From: Jim Evins Date: Sun, 27 Sep 2009 02:52:01 +0000 (-0400) Subject: Reorganized glabels_2_2 branch so that it is the top-level glabels directory, X-Git-Tag: glabels-2_2_6~21 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9ebfc492936b30b4095ae458278e63c51caf3f67;p=glabels Reorganized glabels_2_2 branch so that it is the top-level glabels directory, instead of having a glabels2 subdirectory. --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 00000000..d83a63f5 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,182 @@ +gLabels Author +============== + +Jim Evins + +Acknowledgments +=============== + +- The GNU Barcode Library provides a large chunk of the barcode functionality +and is distributed with glabels. See ./barcode-0.98/README for more +information. The author: + + Alessandro Rubini + +- The iec16022 library provides encoding for 2D barcodes. See +iec16022-0.2.1/README for more information. + +- Glabels includes modified versions of several widgets from the GAL library. +These are copyright: + + * Copyright 2000, 2001, Ximian, Inc. + * Copyright 2000, Michael Levy + * Copyright 2001, Almer S. Tigelaar + +- Glabels includes a modified version of the gimpchainbutton widget from the +gimp, as well as several stock icons from the gimp's default theme. +These are copyright: + + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * Copyright (C) 1999-2000 Sven Neumann + +Glabels includes contributions from: + Frederic Ruaudel + Emmanuel Pacaud + Wayne Schuller + Austin Henry -- EDS and vcard backends + nestor di -- excellent splash screen + that first appeared in + 0.4.3: + Darren Warner + Javier Donaire Segarra + Alessandro Zummo + José Dapena Paz + Akkana + Dag Wieers + Mário Meyer + Peter Cherriman + +Translations: + + Olivier Berger -- French (original) + Florent Morel -- French (2.0.2) + Claude Paroz -- French (2.1.4) + Marcus Bauer -- German (original) + Christian Neumair -- German (1.89.1) + Mario Blättermann -- German (2.2.5) + Takeshi AIHANA -- Japanese + Paulo Rogério Ormenese -- Brazilian Portuguese + Víctor Moral -- Spanish translations + sergio rivadero -- Spanish Translations (2.0.3) + Vitaly Lipatov -- Russian translations + Shell, Hin-lik Hung -- Chinese Translations + Arkadiusz Lipiec -- Polish Translations + David Makovský (Yakeen) -- Czech Translations + Zbynek Mrkvicka -- Czech Translations (2.0.3) + Mancio -- Italian Translations + Daniele Medri -- Italian Translations (2.0.3) + Antonio C. Codazzi "la Filozofo" -- Esperanto + +The following people have submitted label templates or information about +particular products (I apologize if I have missed anybody): + + Hap + Olivier Berger + Marcus Bauer + Jochen Hein + Jonathan Buzzard + Jeff Davis + Ludger Solbach + Darren Ross + George Mitchell + Douglas Bollinger + Tim Jackson + John Stoffel + Dany De Bontridder + Andy Longton + Bostjan Muller + John Helms + no-exit + Mozilla from marela + Holger + Bill Tihen + Dan Gray + Keith Hudson + Tamas Bondar + George Mitchell + Erich Pfennig + Gwen Patton + Miek Gieben + Joerg Schmitz-Linneweber + David Makovský + Oliver Schwank + Akkana + Ted Poe + hans-helmut.belter + Uli Wachowitz + Stephan Hegel + Holger Reinmann + Michael Wojciechowski + Jim Mueller + Mark Fullalove + Zamiel Al'Shaitan + Philip Paeps + Bryan Fields + Martin Klaffenboeck + Lauri Ampuja + Allan Wind + Mark S Burgunder + Christian Holländer + Marvin P. Dickens + Julien BLACHE + James D Strandboge + Linas Jakucionis + Henrik Brix Andersen + Nigel Titley + Sean 'Shaleh' Perry + Anthony Brockman + Thorsten Hirsch + John Ross + Mike Machado + Rob Elshire + Niels + Ernst W. Winter + regis rampnoux + Sven Salzwedel + Dick Middleton + Ian Peake + Wayne Schuller + Thomas Vill + Fred Bacon + JBadger + Frank Altpeter + Matthew J. Lockner + Larry Harriman + Juan Carlos Valero + Nick Hill + Ali Akcaagac + Dan Clark + Peter L. Berghold + Vitaly Lipatov + Steve Saxon + Roman Kreisel + Steve Reppucci + Lionel CONS + Richard Lance + Anand Kumria + Alexandre Sauvé + Ironblade + Matthias Mailänder + Bernhard Walle + Stephen Hilliard + Alessandro Zummo + Herbert Straub + Dennis Böckmann + Anon + D. Leitner + Georg Ostertag + Manuel Siggen + David Huber + Harald Welte + Richard Rothwell + Gernot Hassenpflug + Pau Ruŀlan Ferragut + Richard Hurt + Phil Endecott + Koen Wybo + Mark Moeller + Bertus W. + Oliver Friedrich + + +And many others for their many helpful suggestions and bug reports -- thanks. diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..d60c31a9 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + 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 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/COPYING-DOCS b/COPYING-DOCS new file mode 100644 index 00000000..b42936be --- /dev/null +++ b/COPYING-DOCS @@ -0,0 +1,355 @@ + GNU Free Documentation License + Version 1.1, March 2000 + + Copyright (C) 2000 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +written document "free" in the sense of freedom: to assure everyone +the effective freedom to copy and redistribute it, with or without +modifying it, either commercially or noncommercially. Secondarily, +this License preserves for the author and publisher a way to get +credit for their work, while not being considered responsible for +modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work that contains a +notice placed by the copyright holder saying it can be distributed +under the terms of this License. The "Document", below, refers to any +such manual or work. Any member of the public is a licensee, and is +addressed as "you". + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (For example, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, whose contents can be viewed and edited directly and +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup has been designed to thwart or discourage +subsequent modification by readers is not Transparent. A copy that is +not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML designed for human modification. Opaque formats include +PostScript, PDF, proprietary formats that can be read and edited only +by proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML produced by some word processors for output +purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies of the Document numbering more than 100, +and the Document's license notice requires Cover Texts, you must enclose +the copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a publicly-accessible computer-network location containing a complete +Transparent copy of the Document, free of added material, which the +general network-using public has access to download anonymously at no +charge using public-standard network protocols. If you use the latter +option, you must take reasonably prudent steps, when you begin +distribution of Opaque copies in quantity, to ensure that this +Transparent copy will remain thus accessible at the stated location +until at least one year after the last time you distribute an Opaque +copy (directly or through your agents or retailers) of that edition to +the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has less than five). +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section entitled "History", and its title, and add to + it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. In any section entitled "Acknowledgements" or "Dedications", + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section as "Endorsements" + or to conflict in title with any Invariant Section. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections entitled "History" +in the various original documents, forming one section entitled +"History"; likewise combine any sections entitled "Acknowledgements", +and any sections entitled "Dedications". You must delete all sections +entitled "Endorsements." + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, does not as a whole count as a Modified Version +of the Document, provided no compilation copyright is claimed for the +compilation. Such a compilation is called an "aggregate", and this +License does not apply to the other self-contained works thus compiled +with the Document, on account of their being thus compiled, if they +are not themselves derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one quarter +of the entire aggregate, the Document's Cover Texts may be placed on +covers that surround only the Document within the aggregate. +Otherwise they must appear on covers around the whole aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License provided that you also include the +original English version of this License. In case of a disagreement +between the translation and the original English version of this +License, the original English version will prevail. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document 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. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation 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. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no +Front-Cover Texts, write "no Front-Cover Texts" instead of +"Front-Cover Texts being LIST"; likewise for Back-Cover Texts. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff --git a/COPYING-LIBGLABELS b/COPYING-LIBGLABELS new file mode 100644 index 00000000..161a3d1d --- /dev/null +++ b/COPYING-LIBGLABELS @@ -0,0 +1,482 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: 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 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., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, 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! diff --git a/COPYING.README_FIRST b/COPYING.README_FIRST new file mode 100644 index 00000000..2d76f43e --- /dev/null +++ b/COPYING.README_FIRST @@ -0,0 +1,28 @@ + The gLabels official distribution is an aggregate of several components. + Each component is licensed as follows + + The gLabels application core, and other portions of the official gLabels + distribution not explicitly licensed otherwise, are licensed under + the GNU GENERAL PUBLIC LICENSE (GPL); either version 2 of the License, or + (at your option) any later version -- see the 'COPYING' file in this + directory for details. + + The libglabels library, located in the "libglabels/" subdirectory, is + licensed under the GNU LESSER GENERAL PUBLIC LICENSE (LGPL); either + version 2 of the License, or (at your option) any later version -- see + the 'COPYING-LIBGLABELS' in this directory for details. + + The gLabels and libglabels documentation, located in the "docs/" and "help/" + subdirectories, is licensed under the GNU FREE DOCUMENTATION LICENSE (GFDL) + with no Invariant Sections; either version 1.1 or (at your option) any + later version -- see 'COPYING-DOCS' in this directory for details. + + The "barcode-0.98/" and "iec16022-0.2.1/" subdirectories contain 3rd party + libraries, each licensed under the GNU GENERAL PUBLIC LICENSE (GPL); either + version 2 of the License, or (at your option) any later version -- see the + 'LICENSE' or 'COPYING' file in each of these directories for details. + + The XML files in the "data/templates/" subdirectory constitute the glabels + label database. This database is a simple collection of facts so it is + therefore considered to be public domain and can be used for any purpose. + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 00000000..eea2a733 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,4289 @@ +2009-04-29 Jim Evins + + * NEWS: + * configure.in: + * docs/libglabels/libglabels-decl-list.txt: + * gtk-doc.make: + * src/ui-commands.c: (gl_ui_cmd_help_about): + Prepare for 2.2.5 release. + +2009-04-29 Jim Evins + + * data/templates/avery-iso-templates.xml: + * data/templates/misc-iso-templates.xml: + * data/templates/misc-us-templates.xml: + Make sure new descriptions are marked translatable. + +2009-04-29 Jim Evins + + * data/templates/avery-iso-templates.xml: + * data/templates/misc-iso-templates.xml: + * data/templates/misc-us-templates.xml: + Caught up on user submitted templates. + * AUTHORS: + Acknowledgements for above templates. + +2009-04-29 Jim Evins + + * po/de.po: + Updated german translation (Mario Blättermann). + +2009-04-29 Jim Evins + + * src/color.c: (gl_color_to_gdk_color), (gl_color_from_gdk_color): + * src/mygal/widget-color-combo.c: (color_combo_new): + * src/object-editor.c: (gl_object_editor_construct_color_combo): + * src/ui-property-bar.c: (gl_ui_property_bar_construct_color_combo): + Bug #2760830. Display correct preview color in color combos when default + color selected. + +2009-04-28 Jim Evins + + * data/glade/object-editor.glade: + * data/glade/prefs-dialog.glade: + * data/glade/property-bar.glade: + * data/glade/template-designer.glade: + * src/wdgt-print-copies.c: (gl_wdgt_print_copies_construct), + (first_spin_cb), (last_spin_cb): + * src/wdgt-print-merge.c: (gl_wdgt_print_merge_construct): + Zero out adjustment->page_size for all spinbuttons. With gtk-2.14 this causes + many warning and with gtk-2.16 this actually breaks the spinbuttons. + +2009-01-07 Jim Evins + + * src/critical-error-handler.c: (critical_error_handler): + * src/ui-commands.c: (gl_ui_cmd_help_contents): + * src/warning-handler.c: (warning_handler): + * src/view.c: (selection_received_cb): + Compile without warning with additional CFLAGS of + -O1 -Wall -Wformat=2. + +2009-01-02 Jim Evins + + * COPYING.README_FIRST: + Fixed typo. + +2008-12-27 Jim Evins + + * data/templates/avery-iso-templates.xml: + * data/templates/avery-other-templates.xml: + * data/templates/avery-us-templates.xml: + * data/templates/brother-other-templates.xml: + * data/templates/misc-iso-templates.xml: + * data/templates/misc-other-templates.xml: + * data/templates/zweckform-iso-templates.xml: + Make sure all descriptions are marked as translatable. + +2008-12-27 Jim Evins + + * de.po: + Updated german translation (Mario Blättermann) + * AUTHORS: + Updated credits to reflect above translation. + * data/glade/object-editor.glade: + * data/glade/prefs-dialog.glade: + * data/glade/template-designer.glade: + Removed "translatable" attribute from whitespace strings, + which are used only to help layout. + +2008-12-22 Jim Evins + + * NEWS: + * configure.in: + Prepare for 2.2.4 release. + +2008-12-21 Jim Evins + + * data/templates/avery-us-templates.xml: + * data/templates/misc-iso-templates.xml: + A couple of recent template submissions. + * AUTHORS: + Acknowledgements for above templates. + +2008-12-21 Jim Evins + + * src/view.c: (motion_notify_event_cb), (button_press_event_cb): + Don't check for handles on aggregate selections. + +2008-12-18 Jim Evins + + * src/view.c: (selection_received_cb): + Fixed paste bug that caused a duplicate phantom view_object to be created for + each new label_object. This is because the view now (as of r673) the view + monitiors the label for new objects and creates view_objects automatically. + +2008-12-14 Jim Evins + + * po/POTFILES.in: + Bug #2395628. Reconciled POTFILES.in with current files. + +2008-12-14 Jim Evins + + * src/ui.c: (gl_ui_new): + Bug #2395628. Fixed i18n for application shell. + +2008-12-14 Jim Evins + + * configure.in: + Bug #2316013. Added PKG_PROG_PKG_CONFIG. + +2008-11-15 Jim Evins + + * libglabels/db.c: (lgl_db_register_template): + * libglabels/xml-template.c: + (lgl_xml_template_parse_template_node): + * src/glabels-batch.c: + * src/view-text.c: (gl_view_text_create_button_press_event): + Fixed several issues such as possible use of uninitialized variables found with "-O1 -Wall". + +2008-11-09 Jim Evins + + * data/templates/misc-iso-templates.xml: + Another user submitted template. + +2008-10-27 Jim Evins + + * data/templates/avery-us-templates.xml: + * data/templates/misc-iso-templates.xml: + * data/templates/zweckform-iso-templates.xml: + Caught up on user submitted templates. + * AUTHORS: + Acknowledgements for above templates. + +2008-10-23 Jim Evins + + * src/label-text.c: (set_font_family): + * src/object-editor-text-page.c: + (gl_object_editor_prepare_text_page), + (gl_object_editor_set_font_family): + * src/prefs-dialog.c: (construct_object_page), + (update_object_page_from_prefs): + * src/ui-property-bar.c: (gl_ui_property_bar_construct), + (reset_to_default_properties): + * src/util.c: (gl_util_get_font_family_list): + * src/util.h: + Bug #1902275 and Bug #2186214. Cache font list so that it is not re-created everytime + the list is requested. + * src/object-editor-text-page.c: (gl_object_editor_set_font_family): + Don't change font-family if it hasn't actually changed. + +2008-08-29 Jim Evins + + * src/file.c: (gl_file_open), (gl_file_save_as): + Bug #2069668. Corrected button order in Open and "Save as" + dialogs. + +2008-08-18 Jim Evins + + * NEWS: + * configure.in: + * docs/libglabels/tmpl/paper.sgml: + Prepare for 2.2.3 release. + +2008-08-17 Jim Evins + + * data/dtd/glabels-2.2.dtd: + * data/templates/paper-sizes.xml: + * libglabels/db.c: (lgl_db_init): + * libglabels/paper.c: (lgl_paper_new), (lgl_paper_dup), (lgl_paper_free): + * libglabels/paper.h: + * libglabels/xml-paper.c: (lgl_xml_paper_parse_paper_node): + * src/print-op.c: (set_page_size): + Bug #2049431. Always explicitely set page size. Added pwg_size field (PWG 5101.1-2002 + size specification) to the libglabels paper database to allow the page size to be + communicated to GtkPrintOp un-ambiguously. + +2008-07-25 Jim Evins + + * src/object-editor-size-page.c: (size_reset_cb), + (gl_object_editor_set_max_size): + Bug #1993550. Set size limits based on longest side of label. + +2008-07-19 Jim Evins + + * configure.in: + * src/mygal/Makefile.am: + Make sure libtool handles library dependencies for mygal + properly. + +2008-05-21 Jim Evins + + * src/glabels-batch.c: (main): + Bug #1968653. Initialize prefs subsystem. + +2008-05-09 Jim Evins + + * data/glade/object-editor.glade: + Bug #1959135. A couple of radio buttons somehow became + ungrouped. + +2008-04-04 Jim Evins + + * data/templates/brother-other-templates.xml: + Added categories to existing templates. + * data/templates/misc-other-templates.xml: + Moved dymo templates to their own file. + * data/templates/Makefile.am: + * data/templates/dymo-other-templates.xml: + Additional dymo templates provided by Harald Welte . + * AUTHORS: + Acknowledgement for above templates. + +2008-03-24 Jim Evins + + * src/xml-label.c: (xml_doc_to_label): + Bug #1872584. Don't refuse to parse label file if namespace is + unrecognized -- it may be from a newer version of glabels. + +2008-03-15 Jim Evins + + * data/templates/Makefile.am: + * data/templates/brother-other-templates.xml: + Added brother templates. + * src/cairo-markup-path.c: (gl_cairo_markup_margin_rect_path), + (gl_cairo_markup_margin_cd_path): + * src/view.c: (draw_markup_layer): + Fixed markup drawing errors when label is rotated. + +2008-03-03 Jim Evins + + * configure.in: + * ko.po: + Added korean translation provided by xein@naver.com. + +2008-02-21 Jim Evins + + * src/ui.c: + Last minute bug fix for 2.2.2 release. + Fixed typo that prevented "Save" from being deactivated when + document is not modified. + +2008-02-21 Jim Evins + + * NEWS: + * configure.in: + Prepare for 2.2.2 release. + +2008-02-18 Jim Evins + + * src/prefs-model.c: (gl_prefs_model_save_settings), + (gl_prefs_model_load_settings): + Set default units for file output. + +2008-02-18 Jim Evins + + * help/C/glabels.xml: + Fixed example template. + +2008-02-16 Jim Evins + + * AUTHORS: + * data/templates/avery-iso-templates.xml: + * data/templates/avery-us-templates.xml: + * data/templates/misc-iso-templates.xml: + * data/templates/misc-us-templates.xml: + Caught up on user submitted templates. + +2008-02-04 Jim Evins + + * src/view-image.c: (update_object_from_editor_cb): + Bug #1886438. Don't update the image size unless it is actually + triggered by a change in image source. The result of this bug + was that any attempt to edit the size spinboxes, immediately + reset the size. + +2008-02-03 Jim Evins + + * src/label-image.c: (gl_label_image_class_init), (set_size): + Enforce minimum size for images. + +2008-02-03 Jim Evins + + * src/object-editor-lsize-page.c: (gl_object_editor_set_max_lsize): + * src/object-editor-private.h: + * src/object-editor-shadow-page.c: + (gl_object_editor_set_max_shadow_offset): + * src/object-editor-size-page.c: (gl_object_editor_set_max_size): + * src/object-editor.c: (gl_object_editor_finalize), + (gl_object_editor_new), (gl_object_notebook_construct_valist), + (label_changed_cb): + * src/object-editor.h: + * src/ui-sidebar.c: (gl_ui_sidebar_construct): + * src/view-barcode.c: (construct_properties_editor): + * src/view-box.c: (construct_properties_editor): + * src/view-ellipse.c: (construct_properties_editor): + * src/view-image.c: (construct_properties_editor): + * src/view-line.c: (construct_properties_editor): + * src/view-object.c: (gl_view_object_finalize): + * src/view-text.c: (construct_properties_editor): + Move update_editor_from_label callback from individual view objects + to the object editor, so that signals can be disconnected when + object editor is finalized. + * src/view-text.c: (gl_view_text_create_button_press_event): + Fixed bug that caused multiple view objects to be created for a + single text object. This bug would manifest itself as a crash + when deleting multi-object selections which included text objects. + +2008-01-31 Jim Evins + + * src/label-barcode.c: (draw_object): + Fixed rendering problem when "Invalid data" is displayed when text + object is lower in stacking order. + +2008-01-30 Jim Evins + + * src/label-text.c: (get_size), (draw_object), (draw_shadow): + Don't turn off cairo_hint_metrics. This causes serious issues with + bitmap fonts. + +2008-01-29 Jim Evins + + * src/print-op.c: (gl_print_op_construct), + (gl_print_op_construct_batch), (set_page_size): + Explicitly set page size for "other" page sizes. + +2008-01-25 Jim Evins + + * src/bc.c: + Fixed Code128C backend parameters. + * src/label-barcode.c: (get_size): + Bug #1766425. If barcode is not renderable with either + input data or default data, use a default size. Also + fixed small leak. + +2008-01-22 Jim Evins + + * NEWS: + * configure.in: + Preparation for 2.2.1 release. + +2008-01-16 Jim Evins + + * src/print.c: (print_label): + Bug #1872568. Don't apply special transforms (rotate and + mirror) to clipping region or outline. + +2008-01-01 Jim Evins + + * src/util.c: + Sort font lists alphabetically. + +2008-01-01 Jim Evins + + * src/merge-evolution.c: + Do a case-insensitive sort. + +2008-01-01 Jim Evins + + * src/merge-evolution.c: + Sort evolution by "file_under" field. Original patch provided + by Peter Cherriman in + Patch #1860423. + * AUTHORS: + Added acknowledgement for above patch. + +2007-12-25 Jim Evins + + * glabels.spec.in: + Fix spec file. + +2007-12-25 Jim Evins + + * MESSAGE-OF-DOOM: + Removed for 2.2 stable branch. + * Makefile.am: + * NEWS: + * configure.in: + Prepare for 2.2.0 release. + +2007-12-21 Jim Evins + + * COPYING.LIBGLABELS: + * COPYING.README_FIRST: + * README: + Updating license information to make more complete and understandable. + +2007-12-16 Jim Evins + + * configure.in: + Updated version to 2.pre2. + * help/C/glabels.xml: + Updated documentation. + * src/ui-commands.c: (gl_ui_cmd_help_about): + Updated copyright string. + +2007-12-15 Jim Evins + + * data/glade/object-editor.glade: + Removed any GtkTable that contained a GtkComboBox because the size of + the combo box was not constrained properly. This sacrifices the nice + orderly labels for combo boxes that don't extend beyond the edge of the + window. + +2007-12-15 Jim Evins + + * libglabels/db.c: (lgl_db_lookup_template_from_name): + * src/object-editor.c: (gl_object_editor_finalize): + * src/wdgt-media-select.c: (gl_wdgt_media_select_finalize): + Fixed several small memory leaks. + +2007-12-14 Jim Evins + + * libglabels/db.c: + Optimize template search by name by using a GHashTable. + * src/mini-preview-pixbuf-cache.c: + * src/mini-preview-pixbuf-cache.h: + Store one pixbuf per template, but use a key for each alias. + * src/wdgt-media-select.c: + Optimize loading of tree data, thus optimizing the "new label" dialog. + +2007-12-12 Jim Evins + + * data/templates/avery-us-templates.xml: + More templates and aliases. + +2007-12-08 Jim Evins + + * TODO: + More prep for 2.1.5/2.2.0. + +2007-12-08 Jim Evins + + * NEWS: + * README: + * TODO: + * configure.in: + Preparation for 2.1.5. + +2007-12-08 Jim Evins + + * docs/libglabels/libglabels-decl-list.txt: + * docs/libglabels/libglabels-docs.sgml: + * docs/libglabels/libglabels-sections.txt: + * docs/libglabels/libglabels-undocumented.txt: + * docs/libglabels/tmpl/db.sgml: + * docs/libglabels/tmpl/str.sgml: + * libglabels/str.c: + Documentation cleanup for libglabels. + +2007-11-29 Jim Evins + + * libglabels/db.h: + * libglabels/db.c: + Added lgl_db_does_template_name_exist(). + In lgl_db_lookup_template_from_name() substitute brand/part of new template from + requested alias. + * src/prefs-model.c: + Proof read recent templates -- make sure they still exist. + * src/wdgt-media-select.c: + Default to "search all templates" tab if no recent templates found. + +2007-11-28 Jim Evins + + * data/glade/wdgt-media-select.glade: + * src/wdgt-media-select.c: + Added tabbed notebook to allow selection of recent template versus searching the + entire database. + + +2007-11-26 Jim Evins + + * libglabels/Makefile.am: + * libglabels/libglabels.h: + Make str.h public. + * src/label.c: + * src/prefs-dialog.c: + * src/prefs-model.c: + * src/prefs-model.h: + * src/prefs.c: + * src/prefs.h: + Added tracking of recently used templates. + +2007-11-20 Jim Evins + + * data/glade/template-designer.glade: + * src/template-designer.c: + Added warning icon when match brand and part match an existing template. + +2007-11-18 Jim Evins + + * libglabels/Makefile.am: + * libglabels/str.h: + * libglabels/str.c: + Added lgl_str_utf8_casecmp(). + * libglabels/libglabels-private.h: + Use lgl_str_utf8_casecmp() for UTF8_EQUAL macro -- do case insensitive comparisons. + * libglabels/db.c: (lgl_db_get_brand_list): + Use lgl_str_utf8_casecmp() to determine if we have seen brand before when building + brand list. + +2007-11-18 Jim Evins + + * data/glade/template-designer.glade: + * src/template-designer.c: + Don't advance past name page, if brand and part match an existing template. + +2007-11-18 Jim Evins + + * libglabels/db.c: (lgl_db_register_template), (read_templates): + When registering a new template, don't add to "User defined" category before + writing to file. Add to "User defined" category when reading from "~/.glabels" + directory instead. This will allow legacy templates (and manually created + templates) to be automatically added to the "user defined" category. + * libglabels/xml-template.c: + (lgl_xml_template_create_template_node): + Fixed typo/bug causing brand to be wrong. + +2007-11-16 Jim Evins + + * libglabels/db.c: + * libglabels/db.h: + Added return codes to lgl_db_register_template(). Added lgl_db_does_template_exist() + function. Automatically create "User defined" category and add to all user + registered templates. + * libglabels/xml-template.c: + * libglabels/xml-template.h: + Return number of bytes written from lgl_xml_template_write_templates_to_file() and + lgl_xml_template_write_template_to_file(). + * docs/libglabels/libglabels-decl-list.txt: + * docs/libglabels/libglabels-sections.txt: + * docs/libglabels/libglabels-undocumented.txt: + * docs/libglabels/tmpl/db.sgml: + * docs/libglabels/tmpl/xml-template.sgml: + Update documentation to reflect above changes. + +2007-10-28 Jim Evins + + * libglabels/xml-template.c: + Remove any leading white space from part #s when parsing old names. + * src/mini-preview-pixbuf-cache.c: + If name isn't in cache add it. + +2007-10-26 Jim Evins + + * libglabels/Makefile.am: + * libglabels/category.c: + * libglabels/category.h: + * libglabels/db.c: + * libglabels/db.h: + * libglabels/libglabels-private.h: + * libglabels/libglabels.h: + * libglabels/paper.c: + * libglabels/paper.h: + * libglabels/template.c: + * libglabels/template.h: + * libglabels/xml-template.c: + Another pass at screwing with the libglabels API. Moved all + database related stuff to db.[ch]. + * docs/libglabels/libglabels-decl-list.txt: + * docs/libglabels/libglabels-docs.sgml: + * docs/libglabels/libglabels-sections.txt: + * docs/libglabels/libglabels-undocumented.txt: + * docs/libglabels/tmpl/category.sgml: + * docs/libglabels/tmpl/db.sgml: + * docs/libglabels/tmpl/init.sgml: + * docs/libglabels/tmpl/libglabels-unused.sgml: + * docs/libglabels/tmpl/paper.sgml: + * docs/libglabels/tmpl/template-construction.sgml: + * docs/libglabels/tmpl/template-db.sgml: + * docs/libglabels/tmpl/template-misc.sgml: + * docs/libglabels/tmpl/template-struct.sgml: + * docs/libglabels/tmpl/template.sgml: + Updated documentation to reflect above changes to libglabels API. + * src/file.c: + * src/glabels-batch.c: + * src/glabels.c: + * src/mini-preview-pixbuf-cache.c: + * src/prefs-model.c: + * src/print.c: + * src/template-designer.c: + * src/wdgt-media-select.c: + * src/wdgt-mini-preview.c: + * src/wdgt-rotate-label.c: + * src/xml-label-04.c: + * src/xml-label.c: + Reconciled usage with above libglabels API changes. + +2007-10-21 Jim Evins + + * data/glade/wdgt-media-select.glade: + * src/wdgt-media-select.c: + Added brand to filter settings. + +2007-10-21 Jim Evins + + * data/dtd/glabels-2.2.dtd: + Forgot to replace Alias name attribute with brand and part attributes. + * data/templates/avery-iso-templates.xml: + * data/templates/avery-other-templates.xml: + * data/templates/avery-us-templates.xml: + * data/templates/misc-iso-templates.xml: + * data/templates/misc-other-templates.xml: + * data/templates/misc-us-templates.xml: + * data/templates/zweckform-iso-templates.xml: + Replaced all name attributes with brand/part attribute pairs. + +2007-10-20 Jim Evins + + * src/stock-pixmaps/*.png + Updated icons to use Tango color palette. + +2007-10-20 Jim Evins + + * data/dtd/Makefile.am: + * data/dtd/glabels-2.0.dtd: + * data/dtd/glabels-2.2.dtd: + Rename glabels-2.0.dtd to glabels-2.2.dtd. Added brand and part attributes to + template node. + * libglabels/template.c: + * libglabels/template.h: + * libglabels/xml-template.c: + * libglabels/xml.h: + Added brand and part attributes to template and alias structures and nodes. + * src/file.c: + * src/label.c: + * src/mini-preview-pixbuf-cache.c: + * src/template-designer.c: + * src/wdgt-media-select.c: + Use modified libglabels API. + * docs/libglabels/libglabels-decl-list.txt: + * docs/libglabels/libglabels-sections.txt: + * docs/libglabels/libglabels-undocumented.txt: + * docs/libglabels/tmpl/template-construction.sgml: + * docs/libglabels/tmpl/template-db.sgml: + * docs/libglabels/tmpl/template-struct.sgml: + Update libglabels documentation to reflect above modifications. + +2007-10-14 Jim Evins + + * docs/libglabels/libglabels-decl-list.txt: + * docs/libglabels/libglabels-sections.txt: + * docs/libglabels/libglabels-undocumented.txt: + * docs/libglabels/tmpl/category.sgml: + * libglabels/category.c: + * libglabels/category.h: + Added lgl_category_get_id_list() and lgl_category_free_id_list() to have + parity with paper functions. + +2007-10-12 Jim Evins + + * docs/libglabels/libglabels-decl-list.txt: + * docs/libglabels/libglabels-sections.txt: + * docs/libglabels/libglabels-undocumented.txt: + * docs/libglabels/tmpl/category.sgml: + * docs/libglabels/tmpl/enums.sgml: + * docs/libglabels/tmpl/libglabels-unused.sgml: + * docs/libglabels/tmpl/paper.sgml: + * docs/libglabels/tmpl/template-struct.sgml: + * libglabels/init.c: + * libglabels/template.c: + * libglabels/template.h: + Another pass at fleshing out the libglabels documentation. + * src/cairo-label-path.c: + * src/cairo-markup-path.c: + * src/label.c: + * src/mini-preview-pixbuf.c: + * src/print-op.c: + * src/print.c: + * src/view.c: + * src/wdgt-media-select.c: + * src/wdgt-mini-preview.c: + * src/wdgt-print-copies.c: + * src/wdgt-print-merge.c: + * src/wdgt-rotate-label.c: + Removed lgl_template_get_first_frame() from libglabels API and all references. + +2007-10-11 Jim Evins + * configure.in: + Extended checks for deprecated symbols. + * libglabels/template.c: + Removed g_strcasecmp references, which are deprecated. + +2007-10-09 Jim Evins + + * src/merge-evolution.c: + Create address book if it does not exist. Also, be more robust about handling + error conditions -- don't just assume GError has been set. + +2007-10-08 Jim Evins + + * libglabels/template.c: + * libglabels/xml-template.c: + * src/template-designer.c: + Missed some symbols with libglabels API work. + +2007-10-01 Jim Evins + + * docs/libglabels/libglabels-decl-list.txt: + * docs/libglabels/libglabels-docs.sgml: + * docs/libglabels/libglabels-sections.txt: + * docs/libglabels/libglabels-undocumented.txt: + * docs/libglabels/tmpl/category.sgml: + * docs/libglabels/tmpl/enums.sgml: + * docs/libglabels/tmpl/init.sgml: + * docs/libglabels/tmpl/libglabels-unused.sgml: + * docs/libglabels/tmpl/paper.sgml: + * docs/libglabels/tmpl/template-construction.sgml: + * docs/libglabels/tmpl/template-db.sgml: + * docs/libglabels/tmpl/template-misc.sgml: + * docs/libglabels/tmpl/template-struct.sgml: + * docs/libglabels/tmpl/template.sgml: + * docs/libglabels/tmpl/xml-category.sgml: + * docs/libglabels/tmpl/xml-template.sgml: + * libglabels/category.h: + * libglabels/init.c: + * libglabels/libglabels-private.h: + * libglabels/paper.h: + * libglabels/template.c: + * libglabels/template.h: + * libglabels/xml-template.h: + Basic documentation framework for libglabels updated. This still needs some + fleshing out. + +2007-09-27 Jim Evins + + * docs/libglabels/libglabels-decl-list.txt: + * docs/libglabels/libglabels-docs.sgml: + * docs/libglabels/libglabels-sections.txt: + * docs/libglabels/libglabels-undocumented.txt: + * docs/libglabels/tmpl/enums.sgml: + * docs/libglabels/tmpl/init.sgml: + * docs/libglabels/tmpl/libglabels-unused.sgml: + * docs/libglabels/tmpl/paper.sgml: + * docs/libglabels/tmpl/template.sgml: + * docs/libglabels/tmpl/xml-paper.sgml: + * docs/libglabels/tmpl/xml-template.sgml: + * docs/libglabels/tmpl/xml.sgml: + * libglabels/Makefile.am: + * libglabels/category.c: + * libglabels/category.h: + * libglabels/enums.h: + * libglabels/init.c: + * libglabels/init.h: + * libglabels/libglabels-private.h: + * libglabels/libglabels.h: + * libglabels/paper.c: + * libglabels/paper.h: + * libglabels/template.c: + * libglabels/template.h: + * libglabels/xml-category.c: + * libglabels/xml-category.h: + * libglabels/xml-paper.c: + * libglabels/xml-paper.h: + * libglabels/xml-template.c: + * libglabels/xml-template.h: + * libglabels/xml.c: + * libglabels/xml.h: + * src/cairo-label-path.c: + * src/cairo-label-path.h: + * src/cairo-markup-path.c: + * src/cairo-markup-path.h: + * src/file.c: + * src/glabels-batch.c: + * src/glabels.c: + * src/label-object.c: + * src/label.c: + * src/label.h: + * src/mini-preview-pixbuf-cache.c: + * src/mini-preview-pixbuf.c: + * src/mini-preview-pixbuf.h: + * src/prefs-dialog.c: + * src/prefs-model.c: + * src/prefs-model.h: + * src/prefs.c: + * src/prefs.h: + * src/print-op.c: + * src/print.c: + * src/template-designer.c: + * src/view-barcode.c: + * src/view-box.c: + * src/view-ellipse.c: + * src/view-image.c: + * src/view-line.c: + * src/view.c: + * src/wdgt-media-select.c: + * src/wdgt-mini-preview.c: + * src/wdgt-mini-preview.h: + * src/wdgt-print-copies.c: + * src/wdgt-print-merge.c: + * src/wdgt-rotate-label.c: + * src/xml-label-04.c: + * src/xml-label.c: + Major cleanup of libglabels API -- this breaks API compatibility with older + development and stable versions -- as far as I know, there are currently + no external users of this library yet. + +2007-09-14 Jim Evins + + * src/marshal.list: + * src/label.c: + * src/label.h: + * src/label-object.c: + * src/label-object.h: + * src/label-barcode.c: + * src/label-ellipse.c: + * src/view.c: + * src/view-object.c: + * src/view-barcode.c: + * src/view-box.c: + * src/view-ellipse.c: + * src/view-image.c: + * src/view-line.c: + * src/view-text.c: + Better separation of model from view. + +2007-08-21 Jim Evins + + * src/print-op.c: (create_custom_widget_cb): + Fix problem with force_outline_flag -- don't override with default. + +2007-08-21 Jim Evins + + * data/dtd/glabels-2.0.dtd: + * libglabels/template.c: + * libglabels/template.h: + * libglabels/xml-template.c: + * src/cairo-markup-path.c: + Added "Markup-rect" element to template format. + +2007-08-21 Jim Evins + + * configure.in: + Changed version to 2.1.pre5svn. + * src/view.c: (draw_markup_layer): + Do a stroke for each markup path, otherwise multiple markups + get connected. + +2007-08-17 Jim Evins + + * configure.in: + Bump libglabels revision numbers for 2.1.4 release. + +2007-08-16 Jim Evins + + * Makefile.am: + Include subdir iec16022-0.2.1. + * NEWS: + * configure.in: + * glabels.spec.in: + Preparation for 2.1.4. + + +2007-08-11 Jim Evins + + * po/POTFILES.in: + Updated file list. + * configure.in: + * po/eo.po: + Added Esperanto translation. Provided by Antonio C. + Codazzi "la Filozofo" . + * po/fr.po: + Updated French translation. Provided by Claude Paroz + . + * AUTHORS: + Updated to reflect above translations. + +2007-08-11 Jim Evins + + * AUTHORS: + * data/templates/avery-iso-templates.xml: + * data/templates/avery-us-templates.xml: + * data/templates/misc-iso-templates.xml: + * data/templates/misc-other-templates.xml: + * data/templates/misc-us-templates.xml: + * data/templates/zweckform-iso-templates.xml: + Caught up with backlog of template submissions. + +2007-08-10 Jim Evins + + * src/bc-postnet.c: (gl_barcode_postnet_new): + * src/bc.c: + Added support for Brazilian CEPNet barcodes. This is simply an + instance of the US POSTNET format with 8 digits. Patch supplied + by Mário Meyer in bug # 1768792. + * AUTHORS: + Updated acknowledgments to reflect above patch and recent shuffling + of underlying technology. + +2007-05-13 Jim Evins + + * src/merge-text.c: (parse_line), (parse_field): + Remove leading and trailing spaces from CSV fields, unless quoted. + +2007-05-09 Jim Evins + + * src/object-editor-bc-page.c: + * src/object-editor-data-page.c: + * src/object-editor-fill-page.c: + * src/object-editor-image-page.c: + * src/object-editor-line-page.c: + * src/object-editor-lsize-page.c: + * src/object-editor-position-page.c: + * src/object-editor-private.h: + * src/object-editor-shadow-page.c: + * src/object-editor-size-page.c: + * src/object-editor-text-page.c: + * src/object-editor.c: + * src/prefs-dialog.c: + * src/template-designer.c: + * src/ui-property-bar.c: + * src/wdgt-media-select.c: + Replaced signal block/unblock pairs with simple flags. This reduces + some code clutter, hopefully making it easier to read. + +2007-05-05 Jim Evins + + * src/template-designer.c: (apply_cb): + Add new template to mini-preview pixbuf cache. + +2007-05-03 Jim Evins + + * src/label-image.c: (gl_label_image_init), (draw_object): + Scale default pixbuf up, to prevent bluring. Use cairo_fill to + render image. + +2007-05-02 Jim Evins + + * src/view.c: (draw_select_region_layer), (motion_notify_event_cb), + (button_release_event_cb): + Removed attempt at rendering optimization by clipping the updates + to areas affected -- this actually seemed to hurt update performance. + +2007-04-30 Jim Evins + + * src/color.h: + * src/color.c: (gl_color_shadow), (gl_color_node_new_default), + (gl_color_node_equal), (gl_color_node_expand): + * src/label-barcode.c: (draw_object): + * src/label-box.c: (draw_object), (draw_shadow): + * src/label-ellipse.c: (draw_object), (draw_shadow): + * src/label-line.c: (draw_object), (draw_shadow): + * src/label-text.c: (draw_object), (draw_shadow): + * src/wdgt-mini-preview.c: (draw_shadow), (draw_labels): + * src/wdgt-rotate-label.c: (drawingarea_update): + Some cleanup to color related code. + +2007-04-30 Jim Evins + + * src/label.h: + Added glLabelRegion structure type. + * src/label-object.c: (gl_label_object_get_extent): + * src/label-object.h: + Modified gl_label_object_get_extent() to fill in a glLabelRegion struct. + * src/view.h: + * src/view.c: (gl_view_update_region), (draw_select_region_layer), + (gl_view_select_region), (gl_view_align_selection_left), + (gl_view_align_selection_right), (gl_view_align_selection_hcenter), + (gl_view_align_selection_top), (gl_view_align_selection_bottom), + (gl_view_align_selection_vcenter), + (gl_view_center_selection_horiz), (gl_view_center_selection_vert), + (gl_view_move_selection), (gl_view_can_selection_text), + (motion_notify_event_cb), (button_press_event_cb), + (button_release_event_cb): + - Reconcile with new gl_label_object_get_extent() API. + - Use glLabelRegion for view->select_region. + - Added gl_view_update_region() to clip updates to region. + - Use gl_view_update_region() during manipulation of view->select_region. + +2007-04-26 Jim Evins + + * src/mini-preview-pixbuf.c: (draw_paper), (draw_label_outlines), + (draw_label_outline): + * src/print.c: (print_crop_marks), (draw_outline): + * src/view-object.c: (gl_view_object_draw_handles): + * src/view.c: (draw_bg_layer), (draw_grid_layer), + (draw_markup_layer), (draw_fg_layer), (draw_select_region_layer): + * src/wdgt-mini-preview.c: (draw_paper), (draw_labels): + * src/wdgt-rotate-label.c: (drawingarea_update): + Added defines for various magic numbers. + +2007-04-25 Jim Evins + + * src/label-text.c: (get_size), (draw_object), (draw_shadow): + Scale text down. Cairo seems to render text too large. + +2007-04-25 Jim Evins + + * src/view.h: + * src/view.c: (gl_view_update), (expose_cb), + (motion_notify_event_cb), (button_press_event_cb), + (button_release_event_cb): + - Try not to let updates get backed up. + - Grab pointer when doing any drag operations. + +2007-04-11 Jim Evins + + * src/cairo-label-path.c: (gl_cairo_label_path), + (gl_cairo_rect_label_path), (gl_cairo_round_label_path), + (gl_cairo_cd_label_path): + * src/cairo-label-path.h: + * src/mini-preview-pixbuf.c: (draw_paper), (draw_label_outlines), + (draw_label_outline): + * src/print.c: (draw_outline), (clip_to_outline): + * src/view.c: (draw_bg_layer), (draw_fg_layer): + * src/wdgt-mini-preview.c: (draw_labels): + * src/wdgt-rotate-label.c: (drawingarea_update): + Modified to universally use gl_cairo_label_path() to create paths + for labels. Added shadow to mini preview in rotate widget. + +2007-04-10 Jim Evins + + * libglabels/template.h: + * libglabels/template.c: (gl_template_get_name_list_unique), + (gl_template_get_name_list_all), (gl_template_from_name): + Modified libglabels to allow you to get a list of all template names + including all aliases or just a list of primary names of each unique + template. + * src/Makefile.am: + * src/file.c: (gl_file_properties): + * src/glabels.c: (main): + * src/mini-preview-pixbuf-cache.h: + * src/mini-preview-pixbuf-cache.c: + * src/wdgt-media-select.c: (gl_wdgt_media_select_construct), + (filter_changed_cb), (load_list): + Added mini-preview pixbuf cache, so that only one mini-preview is + needed for a unique template and gets reused for all aliases. These + pixbufs will also live for the life of the program so they are not + rebuilt everytime a new label dialog is invoked. + * src/mini-preview-pixbuf.c: (draw_paper), + (draw_rect_label_outline), (draw_round_label_outline), + (draw_cd_label_outline): + Removed some comment artifacts. + +2007-04-04 Jim Evins + + * src/mini-preview-pixbuf.c: (gl_mini_preview_pixbuf_new), + (draw_paper), (draw_label_outlines), (draw_rect_label_outline), + (draw_round_label_outline), (draw_cd_label_outline): + * src/wdgt-media-select.c: (load_list): + * src/wdgt-rotate-label.c: (draw_cd_label_outline): + Cosmetic enhancments to mini previews. + +2007-04-04 Jim Evins + + * src/ui-property-bar.c: (gl_ui_property_bar_finalize), + (gl_ui_property_bar_construct): + Save copy of GladeXML tree so that we don't lose tooltips. + +2007-04-02 Jim Evins + + * src/merge-properties-dialog.c: + * src/new-label-dialog.c: + * src/object-editor.c: + * src/prefs-dialog.c: + * src/print-op.c: + * src/template-designer.c: + * src/ui-property-bar.c: + * src/wdgt-media-select.c: + * src/wdgt-rotate-label.c: + Fixed several memory leaks. + +2007-04-01 Jim Evins + + * src/label-text.c: (gl_label_text_init), (copy), + (gl_label_text_set_lines), (buffer_changed_cb), (get_size), + (set_font_family), (set_font_size), (set_font_weight), + (set_font_italic_flag), (set_text_alignment), + (set_text_line_spacing): + Cache object size, so that expensive extent calculations are only done + when needed. + +2007-03-30 Jim Evins + + * src/prefs-model.c: (gl_prefs_model_load_settings): + Default to an unlimited list of recent documents, since this parameter + seems to be pre-filter anyway. + +2007-03-30 Jim Evins + + * src/label-box.c: (draw_shadow): + * src/label-ellipse.c: (draw_shadow): + Added missing shadow fill. + +2007-03-28 Jim Evins + + * src/ui-commands.c: (gl_ui_cmd_file_print): + Unreferencing the print operation sometimes crashes. Just don't do it + right now. + +2007-03-28 Jim Evins + + * src/print-op.c: (gl_print_op_construct), + (gl_print_op_get_settings), (gl_print_op_set_settings), + (gl_print_op_free_settings), (create_custom_widget_cb): + * src/print-op.h: + * src/ui-commands.c: (gl_ui_cmd_file_print): + * src/window.c: (gl_window_init): + * src/window.h: + Save print settings and custom settings between print operations + on the same window. + +2007-03-24 Jim Evins + + * src/object-editor-image-page.c: + (gl_object_editor_prepare_image_page), + (gl_object_editor_set_image), (img_selection_changed_cb): + Workaround for GtkFileChooserButton bug # 327243. This the root + cause for gLabels bug # 1192884. I have actually observed 3 delayed + "selection-changed" signals -- the first 2 return NULL -- this is + what caused the image to reset to the default followed by setting + it back to the original image, trying to fit it into a new bounding + box. This sequence of events is much more evident with the new + cairo rendering. + +2007-03-23 Jim Evins + + Merged all changes from experimental cairo branch to trunk. + Trunk no longer depends on libgnomecanvas or libgnomeprint[ui]. + +2007-03-23 Jim Evins + + * src/label-object.h: + * src/label-object.c: (gl_label_object_class_init), + (gl_label_object_get_raw_size), (gl_label_object_get_size): + Created "get_raw_size" method. + * src/label-barcode.c: (get_size): + * src/xml-label.c: (xml_create_object_text), + (xml_create_object_barcode): + Use new "get_raw_size" method on label-objects when apropos. + * src/label-text.h: + * src/label-text.c: (get_size), (draw_object), (draw_shadow), + (auto_shrink_font_size): + Added "auto shrink" functionality back. + +2007-03-19 Jim Evins + + * src/label-text.c: (draw_object), (draw_shadow): + Don't use negative scales in workaround from previous commit. + + +2007-03-18 Jim Evins + + * src/xml-label.c: + Forgot to remove include of xml-lable-191 in previous commit. + * src/label-text.c: (get_size), (draw_object), (draw_shadow): + Workaround for pango Bug #341481. Render text at device scale, + and scale font size accordingly. Also, don't do any hinting. + +2007-03-18 Jim Evins + + * src/cairo-ellipse-path.c: + * src/cairo-ellipse-path.h: + Forgot to add these new files during last mass commit. + +2007-03-18 Jim Evins + + * src/Makefile.am: + * src/xml-label-191.c: + * src/xml-label-191.h: + Removed -- Very buggy. Version 1.91 is a very old "unstable" version, + so there is no need to keep compatability. + * src/base64.c: + * src/bc-iec16022.c: + * src/cairo-label-path.c: + * src/cairo-label-path.h: + * src/cairo-markup-path.c: + * src/color.c: + * src/debug.c: + * src/file.c: + * src/glabels-batch.c: + * src/glabels.c: + * src/label-barcode.c: + * src/label-box.c: + * src/label-ellipse.c: + * src/label-image.c: + * src/label-line.c: + * src/label-object.c: + * src/label-object.h: + * src/label-text.c: + * src/label.c: + * src/label.h: + * src/merge-properties-dialog.c: + * src/merge.c: + * src/new-label-dialog.c: + * src/object-editor-bc-page.c: + * src/object-editor-data-page.c: + * src/object-editor-edit-page.c: + * src/object-editor-fill-page.c: + * src/object-editor-image-page.c: + * src/object-editor-line-page.c: + * src/object-editor-private.h: + * src/object-editor-shadow-page.c: + * src/object-editor-text-page.c: + * src/object-editor.c: + * src/pixbuf-cache.c: + * src/print-op.c: + * src/print.c: + * src/recent.c: + * src/stock.c: + * src/template-designer.c: + * src/text-node.c: + * src/ui-property-bar.c: + * src/ui.c: + * src/view-barcode.c: + * src/view-box.c: + * src/view-ellipse.c: + * src/view-image.c: + * src/view-line.c: + * src/view-object.c: + * src/view-object.h: + * src/view-text.c: + * src/view.c: + * src/wdgt-media-select.c: + * src/wdgt-print-copies.c: + * src/wdgt-print-merge.c: + * src/window.c: + * src/xml-label-04.c: + * src/xml-label.c: + Many changes, including: + - Move draw methods from view-*() to label-*(). + - Use same drawing code for on screen view and printing. + - Fix all issues exposed with '-Wall -Werror'. + +2007-03-14 Jim Evins + + * src/Makefile.am: + * src/cairo-handle-path.c: + * src/cairo-handle-path.h: + * src/cairo-object-path.c: + * src/cairo-object-path.h: + Removed cairo-handle-path.[ch] and cairo-object-path.[ch]. + * src/view-barcode.c: (gl_view_barcode_class_init), (draw_object), + (object_at): + * src/view-box.c: (gl_view_box_class_init), (draw_object), + (draw_shadow), (object_at): + * src/view-ellipse.c: (gl_view_ellipse_class_init), + (create_ellipse_path), (draw_object), (draw_shadow), (object_at): + * src/view-image.c: (gl_view_image_class_init), (draw_object), + (object_at): + * src/view-line.c: (gl_view_line_class_init), (draw_object), + (draw_shadow), (object_at): + * src/view-object.c: (gl_view_object_draw), (gl_view_object_at), + (create_handle_path), (gl_view_object_draw_handles), + (gl_view_object_handle_at): + * src/view-object.h: + * src/view-text.c: (gl_view_text_class_init), (draw_object), + (draw_shadow), (object_at): + * src/view.c: (motion_notify_event_cb), (button_press_event_cb): + Some restructuring of new code. + +2007-03-12 Jim Evins + + * src/Makefile.am: + * src/cairo-object-path.c: + * src/view-barcode.c: + * src/view-barcode.h: + * src/view.c: + Added barcode object support to view. + +2007-03-12 Jim Evins + + * src/Makefile.am: + * src/view-text.h: + * src/view-text.c: + * src/view.c: + * src/cairo-object-path.c: + * src/cairo-object-path.h: + * src/view-box.c: + * src/view-ellipse.c: + * src/view-image.c: + * src/view-line.c: + * src/view-object.c: + * src/view-object.h: + Added text object support to view. Added object_at method to all + view_objects. + +2007-03-11 Jim Evins + + * src/Makefile.am: + * src/cairo-object-path.c: (gl_cairo_object_path), + (gl_cairo_image_object_path): + * src/view-image.c: (gl_view_image_class_init), + (gl_view_image_finalize), (gl_view_image_new), + (update_editor_from_label_cb), (draw), + (gl_view_image_get_create_cursor), + (gl_view_image_create_button_press_event), + (gl_view_image_create_motion_event), + (gl_view_image_create_button_release_event): + * src/view-image.h: + * src/view.c: (gl_view_construct), (gl_view_object_create_mode), + (selection_received_cb), (motion_notify_event_cb), + (button_press_event_cb), (button_release_event_cb): + Added image object support to view. + +2007-03-11 Jim Evins + + * src/Makefile.am: + * src/cairo-object-path.c: (gl_cairo_object_path), + (gl_cairo_line_object_path): + * src/view-line.c: (gl_view_line_class_init), (gl_view_line_new), + (update_object_from_editor_cb), (update_editor_from_object_cb), + (update_editor_from_label_cb), (draw), + (gl_view_line_get_create_cursor), + (gl_view_line_create_button_press_event), + (gl_view_line_create_motion_event), + (gl_view_line_create_button_release_event): + * src/view-line.h: + * src/view-object.c: (gl_view_object_resize_event): + * src/view.c: (gl_view_construct), (gl_view_object_create_mode), + (selection_received_cb), (motion_notify_event_cb), + (button_press_event_cb), (button_release_event_cb): + Added line object support to view. + * src/cairo-handle-path.c: + Made handles slightly larger. + + +2007-03-11 Jim Evins + + * src/Makefile.am: + * src/cairo-handle-path.c: + * src/cairo-label-path.c: (gl_cairo_rect_label_path), + (gl_cairo_round_label_path), (gl_cairo_cd_label_path): + * src/cairo-markup-path.c: (gl_cairo_markup_margin_rect_path), + (gl_cairo_markup_margin_round_path), + (gl_cairo_markup_margin_cd_path), (gl_cairo_markup_circle_path): + * src/cairo-object-path.c: (gl_cairo_object_path), + (gl_cairo_ellipse_object_path): + * src/label-object.c: (gl_label_object_rotate): + * src/view-box.c: + * src/view-box.h: + * src/view-ellipse.c: (gl_view_ellipse_class_init), + (gl_view_ellipse_new), (update_object_from_editor_cb), + (update_editor_from_object_cb), (update_editor_from_label_cb), + (draw), (gl_view_ellipse_get_create_cursor), + (gl_view_ellipse_create_button_press_event), + (gl_view_ellipse_create_motion_event), + (gl_view_ellipse_create_button_release_event): + * src/view-ellipse.h: + * src/view-object.c: + * src/view-object.h: + * src/view.c: (gl_view_construct), (gl_view_object_create_mode), + (select_object_real), (selection_received_cb), + (motion_notify_event_cb), (button_press_event_cb), + (button_release_event_cb): + * src/view.h: + Added ellipse object support to view. Plus other cleanup. + +2007-03-11 Jim Evins + + * src/view-box.h: + * src/view-box.c: (gl_view_box_get_create_cursor), + (gl_view_box_create_button_press_event), + (gl_view_box_create_motion_event), + (gl_view_box_create_button_release_event): + * src/view-object.c: (gl_view_object_set_view), + (gl_view_object_handle_at): + * src/view.h: + * src/view.c: (gl_view_arrow_mode), (gl_view_object_create_mode), + (motion_notify_event_cb), (button_press_event_cb), + (button_release_event_cb), (key_press_event_cb): + Added creation code for box object. + +2007-03-09 Jim Evins + + * src/view-object.c: (gl_view_object_resize_event): + * src/view-object.h: + * src/view.c: (motion_notify_event_cb): + Fix bugs with resizing transformed objects. + * src/cairo-handle-path.c: (gl_cairo_handle_path): + * src/cairo-object-path.c: (gl_cairo_object_path): + * src/cairo-object-path.h: + * src/label-object.c: (gl_label_object_init), + (gl_label_object_dup), (gl_label_object_get_extent), + (gl_label_object_flip_horiz), (gl_label_object_flip_vert), + (gl_label_object_rotate), (gl_label_object_set_matrix), + (gl_label_object_get_matrix): + * src/label-object.h: + * src/print.c: (draw_object): + * src/view-box.c: + * src/view-highlight.c: + * src/view-highlight.h: + * src/xml-label-191.c: (xml191_parse_object): + * src/xml-label.c: (xml_parse_affine_attrs), + (xml_create_affine_attrs): + Replace libart affine matrices with cairo matrices. + +2007-03-08 Jim Evins + + * src/view-object.h: + * src/view.c: (gl_view_update), (motion_notify_event_cb): + * src/view-object.c: (gl_view_object_handle_at), + (gl_view_object_resize_event): + Added resize code -- still a bit buggy. + +2007-03-07 Jim Evins + + * src/Makefile.am: + * src/cairo-handle-path.c: + * src/cairo-handle-path.h: + * src/view-box.c: (gl_view_box_new): + * src/view-object.c: (gl_view_object_set_object), + (gl_view_object_draw_handles), (gl_view_object_handle_at): + * src/view-object.h: + * src/view.c: (draw_highlight_layer), (select_object_real), + (unselect_object_real), (view_handle_at), (motion_notify_event_cb), + (button_press_event_cb), (button_release_event_cb), + (key_press_event_cb): + * src/view.h: + Added beginnings of object resize handles. + +2007-03-07 Jim Evins + + * src/view.h: + * src/view.c: (gl_view_init), (gl_view_arrow_mode), + (gl_view_object_create_mode), (motion_notify_event_cb), + (button_press_event_cb), (button_release_event_cb), + (key_press_event_cb): + Added move selection support. + +2007-03-05 Jim Evins + + * src/cairo-object-path.c: (gl_cairo_object_path): + * src/view-object.c: (gl_view_object_draw), + (gl_view_object_draw_highlight): + * src/view.c: (view_object_at), (motion_notify_event_cb), + (button_press_event_cb), (button_release_event_cb): + Additional refinements to select logic. + +2007-03-05 Jim Evins + + * src/view.h: + * src/view.c: (gl_view_init), (gl_view_construct), + (label_changed_cb), (draw_layers), (draw_select_region_layer), + (gl_view_select_region), (object_at), (motion_notify_event_cb), + (button_press_event_cb), (button_release_event_cb): + Added initial select region support and context menu. + +2007-03-04 Jim Evins + + * configure.in: + * src/Makefile.am: + * src/debug.c: + * src/debug.h: + * src/file.c: + * src/label.c: + * src/label.h: + * src/print-op.c: + * src/print.c: + * src/ui-commands.c: + * src/view-box.c: + * src/view-box.h: + * src/view-object.c: + * src/view-object.h: + * src/view.c: + * src/view.h: + * src/wdgt-print-copies.c: + * src/wdgt-print-merge.c: + * src/xml-label.c: + Initial port to a raw Cairo canvas. This removes all remaining + dependencies on libgnomecanvas and libgnomeprint[ui]. Basically + the view is becoming a canvas widget in its own right. Still needs + a lot of work. + * src/cairo-label-path.c: + * src/cairo-label-path.h: + * src/cairo-markup-path.c: + * src/cairo-markup-path.h: + * src/cairo-object-path.c: + * src/cairo-object-path.h: + New files to support cairo canvas. + * src/canvas-hacktext.c: + * src/canvas-hacktext.h: + Removed. + +2007-02-18 Jim Evins + + * src/bc.h: + GNOME_FONT_BOOK changed to PANGO_WEIGHT_NORMAL. + +2007-02-14 Jim Evins + + * src/base64.c: + * src/base64.h: + * src/bc-gnubarcode.c: + * src/bc-gnubarcode.h: + * src/bc-postnet.c: + * src/bc-postnet.h: + * src/bc.c: + * src/bc.h: + * src/canvas-hacktext.c: + * src/canvas-hacktext.h: + * src/debug.c: + * src/debug.h: + * src/file.c: + * src/file.h: + * src/glabels.c: + * src/hig.h: + * src/label-barcode.c: + * src/label-barcode.h: + * src/label-box.c: + * src/label-box.h: + * src/label-ellipse.c: + * src/label-ellipse.h: + * src/label-image.c: + * src/label-image.h: + * src/label-line.c: + * src/label-line.h: + * src/label-object.c: + * src/label-object.h: + * src/label-text.c: + * src/label-text.h: + * src/label.c: + * src/label.h: + * src/merge-evolution.c: + * src/merge-evolution.h: + * src/merge-init.c: + * src/merge-init.h: + * src/merge-properties-dialog.c: + * src/merge-properties-dialog.h: + * src/merge-text.c: + * src/merge-text.h: + * src/merge-vcard.c: + * src/merge-vcard.h: + * src/merge.c: + * src/merge.h: + * src/mini-preview-pixbuf.h: + * src/new-label-dialog.c: + * src/new-label-dialog.h: + * src/object-editor-bc-page.c: + * src/object-editor-data-page.c: + * src/object-editor-edit-page.c: + * src/object-editor-fill-page.c: + * src/object-editor-image-page.c: + * src/object-editor-line-page.c: + * src/object-editor-lsize-page.c: + * src/object-editor-position-page.c: + * src/object-editor-private.h: + * src/object-editor-size-page.c: + * src/object-editor-text-page.c: + * src/object-editor.c: + * src/object-editor.h: + * src/pixbuf-cache.c: + * src/pixbuf-cache.h: + * src/prefs-dialog.c: + * src/prefs-dialog.h: + * src/prefs-model.c: + * src/prefs-model.h: + * src/prefs.c: + * src/prefs.h: + * src/print-op.c: + * src/stock.c: + * src/stock.h: + * src/template-designer.c: + * src/text-node.c: + * src/text-node.h: + * src/ui-commands.c: + * src/ui-commands.h: + * src/ui-property-bar.c: + * src/ui-property-bar.h: + * src/ui-sidebar.c: + * src/ui-sidebar.h: + * src/ui-util.c: + * src/ui-util.h: + * src/ui.c: + * src/ui.h: + * src/util.c: + * src/util.h: + * src/view-barcode.c: + * src/view-barcode.h: + * src/view-box.c: + * src/view-box.h: + * src/view-ellipse.c: + * src/view-ellipse.h: + * src/view-highlight.c: + * src/view-highlight.h: + * src/view-image.c: + * src/view-image.h: + * src/view-line.c: + * src/view-line.h: + * src/view-object.c: + * src/view-object.h: + * src/view-text.c: + * src/view-text.h: + * src/view.c: + * src/view.h: + * src/wdgt-chain-button.c: + * src/wdgt-chain-button.h: + * src/wdgt-media-select.c: + * src/wdgt-mini-preview.c: + * src/wdgt-print-copies.c: + * src/wdgt-print-copies.h: + * src/wdgt-print-merge.c: + * src/wdgt-print-merge.h: + * src/wdgt-rotate-label.c: + * src/window.h: + * src/xml-label-04.c: + * src/xml-label-04.h: + * src/xml-label-191.c: + * src/xml-label-191.h: + * src/xml-label.c: + * src/xml-label.h: + + Assorted superficial cleanup. Including: + - Use G_DEFINE_TYPE for all objects. + - Reconcile style of all class initializer functions + - Reconcile style of all finalize functions + - Add emacs mode line to all source files + +2007-02-06 Jim Evins + +Assorted cleanup and removal of deprecated items. + + * src/splash.c: + * src/splash.h: + * src/Makefile.am: + Removed annoying splash screen. + * src/glabels-batch.c: (main): + * src/glabels.c: (main): + Converted from popt to GOption. + * src/object-editor-shadow-page.c: + (gl_object_editor_set_shadow_state): + Removed deprecated method on GtkToggleButton. + * src/ui-commands.c: (gl_ui_cmd_help_about): + Removed dependency on libgnomui/qnome-url.h. + * src/template-designer.c: + Removed dependency on libgnome/gnome-program.h. + + +2007-02-04 Jim Evins + + * src/color.c: + * src/color.h: + * src/prefs-model.c: + * src/print.c: (draw_text_object): + * src/wdgt-mini-preview.c: (gl_wdgt_mini_preview_construct): + Removed GnomeCanvas artifacts from color.[ch] and related modules. + +2007-02-04 Jim Evins + + * src/wdgt-mini-preview.c: + * src/wdgt-mini-preview.h: + Ported widget from GnomeCanvas to Cairo. + +2007-02-03 Jim Evins + + * data/glade/template-designer.glade: + * src/template-designer.c: + * src/template-designer.h: + Ported GnomeDruid to GtkAssistant. Since libglade does not + yet support the GtkAssistant and we derive directly from + the Assistant, the pages are layed out in a GtkNotebook in + the glade description -- we then append each page to the + assistant. + +2007-01-25 Jim Evins + + * data/glade/object-editor.glade: + Added dummy page to notebook, to prevent shadow page from + becoming the default current page at creation. + * src/view-box.c: (construct_properties_editor): + * src/view-ellipse.c: (construct_properties_editor): + * src/view-line.c: (construct_properties_editor): + * src/view-text.c: (construct_properties_editor): + Reconciled order of params. + +2007-01-19 Jim Evins + + * src/label-barcode.h: + * src/label-object.c: (gl_label_object_set_font_weight), + (gl_label_object_set_text_alignment), + (gl_label_object_get_font_weight), + (gl_label_object_get_text_alignment): + * src/label-object.h: + * src/label-text.c: (gl_label_text_instance_init), (copy), + (get_size), (set_font_family), (set_font_weight), + (set_text_alignment), (get_font_weight), (get_text_alignment): + * src/label-text.h: + * src/object-editor-text-page.c: + (gl_object_editor_prepare_text_page), + (gl_object_editor_set_font_family), + (gl_object_editor_set_font_weight), + (gl_object_editor_get_font_weight), + (gl_object_editor_set_text_alignment), + (gl_object_editor_get_text_alignment), + (gl_object_editor_set_text_color): + * src/object-editor.h: + * src/prefs-dialog.c: (construct_object_page), + (update_object_page_from_prefs), (update_prefs_from_object_page): + * src/prefs-model.c: (gl_prefs_model_save_settings), + (gl_prefs_model_load_settings): + * src/prefs-model.h: + * src/print.c: (draw_text_object): + * src/ui-property-bar.c: (gl_ui_property_bar_construct), + (reset_to_default_properties), (update_text_properties), + (font_bold_toggled_cb), (text_align_toggled_cb): + * src/ui-sidebar.c: + * src/util.c: (gl_util_align_to_string), (gl_util_string_to_align), + (gl_util_weight_to_string), (gl_util_string_to_weight), + (gl_util_get_font_family_list), (gl_util_font_family_list_free): + * src/util.h: + * src/view-text.c: (update_object_from_editor_cb), + (update_editor_from_object_cb), (draw_hacktext), (draw_cursor): + * src/view.c: (gl_view_set_selection_text_alignment), + (gl_view_set_default_text_alignment), + (gl_view_get_default_text_alignment): + * src/view.h: + * src/xml-label-04.c: (xml04_parse_text_props): + * src/xml-label-191.c: (xml191_parse_text_props): + * src/xml-label.c: (xml_parse_object_text), + (xml_parse_toplevel_span), (xml_create_object_text), + (xml_create_toplevel_span): + Converted all model internals to Pango. GnomeFont remains in + view until GnomeCanvas can be replaced with a cairo-based canvas. + +2007-01-17 Jim Evins + + * src/Makefile.am: + * src/hig.c: + Deleted hig.c. + * src/hig.h: + * src/wdgt-print-copies.c: (gl_wdgt_print_copies_get_type), + (gl_wdgt_print_copies_construct): + * src/wdgt-print-copies.h: + * src/wdgt-print-merge.c: (gl_wdgt_print_merge_get_type), + (gl_wdgt_print_merge_construct): + * src/wdgt-print-merge.h: + Removed all remaining HIG wrapper widgets. + +2007-01-16 Jim Evins + + * src/Makefile.am: + * src/print-dialog.c: + * src/print-dialog.h: + * src/print-op.c: + * src/print-op.h: + * src/template-designer.c: (print_test_cb): + * src/ui-commands.c: (gl_ui_cmd_file_print): + * src/print.c: + Renamed PrintDialog to PrintOp. Added constructor for batch + printing. + * src/glabels-batch.c: (main): + Converted to use new PrintOp object for printing. + +2007-01-15 Jim Evins + + * data/glade/Makefile.am: + * data/glade/print-custom-widget.glade: + * src/print-dialog.c: + * src/print-dialog.h: + * src/print.c: + * src/print.h: + * src/template-designer.c: (print_test_cb): + * src/ui-commands.c: (gl_ui_cmd_file_print): + * src/wdgt-print-merge.c: (gl_wdgt_print_merge_get_copies): + * src/wdgt-print-merge.h: + * src/window.c: (gl_window_init): + * src/window.h: + Initial conversion to GtkPrintOperation. + Still to do: + - Remove font and other libgnomeprint[ui] from elsewhere + - Add batch initialization of print operation + +2007-01-08 Jim Evins + * configure.in: + Updated dependencies. Set version to 2.1.pre4cvs. + +2007-01-03 Jim Evins + + * src/recent-files/* + Removed EggRecent stuff. + * configure.in: + * src/Makefile.am: + * src/file.c: + * src/recent.c: + * src/recent.h: + * src/ui-commands.c: + * src/ui-commands.h: + * src/ui.c: + Ported from EggRecent to GtkRecentManager. + + +2007-01-02 Jim Evins + + * configure.in: + * iec16022-0.2.1/BUGS: + * iec16022-0.2.1/CHANGELOG: + * iec16022-0.2.1/CREDITS: + * iec16022-0.2.1/INSTALL: + * iec16022-0.2.1/LICENSE: + * iec16022-0.2.1/Makefile.am: + * iec16022-0.2.1/Makefile.dist: + * iec16022-0.2.1/README: + * iec16022-0.2.1/README.glabels: + * iec16022-0.2.1/TODO: + * iec16022-0.2.1/iec16022.1: + * iec16022-0.2.1/iec16022.c: + * iec16022-0.2.1/iec16022ecc200.c: + * iec16022-0.2.1/iec16022ecc200.h: + * iec16022-0.2.1/image.c: + * iec16022-0.2.1/image.h: + * iec16022-0.2.1/reedsol.c: + * iec16022-0.2.1/reedsol.h: + * iec16022-0.2.1/test/testsuite-example.bin: + * iec16022-0.2.1/test/testsuite-example.eps: + * iec16022-0.2.1/test/testsuite-example.hex: + * iec16022-0.2.1/test/testsuite-example.png: + * iec16022-0.2.1/test/testsuite-example.text: + * iec16022-0.2.1/test/testsuite.sh: + Include modified copy of iec16022-0.2.1 to provide encoding + support for datamatrix 2D barcodes. + * src/Makefile.am: + * src/bc-iec16022.c: + * src/bc-iec16022.h: + * src/bc.c: + Added initial datamatrix 2D barcode backend to barcode code. + * INSTALL: + * gtk-doc.make: + Automatic updates to later versions of these files. + +2006-11-28 Jim Evins + + * data/templates/avery-iso-templates.xml: + * data/templates/avery-us-templates.xml: + * data/templates/categories.xml: + * data/templates/misc-iso-templates.xml: + * data/templates/misc-us-templates.xml: + * data/templates/zweckform-iso-templates.xml: + More categorization. + +2006-09-12 Jim Evins + + * data/dtd/glabels-2.0.dtd: + * data/templates/Makefile.am: + * data/templates/avery-iso-templates.xml: + * data/templates/avery-other-templates.xml: + * data/templates/avery-us-templates.xml: + * data/templates/categories.xml: + * data/templates/misc-iso-templates.xml: + * data/templates/misc-other-templates.xml: + * data/templates/zweckform-iso-templates.xml: + * data/glade/Makefile.am: + * data/glade/new-label-dialog.glade: + * data/glade/wdgt-media-select.glade: + * data/glade/wdgt-rotate-label.glade: + * libglabels/Makefile.am: + * libglabels/category.c: + * libglabels/category.h: + * libglabels/libglabels.h: + * libglabels/paper.c: + * libglabels/template.c: + * libglabels/template.h: + * libglabels/xml-category.c: + * libglabels/xml-category.h: + * libglabels/xml-template.c: + Added support for category meta data. + * src/Makefile.am: + * src/file.c: + * src/mini-preview-pixbuf.c: + * src/mini-preview-pixbuf.h: + * src/new-label-dialog.c: + * src/new-label-dialog.h: + * src/wdgt-media-select.c: + * src/wdgt-media-select.h: + * src/wdgt-rotate-label.c: + * src/wdgt-rotate-label.h: + New "new label" dialog. + +2006-05-27 Jim Evins + + * NEWS: + * autogen.sh: + * configure.in: + Preparation for 2.1.3. + * acinclude.m4: + * omf.make: + * xmldocs.make: + Removed. + +2006-05-22 Jim Evins + + * src/print.c: (draw_barcode_object): + Don't print "Invalid barcode data" if data field is empty. Patch provided + by Darren Warner . Fixes Bug #1479839. + * AUTHORS: + Added acknowledgment for above patch. + * src/bc-gnubarcode.c: (gl_barcode_gnubarcode_new): + * src/bc-postnet.c: (postnet_code): + Removed "Invalid barcode data" warnings from stderr. + * src/view-barcode.c: (draw_barcode): + Draw box around barcode extent if data empty or invalid. Center a + message whether the data is empty or invalid in box. + +2006-05-22 Jim Evins + + * src/print.c: (draw_text_object): + Check shadow state when printing text. + +2006-05-20 Jim Evins + + * src/ui-commands.c: (gl_ui_cmd_view_grid_toggle), + (gl_ui_cmd_view_markup_toggle): + Fixed crash when grid or markup have been toggled off during + a previous session. Bug #1434324. + +2006-04-05 Jim Evins + + * src/object-editor.c: (gl_object_editor_set_key_names): + Fixed potential crash when freeing empty key list. + +2006-03-11 Jim Evins + + * src/print.c: (draw_text_object): + * src/view-text.c: (gl_view_text_new), + (construct_properties_editor), (update_object_from_editor_cb), + (update_editor_from_object_cb), (update_editor_from_label_cb), + (draw_hacktext): + Added shadow support to text object. + +2006-02-18 Jim Evins + + * src/print.c: (draw_line_object): + * src/view-line.c: (gl_view_line_new), + (construct_properties_editor), (update_canvas_item_from_object_cb), + (update_object_from_editor_cb), (update_editor_from_object_cb), + (update_editor_from_label_cb): + Added shadow support to line object. + +2006-02-16 Jim Evins + + * src/view-box.c: + Comment changes. + * src/print.c: (draw_ellipse_object): + * src/view-ellipse.c: (gl_view_ellipse_new), + (construct_properties_editor), (update_canvas_item_from_object_cb), + (update_object_from_editor_cb), (update_editor_from_object_cb), + (update_editor_from_label_cb): + Added shadow support to ellipse object. + +2006-02-15 Jim Evins + + * src/label-object.c: + Changed default shadow offsets. + * src/view-box.c: (gl_view_box_new): + Simplified gl_view_box_new() so that is does not duplicate code + in update_canvas_item_from_object_cb(). + +2006-02-07 Jim Evins + + * data/glade/object-editor.glade: + Fixed color groups of color combos. + * src/color.h: + Added default shadow color. + * src/object-editor.c: (gl_object_editor_construct_color_combo): + Added shadow color group. + +2006-02-06 Jim Evins + + * src/object-editor-shadow-page.c: + Forgot to add this file. + * src/view-box.c: (gl_view_box_new), + (update_canvas_item_from_object_cb), (update_editor_from_label_cb): + Update limits on shadow offset spinbuttons. + +2006-01-19 Jim Evins + + * src/merge-evolution.c: (gl_merge_evolution_get_key_list): + Initialize key_list to NULL. + * data/glade/object-editor.glade: + * src/Makefile.am: + * src/color.c: + * src/color.h: + * src/label-object.c: + * src/label-object.h: + * src/object-editor-fill-page.c: + * src/object-editor-private.h: + * src/object-editor.c: + * src/object-editor.h: + * src/xml-label.c: + Created infrastructure for shadow support. + * src/view-box.c: + * src/print.c: + Initial shadow support in box object only. + +2006-01-05 Jim Evins + + * src/merge-properties-dialog.c: (src_changed_cb): + Be extra paranoid before calling strcmp(). + * src/merge.c: (gl_merge_set_src): + Don't make (merge == NULL) a critical error. + +2005-12-22 Jim Evins + + * src/glabels-batch.c: (main): + Compile warning free with gcc 4.0. + +2005-12-21 Jim Evins + + * glabels.spec.in: + Updated example RPM spec file. + +2005-12-21 Jim Evins + + * NEWS: + * configure.in: + Preparation for 2.1.2. + +2005-12-20 Jim Evins + + * src/Makefile.am: + Define unique G_LOG_DOMAIN for glabels. + * src/critical-error-handler.c: (gl_critical_error_handler_init): + * src/warning-handler.c: (gl_warning_handler_init), + (warning_handler): + Register for G_LOG_DOMAIN instead of NULL. + +2005-12-10 Jim Evins + + * src/merge-evolution.c: + * src/merge-vcard.c: + Fixed indentation. + +2005-12-08 Jim Evins + + * libglabels/paper.c: (read_paper_files_from_dir): + * libglabels/template.c: (gl_template_register), + (read_template_files_from_dir): + * libglabels/xml-paper.c: (gl_xml_paper_read_papers_from_file), + (gl_xml_paper_parse_papers_doc): + * libglabels/xml-template.c: + (gl_xml_template_read_templates_from_file), + (gl_xml_template_parse_templates_doc), + (gl_xml_template_parse_template_node), + (xml_parse_label_rectangle_node), (xml_parse_label_round_node), + (xml_parse_label_cd_node), (xml_parse_layout_node), + (xml_parse_markup_margin_node), (xml_parse_markup_line_node), + (xml_parse_markup_circle_node), + (gl_xml_template_write_templates_to_file), (xml_create_label_node): + * libglabels/xml.c: (gl_xml_get_prop_length): + Re-classified g_warnings to g_messages. + * src/Makefile.am: + * src/glabels.c: (main): + * src/warning-handler.c: (gl_warning_handler_init), + (warning_handler): + * src/warning-handler.h: + Added warning message handler to make sure the user is + presented with appropriate non-fatal errors. + * src/critical-error-handler.c: (critical_error_handler): + Changed exit to abort. + * src/bc-gnubarcode.c: (gl_barcode_gnubarcode_new), (render_pass1): + * src/bc-postnet.c: (postnet_code): + * src/bc.c: (id_to_index), (name_to_index): + * src/merge.c: (gl_merge_register_backend), (gl_merge_new): + * src/object-editor.c: (gl_object_notebook_construct_valist): + * src/prefs-dialog.c: (update_locale_page_from_prefs): + * src/prefs.c: (gl_prefs_get_units_per_point), + (gl_prefs_get_units_precision), (gl_prefs_get_units_step_size), + (gl_prefs_get_units_string): + * src/print.c: (draw_outline), (clip_to_outline), (clip_punchouts): + * src/splash.c: (gl_splash): + * src/ui-commands.c: (gl_ui_cmd_help_contents): + * src/view-highlight.c: (gl_view_highlight_new), + (highlight_resizable_box_construct), (object_changed_cb), + (view_scale_changed_cb): + * src/view.c: (draw_label_layer), (draw_bg_fg_layers), + (draw_markup_layer), (draw_markup_margin), + (gl_view_object_create_mode), (canvas_event), + (selection_received_cb): + * src/wdgt-mini-preview.c: (mini_outline_list_new): + * src/wdgt-rotate-label.c: (mini_preview_canvas_update): + * src/xml-label-04.c: (gl_xml_label_04_parse), + (xml04_parse_media_description), (xml04_parse_text_props), + (xml04_parse_barcode_props): + * src/xml-label-191.c: (gl_xml_label_191_parse), + (xml191_parse_objects), (xml191_parse_object), + (xml191_parse_text_props), (xml191_parse_image_props), + (xml191_parse_barcode_props), (xml191_parse_data), + (xml191_parse_sheet), (xml191_parse_label), (xml191_parse_layout), + (xml191_parse_markup): + * src/xml-label.c: (gl_xml_label_open), (gl_xml_label_open_buffer), + (xml_doc_to_label), (xml_parse_label), (xml_parse_objects), + (xml_parse_object_text), (xml_parse_object_image), + (xml_parse_object_barcode), (xml_parse_data), + (xml_parse_toplevel_span), (gl_xml_label_save), + (xml_create_objects): + Re-classified g_warnings to g_messages. + * src/merge-evolution.c: (gl_merge_evolution_open), + (gl_merge_evolution_close), (gl_merge_evolution_get_record): + Use g_warning to output errors encountered while + communicating with the evolution data server + instead of embedding them in the data. + +2005-12-08 Jim Evins + + * libglabels/libglabels-private.h: + Set G_LOG_DOMAIN + * libglabels/paper.c: (read_papers): + * libglabels/template.c: (read_templates): + Made appropriate warnings critical. + * src/Makefile.am: + * src/critical-error-handler.h: + * src/critical-error-handler.c: (gl_critical_error_handler_init), + (critical_error_handler): + Created critical error handler. + * src/glabels.c: (main): + Register critical error handler. + * src/merge-properties-dialog.c: (gl_merge_properties_dialog_init): + * src/object-editor.c: (gl_object_editor_init): + * src/prefs-dialog.c: (gl_prefs_dialog_init): + * src/template-designer.c: (gl_template_designer_init): + * src/ui-property-bar.c: (gl_ui_property_bar_instance_init): + Made appropriate warnings critical. + +2005-11-27 Jim Evins + + * src/merge-evolution.c: (gl_merge_evolution_get_key_list), + (gl_merge_evolution_get_primary_key), + (gl_merge_evolution_get_record): + Don't create "record_key" pseudo-key. Don't populate + fields with null data. + +2005-11-25 Jim Evins + + * src/merge-evolution.c: (gl_merge_evolution_finalize), + (gl_merge_evolution_get_key_list), (gl_merge_evolution_open), + (gl_merge_evolution_get_record), (gl_merge_evolution_copy), + (free_field_list): + Query EDS for all supported fields. Patch provided by + Austin Henry . + +2005-10-29 Jim Evins + + * src/glabels.c: (main): + * src/label-barcode.c: (gl_label_barcode_finalize): + * src/label-text.c: (gl_label_text_finalize), (set_font_family): + * src/label.c: (gl_label_instance_init), (gl_label_finalize): + * src/object-editor.c: (gl_object_editor_finalize): + Another pass at valgrinding -- plugged several memory leaks. + * src/view-text.c: (gl_view_text_new), + (update_canvas_item_from_object_cb), (draw_hacktext): + Commented out artifacts of edit-in-place code. + +2005-10-28 Jim Evins + + * src/canvas-hacktext.c: (gl_canvas_hacktext_set_arg): + Fixed use of uninitialized variable. Caught by + d binderman . + +2005-10-27 Jim Evins + + * src/merge-evolution.c: (gl_merge_evolution_get_record): + * src/merge-vcard.c: (gl_merge_vcard_get_record), + (parse_next_vcard): + Additional cleanup of EDS and vcard backends. Provided by + Austin Henry . + +2005-10-24 Jim Evins + + * AUTHORS: + * src/Makefile.am: + * src/merge-evolution.c: + * src/merge-evolution.h: + * src/merge-init.c: (gl_merge_init): + * src/merge-properties-dialog.c: (type_changed_cb): + * src/merge-vcard.c: + * src/merge-vcard.h: + * src/ui-commands.c: (gl_ui_cmd_help_about): + Added Evolution Data Server and VCard merge backends. Original patch + provided by Austin Henry . + * configure.in: + Only support EDS and VCard backends if libebook is installed. Allow + user to disable support, even if installed. + +2005-10-24 Jim Evins + + * AUTHORS: + * data/templates/avery-iso-templates.xml: + * data/templates/avery-us-templates.xml: + * data/templates/misc-iso-templates.xml: + * data/templates/zweckform-iso-templates.xml: + Collected all template changes and submissions since last + release. + +2005-10-23 Jim Evins + + * configure.in: + * data/mime/Makefile.am: + Added configure options to disable update-mime-database and + update-desktop-database as part of the install. Patch + provided by Leonardo Boshell (qhoracio@sourceforge.net). + +2005-10-23 Jim Evins + + * libglabels/xml.h: + * libglabels/xml.c: (gl_xml_get_prop_string), + (gl_xml_get_prop_i18n_string), (gl_xml_set_prop_string), + (gl_xml_is_node), (gl_xml_get_node_content): + Added new XML utility functions. + * libglabels/xml-paper.c: + * libglabels/xml-template.c: + * src/xml-label.c: + Cleanup by using new xml utilities created above. + * libglabels/paper.c: (gl_paper_free): + * src/file.c: (new_response): + * src/object-editor-image-page.c: (add_image_filters_to_chooser): + * src/pixbuf-cache.c: (gl_pixbuf_cache_add_pixbuf), + (gl_pixbuf_cache_get_pixbuf): + * src/ui-property-bar.c: + (gl_ui_property_bar_construct_color_combo): + * src/view-highlight.c: (gl_view_highlight_finalize): + * src/view-image.c: (update_object_from_editor_cb): + * src/view.c: (gl_view_finalize), (draw_bg_fg_layers), + (draw_bg_fg_rounded_rect), (draw_bg_fg_round), (draw_bg_fg_cd), + (draw_bg_fg_cd_bc), (draw_markup_layer), (draw_markup_margin), + (draw_markup_margin_rect), (draw_markup_margin_rounded_rect), + (draw_markup_margin_round), (draw_markup_margin_cd), + (draw_markup_margin_cd_bc): + * src/wdgt-mini-preview.c: (mini_outline_list_new): + * src/wdgt-rotate-label.c: (gl_wdgt_rotate_label_finalize): + Plugged various memory leaks located with valgrind. + * src/view-image.c: (update_canvas_item_from_object_cb): + Don't allow a width or height of zero when drawing pixbuf. + +2005-10-22 Jim Evins + + * libglabels/xml-paper.c: + * libglabels/xml-template.c: + * libglabels/xml.c: + * src/base64.c: + * src/bc-gnubarcode.c: + * src/canvas-hacktext.c: + * src/label-text.c: + * src/object-editor-data-page.c: + * src/print-dialog.c: + * src/print.c: + * src/recent.c: + * src/template-designer.c: + * src/text-node.c: + * src/ui-property-bar.c: + * src/ui.c: + * src/view-barcode.c: + * src/view-box.c: + * src/view-ellipse.c: + * src/view-image.c: + * src/view-line.c: + * src/view-text.c: + * src/view.c: + * src/wdgt-media-select.c: + * src/xml-label-04.c: + * src/xml-label-191.c: + * src/xml-label.c: + Modified to compile warning free with gcc-4.0. Mostly + casting to change signedness of characters. Did not + attack gnu-barcode library yet. + +2005-10-22 Jim Evins + + * src/glabels.c: (main): + * src/splash.c: (gl_splash): + Removed some small memory leaks. + * gtk-doc.make: + Added. + +2005-09-19 Jim Evins + + * data/glade/property-bar.glade: + Remove items from font_family_combo. This prevents the + double entry after adding text model and list of fonts. + * src/ui-property-bar.c: (reset_to_default_properties): + Free font_family_list. + +2005-07-01 Jim Evins + + * po/it.po: + Updated italian translation (Daniele Medri) + +2005-06-26 Jim Evins + + * docs/libglabels/libglabels-decl-list.txt: + Somehow never got checked in before. + * docs/libglabels/libglabels.types: + Removed -- don't need it afterall. + +2005-06-20 Jim Evins + + * NEWS: + Final prep for 2.1.1 release. + +2005-06-20 Jim Evins + + * configure.in: + Final preps for 2.1.1 release. + * docs/libglabels/libglabels.types: + Somehow never got checked in before. + * po/POTFILES.in: + Bring up-to-date with recent reorg of ui code. + + +2005-06-19 Jim Evins + + * src/template-designer.c: (construct_layout_page): + Removed attempt to match background color of mini preview widget to + background. + +2005-06-17 Jim Evins + + * help/C/figures/merge-ex2-4.png: + * help/C/glabels.xml: + Fixed spelling error. + +2005-06-13 Jim Evins + + * help/C/figures/merge-ex1-1.png: + * help/C/figures/merge-ex1-2.png: + * help/C/figures/merge-ex1-3.png: + * help/C/figures/merge-ex1-4.png: + * help/C/figures/merge-ex2-1.png: + * help/C/figures/merge-ex2-2.png: + * help/C/figures/merge-ex2-3.png: + * help/C/figures/merge-ex2-4.png: + Added figures for document merge tutorial. + * help/C/glabels.xml: + Added document merge tutorial. + +2005-05-19 Jim Evins + + * data/glade/merge-properties-dialog.glade: + Fixed irregular spacing. + * src/merge-properties-dialog.c: (gl_merge_properties_dialog_init), + (gl_merge_properties_dialog_construct): + Set outer padding and remove separator. + +2005-05-18 Jim Evins + + * src/hig.h: + * src/hig.c: + Removed glHigDialog class. + * src/file.c: (gl_file_new), (create_new_dialog_widgets), + (gl_file_properties), (create_properties_dialog_widgets): + * src/prefs-dialog.h: + * src/prefs-dialog.c: (gl_prefs_dialog_get_type), + (gl_prefs_dialog_init), (gl_prefs_dialog_construct): + * src/print-dialog.h: + * src/prefs-dialog.h: + * src/print-dialog.c: (gl_print_dialog_get_type), + (gl_print_dialog_init), (gl_print_dialog_construct): + Replaced all instances of glHigDialog with GtkDialog. + +2005-05-17 Jim Evins + + * src/hig.h: + * src/hig.c: + Removed HigAlert class since it is obsoleted by the GtkMessageDialog class. + * src/file.c: (open_response), (gl_file_open_real), (gl_file_save), + (save_as_response), (gl_file_close): + Replaced all instances of HigAlert widgets with GtkMessageDialog widgets. + +2005-05-15 Jim Evins + + * src/ui-commands.h: + * src/ui-util.c: + * src/ui-util.h: + * src/ui.c: + * src/ui.h: + * src/view.c: + * src/window.c: + * src/window.h: + A little code reformatting -- no functional changes. + +2005-05-14 Jim Evins + + * src/Makefile.am: + Removed obsolete macros. + * src/marshal.list: + Added marshalling template to support new view signal: "context_menu_activate." + * src/view.h: + * src/view.c: (gl_view_class_init), (gl_view_construct), + (canvas_event_arrow_mode): + - Removed hardcoded context menus and added new signal "context_menu_activate" + to push this up to the uimanager. + - Removed merge properties and print dialogs so that they can be managed with + the window by the uimanager. + * src/merge-properties-dialog.h: + * src/merge-properties-dialog.c: (gl_merge_properties_dialog_new), + (gl_merge_properties_dialog_construct): + Changed calling convention of gl_merge_properties_dialog_new() to use + glLabel and GtkWindow instead of view to make more consistent with other + dialogs. + * src/print-dialog.h: + * src/print-dialog.c: (gl_print_dialog_new), + (gl_print_dialog_construct): + Removed last artifact of libbonoboui. + * src/ui-commands.c: (gl_ui_cmd_file_print), + (gl_ui_cmd_objects_merge_properties), (gl_ui_cmd_help_about): + Reconciled style for launching dialogs. + * src/ui.c: (gl_ui_new): + Added context menus to ui manager. + * src/view-object.c: (item_event_arrow_mode): + No longer try to select objects with right-click. + * src/window.h: + * src/window.c: (gl_window_init), (gl_window_set_label), + (context_menu_activate_cb): + Context menus and all dialogs are now managed in a consistent way in window + by the ui manager. + +2005-05-11 Jim Evins + + * src/window.h: + * src/window.c: (gl_window_init), (gl_window_destroy): + * src/ui.c: (gl_ui_new), (gl_ui_unref), (recent_tooltip_func): + * src/ui-commands.c: (gl_ui_cmd_file_open_recent): + Moved management of recent_view back from window.c to ui.c -- it just feels + better there. + +2005-05-10 Jim Evins + + * src/window.h: + * src/window.c: (gl_window_init): + * src/ui.h: + * src/ui.c: (gl_ui_new), (connect_proxy_cb), (disconnect_proxy_cb), + (menu_item_select_cb), (menu_item_deselect_cb): + Added GtkStatusbar which displays menu tooltips. + +2005-05-09 Jim Evins + + Replaced libbonoboui with GtkUIManager for creation of basic user interface menus + and toolbars. + + * configure.in: + * glabels.spec.in: + Removed dependencies on libbonoboui. + * data/Makefile.am: + * data/ui/Makefile.am: + * data/ui/glabels-ui.xml: + Removed data/ui directory. + * data/glade/Makefile.am: + * data/property-bar.glade: + Added glade description of property-bar for new libglade implementation + of glUIPropertyBar. + * src/Makefile.am: + * src/commands.h: + * src/commands.c: + * src/tools.h: + * src/tools.c: + * src/ui-commands.h: + * src/ui-commands.c: + Replaced commands.[ch] and tools.[ch] with the single ui-commands.[ch] module + since the distinction between "commands" and "tools" is no longer that clear. + * src/file.h: + * src/file.c: + Modified to expect glWindow instead of GtkWindow. gl_file_open_recent() + no longer has knowledge of eggRecent*. + * src/glabels.c: (main): + Removed libbonobo initialization and replaced bonobo_main loop with gtk_main + loop. + * src/object-editor.c: (gl_object_editor_init): + Make sure notebook does not respond to a "show_all" on the parent. + * src/recent-files/Makefile.am: + * src/recent-files/*.[ch] + Updated from latest version of libegg which now has a view based on + GtkUIManager. Removed unused bonobo and gtk views. + * src/ui-property-bar.h: + * src/ui-property-bar.c: + New implementation based on libglade. + * src/ui-sidebar.h: + * src/ui-sidebar.c: + Sidebar is now simply a GtkWidget and does not expect to be a part of + a libbonoboui interface. + * src/ui-util.h: + * src/ui-util.c: + * src/ui.h: + * src/ui.c: + Converted for use with GtkUIManager. + * src/window.h: + * src/window.c: + Now derived from GtkWindow instead of BonoboWindow and uses GtkUIManager + to create menus and toolbars. + +2005-04-25 Jim Evins + + * data/templates/misc-iso-templates.xml: + Added Fellows 04715 template provided by Steve Saxon. + * AUTHORS: + Updated acknowledgement for above. + +2005-04-23 Jim Evins + + * src/util.c: (gl_util_combo_box_set_strings): + Make sure to clear model before loading a new list of strings. + * src/wdgt-media-select.h: + * src/wdgt-media-select.c: (gl_wdgt_media_select_instance_init), + (gl_wdgt_media_select_construct), (page_size_combo_changed_cb), + (template_combo_changed_cb), (prefs_changed_cb), + (gl_wdgt_media_select_get_name), (gl_wdgt_media_select_set_name), + (gl_wdgt_media_select_get_page_size), + (gl_wdgt_media_select_set_page_size): + Replaced the deprecated GtkCombo widget with the new + GtkComboBox. + +2005-04-21 Jim Evins + + * data/glade/template-designer.glade: + * src/template-designer.c: (construct_pg_size_page), + (pg_size_page_changed_cb), (build_template): + Replaced the deprecated GtkCombo widget with the new + GtkComboBox. + +2005-04-20 Jim Evins + + * data/glade/prefs-dialog.glade: + * src/prefs-dialog.c: (construct_object_page), + (update_object_page_from_prefs), (update_prefs_from_object_page): + Replaced the deprecated GtkCombo widget with the new + GtkComboBox. + +2005-04-19 Jim Evins + + * data/glade/object-editor.glade: + * src/object-editor-bc-page.c: (gl_object_editor_prepare_bc_page), + (style_changed_cb), (gl_object_editor_set_bc_style), + (gl_object_editor_get_bc_style), (gl_object_editor_set_bc_color), + (gl_object_editor_get_bc_color): + * src/object-editor-data-page.c: + (gl_object_editor_prepare_data_page), (gl_object_editor_set_data), + (gl_object_editor_get_data): + * src/object-editor-edit-page.c: + (gl_object_editor_prepare_edit_page), (insert_button_cb): + * src/object-editor-fill-page.c: + (gl_object_editor_prepare_fill_page), + (gl_object_editor_set_fill_color), + (gl_object_editor_get_fill_color): + * src/object-editor-image-page.c: + (gl_object_editor_prepare_image_page), + (gl_object_editor_set_image), (gl_object_editor_get_image): + * src/object-editor-line-page.c: + (gl_object_editor_prepare_line_page), + (gl_object_editor_set_line_color), + (gl_object_editor_get_line_color): + * src/object-editor-private.h: + * src/object-editor-text-page.c: + (gl_object_editor_prepare_text_page), + (gl_object_editor_set_font_family), + (gl_object_editor_get_font_family), + (gl_object_editor_set_text_color), + (gl_object_editor_get_text_color): + * src/object-editor.c: (gl_object_editor_set_key_names): + * src/ui-sidebar.c: + In the object editor: replaced all instances of the deprecated + GtkCombo widget with the new GtkComboBox. + +2005-04-18 Jim Evins + + * src/stock.c: + Neglected to save this one in previous checkin to support + header cleanup. + +2005-04-17 Jim Evins + + * libglabels/libglabels-private.h: + * libglabels/paper.c: + * libglabels/paper.h: + * libglabels/template.c: + * libglabels/template.h: + * libglabels/xml-paper.c: + * libglabels/xml-paper.h: + * libglabels/xml-template.c: + * libglabels/xml.c: + * libglabels/xml.h: + * src/base64.c: + * src/base64.h: + * src/bc-gnubarcode.c: + * src/bc-postnet.c: + * src/bc.c: + * src/bc.h: + * src/commands.c: + * src/debug.c: + * src/debug.h: + * src/file.c: + * src/file.h: + * src/hig.c: + * src/hig.h: + * src/label-barcode.c: + * src/label-box.c: + * src/label-ellipse.c: + * src/label-image.c: + * src/label-image.h: + * src/label-line.c: + * src/label-object.c: + * src/label-text.c: + * src/label-text.h: + * src/label.c: + * src/merge-properties-dialog.c: + * src/object-editor-bc-page.c: + * src/object-editor-data-page.c: + * src/object-editor-edit-page.c: + * src/object-editor-fill-page.c: + * src/object-editor-image-page.c: + * src/object-editor-line-page.c: + * src/object-editor-lsize-page.c: + * src/object-editor-position-page.c: + * src/object-editor-private.h: + * src/object-editor-size-page.c: + * src/object-editor-text-page.c: + * src/object-editor.c: + * src/object-editor.h: + * src/pixbuf-cache.h: + * src/prefs-dialog.c: + * src/prefs-dialog.h: + * src/prefs-model.c: + * src/prefs-model.h: + * src/prefs.c: + * src/print-dialog.c: + * src/print-dialog.h: + * src/print.c: + * src/print.h: + * src/recent.c: + * src/recent.h: + * src/splash.c: + * src/splash.h: + * src/stock.h: + * src/template-designer.c: + * src/template-designer.h: + * src/text-node.h: + * src/tools.c: + * src/ui-property-bar.c: (gl_ui_property_bar_construct): + * src/ui-sidebar.c: + * src/ui-util.c: + * src/ui.c: + * src/util.c: + * src/util.h: + * src/view-barcode.c: + * src/view-box.c: + * src/view-ellipse.c: + * src/view-highlight.c: + * src/view-highlight.h: + * src/view-image.c: + * src/view-line.c: + * src/view-object.c: + * src/view-object.h: + * src/view-text.c: + * src/view.c: + * src/view.h: + * src/wdgt-chain-button.c: + * src/wdgt-media-select.c: + * src/wdgt-media-select.h: + * src/wdgt-mini-preview.c: + * src/wdgt-mini-preview.h: + * src/wdgt-print-copies.c: + * src/wdgt-print-copies.h: + * src/wdgt-print-merge.c: + * src/wdgt-print-merge.h: + * src/wdgt-rotate-label.c: + * src/wdgt-rotate-label.h: + * src/window.c: + * src/window.h: + * src/xml-label-04.c: + * src/xml-label-191.c: + * src/xml-label.c: + Cleanup of header files: + - all header files are now stand-alone, verified by including + first in corresponding "c" files + - replaced blanket includes of gnome, gtk, and glib with + targetted includes + +2005-04-16 Jim Evins + + * data/glade/Makefile.am: + * data/glade/merge-properties-dialog.glade: + Added merge properties dialog glade description file. + * src/merge-properties-dialog.h: + * src/merge-properties-dialog.c: + (gl_merge_properties_dialog_get_type), + (gl_merge_properties_dialog_init), + (gl_merge_properties_dialog_finalize), + (gl_merge_properties_dialog_new), + (gl_merge_properties_dialog_construct), (type_changed_cb), + (src_changed_cb), (response_cb), (load_tree), + (record_select_toggled_cb), (select_all_button_clicked_cb), + (unselect_all_button_clicked_cb): + Modified merge properties dialog to use libglade. Added + "select all" and "unselect all" buttons. + * src/merge-text.c: (parse_line): + Handle empty lines better. + * src/merge.c: (gl_merge_eval_key): + Evaluate the key whether the record is selected or not. + * src/util.h: + * src/util.c: (gl_util_combo_box_add_text_model): + Since libglade does not use the gtk_combo_box_new_text() + constructor for GtkComboBoxes, a utility function was created + to add an appropriate text model to a GtkComboBox. + * src/view.c: (gl_view_edit_merge_props): + Removed unnecessary "show all's". + +2005-04-15 Jim Evins + + * po/ru.po: + Updated russian translation (Vitaly Lipatov) + * data/templates/misc-iso-templates.xml: + Added templates for russian business cards provided by Vitaly Lipatov. + * AUTHORS: + Updated acknowledgements for above. + +2005-04-15 Jim Evins + + * data/templates/avery-us-templates.xml: + Added Avery 5388 and 5389 templates provided by Peter L. Berghold. + * data/templates/misc-iso-templates.xml: + Added Ryman standard CD/DVD template, provided by Dan Clark. + * AUTHORS: + Added acknowledgements for above. + +2005-04-10 Jim Evins + + * libglabels/xml-paper.c: (gl_xml_paper_parse_paper_node): + * libglabels/xml-template.c: (gl_xml_template_parse_template_node), + (xml_parse_label_rectangle_node), (xml_parse_label_round_node), + (xml_parse_label_cd_node), (xml_parse_alias_node): + * libglabels/xml.c: (gl_xml_get_prop_double), + (gl_xml_get_prop_boolean), (gl_xml_get_prop_int), + (gl_xml_get_prop_uint), (gl_xml_get_prop_length): + * src/xml-label-04.c: (xml04_parse_media_description), + (xml04_parse_text_props), (xml04_parse_barcode_props), + (xml04_parse_merge_properties): + * src/xml-label-191.c: (xml191_parse_object), + (xml191_parse_text_props), (xml191_parse_barcode_props), + (xml191_parse_merge_fields), (xml191_parse_pixdata), + (xml191_parse_sheet), (xml191_parse_label), (xml191_parse_markup), + (xml191_parse_alias): + * src/xml-label.c: (xml_parse_object_text), + (xml_parse_object_barcode), (xml_parse_merge_fields), + (xml_parse_pixdata), (xml_parse_toplevel_span): + Make sure to use xmlFree for anything obtained from libxml + in case libxml and glib use different memory management + space. + +2005-04-08 Jim Evins + + * src/util.h: + * src/util.c: (gl_util_combo_box_set_strings), (search_text_func), + (gl_util_combo_box_set_active_text): + Added utility functions to simplify working with GtkComboBox + widgets in GTK-2.6. + * src/ui-property-bar.h: + * src/ui-property-bar.c: (gl_ui_property_bar_construct), + (reset_to_default_properties), (update_text_properties), + (font_family_changed_cb): + Replaced deprecated GtkCombo with GtkComboBox. + + +2005-04-03 Jim Evins + + * src/Makefile.am: + * src/wdgt-image-select.h: + * src/wdgt-image-select.c: + Removed obsolete wdgt-image-select.[ch] files. + * libglabels/paper.c: (gl_paper_dup): + Fixed rename of parameter introduced during documentation + updates. + * data/glade/object-editor.glade: + * src/object-editor-image-page.c: + (gl_object_editor_prepare_image_page), (img_radio_toggled_cb), + (gl_object_editor_set_image), (gl_object_editor_get_image), + (update_preview_cb), (add_image_filters_to_chooser): + * src/object-editor-private.h: + Replaced deprecated GnomePixmapEntry with + GtkFileChooserButton. + +2005-04-02 Jim Evins + + * src/mygal/mygal-combo-box.c: (deactivate_arrow), + (mygal_combo_box_popup_hide_unconditional), + (mygal_combo_box_popup_hide), (mygal_combo_box_popup_display), + (mygal_combo_toggle_pressed), (mygal_combo_box_init), + (mygal_combo_popup_tear_off), (mygal_combo_set_tearoff_state), + (mygal_combo_tearoff_bg_copy), (mygal_combo_popup_reparent), + (cb_tearable_button_release), (mygal_combo_box_set_tearable): + Renamed all internal gtk_combo functions to mygal_combo + to prevent namespace confusion. + +2005-04-02 Jim Evins + + * src/mygal/color-palette.c: (color_palette_change_custom_color), + (cust_color_set), (color_palette_setup): + * src/mygal/color-palette.h: + Replaced deprecated GnomeColorPicker with GtkColorButton. + +2005-04-02 Jim Evins + + * docs/libglabels/libglabels-sections.txt: + * docs/libglabels/libglabels-undocumented.txt: + * docs/libglabels/tmpl/enums.sgml: + * docs/libglabels/tmpl/paper.sgml: + * docs/libglabels/tmpl/xml-paper.sgml: + * docs/libglabels/tmpl/xml-template.sgml: + * libglabels/enums.h: + * libglabels/paper.c: (gl_paper_dup): + * libglabels/paper.h: + * libglabels/xml-paper.c: + * libglabels/xml-template.c: + More documentation updates for libglabels. + +2005-03-23 Jim Evins + + * INSTALL: + Automatically updated. + * Makefile.am: + * autogen.sh: + * configure.in: + * docs/Makefile.am: + * docs/libglabels/Makefile.am: + * docs/libglabels/libglabels-docs.sgml: + * docs/libglabels/libglabels-sections.txt: + * docs/libglabels/libglabels-undocumented.txt: + * docs/libglabels/tmpl/enums.sgml: + * docs/libglabels/tmpl/libglabels-unused.sgml: + * docs/libglabels/tmpl/libglabels.sgml: + * docs/libglabels/tmpl/paper.sgml: + * docs/libglabels/tmpl/template.sgml: + * docs/libglabels/tmpl/xml-paper.sgml: + * docs/libglabels/tmpl/xml-template.sgml: + * docs/libglabels/tmpl/xml.sgml: + Added basic gtk-doc stuff to support documenting libglabels + API. + * libglabels/xml.c: + Updated function comments with gtk-doc markup. + * missing: + Removed. + +2005-03-22 Jim Evins + + Since the development version now requires gtk-2.6/gnome-2.10, I + have made a first pass at removing deprecations. + + * configure.in: + * libglabels/Makefile.am: + * src/Makefile.am: + Added configure option to turn on X_DISABLE_DEPRECATED flags. + Also removed all remnants of HAVE_FILECHOOSER. + * src/file.c: (gl_file_open_real): + Removed code for old GtkFileSelection. + * libglabels/libglabels-private.h: + * libglabels/paper.c: + * libglabels/template.c: + * libglabels/xml-paper.c: + * libglabels/xml-template.c: + * libglabels/xml.c: + * src/bc.c: + * src/file.c: + * src/glabels-batch.c: + * src/glabels.c: + * src/label.c: + * src/merge-init.c: + * src/merge-properties-dialog.c: + * src/merge.c: + * src/object-editor.c: + * src/prefs-dialog.c: + * src/prefs.c: + * src/print-dialog.c: + * src/print.c: + * src/stock.c: + * src/template-designer.c: + * src/ui-property-bar.c: + * src/ui-sidebar.c: + * src/view-barcode.c: + * src/view-box.c: + * src/view-ellipse.c: + * src/view-image.c: + * src/view-line.c: + * src/view-text.c: + * src/view.c: + * src/wdgt-image-select.c: + * src/wdgt-media-select.c: + * src/wdgt-print-copies.c: + * src/wdgt-print-merge.c: + * src/wdgt-rotate-label.c: + * src/window.c: + * src/xml-label-04.c: + * src/xml-label-191.c: + * src/xml-label.c: + Added '#include " where needed. + Removed any unused '#include "s. + +2005-03-22 Jim Evins + + * src/commands.c: (activate_url), (gl_cmd_help_about): + Replaced GnomeAbout with GtkAboutDialog. Therefore the + development version of glabels now depends on GTK 2.6 and + GNOME 2.10. + * configure.in: + Updated library dependencies. + +2005-02-28 Jim Evins + + * AUTHORS: + * data/templates/misc-iso-templates.xml: + Added 'Ednet 45021' template provided by Ali Akcaagac + . + +2005-02-14 Jim Evins + + * data/templates/avery-us-templates.xml: + Updated templates to use inches instead of points. + * src/print-dialog.c: (printer_page_new): + Changed packing style when adding printer selector widget. This fixes + debian Bug#295274. + +2005-02-13 Jim Evins + + * AUTHORS: + * po/es.po: + Updated spanish translations. (sergio rivadero) + +2005-02-05 Jim Evins + + Some cleanup to libglabels. + + * configure.in: + Updated version to 2.1.1cvs. Added generation of libglabels.pc. + * libglabels/libglabels.pc.in + Created. + * libglabels/enums.h + Created. Currently only contains glUnitsType which provides enumerations + for all possible units of distance. + * libglabels/Makefile.am: + Incorporated new files enums.h and libglabels.pc[.in]. + * libglabels/libglabels.h: + Include enums.h. + * libglabels/template.h: + * libglabels/template.c: (gl_template_layout_new): + Changed parameters nx and ny to gint from gdouble. + * libglabels/xml.h: + * libglabels/xml.c: (gl_xml_get_prop_length), + (gl_xml_set_prop_length), (gl_xml_set_default_units): + Added support for different output units. + * src/prefs-dialog.c: (update_locale_page_from_prefs), + (update_prefs_from_locale_page): + * src/prefs-model.c: (string_to_units), (units_to_string): + * src/prefs-model.h: + * src/prefs.c: (gl_prefs_get_units_per_point), + (gl_prefs_get_units_precision), (gl_prefs_get_units_step_size), + (gl_prefs_get_units_string): + * src/prefs.h: + * src/wdgt-media-select.c: (details_update), (get_label_size_desc): + Reconciled all length enumerations with the new enumerations provided + in libglabels/enums.h. + +2005-02-03 Jim Evins + + * po/cs.po: + Updated Czech translations. (David Makovský and Zbynek Mrkvick) + * po/it.po: + Updated Italian translations. (Daniele Medri) + * AUTHORS: + Updated credits to reflect above translations. + + +2005-01-22 Jim Evins + + * MESSAGE-OF-DOOM: + Added. + * Makefile.am: + Added MESSAGE-OF-DOOM to EXTRA_DIST. + * NEWS: + Final prep for 2.1.0. + * configure.in: + Set version to 2.1.0. Output MESSAGE-OF-DOOM. + * glabels.spec.in: + Added '--remove-original' flag to desktop-file-install, so that there is + only one menu entry. + +2005-01-20 Jim Evins + + * data/glade/object-editor.glade: + - Font family entry should not be editable. + - img_key_entry should have sensitivity=YES, so that it follows the + sensitivity of img_key_combo. + +2005-01-19 Jim Evins + + * AUTHORS: + Give credit to Frederic Ruaudel for the color merge patches. + +2005-01-18 Frederic Ruaudel + + Add support to merge color for all other color attribute (Feature + Requests item #1008635. If the data is invalid, the color used is transparent + (GL_COLOR_NONE). The format for color in merge data file are those accepted + by gdk_color_parse() these include name for a color from rgb.txt, such as + DarkSlateGray, or a hex specification such as #305050. File format has been + changed but backward compatibility is preserved for all format. For + box/ellipse/line, keep attribute "line_color" for static color or replace by + "line_color_field" for merge data. For text/barcode objects, keep attribute + "color" for static color or replace by "color_field" for merge data. In the + edit canvas window, merged color are represented by half-transparent black + line/area. + + * data/dtd/glabels-2.0.dtd: + Added line_color_field to line_attrs. Added color_field to + Object-barcode and Span. + * data/glade/object-editor.glade: + Modify the layout of the editor to add merge possibility to color options + * src/color.c: + Fix a copy/paste error in a comment + * src/color.h: + Add default color for merge color representation in the editor canvas. + * src/label-barcode.c: + * src/object-editor-bc-page.c: + * src/view-barcode.c: + Add merge color support for barcode color. + * src/label-box.c: + * src/view-box.c: + Add merge color support for box border color. + * src/label-ellipse.c: + * src/view-ellipse.c: + Add merge color support for ellipse border color. + * src/label-line.c: + * src/view-line.c: + Add merge color support for line color. + * src/label-object.c: + * src/label-object.h: + * src/object-editor.c: + * src/object-editor.h: + * src/ui-property-bar.c: + * src/view.c: + * src/view.h: + * src/xml-label-04.c: + * src/xml-label-191.c: + Add support for merging to other color attribute. + * src/label-text.c: + * src/object-editor-text-page.c: + * src/view-text.c: + Add merge color support for text color. + * src/object-editor-fill-page.c: + Change a blocked handler that didn't match the good widget. Fix the type + of some debug message. + * src/object-editor-line-page.c: + Add merging support to line color option. + * src/object-editor-private.h: + Add variables for new widget. + * src/print.c: + Modify the draw functions to get merge data if needed. + * src/window.c: + Change the default size of the window in order to see all widget in the + "text style tab" of the editor. + * src/xml-label.c: + Modify the parser to record/retreive the field value for objects that need + "color" attribute. For box/ellipse/line, keep attribute "line_color" for + static color or replace by "line_color_field" for merge data. For + text/barcode objects, keep attribute "color" for static color or replace + by "color_field" for merge data. + +2005-01-17 Jim Evins + + * src/view.c: (screen_changed_cb): + Don't do anything if we don't have a screen. + +2005-01-06 Jim Evins + + * src/view.c: (get_home_scale): + Fixed bad call to gtk_widget_has_screen() -- huh?. + +2005-01-06 Jim Evins + + * data/dtd/glabels-2.0.dtd: + Added fill_color_field to fill_attrs. Also added xmlns attribute to all + top-level elements. + +2005-01-06 Jim Evins + + * data/glade/object-editor.glade: + Set entries for fill and data field key dropdowns to NOT editable. + * src/view-box.c: (construct_properties_editor): + * src/view-ellipse.c: (construct_properties_editor): + Update object editor when label's merge property has changed. + * src/xml-label.c: (xml_parse_object_ellipse): + Completed the merge color support for the ellipse item. + +2005-01-06 Frederic Ruaudel + + Add support to merge color for object that have a "Fill color" attribute (Feature + Requests item #1008635. If the data is invalid, the color used is transparent + (GL_COLOR_NONE). The format for color in merge data file are those accepted + by gdk_color_parse() these include name for a color from rgb.txt, such as + DarkSlateGray, or a hex specification such as #305050. File format has been + changed but backward compatibility is preserved for all format. For box/ellipse, + keep attribute "fill_color" for static color or replace by "fill_color_field" + for merge data. + + * data/glade/object-editor.glade: + Modify "Fill" tab to add the merge key combo and convert the labels into + radio button. + * src/color.h: + * src/color.c: + Add "glColorNode" structure and associated functions to manage it. This + structure is equivalent for color than the "glTextNode". It holds the color + and the key field. + * src/label-object.h: + * src/label-object.c: + * src/label-box.c: + * src/label-ellipse.c: + * src/ui-property-bar.c: + * src/view.h: + * src/view.c: + * src/view-box.c: + * src/view-ellipse.c: + * src/xml-label-04.c: + * src/xml-label-191.c: + Change functions of objects that have a "fill color" attribute to use the + new "glColorNode" structure. Use barcode code as example. + * src/Makefile.am: + Add the color.[ch] file to glabels_batch binary that now need support for + "glColorNode". + * src/object-editor.h: + * src/object-editor.c: + * src/object-editor-fill-page.c: + Manage the new widget of the editor's "Fill" tab : key combo and radio button + to choose between static color or merge key. Use barcode code as example. + * src/object-editor-private.h: + Add new widget in the "_glObjectEditorPrivate" structure. + * src/print.c: + Modify the draw functions to get merge data if needed. + * src/xml-label.c: + Modify the parser to record/retreive the field value for objects that need + "Fill color" attribute. For box/ellipse, put attribute "fill_color" for static + color or "fill_color_field" for merge data. + +2005-01-04 Jim Evins + + * AUTHORS: + * data/templates/avery-iso-templates.xml: + * data/templates/misc-iso-templates.xml: + * data/templates/misc-us-templates.xml: + Added templates, submitted by Larry Harriman, Juan Carlos Valero, and + Nick Hill. + +2004-11-26 Jim Evins + + * AUTHORS: + * po/fr.po: + Updated french translations provided by Florent Morel . + * src/view-barcode.c: + * src/view-box.c: + * src/view-ellipse.c: + * src/view-image.c: + * src/view-line.c: + * src/view-text.c: + Added '#include ' -- HAVE_*GETTEXT macros were not defined and + thus _() strings were not being translated. + +2004-11-14 Jim Evins + + * src/debug.h: + * src/debug.c: (gl_debug_init), (gl_debug): + Borrowed from gedit: use environmental variables to select debug + sections. + * src/splash.c: + Removed unused include of debug.h. + * src/glabels.c: (main): + Added call to gl_debug_init(), and removed debug clutter from command line + options. + * src/glabels-batch.c: (main): + Added call to gl_debug_init(). + +2004-11-13 Jim Evins + + Drawing and property toolbars were being initialized with the "icons and text" + look in Fedora Core 3. Even though none of the buttons had any text attached to + them, the buttons were being sized as if they were. This led to less real estate + for the property editor, leading to Bug #1064630. The + + * data/ui/glabels-ui.xml: + Added explicit "look" property to both drawing and property toolbars. + * src/prefs-model.c: (gl_prefs_model_save_settings), + (gl_prefs_model_load_settings): + * src/prefs-model.h: + Removed drawing_toolbar_button_style configuration parameter. + * src/ui.c: (view_menu_item_toggled_cb), + (set_app_drawing_toolbar_style): + Do not attempt to adjust look property of the drawing toolbar. + +2004-10-28 Jim Evins + + * data/pixmaps/glabels-about-logo.png: + Updated about logo. + +2004-10-28 Jim Evins + + * data/man/glabels.1: + * src/glabels-batch.c: (main): + * src/print.h: + * src/print.c: (gl_print_batch): + + Added option to glabels-batch to select the first label to begin + printing on. + +2004-09-26 Jim Evins + + * data/desktop/glabels.desktop.in: + Point to app icon, "glabels.png" + * data/mime/glabels.keys.in: + Point at mime icon, "glabels-application-x-glabels.png" + * data/pixmaps/Makefile.am: + Added glabels_app_icondir. Renamed icons. + * data/pixmaps/glabels.png: + New cleaned up app icon. Deleted glabels-icon.png. + * data/pixmaps/glabels-application-x-glabels.png: + New mime icon. + * data/pixmaps/glabels-splash.png: + Renamed glabels-logo to glabels-splash to be more correct about role. + * src/glabels.c: + * src/template-designer.c: + Point at app icon, "glabels.png" + * src/splash.c: + Point at renamed splash image, "glabels-splash.png" + +2004-08-22 Jim Evins + + * AUTHORS: + * src/glabels-batch.c: (main): + Applied patch with minor mods to allow selecting merge source and + crop-marks on glabels-batch's command line. Original patch provided by + José Dapena Paz . + +2004-08-15 Jim Evins + + * data/desktop/glabels.desktop.in: + - Added encoding line + - Removed period from comment + - Fixed Terminal line, changed "0" to "false" + - Added semicolen to Categories line + * po/ja.po: + - Made sure desktop.in comment string above still translated properly + +2004-08-14 Jim Evins + + * libglabels/xml-paper.c: (gl_xml_paper_parse_paper_node): + * libglabels/xml-template.c: (gl_xml_template_parse_template_node): + * src/xml-label-191.c: (xml191_parse_sheet): + Fixed improper freeing of gettext strings. Merged from 2.0.1. + * configure.in: + Reconciled libglabels versioning with 2.0.1. + + +2004-08-14 Jim Evins + + * configure.in: + Updated version to 2.1cvs. + +2004-08-14 Jim Evins + + * po/ja.po: + Updated 2.0.x translation by Takeshi AIHANA . + +2004-08-14 Jim Evins + + Fixes for Bug #1008181. + + * src/bc.c: (gl_barcode_default_digits): + Make a format of zero digits, harmless. + * src/xml-label.c: (xml_parse_object_barcode): + Set default value of the format property of barcode objects to 10, not + zero. This will prevent crashes when reading pre 2.0.x files. + +2004-08-09 Jim Evins + + * NEWS: + * TODO: + * help/C/glabels-C.omf: + * help/C/glabels.xml: + Brought documentation up-to-date for 2.0.0 release. + +2004-08-09 Jim Evins + + These are hopefully the final preparations for 2.0.0. + + * data/mime/Makefile.am: + Include glabels.xml in EXTRA_DIST. + * configure.in: + - Updated comment style. + - Added LIBGLABELS_VERSION_INFO macro, updated Current. + - Added package and version info to configuration printout + - Update version to 2.0.0 + * libglabels/Makefile.am: + Use the new LIBGLABELS_VERSION_INFO macro. + +2004-08-09 Jim Evins + + * configure.in: + * glabels.spec.in: + Cleanup of required library macros. + +2004-08-08 Jim Evins + + * glabels.spec.in: + - Updated URL + - More specific of what to install in /usr/bin and /usr/lib + - Remove built mime registration files from staging directory + +2004-08-08 Jim Evins + + * data/mime/Makefile.am: + Fixed typo: key_files should have been keys_files. + +2004-08-08 Jim Evins + + Reorganization of runtime data files. Also added registration of mimetype with + new freedesktop.org mime database if available. + + * data/* + Moved files to appropriate subdirectories, creating local Makefile.am + in each subdirectory. + - Moved paper-sizes.xml and *-templates.xml to templates subdirectory. + These are now installed at $datadir/glabels/templates. + - Moved glabels.1 to man subdirectory. + - Moved glabels-2.0.dtd to dtd subdirectory. + - Moved glabels.desktop.in to desktop subdirectory. + - Moved glabels.keys.in and glabels.mime to mime subdirectory. + * data/pixmaps/* + Moved "./pixmaps" to "./data/pixmaps" + * data/ui/* + Moved src/glabels-ui.xml to data/ui directory. Created Makefile.am. + * data/glade/* + Moved libglade files from src to data/glade. Created Makefile.am. + * Makefile.am: + Removed pixmaps from SUBDIRS. + * configure.in: + - Removed pixmaps from makefiles. + - Added makefiles for new subdirs of data. + - Added tests for freedesktop.org mime database. + * glabels.spec.in: + - Added tests for freedesktop.org mime database for post install and + post un-install actions. + * libglabels/Makefile.am: + Moved system template files to $(datadir)/glabels/templates. + * libglabels/libglabels-private.h: + Moved system template files to $(datadir)/glabels/templates. + * po/POTFILES.in: + - Accounted for movement of ui and libglade files. + - Added missing .in files. + - Reorganized by directory. + * src/Makefile.am: + Accounted for movement of ui and libglade files. + * data/mime/glabels.xml.in: + New file for registering with freedesktop.org mime database. + +2004-08-07 Jim Evins + + * src/recent-files/*: + Re-synced to latest libegg/recent-files. + +2004-08-07 Jim Evins + + * Makefile.am: + * configure.in: + * help/* + Renamed "./doc" directory to "./help" which contains user documentation, + to be more consistent with other GNOME applications. + + +2004-07-26 Jim Evins + + * src/merge-properties-dialog.c: (gl_merge_properties_dialog_init): + Corrected button order of merge properties dialog. + +2004-07-18 Jim Evins + + * data/glabels-2.0.dtd: + * src/bc.c: (gl_barcode_default_digits), (gl_barcode_can_freeform), + (gl_barcode_get_prefered_n): + * src/bc.h: + * src/label-barcode.c: (copy), (gl_label_barcode_set_props), + (gl_label_barcode_get_props), (get_size): + * src/label-barcode.h: + * src/object-editor-bc-page.c: (gl_object_editor_prepare_bc_page), + (style_changed_cb), (gl_object_editor_set_bc_style), + (gl_object_editor_get_bc_style): + * src/object-editor-data-page.c: (data_radio_toggled_cb), + (gl_object_editor_set_data), (gl_object_editor_get_data): + * src/object-editor-private.h: + * src/object-editor.c: (gl_object_editor_set_key_names): + * src/object-editor.glade: + * src/object-editor.h: + * src/print.c: (draw_barcode_object): + * src/view-barcode.c: (update_object_from_editor_cb), + (update_editor_from_object_cb), + (gl_view_barcode_create_event_handler), (draw_barcode): + * src/xml-label-04.c: (xml04_parse_barcode_props): + * src/xml-label-191.c: (xml191_parse_barcode_props): + * src/xml-label.c: (xml_parse_object_barcode), + (xml_create_object_barcode): + Added "format" attribute to barcode objects. This attribute is used + to properly format freeform barcodes barcodes prior to merge data is + applied, so that barcodes can be accurately layed out. This addresses + remaining issues of feature request #824787. Also added an example of + the format in the object editor. + +2004-07-12 Jim Evins + + Various code cleanups. + + * src/label-barcode.c: + Removed unneeded include of gnome-glyphlist.h. + + * src/label-text.c: (get_size): + Fixed memory leak: unref glyphlists when done with them. + + * src/object-editor-bc-page.c: (gl_object_editor_prepare_bc_page): + * src/object-editor-data-page.c: + (gl_object_editor_prepare_data_page): + * src/object-editor-image-page.c: + (gl_object_editor_prepare_image_page): + * src/object-editor-line-page.c: + (gl_object_editor_prepare_line_page): + * src/object-editor-lsize-page.c: + (gl_object_editor_prepare_lsize_page): + * src/object-editor-position-page.c: + (gl_object_editor_prepare_position_page): + * src/object-editor-size-page.c: + (gl_object_editor_prepare_size_page): + * src/object-editor-text-page.c: + (gl_object_editor_prepare_text_page): + Removed unneeded size groups, originally intended to keep widgets aligned. + Now use tables to lay these out in object-editor.glade. + + * src/print.c: (draw_text_object): + Fixed memory leak: unref glyphlists when done with them. + + * src/view-barcode.c: (draw_barcode): + Fixed memory leak: unref glyphlists when done with them. + + * src/view-text.c: (update_object_from_editor_cb), (draw_hacktext): + - Removed unneeded cast of gl_object_editor_get_text_line_spacing()s + return value. + - Fixed memory leak: unref glyphlists when done with them. + +2004-07-11 Jim Evins + + * data/glabels-2.0.dtd: + * src/label-text.c: (gl_label_text_instance_init), (copy), + (gl_label_text_set_auto_shrink), (gl_label_text_get_auto_shrink): + * src/label-text.h: + * src/object-editor-private.h: + * src/object-editor-text-page.c: + (gl_object_editor_prepare_text_page), + (gl_object_editor_set_text_auto_shrink), + (gl_object_editor_get_text_auto_shrink): + * src/object-editor.c: (gl_object_editor_set_key_names): + * src/object-editor.glade: + * src/object-editor.h: + * src/print.c: (draw_text_object): + * src/view-text.c: (update_object_from_editor_cb), + (update_editor_from_object_cb): + * src/xml-label.c: (xml_parse_object_text), + (xml_create_object_text): + Added option to allow document merge to auto shrink text size to fit + within the text box. The code in print.c that actually shrinks the + text is loosely based on a patch submitted by Mark Harrison + . This addresses feature request + #661421. + +2004-07-11 Jim Evins + + * data/glabels-2.0.dtd: + * libglabels/template.c: (gl_template_rect_label_type_new), + (gl_template_round_label_type_new), + (gl_template_cd_label_type_new), (gl_template_label_type_dup), + (template_full_page): + * libglabels/template.h: + * libglabels/xml-template.c: (xml_parse_label_rectangle_node), + (xml_create_label_node): + * pixmaps/ex-rect-size.png: + * src/print.c: (clip_to_outline), (clip_punchouts): + * src/template-designer.c: (construct_rect_size_page), + (rect_size_page_prepare_cb), (layout_page_prepare_cb), + (build_template): + * src/template-designer.glade: + * src/xml-label-191.c: (xml191_parse_label): + Modifications to allow separate horizontal (x_waste) and vertical (y_waste) + properties for rectangular labels. Templates remain backwards compatible, + but this breaks the libglabels API (I don't know of anyone outside of + glabels using libglabels at this time -- what can I say, the program is + is still "unstable"). This addresses the suggestion in Feature Request + #976313. + +2004-07-05 Jim Evins + * src/print.c: (print_crop_marks), (draw_outline): + Changed crop marks and label outlines to black, instead of 25% gray. + This addresses debian Bug #257460. + +2004-07-05 Jim Evins + + * src/object-editor-fill-page.c: (gl_object_editor_set_fill_color): + * src/object-editor-line-page.c: (gl_object_editor_set_line_color): + Preserve "is_default" of fill and line color_combos when creating from + existing objects. + +2004-07-02 Jim Evins + + * data/glabels.1: + Created man page. Based on page submitted by Matthew J. Lockner, however + it has been severely edited. + + * data/avery-other-templates.xml + * data/misc-other-templates.xml: + Started new files for predefined templates with non-standard sheet sizes. + These have been initially populated with the Avery 06141 and + OfficeMax #86112, both provided by Matthew J. Lockner. + + * data/Makefile.am: + Install above manpage and template files. + + * glabels.spec.in: + Make sure we install man pages. + + * src/glabels-batch.c: + Changed short form of help option to '-?' to be consistent with glabels. + + * AUTHORS: + Added acknowledgement for above labels. + +2004-07-02 Jim Evins + + * src/glabels.c: (main), (save_session_cb): + - Now include libbonoboui.h, recent.h, and file.h to provide missing + prototypes. + - save_session_cb() now returns gboolean. + - Minor formatting changes. + + * src/window.h: + * src/window.c: + - Now include file.h to provide missing prototype. + - gl_window_get_type() now returns GType, not guint. I believe this may + ultimately be cause of the segfault reported in Bug #982287, since + GType is actually a gulong, which may not be compatible on other + architectures (64bit) -- I cannot personally test this at this time. + I was sloppy in several other xxx_get_type() functions which also + returned guint -- see next group of files: + + * src/window.c: (gl_window_get_type): + * src/canvas-hacktext.c: (gl_canvas_hacktext_get_type): + * src/canvas-hacktext.h: + * src/hig.c: (gl_hig_alert_get_type), (gl_hig_dialog_get_type), + (gl_hig_category_get_type), (gl_hig_vbox_get_type), + (gl_hig_hbox_get_type): + * src/hig.h: + * src/label-barcode.c: (gl_label_barcode_get_type): + * src/label-barcode.h: + * src/label-box.c: (gl_label_box_get_type): + * src/label-box.h: + * src/label-ellipse.c: (gl_label_ellipse_get_type): + * src/label-ellipse.h: + * src/label-image.c: (gl_label_image_get_type): + * src/label-image.h: + * src/label-line.c: (gl_label_line_get_type): + * src/label-line.h: + * src/label-object.c: (gl_label_object_get_type): + * src/label-object.h: + * src/label-text.c: (gl_label_text_get_type): + * src/label-text.h: + * src/label.c: (gl_label_get_type): + * src/label.h: + * src/merge-properties-dialog.c: + (gl_merge_properties_dialog_get_type): + * src/merge-properties-dialog.h: + * src/merge-text.c: (gl_merge_text_get_type): + * src/merge-text.h: + * src/merge.c: (gl_merge_get_type): + * src/merge.h: + * src/object-editor.c: (gl_object_editor_get_type): + * src/prefs-dialog.c: (gl_prefs_dialog_get_type): + * src/prefs-dialog.h: + * src/prefs-model.c: (gl_prefs_model_get_type): + * src/prefs-model.h: + * src/print-dialog.c: (gl_print_dialog_get_type): + * src/print-dialog.h: + * src/template-designer.c: (gl_template_designer_get_type): + * src/template-designer.h: + * src/ui-property-bar.c: (gl_ui_property_bar_get_type): + * src/ui-property-bar.h: + * src/ui-sidebar.c: (gl_ui_sidebar_get_type): + * src/ui-sidebar.h: + * src/view-barcode.c: (gl_view_barcode_get_type): + * src/view-barcode.h: + * src/view-box.c: (gl_view_box_get_type): + * src/view-box.h: + * src/view-ellipse.c: (gl_view_ellipse_get_type): + * src/view-ellipse.h: + * src/view-highlight.c: (gl_view_highlight_get_type): + * src/view-highlight.h: + * src/view-image.c: (gl_view_image_get_type): + * src/view-image.h: + * src/view-line.c: (gl_view_line_get_type): + * src/view-line.h: + * src/view-object.c: (gl_view_object_get_type): + * src/view-object.h: + * src/view-text.c: (gl_view_text_get_type): + * src/view-text.h: + * src/view.c: (gl_view_get_type): + * src/view.h: + * src/wdgt-chain-button.c: (gl_wdgt_chain_button_get_type): + * src/wdgt-image-select.c: (gl_wdgt_image_select_get_type): + * src/wdgt-image-select.h: + * src/wdgt-media-select.c: (gl_wdgt_media_select_get_type): + * src/wdgt-media-select.h: + * src/wdgt-mini-preview.c: (gl_wdgt_mini_preview_get_type): + * src/wdgt-mini-preview.h: + * src/wdgt-print-copies.c: (gl_wdgt_print_copies_get_type): + * src/wdgt-print-copies.h: + * src/wdgt-print-merge.c: (gl_wdgt_print_merge_get_type): + * src/wdgt-print-merge.h: + * src/wdgt-rotate-label.c: (gl_wdgt_rotate_label_get_type): + * src/wdgt-rotate-label.h: + - Made sure all xxx_get_type functions returned GType, not guint. This + was the case in hig.[ch], window.[ch], ui-property-bar.[ch], + ui-sidebar.[ch], view.[ch], wdgt-image-select.[ch], + wdgt-media-select.[ch], wdgt-mini-preview.[ch], wdgt-print-copies.[ch], + wdt-print-merge.[ch], and wdgt-rotate-label.[ch]. See separate + window.[ch] details above for more info. + - Reconciled various coding style differences in all xxx_get_type() + functions: + * All prototypes include G_GNUC_CONST. + * All prototypes specify the return value as GType, not GtkType + or guint. + * Info structures are all declared as "static const." + * Generalized the names of type and info variables. + * Miscelaneous formatting. + +2004-06-08 Jim Evins + + * src/label.c: + * src/label.h: + * src/xml-label.c: + * AUTHORS: + Don't touch compression of original file -- still defaults to 9 for + new files. Original patch provided by Javier Donaire Segarra + (#912252 in patch tracker). + +2004-05-05 Jim Evins + + * data/glabels-2.0.dtd: + Broke DTD previously when adding new barcode types that contain a + plus sign (+). Simply changed the BC_STYLE_TYPE entity to "CDATA" + to avoid the problem. + * data/avery-iso-templates.xml: + * data/zweckform-iso-templates.xml: + * AUTHORS: + Added templates for Avery 7165, Zweckform 3688, 4732, and 6021. Templates + provided by Frank Altpeter. + * libglabels/xml-template.c: (xml_create_label_node): + Reordered markup and layout sub-nodes so that resulting templates will + validate against DTD. + +2004-03-13 Jim Evins + + * src/object-editor-size-page.c: (gl_object_editor_prepare_size_page): + Changed spin callback signals from "value-changed" back to "changed." + This was accidentally introduced in a previous revision, and can cause + size changes just by selecting the size tab. + +2004-03-06 Jim Evins + + * src/view.c: (draw_grid_layer): + For round labels (round and cd) adjust grid so that it lines up with + center of label. Also, no longer draw box around label in the grid layer, + it is hidden by he fg layer anyway. Feature suggested by + nemolivier@free.fr. Although the grid is aligned with the center of the + label, the coordinate system is still relative to the upper left corner + of the rectangle containing the label. + +2004-02-25 Jim Evins + + * configure.in: + Changed version to 2.0pre1cvs + + * libglabels/xml-template.c: (gl_xml_template_parse_templates_doc): + Removed extra xmlFreeDoc() calls upon error. Also print the doc->URL + instead of doc->name fields when errors encountered. + +2004-02-21 Jim Evins + + * data/avery-iso-templates.xml: + Added aliases for Avery 8651. Patch provided by Wayne Schuller. + + * glabels.spec.in: + Added libglabels library and include file to installed files. + + * configure.in: + Final prep for 1.93.3. + +2004-02-20 Jim Evins + + * src/glabels-batch.c: (main): + Changed key for setting output filename to GNOME_PRINT_KEY_OUTPUT_FILENAME + as suggested by Javier Donaire Segarra. This addresses bug #901063. + +2004-02-16 Jim Evins + + * configure.in: + If gtk+ >= 2.3.2 then define HAVE_FILE_CHOOSER. + + * src/Makefile.am: + Added HAVE_FILE_CHOOSER to INCLUDES. + + * src/file.c: (gl_file_open), (open_response), (gl_file_open_real), + (gl_file_save_as), (save_as_response): + Ported to use GtkFileChooserDialog if HAVE_FILE_CHOOSER is defined. + +2004-02-16 Jim Evins + + * src/xml-label-04.c: (xml04_parse_image_props): + * src/xml-label-191.c: (xml191_parse_image_props): + * src/xml-label.c: (xml_parse_object_image): + Delay setting image size until after image has been applied to new + object. + +2004-02-15 Jim Evins + + * src/label-barcode.c: (gl_label_barcode_set_data), + (gl_label_barcode_set_props): + Don't emit "changed" signal, if no change actually made for these + methods. Reduces number of unnecessary redraws of barcodes. + + * src/label-object.h: + * src/label-object.c: (gl_label_object_set_position), + (gl_label_object_set_position_relative), (set_size), + (gl_label_object_set_size), + (gl_label_object_set_size_honor_aspect): + Don't emit "changed" signal, if no change actually made for these + methods. + +2004-02-15 Jim Evins + + * data/glabels-2.0.dtd: + Added specific subtypes for various barcode types. + + * src/bc.h: + * src/bc.c: (id_to_index), (name_to_index), (gl_barcode_new), + (gl_barcode_get_styles_list), (gl_barcode_default_digits), + (gl_barcode_can_text), (gl_barcode_text_optional), + (gl_barcode_can_csum), (gl_barcode_csum_optional), + (gl_barcode_id_to_name), (gl_barcode_name_to_id): + Changed API to use a string id, rather than a fixed enumeration. Id and + name are separate strings. Added entries to backend table for specific + subtypes for various barcode types. + + * src/bc-postnet.h: + * src/bc-postnet.c: (gl_barcode_postnet_new), (postnet_code), + (is_length_valid): + Modified to conform to above API. Now more stringent with data length + for various subtypes. + + * src/bc-gnubarcode.h: + * src/bc-gnubarcode.c: (gl_barcode_gnubarcode_new), + (is_length_valid), (is_length1_valid), (is_length2_valid): + Modified to conform to above API. Now more stringent with data length + for various subtypes. + + * src/label-barcode.h: + * src/label-barcode.c: (copy), (gl_label_barcode_set_props), + (gl_label_barcode_get_props), (get_size): + Modified to use above API for storing barcode type. + + * src/object-editor.h: + * src/object-editor-bc-page.c: (style_changed_cb), + (gl_object_editor_set_bc_style), (gl_object_editor_get_bc_style): + Modified to use above API for storing barcode type. + + * src/object-editor-size-page.c: + (gl_object_editor_prepare_size_page), (aspect_toggle_cb), + (w_spin_cb), (h_spin_cb), (size_reset_cb): + Added debug markers. + + * src/object-editor.glade: + Made barcode style combo's text entry non-editable. + + * src/print.c: (draw_barcode_object): + Modified to use above API for barcode type. + + * src/view-barcode.c: (update_object_from_editor_cb), + (update_editor_from_object_cb), + (gl_view_barcode_create_event_handler), (draw_barcode): + Modified to use above API for barcode type. + + * src/xml-label-04.c: (xml04_parse_barcode_props): + * src/xml-label-191.c: (xml191_parse_barcode_props): + * src/xml-label.c: (xml_parse_object_barcode), + (xml_create_object_barcode): + Modified to use above API for barcode type. + +2004-02-07 Jim Evins + + * src/stock-pixmaps/Makefile.am: + * src/stock-pixmaps/stock_hchain_24.png: + * src/stock-pixmaps/stock_hchain_broken_24.png: + * src/stock-pixmaps/stock_vchain_24.png: + * src/stock-pixmaps/stock_vchain_broken_24.png: + Added chain pixmaps borrowed from the gimp's default theme. + + * src/stock.h: + * src/stock.c: (gl_stock_init), (add_button_icon): + Added above pixmaps to stock icon sets. Created add_button_icon() to + add these pixmaps sized as GTK_ICON_SIZE_BUTTON. + + * src/wdgt-chain-button.h + * src/wdgt-chain-button.c + * src/Makefile.am: + * po/POTFILES.in: + Added this Modified version of gimpchainbutton widget, borrowed from + the gimp. + + * AUTHORS: + Added acknowledgements of the above borrowing from the gimp. + + * src/object-editor-size-page.c: (aspect_toggle_cb), (w_spin_cb), + (h_spin_cb): + * src/object-editor.c: (gl_object_editor_construct_chain_button): + * src/object-editor.glade: + Replaced the keep aspect ratio check box with the above chain-button + widget. + + * src/text-node.c: (gl_text_node_equal): + * src/text-node.h: + Added function gl_text_node_equal() to compare text_nodes. + + * src/label-image.c: (gl_label_image_set_filename): + Replaced incomplete text_node comparison code with invocation of + gl_text_node_equal. This fixed the problem of not being able to + resize an image using the object_editor if the aspect ratio is not + locked. + +2004-02-04 Jim Evins + + * src/object-editor-image-page.c: + (gl_object_editor_prepare_image_page): + Track "changed" signal of pixmap entry's GtkEntry rather than its + "activate" signal -- this catches all changes to the entry rather than + just changes resulting from a browse, so one can easily pull previous + entries from the history. (This change is marked below on 2004-02-03, + but somehow never got checked in.) + + * src/view-highlight.c: (sl_resize_event_handler), + (sr_resize_event_handler), (st_resize_event_handler), + (sb_resize_event_handler): + Side resize handles will now confirm the actual resize that the object + accepted before adjusting position parameters. Previously some interesting + things happened when resizing a barcode to its minimum size. + +2004-02-03 Jim Evins + + * src/object-editor-image-page.c: + (gl_object_editor_prepare_image_page): + Track "changed" signal of pixmap entry's GtkEntry rather than its + "activate" signal -- this catches all changes to the entry rather than + just changes resulting from a browse, so one can easily pull previous + entries from the history. + + * src/view-highlight.c: (tl_resize_event_handler), + (tr_resize_event_handler), (bl_resize_event_handler), + (br_resize_event_handler): + Allow control key to be dropped while dragging a corner resize handle + without losing the aspect ratio lock. + +2004-02-02 Jim Evins + + * src/label-image.c: (gl_label_image_set_filename): + When setting a new filename adjust size such that the aspect ratio of + the image is preserved using the current size as a bounding box. + + * src/view-image.c: (update_object_from_editor_cb): + When updating object from editor, feed back possible size changes to + editor as a result of a possible change in image. + + * src/object-editor-size-page.c: (size_reset_cb): + Fixed typo when blocking spin handlers. If the base size is larger than + the max size, treat max size as a bounding box while keeping aspect + ratio. + + +2004-02-02 Jim Evins + + * src/label-object.h: + * src/label-object.c: (gl_label_object_set_size), + (gl_label_object_set_size_honor_aspect): + Added gl_label_object_set_size_honor_aspect() which will maintain the + current aspect ratio by modifying the supplied w or h apropriately. + + * src/view-highlight.c: (tl_resize_event_handler), + (tr_resize_event_handler), (bl_resize_event_handler), + (br_resize_event_handler): + Corner handles will now maintain the current aspect ratio if the + control key is pressed while resizing. This addresses feature + request #816603. + + +2004-01-31 Jim Evins + + * AUTHORS: + * data/avery-us-templates.xml: + Added entries for "LSK-3," "LSK-5," and "LSK-8." Submitted by JBadger. + + * libglabels/template.c: (read_template_files_from_dir): + Corrected problem with testing for extensions. + + * src/object-editor.glade: + Corrected grouping of radio buttons in barcode data page. + + * src/print.c: (draw_barcode_object): + * src/view-barcode.c: (draw_barcode): + Corrected problem with calculation of y_offset for locating characters. + +2004-01-24 Jim Evins + + * AUTHORS: + * data/avery-us-templates.xml: + Added Avery 5824, submitted by Fred Bacon. + +2004-01-20 Jim Evins + + Catching up on a couple of backlogged user template submissions. + + * data/avery-iso-templates.xml: + Added "DECAdry OLW-4731" and "DECAdry DLW-1731" aliases for Avery 7160. + Suggested by Linas Jakucionis. + + * data/zweckform-iso-templates.xml: + Added Zweckform 4760, submitted by Thomas Vill. + + * AUTHORS: + Updated to reflect above submissions. + +2004-01-06 Jim Evins + + Split-out template.[ch], paper.[ch], xml-template.[ch], xml-paper.[ch], and + xml.[ch] into a separate library called libglabels, to facilitate third + party use of glabels template files. This was suggested by Wayne Schuller. + Once split-out, some modifications to the structures and functions to + make a cleaner more useful API, hopefully. Rather extensive changes have + propogated to other modules. + + * src/paper.h: + * src/paper.c: + * src/template.h: + * src/template.c: + * src/xml-paper.h: + * src/xml-paper.c: + * src/xml-template.h: + * src/xml-template.c: + * src/xml.h: + * src/xml.c: + These files have been moved to libglabels/. API cleanup performed. + + * libglabels/libglabels.h: + * libglabels/libglabels-private.h: + * libglabels/Makefile.am: + These files have been added to finish out libglabels. + + * Makefile.am: + * configure.in: + * glabels.spec.in: + * po/POTFILES.in: + * src/Makefile.am: + Modified to reflect new sets of files in src/ and libglabels/. + + * COPYING.LIBGLABELS: + * COPYING-DOCS: + Added copy of the LGPL for libglabels, and a copy the GFDL for + documentation. + + * src/glabels-batch.c: + * src/glabels.c: + * src/label.c: (gl_label_finalize), (gl_label_set_template), + (gl_label_get_size): + * src/label.h: + * src/prefs-model.c: (gl_prefs_model_load_settings): + * src/print-dialog.c: + * src/print.c: (gl_print_simple), (gl_print_merge_collated), + (gl_print_merge_uncollated), (gl_print_batch), (print_info_free), + (print_crop_marks), (print_label), (draw_outline), + (clip_to_outline), (clip_punchouts): + * src/template-designer.c: (construct_pg_size_page), + (pg_size_page_changed_cb), (layout_page_changed_cb), + (print_test_cb), (build_template): + * src/util.c: (gl_util_fraction): + * src/util.h: + * src/view.c: (draw_bg_fg_layers), (draw_bg_fg_rect), + (draw_bg_fg_rounded_rect), (draw_bg_fg_round), (draw_bg_fg_cd), + (draw_bg_fg_cd_bc), (draw_markup_layer), (draw_markup_margin), + (draw_markup_margin_rect), (draw_markup_margin_rounded_rect), + (draw_markup_margin_round), (draw_markup_margin_cd), + (draw_markup_margin_cd_bc), (draw_markup_line), + (draw_markup_circle), (gl_view_copy): + * src/wdgt-media-select.c: (gl_wdgt_media_select_construct), + (page_size_entry_changed_cb), (details_update), (get_layout_desc), + (get_label_size_desc): + * src/wdgt-mini-preview.c: + (gl_wdgt_mini_preview_set_label_by_name), (mini_outline_list_new), + (cdbc_item): + * src/wdgt-print-copies.c: (gl_wdgt_print_copies_construct): + * src/wdgt-print-merge.c: (gl_wdgt_print_merge_construct): + * src/wdgt-rotate-label.c: (mini_preview_canvas_update), + (gl_wdgt_rotate_label_set_template_name), (cdbc_item): + * src/wdgt-rotate-label.h: + * src/xml-label-04.c: (xml04_parse_media_description): + * src/xml-label-191.c: (gl_xml_label_191_parse), + (xml191_parse_sheet), (xml191_parse_label), (xml191_parse_layout), + (xml191_parse_markup), (xml191_parse_alias): + * src/xml-label.c: (xml_doc_to_label), (xml_parse_label), + (xml_label_to_doc): + Various changes to accomodate new libglabels API. + +2004-01-03 Jim Evins + + * configure.in: + Release 1.93.2. + +2004-01-03 Jim Evins + + * AUTHORS: + Added acknowledgement of contributions by Wayne Schuller. + + * src/commands.c: (gl_cmd_file_print): + Create extra reference to print dialog, so that it can be properly re-used. + + * src/mygal/mygal-combo-box.h: + * src/mygal/mygal-combo-box.c: + (mygal_combo_box_popup_hide_unconditional), + (mygal_combo_box_popup_display), (mygal_combo_box_set_display), + (gtk_combo_set_tearoff_state), (mygal_combo_box_construct), + (mygal_combo_box_set_arrow_relief), (mygal_combo_box_set_title), + (mygal_combo_box_set_tearable): + Changed all occurances of GTK_IS_COMBO_BOX to MYGAL_IS_COMBO_BOX, to + complete the rename of this widget to prevent namespace collisions + with Gtk+-2.3. + + * src/prefs-dialog.glade: + Fixed alignment of Fill/Color widgets. + +2004-01-03 Jim Evins + + * data/avery-iso-templates.xml: + Added user submitted templates. + Avery 8435A & 8435B, submitted by Ludger Solbach. + + * doc/C/glabels.xml: + Added minimal documentation, noting the new template designer. + +2004-01-03 Jim Evins + + * pixmaps/ex-rect-size.png: + * pixmaps/ex-round-size.png: + * pixmaps/ex-cd-size.png: + * pixmaps/Makefile.am: + Added ex-rect-size.png, ex-round-size.png, and ex-cd-size.png image + files to be used as illustrations/examples in the template-designer. + + * src/template-designer.c: (construct_rect_size_page), + (construct_round_size_page), (construct_cd_size_page), + (construct_nlayouts_page), (rect_size_page_prepare_cb), + (round_size_page_prepare_cb), (cd_size_page_prepare_cb), + (layout_page_prepare_cb), (build_template): + * src/template-designer.glade: + Added illustrations for rectangle, round, and cd label size pages. + Added margin spinboxes to these pages, and now add a margin markup + to the constructed template. Added realistic default values for + some of the size spinboxes. Cleaned up the code for setting spinbox + ranges on the layouts page. + +2004-01-02 Jim Evins + + * src/object-editor-size-page.c: (h_spin_cb): + Fixed cut-n-paste error in h_spin_cb that loaded h from + the wrong spinbutton. + + * src/object-editor.h: + * src/object-editor.c: (gl_object_editor_class_init), + (gl_object_editor_changed_cb), (gl_object_editor_size_changed_cb): + * src/object-editor-private.h: + * src/object-editor-size-page.c: (w_spin_cb), (h_spin_cb), + (size_reset_cb): + Added "size_changed" signal. + + * src/view-text.c: (construct_properties_editor), + (update_object_from_editor_cb), + (update_object_from_editor_size_cb): + Track size changes from object editor separately from other + properties. This is so the default size (0,0) of a text + object is not modified unintentionally. + +2003-12-30 Wayne Schuller + + Added feature: line spacing - allows you to comfortably space a text box to + fit a label perfectly. + + * data/glabels-2.0.dtd: + * src/label-object.c: (gl_label_object_set_text_line_spacing), + (gl_label_object_get_text_alignment), + (gl_label_object_get_text_line_spacing): + * src/label-object.h: + * src/label-text.c: (gl_label_text_class_init), + (gl_label_text_instance_init), (copy), (get_size), + (set_text_line_spacing), (get_text_alignment), + (get_text_line_spacing): + * src/object-editor-private.h: + * src/object-editor-text-page.c: + (gl_object_editor_prepare_text_page), + (gl_object_editor_set_text_line_spacing), + (gl_object_editor_get_text_line_spacing): + * src/object-editor.glade: + * src/object-editor.h: + * src/prefs-dialog.c: (construct_object_page), + (update_object_page_from_prefs), (update_prefs_from_object_page): + * src/prefs-dialog.glade: + * src/prefs-model.c: (gl_prefs_model_save_settings), + (gl_prefs_model_load_settings), (get_float): + * src/prefs-model.h: + * src/print.c: (draw_text_object): + * src/ui-sidebar.c: + * src/view-text.c: (update_object_from_editor_cb), + (update_editor_from_object_cb), + (gl_view_text_create_event_handler), (draw_hacktext): + * src/view.c: (gl_view_construct), + (gl_view_set_selection_text_line_spacing), + (gl_view_set_default_text_line_spacing), + (gl_view_get_default_text_line_spacing): + * src/view.h: + * src/xml-label.c: (xml_parse_toplevel_span), + (xml_create_toplevel_span): + +2003-12-30 Jim Evins + + * src/template-designer.c: + * src/template-designer.h: + * src/template-designer.glade: + New template designer assistant. + + * po/POTFILES.in: + * src/Makefile.am: + Added entries for src/template-designer.* files. + + * pixmaps/ex-1layout.png + * pixmaps/ex-2layouts.png + * pixmaps/Makefile.am: + Added the new image files ex-*.png used as illustrations in the + template designer assistant. + + * src/print-dialog.h: + * src/print-dialog.c: (gl_print_dialog_finalize), + (gl_print_dialog_new), (gl_print_dialog_construct), + (gl_print_dialog_force_outline_flag): + Changed first argument of gl_print_dialog_new() from glView to glLabel, + to support printing from the template designer assistant which does not + have a full-fledged view. Nothing else from the view object was being + used by the dialog anyway. + + Added the gl_print_dialog_force_outline_flag() method, for better + integration with the template designer assistant. + + + * src/commands.h: + * src/commands.c: (gl_cmd_file_template_designer), + (gl_cmd_file_print): + Modified print command to provide label instead of view to dialog. + Added the gl_cmd_file_template_designer() command to invoke the + template designer assistant. + + * src/ui.c: + * src/glabels-ui.xml: + Added support for template designer assistant. + + * src/wdgt-mini-preview.h: + * src/wdgt-mini-preview.c: (gl_wdgt_mini_preview_set_template), + (gl_wdgt_mini_preview_set_bg_color): + Preview is now centered in canvas. Added + gl_wdgt_mini_preview_set_bg_color() to allow the template designer + assistant to match the background color with its own. + + * src/print.c: (clip_to_outline): + Fixed really stupid bug when adding waste to clip region of rectangular + labels/cards. Each side of the clip region needs to be extended by + twice the waste margin, as well as negatively offset by the waste + margin. + +2003-12-28 Jim Evins + + * src/prefs-dialog.c: (update_object_page_from_prefs): + Block intermediary function align_toggle_cb() instead of + update_prefs_from_object_page() for the three alignment + widgets. + +2003-12-28 Wayne Schuller + + * src/file.c: (gl_file_new), (gl_file_properties): + Swap button order and set default for higificatory pleasure. + +2003-12-27 Jim Evins + + * barcode-0.98/Makefile.am: + One last time: removed doc/Makefile and po/Makefile.in.in from + EXTRA_DIST files. + +2003-12-27 Jim Evins + + * barcode-0.98/Makefile.am: + Removed config.stat entry from EXTRA_DIST files. + + * barcode-0.98/Makefile.in: + Removed. + +2003-12-27 Jim Evins + + * configure.in: + Updated to work with latest gnome-common package from CVS. + Removed recursive configuration of barcode-0.98. + + * acconfig.h: + * macros/*: + Removed. + + * Makefile.am: + Added barcode-0.98/ as a SUBDIR, and removed dist-hook. + + * barcode-0.98/Makefile.in: + * barcode-0.98/configure.in: + * barcode-0.98/Makefile.am: + * barcode-0.98/README.glabels: + Modified to ignore the barcode package's build system, and build + as a part of glabels. + Renamed Makefile.in to Makefile.in.dist. + Renamed configure.in to configure.in.dist. + Added barcode-0.98/Makefile.am and barcode-0.98/README.glabels. + + * src/Makefile.am: + * src/mygal/Makefile.am: + * src/recent-files/Makefile.am: + In order to build against the GNOME 2.5 platform, + all use of *_DISABLE_DEPRECATED compile-time flags has been removed. + + * src/mygal/Makefile.am: + * src/mygal/mygal-combo-box.c: + * src/mygal/mygal-combo-box.h: + * src/mygal/widget-color-combo.c: + * src/mygal/widget-color-combo.h: + * po/POTFILES.in: + In order to build against the GNOME 2.5 platform, + Renamed gtk_combo_box widget to mygal_combo_box, to prevent namespace + collisions with the real gtk_combo_box widget, now a part of gtk. + +2003-12-26 Jim Evins + + * src/paper.c: + * src/template.c: + * src/util.c: + * src/util.h: + Moved local versions of get_home_data_dir() in paper.c and + template.c to util package. Cleaned up formatting in + util.[ch]. + + * src/template.c: + In gl_template_register() save a copy of the template in + ~/.glabels if the template is not known. Still need to + handle duplicate filename case and duplicate name but + different template case. + + * src/xml-label.c: + * src/xml.h: + Moved local definition of NAME_SPACE macro from xml-label.c + to xml.h. + + * src/xml-template.c: + * src/xml-template.h: + Added function gl_xml_template_write_template_to_file(), used + in gl_template_register(). diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..23e5f25d --- /dev/null +++ b/INSTALL @@ -0,0 +1,236 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..d7b22a01 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,31 @@ +## Process this file with automake to produce Makefile.in + +LIB_BARCODE_DIR = barcode-0.98 +LIB_IEC16022_DIR = iec16022-0.2.1 + +SUBDIRS = \ + po \ + $(LIB_BARCODE_DIR) \ + $(LIB_IEC16022_DIR) \ + libglabels \ + src \ + data \ + help \ + docs + +EXTRA_DIST = \ + README \ + COPYING.README_FIRST \ + COPYING \ + COPYING-DOCS \ + COPYING-LIBGLABELS \ + AUTHORS \ + ChangeLog \ + INSTALL \ + NEWS \ + TODO \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in \ + glabels.spec.in \ + glabels.spec diff --git a/NEWS b/NEWS new file mode 100644 index 00000000..9fd2b224 --- /dev/null +++ b/NEWS @@ -0,0 +1,169 @@ +* gLabels 2.2.5 (stable) release. Release date 2009-04-30 + +- Fixed spinbutton/adjustment bugs that made glabels unusable with Gtk 2.16. +- Fixed default preview colors in color combos. +- Updated german translation (Mario Blättermann). +- New templates. + + +* gLabels 2.2.4 (stable) release. Release date 2008-12-22 + +- Corrected button order in "Open" and "Save as" dialogs. +- Fixed performance problem when large number of fonts are installed. +- Corrected several i18n problems. +- Fixed "paste" bug that created phantom object views. +- Fixed performacne problem when many objects are selected. +- New templates. + + +* gLabels 2.2.3 (stable) release. Release date 2008-08-17 + +- Explicitely set page size when printing -- don't let print back-end use + a default size (Bug #2049431). +- Sets more appropriate object size limits for any aspect ratio (Bug #1993550). +- Fixed crash of glabels-batch (Bug #1968653). +- Fixed bug with barcode and image merge radio buttons (Bug #1959135). +- Will now attempt to parse newer namespaces (Bug #1872584). +- Fixed drawing errors when drawing markup on rotated labels. +- New korean translation (xein@navir.com). +- New templates. + + +* gLabels 2.2.2 (stable) release. Release date 2008-02-22 + +- Fixed crash when creating Code128C barcode (Bug #1766425). +- Explicitely set page size when printing "other" page size. +- Fixed rendering bug with bitmap fonts. +- Fixed rendering problem when displaying "Invalid barcode data". +- Fixed crash when deleting multi-object selections. +- Enforce minimum size for images to prevent rendering of images of zero size. +- Fixed problem with image size spinboxes (Bug #1886438). +- Fixed template example in documentation. +- Use default units when writing xml files. +- New templates. + +* gLabels 2.2.1 (stable) release. Release date 2008-01-23 + +- Sort font lists alphabetically. +- Sort evolution records by "file_under" field. +- Fixed clipping bug when rotating labels. + + +* gLabels 2.2.0 (stable) release. Release date 2007-12-26 + +- Migrated from EggRecent to GtkRecentManager +- Migrated from libgnomeprint to GtkPrintOperation and Cairo. +- Migrated from libgnomeprint to Pango for text layout. +- Migrated GnomeDruid to GtkAssistant for template designer. +- Migrated from GnomeCanvas to Cairo. +- Removed all deprecated widgets as of Gnome-2.16/Gtk-2.10. +- Added categorization of templates and an updated New Label dialog. +- New label dialog now allows selection of recently used templates +- Removed splash screen. +- Added initial support for datamatrix 2D barcodes. +- Added support for Brazilian CEPNet barcodes. +- Added shadow attribute to label objects. +- New merge backend for evolution data server (Austin Henry) +- Various bug fixes. +- New templates. + + +* gLabels 2.1.5 (unstable) release. Release date 2007-12-09. + +- New label dialog now allows selection of recently used templates +- Store brand and part number as separate fields in templates +- Major cleanup of libglabels API and documentation +- Minor bug fixes (and probably some new bugs). + + +* gLabels 2.1.4 (unstable) release. Release date 2007-08-17. + +- Added categorization of templates and an updated New Label dialog. +- Added initial support for datamatrix 2D barcodes. +- Migrated from EggRecent to GtkRecentManager. +- Migrated from libgnomeprint to GtkPrintOperation and Cairo. +- Migrated from libgnomeprint to Pango for text layout. +- Migrated GnomeDruid to GtkAssistant for template designer. +- Migrated from GnomeCanvas to Cairo. +- Removed splash screen. +- Added support for Brazilian CEPNet barcodes. +- Updated French translation (Claude Paroz) +- New Esperanto translation (Antonio C. Codazzi) +- Minor bug fixes (and probably some new bugs). +- New templates. + + +* gLabels 2.1.3 (unstable) release. Release date 2006-05-27. + +- Don't print "Invalid barcode data" if data field is empty. (Bug #1479839) (Darren Warner) +- Fixed hangup when grid or markup have been toggled during a previous session. (Bug #1434324) +- Added shadow attribute to label objects. +- Fixed color groups in color combo widgets. +- Fixed several potential crashes. + + +* gLabels 2.1.2 (unstable) release. Release date 2005-12-21. + +- Updated Italian translation (Daniele Medri) +- Fixed double entry in property bar's font family combobox +- Don't allow zero width or height when drawing pixbufs +- Fixed various memory leaks +- New configure option to disable update-mime-database and update-desktop-database +- New merge backend for evolution data server (Austin Henry) +- New minimal merge backend for VCards using evolution data server API (Austin Henry) +- New templates and fixes + + +* gLabels 2.1.1 (unstable) release. Release date 2005-06-21. + +- Added document merge tutorial to help documentation +- Replaced deprecated widgets (now requires Gnome 2.10 and GTK+ 2.6) +- Replaced libbonoboui with GtkUIManager (now requires Gnome 2.10 and GTK+ 2.6) +- Updated Russian translation (Vitaly Lipatov) +- Updated Spanish translation (Sergio Rivadero) +- Updated Czech translation (David Makovský and Zbynek Mrkvick) +- Updated Italian translation (Daniele Medri) +- Added documentation for libglabels +- Minor bug fixes and cleanup +- New templates + + +* gLabels 2.1.0 (unstable) release. Release date 2005-01-22. + +- Added ability to select color from merge source (Frederic Ruaudel) +- See 2.0.2 + + +* gLabels 2.0.2 release. Release date 2005-01-22. + +- Desktop file reconciled with desktop-entry-spec +- New cleaned-up icon +- Added option to glabels-batch to allow selection of first label. +- Added options to glabels-batch to allow selection of merge source and crop marks. + (José Dapena Paz) +- Updated french translation (Florent Morel) +- Fixed translation problem with object editor labels +- Minor bug fixes and cleanup +- New templates + +* gLabels 2.0.1 release. Release date 2004-08-15. + +- Fixed crash when reading some labels created with 1.93.x. +- Updated japanese translations (Takeshi AIHANA) +- Fixed crash from improperly freeing translation strings. + + +* gLabels 2.0.0 release. Release date 2004-08-09. + +- Fixed crash when encountering old template files +- Align grid to label center for DVD/CD and round labels +- Don't touch compression of original file +- 64-bit fixes +- Added man page +- Fixed missing outline problem experienced with some printers +- Added separate horizontal and vertical waste properties for rectangular templates +- Added option to auto-shrink text during document merge +- Fixed memory leaks +- Added format attibute to barcode objects, to allow correct layout of merged labels +- Fixed mime type registration for GNOME 2.6 + diff --git a/README b/README new file mode 100644 index 00000000..a8c42416 --- /dev/null +++ b/README @@ -0,0 +1,44 @@ +Copyright +========= + + Copyright (C) 2001-2007 Jim Evins + + gLabels contains components copyrighted by others -- see th 'AUTHORS' file in + this directory. + + For license information see the 'COPYING.README_FIRST' file in this directory. + + + +What is gLabels +=============== + +gLabels is a small stand-alone program for creating labels and business +cards using a laser or ink-jet printer. + + + +System Requirements +=================== + +GTK+-2.10.x +LIBGNOME[UI]-2.16.x +LIBXML-2.6.x +LIBGLADE-2.6.x + +All of these libraries are available as part of Gnome 2.16 + + + +Author and Acknowledgments: +=========================== + +See the AUTHORS file. + + + +Website +======= + +http://glabels.sourceforge.net/ + diff --git a/TODO b/TODO new file mode 100644 index 00000000..ed3140cc --- /dev/null +++ b/TODO @@ -0,0 +1,46 @@ + +Development plan +---------------- +This development plan sets a specific set of milestones for future versions of glabels. + + +Goals for 2.2.x: + + - Bugfixes + + - Translations + + +Possible Goals for 2.3.x (current development branch): + + - Undo, Redo capability + + - Make text items rich. I.e. allow multiple characteristics + to exist within a single object. + + - Text effects. (follow contour, non-rectangular text boxes, + ...) + + - Ability to select/unselect individual records during a merge-print. + + - Add additional "merge" backends. Candidates include: + generic XML + freedb (CDDB) for CD labels + gnome-db + ADIF for generating QSL-cards + + - Printer calibration tool: a facility for tweaking output origin and + scale. This should really be part of the underlying print system but + currently is not, so I may want to add the hack. + + - Adjustable grid spacing. Spacing of visible grid should be user + adjustable. This grid spacing should be an integral multiple of + a finer invisible grid. There should be a "snap to grid" toggle, + that causes all posistioning and sizing performed on the canvas + to snap to the closest grid. The possible grid spacing should be + appropriate for the current units selected (e.g. .1 points, .01 mm, + 1/64 inch, 0.001 inch). + + - Allow for management of custom templates + (i.e. delete, rename, edit). + diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 00000000..66bb0fd8 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +REQUIRED_AUTOMAKE_VERSION=1.8 + +PKG_NAME="glabels" + +(test -f $srcdir/configure.in \ + && test -f $srcdir/README \ + && test -d $srcdir/src) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +} + +which gnome-autogen.sh || { + echo "You need to install gnome-common from the GNOME CVS" + exit 1 +} +USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh + diff --git a/barcode-0.98/COPYING b/barcode-0.98/COPYING new file mode 100644 index 00000000..a43ea212 --- /dev/null +++ b/barcode-0.98/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/barcode-0.98/ChangeLog b/barcode-0.98/ChangeLog new file mode 100644 index 00000000..024706de --- /dev/null +++ b/barcode-0.98/ChangeLog @@ -0,0 +1,460 @@ +2002-03-01 Alessandro Rubini + + * library.c (Barcode_Encode): handle bitsets separately, like + in Barcode_Print (otherwise, you might loose NO_CHECKSUM). + + * debian/changelog: moved to 0.98 (but should fix all debian/ stuff) + + * contrib/barcode-for-delphi.tar.gz: new, contributed by Michael Geddes + + * contrib/barcode-for-delphi.tar.gz.README: short info for file above + + * main.c (main): allow "-g" to set size of code in a table as well + -- suggested and initiallt implemented by Joachim Reichelt. + (main): fixed missing "Page: 1 1" in postscript for tables + (main): for tables don't use Encode_and_Print, use a local + unrolled version, so the default margin can be removed and + we avoid problems with negative xoff in the output phase + (first column may be offset, as noted by Karl Magnus Kolstoe) + + * doc/doc.barcode: documented change above. + + * README: removed refernces to systemy.it, I'm no more there + Added link to FreeBSD ports tree and GLabels + Organized as sections with titles + + * contrib/barcode-SVG.tar.gz: new contribution, by David J. Humphreys + + * contrib/barcode-SVG.tar.gz.README: short description of file above + + * contrib/grab-0.0.4.tar.gz: new program, by Tuukka Toivonen. + + * contrib/grab-0.0.4.tar.gz.README: short description of file above + +2002-03-01 Boszormenyi Zoltan + + * barcode.spec: new file + +2002-02-27 Alessandro Rubini + + * bookland/bookland.py: updated to version 0.92 by Judah Milgram + +2001-11-13 Alessandro Rubini + + * README: Added a pointer to the Windows port. + +2001-11-09 Cloyce D. Spradling + + * code128.c (Barcode_128b_verify): prototype fix (unsigned char). + + * ps.c (Barcode_ps_print): the comment for ascii codes must only + be printed if ascii is being printed (benign bug). + +2001-11-06 Christoph Pross + + * pcl.c (Barcode_pcl_print): bugfix: bars were misplaced + +2001-10-16 Nathan D. Holmes + + ====> Version 0.97 released to ftp.systemy.it and ftp.gnu.org + + * code93.c: new file (I modified something as well - Alessandro) + + * doc/doc.barcode (Supported Encodings): added docs for code93 + + * main.c: added code93 names + + * Makefile.in (LIBOBJECTS): added code93.o + + * library.c: added code93 entry points + +2001-10-16 Alessandro Rubini + + * doc/manpager: added (trivial) support for @itemize, added copyright + + * sample.c (main): accept -P to create PCL output + + * doc/doc.barcode (PCL Output): added the section, using text + provided by Andrea Scopece and turning it into texinfo. + Removed also a few extra newlines that made bad man pages + +2001-10-16 Andrea Scopece + + * barcode.h: added BARCODE_OUT_PCL and BARCODE_OUT_PCL_III + + * library.c (Barcode_Print): use BARCODE_OUT_PCL to select pcl_print() + + * Makefile.in (LIBOBJECTS): added pcl.o + + * pcl.c: new file, with PCL output support + +2001-10-16 Alessandro Rubini + + * doc/doc.barcode (Supported Encodings): added documentation for + EAN and UPC with checksum, as coded by mr. Böszörményi (below) + +2001-10-16 Boszormenyi Zoltan + + * ean.c: + + I found that barcode-0.96 does not correctly encodes UPC-E. + This was mainly because in upc_e_to_a() the switch() branches + all ended without "break;". + + Printing UPC-E did not print the leading encoding number and + the trailing UPC-A checksum. Now it does. + + Accept EAN-13 and EAN-8 with and without the checksum. + So always treat 7 and 12 digit sequences as valid EAN codes + and accept 8 and 13 digit sequences as valid EAN codes when + the last digit is the same as the calculated one. + + Accept UPC-A as above (11 or 12 digit sequences.) + + Accepts UPC-E as: + 6 digit sequence: the middle part of the code (leading '0' assumed) + 7 digit sequence: the middle part and either a leading '0' or '1', + or a trailing UPC-A checksum. In that case, leading '0' assumed. + 8 digit sequence: a leading '0' or '1', middle part, checksum + + UPC-A, UPC-E, EAN-13, and EAN-8 may all include + an additional barcode to the right of the main barcode. + + As a 7 or a 12 digit sequence may be ambiguous, please remember + that EAN is checked before UPC if you specified BARCODE_ANY. + +2001-08-20 Alessandro Rubini + + * sample.c (main): added upc-e and ean-8 samples + +2001-08-11 Boszormenyi Zoltan + + * ps.c (Barcode_ps_print): don't output "showpage" in EPS mode + +2001-08-11 Alessandro Rubini + + * README: Changed host names, added barcode-commit list. + +2000-11-29 Alessandro Rubini + + * doc/doc.barcode (The Field List): 1pt == 0.352mm, not 0.0352 + (thanks to Stephen Irven for reporting) + +2000-11-09 Alessandro Rubini + + ====> Version 0.96 released to ftp.systemy.it and ftp.gnu.org + + * doc/Makefile.in ($(TARGET).html): fixed bug introduced on Sep 08 + + * doc/doc.barcode (top): correctly deal with "makeinfo --html" + +2000-11-08 Alessandro Rubini + + * README: new network pointers added + + * codabar.c (Barcode_cbr_encode): don't print ascii text for the + checksum. + + * doc/doc.barcode (The Intermediate Representaion): new section + Documented the new encodings by Leonid. + Promoted two sections to chapters + Added Leonid in the AUTHORS section of the manpage. + + * Makefile.in: don't remove docs in distclean, as the distribution + now includes the docs + +2000-11-07 Alessandro Rubini + + * Makefile.in (clean): don't remove docs, do that only in distclean + + * doc/Makefile.in: a new life for the former Makefile (to build + with both gmake and pmake with features added on 2000-09-08) + + * configure.in: use $MAKE in checking for gmake if set + (to allow testing with BSD make) + Check if makeinfo can manage html, used for doc/Makefile.in + +2000-11-07 Leonid A. Broukhis + + * code128.c (Barcode_encode_as): fixed a bug that prevented F + symbols to be correctly encoded. + + * plessey.c: new file, for Plessey encoding. + + * msi.c: new file, for MSI encoding. + + * codabar.c: new file, for CodaBar encoding. + + * code128.c (Barcode_128raw_encode): new encoding + (Barcode_128raw_verify): checker for new encoding + + * barcode.h, library.c, main.c: added code128raw, codabar, + MSI and Plessey + +2000-11-07 Hans Schou + + * contrib/barcodeps-0.1.tgz: new file, sent to Alessandro on Oct 7 + +2000-10-10 Alessandro Rubini + + * doc/manpager: use gsub instead of gensub, even though it may + leas to problems with some input. This achieves compatibility + with the original awk, so gawk is not needed any more + +2000-10-02 Alessandro Rubini + + * ps.c (Barcode_ps_print): add a backslash in front of '(' too. + Suggested by H Y . + (Barcode_ps_print): use ps arrays to get compact (and prettier) + PostScript output. Suggested by Hans Schou . + + * main.c (get_geometry): accept "+offset+offset" to keep default size. + Suggested by Godmar Back . + +2000-09-16 Alessandro Rubini + + * ps.c (Barcode_ps_print): use "half text height" instead of + "two text heights" as minimum bar height. Suggested by + Oliver Vecernik . + +2000-09-14 Alessandro Rubini + + * barcode.h: added the standard ``extern "C"'' stuff for C++ + (bug reported by Dany Pardo ) + +2000-09-08 Andrea Ferraris + + * doc/Makefile: added support for pdf and html via makeinfo + + * doc/doc.barcode: added a missing trailing dot in an xref + +2000-08-28 Alessandro Rubini + + * i25.c (Barcode_i25_encode): fixed checksum calculation + (thanks to Hans Schou for reporting) + +2000-05-19 Alessandro Rubini + + ====> Version 0.95.1 released to ftp.prosa.it + + * code128.c (Barcode_128_make_array): use code C if encoding 2 digits + +2000-05-08 Alessandro Rubini + + * cmdline.c (commandline_errormsg): removed "?:" gcc extension + + * configure.in: added checks for unistd.h and strcasecmp, as + windows doesn't have them (thanks Marten Karl) + +2000-04-21 Alessandro Rubini + + * doc/Makefile: modified to build with both gmake and pmake + + * Makefile: modified to build with both gmake and pmake + +2000-04-20 Alessandro Rubini + + * Makefile.in (.depend): removed gmake-specific features. + Thanks to Jukka A. Ukkonen for reporting. + + * configure.in: detect gmake and avoid its features if not there + + * ps.c (Barcode_ps_print): fix: codes with (relatively) short bars + were enlarged in height instead of reduced in width (also + the enlarging was wrong). Thanks to Rob Seace for reporting. + +2000-04-09 Alessandro Rubini + + * code128.c (Barcode_128_encode): removed extra messages to stderr, + forgot in the code when I finished code128 support + + * doc/doc.barcode: bugfix: in the description of geometry, the unit + of measure is configurable + +2000-02-03 Alessandro Rubini + +====> Version 0.95 released to ftp.prosa.it and ftp.gnu.org + +2000-01-26 Alessandro Rubini + + * code128.c (Barcode_128_encode): new encoding: full-featured code128 + + * README: added reference to original ftp site + +2000-01-05 Alessandro Rubini + + * main.c (get_page_geometry): avoid using snprintf(), missing in HP/UX + + * code39.c (Barcode_39_verify): added missing parens (a syntax error, + but only apparent where islower() is not a macro). Thanks to + Alexandre Oliva for finding it out. + +2000-01-04 Alessandro Rubini + + * doc/doc.barcode (The API): removed spurious "flags" argument + from description of Barcode_Encode_and_Print(). + Thanks to Willy Wittesaele for noting the error. + +1999-12-24 Alessandro Rubini + + * main.c (get_geometry): fixed the y margin (thanks to Steve Kunath) + +====> Version 0.94 released to ftp.prosa.it and ftp.gnu.org + +1999-10-24 Alessandro Rubini + + * INSTALL: added instructions to install on a Debian GNU/Linux system + + * debian/*: edited information for proper Debian support + + * debian/rules (binary-arch): new file, from "deb-make" + + * Makefile.in (install): added "-m 0644" to install non-executables + + * code128.c (Barcode_128b_encode): fixed checksum calculation. + +====> Version 0.93 released to ftp.prosa.it and ftp.gnu.org + +1999-09-26 Alessandro Rubini + + * doc/doc.barcode: fixed the rendering of complex options (-g and -t) + Removed extra "table of contents" heading in the ps output + Changed attribution on cover page + + * main.c (get_table and others): be more specific in error msgs + (get_page_geometry): numeric specification is according to "-u" + (get_table): accept unsymmetric margin specification + (option_table): added "-u" to accept "cm", "mm", "in", "pt" + (get_page_geometry): bugfix: numeric spec was always consideder mm + + * cmdline.c (commandline): don't always print help + + * Makefile.in ($(INFO)): added missing dependency: distributed docs + formats were out of date with distributed doc source. + +1999-09-13 Alessandro Rubini + + * main.c (main): print tables: y used xmargin (Tim Withers,Jon Bakken) + +1999-09-06 Alessandro Rubini + + * Makefile.in: prevent -Wall when compiling getopt. + + * i25.c, ean.c, ps.c: switched to unsigned char, to prevent warnings + on newer gcc's (thanks Al Piszcz) + +====> Version 0.92 released to ftp.prosa.it and ftp.gnu.org + +1999-08-31 Alessandro Rubini + + * i25.c: the right guard was thinner than other bars + + * doc/doc.barcode: spelling and manpage fixes (thanks Joachim Schaaf) + +====> Version 0.91.4 released to ftp.prosa.it + +1999-08-23 Thad Floryan + + * main.c (strerror): replacement strerror selected by autoconf + +1999-08-06 Alessandro Rubini + + * changed all "ENODATA" in "EINVAL", as some system miss ENODATA + + * Makefile.in (all): removed ".depend" from all, as it needs gcc + + * i25.c (Barcode_i25_encode): fixed wrong free() in an unlinely path + + * ean.c (Barcode_ean_encode): don't use sprintf's result, as some + systems return a char pointer instead of the number of chars. + + * configure.in: new file, as autoconf support is being added + +====> Version 0.91.3 released to ftp.prosa.it + +1999-08-05 Alessandro Rubini + + * code128.c (Barcode_128c_encode): fixed malloc of textinfo (was short) + + * i25.c (Barcode_i25_encode): new encoding: interleaved 2 of 5 + + * ean.c (Barcode_ean_encode): enlarged static "text", to fit add-5 + + * code128.c (Barcode_128b_encode): new encoding: 128-B + +====> Version 0.91.2 released to ftp.prosa.it + +1999-08-04 Alessandro Rubini + + * bookland/bookland.py: upgraded to version 0.06 (Judas Milgram) + + * ean.c (Barcode_ean_encode): fixed layout of 1st/last digit in UPC-A + + * code128.c (Barcode_128c_encode): fixed checksum calculation + +====> Version 0.91.1 released to ftp.prosa.it + +1999-07-09 Alessandro Rubini + + * sample.c (main): due changes to show code128-C + + * code128.c (Barcode_128c_encode): implemented code 128-C + + * ps.c (Barcode_ps_print): Accept float position and font size + + * code39.c (Barcode_39_encode): reduced font (looked too big) + +====> Version 0.91 released to both ftp.prosa.it and ftp.gnu.org + +1999-07-08 Alessandro Rubini + + * ps.c (Barcode_ps_print): shrink all the bars by 0.15 points + (Barcode_ps_print): Use Helvetica as font, not Courier-Bold + (Barcode_ps_print): remember previous font to make shorter ps output + +1999-07-07 Alessandro Rubini + + * bookland/bookland.py: new enntry, by Judah Milgram. + + * ean.c (Barcode_isbn_verify): fixed bug with "-X" codes (thanks Judah) + +====> Version 0.90.3 released to ftp.prosa.it/pub/software + +1999-07-07 Alessandro Rubini + + * doc/doc.barcode: fixed the "BUGS" section (remove fixed stuff) + + * ean.c (Barcode_ean_encode): added '+' markers in partial and textinfo + + * ps.c (Barcode_ps_print): added support for text over bars ('+' mode) + +====> Version 0.90.2, internal checkpoint + +1999-07-06 Alessandro Rubini + + * Makefile: dirty autodetect of libpaper + + * main.c (get_page_geometry): parse a cmdline argument (mcm@glisco.it) + (main): added "--version" + (main): added diagnostic message for unencodable strings + +====> Version 0.90.1 released to ftp.prosa.it/pub/software + +1999-07-03 Alessandro Rubini + + * barcode.h: removed BARCODE_OUT_PG_* as only the library doesn't + need to hack with the page size. + + * ean.c (Barcode_ean_encode): supplemental 2 and 5 encodings (no text) + + * library.c: use unsigned char all over the place, to prevent warnings + +1999-07-01 Alessandro Rubini + + * ean.c: added EAN-8 and UPC-E support + + * Updated the address of the FSF in any source file + + * README: new file. + +====> Version 0.90 is the first public release. No Changelog up to now. diff --git a/barcode-0.98/INSTALL b/barcode-0.98/INSTALL new file mode 100644 index 00000000..5a6cb878 --- /dev/null +++ b/barcode-0.98/INSTALL @@ -0,0 +1,31 @@ + +Installing on generic Unix systems +---------------------------------- + +The package includes both a library and a standalone program. +To install everything try + + ./configure && make && make install + +To uninstall, try + + make uninstall + +You may have problems compiling the package on non-GNUish systems, +because the tool currently uses both gmake and gawk features, and I have +no access to non-gnu systems. If your operating system isn't able to +compile barcode and you are willing to help porting, feel free to call me. + + +Installing on Debian/GNU systems +-------------------------------- + +The suggested installation here includes creation of a Debian package: + + debian/rules binary + +Then, just install using dpkg: + + dpkg -i ../barcode-0.98_*.deb + +(the "*" here will represent your architecture: "i386", "alpha", "sparc", ...) diff --git a/barcode-0.98/Makefile.am b/barcode-0.98/Makefile.am new file mode 100644 index 00000000..e7456ab9 --- /dev/null +++ b/barcode-0.98/Makefile.am @@ -0,0 +1,73 @@ +INCLUDES = \ + $(GLABELS_CFLAGS) + + +BC_FILES = \ + library.c \ + ean.c \ + code128.c \ + code39.c \ + code93.c \ + i25.c \ + msi.c \ + plessey.c \ + codabar.c \ + ps.c \ + pcl.c \ + barcode.h + +noinst_LTLIBRARIES = libbarcode.la + +libbarcode_la_SOURCES = $(BC_FILES) + +EXTRA_DIST = \ + barcode.spec \ + ChangeLog \ + cmdline.c \ + cmdline.h \ + configure \ + configure.in.dist \ + COPYING \ + INSTALL \ + install-sh \ + main.c \ + Makefile.in.dist \ + missing \ + mkinstalldirs \ + README \ + README.glabels \ + sample.c \ + TODO \ + bookland/bookland.py \ + compat/getopt.c \ + compat/getopt.h \ + contrib/barcode-for-delphi.tar.gz \ + contrib/barcode-SVG.tar.gz.README \ + contrib/barcode-for-delphi.tar.gz.README \ + contrib/barcodeps-0.1.tgz \ + contrib/grab-0.0.4.tar.gz \ + contrib/barcodeps-0.1.tgz.README \ + contrib/grab-0.0.4.tar.gz.README \ + contrib/barcode-SVG.tar.gz \ + debian/changelog \ + debian/control \ + debian/copyright \ + debian/dirs \ + debian/info \ + debian/README.debian \ + debian/rules \ + doc/barcodedoc.txt \ + doc/barcode.ps \ + doc/infofilter \ + doc/manpager \ + doc/texi2html \ + doc/barcode.info \ + doc/mktxt \ + doc/barcode.pdf \ + doc/doc.barcode \ + doc/Makefile.in \ + doc/README + + + + diff --git a/barcode-0.98/Makefile.in.dist b/barcode-0.98/Makefile.in.dist new file mode 100644 index 00000000..848aa265 --- /dev/null +++ b/barcode-0.98/Makefile.in.dist @@ -0,0 +1,141 @@ +# +# This Makefile should run fine with both pmake and gmake +# + +CC = @CC@ +CFLAGS = @CFLAGS@ @DEFS@ @NO_GETOPT@ @NO_LIBPAPER@ @NO_STRERROR@ +RANLIB = @RANLIB@ + +INSTALL = @INSTALL@ + +LDFLAGS = -L. -l$(TARGET) @LIBPAPER@ + +prefix = @prefix@ +BINDIR = $(prefix)/bin +LIBDIR = $(prefix)/lib +INCDIR = $(prefix)/include +MAN1DIR = $(prefix)/man/man1 +MAN3DIR = $(prefix)/man/man3 +INFODIR = $(prefix)/info + +# getopt may be installed or not, if not take our copy +GETOPT_O = @GETOPT_O@ + +TARGET = barcode +LIBRARY = lib$(TARGET).a +MAN1 = $(TARGET).1 +MAN3 = $(TARGET).3 +INFO = doc/$(TARGET).info +HEADER = $(TARGET).h + +LIBOBJECTS = library.o ean.o code128.o code39.o code93.o i25.o \ + msi.o plessey.o codabar.o \ + ps.o pcl.o +EXEOBJECTS = main.o cmdline.o $(GETOPT_O) +ALLSOURCES = $(LIBOBJECTS:.o=.c) $(EXEOBJECT:.o=.c) + + +#Hmm... "RM" is undefined in pmake +RM = rm + +all: $(TARGET) $(LIBRARY) $(MAN1) $(MAN3) $(INFO) sample + +$(TARGET): $(LIBRARY) $(EXEOBJECTS) + $(CC) $(CFLAGS) $(EXEOBJECTS) $(LDFLAGS) -o $(TARGET) + +sample: sample.o $(LIBRARY) + $(CC) $(CFLAGS) sample.o $(LDFLAGS) -o $@ + +# Avoid the standard CFLAGS, to avoid -Wall and -DNO_GETOPT +compat/getopt.o: compat/getopt.c + $(CC) -O -c compat/getopt.c -o $@ + +$(LIBRARY): $(LIBOBJECTS) + $(AR) r $(LIBRARY) $(LIBOBJECTS) + $(RANLIB) $(LIBRARY) + +$(MAN1) $(MAN3): doc/doc.$(TARGET) + awk -f doc/manpager doc/doc.$(TARGET) + + +# Unfortunately, pmake has no "-C". Also, "pmake -n" doesn't follow the cd. +$(INFO): doc/doc.$(TARGET) + cd doc && $(MAKE) + +install: + $(INSTALL) -d $(BINDIR) $(INCDIR) $(LIBDIR) $(MAN1DIR) \ + $(MAN3DIR) $(INFODIR) + $(INSTALL) -c $(TARGET) $(BINDIR) + $(INSTALL) -c -m 0644 $(HEADER) $(INCDIR) + $(INSTALL) -c -m 0644 $(LIBRARY) $(LIBDIR) + $(INSTALL) -c -m 0644 $(MAN1) $(MAN1DIR) + $(INSTALL) -c -m 0644 $(MAN3) $(MAN3DIR) + $(INSTALL) -c -m 0644 $(INFO) $(INFODIR) + +uninstall: + $(RM) -f $(BINDIR)/$(TARGET) + $(RM) -f $(INCDIR)/$(HEADER) + $(RM) -f $(LIBDIR)/$(LIBRARY) + $(RM) -f $(MAN1DIR)/$(MAN1) + $(RM) -f $(MAN3DIR)/$(MAN3) + $(RM) -f $(INDODIR)/$(INFO) + +#Make clean keeps the compiled documents +clean: + $(RM) -f *.o */*.o *~ */*~ $(TARGET) $(LIBRARY) + $(RM) -f $(MAN1) $(MAN3) core sample + cd doc && $(MAKE) terse + $(RM) -f .depend + +distclean: clean + if [ -f build ]; then debian/rules clean; fi + # remove the configure stuff as well + $(RM) -f Makefile config.h config.log config.status config.cache \ + doc/Makefile + +cleanest: clean + cd doc && $(MAKE) clean + +Makefile: Makefile.in configure + ./configure + +configure: configure.in + autoconf + +.depend: $(ALLSOURCES) + $(CC) $(CFLAGS) -MM $(ALLSOURCES) > $@ + +depend: .depend + +tar: + @if [ "x" = "x$(RELEASE)" ]; then \ + n=`basename \`pwd\``; cd ..; tar cvf - $$n | gzip > $$n.tar.gz; \ + echo 'you can set a numeric $$(RELEASE) to make a named tar'; \ + else \ + if [ -d ../$(TARGET)-$(RELEASE) ]; then \ + rm -rf ../$(TARGET)-$(RELEASE); \ + fi; \ + mkdir ../$(TARGET)-$(RELEASE) || exit 1; \ + cp -a . ../$(TARGET)-$(RELEASE) && cd .. && \ + tar --exclude '*/CVS*' \ + -cvzf $(TARGET)-$(RELEASE).tar.gz $(TARGET)-$(RELEASE); \ + fi + +# print the version, as I usually forget to update it when distributing +printv: + @grep -n VERSION $(HEADER) /dev/null + @grep -n set.version doc/doc.$(TARGET) /dev/null + @grep -n dpkg.-i INSTALL /dev/null + +# and this is how I make the distribution +distrib: $(INFO) distclean tar printv + + +.PHONY: all install uninstall mostlyclean clean disclean depend \ + tar printv distrib + +# Only if make is gmake, have a rule to conditionally include .depend +@GMAKEDEPEND0@ +@GMAKEDEPEND1@ +@GMAKEDEPEND2@ + diff --git a/barcode-0.98/README b/barcode-0.98/README new file mode 100644 index 00000000..d3ae2a7f --- /dev/null +++ b/barcode-0.98/README @@ -0,0 +1,93 @@ + +NETWORK LINKS +============= + +This is GNU-barcode. The latest release can be downloaded from ftp.gnu.org +and mirrors: + ftp://ftp.gnu.org/pub/gnu/barcode/ + +It is also available from my own ftp/http server + ftp://ar.linux.it/pub/barcode/ + http://ar.linux.it/pub/barcode/ (same as above). + +The current source tree is available by anonymous CVS. See + http://ar.linux.it/software/#cvs + +Plesae note that ar.linux.it/pub/barcode also includes CVS snapshots, +semi-atumatically taken when I commit stuff to CVS. Note that CVS +snapshots include "CVS/" directories, so you can then "cvs update" for +further updates. + +The documentation is online at: + http://ar.linux.it/software/barcode + +The MS-Windows port is maintained at: + http://gnuwin32.sourceforge.net/packages/barcode.htm + +It as also been included in the FreeBSD ports tree in the "graphics" section. +This means /usr/ports/graphics/barcode. It's thus available from: + http://www.freebsd.org/ports/graphics.html + +GLabels, at http://snaught.com/glabels/, uses barcode internally, too. + +DESCRIPTION +=========== + +The package is meant to solve most needs in barcode creation with a +conventional printer. It can create printouts for the conventional +product tagging standards: UPC-A, UPC-E, EAN-13, EAN-8, ISBN, as well +as a few other formats. Ouput is generated as either Postscript or +Encapsulated Postscript (other back-ends may be added if needed). + +The package is released as both a library and a command-line frontend, +so that you can include barcode-generation into your application. The +program is released in the hope that is proves useful but without any +warranty, according to the GPL Licence (see ./COPYING). + +If you're specifically interested in making an ISBN (Bookland EAN) +symbol, you might try to get "bookland.py" by Judah Milgram +(http://www.cgpp.com/bookland/, whose version 0.92 is also included in +the directory "bookland" within this package, for your convenience). +While my main target is flexibility his main target is strict +adherence to the standards. Bookland is free software like the barcode +library and will probabily have its role in the GNU project. +Bookland.py is a self-documenting program, you'll enjoy browsing its +source code. + +Other contributed patches and/or software are available in the +contrib/ directory. + +Please take the "no-warranty" disclaimer seriously: even though I +spent reasonable efforts to make sure the output is useable in +production you should verify it suits your needs as a faulty bar can +cost you a bundle, and you'll be on your own. It's up to you to verify +that the symbol is valid (and, obviously, I'd like to know about any +problem you encounter). [This paragraph copied verbatim from bookland.py] + + +ACKNOWLEDGMENTS +=============== + +I would like to thank both Judah Milgram and Michele Comitini +(mcm@glisco.it) for their help with this tool, as well as Jim Westveer +for introducing me to Debian packaging. Several encodings have been +implemented by Leonid A. Broukhis (leob@mailcom.com). + + +MAILING LISTS +============= + +There is a mailing list where development is coordinated, called +barcode@lists.linux.it . To get subscribed you should + echo subscribe | mail barcode-request@lists.linux.it +or anything equivalent. + +To receive notification of CVS commit messages, please subscribe to +barcode-commit@ar.linux.it, by issuing: + echo subscribe | mail barcode-commit-request@ar.linux.it + +(if you guess, "ar" or "arcana" is my own server, while lists.linux.it +is the mail server of the italian association of gnu/linux users). + +/alessandro (rubini@gnu.org) + diff --git a/barcode-0.98/README.glabels b/barcode-0.98/README.glabels new file mode 100644 index 00000000..b0dc9592 --- /dev/null +++ b/barcode-0.98/README.glabels @@ -0,0 +1,7 @@ +The following changes have been made to the stock barcode-0.98 distribution +to facilitate compilation with glabels: + + Makefile.in renamed to Makefile.in.dist + configure.in renamed to configure.in.dist + added Makefile.am, which is configured from ../configure.in + diff --git a/barcode-0.98/TODO b/barcode-0.98/TODO new file mode 100644 index 00000000..c91c79cf --- /dev/null +++ b/barcode-0.98/TODO @@ -0,0 +1,23 @@ + + Possible enhancements that I'd like to add + +* verbose mode, printing position information to stderr + +* document how a new encoding standard can be added + +* add Barcode_String, which has been contributed + +* EAN128 (as agreed with Dani Pardo) + +* Postnet and associated encoding-specific bar definitions + +* Use texinfo 4 with images + +* shrink the bars to account for ink spreading + + Currently, small barcodes don't get rendered well. While + version 0.91 and later subtracts 0.15 points from the size of + the bars (I found that this makes good results for small + bars), a smart alghorithm to shrink the bars is needed to get + lighter prints at small sizes without loosing readability. + diff --git a/barcode-0.98/barcode.h b/barcode-0.98/barcode.h new file mode 100644 index 00000000..6b9bdf4e --- /dev/null +++ b/barcode-0.98/barcode.h @@ -0,0 +1,119 @@ +/* + * barcode.h -- definitions for libbarcode + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _BARCODE_H_ +#define _BARCODE_H_ + +#include + +#define BARCODE_VERSION "0.98" +#define BARCODE_VERSION_INT 9800 + +/* + * The object + */ +struct Barcode_Item { + int flags; /* type of encoding and decoding */ + char *ascii; /* malloced */ + char *partial; /* malloced too */ + char *textinfo; /* information about text positioning */ + char *encoding; /* code name, filled by encoding engine */ + int width, height; /* output units */ + int xoff, yoff; /* output units */ + int margin; /* output units */ + double scalef; /* requested scaling for barcode */ + int error; /* an errno-like value, in case of failure */ +}; + +/* + * The flags field + */ +#define BARCODE_DEFAULT_FLAGS 0x00000000 + +#define BARCODE_ENCODING_MASK 0x000000ff /* 256 possibilites... */ +#define BARCODE_NO_ASCII 0x00000100 /* avoid text in output */ +#define BARCODE_NO_CHECKSUM 0x00000200 /* avoid checksum in output */ + +#define BARCODE_OUTPUT_MASK 0x000ff000 /* 256 output types */ +#define BARCODE_OUT_EPS 0x00001000 +#define BARCODE_OUT_PS 0x00002000 +#define BARCODE_OUT_PCL 0x00004000 /* by Andrea Scopece */ +/* PCL_III 0x00008000 */ +#define BARCODE_OUT_PCL_III 0x0000C000 +#define BARCODE_OUT_NOHEADERS 0x00100000 /* no header nor footer */ + +enum { + BARCODE_ANY = 0, /* choose best-fit */ + BARCODE_EAN, + BARCODE_UPC, /* upc == 12-digit ean */ + BARCODE_ISBN, /* isbn numbers (still EAN13) */ + BARCODE_39, /* code 39 */ + BARCODE_128, /* code 128 (a,b,c: autoselection) */ + BARCODE_128C, /* code 128 (compact form for digits) */ + BARCODE_128B, /* code 128, full printable ascii */ + BARCODE_I25, /* interleaved 2 of 5 (only digits) */ + BARCODE_128RAW, /* Raw code 128 (by Leonid A. Broukhis) */ + BARCODE_CBR, /* Codabar (by Leonid A. Broukhis) */ + BARCODE_MSI, /* MSI (by Leonid A. Broukhis) */ + BARCODE_PLS, /* Plessey (by Leonid A. Broukhis) */ + BARCODE_93 /* code 93 (by Nathan D. Holmes) */ +}; + +#define BARCODE_DEFAULT_MARGIN 10 + +#ifdef __cplusplus +extern "C" { +#endif +/* + * Create and destroy barcode structures + */ +extern struct Barcode_Item *Barcode_Create(char *text); +extern int Barcode_Delete(struct Barcode_Item *bc); + +/* + * Encode and print + */ +extern int Barcode_Encode(struct Barcode_Item *bc, int flags); +extern int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags); + +/* + * Choose the position + */ +extern int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, + int xoff, int yoff, double scalef); + +/* + * Do it all in one step + */ +extern int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, + int xoff, int yoff, int flags); + + +/* + * Return current version (integer and string) + */ +extern int Barcode_Version(char *versionname); + +#ifdef __cplusplus +} +#endif + +#endif /* _BARCODE_H_ */ diff --git a/barcode-0.98/barcode.spec b/barcode-0.98/barcode.spec new file mode 100644 index 00000000..eccb6026 --- /dev/null +++ b/barcode-0.98/barcode.spec @@ -0,0 +1,84 @@ +%define name barcode +%define ver 0.98 +%define rel 1 +%define prefix /usr +%define sysconfdir /etc + +Summary: GNU barcode +Name: %name +Version: %ver +Release: %rel +Copyright: GPL +Group: Applications/Productivity +Source: ftp://ar.linux.it/pub/barcode/%name-%{ver}.tar.gz +BuildRoot: /var/tmp/%name-%{ver}-root +URL: http://gnu.systemy.it/software/barcode +Prefix: %prefix + +%description +This is GNU-barcode. +The package is meant to solve most needs in barcode creation with a +conventional printer. It can create printouts for the conventional +product tagging standards: UPC-A, UPC-E, EAN-13, EAN-8, ISBN, as well +as a few other formats. Ouput is generated as either Postscript or +Encapsulated Postscript (other back-ends may be added if needed). + +%package devel +Summary: GNU barcode files for development +Group: Development/Libraries + +%description devel +This is GNU-barcode. +The package is meant to solve most needs in barcode creation with a +conventional printer. It can create printouts for the conventional +product tagging standards: UPC-A, UPC-E, EAN-13, EAN-8, ISBN, as well +as a few other formats. Ouput is generated as either Postscript or +Encapsulated Postscript (other back-ends may be added if needed). + +This package contain the C header, the static library and man page +for development. + +%prep +%setup + +%ifarch alpha + ARCH_FLAGS="--host=alpha-redhat-linux" +%endif + +export -n LANG LINGUAS LC_ALL +if [ ! -f configure ]; then + CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh $ARCH_FLAGS --prefix=%{prefix} --sysconfdir=%{sysconfdir} +else + CFLAGS="$RPM_OPT_FLAGS" ./configure $ARCH_FLAGS --prefix=%{prefix} --sysconfdir=%{sysconfdir} +fi + +%build +export -n LANG LINGUAS LC_ALL + +if [ "$SMP" != "" ]; then + (make "MAKE=make -k -j $SMP"; exit 0) + make +else + make +fi + +%install +[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT +make prefix=$RPM_BUILD_ROOT%{prefix} sysconfdir=$RPM_BUILD_ROOT%{sysconfdir} install + +%clean +[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-, root, root) + +%doc COPYING ChangeLog INSTALL README TODO doc/*.html doc/*.pdf doc/*.ps + +%attr(0755,root,root) %{prefix}/bin/barcode +%attr(0644,root,root) %{prefix}/info/barcode.info* +%attr(0644,root,root) %{prefix}/man/man1/barcode.1* + +%files devel +%attr(0644,root,root) %{prefix}/include/barcode.h +%attr(0644,root,root) %{prefix}/lib/libbarcode.a +%attr(0644,root,root) %{prefix}/man/man3/barcode.3* diff --git a/barcode-0.98/bookland/bookland.py b/barcode-0.98/bookland/bookland.py new file mode 100644 index 00000000..373587cb --- /dev/null +++ b/barcode-0.98/bookland/bookland.py @@ -0,0 +1,884 @@ +#!/usr/local/bin/python + +MYNAME="bookland.py" +MYVERSION="0.92" +COPYRIGHT="(C) 1999-2001 J. Milgram" +DATE = "Jan. 2002" +MAINTAINER = "bookland-bugs@cgpp.com" + +# Copyright (C) 1999,2000 Judah Milgram +# +# bookland.py - generate Bookland EAN symbol for ISBN encoding +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. +# +# ============================================================================== +# +# usage: bookland.py [ISBN] [price-code] > output.eps +# +# ISBN - the ISBN, with or without check digit, with or without hyphens. +# default: 1-56592-197-6 ("Programming Python"). If the check digit +# is provided on the command line, it is verified. If not, it is +# calculated. It's up to you to get the hyphenation right - it's +# important, and something the program can't calculate for you. +# +# price - the five digit add-on code. Usually used to indicate the price, +# in which case the first digit indicates the currency (4=$CAN, +# 5=$US, etc.). The remaining digits indicate the price, with +# decimal point assumed to be between the digit 3 and 4. +# For example: $US 6.95 = 50695, $CAN 35.00 = 43500. Instead of a +# price code, a 5 digit add-on ranging from 90000-98999 can be +# used for internal purposes. BISG recommends just using 90000 if +# you don't want to specify a price. Add-ons ranging from 99000 to +# 99999 have been reserved for special use. +# +# An Encapsulated Postscript file (eps) is sent to standard out. This may in turn +# be converted to other formats using the pbmplus package. You may have trouble +# getting the OCRB to map correctly. If you already have the font, you can look in +# the Fontmap file to see what your system calls it, and edit the fontnames accordingly +# (see below). If you don't have it, you might find it on your DOS system. You +# need a .pfa/.pfb (Type 1) or .ttf (TrueType). Your Postscript interpreter might +# or might not be able to deal with TrueType. In any event, in an emergency, you +# might get away with Helvetica. Note that as of 1990 BISG no longer requires the +# ISBN to be printed in OCR-A. +# +# Take the "no-warranty" disclaimer seriously. Going to print with a faulty bar +# can cost you a bundle, and you'll be on your own. It's up to you to verify that +# the symbol is valid. If you need "corporate accountability", try the Book +# Industry Study Group at (212) 929-1393 or the US ISBN Agency at (908) 665-6770 +# and ask for a list of commercial vendors. Outside the US, don't know. +# +# Feedback welcome. If you discover a case where the program generates a faulty +# symbol, I definitely want to hear about it - write me at milgram@cgpp.com or +# P.O. Box 8376, Langley Park, MD 20787, USA +# +# INSTALLATION: +# +# If you have a Python interpreter on your system, you're done. Just put this file +# somewhere in your path and give it execute permission. If you haven't installed +# Python, see http://www.python.org. It has been ported to Macs, DOS, and MS-Windows. +# +# ABOUT THE BOOKLAND EAN +# +# The most difficult part of this project was finding the documents that define +# the Bookland EAN. There appears to be no single, authoritative source that +# provides all the information required. Some good sources: +# +# [1] "Machine-Readable Coding Guidelines for the U.S. Book Industry", Book +# Industry Study Group, New York, Jan., 1992. (212) 929-1393 +# [2] "UPC Symbol Specification Manual", Uniform Code Council Inc., +# Dayton, Ohio, January 1986 (May 1995 Reprint). (937) 435-3870; I found it +# at http://www.uc-council.org/d36-t.htm +# [3] "EAN Identification for Retail/Trade Items", EAN International. I found it +# in Feb. 1999 at http://www.ean.be/html/Numbering.html +# [4] "Hyphenation Instructions", web page at: +# http://www.isbn.org/standards/home/isbn/international/hyphenation-instructions.asp +# +# The starting point of the exercise is the ISBN, assigned by the national ISBN +# Agency. This is a 10 digit number, the last being a check digit. The ISBN is +# converted to a 13 digit EAN number. The first three digits of the EAN-13 indicate +# the country or region. A prefix of 978 has been assigned to books, regardless +# of country of origin (hence, "Bookland") [3]. The remaining ten digits are the +# first 9 digits of the ISBN followed by the EAN-13 check digit. +# +# It seems the EAN-13 check digit can be calculated using the same algorithm as the +# UPC Version A number. Note that the EAN-13 check digit is always between 0 and 9, +# compare with ISBN check digit which can range to 10 ("X"). See Reference [2], +# Section 2 and Appendix G for details of creation of the EAN-13 symbol. Table 2 of +# Appendix G provides a good comparison of the UPC-A and EAN-13 symbols. +# +# The 5 digit add-on (here called, "UPC5") is defined in Ref. [2] Appendix D. +# The ">" to the right of the five digit code serves to enforce the "quiet zone" to +# the right of the bar pattern. Can't remember where I read that. It's probably +# optional. According to [1], in the UK, three horizontal bars appear over price +# add-ons. Haven't implemented that here. The UPC5 encoding is based on UPC-A and +# UPC-E. +# +# According to [2], Section 3, the EAN-13 numbers and 5-digit add-ons are supposed +# to be printed in OCR-B. The ISBN itself is printed above the EAN-13 symbol. At +# one time it was to be printed in OCR-A, but as of 1990 this requirement has been +# dropped [1], and I assume this means you can use any font you like. +# +# SEE ALSO: +# +# "TinyHelp 5 - Making ISBN Barcodes", D. Byram-Wigfield. Another approach to making +# the ISBN barcode symbol. I saw it at +# http://www.cappella.demon.co.uk/index.html/ +# but haven't tried it. +# +# "XBarcode" - nice open-source X-Windows program for generating all sorts of bar codes. +# It does much more than this program, but didn't seem to do the UPC +# 5-digit add-on or do the ISBN->EAN13 calculation (as of v. 2.11). Might +# have made more sense to add this capability, but I needed a Python project. +# In any event, their license forbids distribution in modified form! +# +# HYPHENATION +# +# bookland.py includes automatic hyphenation for ISBN's in group 0 and 1 +# (English-language). This is based on my reading of Ref [4]. If in doubt, +# users can use the "-y" option to force the program to accept the hyphenation +# as input. For other ISBN groups and for ISMN's, no hyphenation is performed +# other than to ensure a hyphen is placed after the group identifier and before +# the check digit. +# +# ABOUT THE ISMN: +# +# See the ISMN Users' Manual, 3rd Edition, 1998, ISBN 3-88053-070-X, published by +# the International ISMN Agency, Staatsbibliothek Preussischer Kulturbesitz, Berlin. +# I found my copy at http://www.ismn.spk-berlin.de/download/ISMNmanual.pdf +# +# An ISMN is just like an ISBN, except: +# - first character is an "M" +# - the "M" counts as a "3" for computing the ISMN check digit (last digit) +# - the checksum weights are 3,1,3,1,3,1,3,1,3, sum to be divisible by "10". This +# means the last character is always a numerical digit, never an "X". +# - the EAN number is "979" plus the *entire* ten character ISMN, except the +# "M" is replaced by "0". Note this means the ISMN checksum is identical to the +# corresponding EAN-13 checksum (excercise left to the reader). +# +# When bookland.py detects an "M" in the first position of the ISBN, it interprets +# it as an ISMN and proceeds accordingly. The 5-digit price code symbol is suppressed. +# +# BAR WIDTH REDUCTIONS +# +# Starting Version 0.92, the widths of the individual bars can be reduced using the +# "-r" option (units are inches). This is to compensate for bleed during printing. +# I don't know when it's a good idea to actually use this; in any event consult with +# your printer first. If not input, it defaults to zero (no reduction). +# +# ABOUT PYTHON +# +# See http://www.python.org +# +# TO DO: +# +# - Generalize to more bar codes, starting with UPC-A and UPC-E. "Plain" EAN13 is +# already built in, could add command line argument to generate that instead of +# Bookland. +# - Make font sizes and placement easier to configure - not sure I have it right. +# Does human-readable 5-digit code take wider font spacing? +# - Clean up bounding box stuff. +# - Bells and whistles. +# - GUI? +# +# HISTORY: +# +# 1/2002 - v 0.92 add ISMN support (thanks to Lars-Henrik Nysten for this suggestion) +# re-wrote bar generation to preclude possibility of white hairlines +# between adjacent black modules. Thanks to Tero Lindfors for +# reporting this bug. +# new -o option to write eps to file rather than stdout +# new -x option for "check only" (verifies check digit) +# new -r option for bar width reduction (compensate for print bleed) +# new -s option to scale module (bar) height (Lars-Henrik Nysten again) +# can suppress UPC-5 price code by entering empty string. (thanks to +# Jacques Du Pasquier for this suggestion) +# re-wrote ISBN/ISMN sanity checks +# lowercase alphas ("x" for ISBN and "m" for ISMN) now ok on input +# fix "long" command line options. +# 10/2001 - v 0.91 add -z option for quiet zone ">" +# add -f option for fonts +# re-write command line parsing to use getopt +# 1/2000 - v 0.09 eliminate use of eval +# 9/99 - v 0.08 accomodate different versions of OCRB by fitting +# all strings to prescribed width. Thanks to Toby Gadd +# for reporting this problem and Peter Deutsch for +# help finding the fix. +# 7/99 -v0.05-0.07 improve error handling. +# 3/27/99 - v0.04 add "--help" and "--version". +# 3/13/99 - v0.03, do a showpage at end (it's allowed) +# fixed checksum calculations for certain cases +# 2/7/99 - v0.02, fixed LH parity pattern for EAN13. It's not the check digit! +# 2/7/99 - initial release +# ================================================================================ + +# +# barCodeSymbol - the whole printed symbol, including bar code(s) and product code(s). +# UPC, UPCA, UPC5, EAN13 - the number itself, with check digit, string representation, +# and barcode bits +# + +import re # we should get rid of regsub and regex in favor of re + # hope there's no conflict. +import string +import sys +import regsub +from regex_syntax import * +import regex +regex.set_syntax(RE_SYNTAX_AWK) +from types import * + +BooklandError = "Something wrong" + + +A="A";B="B";C="C";O="O";E="E" +UPCABITS = [{O:"0001101",E:"1110010"}, + {O:"0011001",E:"1100110"}, + {O:"0010011",E:"1101100"}, + {O:"0111101",E:"1000010"}, + {O:"0100011",E:"1011100"}, + {O:"0110001",E:"1001110"}, + {O:"0101111",E:"1010000"}, + {O:"0111011",E:"1000100"}, + {O:"0110111",E:"1001000"}, + {O:"0001011",E:"1110100"}] +UPCAPARITY = [ "OOOOOOEEEEEE" ] * 10 +UPCEBITS = [{O:"0001101",E:"0100111"}, + {O:"0011001",E:"0110011"}, + {O:"0010011",E:"0011011"}, + {O:"0111101",E:"0100001"}, + {O:"0100011",E:"0011101"}, + {O:"0110001",E:"0111001"}, + {O:"0101111",E:"0000101"}, + {O:"0111011",E:"0010001"}, + {O:"0110111",E:"0001001"}, + {O:"0001011",E:"0010111"}] +# what about UPCEPARITY? Don't need for isbn. +UPC5BITS = UPCEBITS +UPC5PARITY = ["EEOOO","EOEOO","EOOEO","EOOOE","OEEOO", + "OOEEO","OOOEE","OEOEO","OEOOE","OOEOE"] +EAN13BITS = [{A:"0001101", B:"0100111", C:"1110010"}, + {A:"0011001", B:"0110011", C:"1100110"}, + {A:"0010011", B:"0011011", C:"1101100"}, + {A:"0111101", B:"0100001", C:"1000010"}, + {A:"0100011", B:"0011101", C:"1011100"}, + {A:"0110001", B:"0111001", C:"1001110"}, + {A:"0101111", B:"0000101", C:"1010000"}, + {A:"0111011", B:"0010001", C:"1000100"}, + {A:"0110111", B:"0001001", C:"1001000"}, + {A:"0001011", B:"0010111", C:"1110100"}] +EAN13PARITY = map(lambda x: x+"CCCCCC", + ["AAAAAA","AABABB","AABBAB","AABBBA","ABAABB", + "ABBAAB","ABBBAA","ABABAB","ABABBA","ABBABA"]) + +PSFORMAT = "%.6f" +# Default fonts. +# Fonts might have a different name on your system. +# Edit if required. +ISBNFONT = "OCRB" # Doesn't have to be OCR-B +EAN13FONT = "OCRB" +UPC5FONT = "OCRB" + +class psfile: + + def __init__(self): + self.x0 = 100; self.y0 = 100 + self.lines=[] + self.bb=[self.x0,self.y0,self.x0,self.y0] + + def orbb(self,arg): + self.bb[0] = min(self.bb[0],self.x0+arg[0]) + self.bb[1] = min(self.bb[1],self.y0+arg[1]) + self.bb[2] = max(self.bb[2],self.x0+arg[2]) + self.bb[3] = max(self.bb[3],self.y0+arg[3]) + + def translate(self,dx,dy): + self.x0 = self.x0 + dx + self.y0 = self.y0 + dy + return "%d %d translate 0 0 moveto" % (dx,dy) + + def out(self,file=None): + if file: + outfid=open(file,"w") + else: + outfid=sys.stdout + for line in self.lines: + outfid.write("%s\n"%line) + outfid.close() + + def do(self,arg): + self.lines = self.lines + arg + + def setbb(self): + for i in range(len(self.lines)): + if self.lines[i]=="%%BoundingBox: TBD": + self.lines[i]= "%%BoundingBox:" + \ + " %d"%self.bb[0] + \ + " %d"%self.bb[1] + \ + " %d"%self.bb[2] + \ + " %d"%self.bb[3] + return + + def header(self,title,comments,ean13font,isbnfont,upc5font): + for i in range(len(comments)): + comments[i] = regsub.gsub("^","% ",comments[i]) + # There's a more elegant way to do the bounding box line: + return [ "%!PS-Adobe-2.0 EPSF-1.2", + "%%Creator: " + MYNAME + " " + MYVERSION + " " + DATE, + "%%Title: " + title, + "%%BoundingBox: TBD", + "%%EndComments" ] +\ + comments + \ + [ "\n% These font names might be different on your system:", + "/ean13font { /" + ean13font + " findfont 10 scalefont setfont } def", + "/isbnfont { /" + isbnfont + " findfont 8 scalefont setfont } def", + "/upc5font { /" + upc5font +" findfont 14 scalefont setfont } def\n", + "/nextModule { moduleWidth 0 rmoveto } def", + "% The following shenanigans is to deal with different implementations", + "% of same font having different char sizes and spacing.", + "% function fitstring:", + "% usage: width string font fitstring", + "% set font, scaled so that string exactly fits desired width", + "% leave string on stack", + "/fitstring { dup findfont 1 scalefont setfont % w s f", + "3 1 roll % f w s", + "dup stringwidth pop % f w s sw", + "3 2 roll exch div % f s x", + "3 2 roll findfont exch scalefont setfont", + "} def", + "/barHeight { 72 } def", + "/nextModule { moduleWidth 0 rmoveto } def", + "/topcentershow {dup stringwidth pop neg 2 div -9 rmoveto show} def", + "/toprightshow {dup stringwidth pop neg -9 rmoveto show} def", + "/bottomcentershow {dup stringwidth pop neg 2 div 0 rmoveto show} def", + "/bottomrightshow {dup stringwidth pop neg 0 rmoveto show} def", + "/W { moduleWidth mul 0 rmoveto } def", + "/B { dup moduleWidth mul 2 div 0 rmoveto", + "dup moduleWidth mul barWidthReduction sub setlinewidth", + "0 barHeight rlineto 0 barHeight neg rmoveto", + "currentpoint stroke moveto", + "moduleWidth mul 2 div 0 rmoveto } def", + "/L { dup moduleWidth mul 2 div 0 rmoveto", + "dup moduleWidth mul barWidthReduction sub setlinewidth", + "0 -5 rmoveto 0 5 rlineto", + "0 barHeight rlineto 0 barHeight neg rmoveto", + "currentpoint stroke moveto", + "moduleWidth mul 2 div 0 rmoveto } def", + self.x0,self.y0,"translate", + "0 0 moveto" ] + + def trailer(self): + return ["stroke","% showpage supposedly OK in EPS", + "showpage","\n% Good luck!"] + + +class UPC: + + # Includes UPC-A, UPC-E, EAN-13 (sorry), UPC-5 et al. + + def __init__(self,arg): + # arg is a string, either: + # - product code including checksum + # - same, with hyphens (hyphens not verified) + # - same, but with last digit (checksum) dropped, possibly leaving a + # trailing hyphen. + # If checksum is included, it will be verified. + # N.B. "integer" representation is still a string! Just has no hyphens. + + self.s=arg + self.verifyChars(self.s) + self.n = regsub.gsub("-","",self.s) # create "integer" representation + self.x = self.checkDigit(self.n) # always calculate check digit + if len(self.n) == self.ndigits: + self.verifyCheckDigit() # if check digit given, verify it + elif len(self.n) == self.ndigits-1: + self.tackonCheckDigit() # tack on check digit + else: + raise BooklandError, "UPC: wrong number of digits in \"" + self.s + "\"" + + def setbits(self,arg): # UPC (all) + self.bits="" + parityPattern=self.parityPattern() + bitchar=self.bitchar() + for p in range(len(arg)): + digit=int(arg[p]) + # maybe better to define parityPattern with a leading blank? + parity=parityPattern[p] + bit=bitchar[digit][parity] + self.bits=self.bits + bit + + def verifyChars(self,s): # UPC (all) + # Trailing hyphen allowed. + nevergood = "--|^-|[^0-9-]" + ierr=regex.search(nevergood,s) + if ierr != -1: + raise BooklandError, \ + "UPCA: in %s: illegal characters beginning with: %s" % (s,s[ierr]) + + def verifyCheckDigit(self): # UPC (all) + # first verify correct number of digits. + soll=self.checkDigit(self.n) + ist=self.s[-1:] + if ist != soll: + raise BooklandError, "For %s checksum %s is wrong, should be %s" % \ + (self.s,ist,soll) + + def xstring(self,p): # UPC (all) + return "%d" % p + + def tackonCheckDigit(self): + self.n = self.n + self.x # UPC (all) + self.s = self.s + self.x + +class UPCA(UPC): + + def __init__(self,arg): + UPC.__init__(self,arg) + self.setbits(self.n[1:]) # skip first digit + + def parityPattern(self): + return UPCAPARITY[int(self.x)] + def bitchar(self): + return UPCABITS + + def checkDigit(self,arg): # UPCA/EAN13 + weight=[1,3]*6; magic=10; sum = 0 + for i in range(12): # checksum based on first 12 digits. + sum = sum + int(arg[i]) * weight[i] + z = ( magic - (sum % magic) ) % magic + if z < 0 or z >= magic: + raise BooklandError, "UPC checkDigit: something wrong." + return self.xstring(z) + + +class ISBN: + # Includes ISMN, if the plan falls together. + def __init__(self,arg): + self.ndigits=10 # Includes check digit! + self.s=string.upper(arg) + self.n=re.sub("[ -]","",self.s) # "integer" representation + # In ISMN, I allow spaces in place of hyphens. See ISMN User's manual. + if re.match("^M( |-)?\d(( |-)?\d){7,7}(-| )?\d?$",self.s): + # ISMN + self.name="ISMN" + self.n=re.sub("^M","3",self.n) + self.weight=[3,1,3,1,3,1,3,1,3] + self.magic=10 + elif re.match("^\d-?\d(-?\d){7,7}-?(\d|X)?$",self.s): + # ISBN + self.name="ISBN" + self.weight=[10,9,8,7,6,5,4,3,2] + self.magic=11 + else: + raise BooklandError, "%s invalid (hyphenation, characters, or length)" % self.s + self.x = self.checkDigit() + if len(self.n) == self.ndigits: + self.verifyCheckDigit() # if check digit given, verify it + elif len(self.n) == self.ndigits-1: + self.tackonCheckDigit() # tack on check digit + else: + raise BooklandError, "%s failed. Please report as bug" % self.s + + + def checkDigit(self): # ISBN and ISMN; UPCA/EAN13 similar but for weights etc. + # now that we're checking regex's in init, we don't have to check the + # argument at all. (used to check length and bad characters) + sum = 0 + for i in range(9): # checksum based on first nine digits. + sum = sum + int(self.n[i]) * self.weight[i] + z = ( self.magic - (sum % self.magic) ) % self.magic + if z < 0 or z >= self.magic: + raise BooklandError, \ + "%s: checksum %d is wrong - please report as bug" % (self.s,z) + return self.xstring(z) + + def xstring(self,p): + if p == 10: + return "X" + else: + return "%d" % p + + def tackonCheckDigit(self): + if self.s[-1:] == "-": + # Already have a trailing hyphen + self.s = self.s + self.x + else: + self.s = self.s + "-" + self.x + + def verifyCheckDigit(self): # UPC A; EAN13 + # first verify correct number of digits. + soll=self.x + ist=self.s[-1:] + if ist != soll: raise BooklandError, \ + "For %s checksum %s is wrong, should be %s\n" % (self.s,ist,soll) + +class Bar: + # a run of adjacent modules of identical value. + def __init__(self,val): + self.val=val + if not self.val in "L01": + raise BooklandError, "bar bit: %s, pls report as a bug" % self.val + self.width=1 + if self.val=="1": + self.color="Black" + elif self.val=="0": + self.color="White" + elif self.val=="L": + self.color="Long Black" + def __cmp__(self,other): + if self.val==other or (self.val=="L" and other=="1"): + return 0 + else: + return 1 + def inc(self): + self.width=self.width+1 + def pslines(self): + if self.val=="L": + rval = [ "%d L " % self.width ] + elif self.val=="1": + rval = [ "%d B " % self.width ] + else: + rval = [ "%d W " % self.width ] + return rval + def __repr__(self): + return "%s bar of width %d" % (self.color,self.width) + +class barCodeSymbol: + + def __init__(self): + self.patternWidth = len(self.bits)*self.moduleWidth + # Anything else? + + def bitsComment(self): + return [ "%% Bits:\n%% %s" % self.bits ] + + def psbars(self): + # new version, try to prevent all hairlines between adjacent modules. + bars = [] + bar=Bar(self.bits[0]) + for bit in self.bits[1:]: + if bit==bar: + bar.inc() + else: + bars.append(bar) + bar=Bar(bit) + bars.append(bar) + rval = ["0 0 moveto"] + for bar in bars: + rval = rval + bar.pslines() + rval = rval + [ "stroke" ] + return rval + + def psbarsold(self): + psbits=regsub.gsub("1","I ",self.bits) + psbits=regsub.gsub("0","O ",psbits) + psbits=regsub.gsub("L","L ",psbits) + linewidth=50 + p=0; j=linewidth; m=len(psbits); psbarlines=[]; blanks="^ | $" + while p <= m: + j = min(linewidth,m-p) + psbarlines = psbarlines + [ regsub.gsub(blanks,"",psbits[p:p+j]) ] + p=p+linewidth + return [ "0 0 moveto" ] + psbarlines + [ "stroke" ] + + def psSetBarHeight(self): + return [ "/barHeight { " + PSFORMAT % self.moduleHeight + " 72 mul } def" ] + + def psSetBarWidthReduction(self): + return [ "/barWidthReduction { " + \ + PSFORMAT % self.barWidthReduction + " 72 mul } def" ] + + def psSetModuleWidth(self): + rval = [ "/moduleWidth { " + PSFORMAT % self.moduleWidth + " 72 mul } def" ] + return rval + + def psBottomRightText(self,text,font): + # this is specifically for the upc5 price code. + # this is all starting to get messy. + return [ PSFORMAT % self.patternWidth + " 72 mul dup 2 div", + PSFORMAT % self.moduleHeight + " 72 mul 2 add moveto", + "(" + text + ") /" + font + " fitstring bottomcentershow" ] + + def psTopCenterText(self,text,font): + # the text at the top center of the bar pattern (i.e. the ISBN) + return [ PSFORMAT % self.patternWidth + " 72 mul dup 2 div", + PSFORMAT % self.moduleHeight + " 72 mul 3 add moveto", + " (" + text + ") /" + font + " fitstring bottomcentershow" ] + + def psFittedText(self,width,text,font): + return [ PSFORMAT % width + " (" + text + ") " + font + " fitstring" ] + + # This is optional; serves to enforce quiet zone to right of UPC 5 add-on + def psGreaterThan(self,font): + return [ PSFORMAT % self.patternWidth + " 72 mul", + PSFORMAT % self.moduleHeight + " 72 mul 2 add moveto", + "/%s (>) show" % font ] + +class EAN13Symbol(barCodeSymbol): + + def __init__(self,arg,font=EAN13FONT,heightMultiplier=1,barWidthReduction=0): + # arg is a string with the EAN product code + self.barWidthReduction=barWidthReduction + self.ean13 = EAN13(arg) + self.moduleWidth = 0.0130 + specModuleHeight = 1.00 + self.moduleHeight = 1.00 * heightMultiplier + self.bits = self.ean13.bits + barCodeSymbol.__init__(self) + self.font=font + + def bb(self): + return [ -12, -10, self.patternWidth*72+10, self.moduleHeight*72+12 ] + + def pslines(self): + return self.bitsComment() + \ + self.psSetModuleWidth() + \ + self.psSetBarWidthReduction() + \ + self.psSetBarHeight() + \ + self.psbars() + \ + self.psLRDigitLines() + + def psLRDigitLines(self): + # 24 = 3+6*7/2 + # 70 = 3+6*7+4+6*7/2 "4" so we center on the "L" bars (the rightmost of + # the center guard bars is an "O". + # "5" in check digit is the five-module spacing recommended by [2], section 3. + return [ "% We do the left digits first and leave the font scaled", + "% as is for the 9-digit and the right-digits.", + "% EAN13 Left Digits:", + "moduleWidth 24 mul 0 moveto", + "moduleWidth 40 mul (" + self.ean13.leftDigits + ") ", + "/" + self.font + " fitstring topcentershow", + "\n% EAN13 human-readable number", + "% The \"9\" digit (only when encoding ISBN's and ISMN's, I think):", + "-5 0 moveto (" + self.ean13.n[0] + ") toprightshow", + "% EAN13 Right Digits:", + "moduleWidth 70 mul 0 moveto", + "moduleWidth 40 mul (" + self.ean13.rightDigits + ") topcentershow" ] + +class EAN13(UPCA): + + def __init__(self,arg): + self.ndigits=13 # Includes check digit! + UPCA.__init__(self,arg) + leftBits = self.bits[0:42] + rightBits = self.bits[42:] + leftGuard="L0L" + rightGuard="L0L" + center="0L0L0" + self.bits = leftGuard + leftBits + center + rightBits + rightGuard + self.leftDigits = self.n[1:7] + self.rightDigits = self.n[7:13] + + def parityPattern(self): + # N.B. parity pattern based on leftmost digit, the UCC Spec calls this + # the "13th" digit. It's not the check digit! + return EAN13PARITY[int(self.n[0])] + def bitchar(self): + return EAN13BITS + +class UPC5Symbol(barCodeSymbol): + + def __init__(self,arg,heightMultiplier=1,barWidthReduction=0): + # arg is a string with the 5 digit add-on. + self.barWidthReduction=barWidthReduction + self.upc5 = UPC5(arg) + self.moduleWidth = 0.0130 + specModuleHeight = 0.852 + self.moduleHeight = 0.852 * heightMultiplier + self.bits = self.upc5.bits + barCodeSymbol.__init__(self) + + def pslines(self): + return self.bitsComment() + \ + self.psSetModuleWidth() + \ + self.psSetBarHeight() + \ + self.psbars() + + def bb(self): + # Note quiet zone is there even if we don't print the ">". + return [ 0, 0, self.patternWidth*72+10, self.moduleHeight*72+10 ] + +UPC5Error = "Something wrong with 5-digit price code add-on." +class UPC5(UPC): + + def __init__(self,arg): + self.ndigits=5 # Includes check digit! + p=re.search("[^0-9]",arg) + if p: + badchar=arg[p.start()] + raise UPC5Error, "\"%s\" is wrong. The character \"%s\" is not allowed. Price code add-on should contain %d digits and nothing else. Or leave blank to suppress the UPC-5 code." % (arg,badchar,self.ndigits) + elif len(arg) != self.ndigits: + raise UPC5Error, \ + "\"%s\" is wrong. Price code add-on should have exactly %d digits." % (arg,self.ndigits) + UPC.__init__(self,arg) + self.setbits(self.n) + leftGuard="1011" + # no right guard for UPC 5-digit add-on + # Have to insert pesky delineators: + delineator = "01" + self.bits = leftGuard + \ + self.bits[0:7] + delineator + \ + self.bits[7:14] + delineator + \ + self.bits[14:21] + delineator + \ + self.bits[21:28] + delineator + \ + self.bits[28:35] + + def checkDigit(self,arg): # UPC5 + weight=[3,9,3,9,3]; sum = 0 + for i in range(5): + sum = sum + int(arg[i]) * weight[i] + return self.xstring(sum % 10) + + def verifyCheckDigit(self): # UPC2/5 checksum not in number + return + + def parityPattern(self): + return UPC5PARITY[int(self.x)] + def bitchar(self): + return UPC5BITS + +class bookland(barCodeSymbol): + + def __init__(self,isbn,price="",*rest): + + + # Some defaults: + ean13font=EAN13FONT + isbnfont=ISBNFONT + upc5font = UPC5FONT + zone=None + heightMultiplier=1.0 + commandLine="" + barWidthReduction=0 + + # Maybe different fonts: + if len(rest)>0: + font=rest[0] + if font: + ean13font=font + isbnfont=font + upc5font=font + if len(rest)>1: + zone=rest[1] + if len(rest)>2: + heightMultiplier=float(rest[2]) + if len(rest) > 3: + commandLine=rest[3] + if len(rest) > 4: + barWidthReduction=float(rest[4]) + + # Initial setup: + + self.ps = psfile() + self.isbn = ISBN(isbn) + + # Header, EAN13 bars, EAN13 number, and ISBN: + + if self.isbn.name=="ISMN": + self.ean13Symbol = EAN13Symbol("9790"+self.isbn.n[1:9],ean13font,heightMultiplier,barWidthReduction) + elif self.isbn.name=="ISBN": + self.ean13Symbol = EAN13Symbol("978"+self.isbn.n[:9],ean13font,heightMultiplier,barWidthReduction) + else: + raise BooklandError, "Internal error doing %s, please report as bug" % isbn + + self.ps.orbb(self.ean13Symbol.bb()) + comments = ["", + " This is free software and comes with NO WARRANTY WHATSOVER", + " Think twice before going to press with this bar code!", + "", + "Command line: %s" % commandLine, + "" ] + self.ps.lines = self.ps.header(self.isbn.s,comments,ean13font,isbnfont,upc5font) + \ + [ "ean13font" ] + \ + self.ean13Symbol.pslines() +\ + [ "isbnfont" ] + \ + self.ean13Symbol.psTopCenterText("%s %s" % (self.isbn.name,self.isbn.s),isbnfont) + + # 5-digit add-on: (optional for ISBN only) + BLANK=re.compile("^ *$") + if self.isbn.name=="ISBN" and not BLANK.match(price): + # 105 = 95 + 10; 10 = separation (min is 9) + translate=[ self.ps.translate( self.ean13Symbol.moduleWidth * 72 * 105, 0 ) ] + self.upc5Symbol = UPC5Symbol(price,heightMultiplier,barWidthReduction) + self.ps.orbb(self.upc5Symbol.bb()) + self.ps.lines = self.ps.lines + \ + translate + \ + self.upc5Symbol.pslines() + \ + [ "upc5font" ] +\ + self.upc5Symbol.psBottomRightText(price,upc5font) + if zone: self.ps.lines=self.ps.lines + self.upc5Symbol.psGreaterThan(upc5font) + else: + self.ps.lines.append("%% Skipping UPC-5 price code symbol per request") + + self.ps.lines=self.ps.lines + self.ps.trailer() + + # Can now set bounding box. + + self.ps.setbb() + +# Here we go ... + +if __name__ == '__main__': + + def printUsage(): + print "Usage: bookland [-h|--help] [-v|--version] [-x|--check] [-f|--font=] [-s|--height=] [-r|--reduction=] [-o|outfile=] [-z|--quietzone] [| ]" + print "Report bugs to " + MAINTAINER + + def printVersion(): + sys.stderr.write("%s version %s %s.\n" % (MYNAME,MYVERSION,COPYRIGHT)) + sys.stderr.write("Bugs to %s\n" % MAINTAINER) + sys.stderr.write("This is free software and comes with NO WARRANTY\n") + + import getopt + try: + opts,args = getopt.getopt(sys.argv[1:], + "xr:s:uvf:hzo:", + ["reduction=","outfile=","height=","noupc", + "check","version","help","font=","quietzone"]) + except: + printUsage() + sys.exit(0) + + # some initial defaults: + isbn = "1-56592-197-6" # Mark Lutz, "Programming Python", + # O'Reilly, Sebastopol CA, 1996 + price = "90000" + font=None + zone=None + checkonly=None + outfile=None + heightMultiplier=1 + commandLine = string.join(sys.argv) + barWidthReduction = 0 + + # parse command line: + for opt,val in opts: + if opt in ("-v","--version"): + printVersion() + sys.exit(0) + elif opt in ("-h","--help"): + printUsage() + sys.exit(0) + elif opt in ("-f","--font"): + font=val + elif opt in ("-z","--quietzone"): + zone=1 + elif opt in ("-x","--check"): + checkonly=1 + elif opt in ("-s","--height"): + heightMultiplier = float(val) + elif opt in ("-r","--reduction"): + barWidthReduction = val + elif opt in ("-o","--outfile"): + outfile=val + if len(args)==1: + isbn=args[0] + elif len(args)==2: + isbn=args[0] + price=args[1] + + # Do stuff. + + printVersion() + try: + b = bookland(isbn,price,font,zone,heightMultiplier, + commandLine,barWidthReduction) + if not checkonly: b.ps.out(outfile) + if outfile: + sys.stderr.write("Output written to %s\n" % outfile) + except BooklandError, message: + sys.stderr.write(BooklandError + ": " + message + "\n") + sys.exit(1) diff --git a/barcode-0.98/cmdline.c b/barcode-0.98/cmdline.c new file mode 100644 index 00000000..a69a825b --- /dev/null +++ b/barcode-0.98/cmdline.c @@ -0,0 +1,177 @@ +/* + * cmdline.c -- parse a command line using getopt, environment and defaults + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * + * Changes: + * Michele Comitini (mcm@glisco.it): better handling of numeric type args. + */ + +#include +#include +#include + +#ifdef NO_GETOPT + /* use replacement */ + #include "compat/getopt.h" +#else + #include +#endif + +#include "cmdline.h" + +/* In case of error, print help string and return error (-1) */ +int commandline_errormsg(FILE *f, struct commandline *args, + char *prgname, char *messagehead) +{ + char *buffer; + char *buffer2; + int len; + struct commandline *ptr; + + if (!messagehead) { + fprintf(f,"%s: Error in cmdline\nPossible options:\n",prgname); + } else { + fprintf(f,"%s: %s",prgname,messagehead); + } + + for (ptr = args; ptr->option; ptr++) { + if (ptr->descrip) { + len = strlen(ptr->descrip); + len += ptr->default_v ? strlen(ptr->default_v) : 6; + len += ptr->env ? strlen(ptr->env) : 6; + buffer2 = malloc(len+3); /* 3 to be safe :) */ + len += 32; + if (buffer2) { + buffer = malloc(len); + if (buffer) { + sprintf(buffer2, ptr->descrip, + ptr->default_v ? ptr->default_v : "(none)", + ptr->env ? ptr->env : "(none)"); + sprintf(buffer, " -%c %s %s", ptr->option, + ptr->type ? "" : " ", buffer2); + fprintf(f, "%s\n",buffer); + free(buffer); + } + free(buffer2); + } + } + } + return -1; +} + +/* + * Associate formats to type. + */ +struct type_fmt { + enum option_type type; + char *fmt; +}; +static struct type_fmt formats[] = { + {CMDLINE_I, "%i%s"}, /* the trailing "%s" is used for error check */ + {CMDLINE_D, "%d%s"}, + {CMDLINE_X, "%x%s"}, + {CMDLINE_O, "%o%s"}, + {CMDLINE_F, "%lf%s"}, + {CMDLINE_P, "%p%s"}, + {0, NULL} /* If we get here, it's CMDLINE_S: no sscanf buf strcpy() */ +}; + + +/* Parse one argument (default or provided) */ +static int commandline_oneopt(struct commandline *ptr, char *value) +{ + struct type_fmt *tptr; + char *trash = value ? strdup(value) : NULL; + + /* convert it, if needed */ + if ((ptr->type != CMDLINE_NONE) && ptr->result) { + for (tptr = formats; tptr->type; tptr++) + if (tptr->type == ptr->type) + break; + if (!tptr->type) /* not found: it is a string */ + *(char **)(ptr->result) = value; + else + if (sscanf(value, tptr->fmt, ptr->result, trash)!=1) { + free(trash); + return -1; + } + } + if (trash) + free(trash); + + if ((ptr->type == CMDLINE_NONE) && ptr->result) /* no type, just count */ + (*(int *)(ptr->result))++; + + /* call the function, if needed */ + if (ptr->fun) { + if (ptr->type) { + if (ptr->result) return ptr->fun(ptr->result); /* converted */ + return ptr->fun(value); /* type, but not converted */ + } + return ptr->fun(NULL); /* no type: just call it */ + } + return 0; +} + +/* The main function */ +int commandline(struct commandline *args, int argc, char **argv, + char *errorhead) +{ + struct commandline *ptr; + char *getopt_desc = (char *)calloc(512, 1); + int desc_offset = 0; + int opt, retval; + char *value; + + /* Build getopt string and process defaults values */ + for (ptr = args; ptr->option; ptr++) { + getopt_desc[desc_offset++] = ptr->option; + if (ptr->type) getopt_desc[desc_offset++] = ':'; + + value = NULL; + if (ptr->env) + value = getenv(ptr->env); + if (!value) + value = ptr->default_v; + if (value && (retval = commandline_oneopt(ptr, value))) { + /* + * if the function returns a specific (not -1) value, it already + * printed its message, so avoid the generic help + */ + if (retval == -1) + commandline_errormsg(stderr, args, argv[0], errorhead); + return retval; + } + } + + /* Run getopt and process material */ + while ((opt = getopt(argc, argv, getopt_desc)) != -1) { + for (ptr = args; ptr->option; ptr++) + if (opt == ptr->option) + break; + if (!ptr->option) /* unknown option */ + return commandline_errormsg(stderr, args, argv[0], errorhead); + if ( (retval = commandline_oneopt(ptr, optarg)) ) { /* wrong arg */ + if (retval == -1) + commandline_errormsg(stderr, args, argv[0], errorhead); + return retval; + } + } + return 0; +} diff --git a/barcode-0.98/cmdline.h b/barcode-0.98/cmdline.h new file mode 100644 index 00000000..69319915 --- /dev/null +++ b/barcode-0.98/cmdline.h @@ -0,0 +1,58 @@ +/* + * cmdline.h -- generic commandline editing (uses getopt, only short) + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * + */ + +/* + * The options may have different arguments of different type + */ +enum option_type { + CMDLINE_NONE=0, /* no argument after option */ + CMDLINE_I, /* integer (any base) */ + CMDLINE_D, /* decimal integer */ + CMDLINE_X, /* hex integer */ + CMDLINE_O, /* octal integer */ + CMDLINE_S, /* string */ + CMDLINE_F, /* double float */ + CMDLINE_P, /* pointer */ +}; + + +struct commandline { + int option; /* Single byte: option id */ + int type; /* Type of argument, used in sscanf */ + void *result; /* Store data here, if non null */ + int (*fun)(void *); /* Call if defined: arg is "result" or input string */ + char *env; /* Where to get runtime defaults, may be NULL */ + char *default_v; /* The compile-time default, may be NULL */ + char *descrip; /* For err msg. May have %s's for default and env */ +}; + +/* returns: 0 or -1. "optarg" is global (see getopt) */ +extern int commandline(struct commandline *args, + int argc, char **argv, char *errorhead); + +/* prints an error message based on "args" */ +extern int commandline_errormsg(FILE *f, struct commandline *args, + char *prgname, char *messagehead); + + + + diff --git a/barcode-0.98/codabar.c b/barcode-0.98/codabar.c new file mode 100644 index 00000000..7065b9ea --- /dev/null +++ b/barcode-0.98/codabar.c @@ -0,0 +1,182 @@ +/* + * codabar.c -- encoding for Codabar + * + * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + + +/* this is ordered in decades to simplify encoding */ +static char alphabet[] = + "0123456789" "-$:/.+ABCD"; + +#define CODE_A 16 +#define CODE_B 17 + +#define NARROW 12 +#define WIDE 14 + +/* Patterns */ +static char *patterns[] = { +"1111133","1111331","1113113","3311111","1131131", +"3111131","1311113","1311311","1331111","3113111", +"1113311","1133111","3111313","3131113","3131311", +"1131313","1133131","1313113","1113133","1113331" }; + +/* + * Check that the text can be encoded. Returns 0 or -1. + * If it's all lowecase convert to uppercase and accept it. + * If the first character is a letter (A to D), the last one must be too; + * no other character should be a letter. + */ +int Barcode_cbr_verify(unsigned char *text) +{ + int i, lower=0, upper=0; + int startpresent = 0; + + if (!strlen(text)) + return -1; + for (i=0; text[i]; i++) { + char * pos; + if (isupper(text[i])) upper++; + if (islower(text[i])) lower++; + pos = strchr(alphabet,toupper(text[i])); + if (!pos) + return -1; + if (i == 0 && pos - alphabet >= CODE_A) + startpresent = 1; + else if (pos - alphabet >= CODE_A && + (!startpresent || i != strlen(text) - 1)) + return -1; + } + if (lower && upper) + return -1; + return 0; +} + +static int add_one(char *ptr, int code) +{ + sprintf(ptr,"1%s", /* separator */ patterns[code]); + return 0; +} + +/* + * The encoding functions fills the "partial" and "textinfo" fields. + * Lowercase chars are converted to uppercase + */ +int Barcode_cbr_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *c, *ptr, *textptr; + int i, code, textpos, usesum, checksum = 0, startpresent; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("codabar"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* the partial code is 8 * (head + text + check + tail) + margin + term. */ + partial = malloc( (strlen(text) + 3) * 8 + 2); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * (strlen + check) +term */ + textinfo = malloc(10*(strlen(text) + 1) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + ptr = partial; + textptr = textinfo; + textpos = 0; + usesum = bc->flags & BARCODE_NO_CHECKSUM ? 0 : 1; + /* if no start character specified, A is used as a start character */ + if (!isalpha(text[0])) { + add_one(ptr, CODE_A); + ptr += strlen(ptr); + textpos = WIDE; + checksum = CODE_A; + startpresent = 0; + } else { + startpresent = 1; + } + for (i=0; ierror = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + code = c - alphabet; + add_one(ptr, code); + sprintf(textptr, "%i:12:%c ", textpos, toupper(text[i])); + textpos += code < 12 ? NARROW : WIDE; + textptr += strlen(textptr); + ptr += strlen(ptr); + checksum += code; + if (startpresent && usesum && i == strlen(text) - 2) { + /* stuff a check symbol before the stop */ + c = strchr(alphabet, toupper(text[i+1])); + if (!c) /* impossible */ + continue; + code = c - alphabet; + checksum += code; + + /* Complement to a multiple of 16 */ + checksum = (checksum + 15) / 16 * 16 - checksum; + add_one(ptr, checksum); + ptr += strlen(ptr); + } + } + if (!startpresent) { + if (usesum) { + /* if no start character specified, B is used as a stop char */ + checksum += CODE_B; + checksum = (checksum + 15) / 16 * 16 - checksum; + add_one(ptr, checksum); + ptr += strlen(ptr); + } + add_one(ptr, CODE_B); + } + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} diff --git a/barcode-0.98/code128.c b/barcode-0.98/code128.c new file mode 100644 index 00000000..cebba54c --- /dev/null +++ b/barcode-0.98/code128.c @@ -0,0 +1,607 @@ +/* + * code128.c -- encoding for code128 (A, B, C) + * + * Copyright (c) 1999,2000 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + +static char *codeset[] = { + "212222", "222122", "222221", "121223", "121322", /* 0 - 4 */ + "131222", "122213", "122312", "132212", "221213", + "221312", "231212", "112232", "122132", "122231", /* 10 - 14 */ + "113222", "123122", "123221", "223211", "221132", + "221231", "213212", "223112", "312131", "311222", /* 20 - 24 */ + "321122", "321221", "312212", "322112", "322211", + "212123", "212321", "232121", "111323", "131123", /* 30 - 34 */ + "131321", "112313", "132113", "132311", "211313", + "231113", "231311", "112133", "112331", "132131", /* 40 - 44 */ + "113123", "113321", "133121", "313121", "211331", + "231131", "213113", "213311", "213131", "311123", /* 50 - 54 */ + "311321", "331121", "312113", "312311", "332111", + "314111", "221411", "431111", "111224", "111422", /* 60 - 64 */ + "121124", "121421", "141122", "141221", "112214", + "112412", "122114", "122411", "142112", "142211", /* 70 - 74 */ + "241211", "221114", "413111", "241112", "134111", + "111242", "121142", "121241", "114212", "124112", /* 80 - 84 */ + "124211", "411212", "421112", "421211", "212141", + "214121", "412121", "111143", "111341", "131141", /* 90 - 94 */ + "114113", "114311", "411113", "411311", "113141", + "114131", "311141", "411131", "b1a4a2", "b1a2a4", /* 100 - 104 */ + "b1a2c2", "b3c1a1b" +}; + +#define START_A 103 +#define START_B 104 +#define START_C 105 +#define STOP 106 +#define SHIFT 98 /* only A and B */ +#define CODE_A 101 /* only B and C */ +#define CODE_B 100 /* only A and C */ +#define CODE_C 99 /* only A and B */ +#define FUNC_1 102 /* all of them */ +#define FUNC_2 97 /* only A and B */ +#define FUNC_3 96 /* only A and B */ +/* FUNC_4 is CODE_A when in A and CODE_B when in B */ + +#define SYMBOL_WID 11 /* all of them are 11-bar wide */ + +/* + * code 128-b includes all printable ascii chars + */ + +int Barcode_128b_verify(unsigned char *text) +{ + if (text[0] == '\0') + return -1; + while (*text && *text>=32 && !(*text&0x80)) + text++; + if (*text) + return -1; /* a non-ascii char */ + return 0; /* ok */ +} + +int Barcode_128b_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *textptr; + int i, code, textpos, checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("code 128-B"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* the partial code is 6* (head + text + check + tail) + final + term. */ + partial = malloc( (strlen(text) + 4) * 6 +2); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * strlen +term */ + textinfo = malloc(10*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + /* up to now, it was the same code as other encodings */ + + strcpy(partial, "0"); /* the first space */ + strcat(partial, codeset[START_B]); + checksum += START_B; /* the start char is counted in the checksum */ + textptr = textinfo; + textpos = SYMBOL_WID; + + for (i=0; ierror = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + code = text[i]-32; + strcat(partial, codeset[code]); + checksum += code * (i+1); /* first * 1 + second * 2 + third * 3... */ + sprintf(textptr, "%i:12:%c ", textpos, text[i]); + textptr += strlen(textptr); + textpos += SYMBOL_WID; /* width of each code */ + } + /* Add the checksum, independent of BARCODE_NO_CHECKSUM */ + checksum %= 103; + strcat(partial, codeset[checksum]); + /* and the end marker */ + strcat(partial, codeset[STOP]); + + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} + +/* + * code 128-c is only digits, but two per symbol + */ + +int Barcode_128c_verify(unsigned char *text) +{ + if (text[0] == '\0') + return -1; + /* must be an even number of digits */ + if (strlen(text)%2) + return -1; + /* and must be all digits */ + for (; *text; text++) + if (!isdigit(*text)) + return -1; + return 0; +} + +int Barcode_128c_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *textptr; + int i, code, textpos, checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("code 128-C"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* the partial code is 6* (head + text + check + tail) + final + term. */ + partial = malloc( (strlen(text) + 3) * 6 +2); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn.5:fff:c " * strlen +term */ + textinfo = malloc(12*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + strcpy(partial, "0"); /* the first space */ + strcat(partial, codeset[START_C]); + checksum += START_C; /* the start char is counted in the checksum */ + textptr = textinfo; + textpos = SYMBOL_WID; + + for (i=0; text[i]; i+=2) { + if (!isdigit(text[i]) || !isdigit(text[i+1])) { + bc->error = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + code = (text[i]-'0') * 10 + text[i+1]-'0'; + strcat(partial, codeset[code]); + checksum += code * (i/2+1); /* first * 1 + second * 2 + third * 3... */ + + /* print as "%s", because we have ".5" positions */ + sprintf(textptr, "%g:9:%c %g:9:%c ", (double)textpos, text[i], + textpos + (double)SYMBOL_WID/2, text[i+1]); + textptr += strlen(textptr); + textpos += SYMBOL_WID; /* width of each code */ + } + /* Add the checksum, independent of BARCODE_NO_CHECKSUM */ + checksum %= 103; + strcat(partial, codeset[checksum]); + /* and the end marker */ + strcat(partial, codeset[STOP]); + + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} + +/* + * generic (full-featured) code128 implementation: it selects between + * A, B, C according to the data being encoded. F1, F2, F3, F4 are expressed + * using ascii chars 0xc1, 0xc2, 0xc3, 0xc4 (0301, 0302, 0303, 0304). + * Char '\0' is expressed by 0x80 (0200). + */ + +int Barcode_128_verify(unsigned char *text) +{ + if (text[0] == '\0') + return -1; + while (*text && (*text<=0x80 || (*text >= 0xc1 && *text <= 0xc4))) + text++; + if (*text) + return -1; /* unencodable character */ + return 0; /* ok */ +} + + +/* + * These functions are extracted from Barcode_128_encode for clarity. + * It deals with choosing the symbols used to represent the text + * and returns a dynamic array of integers, terminated by -1. + * + * The algorithm used in choosing the codes comes from App 2 of + * "El Codigo Estandar EAN/UCC 128", courtesy of AECOC, Spain. + * Thanks to Dani Pardo for getting permission and giving me a copy + * of the document + */ + +#define NEED_CODE_A(c) ((c)<32 || (c)==0x80) +#define NEED_CODE_B(c) ((c)>=96 && (c)<128) + +static int Barcode_a_or_b(unsigned char *text) +{ + for ( ; *text; text++) { + if (NEED_CODE_A(*text)) + return 'A'; + if (NEED_CODE_B(*text)) + return 'B'; + } + return 0; /* any */ +} + +/* code is either 'A' or 'B', and value must be valid */ +static int Barcode_encode_as(int code, int value) +{ + + /* first check the special chars */ + if (value == 0xC1) return FUNC_1; + if (value == 0xC2) return FUNC_2; + if (value == 0xC3) return FUNC_3; + if (value == 0xC4) { /* F4 */ + if (code == 'A') return CODE_A; + return CODE_B; + } + + /* then check ascii values */ + if (value >= 0x20 && value <= 0x5F) + return value - 0x20; /* both codes */ + if (value == 0x80) return 64; /* code A */ + if (value < 0x20) return value+64; /* code A */ + if (value >= 0x60) return value - 0x20; /* code B */ + /* can't happen */ + return -1; +} + +static int *Barcode_128_make_array(struct Barcode_Item *bc, int *lptr) +{ + int len, *codes; + unsigned char *s; + int i=0, j, code, checksum; + + /* allocate twice the text length + 5, as this is the worst case */ + len = 2 * strlen(bc->ascii) + 5; + codes = malloc(len * sizeof(int)); + s = bc->ascii; + + /* choose the starting code */ + if (s[2]=='\0' && isdigit(s[0]) && isdigit(s[1])) { + code = 'C'; + } else if (isdigit(s[0])&&isdigit(s[1]) && isdigit(s[2])&&isdigit(s[3])) { + code = 'C'; + } else { + code = Barcode_a_or_b(s); + if (!code) code = 'B'; /* default */ + } + codes[i++] = START_A + code - 'A'; + + for (s = bc->ascii; *s; /* increments are in the loop */) { + switch(code) { + + case 'C': + if (s[0] == 0xC1) { /* F1 is valid */ + codes[i++] = FUNC_1; + s++; + } else if (isdigit(s[0]) && isdigit(s[1])) { + /* encode two digits */ + codes[i++] = (s[0]-'0') * 10 + s[1]-'0'; + s += 2; + } else { + /* change code */ + code = Barcode_a_or_b(s); + if (!code) code = 'B'; + codes[i++] = (code == 'A') ? CODE_A : CODE_B; + } + break; + + case 'B': + case 'A': + for (j=0; isdigit(s[j]); j++) + ; + if (j>=4) { /* if there are 4 or more digits, turn to C */ + if (j&1) { + /* odd number: encode one first */ + codes[i++] = *(s++) - ' '; + } + codes[i++] = CODE_C; + code = 'C'; + } else if (code == 'A' && NEED_CODE_B(*s)) { + /* check whether we should use SHIFT or change code */ + j = Barcode_a_or_b(s+1); + if (j == 'B') { + codes[i++] = CODE_B; + code = 'B'; + } else { + codes[i++] = SHIFT; + codes[i++] = Barcode_encode_as('B', *s); + s++; + } + } else if (code == 'B' && NEED_CODE_A(*s)) { + /* check whether we should use SHIFT or change code */ + j = Barcode_a_or_b(s+1); + if (j == 'A') { + codes[i++] = CODE_A; + code = 'A'; + } else { + codes[i++] = SHIFT; + codes[i++] = Barcode_encode_as('A', *s); + s++; + } + } else { + codes[i++] = Barcode_encode_as(code, *s); + s++; + } + break; + } + } + /* add the checksum */ + checksum = codes[0]; + for (j=1; j len) { + fprintf(stderr, "impossible: length is > allocated len\n"); + } + *lptr = i; + return codes; +} + +/* + * Encoding is tricky, in that we cannot print the ascii + * representation in an easy way. Therefore, just skip non-printable + * chars and try to fit the rest somehow. + */ +int Barcode_128_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *textptr; + int *codes; /* dynamic */ + int i, c, len; + double textpos, size, step; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("code 128"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + + codes = Barcode_128_make_array(bc, &len); + if (!codes) return -1; + + /* the partial code is 6*codelen + ini + term (+margin) */ + partial = malloc( 6 * len + 4); + if (!partial) { + bc->error = errno; + free(codes); + return -1; + } + + /* the text information is at most "nnn.n:ff.f:c " * strlen +term */ + textptr = textinfo = malloc(13*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + free(codes); + return -1; + } + + /* up to now, it was almost the same code as other encodings */ + + strcpy(partial, "0"); /* the first space */ + for (i=0; i 12.0) size = 12.0; + + /* align the text to the left, using its natural size */ + step = (int)(10 * (size/18.0 * SYMBOL_WID) + .5) / 10.0; + textpos = SYMBOL_WID; + + for (i=0; i 0xc0) c = ' '; /* F code */ + sprintf(textptr, "%g:%g:%c ", textpos, size, c); + textptr += strlen(textptr); + textpos += step; + } + + bc->partial = partial; + bc->textinfo = textinfo; + free(codes); + return 0; +} + +/* + * A raw 128 code is given as a sequence of space separated numbers + * from 0 to 105, starting from the start code to be (Leonid) + */ + +int Barcode_128raw_verify(unsigned char *text) +{ + int n; + unsigned val; + + if (!strlen(text)) + return -1; + while (*text) { + if (sscanf(text, "%u%n", &val, &n) < 1) + return -1; + if (val > 105) + return -1; + text += n; + } + return 0; +} + +int Barcode_128raw_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *textptr; + int i, n, count, code, textpos, checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("128raw"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* + * length of partial code is unknown in advance, but it is + * at most 6* (1+text/2 + check + tail) + final + terminator + */ + partial = malloc( (3+ strlen(text)/2) * 6 + 2); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn.5:fff:c " * 1+strlen/2 +term */ + textinfo = malloc(12 * (1+strlen(text)/2) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + strcpy(partial, "0"); /* the first space */ + textptr = textinfo; + textpos = 0; + + for (i=0, count = 0; i < strlen(text); count++) { + if (sscanf(text + i, "%u%n", &code, &n) < 1) { + bc->error = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + strcat(partial, codeset[code]); + + /* + * since the start code is part of the "raw" input, it is + * counted in the checksum by itself + */ + if (!count) checksum += code; /* the start code */ + else checksum += code * count; /* first * 1 + second * 2 ... */ + + /* + * print as "%s", because we have ".5" positions + * also, use a size of 9 like codeC above, as each symbol is + * represented by two chars + */ + sprintf(textptr, "%g:9:%c %g:9:%c ", (double)textpos, + code >= 100 ? 'A' : code/10 + '0', + textpos + (double)SYMBOL_WID/2, code%10 + '0'); + textptr += strlen(textptr); + textpos += SYMBOL_WID; /* width of each code */ + i += n; + } + /* Add the checksum, independent of BARCODE_NO_CHECKSUM */ + checksum %= 103; + strcat(partial, codeset[checksum]); + /* and the end marker */ + strcat(partial, codeset[STOP]); + + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} + diff --git a/barcode-0.98/code39.c b/barcode-0.98/code39.c new file mode 100644 index 00000000..3308c950 --- /dev/null +++ b/barcode-0.98/code39.c @@ -0,0 +1,173 @@ +/* + * code39.c -- encoding for code39 + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + + +/* this is ordered in decades to simplify encoding */ +static char alphabet[] = + "1234567890" "ABCDEFGHIJ" "KLMNOPQRST" "UVWXYZ-. *" "$/+%"; + +/* the checksum alphabet has a different order */ +static char checkbet[] = + "0123456789" "ABCDEFGHIJ" "KLMNOPQRST" "UVWXYZ-. $" "/+%"; + +/* The first 40 symbols repeat this bar pattern */ +static char *bars[] = { + "31113","13113","33111","11313","31311", + "13311","11133","31131","13131","11331"}; + +/* The first 4 decades use these space patterns */ +static char *spaces[] = {"1311","1131","1113","3111"}; + +/* the last four symbols are special */ +static char *specialbars[] = { + "11111","11111","11111","11111"}; + +static char *specialspaces[] = { + "3331","3313","3133","1333"}; + +static char *fillers[]= { + "0a3a1c1c1a", + "1a3a1c1c1a" +}; + + +/* + * Check that the text can be encoded. Returns 0 or -1. + * If it's all lowecase convert to uppercase and accept it + */ +int Barcode_39_verify(unsigned char *text) +{ + int i, lower=0, upper=0; + + if (text[0] == '\0') + return -1; + for (i=0; text[i]; i++) { + if (isupper(text[i])) upper++; + if (islower(text[i])) lower++; + if (!strchr(alphabet,toupper(text[i]))) + return -1; + } + if (lower && upper) + return -1; + return 0; +} + +static int add_one(char *ptr, int code) +{ + char *b, *s; + + if (code < 40) { + b = bars[code%10]; + s = spaces[code/10]; + } else { + b = specialbars[code-40]; + s = specialspaces[code-40]; + } + sprintf(ptr,"1%c%c%c%c%c%c%c%c%c", /* separator */ + b[0], s[0], b[1], s[1], b[2], s[2], + b[3], s[3], b[4]); + return 0; +} + +/* + * The encoding functions fills the "partial" and "textinfo" fields. + * Lowercase chars are converted to uppercase + */ +int Barcode_39_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *c, *ptr, *textptr; + int i, code, textpos, checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("code 39"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* the partial code is 10* (head + text + check + tail) + margin + term. */ + partial = malloc( (strlen(text) + 3) * 10 +2); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * strlen +term */ + textinfo = malloc(10*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + strcpy(partial, fillers[0]); + ptr = partial + strlen(partial); + textptr = textinfo; + textpos = 22; + + for (i=0; text[i]; i++) { + c = strchr(alphabet, toupper(text[i])); + if (!c) { + bc->error = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + code = c - alphabet; + add_one(ptr, code); + c = strchr(checkbet,*c); + if (c) /* the '*' is not there */ + checksum += (c-checkbet); + sprintf(textptr, "%i:12:%c ", textpos, toupper(text[i])); + + textpos += 16; /* width of each code */ + textptr += strlen(textptr); + ptr += strlen(ptr); + } + /* Add the checksum */ + if ( (bc->flags & BARCODE_NO_CHECKSUM)==0 ) { + code = (strchr(alphabet, checkbet[checksum % 43]) - alphabet); + add_one(ptr, code); + } + strcat(ptr, fillers[1]); /* end */ + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} diff --git a/barcode-0.98/code93.c b/barcode-0.98/code93.c new file mode 100644 index 00000000..73f8cee3 --- /dev/null +++ b/barcode-0.98/code93.c @@ -0,0 +1,213 @@ +/* + * code39.c -- encoding for code39 + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * Copyright (c) 2001 Nathan D. Holmes / FedEx Services (ndholmes@fedex.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + + +/* this is ordered in decades to simplify encoding */ +static char alphabet[] = + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"; + +static char *codeset[] = { + "131112", "111213", "111312", "111411", "121113", /* 0 - 4 */ + "121212", "121311", "111114", "131211", "141111", /* 5 - 9 */ + "211113", "211212", "211311", "221112", "221211", /* A - E */ + "231111", "112113", "112212", "112311", "122112", /* F - J */ + "132111", "111123", "111222", "111321", "121122", /* K - O */ + "131121", "212112", "212211", "211122", "211221", /* P - T */ + "221121", "222111", "112122", "112221", "122121", /* U - Y */ + "123111", "121131", "311112", "311211", "321111", /* Z - $ */ + "112131", "113121", "211131", "121221", "312111", /* / - (%) */ + "311121", "122211", "111141" /* (/) - (terminator) */ +}; + + +/* 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111 */ +/* 00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222 */ +/* 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 */ +static char shiftset[] = + "%$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%% /// ///// / /%%%%%% %%%%%%++++++++++++++++++++++++++%%%%%"; +static char shiftset2[] = + "UABCDEFGHIJKLMNOPQRSTUVWXYZABCDE ABC FGHIJ L ZFGHIJV KLMNOWABCDEFGHIJLKMNOPQRSTUVWXYZPQRST"; + +#define START_STOP 47 +#define EXTEND_DOLLAR 43 +#define EXTEND_PERCENT 44 +#define EXTEND_SLASH 45 +#define EXTEND_PLUS 46 + +/* + * Check that the text can be encoded. Returns 0 or -1. + * All of ASCII-7 is accepted. + */ +int Barcode_93_verify(unsigned char *text) +{ + int i; + + if (!strlen(text)) + return -1; + for (i=0; text[i]; i++) { + + /* Test if beyond the range of 7-bit ASCII */ + if ((int)text[i] > 127) + return -1; + } + return 0; +} + +/* + * The encoding functions fills the "partial" and "textinfo" fields. + * Lowercase chars are converted to uppercase + */ +int Barcode_93_encode(struct Barcode_Item *bc) +{ + static unsigned char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *c, *textptr; + int *checksum_str; + int i, code, textpos, checksum_len=0; + int c_checksum = 0; + int k_checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("code 93"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + + /* the partial code is 6 * (head + 2* text + 2* check + tail) + margin + term. */ + partial = malloc( (strlen(text) *2 + 4) * 6 +2); + if (!partial) { + bc->error = errno; + return -1; + } + + checksum_str = (int *)malloc( (strlen(text) + 3) * 2 * sizeof(int)); + if (!checksum_str) { + free(partial); + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * strlen +term */ + textinfo = malloc(10*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + free(checksum_str); + return -1; + } + + textptr = textinfo; + textpos = 22; + strcpy(partial, "0"); + strcat(partial, codeset[START_STOP]); + + for (i=0; iflags & BARCODE_NO_CHECKSUM)==0 ) + { + for(i=1; i<=checksum_len; i++) + { + c_checksum += i * (int)checksum_str[checksum_len - i]; + k_checksum += (i+1) * (int)checksum_str[checksum_len - i]; + } + + c_checksum = c_checksum % 47; + k_checksum += c_checksum; + k_checksum = k_checksum % 47; + + strcat(partial, codeset[c_checksum]); + strcat(partial, codeset[k_checksum]); + + } + strcat(partial, codeset[START_STOP]); /* end */ + + /* Encodes final 1-unit width bar to turn the start character into a stop char */ + strcat(partial, "1"); + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} diff --git a/barcode-0.98/compat/getopt.c b/barcode-0.98/compat/getopt.c new file mode 100644 index 00000000..91f00b55 --- /dev/null +++ b/barcode-0.98/compat/getopt.c @@ -0,0 +1,831 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu + before changing it! + + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* This tells Alpha OSF/1 not to define a getopt prototype in . + Ditto for AIX 3.2 and . */ +#ifndef _NO_PROTO +#define _NO_PROTO +#endif + +#ifdef HAVE_CONFIG_H +#include +#endif + +#if !defined (__STDC__) || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#if defined (_LIBC) || !defined (__GNU_LIBRARY__) + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +#include +#if defined (_LIBC) || defined (HAVE_UNISTD_H) +#include +#endif +#endif /* GNU C library. */ + +#ifdef VMS +#include +#if HAVE_STRING_H - 0 +#include +#endif +#endif + +#ifdef WIN32 +/* It's not Unix, really. See? Capital letters. */ +#include +#define getpid() GetCurrentProcessId() +#endif + +#ifndef _ +/* This is for other GNU distributions with internationalized messages. + When compiling libc, the _ macro is predefined. */ +#ifdef HAVE_LIBINTL_H +# include +# define _(msgid) gettext (msgid) +#else +# define _(msgid) (msgid) +#endif +#endif + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg = NULL; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* XXX 1003.2 says this must be 1 before any call. */ +int optind = 0; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return EOF with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +/* Value of POSIXLY_CORRECT environment variable. */ +static char *posixly_correct; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +#include +#define my_index strchr +#else + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +char *getenv (); + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +/* If using GCC, we can safely declare strlen this way. + If not using GCC, it is ok not to declare it. */ +#ifdef __GNUC__ +/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. + That was relevant to code that was here before. */ +#if !defined (__STDC__) || !__STDC__ +/* gcc with -traditional declares the built-in strlen to return int, + and has done so at least since version 2.4.5. -- rms. */ +extern int strlen (const char *); +#endif /* not __STDC__ */ +#endif /* __GNUC__ */ + +#endif /* not __GNU_LIBRARY__ */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +static const char *nonoption_flags; +static int nonoption_flags_len; + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +#if defined (__STDC__) && __STDC__ +static void exchange (char **); +#endif + +static void +exchange (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Initialize the internal data when the first call is made. */ + +#if defined (__STDC__) && __STDC__ +static const char *_getopt_initialize (const char *); +#endif +static const char * +_getopt_initialize (optstring) + const char *optstring; +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + first_nonopt = last_nonopt = optind = 1; + + nextchar = NULL; + + posixly_correct = getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (posixly_correct != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + + if (posixly_correct == NULL) + { + /* Bash 2.0 puts a special variable in the environment for each + command it runs, specifying which ARGV elements are the results of + file name wildcard expansion and therefore should not be + considered as options. */ + char var[100]; + sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); + nonoption_flags = getenv (var); + if (nonoption_flags == NULL) + nonoption_flags_len = 0; + else + nonoption_flags_len = strlen (nonoption_flags); + } + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns `EOF'. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + optarg = NULL; + + if (optind == 0) + { + optstring = _getopt_initialize (optstring); + optind = 1; /* Don't scan ARGV[0], the program name. */ + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. */ +#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ + || (optind < nonoption_flags_len \ + && nonoption_flags[optind] == '1')) + + if (nextchar == NULL || *nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (last_nonopt > optind) + last_nonopt = optind; + if (first_nonopt > optind) + first_nonopt = optind; + + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc && NONOPTION_P) + optind++; + last_nonopt = optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return EOF; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (ordering == REQUIRE_ORDER) + return EOF; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[optind][1] == '-' + || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound; + int option_index; + + for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + +#ifdef lint /* Suppress `used before initialized' warning. */ + indfound = 0; +#endif + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if (nameend - nextchar == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + _("%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + _("%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[optind - 1][0], pfound->name); + + nextchar += strlen (nextchar); + + optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { + if (posixly_correct) + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: illegal option -- %c\n"), + argv[0], c); + else + fprintf (stderr, _("%s: invalid option -- %c\n"), + argv[0], c); + } + optopt = c; + return '?'; + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = NULL; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* _LIBC or not __GNU_LIBRARY__. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == EOF) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/barcode-0.98/compat/getopt.h b/barcode-0.98/compat/getopt.h new file mode 100644 index 00000000..952f4830 --- /dev/null +++ b/barcode-0.98/compat/getopt.h @@ -0,0 +1,129 @@ +/* Declarations for getopt. + Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +#if defined (__STDC__) && __STDC__ + const char *name; +#else + char *name; +#endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +#if defined (__STDC__) && __STDC__ +#ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +#else /* not __GNU_LIBRARY__ */ +extern int getopt (); +#endif /* __GNU_LIBRARY__ */ +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); +#else /* not __STDC__ */ +extern int getopt (); +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H */ diff --git a/barcode-0.98/configure b/barcode-0.98/configure new file mode 100755 index 00000000..f0e5d457 --- /dev/null +++ b/barcode-0.98/configure @@ -0,0 +1,5197 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.57. +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# 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 Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="barcode.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP GETOPT_O NO_GETOPT NO_LIBPAPER LIBPAPER NO_STRERROR GMAKEDEPEND0 GMAKEDEPEND1 GMAKEDEPEND2 LIBOBJS LTLIBOBJS MAKEINFO REMOVEHTMLTAGS INFOTOHTML' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# 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. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +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 + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -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 | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$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 ;; + + -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 ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + 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 ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=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 ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + 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'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +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 + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + 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 + + +# 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 its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + 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 + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# 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 \`..'] + +_ACEOF + + cat <<_ACEOF +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] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --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] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +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 + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style 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 + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +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 0 +fi +exec 5>config.log +cat >&5 <<_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.57. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +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` +hostinfo = `(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=. + echo "PATH: $as_dir" +done + +} >&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_sep= +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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$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 + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core core.* *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >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 + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + 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. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +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 `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +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 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`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. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +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 +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_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" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +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 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out 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. +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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 | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$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 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* 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; +} +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 +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext +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}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; 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 + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +if test x$GCC = xyes; then + CFLAGS="$CFLAGS -Wall" +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 +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f 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 +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +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 + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f 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 >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* 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 >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#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)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +if test "${ac_cv_header_getopt_h+set}" = set; then + echo "$as_me:$LINENO: checking for getopt.h" >&5 +echo $ECHO_N "checking for getopt.h... $ECHO_C" >&6 +if test "${ac_cv_header_getopt_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_getopt_h" >&5 +echo "${ECHO_T}$ac_cv_header_getopt_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking getopt.h usability" >&5 +echo $ECHO_N "checking getopt.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking getopt.h presence" >&5 +echo $ECHO_N "checking getopt.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: getopt.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: getopt.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: getopt.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: getopt.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: getopt.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: getopt.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: getopt.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: getopt.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: getopt.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: getopt.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for getopt.h" >&5 +echo $ECHO_N "checking for getopt.h... $ECHO_C" >&6 +if test "${ac_cv_header_getopt_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_getopt_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_getopt_h" >&5 +echo "${ECHO_T}$ac_cv_header_getopt_h" >&6 + +fi +if test $ac_cv_header_getopt_h = yes; then + : +else + NO_GETOPT=-DNO_GETOPT;GETOPT_O=compat/getopt.o +fi + + +if test "${ac_cv_header_paper_h+set}" = set; then + echo "$as_me:$LINENO: checking for paper.h" >&5 +echo $ECHO_N "checking for paper.h... $ECHO_C" >&6 +if test "${ac_cv_header_paper_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_paper_h" >&5 +echo "${ECHO_T}$ac_cv_header_paper_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking paper.h usability" >&5 +echo $ECHO_N "checking paper.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking paper.h presence" >&5 +echo $ECHO_N "checking paper.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: paper.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: paper.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: paper.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: paper.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: paper.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: paper.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: paper.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: paper.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: paper.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: paper.h: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for paper.h" >&5 +echo $ECHO_N "checking for paper.h... $ECHO_C" >&6 +if test "${ac_cv_header_paper_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_paper_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_paper_h" >&5 +echo "${ECHO_T}$ac_cv_header_paper_h" >&6 + +fi +if test $ac_cv_header_paper_h = yes; then + LIBPAPER=-lpaper +else + NO_LIBPAPER=-DNO_LIBPAPER +fi + + + +for ac_header in unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +echo "$as_me:$LINENO: checking for strerror" >&5 +echo $ECHO_N "checking for strerror... $ECHO_C" >&6 +if test "${ac_cv_func_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char strerror (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +/* 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_strerror) || defined (__stub___strerror) +choke me +#else +char (*f) () = strerror; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != strerror; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strerror=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_strerror=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_strerror" >&5 +echo "${ECHO_T}$ac_cv_func_strerror" >&6 +if test $ac_cv_func_strerror = yes; then + : +else + NO_STRERROR=-DNO_STRERROR +fi + + +for ac_func in strcasecmp +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +echo "$as_me:$LINENO: checking \"for gmake\"" >&5 +echo $ECHO_N "checking \"for gmake\"... $ECHO_C" >&6 +GMAKE=no +${MAKE=make} --version 2> /dev/null | grep GNU > /dev/null && GMAKE=yes +echo "$as_me:$LINENO: result: $GMAKE" >&5 +echo "${ECHO_T}$GMAKE" >&6 +if test "$GMAKE" = "yes"; then + GMAKEDEPEND0='ifeq (.depend,$(wildcard .depend))' + GMAKEDEPEND1='include .depend' + GMAKEDEPEND2='endif' +fi + +echo "$as_me:$LINENO: checking \"if makeinfo can output html\"" >&5 +echo $ECHO_N "checking \"if makeinfo can output html\"... $ECHO_C" >&6 +MAKEINFOHTML=no +${MAKEINFO=makeinfo} --help | grep .--html > /dev/null && MAKEINFOHTML=yes +echo "$as_me:$LINENO: result: $MAKEINFOHTML" >&5 +echo "${ECHO_T}$MAKEINFOHTML" >&6 +if test "$MAKEINFOHTML" = "yes"; then + REMOVEHTMLTAGS="cat" + INFOTOHTML="$MAKEINFO --html" +else + REMOVEHTMLTAGS="sed 's/ifnottex/ifinfo/; s/ifnotinfo/iftex/'" + INFOTOHTML="perl texi2html -monolithic" +fi + + + + + + + + + + + + ac_config_files="$ac_config_files Makefile" +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, don't put newlines in cache variables' values. +# 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. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *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 \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + 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}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ 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[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $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} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.57. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet 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 + +Configuration files: +$config_files + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.57, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +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=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + 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 +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + 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 +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@GETOPT_O@,$GETOPT_O,;t t +s,@NO_GETOPT@,$NO_GETOPT,;t t +s,@NO_LIBPAPER@,$NO_LIBPAPER,;t t +s,@LIBPAPER@,$LIBPAPER,;t t +s,@NO_STRERROR@,$NO_STRERROR,;t t +s,@GMAKEDEPEND0@,$GMAKEDEPEND0,;t t +s,@GMAKEDEPEND1@,$GMAKEDEPEND1,;t t +s,@GMAKEDEPEND2@,$GMAKEDEPEND2,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # 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. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# 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 || { (exit 1); exit 1; } +fi + + + + + + + ac_config_files="$ac_config_files doc/Makefile" +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, don't put newlines in cache variables' values. +# 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. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *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 \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + 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}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ 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[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed + + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $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} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; 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 + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# 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 + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + 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 + + ;; + 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 + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # 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 sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.57. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet 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 + +Configuration files: +$config_files + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.57, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +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=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + 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 +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + + + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + 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 +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@GETOPT_O@,$GETOPT_O,;t t +s,@NO_GETOPT@,$NO_GETOPT,;t t +s,@NO_LIBPAPER@,$NO_LIBPAPER,;t t +s,@LIBPAPER@,$LIBPAPER,;t t +s,@NO_STRERROR@,$NO_STRERROR,;t t +s,@GMAKEDEPEND0@,$GMAKEDEPEND0,;t t +s,@GMAKEDEPEND1@,$GMAKEDEPEND1,;t t +s,@GMAKEDEPEND2@,$GMAKEDEPEND2,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@REMOVEHTMLTAGS@,$REMOVEHTMLTAGS,;t t +s,@INFOTOHTML@,$INFOTOHTML,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # 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. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# 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 || { (exit 1); exit 1; } +fi + + diff --git a/barcode-0.98/configure.in.dist b/barcode-0.98/configure.in.dist new file mode 100644 index 00000000..07120b48 --- /dev/null +++ b/barcode-0.98/configure.in.dist @@ -0,0 +1,65 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(barcode.h) +AC_PREREQ(2.12) + +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_INSTALL + +dnl Add "-Wall" if this is gcc +if test x$GCC = xyes; then + CFLAGS="$CFLAGS -Wall" +fi + + +dnl Check for getopt and libpaper. If getopt is missing, use our version +AC_CHECK_HEADER(getopt.h, ,NO_GETOPT=-DNO_GETOPT;GETOPT_O=compat/getopt.o) +AC_CHECK_HEADER(paper.h, LIBPAPER=-lpaper, NO_LIBPAPER=-DNO_LIBPAPER) +AC_CHECK_HEADERS(unistd.h) + +AC_CHECK_FUNC(strerror, , NO_STRERROR=-DNO_STRERROR) +AC_CHECK_FUNCS(strcasecmp) + +dnl Check if this is gmake, but allow ovverriding using $MAKE +AC_MSG_CHECKING("for gmake") +GMAKE=no +${MAKE=make} --version 2> /dev/null | grep GNU > /dev/null && GMAKE=yes +AC_MSG_RESULT($GMAKE) +if test "$GMAKE" = "yes"; then + GMAKEDEPEND0='ifeq (.depend,$(wildcard .depend))' + GMAKEDEPEND1='include .depend' + GMAKEDEPEND2='endif' +fi + +dnl Check if we use makeinfo or the local texi2html tool +AC_MSG_CHECKING("if makeinfo can output html") +MAKEINFOHTML=no +${MAKEINFO=makeinfo} --help | grep .--html > /dev/null && MAKEINFOHTML=yes +AC_MSG_RESULT($MAKEINFOHTML) +if test "$MAKEINFOHTML" = "yes"; then + REMOVEHTMLTAGS="cat" + INFOTOHTML="$MAKEINFO --html" +else + REMOVEHTMLTAGS="sed 's/ifnottex/ifinfo/; s/ifnotinfo/iftex/'" + INFOTOHTML="perl texi2html -monolithic" +fi + + +AC_SUBST(GETOPT_O) +AC_SUBST(NO_GETOPT) +AC_SUBST(NO_LIBPAPER) +AC_SUBST(LIBPAPER) +AC_SUBST(NO_STRERROR) +AC_SUBST(GMAKEDEPEND0) +AC_SUBST(GMAKEDEPEND1) +AC_SUBST(GMAKEDEPEND2) + +AC_OUTPUT(Makefile) + +AC_SUBST(MAKEINFO) +AC_SUBST(REMOVEHTMLTAGS) +AC_SUBST(INFOTOHTML) + +AC_OUTPUT(doc/Makefile) + diff --git a/barcode-0.98/contrib/barcode-SVG.tar.gz b/barcode-0.98/contrib/barcode-SVG.tar.gz new file mode 100644 index 00000000..69df9562 Binary files /dev/null and b/barcode-0.98/contrib/barcode-SVG.tar.gz differ diff --git a/barcode-0.98/contrib/barcode-SVG.tar.gz.README b/barcode-0.98/contrib/barcode-SVG.tar.gz.README new file mode 100644 index 00000000..1608ebaf --- /dev/null +++ b/barcode-0.98/contrib/barcode-SVG.tar.gz.README @@ -0,0 +1,24 @@ + +[readme written by GNU-barcode maintainer] + +This is a stripped version of what you can find at: + http://www.onefour.net/barcode/SVG/barcode097-SVG.tar.gz + +It's by David J. Humphreys, it's GPL code and the original tarball +(as per the previous URL) contains: + +-rwxr--r-- david/david 243 2002-01-02 04:18:00 Makefile +-rwxr--r-- david/david 1284 2002-01-08 00:26:42 main.c +-rwxr--r-- david/david 37796 2002-01-02 04:33:00 screen1.png +-rwxr--r-- david/david 5503 2002-01-08 00:30:00 svg.c +-rwxr--r-- david/david 2499 2002-01-02 03:37:00 test1.svg +-rwxr--r-- david/david 2499 2002-01-02 03:44:00 test2.svg +-rwxr--r-- david/david 2499 2002-01-02 03:49:00 test3.svg +-rwxr--r-- david/david 34185 2002-01-02 04:41:00 test4.png +-rwxr--r-- david/david 1834 2002-01-02 04:19:00 test4.svg +-rwxr--r-- david/david 92713 2002-01-02 04:36:00 transformation.png +-rwxr--r-- david/david 586 2002-01-02 04:11:00 transformation.svg + +Here I only included Makefile, main.c, svg.c, after converting +newlines to unix-style and changing permissions. + diff --git a/barcode-0.98/contrib/barcode-for-delphi.tar.gz b/barcode-0.98/contrib/barcode-for-delphi.tar.gz new file mode 100644 index 00000000..cbc8e676 Binary files /dev/null and b/barcode-0.98/contrib/barcode-for-delphi.tar.gz differ diff --git a/barcode-0.98/contrib/barcode-for-delphi.tar.gz.README b/barcode-0.98/contrib/barcode-for-delphi.tar.gz.README new file mode 100644 index 00000000..36d216d7 --- /dev/null +++ b/barcode-0.98/contrib/barcode-for-delphi.tar.gz.README @@ -0,0 +1,10 @@ + +The barcode-for-delphi tarball includes a version of this package +ported to run under Delphi. Please note that you can't distribute the +executable because of the GPL (i.e., disitributing it would be +copyright violation, because the executable is a derived work of GNU +barcode, whose authors don't allow distributing under non-GPL terms. + +I still think it may be useful to some users. + +The code has been contributed by Michael Geddes . diff --git a/barcode-0.98/contrib/barcodeps-0.1.tgz b/barcode-0.98/contrib/barcodeps-0.1.tgz new file mode 100644 index 00000000..1dadb1c6 Binary files /dev/null and b/barcode-0.98/contrib/barcodeps-0.1.tgz differ diff --git a/barcode-0.98/contrib/barcodeps-0.1.tgz.README b/barcode-0.98/contrib/barcodeps-0.1.tgz.README new file mode 100644 index 00000000..b0364f6e --- /dev/null +++ b/barcode-0.98/contrib/barcodeps-0.1.tgz.README @@ -0,0 +1,25 @@ + + ***** barcodeps 0.1 ***** + 2000-10-07 + +Barcodes generated in PostScript +by Hans Schou http://www.schou.dk + +PostScript is a programming language. It has all the control structures +needed for creating barcodes on the fly. With this example it is not +needed to have another programming language than PostScript as the +barcodes are generated within the PostScript printer. + +This contribution gives some examples of how to generate Interleave 2 of 5 +barcodes. Edit the bottom of i25.ps with a new number and send it to +a PostScript printer to see an example. + +Usage, in PostScript: +To draw a Interleave 2 of 5 use the following command in i25.ps + (123456789) BarCodeI25 + +This method is very usefull used together with other scripts +or programming language as it is only necessary to copy some +files to the printer. No program execution is needed. + + diff --git a/barcode-0.98/contrib/grab-0.0.4.tar.gz b/barcode-0.98/contrib/grab-0.0.4.tar.gz new file mode 100644 index 00000000..91fa9e6a Binary files /dev/null and b/barcode-0.98/contrib/grab-0.0.4.tar.gz differ diff --git a/barcode-0.98/contrib/grab-0.0.4.tar.gz.README b/barcode-0.98/contrib/grab-0.0.4.tar.gz.README new file mode 100644 index 00000000..4a048075 --- /dev/null +++ b/barcode-0.98/contrib/grab-0.0.4.tar.gz.README @@ -0,0 +1,13 @@ + +The purpose of this program is to read a (scanned) image containing a +barcode. The image is then interpreted and the barcode is decoded. +The decoded string is outputted to stdout. + +Currently, only Code-128 is supported. + +The program is GPL'd and it's the work of Tuukka Toivonen. + +The home page for this and other programs by Tuukka is + http://www.ee.oulu.fi/~tuukkat/releases.html +while a bare ls-like listing of all packages is at + http://www.ee.oulu.fi/~tuukkat/rel/ diff --git a/barcode-0.98/debian/README.debian b/barcode-0.98/debian/README.debian new file mode 100644 index 00000000..7223023a --- /dev/null +++ b/barcode-0.98/debian/README.debian @@ -0,0 +1,9 @@ +The Debian Package barcode +---------------------------- + +This Debian package is integrated in the upstream release of GNU +barcode, maintained by Alessandro Rubini (rubini@gnu.org, +rubini@prosa.it). Since I have no extended experience with Debian +packages, I'm willing to accept any fixes that seem fit, as well as a +real Debian maintainer for the Debian package. + diff --git a/barcode-0.98/debian/changelog b/barcode-0.98/debian/changelog new file mode 100644 index 00000000..b43e686f --- /dev/null +++ b/barcode-0.98/debian/changelog @@ -0,0 +1,27 @@ +barcode (0.98) unstable; urgency=low + + * New upstream release + + -- Alessandro Rubini Fri, 1 Mar 2002 23:04:14 +0100 + +barcode (0.96) unstable; urgency=low + + * New upstream release + + -- Alessandro Rubini Wed, 8 Nov 2000 18:29:18 +0200 + +barcode (0.95) unstable; urgency=low + + * New upstream release + + -- Alessandro Rubini Thu, 3 Feb 2000 21:16:59 +0200 + +barcode (0.94) unstable; urgency=low + + * Initial Release. + + -- Alessandro Rubini Sun, 24 Oct 1999 01:10:23 +0200 + +Local variables: +mode: debian-changelog +End: diff --git a/barcode-0.98/debian/control b/barcode-0.98/debian/control new file mode 100644 index 00000000..aacbfd49 --- /dev/null +++ b/barcode-0.98/debian/control @@ -0,0 +1,14 @@ +Source: barcode +Section: misc +Priority: optional +Maintainer: Alessandro Rubini +Standards-Version: 2.5.0 + +Package: barcode +Architecture: any +Depends: ${shlibs:Depends} +Description: Creates barcodes in .ps format + GNU barcode can create printouts for the conventional + product packagging standards: UPC-A, UPC-E, EAN-13, EAN-8, ISBN, code 39 + code 128 (b and c), and interleaved 2 of 5 . Ouput is generated as + either Postscript or Encapsulated Postscript. diff --git a/barcode-0.98/debian/copyright b/barcode-0.98/debian/copyright new file mode 100644 index 00000000..c193af2c --- /dev/null +++ b/barcode-0.98/debian/copyright @@ -0,0 +1,8 @@ +This package was written by Alessandro Rubini rubini@gnu.org on Sun, 24 Oct 1999 01:10:23 +0200. + +The pristine source can be downloaded from ftp://ftp.gnu.org/pub/barcode +and GNU mirrors. Latest and greatest version (also beta) are immediately +uploaded to ftp://ftp.prosa.it/pub/software. + +Copyright: GPL (see /usr/doc/copyright/GPL) + diff --git a/barcode-0.98/debian/dirs b/barcode-0.98/debian/dirs new file mode 100644 index 00000000..6822e402 --- /dev/null +++ b/barcode-0.98/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/include +usr/info diff --git a/barcode-0.98/debian/info b/barcode-0.98/debian/info new file mode 100644 index 00000000..18336bfb --- /dev/null +++ b/barcode-0.98/debian/info @@ -0,0 +1,15 @@ +# This is a configuration files for installing a .info menu +# The Description to be placed into the directory +DESCR="Barcode library and frontend" + +# The section this info file should be placed in (Regexp) followed by +# the new section name to be created if the Regexp does not match +# (Optional. If not given the .info will be appended to the directory) +SECTION_MATCH="[cC]ommands" +SECTION_NAME="General Commands" + +# The file referred to from the Info directory +FILE=barcode.info + +# Optional. The files to be copied to /usr/info +FILES=doc/*.info diff --git a/barcode-0.98/debian/rules b/barcode-0.98/debian/rules new file mode 100755 index 00000000..c48c5a1c --- /dev/null +++ b/barcode-0.98/debian/rules @@ -0,0 +1,50 @@ +#!/usr/bin/make -f +# Made with the aid of debmake, by Christoph Lameter, +# based on the sample debian/rules file for GNU hello by Ian Jackson. + +package=barcode + +build: + $(checkdir) + ./configure --prefix=/usr + $(MAKE) CFLAGS="-O2 -g -Wall" + touch build + +clean: + $(checkdir) + -rm -f build + -$(MAKE) distclean + -rm -f `find . -name "*~"` + -rm -rf debian/tmp debian/files* core debian/substvars + +binary-indep: checkroot build + $(checkdir) +# There are no architecture-independent files to be uploaded +# generated by this package. If there were any they would be +# made here. + +binary-arch: checkroot build + $(checkdir) + -rm -rf debian/tmp + install -d debian/tmp + cd debian/tmp && install -d `cat ../dirs` + $(MAKE) install prefix=`pwd`/debian/tmp/usr +# Must have debmake installed for this to work. Otherwise please copy +# /usr/bin/debstd into the debian directory and change debstd to debian/debstd + debstd ChangeLog README TODO INSTALL + dpkg-gencontrol + chown -R root.root debian/tmp + chmod -R go=rX debian/tmp + dpkg --build debian/tmp .. + +define checkdir + test -f debian/rules +endef + +binary: binary-indep binary-arch + +checkroot: + $(checkdir) + test root = "`whoami`" + +.PHONY: binary binary-arch binary-indep clean checkroot diff --git a/barcode-0.98/doc/Makefile.in b/barcode-0.98/doc/Makefile.in new file mode 100644 index 00000000..dae8f6b6 --- /dev/null +++ b/barcode-0.98/doc/Makefile.in @@ -0,0 +1,135 @@ +# +# Makefile (now .in) for the documentation directory +# +# Copyright 1994,2000 rubini@gnu.org (Alessandro Rubini) +# +################# +# +# BE CAREFUL in editing: +# due to the large number of index files, and my use of a non standard +# info input file, any file $(TARGET).* is removed by "make clean" +# +# I chose to use a prefix for the input file ("doc.$(TARGET)"), to ease +# makeing clean and applying my own rules. +# +################################################################### +# +# First of all, retrieve features of makeinfo, to know if we can do images +# and --html. Also, allow MAKEINFO to be specified on the commandline to +# allow me testing with various versions. + +# NOTE: it looks like semi-old versions can do images too, so CANDOIMAGES +# is not (yet?) used + + +MAKEINFO = @MAKEINFO@ +# According to whether this makeinfo can output html, autoconf define these +REMOVEHTMLTAGS = @REMOVEHTMLTAGS@ +INFOTOHTML = @INFOTOHTML@ + +############################################## + + +TARGET = barcode +ALL = $(TARGET).ps $(TARGET).info $(TARGET)doc.txt $(TARGET).html \ + $(TARGET).pdf + +all: $(ALL) terse + +info: $(TARGET).info + +$(TARGET)doc.txt: mktxt + +mpage: all + mv $(TARGET).ps $(TARGET)1.ps + mpage -2A $(TARGET)1.ps > $(TARGET)2.ps && rm $(TARGET)1.ps + +terse: + # preserve the pdf copy + -mv -f $(TARGET).pdf PDF 2> /dev/null && \ + rm -f *~ *.dvi *.log *.aux \ + $(TARGET).*.bak $(TARGET).??? $(TARGET).texinfo && \ + mv PDF $(TARGET).pdf; + + # preserve the ps copy + -mv $(TARGET).ps PS; + -rm -f $(TARGET).??; + -mv PS $(TARGET).ps; + +clean: terse + rm -f $(ALL) $(TARGET)_toc.html + + +#################################################### + +# These rules used to be expressed as "%.texinfo: doc.%" etc. However, this +# is gmake-specific, so I turned every % to $(TARGET), thus loosing generality +# but gaining portability. I also had to drop "$^": it worked with gmake +# and not pmake, while "$<" worked with pmake and not gmake. +# with gmake and not pmake. +# ARub 2000-04-21 + +$(TARGET).texinfo: doc.$(TARGET) + @rm -f $@ 2> /dev/null + sed -f ./infofilter doc.$(TARGET) | $(REMOVEHTMLTAGS) > $@ + chmod 400 $@ + + +# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) +# This had to be rewritten too, as "$*" is different in gmake and pmake + +$(TARGET).dvi: $(TARGET).texinfo + +# create a spurious index file to please silly sh (bash will work anyway) + touch $(TARGET).oo + +# get the index list + if test "x`ls $(TARGET).?? $(TARGET).aux`" != "x"; then \ + for i in `ls $(TARGET).?? $(TARGET).aux`; do \ + cp $$i $$i~; \ + done; \ + fi + tex $(TARGET).texinfo + +#check the file list, the file and if needed run TeX again + old="`ls $(TARGET).??~ $(TARGET).aux~ | sed 's/~//g'`"; \ + new="`ls $(TARGET).?? $(TARGET).aux`"; \ + need="n"; \ + if test "$$old" != "$$new"; then need="y"; \ + else \ + for i in `ls $(TARGET).?? $(TARGET).aux`; do \ + cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ + done; \ + fi; \ + if test "$$need" = "y"; then \ + texindex $(TARGET).?? && tex $(TARGET).texinfo; \ + fi + + +$(TARGET).ps: $(TARGET).dvi + dvips -f $(TARGET).dvi > $@ + +$(TARGET).pdf: $(TARGET).ps + ps2pdf $(TARGET).ps > $@ + +$(TARGET).lj: $(TARGET).dvi + dvilj -e- $(TARGET).dvi > $@ + +$(TARGET).info: $(TARGET).texinfo + makeinfo $(TARGET).texinfo -o $@ + +$(TARGET).html: $(TARGET).texinfo + $(INFOTOHTML) -o $@ $< + +#$(TARGET).man: doc.$(TARGET) +# manpages are created by the toplevel Makefile + +$(TARGET)doc.txt: $(TARGET).info + awk -f ./mktxt $(TARGET).info > $@ + + + + + + + diff --git a/barcode-0.98/doc/README b/barcode-0.98/doc/README new file mode 100644 index 00000000..5af5490f --- /dev/null +++ b/barcode-0.98/doc/README @@ -0,0 +1,5 @@ + +The input file is "doc.barcode". I preprocess this file to +build both a "barcode.texinfo" file and manual pages. + +The intermediat diff --git a/barcode-0.98/doc/barcode.info b/barcode-0.98/doc/barcode.info new file mode 100644 index 00000000..66b59d06 --- /dev/null +++ b/barcode-0.98/doc/barcode.info @@ -0,0 +1,747 @@ +This is barcode.info, produced by makeinfo version 4.0b from +barcode.texinfo. + + This file is the User's Manual for the barcode library (version +0.98). + + +File: barcode.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) + +Barcode tools +************* + + This file documents version 0.98 of the barcode library and sample +programs (March 2002). + +* Menu: + +* Overview:: +* The Barcode Object:: +* Supported Flags:: +* The API:: +* The barcode Executable:: +* Supported Encodings:: +* PCL Output:: +* Bugs and Pending Issues:: + + +File: barcode.info, Node: Overview, Next: The Barcode Object, Prev: Top, Up: Top + +Overview +******** + + The "barcode" package is mainly a C library for creating bar-code +output files. It also includes a command line front-end and (in a +foreseeable future) a graphic frontend. + + The package is designed as a library because we think the main use +for barcode-generation tools is inside more featured applications. The +library addresses bar code printing as two distinct problems: creation +of bar information and actual conversion to an output format. To this +aim we use an intermediate representation for bar codes, which is +currently documented in the `ps.c' source file (not in this document). + + Note that the library and the accompanying material is released +according to the GPL license, not the LGPL one. A copy of the GPL is +included in the distribution tarball. + + +File: barcode.info, Node: The Barcode Object, Next: Supported Flags, Prev: Overview, Up: Top + +The Underlying Data Structure +***************************** + + Every barcode-related function acts on a data structure defined in +the `barcode.h' header, which must be included by any C source file +that uses the library. The header is installed by make install. + + The definition of the data structure is included here for reference: + + struct Barcode_Item { + int flags; /* type of encoding and other flags */ + char *ascii; /* malloced */ + char *partial; /* malloced too */ + char *textinfo; /* information about text placement */ + char *encoding; /* code name, filled by encoding engine */ + int width, height; /* output units */ + int xoff, yoff; /* output units */ + int margin; /* output units */ + double scalef; /* requested scaling for barcode */ + int error; /* an errno-like value, in case of failure */ + }; + + The exact meaning of each field and the various flags implemented are +described in the following sections. + + Even though you won't usually need to act on the contents of this +structure, some of the functions in the library receive arguments that +are directly related to one or more of these fields. + +* Menu: + +* The Field List:: +* The Intermediate Representation:: + + +File: barcode.info, Node: The Field List, Next: The Intermediate Representation, Prev: The Barcode Object, Up: The Barcode Object + +The Fields +========== + +`int flags;' + The flags are, as you may suspect, meant to specify the exact + behaviour of the library. They are often passed as an argument to + barcode functions and are discussed in the next section. + +`char *ascii;' +`char *partial;' +`char *textinfo;' +`char *encoding;' + These fields are internally managed by the library, and you are + not expected to touch them if you use the provided API. All of + them are allocated with malloc. + +`int width;' +`int height;' + They specify the width and height of the active barcode region + (i.e., excluding the white margin), in the units used to create + output data (for postscript they are points, 1/72th of an inch, + 0.352 mm). The fields can be either assigned to in the structure + or via Barcode_Position(), at your choice. If either value or + both are left to their default value of zero, the output engine + will assign default values according to the specified scaling + factor. If the specified width is bigger than needed (according to + the scaling factor), the output barcode will be centered in its + requested region. If either the width of the height are too small + for the specified scale factor, the output bar code will expand + symmetrically around the requested region. + +`int xoff;' +`int yoff;' + The fields specify offset from the coordinate origin of the output + engine (for postscript, position 0,0 is the lower left corner of + the page). The fields can be either assigned to in the structure + or via Barcode_Position(), at your choice. The offset specifies + where the white margin begins, not where the first bar will be + printed. To print real ink to the specified position you should + set margin to 0. + +`int margin;' + The white margin that will be left around the printed area of the + bar code. The same margin is applied to all sides of the printed + area. The default value for the margin is defined in `barcode.h' + as BARCODE_DEFAULT_MARGIN (10). + +`double scalef;' + The enlarge or shrink value for the bar code over its default + dimension. The width and scalef fields interact deeply in the + creation of the output, and a complete description of the issues + appears later in this section. + +`int error;' + The field is used when a barcode function fails to host an + errno-like integer value. + +Use of the width and scalef fields. +----------------------------------- + + A width unit is the width of the thinnest bar and/or space in the +chosen code; it defaults to 1 point if the output is postscript or +encapsulated postscript. + + Either or both the code width and the scale factor can be left +unspecified (i.e., zero). The library deals with defaults in the +following way: + +Both unspecified + If both the width and the scale factor are unspecified, the scale + factor will default to 1.0 and the width is calculated according + to the actual width of the bar code being printed. + +Width unspecified + If the width is not specified, it is calculated according to the + values of scalef. + +Scale factor unspecified + If the scale factor is not specified, it will be chosen so that + the generated bar code exactly fits the specified width. + +Both specified + The code will be printed inside the specified region according to + the specified scale factor. It will be aligned to the left. If, + however, the chosen width is too small for the specific bar code + and scaling factor, then the code will extend symmetrically to the + left and to the right of the chosen region. + + +File: barcode.info, Node: The Intermediate Representation, Prev: The Field List, Up: The Barcode Object + +The Intermediate Representation +=============================== + + The encoding functions print their output into the partial and +texinfo fields of the barcode data structure. Those fields, together +with position information, are then used to generate actual output. +This is an informal description of the intermediate format. + + The first char in partial tells how much extra space to add to the +left of the bars. For EAN-13, it is used to leave space to print the +first digit, other codes may have '0' for no-extra-space-needed. + + The next characters are alternating bars and spaces, as multiples of +the base dimension which is 1 unless the code is rescaled. Rescaling is +calculated as the ratio from the requested width and the calculated +width. Digits represent bar/space dimensions. Lower-case letters +represent those bars that should extend lower than the others: 'a' is +equivalent to '1', 'b' is '2' and so on up to 'i' which is equivalent to +'9'. Other letters will be used for encoding-specific meanings, as soon +as I implement them. + + The textinfo string is made up of fields %lf:%lf:%c separated by +blank space. The first integer is the x position of the character, the +second is the font size (before rescaling) and the char item is the +character to be printed. + + Both the partial and textinfo strings may include "-" or "+" as +special characters (in textinfo the char should be a stand-alone word). +They state where the text should be printed: below the bars ("-", +default) or above the bars. This is used, for example, to print the +add-5 and add-2 codes to the right of UPC or EAN codes (the add-5 +extension is mostly used in ISBN codes). + + +File: barcode.info, Node: Supported Flags, Next: The API, Prev: The Barcode Object, Up: Top + +The Flags +********* + + The following flags are supported by version 0.98 of the library: + +`BARCODE_ENCODING_MASK' + The mask is used to extract the encoding-type identifier from the + flags field. + +`BARCODE_EAN' +`BARCODE_UPC' +`BARCODE_ISBN' +`BARCODE_128B' +`BARCODE_128C' +`BARCODE_128' +`BARCODE_128RAW' +`BARCODE_39' +`BARCODE_I25' +`BARCODE_CBR' +`BARCODE_MSI' +`BARCODE_PLS' +`BARCODE_93' + The currently supported encoding types: EAN (13 digits, 8 digits, + 13 + 2 add-on and 13 + 5 add-on), UPC (UPC-A, UPC-E, UPC-A with 2 + or 5 digit add-on), ISBN (with or without the 5-digit add-on), + CODE128-B (the whole set of printable ASCII characters), CODE128-C + (two digits encoded by each barcode symbol), CODE128 (all ASCII + values), a "raw-input" pseudo-code that generates CODE128 output, + CODE39 (alphanumeric), "interleaved 2 of 5" (numeric), Codabar + (numeric plus a few symbols), MSI (numeric) and Plessey (hex + digits). *Note Supported Encodings::. + +`BARCODE_ANY' + This special encoding type (represented by a value of zero, so it + will be the default) tells the encoding procedure to look for the + first encoding type that can deal with a textual string. + Therefore, a 11-digit code will be printed as UPC (as well as + 6-digit, 11+2 and 11+5), a 12-digit (or 7-digit, or 12+2 or 12+5) + as EAN13, an ISBN code (with or without hyphens, with or without + add-5) will be encoded in its EAN13 representation, an even number + of digits is encoded using CODE128C and a generic string is + encoded using CODE128B. Since code-39 offers a much larger + representation for the same text string, code128-b is preferred + over code39 for alphanumeric strings. + +`BARCODE_NO_ASCII' + Instructs the engine not to print the ascii string on output. By + default the bar code is accompanied with an ascii version of the + text it encodes. + +`BARCODE_NO_CHECKSUM' + Instructs the engine not to add the checksum character to the + output. Not all the encoding types can drop the checksum; those + where the checksum is mandatory (like EAN and UPC) just ignore the + flag. + +`BARCODE_OUTPUT_MASK' + The mask is used to extract the output-type identifier from the + flags field. + +`BARCODE_OUT_PS' +`BARCODE_OUT_EPS' +`BARCODE_OUT_PCL' +`BARCODE_OUT_PCL_III' + The currently supported encoding types: full-page postscript and + encapsulated postscript; PCL (print command language, for HP + printers) and PCL-III (same as PCL, but uses a font not available + on older printers). + +`BARCODE_OUT_NOHEADERS' + The flag instructs the printing engine not to print the header and + footer part of the file. This makes sense for the postscript + engine but might not make sense for other engines; such other + engines will silently ignore the flag just like the PCL back-end + does. + + +File: barcode.info, Node: The API, Next: The barcode Executable, Prev: Supported Flags, Up: Top + +Functions Exported by the Library +********************************* + + The functions included in the barcode library are declared in the +header file barcode.h. They perform the following tasks: + +`struct Barcode_Item *Barcode_Create(char *text);' + The function creates a new barcode object to deal with a specified + text string. It returns NULL in case of failure and a pointer to + a barcode data structure in case of success. + +`int Barcode_Delete(struct Barcode_Item *bc);' + Destroy a barcode object. Always returns 0 (success) + +`int Barcode_Encode(struct Barcode_Item *bc, int flags);' + Encode the text included in the bc object. Valid flags are the + encoding type (other flags are ignored) and BARCODE_NO_CHECKSUM + (other flags are silently ignored); if the flag argument is zero, + bc->flags will apply. The function returns 0 on success and -1 in + case of error. After successful termination the data structure + will host the description of the bar code and its textual + representation, after a failure the error field will include the + reason of the failure. + +`int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags);' + Print the bar code described by bc to the specified file. Valid + flags are the output type, BARCODE_NO_ASCII and + BARCODE_OUT_NOHEADERS, other flags are ignored. If any of these + flags is zero, it will be inherited from bc->flags which therefore + takes precedence. The function returns 0 on success and -1 in case + of error (with bc->error set accordingly). In case of success, the + bar code is printed to the specified file, which won't be closed + after use. + +`int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, int xoff, int yoff, double scalef);' + The function is a shortcut to assign values to the data structure. + +`int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, int xoff, int yoff, int flags);' + The function deals with the whole life of the barcode object by + calling the other functions; it uses all the specified flags. + +`int Barcode_Version(char *versionname);' + Returns the current version as an integer number of the form major + * 10000 + minor * 100 + release. Therefore, version 1.03.5 will be + returned as 10305 and version 0.53 as 5300. If the argument is + non-null, it will be used to return the version number as a + string. Note that the same information is available from two + preprocessor macros: BARCODE_VERSION (the string) and + BARCODE_VERSION_INT (the integer number). + + +File: barcode.info, Node: The barcode Executable, Next: Supported Encodings, Prev: The API, Up: Top + +The barcode frontend program +**************************** + + The barcode program is a front-end to access some features of the +library from the command line. It is able to read user supplied +strings from the command line or a data file (standard input by default) +and encode all of them. + +* Menu: + +* The Command Line:: + + +File: barcode.info, Node: The Command Line, Prev: The barcode Executable, Up: The barcode Executable + +The Command Line +================ + + barcode accepts the following options: + +`--help or -h' + Print a usage summary and exit. + +`-i filename' + Identify a file where strings to be encoded are read from. If + missing (and if -b is not used) it defaults to standard input. + Each data line of the input file will be used to create one + barcode output. + +`-o filename' + Output file. It defaults to standard output. + +`-b string' + Specify a single "barcode" string to be encoded. The option can + be used multiple times in order to encode multiple strings (this + will result in multi-page postscript output or a table of barcodes + if -t is specified). The strings must match the encoding chosen; + if it doesn't match the program will print a warning to stderr and + generate "blank" output (although not zero-length). Please note + that a string including spaces or other special characters must be + properly quoted. + +`-e encoding' + encoding is the name of the chosen encoding format being used. It + defaults to the value of the environment variable BARCODE_ENCODING + or to auto detection if the environment is also unset. + +`-g geometry' + The geometry argument is of the form "[ x ] [+ + + ]" (with no intervening spaces). Unspecified + margin values will result in no margin; unspecified size results + in default size. The specified values represent print points by + default, and can be inches, millimeters or other units according + to the -u option or the BARCODE_UNIT environment variable. The + argument is used to place the printout code on the page. Note that + an additional white margin of 10 points is added to the printout. + If the option is unspecified, BARCODE_GEOMETRY is looked up in the + environment, if missing a default size and no margin (but the + default 10 points) are used. + +`-t table-geometry' + Used to print several barcodes to a single page, this option is + meant to be used to print stickers. The argument is of the form + " x [+ + [- + [- ]]]" (with no intervening spaces); if + missing, the top and right margin will default to be the same as + the bottom and left margin. The margins are specified in print + points or in the chosen unit (see -u below). If the option is not + specified, BARCODE_TABLE is looked up in the environment, + otherwise no table is printed and each barcode will get its own + page. The size (but not the position) of a barcode item within a + table can also be selected using -g (see "geometry" above), + without struggling with external and internal margins. I still + think management of geometries in a table is suboptimal, but I + can't make it better without introducing incompatibilities. + +`-m margin(s)' + Specifies an internal margin for each sticker in the table. The + argument is of the form "," and the margin is + applied symmetrically to the sticker. If unspecified, the + environment variable BARCODE_MARGIN is used or a default internal + margin of 10 points is used. + +`-n' + "Numeric" output: don't print the ASCII form of the code, only the + bars. + +`-c' + No checksum character (for encodings that allow it, like code 39, + other codes, like UPC or EAN, ignore this option). + +`-E' + Encapsulated postscript (default is normal postscript). When the + output is generated as EPS only one barcode is encoded. + +`-P' + PCL output. Please note that the Y direction goes from top to + bottom for PCL, and the origin for an image is the top-left corner + instead of the bottom-left + +`-p pagesize' + Specify a non-default page size. The page size can be specified in + millimeters, inches or plain numbers (for example: "210x297mm", + "8.5x11in", "595x842"). A page specification as numbers will be + interpreted according to the current unit specification (see -u + below). If libpaper is available, you can also specify the page + size with its name, like "A3" or "letter" (libpaper is a standard + component of Debian GNU/Linux, but may be missing elsewhere). The + default page size is your system-wide default if libpaper is + there, A4 otherwise. + +`-u unit' + Choose the unit used in size specifications. Accepted values are + "mm", "cm", "in" and "pt". By default, the program will check + BARCODE_UNIT in the environment, and assume points otherwise (this + behaviour is compatible with 0.92 and previous versions. If -u + appears more than once, each instance will modified the behaviour + for the arguments at its right, as the command line is processes + left to right. The program internally works with points, and any + size is approximated to the nearest multiple of one point. The -u + option affect -g (geometry), -t (table) and -p (page size). + + +File: barcode.info, Node: Supported Encodings, Next: PCL Output, Prev: The barcode Executable, Up: Top + +Supported Encodings +******************* + + The program encodes text strings passed either on the command line +(with -b) or retrieved from standard input. The text representation is +interpreted according to the following rules. When auto-detection of +the encoding is enabled (i.e, no explicit encoding type is specified), +the encoding types are scanned to find one that can digest the text +string. The following list of supported types is sorted in the same +order the library uses when auto-detecting a suitable encoding for a +string. + +EAN + The EAN frontend is similar to UPC; it accepts strings of digits, + 12 or 7 characters long. Strings of 13 or 8 characters are + accepted if the provided checksum digit is correct. I expect most + users to feed input without a checksum, though. The add-2 and + add-5 extension are accepted for both the EAN-13 and the EAN-8 + encodings. The following are example of valid input strings: + "123456789012" (EAN-13), "1234567890128" (EAN-13 wih checksum), + "1234567" (EAN-8), "12345670 12345" (EAN-8 with checksum and + add-5), "123456789012 12" (EAN-13 with add-2), "123456789012 + 12345" (EAN-13 with add-5). + +UPC + The UPC frontend accepts only strings made up of digits (and, if a + supplemental encoding is used, a blank to separate it). It + accepts strings of 11 or 12 digits (UPC-A) and 6 or 7 or 8 digits + (UPC-E). + + The 12th digit of UPC-A is the checksum and is added by the + library if not specified in the input; if it is specified, it must + be the right checksum or the code is rejected as invalid. For + UPC-E, 6 digit are considered to be the middle part of the code, a + leading 0 is assumed and the checksum is added; 7 digits are + either considered the initial part (leading digit 0 or 1, checksum + missing) or the final part (checksum specified, leading 0 + assumed); 8 digits are considered to be the complete code, with + leading 0 or 1 and checksum. For both UPC-A and UPC-E, a trailing + string of 2 digits or 5 digits is accepted as well. Therefore, the + following are examples of valid strings that can be encoded as UPC: + "01234567890" (UPC-A) "012345678905" (UPC-A with checksum), + "012345" (UPC-E), "01234567890 12" (UPC-A, add-2) and "01234567890 + 12345" (UPC-A, add-5), "0123456 12" (UPC-E, add-2). Please note + that when setting BARCODE_ANY to auto-detect the encoding to be + used, 12-digit strings and 7-digit strings will always be + identified as EAN. This because I expect most user to provide + input without a checksum. If you need to specify UPC-with-checksum + as input you must explicitly set BARCODE_UPC as a flag or use -e + upc on the command line. + +ISBN + ISBN numbers are encoded as EAN-13 symbols, with an optional add-5 + trailer. The ISBN frontend of the library accepts real ISBN + numbers and deals with any hyphen and, if present, the ISBN + checksum character before encoding data. Valid representations for + ISBN strings are for example: "1-56592-292-1", "3-89721-122-X" and + "3-89721-122-X 06900". + +CODE 128-B + This encoding can represent all of the printing ASCII characters, + from the space (32) to DEL (127). The checksum digit is mandatory + in this encoding. + +CODE 128-C + The "C" variation of Code-128 uses Code-128 symbols to represent + two digits at a time (Code-128 is made up of 104 symbols whose + interpretation is controlled by the start symbol being used). Code + 128-C is thus the most compact way to represent any even number of + digits. The encoder refuses to deal with an odd number of digits + because the caller is expected to provide proper padding to an + even number of digits. (Since Code-128 includes control symbols to + switch charset, it is theoretically possible to represent the odd + digit as a Code 128-A or 128-B symbol, but this tool doesn't + currently implement this option). + +CODE 128 RAW + Code-128 output represented symbol-by-symbol in the input string. + To override part of the problems outlined below in specifying + code128 symbols, this pseudo-encoding allows the used to specify a + list of code128 symbols separated by spaces. Each symbol is + represented by a number in the range 0-105. The list should + include the leading character.The checksum and the stop character + are automatically added by the library. Most likely this + pseudo-encoding will be used with BARCODE_NO_ASCII and some + external program to supply the printed text. + +CODE 39 + The code-39 standard can encode uppercase letters, digits, the + blank space, plus, minus, dot, star, dollar, slash, percent. Any + string that is only composed of such characters is accepted by the + code-39 encoder. To avoid loosing information, the encoder refuses + to encode mixed-case strings (a lowercase string is nonetheless + accepted as a shortcut, but is encoded as uppercase). + +INTERLEAVED 2 OF 5 + This encoding can only represent an even number of digits (odd + digits are represented by bars, and even digits by the + interleaving spaces). The name stresses the fact that two of the + five items (bars or spaces) allocated to each symbol are wide, + while the rest are narrow. The checksum digit is optional (can be + disabled via BARCODE_NO_CHECKSUM). Since the number of digits, + including the checksum, must be even, a leading zero is inserted + in the string being encoded if needed (this is specifically stated + in the specs I have access to). + +CODE 128 + Automatic selection between alphabet A, B and C of the Code-128 + standard. This encoding can represent all ASCII symbols, from 0 + (NUL) to 127 (DEL), as well as four special symbols, named F1, F2, + F3, F4. The set of symbols available in this encoding is not + easily represented as input to the barcode library, so the + following convention is used. In the input string, which is a + C-language null-terminated string, the NUL char is represented by + the value 128 (0x80, 0200) and the F1-F4 characters are + represented by the values 193-196 (0xc1-0xc4, 0301-0304). The + values have been chosen to ease their representation as escape + sequences. + + Since the shell doesn't seem to interpret escape sequences on the + command line, the "-b" option cannot be easily used to designate + the strings to be encoded. As a workaround you can resort to the + command echo, either within back-ticks or used separately to + create a file that is then fed to the standard-input of barcode - + assuming your echo command processes escape sequences. The + newline character is especially though to encode (but not + impossible unless you use a csh variant. + + These problems only apply to the command-line tool; the use of + library functions doesn't give any problem. In needed, you can use + the "code 128 raw" pseudo-encoding to represent code128 symbols by + their numerical value. This encoding is used late in the + auto-selection mechanism because (almost) any input string can be + represented using code128. + +CODABAR + Codabar can encode the ten digits and a few special symbols + (minus, plus, dollar, colon, bar, dot). The characters "A", "B", + "C" and "D" are used to represent four different start/stop + characters. The input string to the barcode library can include + the start and stop characters or not include them (in which case + "A" is used as start and "B" as stop). Start and stop characters + in the input string can be either all lowercase or all uppercase + and are always printed as uppercase. + +PLESSEY + Plessey barcodes can encode all the hexadecimal digits. Alphabetic + digits in the input string must either be all lowercase or all + uppercase. The output text is always uppercase. + +MSI + MSI can only encode the decimal digits. While the standard + specifies either one or two check digits, the current + implementation in this library only generates one check digit. + +CODE 93 + The code-93 standard can natively encode 48 different characters, + including uppercase letters, digits, the blank space, plus, minus, + dot, star, dollar, slash, percent, as well as five special + characters: a start/stop delimiter and four "shift characters" + used for extended encoding. Using this "extended encoding" + method, any standard 7-bit ASCII character can be encoded, but it + takes up two symbol lengths in barcode if the character is not + natively supported (one of the 48). The encoder here fully + implements the code 93 encoding standard. Any characters natively + supported (A-Z, 0-9, ".+-/$&%") will be encoded as such - for any + other characters (such as lower case letters, brackets, + parentheses, etc.), the encoder will revert to extended encoding. + As a note, the option to exclude the checksum will eliminate the + two modulo-47 checksums (called C and K) from the barcode, but this + probably will make it unreadable by 99% of all scanning systems. + These checksums are specified to be used at the firmware level, + and their absence will be interpreted as an invalid barcode. + + +File: barcode.info, Node: PCL Output, Next: Bugs and Pending Issues, Prev: Supported Encodings, Up: Top + +PCL Output +********** + + While the default output is Postscript (possibly EPS), and Postscript +can be post-processed to almost anything, it is sometimes desirable to +create output directly usable by the specific printer at hand. PCL is +currently supported as an output format for this reason. Please note +that the Y coordinate for PCL goes from top to bottom, while for +Postscript it goes from bottom to top. Consistently, while in +Postscript you specify the bottom-left corner as origin, for PCL you +specify the top-left corner. + + Barcode output for PCL Printers (HP LaserJet and compatibles), was +developed using PCL5 Reference manuals from HP. that really refers to +these printers: + * LaserJet III, III P, III D, III Si, + + * LaserJet 4 family + + * LaserJet 5 family + + * LaserJet 6 family + + * Color LaserJet + + * DeskJet 1200 and 1600. + + + However, barcode printing uses a very small subset of PCL, probably +also LaserJet II should print it without problem, but the resulting +text may be horrible. + + The only real difference from one printer to another really depends +on which font are available in the printer, used in printing the label +associated to the bars (if requested). + + Earlier LaserJet supports only bitmaps fonts, so these are not +"scalable". (Ljet II ?), Also these fonts, when available, have a +specified direction, and not all of them are available in both Portrait +and Landscape mode. + + From LaserJet 4 series, (except 4L/5L that are entry-level printers), +Arial scalable font should be available, so it's the "default font" +used by this program. + + LaserJet III series printers (and 4L, 5L), don't feature "Arial" as a +resident font, so you should use BARCODE_OUT_PCL_III instead of +BARCODE_OUT_PCL., and font the font used will be "Univers" instead of +"Arial". + + Results on compatible printers, may depend on consistency of PCL5 +compatibility, in doubt, try BARCODE_OUT_PCL_III + + PJL commands are not used here, as it's not very compatible. + + Tested Printers: + * Hp LaserJet 4050 + + * Hp LaserJet 2100 + + * Epson N-1200 emul PCL + + * Toshiba DP2570 (copier) + PCL option + + * Epson EPL-7100 emul. HP LaserJet II: bars print fine but text is + bad. + + +File: barcode.info, Node: Bugs and Pending Issues, Prev: PCL Output, Up: Top + +Bugs and Pending Issues. +************************ + + The current management of borders/margins is far from optimal. The +"default" margin applied by the library interferes with the external +representation, but I feel it is mandatory to avoid creating barcode +output with no surrounding white space (the problem is especially +relevant for EPS output). + + EAN-128 is not (yet) supported. I plan to implement it pretty soon +and then bless the package as version 1.0. + + + +Tag Table: +Node: Top154 +Node: Overview526 +Node: The Barcode Object1404 +Node: The Field List2821 +Node: The Intermediate Representation6586 +Node: Supported Flags8359 +Node: The API11343 +Node: The barcode Executable14029 +Node: The Command Line14458 +Node: Supported Encodings19557 +Node: PCL Output28997 +Node: Bugs and Pending Issues31316 + +End Tag Table diff --git a/barcode-0.98/doc/barcode.pdf b/barcode-0.98/doc/barcode.pdf new file mode 100644 index 00000000..b2268f4d Binary files /dev/null and b/barcode-0.98/doc/barcode.pdf differ diff --git a/barcode-0.98/doc/barcode.ps b/barcode-0.98/doc/barcode.ps new file mode 100644 index 00000000..cc6cc2c4 --- /dev/null +++ b/barcode-0.98/doc/barcode.ps @@ -0,0 +1,2378 @@ +%!PS-Adobe-2.0 +%%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software +%%Title: barcode.dvi +%%Pages: 12 +%%PageOrder: Ascend +%%BoundingBox: 0 0 596 842 +%%EndComments +%DVIPSWebPage: (www.radicaleye.com) +%DVIPSCommandLine: dvips -f barcode.dvi +%DVIPSParameters: dpi=600, compressed +%DVIPSSource: TeX output 2002.08.21:2135 +%%BeginProcSet: texc.pro +%! +/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S +N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72 +mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0 +0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{ +landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize +mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ +matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round +exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ +statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] +N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin +/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array +/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 +array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N +df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A +definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get +}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub} +B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr +1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3 +1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx +0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx +sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{ +rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp +gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B +/chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{ +/cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{ +A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy +get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse} +ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp +fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17 +{2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add +chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{ +1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop} +forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn +/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put +}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{ +bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A +mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ +SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ +userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X +1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 +index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N +/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ +/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) +(LaserWriter 16/600)]{A length product length le{A length product exch 0 +exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse +end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask +grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot} +imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round +exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto +fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p +delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M} +B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{ +p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S +rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end + +%%EndProcSet +TeXDict begin 39158280 55380996 1000 600 600 (barcode.dvi) +@start +%DVIPSBitmapFont: Fa cmbxti10 14.4 8 +/Fa 8 115 df<13FCEA03FF000F13804813C05AA25AA2B5FCA31480A214006C5A6C5A6C +5AEA0FE0121271912B>46 D97 DI<923807FF80037F13F00203B512FC02 +0F80023F8091B500031380499038F8007F010701E0EBFFC049EB800149495A49485B495A +49485B5A485BA248491580180048496D5A486F5A93C8FC485BA35A91CAFCA3B5FC5BA45B +A65B17036C6CED0780170FEF3FC0003F167F6DEC01FF001F4B13806C6C021F13006C6DEB +7FFC6C9039F00FFFF86C90B612E06C5E013F4AC7FC010F14F0010049C8FC323773B540> +II<923807FF8092B512E0020714F8021F80027F80903A01FFFE03FF49D9F000 +13804901C0EB7FC0495B013F90C7123F495A495A5C5A485B4849147F18804816FF4A4913 +00485DEE0FFE4849EB7FFC923807FFF891B612E0485E94C7FC16F04BC8FCB5CAFC5BA45B +A7007F1603EF0780170F003FEE3FC0177F6C6CEC01FF4C13806C6C021F13006C01C0EB7F +FC6C9039F00FFFF86C90B612E06C6C5D6D4AC7FC010714F09026007FFEC8FC323773B540 +>I<923807FFC0037F13FC0203B6FC020F15C0023F8191B5000313F8499039F8007FFC01 +0701E0133F4901806D7E4990C76C7E49481680495A4948804818C0485BA2485BA248494A +13E05AA2485BA24D13C05A91C8FCA25FB517805BA25F19005B6017FF605E60495E5E6C6C +4A5B604C5B003F4B90C7FC6D4A5A001F4B5A6C6C4A5A6CD980035B6CD9F01F13C06C90B6 +5A6C4BC8FC013F14F0010F14C0010001F8C9FC3B3773B547>111 +D114 +D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fb cmsy10 10.95 1 +/Fb 1 16 df15 +D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fc cmb10 10.95 10 +/Fc 10 115 df97 D<13FFB5FCA512077EAFEC03FE91381FFF +C0027F13F091B57E9138FE0FFE9138F003FF4A7E02C014804A6C13C017E0A3EE7FF0A317 +F8AC17F0A3EEFFE0A217C05D02C014806E4813006E485A9138FC1FFC01FCB55A496C13E0 +D9F01F1380C7D807FCC7FC2D407EBE33>III<49B47E010F13F0013F7F90B512FE48EBC3FF480100 +13804848EB7FC04848133F001F15E05B003FEC1FF0A2485A150F16F8A212FFA290B6FCA4 +01F0C8FCA5127FA37F003F15F8A26C6C1301000F15F06D13036C6CEB07E06C9038800FC0 +6C9038F07F806C6CB512006D5B010F13F8010013C0252B7EA92A>I103 +D105 D<01FFEB7FE0B53801FFF802077F4A7F91381FC3FFDA3E03 +13800007137C6CEB780102F014C014E0A214C0A31480B3A4B5D8FE1F13FFA530297EA833 +>110 D<49B47E010F13F0013F13FC90B6FC48018113803A03FE007FC04848EB3FE0000F +15F049131F001F15F8A24848EB0FFCA2007F15FEA400FF15FFAB007F15FEA3003F15FC6D +131F001F15F8A26C6CEB3FF0000715E06C6CEB7FC03A01FF81FF806C90B51200013F13FC +010F13F001011380282B7EA92D>I<3901FE07F800FFEB0FFE91383FFF804A13C0EC7C7F +9138F8FFE03807FFF06C5B5CA2ED7FC09138803F80ED1F0092C7FCA291C8FCB3A3B6FCA5 +23297FA827>114 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fd cmbxti10 17.28 7 +/Fd 7 115 df97 +DII<963803FFC0061FB512E06060A47214C0F000 +1F61A21B80A261A21B00A296B5FCA262A260A262A260A262A260A262A260A2DCFFE05C03 +0F13FC037FEBFF1F4AB6129F020792B55A4AEBE07F023FEB000F4A487F4948486D5C4913 +F04981495B49496D91C7FC495B5B92C8FC90B55E485B5F485B4860A248495CA248605C5F +5A4A5EA2485EA24A5EA2B55DA24A5EA25FA291C85CA24DEC3F801A7F19005B94B513FFA2 +4E1400A24C5C007F614C13FC4C1403003F4B5D6D4A14076C4B5D6C6D49140F4BB55C6CD9 +C007013F495A6C9026F03FFEEBFE3FC690B5D8F81FB55A6DDAF0075C011FDAC00349C7FC +010749C75B9026007FF0EC1FF04B6571E355>II<93381FFF804BB512F8031F14 +FF037F15C04AB77E0207D9FC0313F8021FD9E0007F4A0180EB3FFEDAFFFEC76C7E494916 +8049496E13C0495B49496E13E0495B494916F05B90B5C87E1AF8485B485F5C5A5C5AA248 +5B605A5CA2485FA24A17F0A2B55EA24A17E0A2601AC091C9FC95B51280A21A005F615F49 +5F4D5B127F6D4B5B616C4C5B4D5B6C6D4A90C7FC4D5A6C6D495B6C4B5B6C6D010F13E06C +01F8013F5B6CD9FE01B5C8FC013FB612FC6D15F0010715C0010002FCC9FC020F13C04542 +71C055>111 D114 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fe cmbxti10 13.15 11 +/Fe 11 120 df97 D99 D<943801FF800403B512C05E1980A282EE000F1900A25FA260A2173FA260 +A2177FA260A217FFA260A25EEDFFC1020701F15B023F13FD91B7FC4913E00107D9003F5B +49487F49487F495A49486D5B495A485D5C4894C7FC5A4A5B5A91C75B5A163FA248485DA2 +167F127F495DA216FF12FF495DA25D181E49EDE03FA24B5C187E17C0A2007F5F5D4B1380 +003F4AEB81F85D6C6C49EB83F06C6C48B55B2707FE0FFC13CF6CB539F07FFFC06C4A6C5B +6C6CD9800F90C7FC903A0FFC0003FC3A4D75CB41>III104 D<15F8EC03FC4A7E4A7EA25CA35DA2 +5D6E5AEC03E091C8FCAEEB07F8EB1FFEEB7FFF90B57E3901FC7FC0D803F07FEA07E0D80F +C07FA2381F80FFA2485A5B007E5CA25B00FE5C485A007C5C12005B92C7FCA25B5C133F5C +A2137F5CA213FFECF00F48EC1F8014E0153F48150014C05D48147E14805D14816CEB01F8 +4A5A4A5A6CEB1FC06CEBFF806D90C7FC6D5AEB07F0214E78CC27>I108 D<913801FFC0021F13F8027F13FE91B6FC4901001380D903FC +EB3FC0D907F0130F010FEC3FE04948137F4A13FF133FA2017F4913C0A26F138017006E13 +7E02FC90C7FCECFFC015FE6F7E16E06D80826D807F6D80010180EB003F1403EC003FD803 +C0130FD80FE01303EA3FF0486C7FA200FF5DA34B5A5B49495A495C49130F6CC7485AD83F +C0EB7FC03A1FF803FF806CB548C7FC6C14F8000114E026001FFEC8FC2B3377B135>115 +DI119 +D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Ff cmbx12 13.14 13 +/Ff 13 117 df<923803FFE092B512FC020714FF021F81027F9038007FC0DAFFF0EB0FE0 +010301C0804990C7EA3FF84948147F4A81494814FF495AA2137F5CA2715A715A715AEF07 +8094C8FCA8EF07FCB9FCA526007FF0C7123F171FB3B3003FB5D8E00FB512F8A53D4D7ECC +44>12 D46 D85 D97 D100 DII< +EB7FC0B5FCA512037EB3A2923801FFC0030F13F8033F13FE4B7F9126C1FE077F9126C3F0 +037F9138C7C001DACF8080150002DE7F02FC81A25CA25CA35CB3A9B6D8C07FEBFFE0A53B +4C7BCB44>104 D108 +D<903A7FC001FFC0B5010F13F8033F13FE4B7F9126C1FE077F9126C3F0037F00039038C7 +C0016CD9CF8080150002DE7F02FC81A25CA25CA35CB3A9B6D8C07FEBFFE0A53B317BB044 +>110 D<913807FF80027F13F80103B6FC010F15C090261FFE017F903A7FF0003FF8D9FF +C0EB0FFC48496D7E4890C76C7E4817804980000F17C048486E13E0A2003F17F049157FA2 +007F17F8A400FF17FCAB007F17F8A36C6CEDFFF0A3001F17E06D5C000F17C06C6C4A1380 +6C17006C6D495A6C01E0EB1FFC6D6C495A903A3FFE01FFF0010FB612C0010392C7FCD900 +7F13F80207138036337DB13D>I<90390FFF8070017FEBF1F048B6FC1207380FFC01391F +E0003F4848130F491307127F90C712035A1501A27FA213E06D90C7FC13FE387FFFF0ECFF +C015F06C14FC6C14FF6C15806C15C06C15E0C615F0013F14F8010714FCEB007F14019138 +003FFE150F0078140700F81403A26C1401A37E16FC6C14036D14F87F6DEB07F001F8EB1F +E001FFEBFFC091B51280D8FC7F1400D8F81F13FCD8E00313C027337CB130>115 +D<14F8A61301A41303A21307A2130FA2131F133F137F13FF1203000F90B512F0B7FCA426 +007FF8C7FCB3A6167CAA013F14F880A290391FFE01F0010F1303903907FF87E06DEBFFC0 +6D14806D6C1300EC0FFC26467EC430>I E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fg cmti10 10.95 35 +/Fg 35 122 df<933807FF80043F13E09338FE00F8DB01F0133EDB07E0130E4B48131F4C +137F031F14FF4BC7FCA218FE157E1878180015FE5DA31401A25DA414030103B712F0A218 +E0903A0003F000070207140F4B14C0A3171F020F15805DA2173F1800141F5D5F177EA214 +3F92C712FE5FA34A1301027EECF81CA3160302FEECF03C4A1538A21878187013014A0101 +13F018E0933800F1C0EF7F804948EC1F0094C7FCA35C1307A2001E5B127F130F00FF5BA2 +49CAFC12FEEAF81EEA703CEA7878EA1FF0EA07C0385383BF33>12 +DI40 +D<14031580A2EC01C0EC00E0A21570A215781538153CA3151EA4151FA2150FA7151FA915 +3FA2153EA3157EA2157CA215FCA215F8A21401A215F0A2140315E0A2140715C0A2EC0F80 +A2141F15005C143EA25CA25CA2495A5C1303495A5C130F49C7FC131E5B137C5B5B485A48 +5A485A48C8FC121E5A12705A5A205A7FC325>I<387FFFFCA3B5FCA21605799521>45 +D<120FEA3FC0127FA212FFA31380EA7F00123C0A0A77891C>I<15031507150F151F151E +153E157EEC01FEEC03FC1407141FEB01FF90380FFBF8EB1FC3EB0E07130015F0A2140FA2 +15E0A2141FA215C0A2143FA21580A2147FA21500A25CA25CA21301A25CA21303A25CA213 +07A25CA2130FA25CA2131FA25CEB7FE0B612F0A215E0203D77BC2E>49 +D<15FE913803FFC091380F01F091383C00F84A137C4A7F4948133F49487F4A148049C7FC +5BEB0E0C011E15C0EB1C0EEB3C06133813781370020E133FD9F00C148013E0141C021813 +7F00011600EBC0384A13FEEC600102E05B3A00E3C003F89039FF0007F0013C495A90C748 +5A5E037FC7FC15FC4A5A4A5AEC0FC04AC8FC147E14F8EB03E0495A011FC9FC133E491418 +01F0143C48481438485A1678485A48C85A120E001E4A5AD83FE0130301FF495A397C3FF0 +1FD8780FB55AD8700391C7FCD8F0015B486C6C5A6E5AEC07C02A3F79BC2E>I<157F9138 +01FFE0913807C0F091381F007C023C133C4A133E4A131F1301495A5C1307A2495AA2163F +011F143EA2167E6E137C16F8ECE00102F013F09138F803E09138FC07C090390FFE0F00EC +FFBE6D13F86D5B7F6D7F8101037F90380F9FFFD91F0F1380D97C0713C0497E48486C13E0 +3903E0007F4848133F4848131F001F140F90C7FC003E1407A2127E127CA200FC15C05AA2 +ED0F80A2ED1F00153E007C143C157C007E5C6CEB03F0391F8007C0390FE03F802607FFFE +C7FC000113F838003FC0283F78BC2E>56 D<49B712C018F818FE903B0003FC0001FF9438 +007F804BEC3FC0A2F01FE014074B15F0180FA2140F5D181FA2021F16E05D183F19C0023F +ED7F804B14FF19004D5A027F4A5A92C7EA07F0EF1FE0EF7F804AD903FEC7FC92B512F017 +FE4AC7EA3F800101ED1FE04A6E7E17078401036F7E5CA30107825CA3010F5E4A1407A260 +011F150F5C4D5A60013F153F4A4A5A4D5A017F4A90C7FC4C5A91C7EA0FF849EC3FF0B812 +C094C8FC16F83C3E7BBD40>66 D<49B77E18F018FC903B0003FE0003FEEF00FF4BEC7F80 +F03FC00207151F19E05DA2020F16F0A25DA2141FF03FE05DA2023F16C0187F4B1580A202 +7FEDFF00604B495A4D5A02FF4A5A4D5A92C7EA3FC04CB4C7FC4990B512FC17E04ACAFCA2 +1303A25CA21307A25CA2130FA25CA2131FA25CA2133FA25CA2137FA25C497EB67EA33C3E +7BBD3E>80 D<92391FE00380ED7FFC913A01FFFE0700913907F01F8F91390FC007DF4AC6 +6CB4FC023E6D5A4A130014FC495A4948147CA2495AA2010F15785CA3011F1570A46E91C7 +FCA2808014FE90380FFFE015FC6DEBFF8016E06D806D806D6C7F141F02037FEC003FED07 +FF1501A281A282A212075A167E120EA2001E15FE5EA25E003E14015E003F14034B5A486C +5C150F6D495A6D49C8FCD8F9F0137C39F8FE01F839F03FFFF0D8E00F13C026C001FEC9FC +314279BF33>83 D<277FFFFE01B500FC90B512E0B5FCA20003902680000790C7380FFC00 +6C90C701FCEC07F049725A04035EA26350C7FCA20407150EA2040F5D1A3C041F15386216 +3B6216734F5A6D14E303014B5A6C15C303034BC8FC1683DB0703140E191E030E151C6103 +1C7F61ED380161157003F04A5A15E002014B5A15C0DA03804AC9FC60DA0700140E60140E +605C029C5D14B8D97FF85D5C715A5C4A5DA24A92CAFC5F91C7FC705A137E5F137C5F1378 +01705D53406EBD5B>87 D<147E49B47E903907C1C38090391F80EFC090383F00FF017E13 +7F4914804848133F485AA248481400120F5B001F5C157E485AA215FE007F5C90C7FCA214 +01485C5AA21403EDF0385AA21407EDE078020F1370127C021F13F0007E013F13E0003E13 +7FECF3E1261F01E313C03A0F8781E3803A03FF00FF00D800FC133E252977A72E>97 +DIIII<167C4BB4FC923807C78092380F83C0ED1F87161FED3F3FA2157EA21780EE0E004B +C7FCA414015DA414035DA30103B512F8A390260007E0C7FCA3140F5DA5141F5DA4143F92 +C8FCA45C147EA414FE5CA413015CA4495AA4495AA4495A121E127F5C12FF49C9FCA2EAFE +1EEAF83C1270EA7878EA3FE0EA0F802A5383BF1C>III<1478EB01FCA21303A314F8EB00E01400AD137C48 +B4FC38038F80EA0707000E13C0121E121CEA3C0F1238A2EA781F00701380A2EAF03F1400 +12005B137E13FE5BA212015BA212035B1438120713E0000F1378EBC070A214F0EB80E0A2 +EB81C01383148038078700EA03FEEA00F8163E79BC1C>I108 +DIII<903903E001F890390FF807FE903A1E7C1E0F80903A1C3E3C07C001 +3C137801389038E003E0EB783F017001C013F0ED80019038F07F0001E015F8147E160300 +0113FEA2C75AA20101140717F05CA20103140F17E05CA20107EC1FC0A24A1480163F010F +15005E167E5E131F4B5A6E485A4B5A90393FB80F80DA9C1FC7FCEC0FFCEC03E049C9FCA2 +137EA213FEA25BA21201A25BA21203A2387FFFE0B5FCA22D3A80A72E>I114 DII<137C48B4141C26038F80137EEA0707000E7F001E15FE +121CD83C0F5C12381501EA781F007001805BA2D8F03F1303140000005D5B017E1307A201 +FE5C5B150F1201495CA2151F0003EDC1C0491481A2153F1683EE0380A2ED7F07000102FF +13005C01F8EBDF0F00009038079F0E90397C0F0F1C90391FFC07F8903907F001F02A2979 +A731>I<017CEB01C048B4EB07F038038F80EA0707000E01C013F8121E001C1403EA3C0F +0038EC01F0A2D8781F130000705BA2EAF03F91C712E012005B017E130116C013FE5B1503 +000115805BA2ED07001203495B150EA25DA25D1578000114706D5B0000495A6D485AD97E +0FC7FCEB1FFEEB03F0252979A72A>I<017C167048B491387001FC3A038F8001F8EA0707 +000E01C015FE001E1403001CEDF000EA3C0F0038177C1507D8781F4A133C00701380A2D8 +F03F130F020049133812005B017E011F14784C137013FE5B033F14F0000192C712E05BA2 +170100034A14C049137E17031880A2EF070015FE170E00010101141E01F86D131C0000D9 +039F5BD9FC076D5A903A3E0F07C1E0903A1FFC03FFC0902703F0007FC7FC372979A73C> +I<903903F001F890390FFC07FE90393C1E0E0F9026780F1C138001F0EBB83FD801E013F8 +9039C007F07FEA0380000714E0D9000F140048151C000E4AC7FCA2001E131FA2C75BA214 +3F92C8FCA35C147EA314FE4A131CA30101143C001E1538003F491378D87F811470018314 +F000FF5D9039077801C039FE0F7C033A7C0E3C078027783C1E1EC7FC391FF80FFC3907E0 +03F029297CA72A>I<137C48B4143826038F8013FCEA0707000E7F001E1401001C15F8EA +3C0F12381503D8781F14F000701380A2D8F03F1307020013E012005B017E130F16C013FE +5B151F1201491480A2153F000315005BA25D157EA315FE5D00011301EBF8030000130790 +387C1FF8EB3FF9EB07E1EB00035DA21407000E5CEA3F80007F495AA24A5AD8FF0090C7FC +143E007C137E00705B387801F0383803E0381E0FC06CB4C8FCEA03F8263B79A72C>I +E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fh cmsl10 10.95 33 +/Fh 33 122 df<007FB5FCA2B512FEA418067C961E>45 D<157015F014011407143F9038 +03FFE0137FEBFFCFEBF80F1300141F15C0A5143F1580A5147F1500A55C5CA513015CA513 +035CA513075CA5130F5CA3131F497EB612F8A31D3D78BC2D>49 DII<01061403D90780131F90390FF801FE91B512FC16F816F016E0168049EB +FE0015F890381C7FC091C8FCA3133C1338A513781370A2EC1FE0ECFFF8903873E03E9038 +FF001F01FCEB0F804914C049EB07E04914F049130390C7FC16F8A61507A21206EA3F8048 +7EA2150F00FF15F0A24914E090C7121F00FC15C000F0143F00701580ED7F0012786C14FE +4A5A6C495A390F800FE03907E03FC06CB5C7FCC613FCEB1FE0283F7ABC2D>53 +D56 DI<17E016011603831607A2160FA2161F83163FA2167F167716F7EEE7FCED +01E316C3150316831507EE03FEED0F01150E151E151C153C03387FED7800157015F05D4A +4880177F4A5AA24AC7FCA2020E81173F5C021FB6FC5CA20270C7EA3FE0171F5CA2495AA2 +494881170F49C8FCA2130EA24982013C1507A2137CD801FE4B7E2607FF80EC3FFEB500F0 +0107B512FC19F85E3E417DC044>65 D<013FB7FC18E018FC903B007FE00007FE6E489038 +01FF809438007FC05DF03FE0F01FF0A3027F16F892C8FCA54A16F04A153F19E0187F19C0 +F0FF8001014B13004A4A5A4D5AEF1FF04D5ADC03FFC7FC49B612F8EFFF8002F8C7EA3FE0 +EF0FF0EF07FC717E010715014A81711380A319C0130F5CA5011F4B13805C19005F601707 +013F4B5A4A4A5A4D5A4D5A017F913801FF8001FF020F90C7FCB812FC17F094C8FC3D3E7D +BD40>II<013FB812F8A39026007F +F0C7127F6E48140F18034B14011800A31978147F4B1570A502FF147092C7FCA3190017F0 +495D4A1301A21607161F91B6FC495DA29138FC003F160F1607160301075D5CA219E01801 +19C0010FEC07004A90C712031980A218071900011F5E5C181EA2183E183C013F167C4A15 +FC4D5A1707017F151F01FF4AB45AB9FCA2603D3E7DBD3E>69 D<011FB512FC5BA2903900 +3FF8006E5AA25DA5143F5DA5147F5DA514FF92C7FCA55B5CA513035CA513075CA5130F5C +A5131F5CA3133F497E007FB512F0A2B6FC263E7EBD21>73 D<90263FFFF093381FFFF850 +13F0629026007FF8EFF000023F4D5AA2023B933801DFC0A2DA39FCED039FA2F1073F1479 +0271040E5BEC70FE191C19381A7F02F01670DAE07F94C7FC19E0A2F001C06201016D6C49 +5A02C05FF00700A2180E6F6C14010103161C028003385BA218706F7EF0E00313070200DA +01C05BA2923907F00380A294380700075B010E902603F80E5C5FA25F190F011E6D6C5A01 +1C605FA2EEFDC0DB00FF141F013C5D013860013C92C7FC017C5C01FE027E143F2607FF80 +017C4A7EB500FC037FB512E004785E4A1338553E7CBD53>77 D<90263FFFE0023FB5FC6F +16FEA29026003FF8020313C0021F030013004A6C157C023B163C6F153814398102381678 +02787FDA707F157082153F82031F15F002F07FDAE00F5D8215078203031401010180DAC0 +015D82811780047F1303010315C04A013F5C17E0161F17F0040F1307010715F891C70007 +91C7FC17FC160317FE04015B4915FF010E6E130E188E177F18CEEF3FDE011E16FE011C6F +5AA2170FA21707133C01386F5A133C017C150113FE2607FF801400B512FC18705C483E7D +BD44>I<013FB612FEEFFFE018F8903B007FF0000FFC6E48EB01FF7113804BEC7FC0183F +19E0F01FF0A2147F5D19F8A402FFED3FF092C8FCA219E0A2F07FC05B4AEDFF8019004D5A +4D5AEF0FF80103ED3FE04A903801FF8091B648C7FC17F002FCCAFCA213075CA5130F5CA5 +131F5CA5133F5CA3137F497EB612E0A25D3D3E7DBD3E>80 D<9238FF80070207EBE00F02 +1FEBF81E91387F00FE02FCEB1F3ED903F0EB0FFE49481307494813034AEB01FC49C7FC49 +1400133E137E177C491578A57F1770A26D1500808080EB7FFEECFFE06D13FEEDFFC06D14 +F06D14FC010380010080143F02031480DA003F13C015031500EE7FE0163F161FA2160F12 +1CA31607160F003C16C0A31780003E151F1700007E5D007F153E6D5C16FC01E0495AD87D +F0495AD8FCFCEB0FC03AF87F803F8027F01FFFFEC7FCD8E00713F839C0007FC030427BBF +33>83 D85 D97 DIIIII<1478EB01FE130314FFA25B14FE130314FCEB00F0 +1400ACEB03F8EA01FF14F0A2EA001F130FA314E0A5131F14C0A5133F1480A5137F1400A5 +5B5BA4EA03FF007F13F0A2B5FC183E7DBD1A>105 D<143FEB1FFF5BA213017FA214FEA5 +130114FCA5130314F8A5130714F0A5130F14E0A5131F14C0A5133F1480A5137F1400A55B +5BA4EA03FF007F13F8A2B5FC183F7DBE1A>108 D<903907F007F8D803FFEB1FFF9139E0 +781FC09138E1E00F3B001FE38007E090380FE70002EE14F014FC14D814F85CA24A130F13 +1F4A14E0A4161F133F4A14C0A4163F137F91C71380A4167F5B491500A300015D486C4913 +80B5D8F87F13FCA32E287DA733>110 DI<903907F01F80D803 +FFEB7FE09138E1E1F09138E387F839001FE707EB0FE614EE02FC13F002D813E09138F801 +804AC7FCA25C131FA25CA4133F5CA5137F91C8FCA55B5BA31201487EB512FEA325287EA7 +24>114 D<9138FF81C0010713E390381F807F90397C003F8049131F4848130F5B000314 +07A248481400A27FA27F6D90C7FCEBFF8014FC6C13FF6C14C015F06C6C7F011F7F130790 +38007FFE1403140100381300157EA2123C153E157E007C147CA2007E147815F8007F495A +4A5A486C485A26F9E01FC7FC38E0FFFC38C01FE0222A7DA824>II118 +DI<90B539E007 +FFF05E18E0902707FE000313006D48EB01FC705A5F01014A5A5F16036E5C0100140794C7 +FC160E805E805E1678ED8070023F13F05EED81C015C191381FC38015C793C8FC15EF15EE +EC0FFCA25DA26E5AA25DA26E5A5DA24AC9FC5C140E141E141C5C121C003F5B5A485B495A +130300FE5B4848CAFCEA701EEA783CEA3FF0EA0FC0343A80A630>121 +D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fi cmbx12 17.28 43 +/Fi 43 122 df46 D<16F04B7E1507151F153FEC01FF1407 +147F010FB5FCB7FCA41487EBF007C7FCB3B3B3B3007FB91280A6395E74DD51>49 +D<913801FFF8021FEBFFC091B612F8010315FF010F16C0013F8290267FFC0114F89027FF +E0003F7F4890C7000F7F48486E7FD807F86E148048486E14C048486E14E048486F13F001 +FC17F8486C816D17FC6E80B56C16FE8380A219FFA283A36C5BA26C5B6C90C8FCD807FC5D +EA01F0CA14FEA34D13FCA219F85F19F04D13E0A294B512C019804C14004C5B604C5B4C5B +604C13804C90C7FC4C5A4C5A4B13F05F4B13804B90C8FC4B5AED1FF84B5A4B5A4B48143F +4A5B4A48C8FC4A5A4A48157E4A5A4A5AEC7F8092C9FC02FE16FE495A495A4948ED01FCD9 +0FC0150749B8FC5B5B90B9FC5A4818F85A5A5A5A5ABAFCA219F0A4405E78DD51>I<92B5 +FC020F14F8023F14FF49B712C04916F0010FD9C01F13FC90271FFC00077FD93FE001017F +49486D8049C86C7F484883486C6F7F14C0486D826E806E82487FA4805CA36C5E4A5E6C5B +6C5B6C495E011FC85A90C95CA294B55A614C91C7FC604C5B4C5B4C5B4C5B047F13809226 +0FFFFEC8FC020FB512F817E094C9FC17F817FF91C7003F13E0040713F8040113FE707F71 +7F7113E085717FA2717F85A285831A80A31AC0EA03FCEA0FFF487F487F487FA2B57EA31A +80A34D14005C7E4A5E5F6C495E49C8485BD81FF85F000F5ED807FE92B55A6C6C6C491480 +6C01F0010791C7FC6C9026FF803F5B6D90B65A011F16F0010716C001014BC8FCD9001F14 +F0020149C9FC426079DD51>II<01C0EE01C0D801F8160F01FF167F02F0EC07FFDAFF8090B5FC92B712 +8019006060606060606095C7FC17FC5F17E0178004FCC8FC16E09026FC3FFCC9FC91CBFC +ADED3FFE0203B512F0020F14FE023F6E7E91B712E001FDD9E00F7F9027FFFE00037F02F8 +01007F02E06EB4FC02806E138091C8FC496F13C04917E07113F0EA00F090C914F8A219FC +83A219FEA419FFA3EA03F0EA0FFC487E487E487FA2B57EA319FEA35C4D13FC6C90C8FC5B +4917F8EA3FF001804B13F06D17E0001F5E6C6C17C06D4B1380D807FC92B512006C6C4A5B +6C6C6C01075B6C01E0011F5BD97FFE90B55A6DB712C0010F93C7FC6D15FC010115F0D900 +3F1480020301F0C8FC406078DD51>III<92383FFF800203B512FC021FECFF80027F +15E049B712F849D9F0077F010F90C76C7ED91FFCEC1FFFD93FF06E7F494802037F494882 +717F484980854890C9127FA24884183FA25A80A380806E157F6E5E14FE6E7E6F4A5A6C14 +F003FC495B03FF495B6C1580DCE0075B6CDBF80F90C7FC9338FE1FFE6C9238FF7FF84D5A +6D16C06D5E6D4BC8FC6D6F7E6D16E00101826D16FC023F814A8149B87E01078349839026 +3FFE3F8190267FFC0F819026FFF003814849C6FC48496D804849131F4890C70007801601 +48486E1580003F163F49150F007F7014C0491501717E8400FF835B8484A384A21A80A27F +007F1900607F003F606D160F001F606D4C5A6C6D153F6C6D4B5A6C01F04B5A6C01FC0203 +5B6C01FF021F5B6D9027F001FFFEC7FC6D90B65A010F16F001035E010093C8FC020F14F8 +DA007F90C9FC426079DD51>I66 D<4DB5ED03C0057F02F01407 +0407B600FE140F047FDBFFC0131F4BB800F0133F030F05FC137F033F9127F8007FFE13FF +92B6C73807FF814A02F0020113C3020702C09138007FE74A91C9001FB5FC023F01FC1607 +4A01F08291B54882490280824991CB7E49498449498449498449865D49498490B5FC484A +84A2484A84A24891CD127FA25A4A1A3F5AA348491A1FA44899C7FCA25CA3B5FCB07EA380 +A27EA2F50FC0A26C7FA37E6E1A1F6C1D80A26C801D3F6C6E1A00A26C6E616D1BFE6D7F6F +4E5A7F6D6D4E5A6D6D4E5A6D6D4E5A6D6E171F6D02E04D5A6E6DEFFF806E01FC4C90C7FC +020F01FFEE07FE6E02C0ED1FF8020102F8ED7FF06E02FF913803FFE0033F02F8013F1380 +030F91B648C8FC030117F86F6C16E004071680DC007F02F8C9FC050191CAFC626677E375 +>IIII73 D76 D<94381FFFE00407B67E043F15F04BB712FE030F +EEFFC0033FD9FC0014F092B500C0010F13FC020349C7000113FF4A01F86E6C7F021F496F +13E04A01C0030F7F4A496F7F91B5C96C7F0103497013FF494970804B834949717F498749 +49717F49874B8390B586484A717FA24891CB6C7FA2481D804A84481DC0A348497214E0A3 +481DF0A34A85481DF8A5B51CFCB06C1DF8A36E96B5FCA36C1DF0A46C6D4E14E0A36C1DC0 +6E606C1D80A26C6E4D1400A26C6E4D5BA26C6E4D5BA26D6D4D5B6D636D6D4D5B6F94B5FC +6D636D6D4C5C6D6D4C91C7FC6D6E4B5B6D02E0031F5B023F6D4B13F06E01FC92B55A6E01 +FF02035C020302C0010F91C8FC020002FC90B512FC033F90B712F0030F17C0030394C9FC +DB007F15F804071580DC001F01E0CAFC666677E379>79 DI83 D<001FBEFCA64849C79126E0000F +148002E0180091C8171F498601F81A0349864986A2491B7FA2491B3F007F1DC090C9181F +A4007E1C0FA600FE1DE0481C07A5CA95C7FCB3B3B3A3021FBAFCA663617AE070>II<913803FFFE027FEBFF +F00103B612FE010F6F7E4916E090273FFE001F7FD97FE001077FD9FFF801017F486D6D7F +717E486D6E7F85717FA2717FA36C496E7FA26C5B6D5AEB1FC090C9FCA74BB6FC157F0207 +B7FC147F49B61207010F14C0013FEBFE004913F048B512C04891C7FC485B4813F85A5C48 +5B5A5CA2B55AA45FA25F806C5E806C047D7F6EEB01F96C6DD903F1EBFF806C01FED90FE1 +14FF6C9027FFC07FC01580000191B5487E6C6C4B7E011F02FC130F010302F001011400D9 +001F90CBFC49437CC14E>97 D<903807FF80B6FCA6C6FC7F7FB3A8EFFFF8040FEBFF8004 +7F14F00381B612FC038715FF038F010014C0DBBFF0011F7FDBFFC001077F93C76C7F4B02 +007F03F8824B6F7E4B6F13804B17C0851BE0A27313F0A21BF8A37313FCA41BFEAE1BFCA4 +4F13F8A31BF0A24F13E0A24F13C06F17804F1300816F4B5A6F4A5B4AB402075B4A6C6C49 +5B9126F83FE0013F13C09127F00FFC03B55A4A6CB648C7FCDAC00115F84A6C15E091C700 +1F91C8FC90C8000313E04F657BE35A>I<92380FFFF04AB67E020F15F0023F15FC91B77E +01039039FE001FFF4901F8010113804901E0010713C04901804913E0017F90C7FC49484A +13F0A2485B485B5A5C5A7113E0485B7113C048701380943800FE0095C7FC485BA4B5FCAE +7EA280A27EA2806C18FCA26C6D150119F87E6C6D15036EED07F06C18E06C6D150F6D6DEC +1FC06D01E0EC7F806D6DECFF00010701FCEB03FE6D9039FFC03FFC010091B512F0023F5D +020F1580020102FCC7FCDA000F13C03E437BC148>II<92380FFFC04AB512FC020FECFF8002 +3F15E091B712F80103D9FE037F499039F0007FFF011F01C0011F7F49496D7F4990C76C7F +49486E7F48498048844A804884485B727E5A5C48717EA35A5C721380A2B5FCA391B9FCA4 +1A0002C0CBFCA67EA380A27EA27E6E160FF11F806C183F6C7FF17F006C7F6C6D16FE6C17 +016D6C4B5A6D6D4A5A6D01E04A5A6D6DEC3FE0010301FC49B45A6D9026FFC01F90C7FC6D +6C90B55A021F15F8020715E0020092C8FC030713F041437CC14A>III<903807FF80B6FCA6C6FC7F7FB3A8EF1FFF94B512F0040714FC041F14FF4C8193267F +E07F7F922781FE001F7FDB83F86D7FDB87F07FDB8FC0814C7F039FC78015BE03BC8003FC +825DA25DA25DA45DB3B2B7D8F007B71280A651647BE35A>II<903807FF80B6FCA6C6FC7F7FB3B3B3B3 +ADB712E0A623647BE32C>108 D<902607FF80D91FFFEEFFF8B691B500F00207EBFF8004 +0702FC023F14E0041F02FF91B612F84C6F488193267FE07F6D4801037F922781FE001F90 +27E00FF0007FC6DA83F86D9026F01FC06D7F6DD987F06D4A487F6DD98FC0DBF87EC7804C +6D027C80039FC76E488203BEEEFDF003BC6E4A8003FC04FF834B5FA24B5FA24B94C8FCA4 +4B5EB3B2B7D8F007B7D8803FB612FCA67E417BC087>I<902607FF80EB1FFFB691B512F0 +040714FC041F14FF4C8193267FE07F7F922781FE001F7FC6DA83F86D7F6DD987F07F6DD9 +8FC0814C7F039FC78015BE03BC8003FC825DA25DA25DA45DB3B2B7D8F007B71280A65141 +7BC05A>I<923807FFE092B6FC020715E0021F15F8027F15FE494848C66C6C7E010701F0 +010F13E04901C001037F49496D7F4990C87F49486F7E49486F7E48496F13804819C04A81 +4819E048496F13F0A24819F8A348496F13FCA34819FEA4B518FFAD6C19FEA46C6D4B13FC +A36C19F8A26C6D4B13F0A26C19E06C6D4B13C0A26C6D4B13806C6D4B13006D6C4B5A6D6D +495B6D6D495B010701F0010F13E06D01FE017F5B010090B7C7FC023F15FC020715E00200 +92C8FC030713E048437CC151>I<902607FF80EBFFF8B6010FEBFF80047F14F00381B612 +FC038715FF038F010114C09227BFF0003F7FC6DAFFC0010F7F6D91C76C7F6D496E7F03F8 +6E7F4B6E7F4B17804B6F13C0A27313E0A27313F0A21BF885A21BFCA3851BFEAE4F13FCA4 +1BF861A21BF0611BE0611BC06F92B512801B006F5C6F4A5B6F4A5B03FF4A5B70495B04E0 +017F13C09226CFFC03B55A03C7B648C7FC03C115F803C015E0041F91C8FC040313E093CB +FCB3A3B712F0A64F5D7BC05A>I114 +D<913A3FFF8007800107B5EAF81F011FECFE7F017F91B5FC48B8FC48EBE0014890C7121F +D80FFC1407D81FF0801600485A007F167F49153FA212FF171FA27F7F7F6D92C7FC13FF14 +E014FF6C14F8EDFFC06C15FC16FF6C16C06C16F06C826C826C826C82013F1680010F16C0 +1303D9007F15E0020315F0EC001F1500041F13F81607007C150100FC81177F6C163FA217 +1F7EA26D16F0A27F173F6D16E06D157F6D16C001FEEDFF806D0203130002C0EB0FFE02FC +EB7FFC01DFB65A010F5DD8FE0315C026F8007F49C7FC48010F13E035437BC140>II<902607FFC0ED3F +FEB60207B5FCA6C6EE00076D826D82B3B3A260A360A2607F60183E6D6D147E4E7F6D6D49 +48806D6DD907F0ECFF806D01FFEB3FE06D91B55A6E1500021F5C020314F8DA003F018002 +F0C7FC51427BC05A>III<007FB600C0017FB512F8A6 +D8001F01F8C70007EBF0006D040190C7FC6D6D5D6D6D4A5A6D6D4A5A70495A6D4C5A6E7F +6E6D495A6E6D495A7049C8FC6E4A5A6E6D485A6E6D485A6E13FFEF8FF06EEC9FE06FEBFF +C06F5C6F91C9FC5F6F5B816F7F6F7F8481707F8493B57E4B805D4B80DB0FF37FDB1FE17F +04C080153F4B486C7F4B486C7F4A486D7F4A486D7F4A5A4B6D7F020F6E7F4A486D7F4A48 +6D804A5A4AC86C7F49486F7F4A6F7F0107707FEB3FFFB600F049B7FCA650407EBF55>I< +B700C00103B512FCA6D8003F01C0C8381FFE006FED07F0A26D6D5E190F6D6D5E191F6D6D +5E193F6D95C7FC6F5D6D177E6F15FEA26D6E495AA26E6D5C18036E6D5C18076E5E70130F +6E5E70131FA26E6D495AA26E6D91C8FC606E6D137E18FE6E5D17816F5C17C3A26FEBE7F0 +A26FEBF7E017FF6F5CA26F5CA26F91C9FCA36F5BA26F5BA2705AA2705AA2705AA35FA25F +163F94CAFC5E167E16FED807E05CD81FF81301487E486C495AA2B5495AA24B5A5E151F4B +5A6C4849CBFC15FEEBFC01393FF807FC391FF03FF06CB55A6C5C6C91CCFCC613FCEB1FE0 +4E5D7DBF55>I E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fj cmtt10 10.95 76 +/Fj 76 126 df<00101304007C131F00FEEB3F80A26C137FA248133FB2007E1400007C7F +003C131E00101304191C75B830>34 D37 D<141E147F14FF5BEB03FEEB07FCEB0FF0EB1FE0EB3FC0 +EB7F80EBFF00485A5B12035B485A120F5BA2485AA2123F5BA2127F90C7FCA412FEAD127F +A47F123FA27F121FA26C7EA27F12076C7E7F12017F6C7EEB7F80EB3FC0EB1FE0EB0FF0EB +07FCEB03FEEB01FF7F147F141E184771BE30>40 D<127812FE7E7F6C7E6C7EEA0FF06C7E +6C7E6C7E6C7EEB7F80133F14C0131FEB0FE014F01307A2EB03F8A214FC1301A214FE1300 +A4147FAD14FEA4130114FCA2130314F8A2EB07F0A2130F14E0EB1FC0133F1480137FEBFF +00485A485A485A485AEA3FE0485A485A90C7FC5A1278184778BE30>I<14E0497E497EA6 +0038EC0380007EEC0FC0D8FF83EB3FE001C3137F9038F3F9FF267FFBFB13C06CB6128000 +0FECFE00000314F86C5C6C6C13C0011F90C7FC017F13C048B512F04880000F14FE003FEC +FF80267FFBFB13C026FFF3F913E09038C3F87F0183133FD87E03EB0FC00038EC03800000 +91C7FCA66D5A6D5A23277AAE30>I<143EA2147FAF007FB7FCA2B81280A36C1600A2C76C +C8FCAF143EA229297DAF30>II<007FB612F0A2B712F8A36C15F0A225077B9E30>I<120FEA3FC0EA7FE0A2EAFFF0A4EA +7FE0A2EA3FC0EA0F000C0C6E8B30>I<16F01501ED03F8A21507A2ED0FF0A2ED1FE0A2ED +3FC0A2ED7F80A2EDFF00A24A5AA25D1403A24A5AA24A5AA24A5AA24A5AA24A5AA24AC7FC +A2495AA25C1303A2495AA2495AA2495AA2495AA2495AA249C8FCA2485AA25B1203A2485A +A2485AA2485AA2485AA2485AA248C9FCA25AA2127CA225477BBE30>I<14FE903807FFC0 +497F013F13F8497F90B57E48EB83FF4848C6138049137F4848EB3FC04848EB1FE049130F +001F15F0491307A24848EB03F8A290C712014815FCA400FEEC00FEAD6C14016C15FCA36D +1303003F15F8A26D1307001F15F0A26D130F6C6CEB1FE0A26C6CEB3FC06C6CEB7F806D13 +FF2601FF8313006CEBFFFE6D5B6D5B010F13E06D5BD900FEC7FC273A7CB830>IIIII<000FB612804815C05AA316800180C8FCAEEB +83FF019F13C090B512F015FC8181D9FE0313809039F0007FC049133F0180EB1FE06CC712 +0F000E15F0C81207A216F81503A31218127EA2B4FC150716F048140F6C15E06C141F6DEB +3FC06D137F3A3FE001FF80261FFC0F13006CB55A6C5C6C5C6C14E06C6C1380D90FFCC7FC +25397BB730>II<127CB712FC16FEA416FC48C7EA0FF816F0ED1FE0007CEC3FC0 +C8EA7F80EDFF00A24A5A4A5A5D14075D140F5D4A5AA24A5AA24AC7FCA25C5C13015CA213 +035CA213075CA4495AA6131F5CA96D5A6DC8FC273A7CB830>I<49B4FC011F13F0017F13 +FC90B57E0003ECFF804815C048010113E03A1FF8003FF049131FD83FC0EB07F8A24848EB +03FC90C71201A56D1303003F15F86D13076C6CEB0FF06C6CEB1FE0D807FCEB7FC03A03FF +83FF806C90B512006C6C13FC011F13F0497F90B512FE48802607FE0013C0D80FF8EB3FE0 +D81FE0EB0FF04848EB07F8491303007F15FC90C712014815FE481400A66C14016C15FC6D +1303003F15F86D1307D81FF0EB1FF06D133F3A0FFF01FFE06C90B512C06C1580C6ECFE00 +6D5B011F13F0010190C7FC273A7CB830>I<49B4FC010F13E0013F13F890B57E48804880 +48010113803A0FFC007FC0D81FF0EB3FE04848131F49EB0FF048481307A290C7EA03F85A +4815FC1501A416FEA37E7E6D1303A26C6C13076C6C130F6D133FD80FFC13FF6CB6FC7E6C +14FE6C14F9013FEBE1FC010F138190380060011400ED03F8A2150716F0150F000F15E048 +6C131F486CEB3FC0157FEDFF804A1300EC07FE391FF01FFC90B55A6C5C6C5C6C1480C649 +C7FCEB3FF0273A7CB830>I<120FEA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA0F00C7 +FCAF120FEA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA0F000C276EA630>II<16F01503ED07F8151F157FEDFFF014034A13C0021F138091383F +FE00ECFFF8495B010713C0495BD93FFEC7FC495A3801FFF0485B000F13804890C8FCEA7F +FC5BEAFFE05B7FEA7FF87FEA1FFF6C7F000313E06C7F38007FFC6D7E90380FFF806D7F01 +0113F06D7FEC3FFE91381FFF80020713C06E13F01400ED7FF8151F1507ED03F01500252F +7BB230>I<1278127EB4FC13C07FEA7FF813FEEA1FFF6C13C000037F6C13F86C6C7EEB1F +FF6D7F010313E06D7F9038007FFC6E7E91380FFF806E13C0020113F080ED3FF8151F153F +EDFFF05C020713C04A138091383FFE004A5A903801FFF0495B010F13804990C7FCEB7FFC +48485A4813E0000F5B4890C8FCEA7FFE13F8EAFFE05B90C9FC127E1278252F7BB230>62 +D64 +D<147F4A7EA2497FA4497F14F7A401077F14E3A3010F7FA314C1A2011F7FA490383F80FE +A590387F007FA4498049133F90B6FCA34881A39038FC001F00038149130FA40007814913 +07A2D87FFFEB7FFFB56CB51280A46C496C130029397DB830>I<007FB512F0B612FE6F7E +82826C813A03F8001FF815076F7E1501A26F7EA615015EA24B5A1507ED1FF0ED7FE090B6 +5A5E4BC7FC6F7E16E0829039F8000FF8ED03FC6F7E1500167FA3EE3F80A6167F1700A25E +4B5A1503ED1FFC007FB6FCB75A5E16C05E6C02FCC7FC29387EB730>I<91387F803C9039 +03FFF03E49EBFC7E011F13FE49EBFFFE5B9038FFE07F48EB801F3903FE000F484813075B +48481303A2484813015B123F491300A2127F90C8FC167C16005A5AAC7E7EA2167C6D14FE +123FA27F121F6D13016C6C14FCA26C6CEB03F86D13076C6CEB0FF03901FF801F6C9038E0 +7FE06DB512C06D14806D1400010713FC6D13F09038007FC0273A7CB830>I<003FB512E0 +4814FCB67E6F7E6C816C813A03F8007FF0ED1FF8150F6F7E6F7E15016F7EA2EE7F80A216 +3F17C0161FA4EE0FE0AC161F17C0A3163F1780A2167F17005E4B5A15034B5A150F4B5AED +7FF0003FB65A485DB75A93C7FC6C14FC6C14E02B387FB730>I<007FB7FCB81280A47ED8 +03F8C7123FA8EE1F0093C7FCA4157C15FEA490B5FCA6EBF800A4157C92C8FCA5EE07C0EE +0FE0A9007FB7FCB8FCA46C16C02B387EB730>I<003FB712804816C0B8FCA27E7ED801FC +C7121FA8EE0F8093C7FCA5153E157FA490B6FCA69038FC007FA4153E92C8FCAE383FFFF8 +487FB5FCA27E6C5B2A387EB730>I<02FF13F00103EBC0F8010F13F1013F13FD4913FF90 +B6FC4813C1EC007F4848133F4848131F49130F485A491307121F5B123F491303A2127F90 +C7FC6F5A92C8FC5A5AA892B5FC4A14805CA26C7F6C6D1400ED03F8A27F003F1407A27F12 +1F6D130F120F7F6C6C131FA2D803FE133F6C6C137FECC1FF6C90B5FC7F6D13FB010F13F3 +0103EBC1F0010090C8FC293A7DB830>I<3B3FFF800FFFE0486D4813F0B56C4813F8A26C +496C13F06C496C13E0D803F8C7EAFE00B290B6FCA601F8C7FCB3A23B3FFF800FFFE0486D +4813F0B56C4813F8A26C496C13F06C496C13E02D387FB730>I<007FB6FCB71280A46C15 +00260007F0C7FCB3B3A8007FB6FCB71280A46C1500213879B730>I75 +D<383FFFF8487FB57EA26C5B6C5BD801FCC9FCB3B0EE0F80EE1FC0A9003FB7FC5AB8FCA2 +7E6C16802A387EB730>III<90383FFFE048B512FC000714FF4815804815C04815E0EB +F80001E0133FD87F80EB0FF0A290C71207A44815F8481403B3A96C1407A26C15F0A36D13 +0FA26D131F6C6CEB3FE001F813FF90B6FC6C15C06C15806C1500000114FCD8003F13E025 +3A7BB830>I<007FB512F0B612FE6F7E16E0826C813903F8003FED0FFCED03FE15016F7E +A2821780163FA6167F17005EA24B5A1503ED0FFCED3FF890B6FC5E5E16804BC7FC15F001 +F8C9FCB0387FFFC0B57EA46C5B29387EB730>I<003FB57E4814F0B612FC15FF6C816C81 +2603F8017F9138003FF0151F6F7E15071503821501A515035E1507150F4B5A153F4AB45A +90B65A5E93C7FC5D8182D9F8007FED3FE0151F150F821507A817F8EEF1FCA53A3FFF8003 +FB4801C0EBFFF8B56C7E17F06C496C13E06C49EB7FC0C9EA1F002E397FB730>82 +D<90390FF803C0D97FFF13E048B512C74814F74814FF5A381FF80F383FE001497E484813 +7F90C7123F5A48141FA2150FA37EED07C06C91C7FC7F7FEA3FF0EA1FFEEBFFF06C13FF6C +14E0000114F86C80011F13FF01031480D9003F13C014019138007FE0151FED0FF0A2ED07 +F8A2007C140312FEA56C140716F07F6DEB0FE06D131F01F8EB3FC001FF13FF91B5128016 +0000FD5CD8FC7F13F8D8F81F5BD878011380253A7BB830>I<003FB712C04816E0B8FCA4 +3AFE003F800FA8007CED07C0C791C7FCB3B1011FB5FC4980A46D91C7FC2B387EB730>I< +3B7FFFC007FFFCB56C4813FEA46C496C13FCD803F8C7EA3F80B3B16D147F00011600A36C +6C14FE6D13016D5CEC800390393FE00FF890391FF83FF06DB55A6D5C6D5C6D91C7FC9038 +007FFCEC1FF02F3980B730>III<3A3FFF01FFF84801837F02C77FA202835B6C01015B3A01FC007F806D91C7FC00 +005C6D5BEB7F01EC81FCEB3F8314C3011F5B14E7010F5B14FF6D5BA26D5BA26D5BA26D90 +C8FCA4497FA2497FA2815B81EB0FE781EB1FC381EB3F8181EB7F0081497F49800001143F +49800003141F49800007140FD87FFEEB7FFFB590B5128080A25C6C486D130029387DB730 +>II<007FB612F0A2B712F8A36C15F0A225077B7D30>95 D97 DII<913801FFE04A +7F5CA28080EC0007AAEB03FE90381FFF874913E790B6FC5A5A481303380FFC00D81FF013 +3F49131F485A150F4848130790C7FCA25AA25AA87E6C140FA27F003F141F6D133F6C7E6D +137F390FF801FF2607FE07EBFFC06CB712E06C16F06C14F76D01C713E0011F010313C0D9 +07FCC8FC2C397DB730>I<49B4FC010713E0011F13F8017F7F90B57E488048018113803A +07FC007FC04848133FD81FE0EB1FE0150F484814F0491307127F90C7FCED03F85A5AB7FC +A516F048C9FC7E7EA27F003FEC01F06DEB03F86C7E6C7E6D1307D807FEEB1FF03A03FFC0 +7FE06C90B5FC6C15C0013F14806DEBFE00010713F8010013C0252A7CA830>IIII<14E0EB03F8A2497EA36D5AA2EB00E091C8FCA9381FFFF8487F5AA27E7EEA0001B3A9 +003FB612C04815E0B7FCA27E6C15C023397AB830>I107 +D<387FFFF8B57EA47EEA0001B3B3A8007FB612F0B712F8A46C15F025387BB730>I<02FC +137E3B7FC3FF01FF80D8FFEF01877F90B500CF7F15DF92B57E6C010F13872607FE07EB03 +F801FC13FE9039F803FC01A201F013F8A301E013F0B3A23C7FFE0FFF07FF80B548018F13 +C0A46C486C01071380322881A730>II<49B4FC010F +13E0013F13F8497F90B57E0003ECFF8014013A07FC007FC04848EB3FE0D81FE0EB0FF0A2 +4848EB07F8491303007F15FC90C71201A300FEEC00FEA86C14016C15FCA26D1303003F15 +F86D13076D130F6C6CEB1FF06C6CEB3FE06D137F3A07FF01FFC06C90B512806C15006C6C +13FC6D5B010F13E0010190C7FC272A7CA830>II<49B413F8010FEBC1FC013F13F14913FD48B6FC5A481381390FFC00 +7F49131F4848130F491307485A491303127F90C7FC15015A5AA77E7E15037FA26C6C1307 +150F6C6C131F6C6C133F01FC137F3907FF01FF6C90B5FC6C14FD6C14F9013F13F1010F13 +C1903803FE0190C7FCAD92B512F84A14FCA46E14F82E3C7DA730>II<9038 +1FFC1E48B5129F000714FF5A5A5A387FF007EB800100FEC7FC4880A46C143E007F91C7FC +13E06CB4FC6C13FC6CEBFF806C14E0000114F86C6C7F01037F9038000FFF02001380007C +147F00FEEC1FC0A2150F7EA27F151F6DEB3F806D137F9039FC03FF0090B6FC5D5D00FC14 +F0D8F83F13C026780FFEC7FC222A79A830>III<3B3FFFC07FFF80 +486DB512C0B515E0A26C16C06C496C13803B01F80003F000A26D130700005DA26D130F01 +7E5CA2017F131F6D5CA2EC803F011F91C7FCA26E5A010F137EA2ECE0FE01075BA214F101 +035BA3903801FBF0A314FF6D5BA36E5A6E5A2B277EA630>I<3B3FFFC01FFFE0486D4813 +F0B515F8A26C16F06C496C13E0D807E0C7EA3F00A26D5C0003157EA56D14FE00015DEC0F +80EC1FC0EC3FE0A33A00FC7FF1F8A2147DA2ECFDF9017C5C14F8A3017E13FBA290393FF0 +7FE0A3ECE03FA2011F5C90390F800F802D277FA630>I<3A3FFF81FFFC4801C37FB580A2 +6C5D6C01815BC648C66CC7FC137FEC80FE90383F81FC90381FC3F8EB0FE3ECE7F06DB45A +6D5B7F6D5B92C8FC147E147F5C497F81903803F7E0EB07E790380FE3F0ECC1F890381F81 +FC90383F80FE90387F007E017E137F01FE6D7E48486D7E267FFF80B5FCB500C1148014E3 +A214C16C0180140029277DA630>I<3B3FFFC07FFF80486DB512C0B515E0A26C16C06C49 +6C13803B01FC0003F000A2000014076D5C137E150F017F5C7F151FD91F805BA214C0010F +49C7FCA214E00107137EA2EB03F0157C15FCEB01F85DA2EB00F9ECFDF0147D147FA26E5A +A36E5AA35DA2143F92C8FCA25C147EA2000F13FE486C5AEA3FC1EBC3F81387EB8FF0EBFF +E06C5B5C6C90C9FC6C5AEA01F02B3C7EA630>I<001FB612FC4815FE5AA316FC90C7EA0F +F8ED1FF0ED3FE0ED7FC0EDFF80003E491300C7485A4A5A4A5A4A5A4A5A4A5A4A5A4990C7 +FC495A495A495A495A495A495A4948133E4890C7127F485A485A485A485A485A48B7FCB8 +FCA46C15FE28277DA630>II125 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fk cmbx12 14.4 49 +/Fk 49 122 df<151E153E157E15FCEC01F8EC07F0EC0FE0EC1FC01580143FEC7F0014FE +1301495A5C1307495AA2495A133F5C137FA2495AA24890C7FCA25A5BA21207A2485AA312 +1F5BA3123FA25BA3127FA55B12FFB3A3127F7FA5123FA37FA2121FA37F120FA36C7EA212 +03A27F7EA26C7FA26D7EA2133F80131F6D7EA26D7E1303806D7E1300147FEC3F80141F15 +C0EC0FE0EC07F0EC01F8EC00FC157E153E151E1F7973D934>40 D<127012F8127C127E7E +EA1FC06C7E6C7E12037F6C7E6C7E7F6D7E133F806D7EA26D7E80130780A26D7EA26D7EA2 +15807FA215C0A2EC7FE0A315F0143FA315F8A2141FA315FCA5140F15FEB3A315FC141FA5 +15F8A3143FA215F0A3147F15E0A3ECFFC0A21580A25B1500A2495AA2495AA25C130F5C49 +5AA2495A5C137F49C7FC5B485A485A5B1207485A485A48C8FC127E127C5A12701F7979D9 +34>I46 +D<913803FFC0023F13FC91B6FC010315C0010F018113F0903A1FFC003FF849486D7E4948 +6D7E49486D7E48496D138048496D13C0A24817E04890C813F0A34817F8A24817FC49157F +A3007F17FEA600FF17FFB3A5007F17FEA6003F17FCA26D15FFA26C17F8A36C17F0A26C6D +4913E0A26C6D4913C06C17806E5B6C6D4913006D6C495AD91FFCEB3FF8903A0FFF81FFF0 +6D90B55A01011580D9003F01FCC7FC020313C0384F7BCD43>48 D<157815FC1403140714 +1F14FF130F0007B5FCB6FCA2147F13F0EAF800C7FCB3B3B3A6007FB712FEA52F4E76CD43 +>II<91380FFFC091B512FC0107ECFF80011F15E090 +263FF8077F9026FF800113FC4848C76C7ED803F86E7E491680D807FC8048B416C080486D +15E0A4805CA36C17C06C5B6C90C75AD801FC1680C9FC4C13005FA24C5A4B5B4B5B4B13C0 +4B5BDBFFFEC7FC91B512F816E016FCEEFF80DA000713E0030113F89238007FFE707E7013 +807013C018E07013F0A218F8A27013FCA218FEA2EA03E0EA0FF8487E487E487EB57EA318 +FCA25E18F891C7FC6C17F0495C6C4816E001F04A13C06C484A1380D80FF84A13006CB44A +5A6CD9F0075BC690B612F06D5D011F1580010302FCC7FCD9001F1380374F7ACD43>I<17 +7C17FEA2160116031607160FA2161F163F167FA216FF5D5DA25D5DED1FBFED3F3F153E15 +7C15FCEC01F815F0EC03E01407EC0FC01580EC1F005C147E147C5C1301495A495A5C495A +131F49C7FC133E5B13FC485A5B485A1207485A485A90C8FC123E127E5ABA12C0A5C96C48 +C7FCAF020FB712C0A53A4F7CCE43>III<121F7F7F +EBFF8091B81280A45A1900606060A2606060485F0180C86CC7FC007EC95A4C5A007C4B5A +5F4C5A160F4C5A484B5A4C5A94C8FC16FEC812014B5A5E4B5A150F4B5AA24B5AA24B5A15 +FFA24A90C9FCA25C5D1407A2140FA25D141FA2143FA4147F5DA314FFA55BAC6D5BA2EC3F +C06E5A395279D043>I<913807FFC0027F13FC0103B67E010F15E090261FFC0113F8903A +3FE0003FFCD97F80EB0FFE49C76C7E48488048486E1380000717C04980120F18E0177FA2 +121F7FA27F7F6E14FF02E015C014F802FE4913806C7FDBC00313009238F007FE6C02F85B +9238FE1FF86C9138FFBFF06CEDFFE017806C4BC7FC6D806D81010F15E06D81010115FC01 +0781011F81491680EBFFE748018115C048D9007F14E04848011F14F048487F4848130303 +0014F8484880161F4848020713FC1601824848157F173FA2171FA2170FA218F8A27F007F +17F06D151FA26C6CED3FE0001F17C06D157F6C6CEDFF806C6C6C010313006C01E0EB0FFE +6C01FCEBFFFC6C6CB612F06D5D010F1580010102FCC7FCD9000F13C0364F7ACD43>I<91 +380FFF8091B512F8010314FE010F6E7E4901037F90267FF8007F4948EB3FF048496D7E48 +4980486F7E484980824817805A91C714C05A7013E0A218F0B5FCA318F8A618FCA46C5DA3 +7EA25E6C7F6C5DA26C5D6C7F6C6D137B6C6D13F390387FF803011FB512E36D14C3010302 +8313F89039007FFE03EC00401500A218F05EA3D801F816E0487E486C16C0487E486D4913 +80A218005E5F4C5A91C7FC6C484A5A494A5A49495B6C48495BD803FC010F5B9027FF807F +FEC7FC6C90B55A6C6C14F06D14C0010F49C8FC010013F0364F7ACD43>I<171F4D7E4D7E +A24D7EA34C7FA24C7FA34C7FA34C7FA24C7FA34C8083047F80167E8304FE804C7E030181 +16F8830303814C7E03078116E083030F814C7E031F81168083033F8293C77E4B82157E84 +03FE824B800201835D840203834B800207835D844AB87EA24A83A3DA3F80C88092C97E4A +84A2027E8202FE844A82010185A24A820103854A82010785A24A82010F855C011F717FEB +FFFCB600F8020FB712E0A55B547BD366>65 DI<932601FFFCEC01C0047FD9FFC013030307B600F81307033F03FE131F +92B8EA803F0203DAE003EBC07F020F01FCC7383FF0FF023F01E0EC0FF94A01800203B5FC +494848C9FC4901F8824949824949824949824949824990CA7E494883A2484983485B1B7F +485B481A3FA24849181FA3485B1B0FA25AA298C7FC5CA2B5FCAE7EA280A2F307C07EA36C +7FA21B0F6C6D1980A26C1A1F6C7F1C006C6D606C6D187EA26D6C606D6D4C5A6D6D16036D +6D4C5A6D6D4C5A6D01FC4C5A6D6DEE7F806D6C6C6C4BC7FC6E01E0EC07FE020F01FEEC1F +F80203903AFFE001FFF0020091B612C0033F93C8FC030715FCDB007F14E0040101FCC9FC +525479D261>I +III73 D76 +D<93380FFFC00303B6FC031F15E092B712FC0203D9FC0013FF020F01C0010F13C0023F90 +C7000313F0DA7FFC02007F494848ED7FFE4901E0ED1FFF49496F7F49496F7F4990C96C7F +49854948707F4948707FA24849717E48864A83481B804A83481BC0A2481BE04A83A2481B +F0A348497113F8A5B51AFCAF6C1BF86E5FA46C1BF0A26E5F6C1BE0A36C6D4D13C0A26C6D +4D1380A26C1B006C6D4D5A6E5E6C626D6C4C5B6D6D4B5B6D6D4B5B6D6D4B5B6D6D4B5B6D +6D4B90C7FC6D6D4B5A6D01FF02035B023F01E0011F13F0020F01FC90B512C0020390B7C8 +FC020016FC031F15E0030392C9FCDB001F13E0565479D265>79 DI82 D<91260FFF80130791B500F85B010702FF5B011FEDC0 +3F49EDF07F9026FFFC006D5A4801E0EB0FFD4801800101B5FC4848C87E48488149150F00 +1F824981123F4981007F82A28412FF84A27FA26D82A27F7F6D93C7FC14C06C13F014FF15 +F86CECFF8016FC6CEDFFC017F06C16FC6C16FF6C17C06C836C836D826D82010F82130301 +0082021F16801400030F15C0ED007F040714E01600173F050F13F08383A200788200F882 +A3187FA27EA219E07EA26CEFFFC0A27F6D4B13806D17006D5D01FC4B5A01FF4B5A02C04A +5A02F8EC7FF0903B1FFFC003FFE0486C90B65AD8FC0393C7FC48C66C14FC48010F14F048 +D9007F90C8FC3C5479D24B>I<003FBC1280A59126C0003F9038C0007F49C71607D87FF8 +060113C001E08449197F49193F90C8171FA2007E1A0FA3007C1A07A500FC1BE0481A03A6 +C994C7FCB3B3AC91B912F0A553517BD05E>II97 DI<913801FFF8021FEB +FF8091B612F0010315FC010F9038C00FFE903A1FFE0001FFD97FFC491380D9FFF05B4817 +C048495B5C5A485BA2486F138091C7FC486F1300705A4892C8FC5BA312FFAD127F7FA27E +A2EF03E06C7F17076C6D15C07E6E140F6CEE1F806C6DEC3F006C6D147ED97FFE5C6D6CEB +03F8010F9038E01FF0010390B55A01001580023F49C7FC020113E033387CB63C>I<4DB4 +7E0407B5FCA5EE001F1707B3A4913801FFE0021F13FC91B6FC010315C7010F9038E03FE7 +4990380007F7D97FFC0101B5FC49487F4849143F484980485B83485B5A91C8FC5AA3485A +A412FFAC127FA36C7EA37EA26C7F5F6C6D5C7E6C6D5C6C6D49B5FC6D6C4914E0D93FFED9 +0FEFEBFF80903A0FFFC07FCF6D90B5128F0101ECFE0FD9003F13F8020301C049C7FC4154 +7CD24B>I<913803FFC0023F13FC49B6FC010715C04901817F903A3FFC007FF849486D7E +49486D7E4849130F48496D7E48178048497F18C0488191C7FC4817E0A248815B18F0A212 +FFA490B8FCA318E049CAFCA6127FA27F7EA218E06CEE01F06E14037E6C6DEC07E0A26C6D +EC0FC06C6D141F6C6DEC3F806D6CECFF00D91FFEEB03FE903A0FFFC03FF8010390B55A01 +0015C0021F49C7FC020113F034387CB63D>IIII<137F497E000313E0487FA2487FA76C5BA2 +6C5BC613806DC7FC90C8FCADEB3FF0B5FCA512017EB3B3A6B612E0A51B547BD325>I108 DII<913801FFE0021F13FE91B612C0010315F0010F9038807F +FC903A1FFC000FFED97FF86D6C7E49486D7F48496D7F48496D7F4A147F48834890C86C7E +A24883A248486F7EA3007F1880A400FF18C0AC007F1880A3003F18006D5DA26C5FA26C5F +6E147F6C5F6C6D4A5A6C6D495B6C6D495B6D6C495BD93FFE011F90C7FC903A0FFF807FFC +6D90B55A010015C0023F91C8FC020113E03A387CB643>I<903A3FF001FFE0B5010F13FE +033FEBFFC092B612F002F301017F913AF7F8007FFE0003D9FFE0EB1FFFC602806D7F92C7 +6C7F4A824A6E7F4A6E7FA2717FA285187F85A4721380AC1A0060A36118FFA2615F616E4A +5BA26E4A5B6E4A5B6F495B6F4990C7FC03F0EBFFFC9126FBFE075B02F8B612E06F148003 +1F01FCC8FC030313C092CBFCB1B612F8A5414D7BB54B>I<90397FE003FEB590380FFF80 +033F13E04B13F09238FE1FF89139E1F83FFC0003D9E3E013FEC6ECC07FECE78014EF1500 +14EE02FEEB3FFC5CEE1FF8EE0FF04A90C7FCA55CB3AAB612FCA52F367CB537>114 +D<903903FFF00F013FEBFE1F90B7FC120348EB003FD80FF81307D81FE0130148487F4980 +127F90C87EA24881A27FA27F01F091C7FC13FCEBFFC06C13FF15F86C14FF16C06C15F06C +816C816C81C681013F1580010F15C01300020714E0EC003F030713F015010078EC007F00 +F8153F161F7E160FA27E17E07E6D141F17C07F6DEC3F8001F8EC7F0001FEEB01FE9039FF +C00FFC6DB55AD8FC1F14E0D8F807148048C601F8C7FC2C387CB635>I<143EA6147EA414 +FEA21301A313031307A2130F131F133F13FF5A000F90B6FCB8FCA426003FFEC8FCB3A9EE +07C0AB011FEC0F8080A26DEC1F0015806DEBC03E6DEBF0FC6DEBFFF86D6C5B021F5B0203 +13802A4D7ECB34>IIII<007FB500 +F090387FFFFEA5C66C48C7000F90C7FC6D6CEC07F86D6D5C6D6D495A6D4B5A6F495A6D6D +91C8FC6D6D137E6D6D5B91387FFE014C5A6E6C485A6EEB8FE06EEBCFC06EEBFF806E91C9 +FCA26E5B6E5B6F7E6F7EA26F7F834B7F4B7F92B5FCDA01FD7F03F87F4A486C7E4A486C7E +020F7FDA1FC0804A486C7F4A486C7F02FE6D7F4A6D7F495A49486D7F01076F7E49486E7E +49486E7FEBFFF0B500FE49B612C0A542357EB447>II +E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fl cmr10 10.95 83 +/Fl 83 124 df<4AB4EB0FE0021F9038E03FFC913A7F00F8FC1ED901FC90383FF03FD907 +F090397FE07F80494801FF13FF4948485BD93F805C137F0200ED7F00EF003E01FE6D91C7 +FC82ADB97EA3C648C76CC8FCB3AE486C4A7E007FD9FC3FEBFF80A339407FBF35>11 +DII<001E130F397F803FC000FF137F01C013E0A201E013F0A3007F13 +3F391E600F3000001300A401E01370491360A3000114E04913C000031301010013804813 +03000EEB070048130E0018130C0038131C003013181C1C7DBE2D>34 +D<14E0A4EB07FC90383FFF8090B512E03901F8E3F03903E0E0FCD807C0133CD80F807FD8 +1F007F003E80003C1580007C140316C00078141F00F8143F157FA47EED3F806CEC0E0092 +C7FC127F138013C0EA3FF013FEEA1FFF6C13FC6C13FF6C14C06C806C6C13F8011F7F1303 +01007FECE7FF14E102E01380157F153FED1FC0A2003E140F127FD8FF801307A5130000FC +158000F0140F1270007815005D6C141E153E6C5C6C5C3907C0E1F03903F8EFE0C6B51280 +D93FFEC7FCEB0FF8EB00E0A422497BC32D>36 D<013F1603D9FFC04B7E2601E0E0150F26 +07C070151F48486C4BC7FC023E157E48486C15FE48D90FC0EB03FC003ED90EF0EB0FF8DA +0F3F13FD007E903A070FFFF1F0007C0200EB03E0160000FC6D6C495A170F604DC8FC5F17 +3E5F17FC5F4C5A1603007CD907005B4C5A007E150F003E495C020E49C9FC003F5D6C4913 +3E260F803C5B023813FC6C6C485B3A01E0E001F03800FFC090273F0003E0133F90C70007 +ECFFC09339C001E0E0923A0F8007C070031F49487E0400143C033E90381F001C037E497F +037C133E4B150F0201027E7F4B137C4A5A020702FCEB03805D4A5A141F92C7FC143E147E +147C5CA2495A0103037CEB07005C4948147E010F033E5B4A160E49C8123F496F5B013E92 +380F803C49173801FC6F6C5A49923801E0E0496FB45A0160043FC7FC41497BC34C>II<121EEA7F8012FF13C0A213E0A3127FEA1E601200A413E013C0A3 +12011380120313005A120E5A1218123812300B1C79BE19>I<1430147014E0EB01C0EB03 +801307EB0F00131E133E133C5B13F85B12015B1203A2485AA2120F5BA2121F90C7FCA25A +A3123E127EA6127C12FCB2127C127EA6123E123FA37EA27F120FA27F1207A26C7EA21201 +7F12007F13787F133E131E7FEB07801303EB01C0EB00E014701430145A77C323>I<12C0 +7E12707E7E121E7E6C7E7F12036C7E7F12007F1378137CA27FA2133F7FA21480130FA214 +C0A3130714E0A6130314F0B214E01307A614C0130FA31480A2131F1400A25B133EA25BA2 +137813F85B12015B485A12075B48C7FC121E121C5A5A5A5A145A7BC323>II<121EEA7F80 +12FF13C0A213E0A3127FEA1E601200A413E013C0A312011380120313005A120E5A121812 +3812300B1C798919>44 DI<121EEA7F80A2EAFFC0A4EA7F80A2 +EA1E000A0A798919>IIIIII<150E151E153EA2157EA215FE +1401A21403EC077E1406140E141CA214381470A214E0EB01C0A2EB0380EB0700A2130E5B +A25B5BA25B5B1201485A90C7FC5A120E120C121C5AA25A5AB8FCA3C8EAFE00AC4A7E49B6 +FCA3283E7EBD2D>I<00061403D80780131F01F813FE90B5FC5D5D5D15C092C7FC14FCEB +3FE090C9FCACEB01FE90380FFF8090383E03E090387001F8496C7E49137E497F90C71380 +0006141FC813C0A216E0150FA316F0A3120C127F7F12FFA416E090C7121F12FC007015C0 +12780038EC3F80123C6CEC7F00001F14FE6C6C485A6C6C485A3903F80FE0C6B55A013F90 +C7FCEB07F8243F7CBC2D>II<1238 +123C123F90B612FCA316F85A16F016E00078C712010070EC03C0ED078016005D48141E15 +1C153C5DC8127015F04A5A5D14034A5A92C7FC5C141EA25CA2147C147814F8A213015C13 +03A31307A3130F5CA2131FA6133FAA6D5A0107C8FC26407BBD2D>III<121EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCB3121EEA7F80A2EAFFC0A4EA +7F80A2EA1E000A2779A619>I<121EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCB3121E12 +7FEAFF80A213C0A4127F121E1200A412011380A3120313005A1206120E120C121C5A1230 +A20A3979A619>I63 D<15074B7EA34B7EA34B7EA34B7EA34B7E15E7A2913801C7FC +15C3A291380381FEA34AC67EA3020E6D7EA34A6D7EA34A6D7EA34A6D7EA34A6D7EA34948 +6D7E91B6FCA249819138800001A249C87EA24982010E157FA2011E82011C153FA2013C82 +0138151FA2017882170F13FC00034C7ED80FFF4B7EB500F0010FB512F8A33D417DC044> +65 DIIIII +III<011FB512FCA3D9000713006E5A1401B3B3A6123F +EA7F80EAFFC0A44A5A1380D87F005B007C130700385C003C495A6C495A6C495A2603E07E +C7FC3800FFF8EB3FC026407CBD2F>IIIIIII82 DI<003FB91280A3903AF0007FE001018090393FC0003F48C7ED1FC0007E17 +07127C00781703A300701701A548EF00E0A5C81600B3B14B7E4B7E0107B612FEA33B3D7D +BC42>IIII89 +D<003FB712F8A391C7EA1FF013F801E0EC3FE00180EC7FC090C8FC003EEDFF80A2003C4A +1300007C4A5A12784B5A4B5AA200704A5AA24B5A4B5AA2C8485A4A90C7FCA24A5A4A5AA2 +4A5AA24A5A4A5AA24A5A4A5AA24990C8FCA2495A4948141CA2495A495AA2495A495A173C +495AA24890C8FC485A1778485A484815F8A24848140116034848140F4848143FED01FFB8 +FCA32E3E7BBD38>II<486C13C000 +03130101001380481303000EEB070048130E0018130C0038131C00301318007013380060 +1330A300E01370481360A400CFEB678039FFC07FE001E013F0A3007F133FA2003F131F01 +C013E0390F0007801C1C73BE2D>I +I96 D +II<49B4FC010F13E090383F00F8017C131E4848131F +4848137F0007ECFF80485A5B121FA24848EB7F00151C007F91C7FCA290C9FC5AAB6C7EA3 +003FEC01C07F001F140316806C6C13076C6C14000003140E6C6C131E6C6C137890383F01 +F090380FFFC0D901FEC7FC222A7DA828>II +II<167C903903F801 +FF903A1FFF078F8090397E0FDE1F9038F803F83803F001A23B07E000FC0600000F6EC7FC +49137E001F147FA8000F147E6D13FE00075C6C6C485AA23901F803E03903FE0FC026071F +FFC8FCEB03F80006CAFC120EA3120FA27F7F6CB512E015FE6C6E7E6C15E06C810003813A +0FC0001FFC48C7EA01FE003E140048157E825A82A46C5D007C153E007E157E6C5D6C6C49 +5A6C6C495AD803F0EB0FC0D800FE017FC7FC90383FFFFC010313C0293D7EA82D>III<1478EB01FEA2EB03FFA4EB01FEA2EB00781400AC147FEB7FFFA313 +017F147FB3B3A5123E127F38FF807E14FEA214FCEB81F8EA7F01387C03F0381E07C0380F +FF803801FC00185185BD1C>II +I<2701F801FE14FF00FF902707FFC00313E0913B1E07E00F03F0913B7803F03C01F80007 +903BE001F87000FC2603F9C06D487F000101805C01FBD900FF147F91C75B13FF4992C7FC +A2495CB3A6486C496CECFF80B5D8F87FD9FC3F13FEA347287DA74C>I<3901F801FE00FF +903807FFC091381E07E091387803F000079038E001F82603F9C07F0001138001FB6D7E91 +C7FC13FF5BA25BB3A6486C497EB5D8F87F13FCA32E287DA733>I<14FF010713E090381F +81F890387E007E01F8131F4848EB0F804848EB07C04848EB03E0000F15F04848EB01F8A2 +003F15FCA248C812FEA44815FFA96C15FEA36C6CEB01FCA3001F15F86C6CEB03F0A26C6C +EB07E06C6CEB0FC06C6CEB1F80D8007EEB7E0090383F81FC90380FFFF0010090C7FC282A +7EA82D>I<3901FC03FC00FF90381FFF8091387C0FE09039FDE003F03A07FFC001FC6C49 +6C7E6C90C7127F49EC3F805BEE1FC017E0A2EE0FF0A3EE07F8AAEE0FF0A4EE1FE0A2EE3F +C06D1580EE7F007F6E13FE9138C001F89039FDE007F09039FC780FC0DA3FFFC7FCEC07F8 +91C9FCAD487EB512F8A32D3A7EA733>I<02FF131C0107EBC03C90381F80F090397F0038 +7C01FC131CD803F8130E4848EB0FFC150748481303121F485A1501485AA448C7FCAA6C7E +A36C7EA2001F14036C7E15076C6C130F6C7E6C6C133DD8007E137990383F81F190380FFF +C1903801FE0190C7FCAD4B7E92B512F8A32D3A7DA730>I<3901F807E000FFEB1FF8EC78 +7CECE1FE3807F9C100031381EA01FB1401EC00FC01FF1330491300A35BB3A5487EB512FE +A31F287EA724>I<90383FC0603901FFF8E03807C03F381F000F003E1307003C1303127C +0078130112F81400A27E7E7E6D1300EA7FF8EBFFC06C13F86C13FE6C7F6C1480000114C0 +D8003F13E0010313F0EB001FEC0FF800E01303A214017E1400A27E15F07E14016C14E06C +EB03C0903880078039F3E01F0038E0FFFC38C01FE01D2A7DA824>I<131CA6133CA4137C +A213FCA2120112031207001FB512C0B6FCA2D801FCC7FCB3A215E0A912009038FE01C0A2 +EB7F03013F138090381F8700EB07FEEB01F81B397EB723>IIIIII<001FB61280A2EBE0000180140049485A001E495A121C4A5A003C +495A141F00385C4A5A147F5D4AC7FCC6485AA2495A495A130F5C495A90393FC00380A2EB +7F80EBFF005A5B484813071207491400485A48485BA248485B4848137F00FF495A90B6FC +A221277EA628>II E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fm cmbx12 20.736 11 +/Fm 11 115 df<137F3801FFC0000713F0487F487F487F487FA2B61280A96C1400A26C5B +6C5B6C5B6C5B000113C06C6CC7FC1919729836>46 D48 D<93B57E031F14FC92B7 +7E020316F0020F16FC023F16FF4A8349B5D8800314E04901F8C7003F7F4901C0020F7F49 +90C800037FD91FFC6F7F49486F6C7E137F4A7013804948827313C05A4A821BE05AA28548 +7FA38080806E5E8003C017C08103F85D03FE17806F6C5C6C6F160004F05C04FC4A5A6C6F +5D706C13FFDDE0015B6CDCF8035BDDFC0F13C06DDBFF1F5B6D93B5C7FC19FC6D17F06D5F +6D17806D17E06D836D6C16FC6E16FF020F836E17E06E83020F83023F8391B97E49840107 +01F0178049D9C07F16C0013FD9801F16E049EB00074948010116F048497F4849023F15F8 +4849140F4A6E15FC48160148496E6C14FE4A151F488391C9120348050014FF193F498385 +00FF84854983A28586A3861BFEA27FA2007F1AFC7F1A7F1BF86C7FF2FFF06C7F6E4C13E0 +6C6D4C13C06C6D5E6E4C13806C6D4C13006C6D6CED7FFE6C02E04A485A013F01FC020F13 +F06D9026FFC001B55A010791B712806D95C7FC010017FC021F16F002071680DA007F02FC +C8FC030191C9FC507378F061>56 D<93B5FC031F14F092B612FE02076F7E021F16E04A16 +F891B87E49DAF00713FF0107DA0001804901FC6D6C7F49496E7F49496E7F49496E7F90B5 +486E7F484A8048854891C86C7FA2487114805C481AC0A2487213E0A2484918F0A31BF8A2 +B5FCA27313FCA51BFEA71BFF61A27EA396B6FC7EA2806C5FA27E606C7F607E6C6E5C6CEF +1FBF6D6DEC3F3F6D6D147F6D6D14FE6D6DEB01FC6D01FE130701019039FFC01FF86D91B5 +00F014FE023F15C06E15800203ECFE00DA007F13F8030713C092C9FC4F13FCA41BF8A31B +F0D91FF093B5FCEB7FFC496C18E0487F486E17C06048801B804E1400A26260624E5B4B5C +626C91C8485B4A4B5B4A92B55A6C01F04A91C7FC02804A5B6C01E0020F5B6D6C023F13F0 +02FE91B55A90273FFFE00F5C6D90B7C8FC010716FC6D16F0010016C0023F92C9FC020714 +F09126007FFECAFC507378F061>I<92383FFFF80207B612E0027F15FC49B87E010717E0 +011F83499026F0007F13FC4948C7000F7F90B502036D7E486E6D806F6D80727F486E6E7F +8486727FA28684A26C5C72806C5C6D90C8FC6D5AEB0FF8EB03E090CAFCA70507B6FC041F +B7FC0303B8FC157F0203B9FC021FECFE0391B612800103ECF800010F14C04991C7FC017F +13FC90B512F04814C0485C4891C8FC485B5A485B5C5A5CA2B5FC5CA360A36E5DA26C5F6E +5D187E6C6D846E4A48806C6D4A4814FC6C6ED90FF0ECFFFC6C02E090263FE07F14FE0001 +9139FC03FFC06C91B6487E013F4B487E010F4B1307010303F01301D9003F0280D9003F13 +FC020101F8CBFC57507ACE5E>97 D<903801FFFCB6FCA8C67E131F7FB3ADF0FFFC050FEB +FFE0057F14FE0403B77E040F16E0043F16F84CD9007F13FE9226FDFFF001077F92B500C0 +01018094C86C13E004FC6F7F4C6F7F04E06F7F4C6F7F5E747F93C915804B7014C0A27414 +E0A21DF087A21DF8A31DFC87A41DFEAF1DFCA4631DF8A31DF098B5FC1DE0A25014C0A26F +1980501400705D705F704B5B505B704B5B04FC4B5BDBE7FE92B55A9226C3FF8001035C03 +8101E0011F49C7FC9226807FFC90B55A4B6CB712F04A010F16C04A010393C8FC4A010015 +F84A023F14C090C9000301F0C9FC5F797AF76C>I<93383FFFF00307B612C0033F15F84A +B712FE0207707E021F17E0027F8391B526FC001F7F010302C001037F4991C7487F49495C +495B4901F04A7F5B90B55A485CA2485C4891C8FCA248715B5C48715B725B4A6F5B489438 +007FC0071FC7FC96C8FC5AA25CA3B5FCAF7E80A47E80A27E806CF11F80F23FC06C6E167F +A26C6EEEFF80816C606C6E17006D6D4B5A6D6D15076D6D4B5A6D6D6C4A5A6D02E0EC7FF0 +6D02F849485A01009126FF801F5B6E91B6C7FC021F5E020716F8020116E06E6C15800307 +02FCC8FCDB003F13804A507ACE56>I<97380FFFE00607B6FCA8F00003190086B3AD9338 +3FFF800307B512F8033F14FF4AB712C0020716F0021F16FC027F9039FE007FFE91B500F0 +EB0FFF01030280010190B5FC4949C87E49498149498149498149498190B548814884484A +8192CAFC5AA2485BA25A5C5AA35A5CA4B5FCAF7EA4807EA37EA2807EA26C7F616C6E5D6C +606C80616D6D5D6D6D5D6D6D92B67E6D6D4A15FC010301FF0207EDFFFE6D02C0EB3FFE6D +6C9039FC01FFF86E90B65A020F16C002031600DA007F14FC030F14E09226007FFEC749C7 +FC5F797AF76C>I<93387FFF80030FB512FC037FECFF804AB712E0020716F8021F16FE02 +7FD9F8077F49B5D8C000804991C7003F13E04901FC020F7F49496E7F49498049496E7F49 +496E7F90B55A48727E92C914804884485B1BC048841BE0485BA27313F05AA25C5AA21BF8 +85A2B5FCA391BAFCA41BF002F8CCFCA67EA3807EA47E806CF103F0F207F86C7F1A0F6C6E +17F06C191F6F17E06C6E163F6D6DEE7FC06D6D16FF6D6D4B13806D6D4B13006D6D6CEC0F +FE6D02E0EC3FFC6D02F8ECFFF86D9126FFC00F5B023F91B65A020F178002034CC7FC0200 +16F8031F15E0030392C8FCDB000F13E04D507BCE58>I<93381FFFE00303B6FC031F15E0 +92B712FC020316FF020F17C0023FD9FC0014F091B500C0010F13FC4991C700037F4901FC +02007F010F496F13C049496F7F49496F7F4B8149496F7F90B5C96C7F4886A24849707F48 +1B80A248497014C0A2481BE0A348497113F0A3481BF8A5B51AFCAE6C1BF8A46C1BF06E94 +B5FCA36C1BE0A26C6D4C14C0A26C1B806E5E6C1B006C6E4B5BA26C6E4B5B6D6D4B5B6D6D +4B5B6D6D4B5B6D6D92B55A6D01FF02035C6D02C0010F91C7FC010002FC90B512FC6E90B7 +5A021F17E00207178002014CC8FCDA003F15F0030392C9FCDB001F13E056507BCE61> +111 D<902601FFF8EB07FEB691383FFFC094B512F00403804C14FE4C8093261FFC3F1380 +93263FE07F13C0DC7F80B5FCC66C5D011FDAFE0114E06DEBF9FC16F815FB16F016E015FF +16C07114C05E72138095381FFE0093C76C5AF001E095C8FCA25DA65DB3B3A2B812F8A843 +4E7ACD4F>114 D E +%EndDVIPSBitmapFont +end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 600dpi +TeXDict begin +%%PaperSize: A4 + +%%EndSetup +%%Page: 1 1 +1 0 bop 94 1385 a Fm(barco)5 b(de)65 b(0.98)p 94 1451 +3780 34 v 2617 1548 a Fl(A)31 b(library)d(for)i(dra)m(wing)f(bar)h(co)s +(des)3409 1656 y(Marc)m(h)h(2002)94 5367 y Fk(b)l(y)45 +b(Alessandro)h(Rubini)f(\()p Fj(rubini@gnu.org)p Fk(\))p +94 5446 3780 17 v eop +%%Page: 1 2 +1 1 bop 94 -116 a Fl(Chapter)30 b(2:)41 b(The)30 b(Underlying)e(Data)k +(Structure)2012 b(1)94 365 y Fi(Barco)t(de)54 b(to)t(ols)219 +549 y Fl(This)29 b(\014le)g(do)s(cumen)m(ts)h(v)m(ersion)g(0.98)i(of)e +(the)h(barco)s(de)f(library)e(and)i(sample)f(programs)h(\(Marc)m(h)i +(2002\).)94 815 y Fi(1)81 b(Ov)l(erview)219 999 y Fl(The)26 +b Fh(barco)s(de)32 b Fl(pac)m(k)-5 b(age)29 b(is)d(mainly)f(a)i(C)f +(library)f(for)h(creating)i(bar-co)s(de)f(output)f(\014les.)39 +b(It)27 b(also)f(includes)94 1099 y(a)31 b(command)f(line)f(fron)m +(t-end)h(and)g(\(in)f(a)i(foreseeable)g(future\))f(a)h(graphic)e(fron)m +(tend.)219 1215 y(The)k(pac)m(k)-5 b(age)35 b(is)d(designed)g(as)i(a)f +(library)e(b)s(ecause)i(w)m(e)h(think)e(the)h(main)g(use)f(for)h(barco) +s(de-generation)94 1315 y(to)s(ols)23 b(is)f(inside)f(more)i(featured)g +(applications.)37 b(The)22 b(library)f(addresses)h(bar)h(co)s(de)g +(prin)m(ting)e(as)i(t)m(w)m(o)i(distinct)94 1415 y(problems:)43 +b(creation)33 b(of)f(bar)g(information)e(and)i(actual)h(con)m(v)m +(ersion)f(to)h(an)f(output)g(format.)47 b(T)-8 b(o)32 +b(this)g(aim)94 1514 y(w)m(e)25 b(use)f(an)g(in)m(termediate)g +(represen)m(tation)g(for)g(bar)f(co)s(des,)j(whic)m(h)d(is)g(curren)m +(tly)g(do)s(cumen)m(ted)h(in)e(the)j(`)p Fj(ps.c)p Fl(')94 +1614 y(source)31 b(\014le)e(\(not)i(in)f(this)f(do)s(cumen)m(t\).)219 +1730 y(Note)24 b(that)e(the)h(library)d(and)h(the)i(accompan)m(ying)g +(material)e(is)h(released)g(according)g(to)h(the)f(GPL)h(license,)94 +1830 y(not)31 b(the)g(LGPL)f(one.)41 b(A)30 b(cop)m(y)h(of)g(the)g(GPL) +f(is)f(included)f(in)h(the)i(distribution)26 b(tarball.)94 +2096 y Fi(2)81 b(The)53 b(Underlying)h(Data)g(Structure)219 +2280 y Fl(Ev)m(ery)33 b(barco)s(de-related)g(function)f(acts)i(on)f(a)h +(data)f(structure)g(de\014ned)f(in)g(the)h(`)p Fj(barcode.h)p +Fl(')e(header,)94 2380 y(whic)m(h)j(m)m(ust)h(b)s(e)f(included)e(b)m(y) +j(an)m(y)g(C)g(source)g(\014le)f(that)h(uses)g(the)g(library)-8 +b(.)52 b(The)35 b(header)f(is)g(installed)f(b)m(y)94 +2480 y Fj(make)47 b(install)p Fl(.)219 2596 y(The)30 +b(de\014nition)e(of)i(the)h(data)g(structure)f(is)f(included)f(here)i +(for)g(reference:)334 2717 y Fj(struct)47 b(Barcode_Item)d({)525 +2820 y(int)j(flags;)428 b(/*)47 b(type)g(of)g(encoding)f(and)h(other)f +(flags)g(*/)525 2924 y(char)h(*ascii;)332 b(/*)47 b(malloced)f(*/)525 +3028 y(char)h(*partial;)236 b(/*)47 b(malloced)f(too)h(*/)525 +3132 y(char)g(*textinfo;)188 b(/*)47 b(information)e(about)h(text)h +(placement)e(*/)525 3236 y(char)i(*encoding;)188 b(/*)47 +b(code)g(name,)f(filled)g(by)i(encoding)d(engine)h(*/)525 +3339 y(int)h(width,)f(height;)g(/*)h(output)f(units)h(*/)525 +3443 y(int)g(xoff,)g(yoff;)189 b(/*)47 b(output)f(units)h(*/)525 +3547 y(int)g(margin;)380 b(/*)47 b(output)f(units)h(*/)525 +3651 y(double)f(scalef;)237 b(/*)47 b(requested)f(scaling)f(for)i +(barcode)f(*/)525 3754 y(int)h(error;)428 b(/*)47 b(an)h(errno-like)d +(value,)h(in)h(case)f(of)i(failure)d(*/)334 3858 y(};)219 +3975 y Fl(The)e(exact)i(meaning)e(of)g(eac)m(h)i(\014eld)d(and)h(the)g +(v)-5 b(arious)43 b(\015ags)g(implemen)m(ted)f(are)i(describ)s(ed)e(in) +g(the)94 4074 y(follo)m(wing)29 b(sections.)219 4191 +y(Ev)m(en)38 b(though)f(y)m(ou)h(w)m(on't)g(usually)d(need)i(to)h(act)h +(on)e(the)h(con)m(ten)m(ts)h(of)f(this)e(structure,)j(some)f(of)g(the) +94 4290 y(functions)25 b(in)f(the)i(library)d(receiv)m(e)k(argumen)m +(ts)e(that)i(are)f(directly)e(related)i(to)g(one)g(or)g(more)f(of)h +(these)g(\014elds.)94 4524 y Fk(2.1)69 b(The)44 b(Fields)94 +4715 y Fj(int)30 b(flags;)574 4815 y Fl(The)42 b(\015ags)g(are,)j(as)d +(y)m(ou)g(ma)m(y)g(susp)s(ect,)j(mean)m(t)d(to)h(sp)s(ecify)d(the)i +(exact)h(b)s(eha)m(viour)e(of)h(the)574 4914 y(library)-8 +b(.)37 b(They)22 b(are)h(often)h(passed)e(as)h(an)g(argumen)m(t)g(to)h +Fg(b)-5 b(ar)g(c)g(o)g(de)32 b Fl(functions)21 b(and)i(are)g(discussed) +574 5014 y(in)30 b(the)g(next)h(section.)94 5147 y Fj(char)f(*ascii;)94 +5247 y(char)g(*partial;)94 5347 y(char)g(*textinfo;)94 +5446 y(char)g(*encoding;)574 5546 y Fl(These)41 b(\014elds)f(are)h(in)m +(ternally)e(managed)i(b)m(y)g(the)h(library)-8 b(,)41 +b(and)g(y)m(ou)g(are)h(not)f(exp)s(ected)g(to)574 5645 +y(touc)m(h)31 b(them)g(if)e(y)m(ou)i(use)f(the)h(pro)m(vided)d(API.)j +(All)e(of)h(them)h(are)g(allo)s(cated)f(with)f Fg(mal)5 +b(lo)-5 b(c)p Fl(.)p eop +%%Page: 2 3 +2 2 bop 94 -116 a Fl(Chapter)30 b(2:)41 b(The)30 b(Underlying)e(Data)k +(Structure)2012 b(2)94 365 y Fj(int)30 b(width;)94 465 +y(int)g(height;)574 565 y Fl(They)i(sp)s(ecify)e(the)i(width)d(and)i +(heigh)m(t)h(of)g(the)f Fg(active)39 b Fl(barco)s(de)31 +b(region)g(\(i.e.,)i(excluding)d(the)574 664 y(white)21 +b(margin\),)i(in)d(the)i(units)e(used)h(to)h(create)i(output)d(data)h +(\(for)g(p)s(ostscript)e(they)i(are)g(p)s(oin)m(ts,)574 +764 y(1/72th)33 b(of)d(an)g(inc)m(h,)g(0.352)j(mm\).)40 +b(The)30 b(\014elds)f(can)i(b)s(e)f(either)g(assigned)f(to)j(in)d(the)h +(structure)574 863 y(or)37 b(via)e Fg(Bar)-5 b(c)g(o)g(de)p +1161 863 28 4 v 36 w(Position\(\))p Fl(,)39 b(at)e(y)m(our)f(c)m +(hoice.)59 b(If)35 b(either)h(v)-5 b(alue)35 b(or)h(b)s(oth)g(are)g +(left)g(to)h(their)574 963 y(default)c(v)-5 b(alue)33 +b(of)g(zero,)i(the)e(output)g(engine)g(will)d(assign)j(default)f(v)-5 +b(alues)33 b(according)g(to)h(the)574 1063 y(sp)s(eci\014ed)g(scaling)f +(factor.)55 b(If)35 b(the)g(sp)s(eci\014ed)e(width)g(is)h(bigger)g +(than)h(needed)f(\(according)h(to)574 1162 y(the)g(scaling)f(factor\),) +j(the)d(output)g(barco)s(de)h(will)c(b)s(e)j(cen)m(tered)i(in)d(its)h +(requested)g(region.)52 b(If)574 1262 y(either)27 b(the)h(width)d(of)i +(the)h(heigh)m(t)f(are)h(to)s(o)g(small)d(for)i(the)h(sp)s(eci\014ed)d +(scale)j(factor,)h(the)e(output)574 1362 y(bar)j(co)s(de)h(will)d +(expand)h(symmetrically)g(around)g(the)i(requested)f(region.)94 +1513 y Fj(int)g(xoff;)94 1612 y(int)g(yoff;)574 1738 +y Fl(The)53 b(\014elds)f(sp)s(ecify)g(o\013set)j(from)e(the)g(co)s +(ordinate)h(origin)e(of)h(the)h(output)f(engine)g(\(for)574 +1838 y(p)s(ostscript,)46 b(p)s(osition)c(0,0)i(is)f(the)g(lo)m(w)m(er)h +(left)f(corner)h(of)f(the)h(page\).)81 b(The)43 b(\014elds)f(can)i(b)s +(e)574 1937 y(either)36 b(assigned)e(to)j(in)d(the)i(structure)f(or)g +(via)g Fg(Bar)-5 b(c)g(o)g(de)p 2572 1937 V 36 w(Position\(\))p +Fl(,)39 b(at)d(y)m(our)f(c)m(hoice.)57 b(The)574 2037 +y(o\013set)24 b(sp)s(eci\014es)d(where)h(the)g(white)g(margin)f(b)s +(egins,)h(not)h(where)f(the)g(\014rst)g(bar)g(will)d(b)s(e)j(prin)m +(ted.)574 2136 y(T)-8 b(o)31 b(prin)m(t)e(real)h(ink)f(to)j(the)e(sp)s +(eci\014ed)f(p)s(osition)f(y)m(ou)j(should)d(set)j Fg(mar)-5 +b(gin)39 b Fl(to)31 b(0.)94 2288 y Fj(int)f(margin;)574 +2387 y Fl(The)36 b(white)g(margin)f(that)j(will)33 b(b)s(e)j(left)g +(around)g(the)h(prin)m(ted)e(area)i(of)g(the)f(bar)g(co)s(de.)59 +b(The)574 2487 y(same)37 b(margin)e(is)g(applied)f(to)j(all)e(sides)g +(of)h(the)g(prin)m(ted)f(area.)59 b(The)35 b(default)g(v)-5 +b(alue)36 b(for)g(the)574 2587 y(margin)30 b(is)f(de\014ned)g(in)g(`)p +Fj(barcode.h)p Fl(')g(as)h Fj(BARCODE_DEFAULT_MARGIN)25 +b Fl(\(10\).)94 2738 y Fj(double)k(scalef;)574 2837 y +Fl(The)j(enlarge)f(or)h(shrink)d(v)-5 b(alue)31 b(for)g(the)h(bar)f(co) +s(de)h(o)m(v)m(er)h(its)e(default)g(dimension.)42 b(The)31 +b Fg(width)574 2937 y Fl(and)j Fg(sc)-5 b(alef)54 b Fl(\014elds)33 +b(in)m(teract)h(deeply)f(in)g(the)h(creation)h(of)f(the)g(output,)h +(and)f(a)g(complete)h(de-)574 3037 y(scription)29 b(of)i(the)f(issues)f +(app)s(ears)h(later)g(in)f(this)g(section.)94 3188 y +Fj(int)h(error;)574 3288 y Fl(The)g(\014eld)f(is)h(used)f(when)h(a)g +Fg(b)-5 b(ar)g(c)g(o)g(de)40 b Fl(function)29 b(fails)g(to)i(host)g(an) +f Fj(errno)p Fl(-lik)m(e)f(in)m(teger)h(v)-5 b(alue.)94 +3515 y Ff(Use)42 b(of)f(the)g Fe(width)50 b Ff(and)41 +b Fe(sc)-6 b(alef)64 b Ff(\014elds.)219 3700 y Fl(A)29 +b(width)f(unit)f(is)h(the)i(width)d(of)i(the)h(thinnest)d(bar)i(and/or) +g(space)h(in)d(the)j(c)m(hosen)f(co)s(de;)h(it)f(defaults)f(to)94 +3800 y(1)j(p)s(oin)m(t)f(if)f(the)i(output)e(is)h(p)s(ostscript)f(or)h +(encapsulated)g(p)s(ostscript.)219 3926 y(Either)j(or)h(b)s(oth)g(the)g +(co)s(de)h(width)d(and)i(the)g(scale)h(factor)g(can)g(b)s(e)e(left)h +(unsp)s(eci\014ed)e(\(i.e.,)k(zero\).)53 b(The)94 4026 +y(library)28 b(deals)i(with)f(defaults)h(in)f(the)h(follo)m(wing)f(w)m +(a)m(y:)94 4178 y Fg(Both)34 b(unsp)-5 b(e)g(ci\014e)g(d)574 +4277 y Fl(If)26 b(b)s(oth)f(the)h(width)e(and)h(the)h(scale)g(factor)g +(are)g(unsp)s(eci\014ed,)f(the)h(scale)g(factor)g(will)d(default)i(to) +574 4377 y(1.0)31 b(and)e(the)h(width)e(is)g(calculated)i(according)f +(to)i(the)e(actual)h(width)e(of)i(the)g(bar)f(co)s(de)g(b)s(eing)574 +4477 y(prin)m(ted.)94 4628 y Fg(Width)34 b(unsp)-5 b(e)g(ci\014e)g(d) +574 4728 y Fl(If)30 b(the)h(width)e(is)g(not)i(sp)s(eci\014ed,)d(it)i +(is)g(calculated)g(according)g(to)i(the)e(v)-5 b(alues)30 +b(of)g Fg(sc)-5 b(alef)p Fl(.)94 4879 y Fg(Sc)g(ale)34 +b(factor)f(unsp)-5 b(e)g(ci\014e)g(d)574 4978 y Fl(If)32 +b(the)h(scale)f(factor)i(is)d(not)i(sp)s(eci\014ed,)e(it)h(will)d(b)s +(e)j(c)m(hosen)h(so)f(that)h(the)g(generated)g(bar)f(co)s(de)574 +5078 y(exactly)g(\014ts)e(the)g(sp)s(eci\014ed)f(width.)94 +5229 y Fg(Both)34 b(sp)-5 b(e)g(ci\014e)g(d)574 5329 +y Fl(The)31 b(co)s(de)g(will)d(b)s(e)i(prin)m(ted)g(inside)e(the)j(sp)s +(eci\014ed)f(region)g(according)h(to)g(the)g(sp)s(eci\014ed)f(scale)574 +5429 y(factor.)48 b(It)33 b(will)d(b)s(e)h(aligned)h(to)h(the)f(left.) +47 b(If,)33 b(ho)m(w)m(ev)m(er,)h(the)f(c)m(hosen)g(width)e(is)g(to)s +(o)i(small)e(for)574 5528 y(the)f(sp)s(eci\014c)e(bar)h(co)s(de)h(and)e +(scaling)h(factor,)h(then)f(the)h(co)s(de)g(will)c(extend)k +(symmetrically)d(to)574 5628 y(the)k(left)f(and)g(to)h(the)g(righ)m(t)f +(of)g(the)h(c)m(hosen)g(region.)p eop +%%Page: 3 4 +3 3 bop 94 -116 a Fl(Chapter)30 b(3:)41 b(The)30 b(Flags)2872 +b(3)94 365 y Fk(2.2)69 b(The)44 b(In)l(termediate)j(Represen)l(tation) +219 565 y Fl(The)23 b(enco)s(ding)g(functions)f(prin)m(t)g(their)g +(output)h(in)m(to)h(the)g Fj(partial)d Fl(and)i Fj(texinfo)f +Fl(\014elds)g(of)h(the)h(barco)s(de)94 664 y(data)g(structure.)37 +b(Those)23 b(\014elds,)g(together)h(with)d(p)s(osition)g(information,)h +(are)h(then)f(used)g(to)i(generate)g(actual)94 764 y(output.)41 +b(This)28 b(is)i(an)g(informal)e(description)h(of)h(the)h(in)m +(termediate)f(format.)219 905 y(The)38 b(\014rst)g(c)m(har)h(in)f +Fj(partial)f Fl(tells)g(ho)m(w)i(m)m(uc)m(h)g(extra)g(space)h(to)f(add) +f(to)i(the)f(left)f(of)h(the)g(bars.)65 b(F)-8 b(or)94 +1005 y(EAN-13,)33 b(it)d(is)f(used)h(to)h(lea)m(v)m(e)h(space)f(to)g +(prin)m(t)e(the)i(\014rst)f(digit,)f(other)i(co)s(des)f(ma)m(y)h(ha)m +(v)m(e)h('0')f(for)g(no-extra-)94 1104 y(space-needed.)219 +1245 y(The)23 b(next)h(c)m(haracters)i(are)e(alternating)f(bars)g(and)h +(spaces,)h(as)g(m)m(ultiples)c(of)j(the)g(base)g(dimension)d(whic)m(h) +94 1345 y(is)35 b(1)g(unless)f(the)i(co)s(de)f(is)f(rescaled.)56 +b(Rescaling)34 b(is)h(calculated)g(as)g(the)h(ratio)f(from)g(the)h +(requested)f(width)94 1445 y(and)e(the)h(calculated)f(width.)48 +b(Digits)33 b(represen)m(t)g(bar/space)h(dimensions.)47 +b(Lo)m(w)m(er-case)35 b(letters)f(represen)m(t)94 1544 +y(those)d(bars)f(that)h(should)e(extend)i(lo)m(w)m(er)f(than)h(the)f +(others:)41 b('a')32 b(is)d(equiv)-5 b(alen)m(t)30 b(to)h('1',)h('b')f +(is)e('2')i(and)f(so)h(on)94 1644 y(up)e(to)h('i')g(whic)m(h)e(is)g +(equiv)-5 b(alen)m(t)29 b(to)i('9'.)41 b(Other)29 b(letters)h(will)d(b) +s(e)i(used)g(for)g(enco)s(ding-sp)s(eci\014c)f(meanings,)h(as)94 +1743 y(so)s(on)i(as)f(I)g(implemen)m(t)f(them.)219 1885 +y(The)35 b Fj(textinfo)e Fl(string)h(is)h(made)g(up)f(of)i(\014elds)e +Fj(\045lf:\045lf:\045c)e Fl(separated)k(b)m(y)g(blank)e(space.)56 +b(The)35 b(\014rst)94 1984 y(in)m(teger)f(is)e(the)h(x)g(p)s(osition)e +(of)i(the)h(c)m(haracter,)h(the)e(second)g(is)f(the)i(fon)m(t)f(size)g +(\(b)s(efore)g(rescaling\))f(and)h(the)94 2084 y(c)m(har)e(item)f(is)g +(the)g(c)m(haracter)i(to)f(b)s(e)f(prin)m(ted.)219 2225 +y(Both)39 b(the)g Fj(partial)d Fl(and)i Fj(textinfo)f +Fl(strings)g(ma)m(y)i(include)d(\\)p Fj(-)p Fl(")j(or)g(\\)p +Fj(+)p Fl(")g(as)g(sp)s(ecial)e(c)m(haracters)j(\(in)94 +2325 y Fj(textinfo)25 b Fl(the)j(c)m(har)f(should)e(b)s(e)i(a)g +(stand-alone)g(w)m(ord\).)40 b(They)26 b(state)j(where)d(the)i(text)g +(should)d(b)s(e)h(prin)m(ted:)94 2424 y(b)s(elo)m(w)34 +b(the)g(bars)f(\(\\)p Fj(-)p Fl(",)j(default\))e(or)g(ab)s(o)m(v)m(e)h +(the)f(bars.)51 b(This)32 b(is)h(used,)i(for)e(example,)i(to)g(prin)m +(t)e(the)h(add-5)94 2524 y(and)27 b(add-2)g(co)s(des)g(to)h(the)f(righ) +m(t)f(of)i(UPC)e(or)h(EAN)g(co)s(des)g(\(the)h(add-5)f(extension)g(is)f +(mostly)g(used)g(in)g(ISBN)94 2623 y(co)s(des\).)94 2939 +y Fi(3)81 b(The)53 b(Flags)219 3213 y Fl(The)30 b(follo)m(wing)f +(\015ags)h(are)h(supp)s(orted)e(b)m(y)h(v)m(ersion)g(0.98)i(of)e(the)h +(library:)94 3387 y Fj(BARCODE_ENCODING_MASK)574 3487 +y Fl(The)f(mask)h(is)e(used)h(to)h(extract)h(the)e(enco)s(ding-t)m(yp)s +(e)g(iden)m(ti\014er)f(from)h(the)g Fg(\015ags)39 b Fl(\014eld.)94 +3653 y Fj(BARCODE_EAN)94 3753 y(BARCODE_UPC)94 3852 y(BARCODE_ISBN)94 +3952 y(BARCODE_128B)94 4051 y(BARCODE_128C)94 4151 y(BARCODE_128)94 +4251 y(BARCODE_128RAW)94 4350 y(BARCODE_39)94 4450 y(BARCODE_I25)94 +4550 y(BARCODE_CBR)94 4649 y(BARCODE_MSI)94 4749 y(BARCODE_PLS)94 +4848 y(BARCODE_93)574 4948 y Fl(The)d(curren)m(tly)f(supp)s(orted)g +(enco)s(ding)g(t)m(yp)s(es:)52 b(EAN)36 b(\(13)i(digits,)e(8)h(digits,) +f(13)h Fj(+)f Fl(2)g(add-on)574 5048 y(and)26 b(13)i +Fj(+)e Fl(5)h(add-on\),)g(UPC)f(\(UPC-A,)i(UPC-E,)e(UPC-A)h(with)e(2)i +(or)f(5)h(digit)f(add-on\),)h(ISBN)574 5147 y(\(with)e(or)f(without)g +(the)i(5-digit)e(add-on\),)i(CODE128-B)h(\(the)e(whole)g(set)g(of)g +(prin)m(table)e(ASCI)s(I)574 5247 y(c)m(haracters\),)36 +b(CODE128-C)d(\(t)m(w)m(o)i(digits)c(enco)s(ded)h(b)m(y)h(eac)m(h)h +(barco)s(de)e(sym)m(b)s(ol\),)h(CODE128)574 5347 y(\(all)41 +b(ASCI)s(I)f(v)-5 b(alues\),)44 b(a)e(\\ra)m(w-input")f(pseudo-co)s(de) +h(that)g(generates)h(CODE128)f(output,)574 5446 y(CODE39)32 +b(\(alphan)m(umeric\),)e Fj(")p Fl(in)m(terlea)m(v)m(ed)i(2)f(of)h(5)p +Fj(")f Fl(\(n)m(umeric\),)g(Co)s(dabar)f(\(n)m(umeric)g(plus)g(a)574 +5546 y(few)36 b(sym)m(b)s(ols\),)g(MSI)f(\(n)m(umeric\))g(and)g +(Plessey)g(\(hex)g(digits\).)55 b(See)36 b(Chapter)f(6)h([Supp)s(orted) +574 5645 y(Enco)s(dings],)30 b(page)h(7.)p eop +%%Page: 4 5 +4 4 bop 94 -116 a Fl(Chapter)30 b(4:)41 b(F)-8 b(unctions)30 +b(Exp)s(orted)g(b)m(y)g(the)h(Library)1871 b(4)94 365 +y Fj(BARCODE_ANY)574 465 y Fl(This)27 b(sp)s(ecial)g(enco)s(ding)g(t)m +(yp)s(e)h(\(represen)m(ted)h(b)m(y)f(a)h(v)-5 b(alue)27 +b(of)i(zero,)h(so)e(it)g(will)d(b)s(e)j(the)g(default\))574 +565 y(tells)33 b(the)g(enco)s(ding)f(pro)s(cedure)g(to)h(lo)s(ok)g(for) +g(the)g(\014rst)f(enco)s(ding)g(t)m(yp)s(e)i(that)f(can)h(deal)e(with) +574 664 y(a)44 b(textual)f(string.)77 b(Therefore,)46 +b(a)d(11-digit)f(co)s(de)h(will)e(b)s(e)h(prin)m(ted)f(as)i(UPC)g(\(as) +g(w)m(ell)f(as)574 764 y(6-digit,)48 b(11)p Fj(+)p Fl(2)e(and)e(11)p +Fj(+)p Fl(5\),)49 b(a)c(12-digit)g(\(or)g(7-digit,)i(or)e(12)p +Fj(+)p Fl(2)h(or)e(12)p Fj(+)p Fl(5\))i(as)f(EAN13,)k(an)574 +863 y(ISBN)39 b(co)s(de)f(\(with)g(or)g(without)f(h)m(yphens,)i(with)e +(or)i(without)e(add-5\))i(will)d(b)s(e)h(enco)s(ded)h(in)574 +963 y(its)e(EAN13)i(represen)m(tation,)g(an)e(ev)m(en)h(n)m(um)m(b)s +(er)e(of)i(digits)e(is)g(enco)s(ded)h(using)f(CODE128C)574 +1063 y(and)45 b(a)h(generic)f(string)f(is)h(enco)s(ded)g(using)f +(CODE128B.)j(Since)d(co)s(de-39)j(o\013ers)e(a)h(m)m(uc)m(h)574 +1162 y(larger)38 b(represen)m(tation)f(for)h(the)f(same)h(text)h +(string,)f(co)s(de128-b)h(is)e(preferred)f(o)m(v)m(er)j(co)s(de39)574 +1262 y(for)31 b(alphan)m(umeric)d(strings.)94 1411 y +Fj(BARCODE_NO_ASCII)574 1510 y Fl(Instructs)f(the)h(engine)e(not)i(to)g +(prin)m(t)e(the)i(ascii)e(string)h(on)g(output.)39 b(By)28 +b(default)e(the)i(bar)f(co)s(de)574 1610 y(is)j(accompanied)g(with)f +(an)i(ascii)e(v)m(ersion)h(of)h(the)f(text)i(it)d(enco)s(des.)94 +1759 y Fj(BARCODE_NO_CHECKSUM)574 1858 y Fl(Instructs)j(the)h(engine)f +(not)h(to)g(add)f(the)h(c)m(hec)m(ksum)g(c)m(haracter)h(to)f(the)g +(output.)47 b(Not)33 b(all)f(the)574 1958 y(enco)s(ding)23 +b(t)m(yp)s(es)g(can)h(drop)f(the)h(c)m(hec)m(ksum;)i(those)e(where)f +(the)h(c)m(hec)m(ksum)g(is)f(mandatory)g(\(lik)m(e)574 +2058 y(EAN)31 b(and)f(UPC\))g(just)g(ignore)g(the)h(\015ag.)94 +2206 y Fj(BARCODE_OUTPUT_MASK)574 2306 y Fl(The)f(mask)h(is)e(used)h +(to)h(extract)h(the)e(output-t)m(yp)s(e)h(iden)m(ti\014er)d(from)i(the) +h Fg(\015ags)38 b Fl(\014eld.)94 2455 y Fj(BARCODE_OUT_PS)94 +2554 y(BARCODE_OUT_EPS)94 2654 y(BARCODE_OUT_PCL)94 2753 +y(BARCODE_OUT_PCL_III)574 2853 y Fl(The)48 b(curren)m(tly)f(supp)s +(orted)f(enco)s(ding)g(t)m(yp)s(es:)76 b(full-page)47 +b(p)s(ostscript)f(and)h(encapsulated)574 2953 y(p)s(ostscript;)h(PCL)41 +b(\(prin)m(t)g(command)i(language,)j(for)c(HP)g(prin)m(ters\))f(and)h +(PCL-I)s(I)s(I)e(\(same)574 3052 y(as)31 b(PCL,)f(but)g(uses)g(a)g(fon) +m(t)h(not)g(a)m(v)-5 b(ailable)30 b(on)g(older)f(prin)m(ters\).)94 +3201 y Fj(BARCODE_OUT_NOHEADERS)574 3301 y Fl(The)f(\015ag)h(instructs) +d(the)j(prin)m(ting)d(engine)h(not)i(to)f(prin)m(t)f(the)h(header)g +(and)g(fo)s(oter)h(part)e(of)i(the)574 3400 y(\014le.)40 +b(This)29 b(mak)m(es)i(sense)f(for)f(the)i(p)s(ostscript)d(engine)i +(but)f(migh)m(t)h(not)h(mak)m(e)g(sense)f(for)g(other)574 +3500 y(engines;)k(suc)m(h)f(other)h(engines)e(will)e(silen)m(tly)i +(ignore)g(the)i(\015ag)f(just)g(lik)m(e)f(the)h(PCL)f(bac)m(k-end)574 +3600 y(do)s(es.)94 3881 y Fi(4)81 b(F)-13 b(unctions)52 +b(Exp)t(orted)h(b)l(y)g(the)g(Library)219 4103 y Fl(The)41 +b(functions)f(included)f(in)h(the)i(barco)s(de)f(library)e(are)j +(declared)f(in)g(the)g(header)h(\014le)e Fj(barcode.h)p +Fl(.)94 4203 y(They)30 b(p)s(erform)f(the)i(follo)m(wing)e(tasks:)94 +4352 y Fj(struct)g(Barcode_Item)e(*Barcode_Create\(char)e(*text\);)574 +4451 y Fl(The)35 b(function)e(creates)j(a)f(new)g(barco)s(de)f(ob)5 +b(ject)36 b(to)f(deal)g(with)e(a)i(sp)s(eci\014ed)e(text)j(string.)53 +b(It)574 4551 y(returns)27 b(NULL)h(in)e(case)j(of)f(failure)e(and)i(a) +g(p)s(oin)m(ter)f(to)h(a)h(barco)s(de)e(data)i(structure)e(in)g(case)i +(of)574 4651 y(success.)94 4799 y Fj(int)h(Barcode_Delete\(struct)25 +b(Barcode_Item)i(*bc\);)574 4899 y Fl(Destro)m(y)32 b(a)f(barco)s(de)f +(ob)5 b(ject.)42 b(Alw)m(a)m(ys)31 b(returns)e(0)h(\(success\))94 +5048 y Fj(int)g(Barcode_Encode\(struct)25 b(Barcode_Item)i(*bc,)i(int)g +(flags\);)574 5147 y Fl(Enco)s(de)h(the)h(text)g(included)d(in)h(the)h +Fg(b)-5 b(c)35 b Fl(ob)5 b(ject.)42 b(V)-8 b(alid)29 +b(\015ags)i(are)f(the)h(enco)s(ding)e(t)m(yp)s(e)h(\(other)574 +5247 y(\015ags)45 b(are)f(ignored\))g(and)g(BAR)m(CODE)p +1994 5247 28 4 v 33 w(NO)p 2166 5247 V 33 w(CHECKSUM)f(\(other)i +(\015ags)f(are)h(silen)m(tly)d(ig-)574 5347 y(nored\);)35 +b(if)e(the)g(\015ag)h(argumen)m(t)g(is)e(zero,)j Fj(bc->flags)c +Fl(will)g(apply)-8 b(.)49 b(The)32 b(function)g(returns)h(0)574 +5446 y(on)h(success)g(and)f(-1)i(in)d(case)j(of)f(error.)51 +b(After)34 b(successful)e(termination)h(the)h(data)g(structure)574 +5546 y(will)21 b(host)i(the)h(description)d(of)j(the)f(bar)g(co)s(de)g +(and)g(its)g(textual)g(represen)m(tation,)i(after)f(a)g(failure)574 +5645 y(the)31 b Fj(error)e Fl(\014eld)g(will)f(include)g(the)i(reason)h +(of)f(the)h(failure.)p eop +%%Page: 5 6 +5 5 bop 94 -116 a Fl(Chapter)30 b(5:)41 b(The)30 b Fg(b)-5 +b(ar)g(c)g(o)g(de)40 b Fl(fron)m(tend)30 b(program)2063 +b(5)94 365 y Fj(int)30 b(Barcode_Print\(struct)25 b(Barcode_Item)i +(*bc,)i(FILE)g(*f,)h(int)f(flags\);)574 465 y Fl(Prin)m(t)39 +b(the)g(bar)g(co)s(de)g(describ)s(ed)e(b)m(y)i Fj(bc)g +Fl(to)h(the)f(sp)s(eci\014ed)f(\014le.)66 b(V)-8 b(alid)38 +b(\015ags)h(are)h(the)f(out-)574 565 y(put)25 b(t)m(yp)s(e,)h +Fj(BARCODE_NO_ASCII)21 b Fl(and)j Fj(BARCODE_OUT_NOHEADERS)p +Fl(,)d(other)k(\015ags)g(are)h(ignored.)574 664 y(If)39 +b(an)m(y)h(of)f(these)h(\015ags)g(is)e(zero,)43 b(it)c(will)d(b)s(e)j +(inherited)e(from)i Fj(bc->flags)d Fl(whic)m(h)i(therefore)574 +764 y(tak)m(es)f(precedence.)57 b(The)35 b(function)g(returns)f(0)i(on) +f(success)h(and)f(-1)h(in)e(case)j(of)f(error)f(\(with)574 +863 y Fj(bc->error)28 b Fl(set)j(accordingly\).)40 b(In)29 +b(case)j(of)e(success,)h(the)f(bar)g(co)s(de)g(is)f(prin)m(ted)g(to)i +(the)f(sp)s(ec-)574 963 y(i\014ed)f(\014le,)h(whic)m(h)f(w)m(on't)i(b)s +(e)f(closed)g(after)h(use.)94 1115 y Fj(int)f(Barcode_Position\(struct) +24 b(Barcode_Item)j(*bc,)i(int)h(wid,)f(int)g(hei,)h(int)f(xoff,)g(int) +h(yoff,)94 1215 y(double)f(scalef\);)574 1315 y Fl(The)h(function)f(is) +h(a)h(shortcut)f(to)h(assign)f(v)-5 b(alues)29 b(to)j(the)e(data)h +(structure.)94 1467 y Fj(int)f(Barcode_Encode_and_Print)o(\(cha)o(r)24 +b(*text,)29 b(FILE)g(*f,)h(int)f(wid,)g(int)h(hei,)f(int)h(xoff,)f(int) +94 1567 y(yoff,)g(int)h(flags\);)574 1666 y Fl(The)38 +b(function)e(deals)h(with)g(the)h(whole)f(life)f(of)i(the)g(barco)s(de) +g(ob)5 b(ject)39 b(b)m(y)e(calling)g(the)h(other)574 +1766 y(functions;)30 b(it)g(uses)g(all)f(the)h(sp)s(eci\014ed)f +(\015ags.)94 1918 y Fj(int)h(Barcode_Version\(char)25 +b(*versionname\);)574 2018 y Fl(Returns)g(the)g(curren)m(t)f(v)m +(ersion)h(as)g(an)g(in)m(teger)g(n)m(um)m(b)s(er)f(of)h(the)g(form)f +(ma)5 b(jor)25 b(*)h(10000)h Fj(+)d Fl(minor)574 2118 +y(*)k(100)h Fj(+)e Fl(release.)40 b(Therefore,)28 b(v)m(ersion)f +(1.03.5)i(will)c(b)s(e)i(returned)f(as)h(10305)j(and)d(v)m(ersion)f +(0.53)574 2217 y(as)i(5300.)41 b(If)27 b(the)h(argumen)m(t)f(is)f +(non-n)m(ull,)g(it)h(will)e(b)s(e)h(used)h(to)h(return)e(the)h(v)m +(ersion)g(n)m(um)m(b)s(er)f(as)574 2317 y(a)h(string.)39 +b(Note)28 b(that)f(the)f(same)h(information)e(is)h(a)m(v)-5 +b(ailable)26 b(from)g(t)m(w)m(o)i(prepro)s(cessor)d(macros:)574 +2416 y Fj(BARCODE_VERSION)i Fl(\(the)k(string\))e(and)h +Fj(BARCODE_VERSION_INT)25 b Fl(\(the)31 b(in)m(teger)g(n)m(um)m(b)s +(er\).)94 2705 y Fi(5)81 b(The)53 b Fd(b)-8 b(ar)g(c)g(o)g(de)65 +b Fi(fron)l(tend)51 b(program)219 2938 y Fl(The)26 b +Fc(barco)s(de)g Fl(program)g(is)f(a)h(fron)m(t-end)g(to)h(access)h +(some)e(features)h(of)f(the)g(library)e(from)i(the)g(command)94 +3037 y(line.)63 b(It)38 b(is)g(able)f(to)i(read)f(user)g(supplied)d +(strings)i(from)h(the)g(command)g(line)e(or)j(a)f(data)h(\014le)e +(\(standard)94 3137 y(input)29 b(b)m(y)h(default\))g(and)g(enco)s(de)g +(all)g(of)g(them.)94 3401 y Fk(5.1)69 b(The)44 b(Command)h(Line)219 +3587 y Fc(barco)s(de)30 b Fl(accepts)i(the)e(follo)m(wing)f(options:)94 +3741 y Fj(--help)g(or)h(-h)574 3840 y Fl(Prin)m(t)g(a)h(usage)g +(summary)e(and)h(exit.)94 3993 y Fj(-i)g(filename)574 +4092 y Fl(Iden)m(tify)35 b(a)h(\014le)f(where)g(strings)f(to)j(b)s(e)e +(enco)s(ded)g(are)h(read)f(from.)56 b(If)36 b(missing)d(\(and)i(if)g +Fj(-b)g Fl(is)574 4192 y(not)29 b(used\))f(it)g(defaults)f(to)i +(standard)e(input.)38 b(Eac)m(h)29 b(data)g(line)e(of)h(the)h(input)d +(\014le)i(will)d(b)s(e)j(used)574 4292 y(to)k(create)g(one)e(barco)s +(de)g(output.)94 4444 y Fj(-o)g(filename)574 4544 y Fl(Output)g +(\014le.)40 b(It)30 b(defaults)f(to)j(standard)d(output.)94 +4696 y Fj(-b)h(string)66 b Fl(Sp)s(ecify)32 b(a)j(single)d(\\barco)s +(de")i(string)f(to)h(b)s(e)g(enco)s(ded.)50 b(The)33 +b(option)g(can)h(b)s(e)f(used)g(m)m(ultiple)574 4796 +y(times)j(in)e(order)h(to)h(enco)s(de)g(m)m(ultiple)d(strings)i(\(this) +f(will)f(result)i(in)f(m)m(ulti-page)h(p)s(ostscript)574 +4895 y(output)22 b(or)g(a)g(table)g(of)g(barco)s(des)g(if)f +Fj(-t)g Fl(is)g(sp)s(eci\014ed\).)37 b(The)21 b(strings)g(m)m(ust)h +(matc)m(h)h(the)f(enco)s(ding)574 4995 y(c)m(hosen;)29 +b(if)c(it)g(do)s(esn't)h(matc)m(h)h(the)f(program)g(will)d(prin)m(t)i +(a)h(w)m(arning)f(to)i Fj(stderr)d Fl(and)h(generate)574 +5095 y(\\blank")44 b(output)g(\(although)h(not)f(zero-length\).)84 +b(Please)44 b(note)h(that)g(a)g(string)e(including)574 +5194 y(spaces)31 b(or)g(other)f(sp)s(ecial)f(c)m(haracters)j(m)m(ust)e +(b)s(e)g(prop)s(erly)e(quoted.)94 5347 y Fj(-e)i(encoding)574 +5446 y Fc(enco)s(ding)j Fl(is)e(the)i(name)f(of)h(the)g(c)m(hosen)g +(enco)s(ding)e(format)i(b)s(eing)e(used.)46 b(It)32 b(defaults)g(to)h +(the)574 5546 y(v)-5 b(alue)41 b(of)f(the)h(en)m(vironmen)m(t)g(v)-5 +b(ariable)39 b Fj(BARCODE_ENCODING)d Fl(or)41 b(to)g(auto)h(detection)f +(if)f(the)574 5645 y(en)m(vironmen)m(t)30 b(is)g(also)g(unset.)p +eop +%%Page: 6 7 +6 6 bop 94 -116 a Fl(Chapter)30 b(6:)41 b(Supp)s(orted)29 +b(Enco)s(dings)2417 b(6)94 365 y Fj(-g)30 b(geometry)574 +465 y Fl(The)e(geometry)g(argumen)m(t)g(is)f(of)h(the)f(form)g(\\[)p +Fj(<)p Fg(width)p Fj(>)i(x)f(<)p Fg(height)p Fj(>)p Fl(])f([)p +Fj(+)h(<)p Fg(xmar)-5 b(gin)p Fj(>)28 b(+)f(<)p Fg(ymar-)574 +565 y(gin)p Fj(>)p Fl(]")42 b(\(with)f(no)h(in)m(terv)m(ening)f +(spaces\).)75 b(Unsp)s(eci\014ed)40 b(margin)h(v)-5 b(alues)41 +b(will)e(result)i(in)f(no)574 664 y(margin;)31 b(unsp)s(eci\014ed)d +(size)j(results)e(in)h(default)g(size.)42 b(The)30 b(sp)s(eci\014ed)f +(v)-5 b(alues)30 b(represen)m(t)h(prin)m(t)574 764 y(p)s(oin)m(ts)e(b)m +(y)g(default,)g(and)g(can)g(b)s(e)g(inc)m(hes,)g(millimeters)e(or)i +(other)h(units)e(according)h(to)h(the)g Fj(-u)574 863 +y Fl(option)j(or)h(the)g Fj(BARCODE_UNIT)c Fl(en)m(vironmen)m(t)j(v)-5 +b(ariable.)49 b(The)33 b(argumen)m(t)h(is)e(used)h(to)h(place)574 +963 y(the)g(prin)m(tout)f(co)s(de)h(on)f(the)h(page.)51 +b(Note)35 b(that)f(an)f(additional)f(white)g(margin)h(of)h(10)g(p)s +(oin)m(ts)574 1063 y(is)e(added)f(to)i(the)g(prin)m(tout.)45 +b(If)31 b(the)i(option)f(is)f(unsp)s(eci\014ed,)f Fj(BARCODE_GEOMETRY)e +Fl(is)j(lo)s(ok)m(ed)574 1162 y(up)h(in)f(the)h(en)m(vironmen)m(t,)h +(if)e(missing)f(a)j(default)f(size)g(and)g(no)g(margin)f(\(but)h(the)h +(default)e(10)574 1262 y(p)s(oin)m(ts\))f(are)h(used.)94 +1409 y Fj(-t)f(table-geometry)574 1508 y Fl(Used)j(to)g(prin)m(t)e(sev) +m(eral)i(barco)s(des)f(to)i(a)f(single)e(page,)j(this)d(option)h(is)g +(mean)m(t)h(to)h(b)s(e)d(used)h(to)574 1608 y(prin)m(t)e(stic)m(k)m +(ers.)43 b(The)30 b(argumen)m(t)h(is)f(of)h(the)g(form)g(\\)p +Fj(<)p Fg(c)-5 b(olumns)p Fj(>)32 b(x)e(<)p Fg(lines)p +Fj(>)h Fl([)p Fj(+)g(<)p Fg(leftmar)-5 b(gin)p Fj(>)31 +b(+)574 1707 y(<)p Fg(b)-5 b(ottommar)g(gin)p Fj(>)39 +b Fl([)p Fj(-)d(<)p Fg(rightmar)-5 b(gin)p Fj(>)38 b +Fl([)p Fj(-)e(<)p Fg(topmar)-5 b(gin)p Fj(>)p Fl(]]]")39 +b(\(with)c(no)h(in)m(terv)m(ening)f(spaces\);)574 1807 +y(if)42 b(missing,)i(the)f(top)g(and)f(righ)m(t)g(margin)g(will)e +(default)i(to)i(b)s(e)e(the)h(same)g(as)g(the)g(b)s(ottom)574 +1907 y(and)c(left)g(margin.)66 b(The)38 b(margins)g(are)i(sp)s +(eci\014ed)d(in)h(prin)m(t)g(p)s(oin)m(ts)g(or)h(in)e(the)j(c)m(hosen)f +(unit)574 2006 y(\(see)f Fj(-u)d Fl(b)s(elo)m(w\).)59 +b(If)35 b(the)i(option)f(is)f(not)i(sp)s(eci\014ed,)f +Fj(BARCODE_TABLE)d Fl(is)i(lo)s(ok)m(ed)h(up)g(in)f(the)574 +2106 y(en)m(vironmen)m(t,)d(otherwise)f(no)h(table)f(is)g(prin)m(ted)f +(and)h(eac)m(h)i(barco)s(de)f(will)c(get)33 b(its)e(o)m(wn)h(page.)574 +2206 y(The)27 b(size)g(\(but)f(not)h(the)g(p)s(osition\))e(of)j(a)f +(barco)s(de)f(item)h(within)d(a)k(table)e(can)h(also)g(b)s(e)f +(selected)574 2305 y(using)43 b Fj(-g)g Fl(\(see)i Fj(")p +Fl(geometry)p Fj(")g Fl(ab)s(o)m(v)m(e\),)k(without)43 +b(struggling)f(with)h(external)h(and)f(in)m(ternal)574 +2405 y(margins.)71 b(I)40 b(still)e(think)h(managemen)m(t)j(of)f +(geometries)g(in)f(a)h(table)f(is)g(sub)s(optimal,)g(but)g(I)574 +2504 y(can't)32 b(mak)m(e)f(it)f(b)s(etter)h(without)e(in)m(tro)s +(ducing)f(incompatibilities.)94 2651 y Fj(-m)i(margin\(s\))574 +2751 y Fl(Sp)s(eci\014es)21 b(an)g(in)m(ternal)g(margin)g(for)g(eac)m +(h)i(stic)m(k)m(er)g(in)d(the)i(table.)38 b(The)21 b(argumen)m(t)i(is)d +(of)i(the)g(form)574 2850 y(\\)p Fj(<)p Fg(xmar)-5 b(gin)p +Fj(>,<)p Fg(ymar)g(gin)p Fj(>)p Fl(")35 b(and)c(the)g(margin)g(is)g +(applied)e(symmetrically)h(to)i(the)g(stic)m(k)m(er.)45 +b(If)574 2950 y(unsp)s(eci\014ed,)28 b(the)h(en)m(vironmen)m(t)g(v)-5 +b(ariable)28 b Fj(BARCODE_MARGIN)e Fl(is)i(used)h(or)g(a)h(default)e +(in)m(ternal)574 3050 y(margin)i(of)g(10)i(p)s(oin)m(ts)d(is)g(used.)94 +3196 y Fj(-n)384 b Fl(\\Numeric")31 b(output:)40 b(don't)31 +b(prin)m(t)e(the)h(ASCI)s(I)f(form)h(of)g(the)h(co)s(de,)g(only)e(the)i +(bars.)94 3343 y Fj(-c)384 b Fl(No)35 b(c)m(hec)m(ksum)f(c)m(haracter)h +(\(for)f(enco)s(dings)e(that)j(allo)m(w)e(it,)h(lik)m(e)f(co)s(de)h +(39,)h(other)f(co)s(des,)h(lik)m(e)574 3442 y(UPC)c(or)f(EAN,)h(ignore) +f(this)f(option\).)94 3589 y Fj(-E)384 b Fl(Encapsulated)32 +b(p)s(ostscript)f(\(default)h(is)g(normal)f(p)s(ostscript\).)47 +b(When)32 b(the)h(output)f(is)f(gener-)574 3689 y(ated)h(as)e(EPS)g +(only)f(one)i(barco)s(de)f(is)f(enco)s(ded.)94 3835 y +Fj(-P)384 b Fl(PCL)35 b(output.)56 b(Please)36 b(note)g(that)g(the)f(Y) +h(direction)e(go)s(es)i(from)f(top)h(to)g(b)s(ottom)g(for)f(PCL,)574 +3935 y(and)30 b(the)h(origin)e(for)h(an)g(image)h(is)e(the)i(top-left)f +(corner)h(instead)e(of)i(the)f(b)s(ottom-left)94 4081 +y Fj(-p)g(pagesize)574 4181 y Fl(Sp)s(ecify)44 b(a)h(non-default)f +(page)i(size.)85 b(The)45 b(page)h(size)f(can)g(b)s(e)f(sp)s(eci\014ed) +g(in)g(millimeters,)574 4281 y(inc)m(hes)34 b(or)g(plain)e(n)m(um)m(b)s +(ers)g(\(for)i(example:)48 b Fj("210x297mm")p Fl(,)32 +b Fj("8.5x11in")p Fl(,)g Fj("595x842")p Fl(\).)50 b(A)574 +4380 y(page)27 b(sp)s(eci\014cation)d(as)i(n)m(um)m(b)s(ers)e(will)f(b) +s(e)i(in)m(terpreted)g(according)g(to)i(the)f(curren)m(t)f(unit)f(sp)s +(ec-)574 4480 y(i\014cation)33 b(\(see)h Fj(-u)e Fl(b)s(elo)m(w\).)49 +b(If)33 b(libpap)s(er)d(is)i(a)m(v)-5 b(ailable,)33 b(y)m(ou)h(can)f +(also)g(sp)s(ecify)f(the)h(page)h(size)574 4580 y(with)40 +b(its)g(name,)k(lik)m(e)d Fj("A3")e Fl(or)i Fj("letter")e +Fl(\(libpap)s(er)f(is)i(a)h(standard)g(comp)s(onen)m(t)g(of)g(De-)574 +4679 y(bian)d(GNU/Lin)m(ux,)k(but)d(ma)m(y)h(b)s(e)e(missing)f +(elsewhere\).)68 b(The)39 b(default)f(page)i(size)g(is)e(y)m(our)574 +4779 y(system-wide)30 b(default)g(if)f(libpap)s(er)e(is)j(there,)h(A4)g +(otherwise.)94 4925 y Fj(-u)f(unit)162 b Fl(Cho)s(ose)32 +b(the)f(unit)f(used)g(in)g(size)i(sp)s(eci\014cations.)42 +b(Accepted)32 b(v)-5 b(alues)31 b(are)g(\\mm",)i(\\cm",)f(\\in")574 +5025 y(and)37 b(\\pt".)61 b(By)37 b(default,)h(the)f(program)f(will)f +(c)m(hec)m(k)j Fj(BARCODE_UNIT)33 b Fl(in)j(the)h(en)m(vironmen)m(t,) +574 5125 y(and)c(assume)g(p)s(oin)m(ts)g(otherwise)f(\(this)h(b)s(eha)m +(viour)f(is)g(compatible)h(with)f(0.92)j(and)d(previous)574 +5224 y(v)m(ersions.)50 b(If)33 b Fj(-u)g Fl(app)s(ears)g(more)g(than)g +(once,)j(eac)m(h)e(instance)f(will)e(mo)s(di\014ed)h(the)h(b)s(eha)m +(viour)574 5324 y(for)h(the)g(argumen)m(ts)g(at)g(its)f(righ)m(t,)i(as) +f(the)g(command)f(line)f(is)h(pro)s(cesses)g(left)h(to)g(righ)m(t.)50 +b(The)574 5424 y(program)32 b(in)m(ternally)f(w)m(orks)h(with)f(p)s +(oin)m(ts,)h(and)f(an)m(y)i(size)f(is)f(appro)m(ximated)h(to)h(the)f +(nearest)574 5523 y(m)m(ultiple)c(of)j(one)f(p)s(oin)m(t.)40 +b(The)30 b Fj(-u)f Fl(option)h(a\013ect)i Fj(-g)e Fl(\(geometry\),)i +Fj(-t)e Fl(\(table\))h(and)e Fj(-p)h Fl(\(page)574 5623 +y(size\).)p eop +%%Page: 7 8 +7 7 bop 94 -116 a Fl(Chapter)30 b(6:)41 b(Supp)s(orted)29 +b(Enco)s(dings)2417 b(7)94 365 y Fi(6)81 b(Supp)t(orted)51 +b(Enco)t(dings)219 558 y Fl(The)31 b(program)h(enco)s(des)g(text)g +(strings)f(passed)g(either)g(on)h(the)g(command)g(line)e(\(with)g(-b\)) +i(or)g(retriev)m(ed)94 658 y(from)38 b(standard)f(input.)61 +b(The)37 b(text)i(represen)m(tation)f(is)f(in)m(terpreted)g(according)g +(to)i(the)f(follo)m(wing)e(rules.)94 758 y(When)42 b(auto-detection)g +(of)g(the)f(enco)s(ding)f(is)h(enabled)f(\(i.e,)k(no)e(explicit)d(enco) +s(ding)h(t)m(yp)s(e)i(is)e(sp)s(eci\014ed\),)94 857 y(the)c(enco)s +(ding)e(t)m(yp)s(es)h(are)h(scanned)f(to)h(\014nd)d(one)j(that)g(can)f +(digest)g(the)g(text)i(string.)54 b(The)35 b(follo)m(wing)e(list)94 +957 y(of)h(supp)s(orted)e(t)m(yp)s(es)h(is)g(sorted)g(in)g(the)g(same)h +(order)f(the)h(library)d(uses)i(when)f(auto-detecting)k(a)d(suitable)94 +1056 y(enco)s(ding)d(for)g(a)h(string.)94 1193 y Fh(EAN)282 +b Fl(The)36 b(EAN)h(fron)m(tend)f(is)g(similar)d(to)38 +b(UPC;)e(it)g(accepts)i(strings)d(of)i(digits,)g(12)g(or)g(7)f(c)m +(harac-)574 1293 y(ters)c(long.)41 b(Strings)30 b(of)h(13)g(or)g(8)g(c) +m(haracters)i(are)e(accepted)h(if)e(the)h(pro)m(vided)f(c)m(hec)m(ksum) +h(digit)574 1393 y(is)40 b(correct.)73 b(I)40 b(exp)s(ect)i(most)f +(users)e(to)j(feed)e(input)f(without)h(a)h(c)m(hec)m(ksum,)j(though.)71 +b(The)574 1492 y(add-2)36 b(and)g(add-5)g(extension)f(are)h(accepted)i +(for)d(b)s(oth)g(the)i(EAN-13)g(and)e(the)h(EAN-8)h(en-)574 +1592 y(co)s(dings.)42 b(The)30 b(follo)m(wing)f(are)j(example)e(of)h(v) +-5 b(alid)29 b(input)g(strings:)41 b(\\)p Fj(123456789012)p +Fl(")28 b(\(EAN-)574 1692 y(13\),)43 b(\\)p Fj(1234567890128)p +Fl(")37 b(\(EAN-13)k(wih)c(c)m(hec)m(ksum\),)43 b(\\)p +Fj(1234567)p Fl(")38 b(\(EAN-8\),)44 b(\\)p Fj(12345670)574 +1791 y(12345)p Fl(")23 b(\(EAN-8)h(with)e(c)m(hec)m(ksum)h(and)g +(add-5\),)i(\\)p Fj(123456789012)45 b(12)p Fl(")23 b(\(EAN-13)i(with)c +(add-)574 1891 y(2\),)32 b(\\)p Fj(123456789012)45 b(12345)p +Fl(")29 b(\(EAN-13)j(with)d(add-5\).)94 2028 y Fh(UPC)284 +b Fl(The)35 b(UPC)g(fron)m(tend)g(accepts)i(only)d(strings)g(made)i(up) +e(of)h(digits)f(\(and,)j(if)d(a)i(supplemen)m(tal)574 +2127 y(enco)s(ding)27 b(is)g(used,)g(a)h(blank)f(to)h(separate)g(it\).) +40 b(It)28 b(accepts)h(strings)d(of)i(11)g(or)g(12)g(digits)f(\(UPC-) +574 2227 y(A\))k(and)f(6)h(or)f(7)h(or)f(8)h(digits)e(\(UPC-E\).)574 +2345 y(The)c(12th)h(digit)e(of)h(UPC-A)g(is)f(the)h(c)m(hec)m(ksum)h +(and)e(is)g(added)h(b)m(y)g(the)g(library)d(if)i(not)i(sp)s(eci\014ed) +574 2445 y(in)k(the)h(input;)e(if)h(it)h(is)f(sp)s(eci\014ed,)f(it)h(m) +m(ust)h(b)s(e)f(the)h(righ)m(t)g(c)m(hec)m(ksum)g(or)g(the)g(co)s(de)g +(is)f(rejected)574 2545 y(as)38 b(in)m(v)-5 b(alid.)59 +b(F)-8 b(or)38 b(UPC-E,)f(6)h(digit)e(are)i(considered)e(to)i(b)s(e)e +(the)i(middle)d(part)i(of)g(the)g(co)s(de,)574 2644 y(a)i(leading)d(0)i +(is)f(assumed)g(and)g(the)h(c)m(hec)m(ksum)g(is)f(added;)k(7)d(digits)e +(are)i(either)f(considered)574 2744 y(the)30 b(initial)d(part)i +(\(leading)g(digit)f(0)i(or)g(1,)g(c)m(hec)m(ksum)g(missing\))e(or)i +(the)f(\014nal)g(part)g(\(c)m(hec)m(ksum)574 2844 y(sp)s(eci\014ed,)f +(leading)g(0)i(assumed\);)g(8)f(digits)f(are)i(considered)e(to)i(b)s(e) +e(the)i(complete)f(co)s(de,)h(with)574 2943 y(leading)k(0)i(or)f(1)g +(and)g(c)m(hec)m(ksum.)55 b(F)-8 b(or)36 b(b)s(oth)f(UPC-A)g(and)f +(UPC-E,)i(a)f(trailing)e(string)h(of)i(2)574 3043 y(digits)30 +b(or)h(5)g(digits)e(is)h(accepted)i(as)f(w)m(ell.)40 +b(Therefore,)31 b(the)g(follo)m(wing)e(are)i(examples)g(of)g(v)-5 +b(alid)574 3142 y(strings)41 b(that)h(can)f(b)s(e)g(enco)s(ded)g(as)h +(UPC:)f(\\)p Fj(01234567890)p Fl(")e(\(UPC-A\))j(\\)p +Fj(012345678905)p Fl(")574 3242 y(\(UPC-A)33 b(with)d(c)m(hec)m +(ksum\),)k(\\)p Fj(012345)p Fl(")d(\(UPC-E\),)i(\\)p +Fj(01234567890)45 b(12)p Fl(")32 b(\(UPC-A,)g(add-2\))574 +3342 y(and)21 b(\\)p Fj(01234567890)45 b(12345)p Fl(")20 +b(\(UPC-A,)i(add-5\),)h(\\)p Fj(0123456)47 b(12)p Fl(")20 +b(\(UPC-E,)i(add-2\).)38 b(Please)574 3441 y(note)24 +b(that)f(when)f(setting)h Fj(BARCODE_ANY)c Fl(to)24 b(auto-detect)h +(the)e(enco)s(ding)f(to)h(b)s(e)f(used,)i(12-digit)574 +3541 y(strings)32 b(and)h(7-digit)f(strings)g(will)e(alw)m(a)m(ys)k(b)s +(e)e(iden)m(ti\014ed)f(as)i(EAN.)h(This)d(b)s(ecause)i(I)f(exp)s(ect) +574 3641 y(most)h(user)f(to)h(pro)m(vide)f(input)e(without)i(a)g(c)m +(hec)m(ksum.)48 b(If)32 b(y)m(ou)h(need)f(to)h(sp)s(ecify)e(UPC-with-) +574 3740 y(c)m(hec)m(ksum)h(as)g(input)d(y)m(ou)i(m)m(ust)g(explicitly) +e(set)j Fj(BARCODE_UPC)c Fl(as)j(a)g(\015ag)h(or)f(use)g +Fj(-e)47 b(upc)30 b Fl(on)574 3840 y(the)h(command)f(line.)94 +3977 y Fh(ISBN)264 b Fl(ISBN)26 b(n)m(um)m(b)s(ers)e(are)i(enco)s(ded)f +(as)h(EAN-13)g(sym)m(b)s(ols,)g(with)e(an)h(optional)g(add-5)g +(trailer.)38 b(The)574 4076 y(ISBN)27 b(fron)m(tend)f(of)h(the)g +(library)e(accepts)j(real)e(ISBN)h(n)m(um)m(b)s(ers)e(and)h(deals)h +(with)e(an)m(y)i(h)m(yphen)574 4176 y(and,)h(if)f(presen)m(t,)h(the)g +(ISBN)f(c)m(hec)m(ksum)i(c)m(haracter)g(b)s(efore)e(enco)s(ding)f +(data.)41 b(V)-8 b(alid)26 b(represen-)574 4276 y(tations)j(for)e(ISBN) +h(strings)e(are)j(for)e(example:)40 b(\\)p Fj(1-56592-292-1)p +Fl(",)25 b(\\)p Fj(3-89721-122-X)p Fl(")h(and)574 4375 +y(\\)p Fj(3-89721-122-X)45 b(06900)p Fl(".)94 4512 y +Fh(co)s(de)31 b(128-B)574 4612 y Fl(This)37 b(enco)s(ding)g(can)h +(represen)m(t)g(all)f(of)h(the)h(prin)m(ting)c(ASCI)s(I)i(c)m +(haracters,)42 b(from)37 b(the)h(space)574 4711 y(\(32\))32 +b(to)g(DEL)e(\(127\).)43 b(The)30 b(c)m(hec)m(ksum)h(digit)e(is)g +(mandatory)i(in)e(this)g(enco)s(ding.)94 4848 y Fh(co)s(de)i(128-C)574 +4948 y Fl(The)h(\\C")g(v)-5 b(ariation)31 b(of)h(Co)s(de-128)h(uses)e +(Co)s(de-128)i(sym)m(b)s(ols)d(to)j(represen)m(t)f(t)m(w)m(o)h(digits)d +(at)j(a)574 5048 y(time)28 b(\(Co)s(de-128)g(is)f(made)g(up)f(of)i(104) +g(sym)m(b)s(ols)e(whose)i(in)m(terpretation)e(is)h(con)m(trolled)g(b)m +(y)g(the)574 5147 y(start)35 b(sym)m(b)s(ol)e(b)s(eing)g(used\).)52 +b(Co)s(de)34 b(128-C)h(is)e(th)m(us)h(the)h(most)f(compact)i(w)m(a)m(y) +f(to)g(represen)m(t)574 5247 y(an)m(y)41 b(ev)m(en)h(n)m(um)m(b)s(er)d +(of)i(digits.)70 b(The)40 b(enco)s(der)g(refuses)g(to)h(deal)f(with)g +(an)g(o)s(dd)g(n)m(um)m(b)s(er)f(of)574 5347 y(digits)24 +b(b)s(ecause)h(the)g(caller)f(is)g(exp)s(ected)h(to)h(pro)m(vide)e +(prop)s(er)f(padding)g(to)j(an)f(ev)m(en)g(n)m(um)m(b)s(er)f(of)574 +5446 y(digits.)38 b(\(Since)23 b(Co)s(de-128)i(includes)d(con)m(trol)j +(sym)m(b)s(ols)d(to)j(switc)m(h)f(c)m(harset,)j(it)c(is)g +(theoretically)574 5546 y(p)s(ossible)29 b(to)j(represen)m(t)f(the)h(o) +s(dd)e(digit)g(as)h(a)g(Co)s(de)g(128-A)i(or)e(128-B)i(sym)m(b)s(ol,)e +(but)f(this)g(to)s(ol)574 5645 y(do)s(esn't)h(curren)m(tly)e(implemen)m +(t)g(this)g(option\).)p eop +%%Page: 8 9 +8 8 bop 94 -116 a Fl(Chapter)30 b(6:)41 b(Supp)s(orted)29 +b(Enco)s(dings)2417 b(8)94 365 y Fh(co)s(de)31 b(128)h(ra)m(w)574 +465 y Fl(Co)s(de-128)24 b(output)d(represen)m(ted)h(sym)m(b)s(ol-b)m +(y-sym)m(b)s(ol)e(in)h(the)h(input)f(string.)36 b(T)-8 +b(o)23 b(o)m(v)m(erride)f(part)574 565 y(of)27 b(the)g(problems)d +(outlined)h(b)s(elo)m(w)g(in)g(sp)s(ecifying)f(co)s(de128)k(sym)m(b)s +(ols,)e(this)f(pseudo-enco)s(ding)574 664 y(allo)m(ws)42 +b(the)h(used)f(to)h(sp)s(ecify)e(a)i(list)e(of)i(co)s(de128)h(sym)m(b)s +(ols)d(separated)i(b)m(y)g(spaces.)77 b(Eac)m(h)574 764 +y(sym)m(b)s(ol)31 b(is)g(represen)m(ted)h(b)m(y)g(a)g(n)m(um)m(b)s(er)f +(in)g(the)h(range)g(0-105.)48 b(The)31 b(list)g(should)f(include)g(the) +574 863 y(leading)e(c)m(haracter.The)i(c)m(hec)m(ksum)g(and)e(the)h +(stop)g(c)m(haracter)h(are)f(automatically)g(added)f(b)m(y)574 +963 y(the)k(library)-8 b(.)42 b(Most)33 b(lik)m(ely)d(this)g +(pseudo-enco)s(ding)g(will)f(b)s(e)i(used)f(with)g Fj(BARCODE_NO_ASCII) +574 1063 y Fl(and)g(some)h(external)f(program)g(to)i(supply)27 +b(the)k(prin)m(ted)e(text.)94 1245 y Fh(co)s(de)37 b(39)180 +b Fl(The)36 b(co)s(de-39)h(standard)f(can)g(enco)s(de)g(upp)s(ercase)g +(letters,)i(digits,)e(the)g(blank)f(space,)k(plus,)574 +1345 y(min)m(us,)d(dot,)i(star,)f(dollar,)f(slash,)g(p)s(ercen)m(t.)57 +b(An)m(y)36 b(string)f(that)h(is)f(only)g(comp)s(osed)g(of)h(suc)m(h) +574 1445 y(c)m(haracters)j(is)e(accepted)h(b)m(y)g(the)f(co)s(de-39)i +(enco)s(der.)61 b(T)-8 b(o)38 b(a)m(v)m(oid)g(lo)s(osing)e +(information,)i(the)574 1544 y(enco)s(der)c(refuses)g(to)h(enco)s(de)f +(mixed-case)g(strings)f(\(a)i(lo)m(w)m(ercase)g(string)e(is)g +(nonetheless)h(ac-)574 1644 y(cepted)d(as)g(a)g(shortcut,)f(but)g(is)f +(enco)s(ded)h(as)h(upp)s(ercase\).)94 1826 y Fh(in)m(terlea)m(v)m(ed)g +(2)g(of)g(5)574 1926 y Fl(This)36 b(enco)s(ding)g(can)i(only)e +(represen)m(t)h(an)g(ev)m(en)h(n)m(um)m(b)s(er)e(of)h(digits)f(\(o)s +(dd)h(digits)f(are)h(repre-)574 2026 y(sen)m(ted)c(b)m(y)g(bars,)f(and) +g(ev)m(en)h(digits)e(b)m(y)i(the)f(in)m(terlea)m(ving)g(spaces\).)48 +b(The)32 b(name)g(stresses)h(the)574 2125 y(fact)i(that)g(t)m(w)m(o)g +(of)f(the)g(\014v)m(e)g(items)f(\(bars)h(or)f(spaces\))i(allo)s(cated)f +(to)g(eac)m(h)h(sym)m(b)s(ol)e(are)h(wide,)574 2225 y(while)41 +b(the)i(rest)g(are)g(narro)m(w.)78 b(The)42 b(c)m(hec)m(ksum)h(digit)f +(is)g(optional)f(\(can)j(b)s(e)e(disabled)e(via)574 2325 +y Fj(BARCODE_NO_CHECKSUM)p Fl(\).)f(Since)31 b(the)h(n)m(um)m(b)s(er)e +(of)h(digits,)g(including)d(the)j(c)m(hec)m(ksum,)i(m)m(ust)574 +2424 y(b)s(e)40 b(ev)m(en,)k(a)c(leading)f(zero)i(is)e(inserted)g(in)g +(the)i(string)e(b)s(eing)g(enco)s(ded)g(if)h(needed)f(\(this)h(is)574 +2524 y(sp)s(eci\014cally)29 b(stated)i(in)e(the)h(sp)s(ecs)g(I)g(ha)m +(v)m(e)i(access)g(to\).)94 2707 y Fh(co)s(de)f(128)136 +b Fl(Automatic)31 b(selection)g(b)s(et)m(w)m(een)g(alphab)s(et)f(A,)h +(B)g(and)f(C)h(of)g(the)g(Co)s(de-128)h(standard.)41 +b(This)574 2806 y(enco)s(ding)31 b(can)i(represen)m(t)f(all)f(ASCI)s(I) +f(sym)m(b)s(ols,)i(from)f(0)h(\(NUL\))h(to)g(127)g(\(DEL\),)g(as)g(w)m +(ell)e(as)574 2906 y(four)36 b(sp)s(ecial)e(sym)m(b)s(ols,)i(named)f +(F1,)j(F2,)g(F3,)g(F4.)58 b(The)35 b(set)h(of)g(sym)m(b)s(ols)f(a)m(v) +-5 b(ailable)35 b(in)f(this)574 3005 y(enco)s(ding)g(is)f(not)i(easily) +e(represen)m(ted)i(as)f(input)e(to)k(the)e Fg(b)-5 b(ar)g(c)g(o)g(de)44 +b Fl(library)-8 b(,)33 b(so)i(the)f(follo)m(wing)574 +3105 y(con)m(v)m(en)m(tion)24 b(is)e(used.)38 b(In)22 +b(the)g(input)f(string,)j(whic)m(h)d(is)h(a)h(C-language)g(n)m +(ull-terminated)e(string,)574 3205 y(the)26 b(NUL)g(c)m(har)f(is)g +(represen)m(ted)g(b)m(y)h(the)f(v)-5 b(alue)25 b(128)i(\(0x80,)h +(0200\))g(and)d(the)g(F1-F4)i(c)m(haracters)574 3304 +y(are)f(represen)m(ted)g(b)m(y)f(the)h(v)-5 b(alues)25 +b(193-196)k(\(0xc1-0xc4,)h(0301-0304\).)43 b(The)25 b(v)-5 +b(alues)25 b(ha)m(v)m(e)i(b)s(een)574 3404 y(c)m(hosen)k(to)h(ease)f +(their)e(represen)m(tation)i(as)f(escap)s(e)h(sequences.)574 +3545 y(Since)39 b(the)h(shell)d(do)s(esn't)j(seem)f(to)i(in)m(terpret)d +(escap)s(e)i(sequences)g(on)f(the)h(command)f(line,)574 +3645 y(the)e Fj(")p Fl(-b)p Fj(")e Fl(option)g(cannot)h(b)s(e)f(easily) +g(used)g(to)i(designate)f(the)g(strings)f(to)h(b)s(e)f(enco)s(ded.)57 +b(As)574 3744 y(a)44 b(w)m(ork)-5 b(around)42 b(y)m(ou)i(can)f(resort)h +(to)f(the)h(command)f Fj(echo)p Fl(,)i(either)e(within)d(bac)m(k-tic)m +(ks)45 b(or)574 3844 y(used)34 b(separately)g(to)g(create)i(a)e(\014le) +f(that)i(is)e(then)g(fed)h(to)h(the)f(standard-input)d(of)j +Fg(b)-5 b(ar)g(c)g(o)g(de)44 b Fl({)574 3944 y(assuming)34 +b(y)m(our)h Fj(echo)f Fl(command)h(pro)s(cesses)g(escap)s(e)h +(sequences.)56 b(The)34 b(newline)f(c)m(haracter)574 +4043 y(is)d(esp)s(ecially)f(though)h(to)h(enco)s(de)f(\(but)g(not)h +(imp)s(ossible)c(unless)h(y)m(ou)j(use)f(a)h Fj(csh)e +Fl(v)-5 b(arian)m(t.)574 4184 y(These)35 b(problems)f(only)g(apply)g +(to)i(the)f(command-line)f(to)s(ol;)j(the)f(use)e(of)i(library)c +(functions)574 4284 y(do)s(esn't)44 b(giv)m(e)f(an)m(y)h(problem.)78 +b(In)42 b(needed,)47 b(y)m(ou)c(can)h(use)f(the)h(\\)p +Fg(c)-5 b(o)g(de)46 b(128)f(r)-5 b(aw)10 b Fl(")45 b(pseudo-)574 +4384 y(enco)s(ding)33 b(to)h(represen)m(t)g(co)s(de128)h(sym)m(b)s(ols) +d(b)m(y)h(their)g(n)m(umerical)f(v)-5 b(alue.)50 b(This)31 +b(enco)s(ding)i(is)574 4483 y(used)28 b(late)h(in)e(the)h +(auto-selection)i(mec)m(hanism)d(b)s(ecause)h(\(almost\))i(an)m(y)e +(input)f(string)g(can)i(b)s(e)574 4583 y(represen)m(ted)i(using)e(co)s +(de128.)94 4765 y Fh(Co)s(dabar)138 b Fl(Co)s(dabar)33 +b(can)h(enco)s(de)g(the)g(ten)f(digits)g(and)g(a)h(few)f(sp)s(ecial)f +(sym)m(b)s(ols)g(\(min)m(us,)i(plus,)e(dollar,)574 4865 +y(colon,)k(bar,)g(dot\).)54 b(The)34 b(c)m(haracters)i(\\)p +Fj(A)p Fl(",)h(\\)p Fj(B)p Fl(",)f(\\)p Fj(C)p Fl(")f(and)g(\\)p +Fj(D)p Fl(")g(are)g(used)f(to)h(represen)m(t)g(four)574 +4965 y(di\013eren)m(t)30 b(start/stop)i(c)m(haracters.)42 +b(The)30 b(input)e(string)i(to)h(the)f(barco)s(de)h(library)d(can)i +(include)574 5064 y(the)d(start)g(and)f(stop)h(c)m(haracters)h(or)e +(not)h(include)d(them)j(\(in)e(whic)m(h)h(case)h(\\)p +Fj(A)p Fl(")g(is)f(used)g(as)g(start)574 5164 y(and)38 +b(\\)p Fj(B)p Fl(")g(as)g(stop\).)64 b(Start)38 b(and)f(stop)h(c)m +(haracters)h(in)e(the)h(input)e(string)g(can)j(b)s(e)e(either)g(all)574 +5264 y(lo)m(w)m(ercase)32 b(or)f(all)e(upp)s(ercase)g(and)h(are)h(alw)m +(a)m(ys)g(prin)m(ted)e(as)h(upp)s(ercase.)94 5446 y Fh(Plessey)192 +b Fl(Plessey)39 b(barco)s(des)f(can)h(enco)s(de)g(all)f(the)h +(hexadecimal)f(digits.)64 b(Alphab)s(etic)37 b(digits)g(in)h(the)574 +5546 y(input)25 b(string)g(m)m(ust)h(either)g(b)s(e)f(all)g(lo)m(w)m +(ercase)j(or)e(all)f(upp)s(ercase.)38 b(The)26 b(output)g(text)h(is)e +(alw)m(a)m(ys)574 5645 y(upp)s(ercase.)p eop +%%Page: 9 10 +9 9 bop 94 -116 a Fl(Chapter)30 b(7:)41 b(PCL)30 b(Output)2761 +b(9)94 365 y Fh(MSI)313 b Fl(MSI)39 b(can)g(only)e(enco)s(de)i(the)g +(decimal)e(digits.)64 b(While)38 b(the)h(standard)e(sp)s(eci\014es)h +(either)g(one)574 465 y(or)e(t)m(w)m(o)h(c)m(hec)m(k)g(digits,)e(the)h +(curren)m(t)f(implemen)m(tation)f(in)g(this)g(library)f(only)i +(generates)i(one)574 565 y(c)m(hec)m(k)32 b(digit.)94 +701 y Fh(co)s(de)f(93)180 b Fl(The)30 b(co)s(de-93)h(standard)f(can)g +(nativ)m(ely)g(enco)s(de)g(48)h(di\013eren)m(t)e(c)m(haracters,)j +(including)27 b(upp)s(er-)574 801 y(case)39 b(letters,)h(digits,)e(the) +g(blank)e(space,)k(plus,)e(min)m(us,)g(dot,)h(star,)h(dollar,)e(slash,) +h(p)s(ercen)m(t,)574 901 y(as)31 b(w)m(ell)f(as)g(\014v)m(e)h(sp)s +(ecial)e(c)m(haracters:)43 b(a)30 b(start/stop)i(delimiter)c(and)i +(four)g Fj(")p Fl(shift)f(c)m(haracters)p Fj(")574 1000 +y Fl(used)f(for)f(extended)h(enco)s(ding.)39 b(Using)27 +b(this)g Fj(")p Fl(extended)g(enco)s(ding)p Fj(")g Fl(metho)s(d,)h(an)m +(y)g(standard)574 1100 y(7-bit)34 b(ASCI)s(I)e(c)m(haracter)k(can)e(b)s +(e)f(enco)s(ded,)i(but)e(it)h(tak)m(es)h(up)e(t)m(w)m(o)i(sym)m(b)s(ol) +d(lengths)i(in)e(bar-)574 1200 y(co)s(de)k(if)f(the)g(c)m(haracter)j +(is)c(not)i(nativ)m(ely)f(supp)s(orted)f(\(one)i(of)g(the)f(48\).)58 +b(The)35 b(enco)s(der)g(here)574 1299 y(fully)24 b(implemen)m(ts)g(the) +i(co)s(de)g(93)g(enco)s(ding)f(standard.)38 b(An)m(y)26 +b(c)m(haracters)h(nativ)m(ely)e(supp)s(orted)574 1399 +y(\(A-Z,)35 b(0-9,)h Fj(")p Fl(.)p Fj(+)p Fl(-/$&\045)p +Fj(")p Fl(\))e(will)d(b)s(e)j(enco)s(ded)f(as)h(suc)m(h)g(-)g(for)f(an) +m(y)h(other)h(c)m(haracters)g(\(suc)m(h)f(as)574 1498 +y(lo)m(w)m(er)h(case)g(letters,)g(brac)m(k)m(ets,)h(paren)m(theses,)g +(etc.\),)h(the)d(enco)s(der)f(will)f(rev)m(ert)i(to)h(extended)574 +1598 y(enco)s(ding.)68 b(As)40 b(a)g(note,)j(the)d(option)f(to)h +(exclude)f(the)h(c)m(hec)m(ksum)g(will)d(eliminate)i(the)h(t)m(w)m(o) +574 1698 y(mo)s(dulo-47)f(c)m(hec)m(ksums)g(\(called)g(C)f(and)g(K\))h +(from)f(the)h(barco)s(de,)i(but)d(this)g(probably)f(will)574 +1797 y(mak)m(e)c(it)e(unreadable)e(b)m(y)i(99\045)h(of)g(all)e +(scanning)g(systems.)43 b(These)31 b(c)m(hec)m(ksums)h(are)g(sp)s +(eci\014ed)574 1897 y(to)f(b)s(e)e(used)g(at)i(the)f(\014rm)m(w)m(are)f +(lev)m(el,)h(and)f(their)g(absence)h(will)d(b)s(e)j(in)m(terpreted)f +(as)h(an)f(in)m(v)-5 b(alid)574 1997 y(barco)s(de.)94 +2266 y Fi(7)81 b(PCL)53 b(Output)219 2459 y Fl(While)28 +b(the)h(default)g(output)f(is)g(P)m(ostscript)i(\(p)s(ossibly)c(EPS\),) +j(and)g(P)m(ostscript)g(can)g(b)s(e)f(p)s(ost-pro)s(cessed)94 +2558 y(to)40 b(almost)e(an)m(ything,)i(it)e(is)f(sometimes)i(desirable) +d(to)j(create)h(output)e(directly)f(usable)g(b)m(y)i(the)f(sp)s +(eci\014c)94 2658 y(prin)m(ter)33 b(at)h(hand.)50 b(PCL)33 +b(is)g(curren)m(tly)f(supp)s(orted)g(as)i(an)g(output)f(format)h(for)g +(this)e(reason.)51 b(Please)34 b(note)94 2758 y(that)25 +b(the)f(Y)g(co)s(ordinate)g(for)f(PCL)h(go)s(es)g(from)f(top)i(to)f(b)s +(ottom,)i(while)c(for)h(P)m(ostscript)h(it)g(go)s(es)g(from)g(b)s +(ottom)94 2857 y(to)35 b(top.)51 b(Consisten)m(tly)-8 +b(,)34 b(while)d(in)i(P)m(ostscript)g(y)m(ou)h(sp)s(ecify)f(the)g(b)s +(ottom-left)i(corner)e(as)h(origin,)f(for)h(PCL)94 2957 +y(y)m(ou)d(sp)s(ecify)e(the)i(top-left)f(corner.)219 +3075 y(Barco)s(de)c(output)e(for)h(PCL)f(Prin)m(ters)g(\(HP)h(LaserJet) +g(and)g(compatibles\),)g(w)m(as)h(dev)m(elop)s(ed)e(using)f(PCL5)94 +3175 y(Reference)32 b(man)m(uals)d(from)h(HP)-8 b(.)31 +b(that)g(really)e(refers)h(to)h(these)g(prin)m(ters:)169 +3293 y Fb(\017)60 b Fl(LaserJet)31 b(I)s(I)s(I,)f(I)s(I)s(I)e(P)-8 +b(,)31 b(I)s(I)s(I)e(D,)i(I)s(I)s(I)e(Si,)169 3411 y +Fb(\017)60 b Fl(LaserJet)31 b(4)g(family)169 3529 y Fb(\017)60 +b Fl(LaserJet)31 b(5)g(family)169 3648 y Fb(\017)60 b +Fl(LaserJet)31 b(6)g(family)169 3766 y Fb(\017)60 b Fl(Color)30 +b(LaserJet)169 3884 y Fb(\017)60 b Fl(DeskJet)32 b(1200)g(and)e(1600.) +219 4021 y(Ho)m(w)m(ev)m(er,)g(barco)s(de)e(prin)m(ting)d(uses)i(a)h(v) +m(ery)g(small)e(subset)h(of)g(PCL,)g(probably)f(also)h(LaserJet)h(I)s +(I)f(should)94 4121 y(prin)m(t)i(it)h(without)g(problem,)f(but)g(the)i +(resulting)e(text)i(ma)m(y)g(b)s(e)f(horrible.)219 4239 +y(The)22 b(only)g(real)h(di\013erence)f(from)h(one)g(prin)m(ter)e(to)j +(another)f(really)f(dep)s(ends)f(on)h(whic)m(h)g(fon)m(t)h(are)h(a)m(v) +-5 b(ailable)94 4338 y(in)30 b(the)g(prin)m(ter,)f(used)h(in)f(prin)m +(ting)f(the)j(lab)s(el)d(asso)s(ciated)j(to)g(the)g(bars)f(\(if)f +(requested\).)219 4457 y(Earlier)j(LaserJet)j(supp)s(orts)d(only)h +(bitmaps)f(fon)m(ts,)k(so)e(these)g(are)h(not)f Fj(")p +Fl(scalable)p Fj(")p Fl(.)50 b(\(Ljet)35 b(I)s(I)e(?\),)i(Also)94 +4556 y(these)c(fon)m(ts,)f(when)f(a)m(v)-5 b(ailable,)29 +b(ha)m(v)m(e)i(a)f(sp)s(eci\014ed)e(direction,)h(and)g(not)h(all)f(of)g +(them)h(are)g(a)m(v)-5 b(ailable)29 b(in)g(b)s(oth)94 +4656 y(P)m(ortrait)i(and)f(Landscap)s(e)g(mo)s(de.)219 +4774 y(F)-8 b(rom)23 b(LaserJet)g(4)f(series,)i(\(except)g(4L/5L)f +(that)g(are)g(en)m(try-lev)m(el)f(prin)m(ters\),)h(Arial)e(scalable)h +(fon)m(t)h(should)94 4874 y(b)s(e)30 b(a)m(v)-5 b(ailable,)30 +b(so)h(it's)f(the)g Fj(")p Fl(default)g(fon)m(t)p Fj(")g +Fl(used)g(b)m(y)g(this)f(program.)219 4992 y(LaserJet)41 +b(I)s(I)s(I)d(series)i(prin)m(ters)e(\(and)i(4L,)g(5L\),)h(don't)f +(feature)h Fj(")p Fl(Arial)p Fj(")d Fl(as)i(a)h(residen)m(t)e(fon)m(t,) +k(so)e(y)m(ou)94 5092 y(should)27 b(use)i Fj(BARCODE_OUT_PCL_III)23 +b Fl(instead)28 b(of)h Fj(BARCODE_OUT_PCL.)p Fl(,)c(and)j(fon)m(t)h +(the)g(fon)m(t)h(used)d(will)g(b)s(e)94 5191 y Fj(")p +Fl(Univ)m(ers)p Fj(")j Fl(instead)f(of)i Fj(")p Fl(Arial)p +Fj(")p Fl(.)219 5309 y(Results)26 b(on)i(compatible)e(prin)m(ters,)h +(ma)m(y)h(dep)s(end)d(on)i(consistency)g(of)h(PCL5)f(compatibilit)m(y) +-8 b(,)26 b(in)g(doubt,)94 5409 y(try)31 b(BAR)m(CODE)p +713 5409 28 4 v 33 w(OUT)p 951 5409 V 32 w(PCL)p 1168 +5409 V 32 w(I)s(I)s(I)219 5527 y(PJL)f(commands)g(are)g(not)h(used)f +(here,)g(as)h(it's)f(not)g(v)m(ery)h(compatible.)219 +5645 y(T)-8 b(ested)31 b(Prin)m(ters:)p eop +%%Page: 10 11 +10 10 bop 94 -116 a Fl(Chapter)30 b(8:)41 b(Bugs)31 b(and)f(P)m(ending) +f(Issues.)2211 b(10)169 365 y Fb(\017)60 b Fl(Hp)30 b(LaserJet)h(4050) +169 490 y Fb(\017)60 b Fl(Hp)30 b(LaserJet)h(2100)169 +614 y Fb(\017)60 b Fl(Epson)30 b(N-1200)j(em)m(ul)c(PCL)169 +739 y Fb(\017)60 b Fl(T)-8 b(oshiba)30 b(DP2570)i(\(copier\))f +Fj(+)f Fl(PCL)g(option)169 863 y Fb(\017)60 b Fl(Epson)30 +b(EPL-7100)i(em)m(ul.)40 b(HP)30 b(LaserJet)h(I)s(I:)f(bars)g(prin)m(t) +f(\014ne)g(but)h(text)i(is)d(bad.)94 1146 y Fi(8)81 b(Bugs)52 +b(and)i(P)l(ending)f(Issues.)219 1370 y Fl(The)42 b(curren)m(t)g +(managemen)m(t)h(of)g(b)s(orders/margins)d(is)h(far)h(from)g(optimal.) +75 b(The)42 b(\\default")g(margin)94 1469 y(applied)d(b)m(y)h(the)h +(library)d(in)m(terferes)i(with)f(the)i(external)g(represen)m(tation,)i +(but)d(I)g(feel)g(it)g(is)g(mandatory)94 1569 y(to)f(a)m(v)m(oid)f +(creating)g(barco)s(de)f(output)h(with)e(no)i(surrounding)c(white)j +(space)h(\(the)g(problem)e(is)h(esp)s(ecially)94 1669 +y(relev)-5 b(an)m(t)31 b(for)f(EPS)g(output\).)219 1793 +y(EAN-128)44 b(is)d(not)h(\(y)m(et\))i(supp)s(orted.)73 +b(I)42 b(plan)e(to)j(implemen)m(t)e(it)g(prett)m(y)h(so)s(on)g(and)f +(then)h(bless)f(the)94 1893 y(pac)m(k)-5 b(age)33 b(as)d(v)m(ersion)g +(1.0.)p eop +%%Page: -1 12 +-1 11 bop 3849 -116 a Fl(i)94 365 y Fi(T)-13 b(able)55 +b(of)e(Con)l(ten)l(ts)94 697 y Fk(Barco)t(de)45 b(to)t(ols)16 +b Fa(.)k(.)g(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.) +f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g +(.)h(.)60 b Fk(1)94 955 y(1)135 b(Ov)l(erview)12 b Fa(.)21 +b(.)f(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h +(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.) +f(.)57 b Fk(1)94 1212 y(2)135 b(The)45 b(Underlying)g(Data)h(Structure) +41 b Fa(.)20 b(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)86 +b Fk(1)393 1337 y Fl(2.1)92 b(The)30 b(Fields)19 b Fg(.)14 +b(.)h(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g +(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) +g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)49 +b Fl(1)692 1436 y(Use)31 b(of)g(the)f Fg(width)39 b Fl(and)30 +b Fg(sc)-5 b(alef)50 b Fl(\014elds.)25 b Fg(.)15 b(.)g(.)g(.)g(.)g(.)g +(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) +g(.)g(.)56 b Fl(2)393 1536 y(2.2)92 b(The)30 b(In)m(termediate)h +(Represen)m(tation)24 b Fg(.)15 b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g +(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) +g(.)54 b Fl(3)94 1768 y Fk(3)135 b(The)45 b(Flags)28 +b Fa(.)20 b(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f +(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.) +f(.)g(.)73 b Fk(3)94 2026 y(4)135 b(F)-11 b(unctions)44 +b(Exp)t(orted)h(b)l(y)g(the)g(Library)37 b Fa(.)19 b(.)h(.)f(.)g(.)h(.) +f(.)h(.)f(.)h(.)f(.)g(.)81 b Fk(4)94 2283 y(5)135 b(The)45 +b Fa(b)-7 b(ar)g(c)g(o)g(de)52 b Fk(fron)l(tend)46 b(program)11 +b Fa(.)19 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h +(.)55 b Fk(5)393 2408 y Fl(5.1)92 b(The)30 b(Command)g(Line)24 +b Fg(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g +(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) +g(.)g(.)g(.)g(.)g(.)g(.)g(.)55 b Fl(5)94 2640 y Fk(6)135 +b(Supp)t(orted)44 b(Enco)t(dings)33 b Fa(.)20 b(.)f(.)g(.)h(.)f(.)h(.)f +(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.) +78 b Fk(7)94 2897 y(7)135 b(PCL)45 b(Output)40 b Fa(.)20 +b(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f +(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)85 +b Fk(9)94 3155 y(8)135 b(Bugs)45 b(and)f(P)l(ending)h(Issues.)36 +b Fa(.)19 b(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)h +(.)f(.)g(.)h(.)79 b Fk(10)p eop +%%Trailer +end +userdict /end-hook known{end-hook}if +%%EOF diff --git a/barcode-0.98/doc/barcodedoc.txt b/barcode-0.98/doc/barcodedoc.txt new file mode 100644 index 00000000..2d242f99 --- /dev/null +++ b/barcode-0.98/doc/barcodedoc.txt @@ -0,0 +1,734 @@ + + +This is barcode.info, produced by makeinfo version 4.0b from +barcode.texinfo. + + This file is the User's Manual for the barcode library (version +0.98). + + + + +*Node: Overview + Overview + ******** + + The "barcode" package is mainly a C library for creating bar-code +output files. It also includes a command line front-end and (in a +foreseeable future) a graphic frontend. + + The package is designed as a library because we think the main use +for barcode-generation tools is inside more featured applications. The +library addresses bar code printing as two distinct problems: creation +of bar information and actual conversion to an output format. To this +aim we use an intermediate representation for bar codes, which is +currently documented in the `ps.c' source file (not in this document). + + Note that the library and the accompanying material is released +according to the GPL license, not the LGPL one. A copy of the GPL is +included in the distribution tarball. + + + + +*Node: The Barcode Object + The Underlying Data Structure + ***************************** + + Every barcode-related function acts on a data structure defined in +the `barcode.h' header, which must be included by any C source file +that uses the library. The header is installed by make install. + + The definition of the data structure is included here for reference: + + struct Barcode_Item { + int flags; /* type of encoding and other flags */ + char *ascii; /* malloced */ + char *partial; /* malloced too */ + char *textinfo; /* information about text placement */ + char *encoding; /* code name, filled by encoding engine */ + int width, height; /* output units */ + int xoff, yoff; /* output units */ + int margin; /* output units */ + double scalef; /* requested scaling for barcode */ + int error; /* an errno-like value, in case of failure */ + }; + + The exact meaning of each field and the various flags implemented are +described in the following sections. + + Even though you won't usually need to act on the contents of this +structure, some of the functions in the library receive arguments that +are directly related to one or more of these fields. + + + + +*Node: The Field List + The Fields + ========== + +`int flags;' + The flags are, as you may suspect, meant to specify the exact + behaviour of the library. They are often passed as an argument to + barcode functions and are discussed in the next section. + +`char *ascii;' +`char *partial;' +`char *textinfo;' +`char *encoding;' + These fields are internally managed by the library, and you are + not expected to touch them if you use the provided API. All of + them are allocated with malloc. + +`int width;' +`int height;' + They specify the width and height of the active barcode region + (i.e., excluding the white margin), in the units used to create + output data (for postscript they are points, 1/72th of an inch, + 0.352 mm). The fields can be either assigned to in the structure + or via Barcode_Position(), at your choice. If either value or + both are left to their default value of zero, the output engine + will assign default values according to the specified scaling + factor. If the specified width is bigger than needed (according to + the scaling factor), the output barcode will be centered in its + requested region. If either the width of the height are too small + for the specified scale factor, the output bar code will expand + symmetrically around the requested region. + +`int xoff;' +`int yoff;' + The fields specify offset from the coordinate origin of the output + engine (for postscript, position 0,0 is the lower left corner of + the page). The fields can be either assigned to in the structure + or via Barcode_Position(), at your choice. The offset specifies + where the white margin begins, not where the first bar will be + printed. To print real ink to the specified position you should + set margin to 0. + +`int margin;' + The white margin that will be left around the printed area of the + bar code. The same margin is applied to all sides of the printed + area. The default value for the margin is defined in `barcode.h' + as BARCODE_DEFAULT_MARGIN (10). + +`double scalef;' + The enlarge or shrink value for the bar code over its default + dimension. The width and scalef fields interact deeply in the + creation of the output, and a complete description of the issues + appears later in this section. + +`int error;' + The field is used when a barcode function fails to host an + errno-like integer value. + +Use of the width and scalef fields. +----------------------------------- + + A width unit is the width of the thinnest bar and/or space in the +chosen code; it defaults to 1 point if the output is postscript or +encapsulated postscript. + + Either or both the code width and the scale factor can be left +unspecified (i.e., zero). The library deals with defaults in the +following way: + +Both unspecified + If both the width and the scale factor are unspecified, the scale + factor will default to 1.0 and the width is calculated according + to the actual width of the bar code being printed. + +Width unspecified + If the width is not specified, it is calculated according to the + values of scalef. + +Scale factor unspecified + If the scale factor is not specified, it will be chosen so that + the generated bar code exactly fits the specified width. + +Both specified + The code will be printed inside the specified region according to + the specified scale factor. It will be aligned to the left. If, + however, the chosen width is too small for the specific bar code + and scaling factor, then the code will extend symmetrically to the + left and to the right of the chosen region. + + + + +*Node: The Intermediate Representation + The Intermediate Representation + =============================== + + The encoding functions print their output into the partial and +texinfo fields of the barcode data structure. Those fields, together +with position information, are then used to generate actual output. +This is an informal description of the intermediate format. + + The first char in partial tells how much extra space to add to the +left of the bars. For EAN-13, it is used to leave space to print the +first digit, other codes may have '0' for no-extra-space-needed. + + The next characters are alternating bars and spaces, as multiples of +the base dimension which is 1 unless the code is rescaled. Rescaling is +calculated as the ratio from the requested width and the calculated +width. Digits represent bar/space dimensions. Lower-case letters +represent those bars that should extend lower than the others: 'a' is +equivalent to '1', 'b' is '2' and so on up to 'i' which is equivalent to +'9'. Other letters will be used for encoding-specific meanings, as soon +as I implement them. + + The textinfo string is made up of fields %lf:%lf:%c separated by +blank space. The first integer is the x position of the character, the +second is the font size (before rescaling) and the char item is the +character to be printed. + + Both the partial and textinfo strings may include "-" or "+" as +special characters (in textinfo the char should be a stand-alone word). +They state where the text should be printed: below the bars ("-", +default) or above the bars. This is used, for example, to print the +add-5 and add-2 codes to the right of UPC or EAN codes (the add-5 +extension is mostly used in ISBN codes). + + + + +*Node: Supported Flags + The Flags + ********* + + The following flags are supported by version 0.98 of the library: + +`BARCODE_ENCODING_MASK' + The mask is used to extract the encoding-type identifier from the + flags field. + +`BARCODE_EAN' +`BARCODE_UPC' +`BARCODE_ISBN' +`BARCODE_128B' +`BARCODE_128C' +`BARCODE_128' +`BARCODE_128RAW' +`BARCODE_39' +`BARCODE_I25' +`BARCODE_CBR' +`BARCODE_MSI' +`BARCODE_PLS' +`BARCODE_93' + The currently supported encoding types: EAN (13 digits, 8 digits, + 13 + 2 add-on and 13 + 5 add-on), UPC (UPC-A, UPC-E, UPC-A with 2 + or 5 digit add-on), ISBN (with or without the 5-digit add-on), + CODE128-B (the whole set of printable ASCII characters), CODE128-C + (two digits encoded by each barcode symbol), CODE128 (all ASCII + values), a "raw-input" pseudo-code that generates CODE128 output, + CODE39 (alphanumeric), "interleaved 2 of 5" (numeric), Codabar + (numeric plus a few symbols), MSI (numeric) and Plessey (hex + digits). *Note Supported Encodings::. + +`BARCODE_ANY' + This special encoding type (represented by a value of zero, so it + will be the default) tells the encoding procedure to look for the + first encoding type that can deal with a textual string. + Therefore, a 11-digit code will be printed as UPC (as well as + 6-digit, 11+2 and 11+5), a 12-digit (or 7-digit, or 12+2 or 12+5) + as EAN13, an ISBN code (with or without hyphens, with or without + add-5) will be encoded in its EAN13 representation, an even number + of digits is encoded using CODE128C and a generic string is + encoded using CODE128B. Since code-39 offers a much larger + representation for the same text string, code128-b is preferred + over code39 for alphanumeric strings. + +`BARCODE_NO_ASCII' + Instructs the engine not to print the ascii string on output. By + default the bar code is accompanied with an ascii version of the + text it encodes. + +`BARCODE_NO_CHECKSUM' + Instructs the engine not to add the checksum character to the + output. Not all the encoding types can drop the checksum; those + where the checksum is mandatory (like EAN and UPC) just ignore the + flag. + +`BARCODE_OUTPUT_MASK' + The mask is used to extract the output-type identifier from the + flags field. + +`BARCODE_OUT_PS' +`BARCODE_OUT_EPS' +`BARCODE_OUT_PCL' +`BARCODE_OUT_PCL_III' + The currently supported encoding types: full-page postscript and + encapsulated postscript; PCL (print command language, for HP + printers) and PCL-III (same as PCL, but uses a font not available + on older printers). + +`BARCODE_OUT_NOHEADERS' + The flag instructs the printing engine not to print the header and + footer part of the file. This makes sense for the postscript + engine but might not make sense for other engines; such other + engines will silently ignore the flag just like the PCL back-end + does. + + + + +*Node: The API + Functions Exported by the Library + ********************************* + + The functions included in the barcode library are declared in the +header file barcode.h. They perform the following tasks: + +`struct Barcode_Item *Barcode_Create(char *text);' + The function creates a new barcode object to deal with a specified + text string. It returns NULL in case of failure and a pointer to + a barcode data structure in case of success. + +`int Barcode_Delete(struct Barcode_Item *bc);' + Destroy a barcode object. Always returns 0 (success) + +`int Barcode_Encode(struct Barcode_Item *bc, int flags);' + Encode the text included in the bc object. Valid flags are the + encoding type (other flags are ignored) and BARCODE_NO_CHECKSUM + (other flags are silently ignored); if the flag argument is zero, + bc->flags will apply. The function returns 0 on success and -1 in + case of error. After successful termination the data structure + will host the description of the bar code and its textual + representation, after a failure the error field will include the + reason of the failure. + +`int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags);' + Print the bar code described by bc to the specified file. Valid + flags are the output type, BARCODE_NO_ASCII and + BARCODE_OUT_NOHEADERS, other flags are ignored. If any of these + flags is zero, it will be inherited from bc->flags which therefore + takes precedence. The function returns 0 on success and -1 in case + of error (with bc->error set accordingly). In case of success, the + bar code is printed to the specified file, which won't be closed + after use. + +`int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, int xoff, int yoff, double scalef);' + The function is a shortcut to assign values to the data structure. + +`int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, int xoff, int yoff, int flags);' + The function deals with the whole life of the barcode object by + calling the other functions; it uses all the specified flags. + +`int Barcode_Version(char *versionname);' + Returns the current version as an integer number of the form major + * 10000 + minor * 100 + release. Therefore, version 1.03.5 will be + returned as 10305 and version 0.53 as 5300. If the argument is + non-null, it will be used to return the version number as a + string. Note that the same information is available from two + preprocessor macros: BARCODE_VERSION (the string) and + BARCODE_VERSION_INT (the integer number). + + + + +*Node: The barcode Executable + The barcode frontend program + **************************** + + The barcode program is a front-end to access some features of the +library from the command line. It is able to read user supplied +strings from the command line or a data file (standard input by default) +and encode all of them. + + + + +*Node: The Command Line + The Command Line + ================ + + barcode accepts the following options: + +`--help or -h' + Print a usage summary and exit. + +`-i filename' + Identify a file where strings to be encoded are read from. If + missing (and if -b is not used) it defaults to standard input. + Each data line of the input file will be used to create one + barcode output. + +`-o filename' + Output file. It defaults to standard output. + +`-b string' + Specify a single "barcode" string to be encoded. The option can + be used multiple times in order to encode multiple strings (this + will result in multi-page postscript output or a table of barcodes + if -t is specified). The strings must match the encoding chosen; + if it doesn't match the program will print a warning to stderr and + generate "blank" output (although not zero-length). Please note + that a string including spaces or other special characters must be + properly quoted. + +`-e encoding' + encoding is the name of the chosen encoding format being used. It + defaults to the value of the environment variable BARCODE_ENCODING + or to auto detection if the environment is also unset. + +`-g geometry' + The geometry argument is of the form "[ x ] [+ + + ]" (with no intervening spaces). Unspecified + margin values will result in no margin; unspecified size results + in default size. The specified values represent print points by + default, and can be inches, millimeters or other units according + to the -u option or the BARCODE_UNIT environment variable. The + argument is used to place the printout code on the page. Note that + an additional white margin of 10 points is added to the printout. + If the option is unspecified, BARCODE_GEOMETRY is looked up in the + environment, if missing a default size and no margin (but the + default 10 points) are used. + +`-t table-geometry' + Used to print several barcodes to a single page, this option is + meant to be used to print stickers. The argument is of the form + " x [+ + [- + [- ]]]" (with no intervening spaces); if + missing, the top and right margin will default to be the same as + the bottom and left margin. The margins are specified in print + points or in the chosen unit (see -u below). If the option is not + specified, BARCODE_TABLE is looked up in the environment, + otherwise no table is printed and each barcode will get its own + page. The size (but not the position) of a barcode item within a + table can also be selected using -g (see "geometry" above), + without struggling with external and internal margins. I still + think management of geometries in a table is suboptimal, but I + can't make it better without introducing incompatibilities. + +`-m margin(s)' + Specifies an internal margin for each sticker in the table. The + argument is of the form "," and the margin is + applied symmetrically to the sticker. If unspecified, the + environment variable BARCODE_MARGIN is used or a default internal + margin of 10 points is used. + +`-n' + "Numeric" output: don't print the ASCII form of the code, only the + bars. + +`-c' + No checksum character (for encodings that allow it, like code 39, + other codes, like UPC or EAN, ignore this option). + +`-E' + Encapsulated postscript (default is normal postscript). When the + output is generated as EPS only one barcode is encoded. + +`-P' + PCL output. Please note that the Y direction goes from top to + bottom for PCL, and the origin for an image is the top-left corner + instead of the bottom-left + +`-p pagesize' + Specify a non-default page size. The page size can be specified in + millimeters, inches or plain numbers (for example: "210x297mm", + "8.5x11in", "595x842"). A page specification as numbers will be + interpreted according to the current unit specification (see -u + below). If libpaper is available, you can also specify the page + size with its name, like "A3" or "letter" (libpaper is a standard + component of Debian GNU/Linux, but may be missing elsewhere). The + default page size is your system-wide default if libpaper is + there, A4 otherwise. + +`-u unit' + Choose the unit used in size specifications. Accepted values are + "mm", "cm", "in" and "pt". By default, the program will check + BARCODE_UNIT in the environment, and assume points otherwise (this + behaviour is compatible with 0.92 and previous versions. If -u + appears more than once, each instance will modified the behaviour + for the arguments at its right, as the command line is processes + left to right. The program internally works with points, and any + size is approximated to the nearest multiple of one point. The -u + option affect -g (geometry), -t (table) and -p (page size). + + + + +*Node: Supported Encodings + Supported Encodings + ******************* + + The program encodes text strings passed either on the command line +(with -b) or retrieved from standard input. The text representation is +interpreted according to the following rules. When auto-detection of +the encoding is enabled (i.e, no explicit encoding type is specified), +the encoding types are scanned to find one that can digest the text +string. The following list of supported types is sorted in the same +order the library uses when auto-detecting a suitable encoding for a +string. + +EAN + The EAN frontend is similar to UPC; it accepts strings of digits, + 12 or 7 characters long. Strings of 13 or 8 characters are + accepted if the provided checksum digit is correct. I expect most + users to feed input without a checksum, though. The add-2 and + add-5 extension are accepted for both the EAN-13 and the EAN-8 + encodings. The following are example of valid input strings: + "123456789012" (EAN-13), "1234567890128" (EAN-13 wih checksum), + "1234567" (EAN-8), "12345670 12345" (EAN-8 with checksum and + add-5), "123456789012 12" (EAN-13 with add-2), "123456789012 + 12345" (EAN-13 with add-5). + +UPC + The UPC frontend accepts only strings made up of digits (and, if a + supplemental encoding is used, a blank to separate it). It + accepts strings of 11 or 12 digits (UPC-A) and 6 or 7 or 8 digits + (UPC-E). + + The 12th digit of UPC-A is the checksum and is added by the + library if not specified in the input; if it is specified, it must + be the right checksum or the code is rejected as invalid. For + UPC-E, 6 digit are considered to be the middle part of the code, a + leading 0 is assumed and the checksum is added; 7 digits are + either considered the initial part (leading digit 0 or 1, checksum + missing) or the final part (checksum specified, leading 0 + assumed); 8 digits are considered to be the complete code, with + leading 0 or 1 and checksum. For both UPC-A and UPC-E, a trailing + string of 2 digits or 5 digits is accepted as well. Therefore, the + following are examples of valid strings that can be encoded as UPC: + "01234567890" (UPC-A) "012345678905" (UPC-A with checksum), + "012345" (UPC-E), "01234567890 12" (UPC-A, add-2) and "01234567890 + 12345" (UPC-A, add-5), "0123456 12" (UPC-E, add-2). Please note + that when setting BARCODE_ANY to auto-detect the encoding to be + used, 12-digit strings and 7-digit strings will always be + identified as EAN. This because I expect most user to provide + input without a checksum. If you need to specify UPC-with-checksum + as input you must explicitly set BARCODE_UPC as a flag or use -e + upc on the command line. + +ISBN + ISBN numbers are encoded as EAN-13 symbols, with an optional add-5 + trailer. The ISBN frontend of the library accepts real ISBN + numbers and deals with any hyphen and, if present, the ISBN + checksum character before encoding data. Valid representations for + ISBN strings are for example: "1-56592-292-1", "3-89721-122-X" and + "3-89721-122-X 06900". + +CODE 128-B + This encoding can represent all of the printing ASCII characters, + from the space (32) to DEL (127). The checksum digit is mandatory + in this encoding. + +CODE 128-C + The "C" variation of Code-128 uses Code-128 symbols to represent + two digits at a time (Code-128 is made up of 104 symbols whose + interpretation is controlled by the start symbol being used). Code + 128-C is thus the most compact way to represent any even number of + digits. The encoder refuses to deal with an odd number of digits + because the caller is expected to provide proper padding to an + even number of digits. (Since Code-128 includes control symbols to + switch charset, it is theoretically possible to represent the odd + digit as a Code 128-A or 128-B symbol, but this tool doesn't + currently implement this option). + +CODE 128 RAW + Code-128 output represented symbol-by-symbol in the input string. + To override part of the problems outlined below in specifying + code128 symbols, this pseudo-encoding allows the used to specify a + list of code128 symbols separated by spaces. Each symbol is + represented by a number in the range 0-105. The list should + include the leading character.The checksum and the stop character + are automatically added by the library. Most likely this + pseudo-encoding will be used with BARCODE_NO_ASCII and some + external program to supply the printed text. + +CODE 39 + The code-39 standard can encode uppercase letters, digits, the + blank space, plus, minus, dot, star, dollar, slash, percent. Any + string that is only composed of such characters is accepted by the + code-39 encoder. To avoid loosing information, the encoder refuses + to encode mixed-case strings (a lowercase string is nonetheless + accepted as a shortcut, but is encoded as uppercase). + +INTERLEAVED 2 OF 5 + This encoding can only represent an even number of digits (odd + digits are represented by bars, and even digits by the + interleaving spaces). The name stresses the fact that two of the + five items (bars or spaces) allocated to each symbol are wide, + while the rest are narrow. The checksum digit is optional (can be + disabled via BARCODE_NO_CHECKSUM). Since the number of digits, + including the checksum, must be even, a leading zero is inserted + in the string being encoded if needed (this is specifically stated + in the specs I have access to). + +CODE 128 + Automatic selection between alphabet A, B and C of the Code-128 + standard. This encoding can represent all ASCII symbols, from 0 + (NUL) to 127 (DEL), as well as four special symbols, named F1, F2, + F3, F4. The set of symbols available in this encoding is not + easily represented as input to the barcode library, so the + following convention is used. In the input string, which is a + C-language null-terminated string, the NUL char is represented by + the value 128 (0x80, 0200) and the F1-F4 characters are + represented by the values 193-196 (0xc1-0xc4, 0301-0304). The + values have been chosen to ease their representation as escape + sequences. + + Since the shell doesn't seem to interpret escape sequences on the + command line, the "-b" option cannot be easily used to designate + the strings to be encoded. As a workaround you can resort to the + command echo, either within back-ticks or used separately to + create a file that is then fed to the standard-input of barcode - + assuming your echo command processes escape sequences. The + newline character is especially though to encode (but not + impossible unless you use a csh variant. + + These problems only apply to the command-line tool; the use of + library functions doesn't give any problem. In needed, you can use + the "code 128 raw" pseudo-encoding to represent code128 symbols by + their numerical value. This encoding is used late in the + auto-selection mechanism because (almost) any input string can be + represented using code128. + +CODABAR + Codabar can encode the ten digits and a few special symbols + (minus, plus, dollar, colon, bar, dot). The characters "A", "B", + "C" and "D" are used to represent four different start/stop + characters. The input string to the barcode library can include + the start and stop characters or not include them (in which case + "A" is used as start and "B" as stop). Start and stop characters + in the input string can be either all lowercase or all uppercase + and are always printed as uppercase. + +PLESSEY + Plessey barcodes can encode all the hexadecimal digits. Alphabetic + digits in the input string must either be all lowercase or all + uppercase. The output text is always uppercase. + +MSI + MSI can only encode the decimal digits. While the standard + specifies either one or two check digits, the current + implementation in this library only generates one check digit. + +CODE 93 + The code-93 standard can natively encode 48 different characters, + including uppercase letters, digits, the blank space, plus, minus, + dot, star, dollar, slash, percent, as well as five special + characters: a start/stop delimiter and four "shift characters" + used for extended encoding. Using this "extended encoding" + method, any standard 7-bit ASCII character can be encoded, but it + takes up two symbol lengths in barcode if the character is not + natively supported (one of the 48). The encoder here fully + implements the code 93 encoding standard. Any characters natively + supported (A-Z, 0-9, ".+-/$&%") will be encoded as such - for any + other characters (such as lower case letters, brackets, + parentheses, etc.), the encoder will revert to extended encoding. + As a note, the option to exclude the checksum will eliminate the + two modulo-47 checksums (called C and K) from the barcode, but this + probably will make it unreadable by 99% of all scanning systems. + These checksums are specified to be used at the firmware level, + and their absence will be interpreted as an invalid barcode. + + + + +*Node: PCL Output + PCL Output + ********** + + While the default output is Postscript (possibly EPS), and Postscript +can be post-processed to almost anything, it is sometimes desirable to +create output directly usable by the specific printer at hand. PCL is +currently supported as an output format for this reason. Please note +that the Y coordinate for PCL goes from top to bottom, while for +Postscript it goes from bottom to top. Consistently, while in +Postscript you specify the bottom-left corner as origin, for PCL you +specify the top-left corner. + + Barcode output for PCL Printers (HP LaserJet and compatibles), was +developed using PCL5 Reference manuals from HP. that really refers to +these printers: + * LaserJet III, III P, III D, III Si, + + * LaserJet 4 family + + * LaserJet 5 family + + * LaserJet 6 family + + * Color LaserJet + + * DeskJet 1200 and 1600. + + + However, barcode printing uses a very small subset of PCL, probably +also LaserJet II should print it without problem, but the resulting +text may be horrible. + + The only real difference from one printer to another really depends +on which font are available in the printer, used in printing the label +associated to the bars (if requested). + + Earlier LaserJet supports only bitmaps fonts, so these are not +"scalable". (Ljet II ?), Also these fonts, when available, have a +specified direction, and not all of them are available in both Portrait +and Landscape mode. + + From LaserJet 4 series, (except 4L/5L that are entry-level printers), +Arial scalable font should be available, so it's the "default font" +used by this program. + + LaserJet III series printers (and 4L, 5L), don't feature "Arial" as a +resident font, so you should use BARCODE_OUT_PCL_III instead of +BARCODE_OUT_PCL., and font the font used will be "Univers" instead of +"Arial". + + Results on compatible printers, may depend on consistency of PCL5 +compatibility, in doubt, try BARCODE_OUT_PCL_III + + PJL commands are not used here, as it's not very compatible. + + Tested Printers: + * Hp LaserJet 4050 + + * Hp LaserJet 2100 + + * Epson N-1200 emul PCL + + * Toshiba DP2570 (copier) + PCL option + + * Epson EPL-7100 emul. HP LaserJet II: bars print fine but text is + bad. + + + + +*Node: Bugs and Pending Issues + Bugs and Pending Issues. + ************************ + + The current management of borders/margins is far from optimal. The +"default" margin applied by the library interferes with the external +representation, but I feel it is mandatory to avoid creating barcode +output with no surrounding white space (the problem is especially +relevant for EPS output). + + EAN-128 is not (yet) supported. I plan to implement it pretty soon +and then bless the package as version 1.0. + + + + + +Tag Table:Node: Top154 + Node: Overview526 + Node: The Barcode Object1404 +Node: The Field List2821 +Node: The Intermediate Representation6586 +Node: Supported Flags8359 +Node: The API11343 +Node: The barcode Executable14029 +Node: The Command Line14458 +Node: Supported Encodings19557 +Node: PCL Output28997 +Node: Bugs and Pending Issues31316 + + + +End Tag Table \ No newline at end of file diff --git a/barcode-0.98/doc/doc.barcode b/barcode-0.98/doc/doc.barcode new file mode 100644 index 00000000..7b460558 --- /dev/null +++ b/barcode-0.98/doc/doc.barcode @@ -0,0 +1,939 @@ +\input texinfo @c -*-texinfo-*- +% +% doc.barcode - main file for the documentation +% +%%%% + +%------------------------------------------------------------------------------ +% +% NOTE FOR THE UNAWARE USER +% ========================= +% +% This file is a texinfo source. It isn't the binary file of some strange +% editor of mine. If you want ascii, you should "make barcodedoc.txt". +% +%------------------------------------------------------------------------------ + +% +% This is not a conventional info file... +% I use two extra features: +% - The '%' as a comment marker, if at beg. of line ("\%" -> "%") +% - leading blanks are allowed +% + +@comment %**start of header +@setfilename barcode.info +@settitle Barcode @value{version} +@iftex +@afourpaper +@end iftex +@comment %**end of header + +@setchapternewpage off + +@set version 0.98 +@set update-month March 2002 + +@finalout + +@ifinfo + +This file is the User's Manual for the barcode library (version +@value{version}). + +@end ifinfo + +@setchapternewpage odd +@titlepage +@c use the new format for titles +@title barcode @value{version} +@subtitle A library for drawing bar codes +@subtitle @value{update-month} + +@author by Alessandro Rubini (@code{rubini@@gnu.org}) + +@end titlepage +@setchapternewpage off +@headings single + + +@node Top, Overview, (dir), (dir) +@top Barcode tools + +This file documents version @value{version} of the barcode +library and sample programs (@value{update-month}). + +@menu +* Overview:: +* The Barcode Object:: +* Supported Flags:: +* The API:: +* The barcode Executable:: +* Supported Encodings:: +* PCL Output:: +* Bugs and Pending Issues:: +@end menu + + +%########################################################################## +%########################################################################## + +@node Overview, The Barcode Object, Top, Top +@chapter Overview + +The @dfn{barcode} package is mainly a C library for creating bar-code +output files. It also includes a command line front-end and (in a +foreseeable future) a graphic frontend. + +The package is designed as a library because we think the main use for +barcode-generation tools is inside more featured applications. The +library addresses bar code printing as two distinct problems: creation +of bar information and actual conversion to an output format. To this +aim we use an intermediate representation for bar codes, which is +currently documented in the @file{ps.c} source file (not in this +document). + +Note that the library and the accompanying material is released +according to the GPL license, not the LGPL one. A copy of the GPL is +included in the distribution tarball. + +%########################################################################## + +@node The Barcode Object, Supported Flags, Overview, Top +@chapter The Underlying Data Structure + +Every barcode-related function acts on a data structure defined in the +@file{barcode.h} header, which must be included by any C source file +that uses the library. The header is installed by @t{make install}. + +The definition of the data structure is included here for reference: + +@lisp +struct Barcode_Item @{ + int flags; /* type of encoding and other flags */ + char *ascii; /* malloced */ + char *partial; /* malloced too */ + char *textinfo; /* information about text placement */ + char *encoding; /* code name, filled by encoding engine */ + int width, height; /* output units */ + int xoff, yoff; /* output units */ + int margin; /* output units */ + double scalef; /* requested scaling for barcode */ + int error; /* an errno-like value, in case of failure */ +@}; +@end lisp + +The exact meaning of each field and the various flags implemented are +described in the following sections. + +Even though you won't usually need to act on the contents of this +structure, some of the functions in the library receive arguments that +are directly related to one or more of these fields. + +%========================================================================== + +@menu +* The Field List:: +* The Intermediate Representation:: +@end menu + +%-------------------------------------------------------------------------- +@node The Field List, The Intermediate Representation, The Barcode Object, The Barcode Object +@section The Fields + +@table @code + +@item int flags; + + The flags are, as you may suspect, meant to specify the exact + behaviour of the library. They are often passed as an argument + to @i{barcode} functions and are discussed in the next section. + +@item char *ascii; +@itemx char *partial; +@itemx char *textinfo; +@itemx char *encoding; + + These fields are internally managed by the library, and you are + not expected to touch them if you use the provided API. All + of them are allocated with @i{malloc}. + +@item int width; +@itemx int height; + + They specify the width and height of the @i{active} barcode + region (i.e., excluding the white margin), in the units used + to create output data (for postscript they are points, 1/72th + of an inch, 0.352 mm). The fields can be either assigned to + in the structure or via @i{Barcode_Position()}, at your + choice. If either value or both are left to their default + value of zero, the output engine will assign default values + according to the specified scaling factor. If the specified + width is bigger than needed (according to the scaling factor), + the output barcode will be centered in its requested + region. If either the width of the height are too small for + the specified scale factor, the output bar code will expand + symmetrically around the requested region. + +@item int xoff; +@itemx int yoff; + + The fields specify offset from the coordinate origin of the + output engine (for postscript, position 0,0 is the lower left + corner of the page). The fields can be either assigned to in + the structure or via @i{Barcode_Position()}, at your choice. + The offset specifies where the white margin begins, not where + the first bar will be printed. To print real ink to the + specified position you should set @i{margin} to 0. + +@item int margin; + + The white margin that will be left around the printed area of + the bar code. The same margin is applied to all sides of the + printed area. The default value for the margin is defined in + @file{barcode.h} as @t{BARCODE_DEFAULT_MARGIN} (10). + +@item double scalef; + + The enlarge or shrink value for the bar code over its default + dimension. The @i{width} and @i{scalef} fields interact deeply + in the creation of the output, and a complete description of + the issues appears later in this section. + +@item int error; + + The field is used when a @i{barcode} function fails to host + an @t{errno}-like integer value. + +@end table + + +@unnumberedsubsec Use of the @i{width} and @i{scalef} fields. + +A width unit is the width of the thinnest bar and/or space in the +chosen code; it defaults to 1 point if the output is postscript or +encapsulated postscript. + +Either or both the code width and the scale factor can be left +unspecified (i.e., zero). The library deals with defaults in the +following way: + +@table @i + +@item Both unspecified + + If both the width and the scale factor are unspecified, the + scale factor will default to 1.0 and the width is calculated + according to the actual width of the bar code being printed. + +@item Width unspecified + + If the width is not specified, it is calculated according to + the values of @i{scalef}. + +@item Scale factor unspecified + + If the scale factor is not specified, it will be chosen so + that the generated bar code exactly fits the specified width. + +@item Both specified + + The code will be printed inside the specified region according + to the specified scale factor. It will be aligned to the left. + If, however, the chosen width is too small for the specific + bar code and scaling factor, then the code will extend + symmetrically to the left and to the right of the chosen + region. + +@end table + +%-------------------------------------------------------------------------- +@node The Intermediate Representation, , The Field List, The Barcode Object +@section The Intermediate Representation + +The encoding functions print their output into the @t{partial} and +@t{texinfo} fields of the barcode data structure. Those fields, together +with position information, are then used to generate actual output. +This is an informal description of the intermediate format. + +The first char in @t{partial} tells how much extra space to add to the +left of the bars. For EAN-13, it is used to leave space to print the +first digit, other codes may have '0' for no-extra-space-needed. + +The next characters are alternating bars and spaces, as multiples of the +base dimension which is 1 unless the code is rescaled. Rescaling is +calculated as the ratio from the requested width and the calculated +width. Digits represent bar/space dimensions. Lower-case letters +represent those bars that should extend lower than the others: 'a' is +equivalent to '1', 'b' is '2' and so on up to 'i' which is equivalent to +'9'. Other letters will be used for encoding-specific meanings, as soon +as I implement them. + +The @t{textinfo} string is made up of fields @t{%lf:%lf:%c} separated by +blank space. The first integer is the x position of the character, +the second is the font size (before rescaling) and the char item is +the character to be printed. + +Both the @t{partial} and @t{textinfo} strings may include ``@t{-}'' or +``@t{+}'' as special characters (in @t{textinfo} the char should be a +stand-alone word). They state where the text should be printed: below +the bars (``@t{-}'', default) or above the bars. This is used, for +example, to print the add-5 and add-2 codes to the right of UPC or EAN +codes (the add-5 extension is mostly used in ISBN codes). + + + + +%========================================================================== + +@node Supported Flags, The API, The Barcode Object, Top +@chapter The Flags + +The following flags are supported by version @value{version} of the +library: + +@table @code + +@item BARCODE_ENCODING_MASK + + The mask is used to extract the encoding-type identifier from + the @i{flags} field. + +@item BARCODE_EAN +@itemx BARCODE_UPC +@itemx BARCODE_ISBN +@itemx BARCODE_128B +@itemx BARCODE_128C +@itemx BARCODE_128 +@itemx BARCODE_128RAW +@itemx BARCODE_39 +@itemx BARCODE_I25 +@itemx BARCODE_CBR +@itemx BARCODE_MSI +@itemx BARCODE_PLS +@itemx BARCODE_93 + + The currently supported encoding types: EAN (13 digits, 8 + digits, 13 + 2 add-on and 13 + 5 add-on), UPC (UPC-A, UPC-E, + UPC-A with 2 or 5 digit add-on), ISBN (with or without the + 5-digit add-on), CODE128-B (the whole set of printable + ASCII characters), CODE128-C (two digits encoded by each barcode + symbol), CODE128 (all ASCII values), a ``raw-input'' pseudo-code + that generates CODE128 output, CODE39 (alphanumeric), + "interleaved 2 of 5" (numeric), Codabar (numeric plus a few + symbols), MSI (numeric) and Plessey (hex digits). + @xref{Supported Encodings}. + +@item BARCODE_ANY + + This special encoding type (represented by a value of zero, so + it will be the default) tells the encoding procedure to look + for the first encoding type that can deal with a textual + string. Therefore, a 11-digit code will be printed as UPC (as + well as 6-digit, 11+2 and 11+5), a 12-digit (or 7-digit, or + 12+2 or 12+5) as EAN13, an ISBN code (with or without hyphens, + with or without add-5) will be encoded in its EAN13 + representation, an even number of digits is encoded using + CODE128C and a generic string is encoded using CODE128B. Since + code-39 offers a much larger representation for the same + text string, code128-b is preferred over code39 for + alphanumeric strings. + +@item BARCODE_NO_ASCII + + Instructs the engine not to print the ascii string on + output. By default the bar code is accompanied with an ascii + version of the text it encodes. + +@item BARCODE_NO_CHECKSUM + + Instructs the engine not to add the checksum character to the + output. Not all the encoding types can drop the checksum; + those where the checksum is mandatory (like EAN and UPC) + just ignore the flag. + +@item BARCODE_OUTPUT_MASK + + The mask is used to extract the output-type identifier from + the @i{flags} field. + +@item BARCODE_OUT_PS +@itemx BARCODE_OUT_EPS +@itemx BARCODE_OUT_PCL +@itemx BARCODE_OUT_PCL_III + + The currently supported encoding types: full-page postscript + and encapsulated postscript; PCL (print command language, for + HP printers) and PCL-III (same as PCL, but uses a font not + available on older printers). + +@item BARCODE_OUT_NOHEADERS + + The flag instructs the printing engine not to print the header + and footer part of the file. This makes sense for the + postscript engine but might not make sense for other engines; + such other engines will silently ignore the flag just like + the PCL back-end does. + +@end table + +%########################################################################## + +@node The API, The barcode Executable, Supported Flags, Top +@chapter Functions Exported by the Library + +%MANPAGE barcode.3 +%M .TH BARCODE 3 "October 1999" "GNU" "GNU barcode" +%M .UC 4 +%M .SH NAME +%M barcode \- a library to create and print bar codes +%M .SH SYNOPSIS +%M .B #include +%M .sp +%M .BI "struct Barcode_Item *Barcode_Create(char *" text ");" +%M .br +%M .BI "int Barcode_Delete(struct Barcode_Item *" bc ");" +%M .br +%M .BI "int Barcode_Encode(struct Barcode_Item *" bc ", int " flags ");" +%M .br +%M .BI "int Barcode_Print(struct Barcode_Item *" bc ", FILE *" f ", int " flags ");" +%M .br +%M .BI "int Barcode_Position(struct Barcode_Item *" bc ", int " wid ", int " hei ", int " xoff ", int " yoff " , double " scalef ");" +%M .br +%M .BI "int Barcode_Encode_and_Print(char *" text ", FILE *" f ", int " wid ", int " hei ", int " xoff ", int " yoff ", int " flags ");" +%M .br +%M .BI "int Barcode_Version(char *" versionname ");" +%M +%M .SH DESCRIPTION +%M +%M The barcode family of library functions is meant to ease +%M creation of bar-code printouts. +%M +%M The information below is extracted from the texinfo file, which is the +%M preferred source of information. + +The functions included in the barcode library are declared in the +header file @t{barcode.h}. They perform the following tasks: + +@table @code + +@item struct Barcode_Item *Barcode_Create(char *text); + The function creates a new barcode object to deal with a + specified text string. It returns NULL in case of failure and + a pointer to a barcode data structure in case of success. + +@item int Barcode_Delete(struct Barcode_Item *bc); + Destroy a barcode object. Always returns 0 (success) + +@item int Barcode_Encode(struct Barcode_Item *bc, int flags); + Encode the text included in the @i{bc} object. Valid flags are + the encoding type (other flags are ignored) and + BARCODE_NO_CHECKSUM (other flags are silently ignored); if the + flag argument is zero, @t{bc->flags} will apply. The function + returns 0 on success and -1 in case of error. After + successful termination the data structure will host the + description of the bar code and its textual representation, + after a failure the @t{error} field will include the reason of + the failure. + +@item int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags); + Print the bar code described by @t{bc} to the specified file. + Valid flags are the output type, @t{BARCODE_NO_ASCII} and + @t{BARCODE_OUT_NOHEADERS}, other flags are ignored. If any of + these flags is zero, it will be inherited from @t{bc->flags} + which therefore takes precedence. The function returns 0 on + success and -1 in case of error (with @t{bc->error} set + accordingly). In case of success, the bar code is printed to + the specified file, which won't be closed after use. + +@item int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, int xoff, int yoff, double scalef); + The function is a shortcut to assign values to the data + structure. + +@item int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, int xoff, int yoff, int flags); + The function deals with the whole life of the barcode + object by calling the other functions; it uses all the specified + flags. + +@item int Barcode_Version(char *versionname); + Returns the current version as an integer number of the form + major * 10000 + minor * 100 + release. Therefore, version + 1.03.5 will be returned as 10305 and version 0.53 as 5300. If + the argument is non-null, it will be used to return the version + number as a string. Note that the same information is available from + two preprocessor macros: @t{BARCODE_VERSION} (the string) and + @t{BARCODE_VERSION_INT} (the integer number). + +@end table + +%MANPAGE END + +%########################################################################## + +@node The barcode Executable, Supported Encodings, The API, Top +@chapter The @i{barcode} frontend program + +%MANPAGE barcode.1 +%M .TH BARCODE 1 "October 2001" "GNU" "GNU barcode" +%M .UC 4 +%M .SH NAME +%M barcode \- a stand alone program to run the barcode library +%M .SH SYNOPSIS +%M .B barcode +%M [\-b - | string] [\-e encoding] [\-o - | outfile] [ +%M .I other-flags +%M ] +%M .SH DESCRIPTION +%M +%M The information below is extracted from the texinfo file, which is the +%M preferred source of information. +%M .PP +The @b{barcode} program is a front-end to access some features of the +library from the command line. It is able to read user supplied +strings from the command line or a data file (standard input by default) +and encode all of them. + +%M .SH OPTIONS +%M .PP + +@menu +* The Command Line:: +@end menu + +%-------------------------------------------------------------------------- +@node The Command Line, , The barcode Executable, The barcode Executable +@section The Command Line + + +@b{barcode} accepts the following options: + +@table @code + +@item --help or -h + Print a usage summary and exit. + +@item -i filename + Identify a file where strings to be encoded are read from. If + missing (and if @t{-b} is not used) it defaults to standard + input. Each data line of the input file will be used to create + one barcode output. + +@item -o filename + Output file. It defaults to standard output. + +@item -b string + Specify a single ``barcode'' string to be encoded. + The option can be used multiple times in order to encode + multiple strings (this will result in multi-page postscript + output or a table of barcodes if @t{-t} is specified). The + strings must match the encoding chosen; if it doesn't + match the program will print a warning to @t{stderr} and + generate ``blank'' output (although not zero-length). + Please note that a string including spaces or + other special characters must be properly quoted. + +@item -e encoding + @b{encoding} is the name of the chosen encoding format being + used. It defaults to the value of the environment variable + @t{BARCODE_ENCODING} or to auto detection if the environment is + also unset. + +@item -g geometry + The geometry argument is of the form ``[@i{} @t{x} + @i{}] [@t{+} @i{} @t{+} @i{}]'' (with + no intervening spaces). Unspecified margin values will result in + no margin; unspecified size results in default size. + The specified values represent print points by + default, and can be inches, millimeters or other units + according to the @t{-u} option or the @t{BARCODE_UNIT} + environment variable. The argument is used to place the + printout code on the page. Note that an additional white + margin of 10 points is added to the printout. If the option is + unspecified, @t{BARCODE_GEOMETRY} is looked up in the + environment, if missing a default size and no margin (but the + default 10 points) are used. + +@item -t table-geometry + Used to print several barcodes to a single page, this option + is meant to be used to print stickers. The argument is of the + form ``@i{} @t{x} @i{} [@t{+} @i{} + @t{+} @i{} [@t{-} @i{} [@t{-} + @i{}]]]'' (with no intervening spaces); if missing, + the top and right margin will default to be the same as the + bottom and left margin. The margins are specified in print + points or in the chosen unit (see @t{-u} below). If the + option is not specified, @t{BARCODE_TABLE} is looked up in the + environment, otherwise no table is printed and each barcode + will get its own page. The size (but not the position) + of a barcode item within a table can also be selected using + @t{-g} (see "geometry" above), without struggling with + external and internal margins. I still think management of + geometries in a table is suboptimal, but I can't make it + better without introducing incompatibilities. + + +@item -m margin(s) + Specifies an internal margin for each sticker in the + table. The argument is of the form + ``@i{}@t{,}@i{}'' and the margin is applied + symmetrically to the sticker. If unspecified, the environment + variable @t{BARCODE_MARGIN} is used or a default internal + margin of 10 points is used. + +@item -n + ``Numeric'' output: don't print the ASCII form of the code, + only the bars. + +@item -c + No checksum character (for encodings that allow it, like code 39, + other codes, like UPC or EAN, ignore this option). + +@item -E + Encapsulated postscript (default is normal postscript). When + the output is generated as EPS only one barcode is encoded. + +@item -P + PCL output. Please note that the Y direction goes from top + to bottom for PCL, and the origin for an image is the top-left + corner instead of the bottom-left + +@item -p pagesize + Specify a non-default page size. The page size can be specified + in millimeters, inches or plain numbers (for example: "@t{210x297mm}", + "@t{8.5x11in}", "@t{595x842}"). A page specification as numbers + will be interpreted according to the current unit specification + (see @t{-u} below). If libpaper is available, + you can also specify the page size with its name, like "@t{A3}" + or "@t{letter}" (libpaper is a standard component of Debian + GNU/Linux, but may be missing elsewhere). The default page + size is your system-wide default if libpaper is there, A4 otherwise. + +@item -u unit + Choose the unit used in size specifications. Accepted values + are ``mm'', ``cm'', ``in'' and ``pt''. By default, the program + will check @t{BARCODE_UNIT} in the environment, and assume + points otherwise (this behaviour is compatible with 0.92 and + previous versions. If @t{-u} appears more than once, each + instance will modified the behaviour for the arguments at its + right, as the command line is processes left to right. The + program internally works with points, and any size is + approximated to the nearest multiple of one point. The @t{-u} + option affect @t{-g} (geometry), @t{-t} (table) and @t{-p} + (page size). + +@end table + +%M .SH ENCODING TYPES +%M .PP + +%########################################################################## +@node Supported Encodings, PCL Output, The barcode Executable, Top +@chapter Supported Encodings + +The program encodes text strings passed either on the command line +(with -b) or retrieved from standard input. The text representation is +interpreted according to the following rules. When auto-detection +of the encoding is enabled (i.e, no explicit encoding type is specified), +the encoding types are scanned to find one that can digest the text string. +The following list of supported types is sorted in the same order +the library uses when auto-detecting a suitable encoding for a string. + +@table @var + +@item EAN + The EAN frontend is similar to UPC; it accepts strings of + digits, 12 or 7 characters long. Strings of 13 or 8 characters + are accepted if the provided checksum digit is correct. + I expect most users to feed input without a + checksum, though. The add-2 and add-5 extension are accepted for both + the EAN-13 and the EAN-8 encodings. + The following are example of valid input strings: + ``@t{123456789012}'' (EAN-13), ``@t{1234567890128}'' (EAN-13 wih + checksum), ``@t{1234567}'' (EAN-8), ``@t{12345670 12345}'' (EAN-8 + with checksum and add-5), + ``@t{123456789012 12}'' (EAN-13 with add-2), + ``@t{123456789012 12345}'' (EAN-13 with add-5). + +@item UPC + The UPC frontend accepts only strings made up of digits (and, + if a supplemental encoding is used, a blank to separate it). + It accepts strings of 11 or 12 digits (UPC-A) and 6 or 7 or 8 + digits (UPC-E). + + The 12th digit of UPC-A is the checksum and is added by the + library if not specified in the input; if it is specified, it + must be the right checksum or the code is rejected as invalid. + For UPC-E, 6 digit are considered to be the middle part of the + code, a leading 0 is assumed and the checksum is added; + 7 digits are either considered the initial part (leading digit + 0 or 1, checksum missing) or the final part (checksum specified, + leading 0 assumed); 8 digits are considered to be the complete code, + with leading 0 or 1 and checksum. + For both UPC-A and UPC-E, a trailing string of 2 digits or 5 digits + is accepted as well. Therefore, the following are examples + of valid strings that can be encoded as UPC: + ``@t{01234567890}'' (UPC-A) + ``@t{012345678905}'' (UPC-A with checksum), ``@t{012345}'' + (UPC-E), ``@t{01234567890 12}'' (UPC-A, add-2) and + ``@t{01234567890 12345}'' (UPC-A, add-5), ``@t{0123456 12}'' + (UPC-E, add-2). + Please note that when setting @t{BARCODE_ANY} to auto-detect + the encoding to be used, 12-digit strings and 7-digit strings + will always be identified as EAN. This because I expect most + user to provide input without a checksum. If you need to + specify UPC-with-checksum as input you must explicitly set + @t{BARCODE_UPC} as a flag or use @t{-e upc} on the command line. + +@item ISBN + ISBN numbers are encoded as EAN-13 symbols, with an optional + add-5 trailer. The ISBN frontend of the library accepts real + ISBN numbers and deals with any hyphen and, if present, the + ISBN checksum character before encoding data. Valid + representations for ISBN strings are for example: + ``@t{1-56592-292-1}'', ``@t{3-89721-122-X}'' and ``@t{3-89721-122-X + 06900}''. + +@item code 128-B + This encoding can represent all of the printing ASCII + characters, from the space (32) to DEL (127). The checksum + digit is mandatory in this encoding. + +@item code 128-C + The ``C'' variation of Code-128 uses Code-128 symbols to + represent two digits at a time (Code-128 is made up of 104 + symbols whose interpretation is controlled by the start symbol + being used). Code 128-C is thus the most compact way to + represent any even number of digits. The encoder refuses to + deal with an odd number of digits because the caller is + expected to provide proper padding to an even number of + digits. (Since Code-128 includes control symbols to switch + charset, it is theoretically possible to represent the odd + digit as a Code 128-A or 128-B symbol, but this tool doesn't + currently implement this option). + +@item code 128 raw + Code-128 output represented symbol-by-symbol in the input + string. To override part of the problems outlined below in + specifying code128 symbols, this pseudo-encoding allows the + used to specify a list of code128 symbols separated by + spaces. Each symbol is represented by a number in the range + 0-105. The list should include the leading character.The + checksum and the stop character are automatically added by the + library. Most likely this pseudo-encoding will be used with + @t{BARCODE_NO_ASCII} and some external program to supply the + printed text. + +@item code 39 + The code-39 standard can encode uppercase letters, digits, the + blank space, plus, minus, dot, star, dollar, slash, percent. + Any string that is only composed of such characters is + accepted by the code-39 encoder. To avoid loosing information, + the encoder refuses to encode mixed-case strings (a lowercase + string is nonetheless accepted as a shortcut, but is encoded + as uppercase). + +@item interleaved 2 of 5 + This encoding can only represent an even number of digits + (odd digits are represented by bars, and even digits by the + interleaving spaces). The name stresses the fact that two + of the five items (bars or spaces) allocated to each symbol + are wide, while the rest are narrow. The checksum digit is + optional (can be disabled via @t{BARCODE_NO_CHECKSUM}). + Since the number of digits, including the checksum, must be even, + a leading zero is inserted in the string being encoded if needed + (this is specifically stated in the specs I have access to). + +@item code 128 + Automatic selection between alphabet A, B and C of the Code-128 + standard. This encoding can represent all ASCII symbols, from + 0 (NUL) to 127 (DEL), as well as four special symbols, named + F1, F2, F3, F4. The set of symbols available in this encoding + is not easily represented as input to the @i{barcode} library, + so the following convention is used. In the input string, + which is a C-language null-terminated string, the NUL char + is represented by the value 128 (0x80, 0200) and the F1-F4 characters + are represented by the values 193-196 (0xc1-0xc4, 0301-0304). + The values have been chosen to ease their representation as + escape sequences. + + Since the shell doesn't seem to interpret escape sequences on the + command line, the "-b" option cannot be easily used to designate + the strings to be encoded. As a workaround you can resort + to the command @t{echo}, either within back-ticks or used + separately to create a file that is then fed to the standard-input + of @i{barcode} -- assuming your @t{echo} command processes escape + sequences. The newline character is especially though to encode + (but not impossible unless you use a @t{csh} variant. + + These problems only apply to the command-line tool; the use of + library functions doesn't give any problem. In needed, you can + use the ``@i{code 128 raw}'' pseudo-encoding to represent + code128 symbols by their numerical value. This encoding is + used late in the auto-selection mechanism because (almost) any + input string can be represented using code128. + +@item Codabar + Codabar can encode the ten digits and a few special symbols + (minus, plus, dollar, colon, bar, dot). The characters + ``@t{A}'', ``@t{B}'', ``@t{C}'' and ``@t{D}'' are used to + represent four different start/stop characters. The input + string to the barcode library can include the start and stop + characters or not include them (in which case ``@t{A}'' is + used as start and ``@t{B}'' as stop). Start and stop + characters in the input string can be either all lowercase or + all uppercase and are always printed as uppercase. + +@item Plessey + Plessey barcodes can encode all the hexadecimal + digits. Alphabetic digits in the input string must either be + all lowercase or all uppercase. The output text is always + uppercase. + +@item MSI + MSI can only encode the decimal digits. While the standard + specifies either one or two check digits, the current + implementation in this library only generates one check digit. + +@item code 93 + The code-93 standard can natively encode 48 different characters, + including uppercase letters, digits, the blank space, plus, minus, + dot, star, dollar, slash, percent, as well as five special + characters: a start/stop delimiter and four "shift characters" used + for extended encoding. Using this "extended encoding" method, any + standard 7-bit ASCII character can be encoded, but it takes up two + symbol lengths in barcode if the character is not natively supported + (one of the 48). + The encoder here fully implements the code 93 encoding standard. + Any characters natively supported (A-Z, 0-9, ".+-/$&%") will be + encoded as such - for any other characters (such as lower case + letters, brackets, parentheses, etc.), the encoder will revert + to extended encoding. + As a note, the option to exclude the checksum will eliminate the + two modulo-47 checksums (called C and K) from the barcode, but this + probably will make it unreadable by 99% of all scanning systems. + These checksums are specified to be used at the firmware level, + and their absence will be interpreted as an invalid barcode. + + +@end table + +%M .SH PCL OUTPUT + +%########################################################################## +@node PCL Output, Bugs and Pending Issues, Supported Encodings, Top +@chapter PCL Output + +While the default output is Postscript (possibly EPS), and Postscript +can be post-processed to almost anything, it is sometimes desirable to +create output directly usable by the specific printer at hand. +PCL is currently supported as an output format for this reason. +Please note that the Y coordinate for PCL goes from top to bottom, while +for Postscript it goes from bottom to top. Consistently, while in +Postscript you specify the bottom-left corner as origin, for PCL +you specify the top-left corner. + +Barcode output for PCL Printers (HP LaserJet and compatibles), +was developed using PCL5 Reference manuals from HP. +that really refers to these printers: +@itemize @bullet + +@item +LaserJet III, III P, III D, III Si, + +@item +LaserJet 4 family + +@item +LaserJet 5 family + +@item +LaserJet 6 family + +@item +Color LaserJet + +@item +DeskJet 1200 and 1600. + +@end itemize + +However, barcode printing uses a very small subset of PCL, probably also +LaserJet II should print it without problem, but the resulting text may +be horrible. + +The only real difference from one printer to another really depends on +which font are available in the printer, used in printing the label +associated to the bars (if requested). + +Earlier LaserJet supports only bitmaps fonts, so these are not +"scalable". (Ljet II ?), Also these fonts, when available, have a +specified direction, and not all of them are available in +both Portrait and Landscape mode. + +From LaserJet 4 series, (except 4L/5L that are entry-level printers), +Arial scalable font should be available, so it's the "default font" +used by this program. + +LaserJet III series printers (and 4L, 5L), don't feature "Arial" as a +resident font, so you should use @t{BARCODE_OUT_PCL_III} instead of +@t{BARCODE_OUT_PCL.}, and font the font used will be "Univers" instead +of "Arial". + +Results on compatible printers, may depend on consistency of +PCL5 compatibility, in doubt, try BARCODE_OUT_PCL_III + +PJL commands are not used here, as it's not very compatible. + + +Tested Printers: +@itemize @bullet +@item +Hp LaserJet 4050 +@item +Hp LaserJet 2100 +@item +Epson N-1200 emul PCL +@item +Toshiba DP2570 (copier) + PCL option +@item +Epson EPL-7100 emul. HP LaserJet II: bars print fine but text is bad. +@end itemize + + +%M .SH BUGS + +%########################################################################## +@node Bugs and Pending Issues, , PCL Output, Top +@chapter Bugs and Pending Issues. + +The current management of borders/margins is far from optimal. The +``default'' margin applied by the library interferes with the external +representation, but I feel it is mandatory to avoid creating barcode +output with no surrounding white space (the problem is especially +relevant for EPS output). + +EAN-128 is not (yet) supported. I plan to implement it pretty soon and +then bless the package as version 1.0. + +%M .SH "SEE ALSO" +%M \fBbarcode(3)\fP +%M +%M .SH AUTHORS +%M Alessandro Rubini (maintainer) +%M .PP +%M Leonid A. Broukhis (several encodings) +%M .PP +%M Andrea Scopece (PCL output) +%MANPAGE END + +@iftex +@contents +@end iftex + +@bye +@c LocalWords: barcode ifinfo titlepage iftex texinfo ascii frontend LGPL +@c LocalWords: tarball malloced textinfo scalef isbn Plessey codabar GPL Ljet +@c LocalWords: LocalWords LaserJet Univers Arial Debian libpaper pagesize +@c LocalWords: Epson MANPAGE stderr barcodes emul DeskJet xmargin ymargin +@c LocalWords: leftmargin rightmargin topmargin bottommargin unset struct +@c LocalWords: NOHEADERS yoff xoff versionname errno malloc behaviour charset diff --git a/barcode-0.98/doc/infofilter b/barcode-0.98/doc/infofilter new file mode 100755 index 00000000..92bc8b7d --- /dev/null +++ b/barcode-0.98/doc/infofilter @@ -0,0 +1,16 @@ +#! /usr/bin/sed -f + + +# allow "%" as a comment char, but only at the beginning of the line +s/^%/@c / +#s/[^\\]%.*$// +s/^\\%/%/ + +#preserve blanks in @lisp blocks +/@lisp/,/@end lisp/ p +/@lisp/,/@end lisp/ d + +# remove leading blanks +s/^[ ]*// + +#s/\\t/@code/g diff --git a/barcode-0.98/doc/manpager b/barcode-0.98/doc/manpager new file mode 100755 index 00000000..46de5be2 --- /dev/null +++ b/barcode-0.98/doc/manpager @@ -0,0 +1,120 @@ +#! /usr/bin/awk -f +# Copyright (c) 1998-2001 Alessandro Rubini + +BEGIN {IN=0} + +/^%MANPAGE END/ {IN=0; next} +/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} +IN==0 {next} + +/^%MSKIP/ {SKIP=1;next} +/^%M/ {SKIP=0} + +/^@menu/ {SKIP=1;next} +/^@end menu/ {SKIP=0;next} + +SKIP==1 {next} +/^%M$/ {next} +/^@ignore/ {next} +/^@end ign/ {next} + +#now perform all the substitutions needed + + { gsub("^%M ?",""); } + +# Use gensub for converting tags: itz Sep 30 1998 +# +# However, the gensub function is gawk-specific, and we want things +# to work with original-awk too (for portability). +# Therefore, use a normal gsub, even though it's a subobptimal solution +# as it may step in extra braces. The good solution will be piping to sed, +# or match, extract subesxpression, replace, reinsert -- bleah... +# (ARub, Oct 10 2000) +/@b\{/ { + #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); + gsub("@b\{","\\fB"); + gsub("\}","\\fP"); +} + +/@var\{/ { + #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); + gsub("@var\{","\\fB"); + gsub("\}","\\fP"); +} + +/@(samp|code|file)\{/ { + #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); + gsub("@(samp|code|file)\{",""); + gsub("\}",""); +} + + +/@xref\{.*\}\./ { + gsub(/@xref\{.*\}\./,""); +} + +/@ref\{.*\}/ { + gsub("@ref\{",""); + gsub("\}",""); +} + +/@\*/ { + gsub(/@\* */,"\n.br\n"); +} + +/@[a-z]+\{/ { + gsub("@[a-z]+\\{",""); + gsub("}",""); + } + +/^@table/ { TABLE=1; } +/^@itemize/ { TABLE=1; next} + +/^@item/ { + gsub("^@item *",""); + printf ".TP\n%s\n",$0 > NAME; + NEEDLP=0; next; + } + +/^@end table/ {TABLE=0} +/^@end itemize/ {TABLE=0} + +# discard other texinfo commands + +/^@/ {next} + +# manage comments and '%' + +/^%/ {next} + + + { + gsub("[^\\\\]%.*$",""); + gsub("\\%","%"); + } + +# remove leading blanks + +/^[ \t]/ {gsub("^[ \t]*","");} + +# put a .LP at blank lines + +/^.nf/ {USELP=0} +/^.fi/ {USELP=1} + +/^$/ {if (USELP) {NEEDLP++; next;} } + + +/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } + +/^.TH/ {USELP=1} + +# Escape single slashes (e.g. in documentation for `-l' command line option) + + {gsub("\\\\ ", "\\\\ ");} + + {gsub("~", "~~");} + + {print > NAME} + + diff --git a/barcode-0.98/doc/mktxt b/barcode-0.98/doc/mktxt new file mode 100755 index 00000000..bd3f88ba --- /dev/null +++ b/barcode-0.98/doc/mktxt @@ -0,0 +1,38 @@ +#! /usr/bin/awk -f + +# Warning: this may use gnu-awk features + +# Program to create ascii from info; +# Missing: table of contents + +# skip + +BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} + + +/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} + +NODE==1 { next } + +NODELINE==1 { + NODELINE=2; + sub("^.*Node: ","*Node: "); + sub(",.*$",""); + printf "\n\n\n%s",$0; +#print + next; + } + +NODELINE { NODELINE=NODELINE+1 } + +NODELINE==4 { printf "\t\t\t\t"; } +NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} + + +/^\* Menu:$/ { KEEP=0 } + + + +KEEP==0 { next } + +{ print } diff --git a/barcode-0.98/doc/texi2html b/barcode-0.98/doc/texi2html new file mode 100755 index 00000000..2c61aa93 --- /dev/null +++ b/barcode-0.98/doc/texi2html @@ -0,0 +1,2021 @@ +#!/usr/local/bin/perl +'di '; +'ig 00 '; +#+############################################################################## +# # +# File: texi2html # +# # +# Description: Program to transform most Texinfo documents to HTML # +# # +#-############################################################################## + +# @(#)texi2html 1.51 09/10/96 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch + +# The man page for this program is included at the end of this file and can be +# viewed using the command 'nroff -man texi2html'. +# Please read the copyright at the end of the man page. + +#+++############################################################################ +# # +# Constants # +# # +#---############################################################################ + +$DEBUG_TOC = 1; +$DEBUG_INDEX = 2; +$DEBUG_BIB = 4; +$DEBUG_GLOSS = 8; +$DEBUG_DEF = 16; +$DEBUG_HTML = 32; +$DEBUG_USER = 64; + +$BIBRE = '\[[\w\/]+\]'; # RE for a bibliography reference +$FILERE = '[\/\w.+-]+'; # RE for a file name +$VARRE = '[^\s\{\}]+'; # RE for a variable name +$NODERE = '[^@{}:\'`",]+'; # RE for a node name +$NODESRE = '[^@{}:\'`"]+'; # RE for a list of node names +$XREFRE = '[^@{}]+'; # RE for a xref (should use NODERE) + +$ERROR = "***"; # prefix for errors and warnings +$THISPROG = "texi2html 1.51"; # program name and version +$HOMEPAGE = "http://wwwcn.cern.ch/dci/texi2html/"; # program home page +$TODAY = &pretty_date; # like "20 September 1993" +$SPLITTAG = "\n"; # tag to know where to split +$PROTECTTAG = "_ThisIsProtected_"; # tag to recognize protected sections +$html2_doctype = ''; + +# +# language dependent constants +# +#$LDC_SEE = 'see'; +#$LDC_SECTION = 'section'; +#$LDC_IN = 'in'; +#$LDC_TOC = 'Table of Contents'; +#$LDC_GOTO = 'Go to the'; +#$LDC_FOOT = 'Footnotes'; +# TODO: @def* shortcuts + +# +# pre-defined indices +# +%predefined_index = ( + 'cp', 'c', + 'fn', 'f', + 'vr', 'v', + 'ky', 'k', + 'pg', 'p', + 'tp', 't', + ); + +# +# valid indices +# +%valid_index = ( + 'c', 1, + 'f', 1, + 'v', 1, + 'k', 1, + 'p', 1, + 't', 1, + ); + +# +# texinfo section names to level +# +%sec2level = ( + 'top', 0, + 'chapter', 1, + 'unnumbered', 1, + 'majorheading', 1, + 'chapheading', 1, + 'appendix', 1, + 'section', 2, + 'unnumberedsec', 2, + 'heading', 2, + 'appendixsec', 2, + 'appendixsection', 2, + 'subsection', 3, + 'unnumberedsubsec', 3, + 'subheading', 3, + 'appendixsubsec', 3, + 'subsubsection', 4, + 'unnumberedsubsubsec', 4, + 'subsubheading', 4, + 'appendixsubsubsec', 4, + ); + +# +# accent map, TeX command to ISO name +# +%accent_map = ( + '"', 'uml', + '~', 'tilde', + '^', 'circ', + '`', 'grave', + '\'', 'acute', + ); + +# +# texinfo "simple things" (@foo) to HTML ones +# +%simple_map = ( + # cf. makeinfo.c + "*", "
", # HTML+ + " ", " ", + "\n", "\n", + "|", "", + # spacing commands + ":", "", + "!", "!", + "?", "?", + ".", ".", + ); + +# +# texinfo "things" (@foo{}) to HTML ones +# +%things_map = ( + 'TeX', 'TeX', + 'br', '

', # paragraph break + 'bullet', '*', + 'copyright', '(C)', + 'dots', '...', + 'equiv', '==', + 'error', 'error-->', + 'expansion', '==>', + 'minus', '-', + 'point', '-!-', + 'print', '-|', + 'result', '=>', + 'today', $TODAY, + ); + +# +# texinfo styles (@foo{bar}) to HTML ones +# +%style_map = ( + 'asis', '', + 'b', 'B', + 'cite', 'CITE', + 'code', 'CODE', + 'ctrl', '&do_ctrl', # special case + 'dfn', 'STRONG', # DFN tag is illegal in the standard + 'dmn', '', # useless + 'emph', 'EM', + 'file', '"TT', # will put quotes, cf. &apply_style + 'i', 'I', + 'kbd', 'KBD', + 'key', 'KBD', + 'r', '', # unsupported + 'samp', '"SAMP', # will put quotes, cf. &apply_style + 'sc', '&do_sc', # special case + 'strong', 'STRONG', + 't', 'TT', + 'titlefont', '', # useless + 'var', 'VAR', + 'w', '', # unsupported + ); + +# +# texinfo format (@foo/@end foo) to HTML ones +# +%format_map = ( + 'display', 'PRE', + 'example', 'PRE', + 'format', 'PRE', + 'lisp', 'PRE', + 'quotation', 'BLOCKQUOTE', + 'smallexample', 'PRE', + 'smalllisp', 'PRE', + # lists + 'itemize', 'UL', + 'enumerate', 'OL', + # poorly supported + 'flushleft', 'PRE', + 'flushright', 'PRE', + ); + +# +# texinfo definition shortcuts to real ones +# +%def_map = ( + # basic commands + 'deffn', 0, + 'defvr', 0, + 'deftypefn', 0, + 'deftypevr', 0, + 'defcv', 0, + 'defop', 0, + 'deftp', 0, + # basic x commands + 'deffnx', 0, + 'defvrx', 0, + 'deftypefnx', 0, + 'deftypevrx', 0, + 'defcvx', 0, + 'defopx', 0, + 'deftpx', 0, + # shortcuts + 'defun', 'deffn Function', + 'defmac', 'deffn Macro', + 'defspec', 'deffn {Special Form}', + 'defvar', 'defvr Variable', + 'defopt', 'defvr {User Option}', + 'deftypefun', 'deftypefn Function', + 'deftypevar', 'deftypevr Variable', + 'defivar', 'defcv {Instance Variable}', + 'defmethod', 'defop Method', + # x shortcuts + 'defunx', 'deffnx Function', + 'defmacx', 'deffnx Macro', + 'defspecx', 'deffnx {Special Form}', + 'defvarx', 'defvrx Variable', + 'defoptx', 'defvrx {User Option}', + 'deftypefunx', 'deftypefnx Function', + 'deftypevarx', 'deftypevrx Variable', + 'defivarx', 'defcvx {Instance Variable}', + 'defmethodx', 'defopx Method', + ); + +# +# things to skip +# +%to_skip = ( + # comments + 'c', 1, + 'comment', 1, + # useless + 'contents', 1, + 'shortcontents', 1, + 'summarycontents', 1, + 'footnotestyle', 1, + 'end ifclear', 1, + 'end ifset', 1, + 'titlepage', 1, + 'end titlepage', 1, + # unsupported commands (formatting) + 'afourpaper', 1, + 'cropmarks', 1, + 'finalout', 1, + 'headings', 1, + 'need', 1, + 'page', 1, + 'setchapternewpage', 1, + 'everyheading', 1, + 'everyfooting', 1, + 'evenheading', 1, + 'evenfooting', 1, + 'oddheading', 1, + 'oddfooting', 1, + 'smallbook', 1, + 'vskip', 1, + 'filbreak', 1, + # unsupported formats + 'cartouche', 1, + 'end cartouche', 1, + 'group', 1, + 'end group', 1, + ); + +#+++############################################################################ +# # +# Argument parsing, initialisation # +# # +#---############################################################################ + +$use_bibliography = 1; +$use_acc = 0; +$debug = 0; +$doctype = ''; +$check = 0; +$expandinfo = 0; +$use_glossary = 0; +$invisible_mark = ''; +$use_iso = 0; +@include_dirs = (); +$show_menu = 0; +$number_sections = 0; +$split_node = 0; +$split_chapter = 0; +$monolithic = 0; +$verbose = 0; +$usage = <= 0 && $ARGV[0] =~ /^-/) { + $_ = shift(@ARGV); + if (/^-acc$/) { $use_acc = 1; next; } + if (/^-d(ebug)?(\d+)?$/) { $debug = $2 || shift(@ARGV); next; } + if (/^-doctype$/) { $doctype = shift(@ARGV); next; } + if (/^-c(heck)?$/) { $check = 1; next; } + if (/^-e(xpandinfo)?$/) { $expandinfo = 1; next; } + if (/^-g(lossary)?$/) { $use_glossary = 1; next; } + if (/^-i(nvisible)?$/) { $invisible_mark = shift(@ARGV); next; } + if (/^-iso$/) { $use_iso = 1; next; } + if (/^-I(.+)?$/) { push(@include_dirs, $1 || shift(@ARGV)); next; } + if (/^-m(enu)?$/) { $show_menu = 1; next; } + if (/^-mono(lithic)?$/) { $monolithic = 1; next; } + if (/^-n(umber)?$/) { $number_sections = 1; next; } + if (/^-s(plit)?_?(n(ode)?|c(hapter)?)?$/) { + if ($2 =~ /^n/) { + $split_node = 1; + } else { + $split_chapter = 1; + } + next; + } + if (/^-v(erbose)?$/) { $verbose = 1; next; } + die $usage; +} +if ($check) { + die $usage unless @ARGV > 0; + ✓ + exit; +} + +if (($split_node || $split_chapter) && $monolithic) { + warn "Can't use -monolithic with -split, -monolithic ignored.\n"; + $monolithic = 0; +} +if ($expandinfo) { + $to_skip{'ifinfo'}++; + $to_skip{'end ifinfo'}++; +} else { + $to_skip{'iftex'}++; + $to_skip{'end iftex'}++; +} +$invisible_mark = '' if $invisible_mark eq 'xbm'; +die $usage unless @ARGV == 1; +$docu = shift(@ARGV); +if ($docu =~ /.*\//) { + chop($docu_dir = $&); + $docu_name = $'; +} else { + $docu_dir = '.'; + $docu_name = $docu; +} +unshift(@include_dirs, $docu_dir); +$docu_name =~ s/\.te?x(i|info)?$//; # basename of the document + +$docu_doc = "$docu_name.html"; # document's contents +if ($monolithic) { + $docu_toc = $docu_foot = $docu_doc; +} else { + $docu_toc = "${docu_name}_toc.html"; # document's table of contents + $docu_foot = "${docu_name}_foot.html"; # document's footnotes +} + +# +# variables +# +%value = (); # hold texinfo variables +$value{'html'} = 1; # predefine html (the output format) +$value{'texi2html'} = '1.51'; # predefine texi2html (the translator) +# _foo: internal to track @foo +foreach ('_author', '_title', '_subtitle', + '_settitle', '_setfilename') { + $value{$_} = ''; # prevent -w warnings +} +%node2sec = (); # node to section name +%node2href = (); # node to HREF +%bib2href = (); # bibliography reference to HREF +%gloss2href = (); # glossary term to HREF +@sections = (); # list of sections +%tag2pro = (); # protected sections + +# +# initial indexes +# +$bib_num = 0; +$foot_num = 0; +$gloss_num = 0; +$idx_num = 0; +$sec_num = 0; +$doc_num = 0; +$html_num = 0; + +# +# can I use ISO8879 characters? (HTML+) +# +if ($use_iso) { + $things_map{'bullet'} = "•"; + $things_map{'copyright'} = "©"; + $things_map{'dots'} = "…"; + $things_map{'equiv'} = "≡"; + $things_map{'expansion'} = "→"; + $things_map{'point'} = "∗"; + $things_map{'result'} = "⇒"; +} + +# +# read texi2html extensions (if any) +# +$extensions = 'texi2html.ext'; # extensions in working directory +if (-f $extensions) { + print "# reading extensions from $extensions\n" if $verbose; + require($extensions); +} +($progdir = $0) =~ s/[^\/]+$//; +if ($progdir && ($progdir ne './')) { + $extensions = "${progdir}texi2html.ext"; # extensions in texi2html directory + if (-f $extensions) { + print "# reading extensions from $extensions\n" if $verbose; + require($extensions); + } +} + +print "# reading from $docu\n" if $verbose; + +#+++############################################################################ +# # +# Pass 1: read source, handle command, variable, simple substitution # +# # +#---############################################################################ + +@lines = (); # whole document +@toc_lines = (); # table of contents +$toplevel = 0; # top level seen in hierarchy +$curlevel = 0; # current level in TOC +$node = ''; # current node name +$in_table = 0; # am I inside a table +$table_type = ''; # type of table ('', 'f', 'v') +@tables = (); # nested table support +$in_bibliography = 0; # am I inside a bibliography +$in_glossary = 0; # am I inside a glossary +$in_top = 0; # am I inside the top node +$in_pre = 0; # am I inside a preformatted section +$in_list = 0; # am I inside a list +$in_html = 0; # am I inside an HTML section +$first_line = 1; # is it the first line +$dont_html = 0; # don't protect HTML on this line +$split_num = 0; # split index +$deferred_ref = ''; # deferred reference for indexes +@html_stack = (); # HTML elements stack +$html_element = ''; # current HTML element +&html_reset; + +# build code for simple substitutions +# the maps used (%simple_map and %things_map) MUST be aware of this +# watch out for regexps, / and escaped characters! +$subst_code = ''; +foreach (keys(%simple_map)) { + ($re = $_) =~ s/(\W)/\\$1/g; # protect regexp chars + $subst_code .= "s/\\\@$re/$simple_map{$_}/g;\n"; +} +foreach (keys(%things_map)) { + $subst_code .= "s/\\\@$_\\{\\}/$things_map{$_}/g;\n"; +} +if ($use_acc) { + # accentuated characters + foreach (keys(%accent_map)) { + if ($_ eq "`") { + $subst_code .= "s/$;3"; + } elsif ($_ eq "'") { + $subst_code .= "s/$;4"; + } else { + $subst_code .= "s/\\\@\\$_"; + } + $subst_code .= "([aeiou])/&\${1}$accent_map{$_};/gi;\n"; + } +} +eval("sub simple_substitutions { $subst_code }"); + +&init_input; +while ($_ = &next_line) { + # + # remove \input on the first lines only + # + if ($first_line) { + next if /^\\input/; + $first_line = 0; + } + # + # parse texinfo tags + # + $tag = ''; + $end_tag = ''; + if (/^\@end\s+(\w+)\b/) { + $end_tag = $1; + } elsif (/^\@(\w+)\b/) { + $tag = $1; + } + # + # handle @ifhtml / @end ifhtml + # + if ($in_html) { + if ($end_tag eq 'ifhtml') { + $in_html = 0; + } else { + $tag2pro{$in_html} .= $_; + } + next; + } elsif ($tag eq 'ifhtml') { + $in_html = $PROTECTTAG . ++$html_num; + push(@lines, $in_html); + next; + } + # + # try to skip the line + # + if ($end_tag) { + next if $to_skip{"end $end_tag"}; + } elsif ($tag) { + next if $to_skip{$tag}; + last if $tag eq 'bye'; + } + if ($in_top) { + # parsing the top node + if ($tag eq 'node' || $tag eq 'include' || $sec2level{$tag}) { + # no more in top + $in_top = 0; + } else { + # skip it + next; + } + } + # + # try to remove inlined comments + # syntax from tex-mode.el comment-start-skip + # + s/((^|[^\@])(\@\@)*)\@c(omment)? .*/$1/; + # non-@ substitutions cf. texinfmt.el + s/``/\"/g; + s/''/\"/g; + s/([\w ])---([\w ])/$1--$2/g; + # + # analyze the tag + # + if ($tag) { + # skip lines + &skip_until($tag), next if $tag eq 'ignore'; + if ($expandinfo) { + &skip_until($tag), next if $tag eq 'iftex'; + } else { + &skip_until($tag), next if $tag eq 'ifinfo'; + } + &skip_until($tag), next if $tag eq 'tex'; + # handle special tables + if ($tag eq 'table') { + $table_type = ''; + } elsif ($tag eq 'ftable') { + $tag = 'table'; + $table_type = 'f'; + } elsif ($tag eq 'vtable') { + $tag = 'table'; + $table_type = 'v'; + } + # special cases + if ($tag eq 'top' || ($tag eq 'node' && /^\@node\s+top\s*,/i)) { + $in_top = 1; + @lines = (); # ignore all lines before top (title page garbage) + next; + } elsif ($tag eq 'node') { + $in_top = 0; + warn "$ERROR Bad node line: $_" unless $_ =~ /^\@node\s$NODESRE$/o; + $_ = &protect_html($_); # if node contains '&' for instance + s/^\@node\s+//; + ($node) = split(/,/); + &normalise_node($node); + if ($split_node) { + &next_doc; + push(@lines, $SPLITTAG) if $split_num++; + push(@sections, $node); + } + next; + } elsif ($tag eq 'include') { + if (/^\@include\s+($FILERE)\s*$/o) { + $file = $1; + unless (-e $file) { + foreach $dir (@include_dirs) { + $file = "$dir/$1"; + last if -e $file; + } + } + if (-e $file) { + &open($file); + print "# including $file\n" if $verbose; + } else { + warn "$ERROR Can't find $file, skipping"; + } + } else { + warn "$ERROR Bad include line: $_"; + } + next; + } elsif ($tag eq 'ifclear') { + if (/^\@ifclear\s+($VARRE)\s*$/o) { + next unless defined($value{$1}); + &skip_until($tag); + } else { + warn "$ERROR Bad ifclear line: $_"; + } + next; + } elsif ($tag eq 'ifset') { + if (/^\@ifset\s+($VARRE)\s*$/o) { + next if defined($value{$1}); + &skip_until($tag); + } else { + warn "$ERROR Bad ifset line: $_"; + } + next; + } elsif ($tag eq 'menu') { + unless ($show_menu) { + &skip_until($tag); + next; + } + &html_push_if($tag); + push(@lines, &html_debug("\n", __LINE__)); + } elsif ($format_map{$tag}) { + $in_pre = 1 if $format_map{$tag} eq 'PRE'; + &html_push_if($format_map{$tag}); + push(@lines, &html_debug("\n", __LINE__)); + $in_list++ if $format_map{$tag} eq 'UL' || $format_map{$tag} eq 'OL' ; + push(@lines, &debug("<$format_map{$tag}>\n", __LINE__)); + next; + } elsif ($tag eq 'table') { + if (/^\@[fv]?table\s+\@(\w+)\s*$/) { + $in_table = $1; + unshift(@tables, join($;, $table_type, $in_table)); + push(@lines, &debug("

\n", __LINE__)); + &html_push_if('DL'); + push(@lines, &html_debug("\n", __LINE__)); + } else { + warn "$ERROR Bad table line: $_"; + } + next; + } elsif ($tag eq 'synindex' || $tag eq 'syncodeindex') { + if (/^\@$tag\s+(\w)\w\s+(\w)\w\s*$/) { + eval("*${1}index = *${2}index"); + } else { + warn "$ERROR Bad syn*index line: $_"; + } + next; + } elsif ($tag eq 'sp') { + push(@lines, &debug("

\n", __LINE__)); + next; + } elsif ($tag eq 'setref') { + &protect_html; # if setref contains '&' for instance + if (/^\@$tag\s*{($NODERE)}\s*$/) { + $setref = $1; + $setref =~ s/\s+/ /g; # normalize + $setref =~ s/ $//; + $node2sec{$setref} = $name; + $node2href{$setref} = "$docu_doc#$docid"; + } else { + warn "$ERROR Bad setref line: $_"; + } + next; + } elsif ($tag eq 'defindex' || $tag eq 'defcodeindex') { + if (/^\@$tag\s+(\w\w)\s*$/) { + $valid_index{$1} = 1; + } else { + warn "$ERROR Bad defindex line: $_"; + } + next; + } elsif (defined($def_map{$tag})) { + if ($def_map{$tag}) { + s/^\@$tag\s+//; + $tag = $def_map{$tag}; + $_ = "\@$tag $_"; + $tag =~ s/\s.*//; + } + } elsif (defined($user_sub{$tag})) { + s/^\@$tag\s+//; + $sub = $user_sub{$tag}; + print "# user $tag = $sub, arg: $_" if $debug & $DEBUG_USER; + if (defined(&$sub)) { + chop($_); + &$sub($_); + } else { + warn "$ERROR Bad user sub for $tag: $sub\n"; + } + next; + } + if (defined($def_map{$tag})) { + s/^\@$tag\s+//; + if ($tag =~ /x$/) { + # extra definition line + $tag = $`; + $is_extra = 1; + } else { + $is_extra = 0; + } + while (/\{([^\{\}]*)\}/) { + # this is a {} construct + ($before, $contents, $after) = ($`, $1, $'); + # protect spaces + $contents =~ s/\s+/$;9/g; + # restore $_ protecting {} + $_ = "$before$;7$contents$;8$after"; + } + @args = split(/\s+/, &protect_html($_)); + foreach (@args) { + s/$;9/ /g; # unprotect spaces + s/$;7/\{/g; # ... { + s/$;8/\}/g; # ... } + } + $type = shift(@args); + $type =~ s/^\{(.*)\}$/$1/; + print "# def ($tag): {$type} ", join(', ', @args), "\n" + if $debug & $DEBUG_DEF; + $type .= ':'; # it's nicer like this + $name = shift(@args); + $name =~ s/^\{(.*)\}$/$1/; + if ($is_extra) { + $_ = &debug("

", __LINE__); + } else { + $_ = &debug("
\n
", __LINE__); + } + if ($tag eq 'deffn' || $tag eq 'defvr' || $tag eq 'deftp') { + $_ .= "$type $name"; + $_ .= " @args" if @args; + } elsif ($tag eq 'deftypefn' || $tag eq 'deftypevr' + || $tag eq 'defcv' || $tag eq 'defop') { + $ftype = $name; + $name = shift(@args); + $name =~ s/^\{(.*)\}$/$1/; + $_ .= "$type $ftype $name"; + $_ .= " @args" if @args; + } else { + warn "$ERROR Unknown definition type: $tag\n"; + $_ .= "$type $name"; + $_ .= " @args" if @args; + } + $_ .= &debug("\n
", __LINE__); + $name = &unprotect_html($name); + if ($tag eq 'deffn' || $tag eq 'deftypefn') { + unshift(@input_spool, "\@findex $name\n"); + } elsif ($tag eq 'defop') { + unshift(@input_spool, "\@findex $name on $ftype\n"); + } elsif ($tag eq 'defvr' || $tag eq 'deftypevr' || $tag eq 'defcv') { + unshift(@input_spool, "\@vindex $name\n"); + } else { + unshift(@input_spool, "\@tindex $name\n"); + } + $dont_html = 1; + } + } elsif ($end_tag) { + if ($format_map{$end_tag}) { + $in_pre = 0 if $format_map{$end_tag} eq 'PRE'; + $in_list-- if $format_map{$end_tag} eq 'UL' || $format_map{$end_tag} eq 'OL' ; + &html_pop_if('LI', 'P'); + &html_pop_if(); + push(@lines, &debug("\n", __LINE__)); + push(@lines, &html_debug("\n", __LINE__)); + } elsif ($end_tag eq 'table' || + $end_tag eq 'ftable' || + $end_tag eq 'vtable') { + shift(@tables); + if (@tables) { + ($table_type, $in_table) = split($;, $tables[0]); + } else { + $in_table = 0; + } + push(@lines, "
\n"); + &html_pop_if('DD'); + &html_pop_if(); + } elsif (defined($def_map{$end_tag})) { + push(@lines, &debug("
\n", __LINE__)); + } elsif ($end_tag eq 'menu') { + &html_pop_if(); + push(@lines, $_); # must keep it for pass 2 + } + next; + } + # + # misc things + # + # protect texi and HTML things + &protect_texi; + $_ = &protect_html($_) unless $dont_html; + $dont_html = 0; + # substitution (unsupported things) + s/^\@center\s+//g; + s/^\@exdent\s+//g; + s/\@noindent\s+//g; + s/\@refill\s+//g; + # other substitutions + &simple_substitutions; + s/\@value{($VARRE)}/$value{$1}/eg; + s/\@footnote\{/\@footnote$docu_doc\{/g; # mark footnotes, cf. pass 4 + # + # analyze the tag again + # + if ($tag) { + if (defined($sec2level{$tag}) && $sec2level{$tag} > 0) { + if (/^\@$tag\s+(.+)$/) { + $name = $1; + $name =~ s/\s+$//; + $level = $sec2level{$tag}; + $name = &update_sec_num($tag, $level) . " $name" + if $number_sections && $tag !~ /^unnumbered/; + if ($tag =~ /heading$/) { + push(@lines, &html_debug("\n", __LINE__)); + if ($html_element ne 'body') { + # We are in a nice pickle here. We are trying to get a H? heading + # even though we are not in the body level. So, we convert it to a + # nice, bold, line by itself. + $_ = &debug("\n\n

$name

\n\n", __LINE__); + } else { + $_ = &debug("$name\n", __LINE__); + &html_push_if('body'); + } + print "# heading, section $name, level $level\n" + if $debug & $DEBUG_TOC; + } else { + if ($split_chapter) { + unless ($toplevel) { + # first time we see a "section" + unless ($level == 1) { + warn "$ERROR The first section found is not of level 1: $_"; + warn "$ERROR I'll split on sections of level $level...\n"; + } + $toplevel = $level; + } + if ($level == $toplevel) { + &next_doc; + push(@lines, $SPLITTAG) if $split_num++; + push(@sections, $name); + } + } + $sec_num++; + $docid = "SEC$sec_num"; + $tocid = "TOC$sec_num"; + # check biblio and glossary + $in_bibliography = ($name =~ /^([A-Z]|\d+)?(\.\d+)*\s*bibliography$/i); + $in_glossary = ($name =~ /^([A-Z]|\d+)?(\.\d+)*\s*glossary$/i); + # check node + if ($node) { + if ($node2sec{$node}) { + warn "$ERROR Duplicate node found: $node\n"; + } else { + $node2sec{$node} = $name; + $node2href{$node} = "$docu_doc#$docid"; + print "# node $node, section $name, level $level\n" + if $debug & $DEBUG_TOC; + } + $node = ''; + } else { + print "# no node, section $name, level $level\n" + if $debug & $DEBUG_TOC; + } + # update TOC + while ($level > $curlevel) { + $curlevel++; + push(@toc_lines, "
    \n"); + } + while ($level < $curlevel) { + $curlevel--; + push(@toc_lines, "
\n"); + } + $_ = "
  • " . &anchor($tocid, "$docu_doc#$docid", $name, 1); + push(@toc_lines, &substitute_style($_)); + # update DOC + push(@lines, &html_debug("\n", __LINE__)); + &html_reset; + $_ = "".&anchor($docid, "$docu_toc#$tocid", $name)."\n"; + $_ = &debug($_, __LINE__); + push(@lines, &html_debug("\n", __LINE__)); + } + # update DOC + foreach $line (split(/\n+/, $_)) { + push(@lines, "$line\n"); + } + next; + } else { + warn "$ERROR Bad section line: $_"; + } + } else { + # track variables + $value{$1} = $2, next if /^\@set\s+($VARRE)\s+(.*)$/o; + delete $value{$1}, next if /^\@clear\s+($VARRE)\s*$/o; + # store things + $value{'_setfilename'} = $1, next if /^\@setfilename\s+(.*)$/; + $value{'_settitle'} = $1, next if /^\@settitle\s+(.*)$/; + $value{'_author'} .= "$1\n", next if /^\@author\s+(.*)$/; + $value{'_subtitle'} .= "$1\n", next if /^\@subtitle\s+(.*)$/; + $value{'_title'} .= "$1\n", next if /^\@title\s+(.*)$/; + # index + if (/^\@(..?)index\s+/) { + unless ($valid_index{$1}) { + warn "$ERROR Undefined index command: $_"; + next; + } + $id = 'IDX' . ++$idx_num; + $index = $1 . 'index'; + $what = &substitute_style($'); + $what =~ s/\s+$//; + print "# found $index for '$what' id $id\n" + if $debug & $DEBUG_INDEX; + eval(<\n", __LINE__)); + push(@lines, &anchor($id, '', $invisible_mark, !$in_pre)); + &html_push('P'); + } elsif ($html_element eq 'DL' || + $html_element eq 'UL' || + $html_element eq 'OL' ) { + $deferred_ref .= &anchor($id, '', $invisible_mark, !$in_pre) . " "; + } + next; + } + # list item + if (/^\@itemx?\s+/) { + $what = $'; + $what =~ s/\s+$//; + if ($in_bibliography && $use_bibliography) { + if ($what =~ /^$BIBRE$/o) { + $id = 'BIB' . ++$bib_num; + $bib2href{$what} = "$docu_doc#$id"; + print "# found bibliography for '$what' id $id\n" + if $debug & $DEBUG_BIB; + $what = &anchor($id, '', $what); + } + } elsif ($in_glossary && $use_glossary) { + $id = 'GLOSS' . ++$gloss_num; + $entry = $what; + $entry =~ tr/A-Z/a-z/ unless $entry =~ /^[A-Z\s]+$/; + $gloss2href{$entry} = "$docu_doc#$id"; + print "# found glossary for '$entry' id $id\n" + if $debug & $DEBUG_GLOSS; + $what = &anchor($id, '', $what); + } + &html_pop_if('P'); + if ($html_element eq 'DL' || $html_element eq 'DD') { + if ($things_map{$in_table} && !$what) { + # special case to allow @table @bullet for instance + push(@lines, &debug("
    $things_map{$in_table}\n", __LINE__)); + } else { + push(@lines, &debug("
    \@$in_table\{$what\}\n", __LINE__)); + } + push(@lines, "
    "); + &html_push('DD') unless $html_element eq 'DD'; + if ($table_type) { # add also an index + unshift(@input_spool, "\@${table_type}index $what\n"); + } + } else { + push(@lines, &debug("
  • $what\n", __LINE__)); + &html_push('LI') unless $html_element eq 'LI'; + } + push(@lines, &html_debug("\n", __LINE__)); + if ($deferred_ref) { + push(@lines, &debug("$deferred_ref\n", __LINE__)); + $deferred_ref = ''; + } + next; + } + } + } + # paragraph separator + if ($_ eq "\n") { + next if $#lines >= 0 && $lines[$#lines] eq "\n"; + if ($html_element eq 'P') { + push(@lines, "\n"); + $_ = &debug("

    \n", __LINE__); + &html_pop; + } + } elsif ($html_element eq 'body' || $html_element eq 'BLOCKQUOTE') { + push(@lines, "

    \n"); + &html_push('P'); + $_ = &debug($_, __LINE__); + } + # otherwise + push(@lines, $_); +} + +# finish TOC +$level = 0; +while ($level < $curlevel) { + $curlevel--; + push(@toc_lines, "\n"); +} + +print "# end of pass 1\n" if $verbose; + +#+++############################################################################ +# # +# Pass 2/3: handle style, menu, index, cross-reference # +# # +#---############################################################################ + +@lines2 = (); # whole document (2nd pass) +@lines3 = (); # whole document (3rd pass) +$in_menu = 0; # am I inside a menu + +while (@lines) { + $_ = shift(@lines); + # + # special case (protected sections) + # + if (/^$PROTECTTAG/o) { + push(@lines2, $_); + next; + } + # + # menu + # + $in_menu = 1, push(@lines2, &debug("

      \n", __LINE__)), next if /^\@menu\b/; + $in_menu = 0, push(@lines2, &debug("
    \n", __LINE__)), next if /^\@end\s+menu\b/; + if ($in_menu) { + if (/^\*\s+($NODERE)::/o) { + $descr = $'; + chop($descr); + &menu_entry($1, $1, $descr); + } elsif (/^\*\s+(.+):\s+([^\t,\.\n]+)[\t,\.\n]/) { + $descr = $'; + chop($descr); + &menu_entry($1, $2, $descr); + } elsif (/^\*/) { + warn "$ERROR Bad menu line: $_"; + } else { # description continued? + push(@lines2, $_); + } + next; + } + # + # printindex + # + if (/^\@printindex\s+(\w\w)\b/) { + local($index, *ary, @keys, $key, $letter, $last_letter, @refs); + if ($predefined_index{$1}) { + $index = $predefined_index{$1} . 'index'; + } else { + $index = $1 . 'index'; + } + eval("*ary = *$index"); + @keys = keys(%ary); + foreach $key (@keys) { + $_ = $key; + 1 while s/<(\w+)>\`(.*)\'<\/\1>/$2/; # remove HTML tags with quotes + 1 while s/<(\w+)>(.*)<\/\1>/$2/; # remove HTML tags + $_ = &unprotect_html($_); + &unprotect_texi; + tr/A-Z/a-z/; # lowercase + $key2alpha{$key} = $_; + print "# index $key sorted as $_\n" + if $key ne $_ && $debug & $DEBUG_INDEX; + } + $last_letter = undef; + foreach $key (sort byalpha @keys) { + $letter = substr($key2alpha{$key}, 0, 1); + $letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;; + if (!defined($last_letter) || $letter ne $last_letter) { + push(@lines2, "\n") if defined($last_letter); + push(@lines2, "

    " . &protect_html($letter) . "

    \n"); + push(@lines2, "\n"); + $last_letter = $letter; + } + @refs = (); + foreach (split(/$;/, $ary{$key})) { + push(@refs, &anchor('', $_, $key, 0)); + } + push(@lines2, "
  • " . join(", ", @refs) . "\n"); + } + push(@lines2, "
  • \n") if defined($last_letter); + next; + } + # + # simple style substitutions + # + $_ = &substitute_style($_); + # + # xref + # + while (/\@(x|px|info|)ref{($XREFRE)(}?)/o) { + # note: Texinfo may accept other characters + ($type, $nodes, $full) = ($1, $2, $3); + ($before, $after) = ($`, $'); + if (! $full && $after) { + warn "$ERROR Bad xref (no ending } on line): $_"; + $_ = "$before$;0${type}ref\{$nodes$after"; + next; # while xref + } + if ($type eq 'x') { + $type = 'See '; + } elsif ($type eq 'px') { + $type = 'see '; + } elsif ($type eq 'info') { + $type = 'See Info'; + } else { + $type = ''; + } + unless ($full) { + $next = shift(@lines); + $next = &substitute_style($next); + chop($nodes); # remove final newline + if ($next =~ /\}/) { # split on 2 lines + $nodes .= " $`"; + $after = $'; + } else { + $nodes .= " $next"; + $next = shift(@lines); + $next = &substitute_style($next); + chop($nodes); + if ($next =~ /\}/) { # split on 3 lines + $nodes .= " $`"; + $after = $'; + } else { + warn "$ERROR Bad xref (no ending }): $_"; + $_ = "$before$;0xref\{$nodes$after"; + unshift(@lines, $next); + next; # while xref + } + } + } + $nodes =~ s/\s+/ /g; # remove useless spaces + @args = split(/\s*,\s*/, $nodes); + $node = $args[0]; # the node is always the first arg + &normalise_node($node); + $sec = $node2sec{$node}; + if (@args == 5) { # reference to another manual + $sec = $args[2] || $node; + $man = $args[4] || $args[3]; + $_ = "${before}${type}section `$sec' in \@cite{$man}$after"; + } elsif ($type =~ /Info/) { # inforef + warn "$ERROR Wrong number of arguments: $_" unless @args == 3; + ($nn, $_, $in) = @args; + $_ = "${before}${type} file `$in', node `$nn'$after"; + } elsif ($sec) { + $href = $node2href{$node}; + $_ = "${before}${type}section " . &anchor('', $href, $sec) . $after; + } else { + warn "$ERROR Undefined node ($node): $_"; + $_ = "$before$;0xref{$nodes}$after"; + } + } + # + # try to guess bibliography references or glossary terms + # + unless (/^/) { + $done .= $pre . &anchor('', $href, $what); + } else { + $done .= "$pre$what"; + } + $_ = $post; + } + $_ = $done . $_; + } + if ($use_glossary) { + $done = ''; + while (/\b\w+\b/) { + ($pre, $what, $post) = ($`, $&, $'); + $entry = $what; + $entry =~ tr/A-Z/a-z/ unless $entry =~ /^[A-Z\s]+$/; + $href = $gloss2href{$entry}; + if (defined($href) && $post !~ /^[^<]*<\/A>/) { + $done .= $pre . &anchor('', $href, $what); + } else { + $done .= "$pre$what"; + } + $_ = $post; + } + $_ = $done . $_; + } + } + # otherwise + push(@lines2, $_); +} +print "# end of pass 2\n" if $verbose; + +# +# split style substitutions +# +while (@lines2) { + $_ = shift(@lines2); + # + # special case (protected sections) + # + if (/^$PROTECTTAG/o) { + push(@lines3, $_); + next; + } + # + # split style substitutions + # + $old = ''; + while ($old ne $_) { + $old = $_; + if (/\@(\w+)\{/) { + ($before, $style, $after) = ($`, $1, $'); + if (defined($style_map{$style})) { + $_ = $after; + $text = ''; + $after = ''; + $failed = 1; + while (@lines2) { + if (/\}/) { + $text .= $`; + $after = $'; + $failed = 0; + last; + } else { + $text .= $_; + $_ = shift(@lines2); + } + } + if ($failed) { + die "* Bad syntax (\@$style) after: $before\n"; + } else { + $text = &apply_style($style, $text); + $_ = "$before$text$after"; + } + } + } + } + # otherwise + push(@lines3, $_); +} +print "# end of pass 3\n" if $verbose; + +#+++############################################################################ +# # +# Pass 4: foot notes, final cleanup # +# # +#---############################################################################ + +@foot_lines = (); # footnotes +@doc_lines = (); # final document +$end_of_para = 0; # true if last line is

    + +while (@lines3) { + $_ = shift(@lines3); + # + # special case (protected sections) + # + if (/^$PROTECTTAG/o) { + push(@doc_lines, $_); + $end_of_para = 0; + next; + } + # + # footnotes + # + while (/\@footnote([^\{\s]+)\{/) { + ($before, $d, $after) = ($`, $1, $'); + $_ = $after; + $text = ''; + $after = ''; + $failed = 1; + while (@lines3) { + if (/\}/) { + $text .= $`; + $after = $'; + $failed = 0; + last; + } else { + $text .= $_; + $_ = shift(@lines3); + } + } + if ($failed) { + die "* Bad syntax (\@footnote) after: $before\n"; + } else { + $foot_num++; + $docid = "DOCF$foot_num"; + $footid = "FOOT$foot_num"; + $foot = "($foot_num)"; + push(@foot_lines, "

    " . &anchor($footid, "$d#$docid", $foot) . "

    \n"); + $text = "

    $text" unless $text =~ /^\s*

    /; + push(@foot_lines, "$text\n"); + $_ = $before . &anchor($docid, "$docu_foot#$footid", $foot) . $after; + } + } + # + # remove unnecessary

    + # + if (/^\s*

    \s*$/) { + next if $end_of_para++; + } else { + $end_of_para = 0; + } + # otherwise + push(@doc_lines, $_); +} +print "# end of pass 4\n" if $verbose; + +#+++############################################################################ +# # +# Pass 5: print things # +# # +#---############################################################################ + +$header = < +EOT + +$full_title = $value{'_title'} || $value{'_settitle'} || "Untitled Document"; +$title = $value{'_settitle'} || $full_title; +$_ = &substitute_style($full_title); +&unprotect_texi; +s/\n$//; # rmv last \n (if any) +$full_title = "

    " . join("

    \n

    ", split(/\n/, $_)) . "

    \n"; + +# +# print ToC +# +if (!$monolithic && @toc_lines) { + if (open(FILE, "> $docu_toc")) { + print "# creating $docu_toc...\n" if $verbose; + &print_toplevel_header("$title - Table of Contents"); + &print_ruler; + &print(*toc_lines, FILE); + &print_toplevel_footer; + close(FILE); + } else { + warn "$ERROR Can't write to $docu_toc: $!\n"; + } +} + +# +# print footnotes +# +if (!$monolithic && @foot_lines) { + if (open(FILE, "> $docu_foot")) { + print "# creating $docu_foot...\n" if $verbose; + &print_toplevel_header("$title - Footnotes"); + &print_ruler; + &print(*foot_lines, FILE); + &print_toplevel_footer; + close(FILE); + } else { + warn "$ERROR Can't write to $docu_foot: $!\n"; + } +} + +# +# print document +# +if ($split_chapter || $split_node) { # split + $doc_num = 0; + $last_num = scalar(@sections); + $first_doc = &doc_name(1); + $last_doc = &doc_name($last_num); + while (@sections) { + $section = shift(@sections); + &next_doc; + if (open(FILE, "> $docu_doc")) { + print "# creating $docu_doc...\n" if $verbose; + &print_header("$title - $section"); + $prev_doc = ($doc_num == 1 ? undef : &doc_name($doc_num - 1)); + $next_doc = ($doc_num == $last_num ? undef : &doc_name($doc_num + 1)); + $navigation = "Go to the "; + $navigation .= ($prev_doc ? &anchor('', $first_doc, "first") : "first"); + $navigation .= ", "; + $navigation .= ($prev_doc ? &anchor('', $prev_doc, "previous") : "previous"); + $navigation .= ", "; + $navigation .= ($next_doc ? &anchor('', $next_doc, "next") : "next"); + $navigation .= ", "; + $navigation .= ($next_doc ? &anchor('', $last_doc, "last") : "last"); + $navigation .= " section, " . &anchor('', $docu_toc, "table of contents") . ".\n"; + print FILE $navigation; + &print_ruler; + # find corresponding lines + @tmp_lines = (); + while (@doc_lines) { + $_ = shift(@doc_lines); + last if ($_ eq $SPLITTAG); + push(@tmp_lines, $_); + } + &print(*tmp_lines, FILE); + &print_ruler; + print FILE $navigation; + &print_footer; + close(FILE); + } else { + warn "$ERROR Can't write to $docu_doc: $!\n"; + } + } +} else { # not split + if (open(FILE, "> $docu_doc")) { + print "# creating $docu_doc...\n" if $verbose; + if ($monolithic || !@toc_lines) { + &print_toplevel_header($title); + } else { + &print_header($title); + print FILE $full_title; + } + if ($monolithic && @toc_lines) { + &print_ruler; + print FILE "

    Table of Contents

    \n"; + &print(*toc_lines, FILE); + } + &print_ruler; + &print(*doc_lines, FILE); + if ($monolithic && @foot_lines) { + &print_ruler; + print FILE "

    Footnotes

    \n"; + &print(*foot_lines, FILE); + } + if ($monolithic || !@toc_lines) { + &print_toplevel_footer; + } else { + &print_footer; + } + close(FILE); + } else { + warn "$ERROR Can't write to $docu_doc: $!\n"; + } +} + +print "# that's all folks\n" if $verbose; + +#+++############################################################################ +# # +# Low level functions # +# # +#---############################################################################ + +sub update_sec_num { + local($name, $level) = @_; + + $level--; # here we start at 0 + if ($name =~ /^appendix/) { + # appendix style + if (defined(@appendix_sec_num)) { + &incr_sec_num($level, @appendix_sec_num); + } else { + @appendix_sec_num = ('A', 0, 0, 0); + } + return(join('.', @appendix_sec_num[0..$level])); + } else { + # normal style + if (defined(@normal_sec_num)) { + &incr_sec_num($level, @normal_sec_num); + } else { + @normal_sec_num = (1, 0, 0, 0); + } + return(join('.', @normal_sec_num[0..$level])); + } +} + +sub incr_sec_num { + local($level, $l); + $level = shift(@_); + $_[$level]++; + foreach $l ($level+1 .. 3) { + $_[$l] = 0; + } +} + +sub check { + local($_, %seen, %context, $before, $match, $after); + + while (<>) { + if (/\@(\*|\.|\:|\@|\{|\})/) { + $seen{$&}++; + $context{$&} .= "> $_" if $verbose; + $_ = "$`XX$'"; + redo; + } + if (/\@(\w+)/) { + ($before, $match, $after) = ($`, $&, $'); + if ($before =~ /\b[\w-]+$/ && $after =~ /^[\w-.]*\b/) { # e-mail address + $seen{'e-mail address'}++; + $context{'e-mail address'} .= "> $_" if $verbose; + } else { + $seen{$match}++; + $context{$match} .= "> $_" if $verbose; + } + $match =~ s/^\@/X/; + $_ = "$before$match$after"; + redo; + } + } + + foreach (sort(keys(%seen))) { + if ($verbose) { + print "$_\n"; + print $context{$_}; + } else { + print "$_ ($seen{$_})\n"; + } + } +} + +sub open { + local($name) = @_; + + ++$fh_name; + if (open($fh_name, $name)) { + unshift(@fhs, $fh_name); + } else { + warn "$ERROR Can't read file $name: $!\n"; + } +} + +sub init_input { + @fhs = (); # hold the file handles to read + @input_spool = (); # spooled lines to read + $fh_name = 'FH000'; + &open($docu); +} + +sub next_line { + local($fh, $line); + + if (@input_spool) { + $line = shift(@input_spool); + return($line); + } + while (@fhs) { + $fh = $fhs[0]; + $line = <$fh>; + return($line) if $line; + close($fh); + shift(@fhs); + } + return(undef); +} + +# used in pass 1, use &next_line +sub skip_until { + local($tag) = @_; + local($_); + + while ($_ = &next_line) { + return if /^\@end\s+$tag\s*$/; + } + die "* Failed to find '$tag' after: " . $lines[$#lines]; +} + +# +# HTML stacking to have a better HTML output +# + +sub html_reset { + @html_stack = ('html'); + $html_element = 'body'; +} + +sub html_push { + local($what) = @_; + push(@html_stack, $html_element); + $html_element = $what; +} + +sub html_push_if { + local($what) = @_; + push(@html_stack, $html_element) + if ($html_element && $html_element ne 'P'); + $html_element = $what; +} + +sub html_pop { + $html_element = pop(@html_stack); +} + +sub html_pop_if { + local($elt); + + if (@_) { + foreach $elt (@_) { + if ($elt eq $html_element) { + $html_element = pop(@html_stack) if @html_stack; + last; + } + } + } else { + $html_element = pop(@html_stack) if @html_stack; + } +} + +sub html_debug { + local($what, $line) = @_; + return("$what") + if $debug & $DEBUG_HTML; + return($what); +} + +# to debug the output... +sub debug { + local($what, $line) = @_; + return("$what") + if $debug & $DEBUG_HTML; + return($what); +} + +sub normalise_node { + $_[0] =~ s/\s+/ /g; + $_[0] =~ s/ $//; + $_[0] =~ s/^ //; +} + +sub menu_entry { + local($entry, $node, $descr) = @_; + local($href); + + &normalise_node($node); + $href = $node2href{$node}; + if ($href) { + $descr =~ s/^\s+//; + $descr = ": $descr" if $descr; + push(@lines2, "
  • " . &anchor('', $href, $entry) . "$descr\n"); + } else { + warn "$ERROR Undefined node ($node): $_"; + } +} + +sub do_ctrl { "^$_[0]" } + +sub do_sc { "\U$_[0]\E" } + +sub apply_style { + local($texi_style, $text) = @_; + local($style); + + $style = $style_map{$texi_style}; + if (defined($style)) { # known style + if ($style =~ /^\"/) { # add quotes + $style = $'; + $text = "\`$text\'"; + } + if ($style =~ /^\&/) { # custom + $style = $'; + $text = &$style($text); + } elsif ($style) { # good style + $text = "<$style>$text"; + } else { # no style + } + } else { # unknown style + $text = undef; + } + return($text); +} + +# remove Texinfo styles +sub remove_style { + local($_) = @_; + s/\@\w+{([^\{\}]+)}/$1/g; + return($_); +} + +sub substitute_style { + local($_) = @_; + local($changed, $done, $style, $text); + + $changed = 1; + while ($changed) { + $changed = 0; + $done = ''; + while (/\@(\w+){([^\{\}]+)}/) { + $text = &apply_style($1, $2); + if ($text) { + $_ = "$`$text$'"; + $changed = 1; + } else { + $done .= "$`\@$1"; + $_ = "{$2}$'"; + } + } + $_ = $done . $_; + } + return($_); +} + +sub anchor { + local($name, $href, $text, $newline) = @_; + local($result); + + $result = "

    \n"; +} + +sub print_header { + local($_); + + # clean the title + $_ = &remove_style($_[0]); + &unprotect_texi; + # print the header + if ($doctype eq 'html2') { + print FILE $html2_doctype; + } elsif ($doctype) { + print FILE $doctype; + } + print FILE < + +$header +$_ + + +EOT +} + +sub print_toplevel_header { + local($_); + + &print_header; # pass given arg... + print FILE $full_title; + if ($value{'_subtitle'}) { + $value{'_subtitle'} =~ s/\n+$//; + foreach (split(/\n/, $value{'_subtitle'})) { + $_ = &substitute_style($_); + &unprotect_texi; + print FILE "

    $_

    \n"; + } + } + if ($value{'_author'}) { + $value{'_author'} =~ s/\n+$//; + foreach (split(/\n/, $value{'_author'})) { + $_ = &substitute_style($_); + &unprotect_texi; + s/[\w.-]+\@[\w.-]+/
    $&<\/A>/g; + print FILE "
    $_
    \n"; + } + } + print FILE "

    \n"; +} + +sub print_footer { + print FILE < + +EOT +} + +sub print_toplevel_footer { + &print_ruler; + print FILE <texi2html +translator version 1.51.

    +EOT + &print_footer; +} + +sub protect_texi { + # protect @ { } ` ' + s/\@\@/$;0/go; + s/\@\{/$;1/go; + s/\@\}/$;2/go; + s/\@\`/$;3/go; + s/\@\'/$;4/go; +} + +sub protect_html { + local($what) = @_; + # protect & < > + $what =~ s/\&/\&\#38;/g; + $what =~ s/\/\&\#62;/g; + # but recognize some HTML things + $what =~ s/\&\#60;\/A\&\#62;/<\/A>/g; # + $what =~ s/\&\#60;A ([^\&]+)\&\#62;//g; # + $what =~ s/\&\#60;IMG ([^\&]+)\&\#62;//g; # + return($what); +} + +sub unprotect_texi { + s/$;0/\@/go; + s/$;1/\{/go; + s/$;2/\}/go; + s/$;3/\`/go; + s/$;4/\'/go; +} + +sub unprotect_html { + local($what) = @_; + $what =~ s/\&\#38;/\&/g; + $what =~ s/\&\#60;/\/g; + return($what); +} + +sub byalpha { + $key2alpha{$a} cmp $key2alpha{$b}; +} + +############################################################################## + + # These next few lines are legal in both Perl and nroff. + +.00 ; # finish .ig + +'di \" finish diversion--previous line must be blank +.nr nl 0-1 \" fake up transition to first page again +.nr % 0 \" start at page 1 +'; __END__ ############# From here on it's a standard manual page ############ +.TH TEXI2HTML 1 "09/10/96" +.AT 3 +.SH NAME +texi2html \- a Texinfo to HTML converter +.SH SYNOPSIS +.B texi2html [options] file +.PP +.B texi2html -check [-verbose] files +.SH DESCRIPTION +.I Texi2html +converts the given Texinfo file to a set of HTML files. It tries to handle +most of the Texinfo commands. It creates hypertext links for cross-references, +footnotes... +.PP +It also tries to add links from a reference to its corresponding entry in the +bibliography (if any). It may also handle a glossary (see the +.B \-glossary +option). +.PP +.I Texi2html +creates several files depending on the contents of the Texinfo file and on +the chosen options (see FILES). +.PP +The HTML files created by +.I texi2html +are closer to TeX than to Info, that's why +.I texi2html +converts @iftex sections and not @ifinfo ones by default. You can reverse +this with the \-expandinfo option. +.SH OPTIONS +.TP 12 +.B \-check +Check the given file and give the list of all things that may be Texinfo commands. +This may be used to check the output of +.I texi2html +to find the Texinfo commands that have been left in the HTML file. +.TP +.B \-expandinfo +Expand @ifinfo sections, not @iftex ones. +.TP +.B \-glossary +Use the section named 'Glossary' to build a list of terms and put links in the HTML +document from each term toward its definition. +.TP +.B \-invisible \fIname\fP +Use \fIname\fP to create invisible destination anchors for index links. This is a workaround +for a known bug of many WWW browsers, including xmosaic. +.TP +.B \-I \fIdir\fP +Look also in \fIdir\fP to find included files. +.TP +.B \-menu +Show the Texinfo menus; by default they are ignored. +.TP +.B \-monolithic +Output only one file, including the table of contents and footnotes. +.TP +.B \-number +Number the sections. +.TP +.B \-split_chapter +Split the output into several HTML files (one per main section: +chapter, appendix...). +.TP +.B \-split_node +Split the output into several HTML files (one per node). +.TP +.B \-usage +Print usage instructions, listing the current available command-line options. +.TP +.B \-verbose +Give a verbose output. Can be used with the +.B \-check +option. +.PP +.SH FILES +By default +.I texi2html +creates the following files (foo being the name of the Texinfo file): +.TP 16 +.B foo_toc.html +The table of contents. +.TP +.B foo.html +The document's contents. +.TP +.B foo_foot.html +The footnotes (if any). +.PP +When used with the +.B \-split +option, it creates several files (one per chapter or node), named +.B foo_n.html +(n being the indice of the chapter or node), instead of the single +.B foo.html +file. +.PP +When used with the +.B \-monolithic +option, it creates only one file: +.B foo.html +.SH VARIABLES +.I texi2html +predefines the following variables: \fBhtml\fP, \fBtexi2html\fP. +.SH ADDITIONAL COMMANDS +.I texi2html +implements the following non-Texinfo commands: +.TP 16 +.B @ifhtml +This indicates the start of an HTML section, this section will passed through +without any modofication. +.TP +.B @end ifhtml +This indcates the end of an HTML section. +.SH VERSION +This is \fItexi2html\fP version 1.51, 09/10/96. +.PP +The latest version of \fItexi2html\fP can be found in WWW, cf. URL +http://wwwcn.cern.ch/dci/texi2html/ +.SH AUTHOR +The main author is Lionel Cons, CERN CN/DCI/UWS, Lionel.Cons@cern.ch. +Many other people around the net contributed to this program. +.SH COPYRIGHT +This program is the intellectual property of the European +Laboratory for Particle Physics (known as CERN). No guarantee whatsoever is +provided by CERN. No liability whatsoever is accepted for any loss or damage +of any kind resulting from any defect or inaccuracy in this information or +code. +.PP +CERN, 1211 Geneva 23, Switzerland +.SH "SEE ALSO" +GNU Texinfo Documentation Format, +HyperText Markup Language (HTML), +World Wide Web (WWW). +.SH BUGS +This program does not understand all Texinfo commands (yet). +.PP +TeX specific commands (normally enclosed in @iftex) will be +passed unmodified. +.ex diff --git a/barcode-0.98/ean.c b/barcode-0.98/ean.c new file mode 100644 index 00000000..0801a0ef --- /dev/null +++ b/barcode-0.98/ean.c @@ -0,0 +1,774 @@ +/* + * ean.c -- encoding for ean, upc and isbn + * + * Copyright (c) 1999 Alessandro Rubini + * Copyright (c) 1999 Prosa Srl. + * Copyright (c) 2001 Boszormenyi Zoltan + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + +/* + * IMPORTANT NOTE: if you are reading this file to learn how to add a + * new encoding type, this is the wrong place as there are too many + * special cases. Please refer to code39.c instead. If you want to + * learn how UPC, EAN, ISBN work, on the other hand, I did my best to + * commend things and hope you enjoy it. + */ + +/* + * These following static arrays are used to describe the barcode. + * + * The various forms of UPC and EAN are documented as using three + * different alphabets to encode the ten digits. However, each digit + * has exactly one encoding; only, it is sometimes mirrored. Moreover, + * if you represent the width of each symbol (bar/space) instead of + * the sequence of 1's and 0's, you find that even-parity and odd-parity + * encoding are exactly the same. So, here are the digits: */ +static char *digits[] = { + "3211","2221","2122","1411","1132", + "1231","1114","1312","1213","3112"}; + +/* + * What EAN encoding does is adding a leading digit (the 13th digit). + * Such an extra digit is encoded by mirroring three of the six digits that + * appear in the left half of the UPC code. Here how mirroring works: + */ +static char *ean_mirrortab[] = { + "------","--1-11","--11-1","--111-","-1--11", + "-11--1","-111--","-1-1-1","-1-11-","-11-1-" +}; + +/* + * UPC-E (the 6-digit one), instead, encodes the check character as + * a mirroring of the symbols. This is similar, but the encoding for "0" is + * different (EAN uses no mirroring for "0" to be compatible with UPC). + * The same rule is used for UPC-5 (the supplemental digits for ISBN) + */ +static char *upc_mirrortab[] = { + "---111","--1-11","--11-1","--111-","-1--11", + "-11--1","-111--","-1-1-1","-1-11-","-11-1-" +}; + +/* + * UPC-E mirroring for encoding "1" + */ +static char *upc_mirrortab1[] = { + "111---","11-1--","11--1-","11---1","1-11--", + "1--11-","1---11","1-1-1-","1-1--1","1--1-1" +}; + +/* UPC-2 has just two digits to mirror */ +static char *upc_mirrortab2[] = { + "11","1-","-1","--" +}; + +/* + * initial, middle, final guard bars (first symbol is a a space). + * EAN-13 overwrites the first "0" with "9" to make space for the extra digit. + */ +static char *guard[] = {"0a1a","1a1a1","a1a"}; + +/* initial, final guard bars for UPC-E*/ +static char *guardE[] = {"0a1a","1a1a1a"}; + +/* initial and inter-char guard bars for supplementals (first is space) */ +static char *guardS[] = {"9112","11"}; + +/* + * These functions are shortcuts I use in the encoding engine + */ +static int ean_make_checksum(char *text, int mode) +{ + int esum = 0, osum = 0, i; + int even=1; /* last char is even */ + + if (strchr(text, ' ')) + i = strchr(text, ' ') - text; /* end of first part */ + else + i = strlen(text); /* end of all */ + + while (i-- > 0) { + if (even) esum += text[i]-'0'; + else osum += text[i]-'0'; + even = !even; + } + if (!mode) { /* standard upc/ean checksum */ + i = (3*esum + osum) % 10; + return (10-i) % 10; /* complement to 10 */ + } else { /* add-5 checksum */ + i = (3*esum + 9*osum); + return i%10; + } +} + +/* + * Check that the text can be encoded. Returns 0 or -1. + * Accept: + * 13 or 12 digits: EAN-13 w/ or w/o checksum + * or + * 8 or 7 digits: EAN-8 w/ or w/o checksum. + * For both EAN-13 and EAN-8, accept an addon of 2 or 5 digits, + * separated by ' ' + */ +int Barcode_ean_verify(unsigned char *text) +{ + int i, len0, len, addon; + unsigned char tmp[24], *spc; + + len = strlen(text); + spc = strchr(text, ' '); + if (spc) { + len0 = spc - text; + addon = len - len0 - 1; + if (addon != 2 && addon != 5) + return -1; + for (i=len0+1; i= '5' && text[10] <= '9') { + memcpy(&result[1], text+1, 5); + result[6] = text[10]; + } else { + return NULL; + } + result[7] = chksum + '0'; + + return result; +} + +/* + * UPC-A is the same as EAN, but accept + * 12 or 11 digits (UPC-A w/ or w/o checksum) + * or accept UPC-E as: + * 6 digits (w/o number system and checksum): number system '0' assumed, + * 7 digits (either w/o number system or checksum), + * 8 digits (w/ number system and checksum) + * plus the 2 or 5-digit add-on + */ +int Barcode_upc_verify(unsigned char *text) +{ + int i, len0, len, addon; + unsigned char tmp[24], *spc; + + len = strlen(text); + spc = strchr(text, ' '); + if (spc) { + len0 = spc - text; + addon = len - len0 - 1; + if (addon != 2 && addon != 5) + return -1; + for (i=len0+1; iascii) { + bc->error = EINVAL; + return -1; + } + + /* Find out whether the barcode has addon and + * the length of the barcode w/o the addon. + */ + len = strlen(bc->ascii); + spc = strchr(bc->ascii, ' '); + if (spc) { + len0 = spc - bc->ascii; + addon = strlen(spc + 1); + if (addon != 2 && addon != 5) { + bc->error = EINVAL; /* impossible, actually */ + return -1; + } + } else { + len0 = len; + addon = 0; + } + + if (!bc->encoding) { + /* ISBN already wrote what it is; if unknown, find it out */ + + /* + * Do not decide only by barcode length, it may be ambiguous. + * Anyway, either the user specified the barcode type or + * we already found a fitting one. + */ + switch(bc->flags & BARCODE_ENCODING_MASK) { + case BARCODE_EAN: + switch (len0) { + case 7: case 8: + bc->encoding = strdup("EAN-8"); + encoding = EAN8; + break; + case 12: case 13: + bc->encoding = strdup("EAN-13"); + encoding = EAN13; + break; + default: + bc->error = -EINVAL; + return -1; + } + break; + + case BARCODE_UPC: + switch (len0) { + case 6: case 7: case 8: + bc->encoding = strdup("UPC-E"); + encoding = UPCE; + break; + case 11: case 12: + bc->encoding = strdup("UPC-A"); + encoding = UPCA; + break; + default: + bc->error = -EINVAL; + return -1; + } + break; + default: + /* else, it's wrong (impossible, as the text is checked) */ + bc->error = -EINVAL; + return -1; + } + } + + /* better safe than sorry */ + if (bc->partial) free(bc->partial); bc->partial = NULL; + if (bc->textinfo) free(bc->textinfo); bc->textinfo = NULL; + + if (encoding == UPCA) { /* add the leading 0 (not printed) */ + text[0] = '0'; + strcpy(text+1, bc->ascii); + } else if (encoding == UPCE) { + strcpy(text, upc_a_to_e(upc_e_to_a(bc->ascii))); + } else { + strcpy(text, bc->ascii); + } + + /* + * build the checksum and the bars: any encoding is slightly different + */ + if (encoding == UPCA || encoding == EAN13 || encoding == ISBN) { + if (!(encoding == UPCA && len0 == 12) && + !(encoding == EAN13 && len0 == 13)) { + checksum = ean_make_checksum(text, 0); + text[12] = '0' + checksum; /* add it to the text */ + text[13] = '\0'; + } + + strcpy(partial, guard[0]); + if (encoding == EAN13 || encoding == ISBN) { /* The first digit */ + sprintf(tptr,"0:12:%c ",text[0]); + tptr += strlen(tptr); + partial[0] = '9'; /* extra space for the digit */ + } else if (encoding == UPCA) + partial[0] = '9'; /* UPC has one digit before the symbol, too */ + xpos = width_of_partial(partial); + mirror = ean_mirrortab[text[0]-'0']; + + /* left part */ + for (i=1;i<7;i++) { + ptr1 = partial + strlen(partial); /* target */ + ptr2 = digits[text[i]-'0']; /* source */ + strcpy(ptr1, ptr2); + if (mirror[i-1] == '1') { + /* mirror this */ + ptr1[0] = ptr2[3]; + ptr1[1] = ptr2[2]; + ptr1[2] = ptr2[1]; + ptr1[3] = ptr2[0]; + } + /* + * Write the ascii digit. UPC has a special case + * for the first digit, which is out of the bars + */ + if (encoding == UPCA && i==1) { + sprintf(tptr, "0:10:%c ", text[i]); + tptr += strlen(tptr); + ptr1[1] += 'a'-'1'; /* bars are long */ + ptr1[3] += 'a'-'1'; + } else { + sprintf(tptr, "%i:12:%c ", xpos, text[i]); + tptr += strlen(tptr); + } + /* count the width of the symbol */ + xpos += 7; /* width_of_partial(ptr2) */ + } + + strcat(partial, guard[1]); /* middle */ + xpos += width_of_partial(guard[1]); + + /* right part */ + for (i=7;i<13;i++) { + ptr1 = partial + strlen(partial); /* target */ + ptr2 = digits[text[i]-'0']; /* source */ + strcpy(ptr1, ptr2); + /* + * Ascii digit. Once again, UPC has a special + * case for the last digit + */ + if (encoding == UPCA && i==12) { + sprintf(tptr, "%i:10:%c ", xpos+13, text[i]); + tptr += strlen(tptr); + ptr1[0] += 'a'-'1'; /* bars are long */ + ptr1[2] += 'a'-'1'; + } else { + sprintf(tptr, "%i:12:%c ", xpos, text[i]); + tptr += strlen(tptr); + } + xpos += 7; /* width_of_partial(ptr2) */ + } + tptr[-1] = '\0'; /* overwrite last space */ + strcat(partial, guard[2]); /* end */ + xpos += width_of_partial(guard[2]); + + } else if (encoding == UPCE) { + checksum = text[7] - '0'; + + strcpy(partial, guardE[0]); + partial[0] = '9'; /* UPC-A has one digit before the symbol, too */ + xpos = width_of_partial(partial); + + /* UPC-E has the number system written before the bars. */ + sprintf(tptr, "0:10:%c ", text[0]); + tptr += strlen(tptr); + + if (text[0] == '0') + mirror = upc_mirrortab[checksum]; + else + mirror = upc_mirrortab1[checksum]; + + for (i=0;i<6;i++) { + ptr1 = partial + strlen(partial); /* target */ + ptr2 = digits[text[i+1]-'0']; /* source */ + strcpy(ptr1, ptr2); + if (mirror[i] != '1') { /* negated wrt EAN13 */ + /* mirror this */ + ptr1[0] = ptr2[3]; + ptr1[1] = ptr2[2]; + ptr1[2] = ptr2[1]; + ptr1[3] = ptr2[0]; + } + sprintf(tptr, "%i:12:%c ", xpos, text[i+1]); + tptr += strlen(tptr); + xpos += 7; /* width_of_partial(ptr2) */ + } + + sprintf(tptr, "%i:10:%c ", xpos+10, text[7]); + tptr += strlen(tptr); + ptr1[0] += 'a'-'1'; /* bars are long */ + ptr1[2] += 'a'-'1'; + + tptr[-1] = '\0'; /* overwrite last space */ + strcat(partial, guardE[1]); /* end */ + + } else { /* EAN-8 almost identical to EAN-13 but no mirroring */ + + if (len0 != 8) { + checksum = ean_make_checksum(text, 0); + text[7] = '0' + checksum; /* add it to the text */ + text[8] = '\0'; + } + + strcpy(partial, guard[0]); + xpos = width_of_partial(partial); + + /* left part */ + for (i=0;i<4;i++) { + strcpy(partial + strlen(partial), digits[text[i]-'0']); + sprintf(tptr, "%i:12:%c ", xpos, text[i]); + tptr += strlen(tptr); + xpos += 7; /* width_of_partial(digits[text[i]-'0' */ + } + strcat(partial, guard[1]); /* middle */ + xpos += width_of_partial(guard[1]); + + /* right part */ + for (i=4;i<8;i++) { + strcpy(partial + strlen(partial), digits[text[i]-'0']); + sprintf(tptr, "%i:12:%c ", xpos, text[i]); + tptr += strlen(tptr); + xpos += 7; /* width_of_partial(digits[text[i]-'0' */ + } + tptr[-1] = '\0'; /* overwrite last space */ + strcat(partial, guard[2]); /* end */ + } + + /* + * And that's it. Now, in case some add-on is specified it + * must be encoded too. Look for it. + */ + if ( (ptr1 = spc) ) { + ptr1++; + strcpy(text, ptr1); + if (strlen(ptr1)==5) { + checksum = ean_make_checksum(text, 1 /* special way */); + mirror = upc_mirrortab[checksum]+1; /* only last 5 digits */ + } else { + checksum = atoi(text)%4; + mirror = upc_mirrortab2[checksum]; + } + strcat(textinfo, " +"); strcat(partial, "+"); + tptr = textinfo + strlen(textinfo); + for (i=0; ipartial = strdup(partial); + if (!bc->partial) { + bc->error = errno; + return -1; + } + bc->textinfo = strdup(textinfo); + if (!bc->textinfo) { + bc->error = errno; + free(bc->partial); + bc->partial = NULL; + return -1; + } + if (!bc->width) + bc->width = width_of_partial(partial); + + return 0; /* success */ +} + +int Barcode_upc_encode(struct Barcode_Item *bc) +{ + return Barcode_ean_encode(bc); /* UPC is folded into EAN */ +} + +int Barcode_isbn_encode(struct Barcode_Item *bc) +{ + /* For ISBN we must normalize the string and prefix "978" */ + unsigned char *text = malloc(24); /* 13 + ' ' + 5 plus some slack */ + unsigned char *otext; + int i, j, retval; + + if (!text) { + bc->error = ENOMEM; + return -1; + } + strcpy(text, "978"); j=3; + + otext = bc->ascii; + for (i=0; otext[i]; i++) { + if (isdigit(otext[i])) + text[j++] = otext[i]; + if (j == 12) /* checksum added later */ + break; + } + text[j]='\0'; + if (strchr(otext, ' ')) + strcat(text, strchr(otext, ' ')); + bc->ascii = text; + bc->encoding = strdup("ISBN"); + retval = Barcode_ean_encode(bc); + bc->ascii = otext; /* restore ascii for the ps comments */ + free(text); + return retval; +} + diff --git a/barcode-0.98/i25.c b/barcode-0.98/i25.c new file mode 100644 index 00000000..72bd0358 --- /dev/null +++ b/barcode-0.98/i25.c @@ -0,0 +1,164 @@ +/* + * i25.c -- "interleaved 2 of 5" + * + * Copyright (c) 1999,2000 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + +static char *codes[] = { + "11331", "31113", "13113", "33111", "11313", + "31311", "13311", "11133", "31131", "13131" +}; + +static char *guard[] = {"a1a1", "c1a"}; /* begin end */ + +int Barcode_i25_verify(unsigned char *text) +{ + if (!text[0]) + return -1; + while (*text && isdigit(*text)) + text++; + if (*text) + return -1; /* a non-digit char */ + return 0; /* ok */ +} + +int Barcode_i25_encode(struct Barcode_Item *bc) +{ + unsigned char *text; + unsigned char *partial; /* dynamic */ + unsigned char *textinfo; /* dynamic */ + unsigned char *textptr, *p1, *p2, *pd; + int i, len, sum[2], textpos, usesum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("interleaved 2 of 5"); + + text = bc->ascii; + if (!bc->ascii) { + bc->error = EINVAL; + return -1; + } + + if ((bc->flags & BARCODE_NO_CHECKSUM)) usesum = 0; else usesum = 1; + + /* create the real text string, padded to an even number of digits */ + text = malloc(strlen(bc->ascii) + 3); /* leading 0, checksum, term. */ + if (!text) { + bc->error = errno; + return -1; + } + /* add the leading 0 if needed */ + i = strlen(bc->ascii) + usesum; + if (i % 2) { + /* add a leading 0 */ + text[0] = '0'; + strcpy(text+1, bc->ascii); + } else { + strcpy(text, bc->ascii); + } + /* add the trailing checksum if needed, the leading 0 is ignored */ + if (usesum) { + sum[0] = sum[1] = 0; + for (i=0; text[i]; i++) + sum[i%2] += text[i]-'0'; + /* + * The "even" sum must be multiplied by three, and the * + * rightmost digit is defined as "even". The digits' position + * is already correct, whether or not we added a leading zero. + * (e.g., they are in pos. 0..4 or 1..4 of the string) + */ + i = sum[0] * 3 + sum[1]; + strcat(text, "0"); + text[strlen(text)-1] += (10 - (i%10)) % 10; + } + + /* the partial code is 5 * (text + check) + 4(head) + 3(tail) + term. */ + partial = malloc( (strlen(text) + 3) * 5 +2); /* be large... */ + if (!partial) { + bc->error = errno; + free(text); + return -1; + } + + /* the text information is at most "nnn:fff:c " * (strlen+1) +term */ + textinfo = malloc(10*(strlen(text)+1) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + free(text); + return -1; + } + + + strcpy(partial, "0"); /* the first space */ + strcat(partial, guard[0]); /* start */ + textpos = 4; /* width of initial guard */ + textptr = textinfo; + + len = strlen(text); + for (i=0; ierror = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + free(text); + return -1; + } + /* interleave two digits */ + p1 = codes[text[i]-'0']; + p2 = codes[text[i+1]-'0']; + pd = partial + strlen(partial); /* destination */ + while (*p1) { + *(pd++) = *(p1++); + *(pd++) = *(p2++); + } + *pd = '\0'; + /* and print the ascii text (but don't print the checksum, if any */ + if (usesum && strlen(text+i)==2) { + /* print only one digit, discard the checksum */ + sprintf(textptr, "%i:12:%c ", textpos, text[i]); + } else { + sprintf(textptr, "%i:12:%c %i:12:%c ", textpos, text[i], + textpos+9, text[i+1]); + } + textpos += 18; /* width of two codes */ + textptr += strlen(textptr); + } + strcat(partial, guard[1]); + + bc->partial = partial; + bc->textinfo = textinfo; + free(text); + + return 0; +} + diff --git a/barcode-0.98/install-sh b/barcode-0.98/install-sh new file mode 100644 index 00000000..ab74c882 --- /dev/null +++ b/barcode-0.98/install-sh @@ -0,0 +1,238 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# 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}" +mkdirprog="${MKDIRPROG-mkdir}" + +tranformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + 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;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + 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` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/barcode-0.98/library.c b/barcode-0.98/library.c new file mode 100644 index 00000000..a8787020 --- /dev/null +++ b/barcode-0.98/library.c @@ -0,0 +1,244 @@ +/* + * library.c -- external functions of libbarcode + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H /* sometimes (windows, for instance) it's missing */ +# include +#endif +#include + +#include "barcode.h" + +/* + * This function allocates a barcode structure and strdup()s the + * text string. It returns NULL in case of error + */ +struct Barcode_Item *Barcode_Create(char *text) +{ + struct Barcode_Item *bc; + + bc = malloc(sizeof(*bc)); + if (!bc) return NULL; + + memset(bc, 0, sizeof(*bc)); + bc->ascii = strdup(text); + bc->margin = BARCODE_DEFAULT_MARGIN; /* default margin */ + return bc; +} + + +/* + * Free a barcode structure + */ +int Barcode_Delete(struct Barcode_Item *bc) +{ + if (bc->ascii) + free(bc->ascii); + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + if (bc->encoding) + free(bc->encoding); + free(bc); + return 0; /* always success */ +} + + +/* + * The various supported encodings. This might be extended to support + * dynamic addition of extra encodings + */ +extern int Barcode_ean_verify(unsigned char *text); +extern int Barcode_ean_encode(struct Barcode_Item *bc); +extern int Barcode_upc_verify(unsigned char *text); +extern int Barcode_upc_encode(struct Barcode_Item *bc); +extern int Barcode_isbn_verify(unsigned char *text); +extern int Barcode_isbn_encode(struct Barcode_Item *bc); +extern int Barcode_39_verify(unsigned char *text); +extern int Barcode_39_encode(struct Barcode_Item *bc); +extern int Barcode_128b_verify(unsigned char *text); +extern int Barcode_128b_encode(struct Barcode_Item *bc); +extern int Barcode_128c_verify(unsigned char *text); +extern int Barcode_128c_encode(struct Barcode_Item *bc); +extern int Barcode_128_verify(unsigned char *text); +extern int Barcode_128_encode(struct Barcode_Item *bc); +extern int Barcode_128raw_verify(unsigned char *text); +extern int Barcode_128raw_encode(struct Barcode_Item *bc); +extern int Barcode_i25_verify(unsigned char *text); +extern int Barcode_i25_encode(struct Barcode_Item *bc); +extern int Barcode_cbr_verify(unsigned char *text); +extern int Barcode_cbr_encode(struct Barcode_Item *bc); +extern int Barcode_msi_verify(unsigned char *text); +extern int Barcode_msi_encode(struct Barcode_Item *bc); +extern int Barcode_pls_verify(unsigned char *text); +extern int Barcode_pls_encode(struct Barcode_Item *bc); +extern int Barcode_93_verify(unsigned char *text); +extern int Barcode_93_encode(struct Barcode_Item *bc); + + +struct encoding { + int type; + int (*verify)(unsigned char *text); + int (*encode)(struct Barcode_Item *bc); +}; + +struct encoding encodings[] = { + {BARCODE_EAN, Barcode_ean_verify, Barcode_ean_encode}, + {BARCODE_UPC, Barcode_upc_verify, Barcode_upc_encode}, + {BARCODE_ISBN, Barcode_isbn_verify, Barcode_isbn_encode}, + {BARCODE_128B, Barcode_128b_verify, Barcode_128b_encode}, + {BARCODE_128C, Barcode_128c_verify, Barcode_128c_encode}, + {BARCODE_128RAW, Barcode_128raw_verify, Barcode_128raw_encode}, + {BARCODE_39, Barcode_39_verify, Barcode_39_encode}, + {BARCODE_I25, Barcode_i25_verify, Barcode_i25_encode}, + {BARCODE_128, Barcode_128_verify, Barcode_128_encode}, + {BARCODE_CBR, Barcode_cbr_verify, Barcode_cbr_encode}, + {BARCODE_PLS, Barcode_pls_verify, Barcode_pls_encode}, + {BARCODE_MSI, Barcode_msi_verify, Barcode_msi_encode}, + {BARCODE_93, Barcode_93_verify, Barcode_93_encode}, + {0, NULL, NULL} +}; + +/* + * A function to encode a string into bc->partial, ready for + * postprocessing to the output file. Meaningful bits for "flags" are + * the encoding mask and the no-checksum flag. These bits + * get saved in the data structure. + */ +int Barcode_Encode(struct Barcode_Item *bc, int flags) +{ + int validbits = BARCODE_ENCODING_MASK | BARCODE_NO_CHECKSUM; + struct encoding *cptr; + + /* If any flag is cleared in "flags", inherit it from "bc->flags" */ + if (!(flags & BARCODE_ENCODING_MASK)) + flags |= bc->flags & BARCODE_ENCODING_MASK; + if (!(flags & BARCODE_NO_CHECKSUM)) + flags |= bc->flags & BARCODE_NO_CHECKSUM; + flags = bc->flags = (flags & validbits) | (bc->flags & ~validbits); + + if (!(flags & BARCODE_ENCODING_MASK)) { + /* get the first code able to handle the text */ + for (cptr = encodings; cptr->verify; cptr++) + if (cptr->verify((unsigned char *)bc->ascii)==0) + break; + if (!cptr->verify) { + bc->error = EINVAL; /* no code can handle this text */ + return -1; + } + flags |= cptr->type; /* this works */ + bc->flags |= cptr->type; + } + for (cptr = encodings; cptr->verify; cptr++) + if (cptr->type == (flags & BARCODE_ENCODING_MASK)) + break; + if (!cptr->verify) { + bc->error = EINVAL; /* invalid barcode type */ + return -1; + } + if (cptr->verify(bc->ascii) != 0) { + bc->error = EINVAL; + return -1; + } + return cptr->encode(bc); +} + + +/* + * When multiple output formats are supported, there will + * be a jumpt table like the one for the types. Now we don't need it + */ +extern int Barcode_ps_print(struct Barcode_Item *bc, FILE *f); +extern int Barcode_pcl_print(struct Barcode_Item *bc, FILE *f); + +/* + * A function to print a partially decoded string. Meaningful bits for + * "flags" are the output mask etc. These bits get saved in the data + * structure. + */ +int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags) +{ + int validbits = BARCODE_OUTPUT_MASK | BARCODE_NO_ASCII + | BARCODE_OUT_NOHEADERS; + + /* If any flag is clear in "flags", inherit it from "bc->flags" */ + if (!(flags & BARCODE_OUTPUT_MASK)) + flags |= bc->flags & BARCODE_OUTPUT_MASK; + if (!(flags & BARCODE_NO_ASCII)) + flags |= bc->flags & BARCODE_NO_ASCII; + if (!(flags & BARCODE_OUT_NOHEADERS)) + flags |= bc->flags & BARCODE_OUT_NOHEADERS; + flags = bc->flags = (flags & validbits) | (bc->flags & ~validbits); + + if (bc->flags & BARCODE_OUT_PCL) + return Barcode_pcl_print(bc, f); + return Barcode_ps_print(bc, f); +} + +/* + * Choose the position + */ +int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, + int xoff, int yoff, double scalef) +{ + bc->width = wid; bc->height = hei; + bc->xoff = xoff; bc->yoff = yoff; + bc->scalef = scalef; + return 0; +} + +/* + * Do it all in one step + */ +int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, + int xoff, int yoff, int flags) +{ + struct Barcode_Item * bc; + + if (!(bc=Barcode_Create(text))) { + errno = -ENOMEM; + return -1; + } + if ( Barcode_Position(bc, wid, hei, xoff, yoff, 0.0) < 0 + || Barcode_Encode(bc, flags) < 0 + || Barcode_Print(bc, f, flags) < 0) { + errno = bc->error; + Barcode_Delete(bc); + return -1; + } + Barcode_Delete(bc); + return 0; +} + +/* + * Return the version + */ + +int Barcode_Version(char *vptr) +{ + if (vptr) + strcpy(vptr, BARCODE_VERSION); + return BARCODE_VERSION_INT; +} diff --git a/barcode-0.98/main.c b/barcode-0.98/main.c new file mode 100644 index 00000000..e07e4d3c --- /dev/null +++ b/barcode-0.98/main.c @@ -0,0 +1,604 @@ +/* + * main.c - a commandline frontend for the barcode library + * + * Copyright (c) 1999 Michele Comitini (mcm@glisco.it) + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include + +#include "cmdline.h" +#include "barcode.h" + +#ifndef NO_LIBPAPER +#include +#endif + +/* + * Most of this file deals with command line options, by exploiting + * the cmdline.[ch] engine to offer defaults via environment variables + * and handling functions for complex options. + * + * In order to offer a friendly interface (for those who feel the + * cmdline *is* friendly, like me), we have to convert names to enums... + */ + +struct { + char *name; + int type; +} encode_tab[] = { + {"ean", BARCODE_EAN}, + {"ean13", BARCODE_EAN}, + {"ean-13", BARCODE_EAN}, + {"ean8", BARCODE_EAN}, + {"ean-8", BARCODE_EAN}, + {"upc", BARCODE_UPC}, + {"upc-a", BARCODE_UPC}, + {"upc-e", BARCODE_UPC}, + {"isbn", BARCODE_ISBN}, + {"39", BARCODE_39}, + {"code39", BARCODE_39}, + {"128c", BARCODE_128C}, + {"code128c", BARCODE_128C}, + {"128b", BARCODE_128B}, + {"code128b", BARCODE_128B}, + {"128", BARCODE_128}, + {"code128", BARCODE_128}, + {"128raw", BARCODE_128RAW}, + {"i25", BARCODE_I25}, + {"interleaved 2 of 5", BARCODE_I25}, + {"cbr", BARCODE_CBR}, + {"codabar", BARCODE_CBR}, + {"msi", BARCODE_MSI}, + {"pls", BARCODE_PLS}, + {"plessey", BARCODE_PLS}, + {"code93", BARCODE_93}, + {"93", BARCODE_93}, + + {NULL, 0} +}; + +/* + * Get encoding type from string rapresentation. + * Returns -1 on error. + */ +#ifndef HAVE_STRCASECMP /* some libs (windows, for example) have stricmp */ +# define strcasecmp stricmp +#endif + +int encode_id(char *encode_name) +{ + int i; + for (i = 0; encode_tab[i].name; i++) + if (!strcasecmp(encode_tab[i].name, encode_name)) + return encode_tab[i].type; + return -1; +} + +int list_encodes(FILE *f) /* used in the help message */ +{ + int prev = -1; + int i; + + fprintf(f, "Known encodings are (synonyms appear on the same line):"); + for (i = 0; encode_tab[i].name; i++) { + if (encode_tab[i].type != prev) + fprintf(f, "\n\t"); + else + fprintf(f, ", "); + fprintf(f, "\"%s\"", encode_tab[i].name); + prev = encode_tab[i].type; + } + fprintf(f, "\n"); + return 0; +} + + +/* + * Variables to hold cmdline arguments (or defaults) + */ + +char *ifilename, *ofilename; +int encoding_type; /* filled by get_encoding() */ +int code_width, code_height; /* "-g" for standalone codes */ +int lines, columns; /* "-t" for tables */ +int xmargin0, ymargin0; /* both for "-g" and "-t" */ +int xmargin1, ymargin1; /* same, but right and top */ +int ximargin, yimargin; /* "-m": internal margins */ +int eps, pcl, ps, noascii, nochecksum; /* boolean flags */ +int page_wid, page_hei; /* page size in points */ +char *page_name; /* name of the media */ +double unit = 1.0; /* unit specification */ + +char *prgname; /* used to print error msgs, initialized to argv[0] by main */ + +/* + * Functions to handle command line arguments + */ + +struct encode_item { + char *string; + struct encode_item *next; +} *list_head, *list_tail; + +/* each "-b" option adds a string to the input pool allocating its space */ +int get_input_string(void *arg) +{ + struct encode_item *item = malloc(sizeof(*item)); + if (!item) { + fprintf(stderr, "%s: malloc: %s\n", prgname, strerror(errno)); + return -2; + } + item->string = strdup(arg); + if (!list_head) { + list_head = list_tail = item; + } else { + list_tail->next = item; + list_tail = item; + } + item->next = NULL; + return 0; +} + +/* and this function extracts strings from the pool */ +unsigned char *retrieve_input_string(FILE *ifile) +{ + char *string; + static char fileline[128]; + + struct encode_item *item = list_head; + if (list_tail) { /* this means at least one "-b" was specified */ + if (!item) + return NULL; /* the list is empty */ + string = item->string; + list_head = item->next; + free(item); + return string; + } + + /* else, read from the file */ + if (!fgets(fileline, 128, ifile)) + return NULL; + if (fileline[strlen(fileline)-1]=='\n') + fileline[strlen(fileline)-1]= '\0'; + return strdup(fileline); +} + +/* accept a unit specification */ +int get_unit(void *arg) +{ + static struct { + char *str; + double unit; + } *ptr, unittab[] = { + {"pt", 1.0}, + {"in", 72.0}, + {"cm", 72.0/2.54}, + {"mm", 72.0/25.4}, + {NULL, 0.0} + }; + + for (ptr = unittab; ptr->str && strcmp((char *)arg, ptr->str); ptr++) + ; + unit = ptr->unit; + if (ptr->str) return 0; + + fprintf(stderr, "%s: incorrect unit \"%s\" (use one of", + prgname, (char *)arg); + for (ptr = unittab; ptr->str; ptr++) + fprintf(stderr, " \"%s\"", ptr->str); + fprintf(stderr, ")\n"); + return -2; +} + +/* convert an encoding name to an encoding integer code */ +int get_encoding(void *arg) +{ + encoding_type = encode_id((char *)arg); + if (encoding_type >=0) return 0; + fprintf(stderr, "%s: wrong encoding \"%s\"\n", prgname, + (char *)arg); + return -2; /* error, no help */ +} + +/* convert a geometry specification */ +int get_geometry(void *arg) +{ + double w = 0.0, h = 0.0; + double x = 0.0, y = 0.0; + int n; + + if (((char *)arg)[0]=='+') { + n = sscanf((char *)arg, "+%lf+%lf%s", &x, &y, (char *)arg); + } else { + n = sscanf((char *)arg, "%lfx%lf+%lf+%lf%s", &w, &h, &x, &y, + (char *)arg); + } + if (n!=4 && n!=2) { + fprintf(stderr, "%s: wrong geometry \"%s\"\n", prgname, (char *)arg); + return -2; + } + /* convert to points */ + code_width = w * unit; + code_height = h * unit; + xmargin0 = x * unit; + ymargin0 = y * unit; + return 0; +} + +/* convert a geometry specification */ +int get_table(void *arg) +{ + double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0; + int n; + + n = sscanf((char *)arg, "%dx%d+%lf+%lf-%lf-%lf", + &columns, &lines, &x0, &y0, &x1, &y1); + + if (n==1 || n==3) { /* error: 2, 4, 5, 6 are fine */ + fprintf(stderr, "%s: wrong table specification \"%s\"\n", prgname, + (char *)arg); + return -2; + } + if (n < 6) y1 = y0; /* symmetric by default */ + if (n < 5) x1 = x0; + + /* convert and return */ + xmargin0 = x0 * unit; + ymargin0 = y0 * unit; + xmargin1 = x1 * unit; + ymargin1 = y1 * unit; + return 0; +} + +/* convert an internal margin specification */ +int get_margin(void *arg) +{ + char separator; + double x,y; + int n; + + /* accept one number or two, separated by any char */ + n = sscanf((char *)arg, "%lf%c%lf", &x, &separator, &y); + + if (n==1) { + n=3; y = x; + } + if (n==3) { + ximargin = x * unit; + yimargin = y * unit; + return 0; + } + fprintf(stderr, "%s: wrong margin specification \"%s\"\n", prgname, + (char *)arg); + return -2; + return 0; +} + +/* convert a page geometry specification */ +int get_page_geometry(void *arg) +{ + int n; + double dpw, dph; /* page width, height in mm or inches */ + static char tmpstr[20]; + page_name = arg; /* if undecipherable, we won't run the program :) */ + /* + * try to decode a "mm" string (eg. "210mmx297mm" or "210x297mm") + */ + n = sscanf((char *)arg, "%lfmmx%lf", &dpw, &dph); + if (n != 2 && strlen(arg)<20) { + n = sscanf((char *)arg, "%lfx%lf%s", &dpw, &dph, tmpstr); + if (n == 3 && !strcmp(tmpstr, "mm")) { + /* Ok, convert to points: 1in is 25.4mm, 1in is also 72p */ + page_wid = (int)(dpw / 25.4 * 72.0 + 0.5); + page_hei = (int)(dph / 25.4 * 72.0 + 0.5); + return 0; + } + } + + /* + * try to decode an "in" string (eg. "8.5inx11in" or "8.5x11in") + */ + n = sscanf((char *)arg, "%lfinx%lf", &dpw, &dph); + if (n != 2 && strlen(arg)<20) { + n = sscanf((char *)arg, "%lfx%lf%s", &dpw, &dph, tmpstr); + if (n == 3 && !strcmp(tmpstr, "in")) { + page_wid = (int)(dpw * 72.0 + 0.5); /* round to points */ + page_hei = (int)(dph * 72.0 + 0.5); + return 0; + } + } + + /* + * try to decode a numeric specification + */ + n = sscanf((char *)arg, "%lfx%lf", &dpw, &dph); + if (n == 2) { + page_wid = dpw * unit; + page_hei = dph * unit; + if (unit != 1.0) { /* rebuild the page name */ + page_name = malloc(32); /* big, to avoid snprintf, missing on HP */ + if (page_name) + sprintf(page_name, "%dx%d\n", page_wid, page_hei); + } + return 0; + } + +#ifndef NO_LIBPAPER + /* + * try to use libpaper, since it is available + */ + { + const struct paper* paptr; + + paperinit(); + paptr = paperinfo(arg); + if (!paptr) { /* unknown name */ + paperdone(); + return -1; + } + page_wid = (int)(paperpswidth(paptr) + 0.5); + page_hei = (int)(paperpsheight(paptr) + 0.5); + paperdone(); + return 0; + } +#endif + /* If we got here, the argument is undecipherable: fail */ + fprintf(stderr, "%s: wrong page size specification \"%s\"\n", prgname, + (char *)arg); + return -2; +} + +/* + * The table of possible arguments + */ +struct commandline option_table[] = { + {'i', CMDLINE_S, &ifilename, NULL, NULL, NULL, + "input file (strings to encode), default is stdin"}, + {'o', CMDLINE_S, &ofilename, NULL, NULL, NULL, + "output file, default is stdout"}, + {'b', CMDLINE_S, NULL, get_input_string, NULL, NULL, + "string to encode (use input file if missing)"}, + {'e', CMDLINE_S, NULL, get_encoding, "BARCODE_ENCODING", NULL, + "encoding type (default is best fit for first string)"}, + {'u', CMDLINE_S, NULL, get_unit, "BARCODE_UNIT", NULL, + "unit (\"mm\", \"in\", ...) used to decode -g, -t, -p"}, + {'g', CMDLINE_S, NULL, get_geometry, "BARCODE_GEOMETRY", NULL, + "geometry on the page: [x][++]"}, + {'t', CMDLINE_S, NULL, get_table, "BARCODE_TABLE", NULL, + "table geometry: x[++]"}, + {'m', CMDLINE_S, NULL, get_margin, "BARCODE_MARGIN", "10", + "internal margin for each item in a table: [,]"}, + {'n', CMDLINE_NONE, &noascii, NULL, NULL, NULL, + "\"numeric\": avoid printing text along with the bars"}, + {'c', CMDLINE_NONE, &nochecksum, NULL, NULL, NULL, + "no Checksum character, if the chosen encoding allows it"}, + {'E', CMDLINE_NONE, &eps, NULL, NULL, NULL, + "print one code as eps file (default: multi-page ps)"}, + {'P', CMDLINE_NONE, &pcl, NULL, NULL, NULL, + "create PCL output instead of postscript"}, + {'p', CMDLINE_S, NULL, get_page_geometry, NULL, NULL, + "page size (refer to the man page)"}, + {0,} +}; + +#ifdef NO_STRERROR +/* + * A strerror replacement (thanks to Thad Floryan ) + */ +char *strerror(int error) +{ + static char msg[16]; + if (error >= 0 && error < sys_nerr) + return sys_errlist[error]; + sprintf(msg, "Error %d", error); + return msg; +} +#endif + +/* + * The main function + */ +int main(int argc, char **argv) +{ + struct Barcode_Item * bc; + FILE *ifile = stdin; + FILE *ofile = stdout; + char *line; + int flags=0; /* for the library */ + int page, retval; + + prgname = argv[0]; + + /* First of all, accept "--help" and "-h" as a special case */ + if (argc == 2 && (!strcmp(argv[1],"--help") || !strcmp(argv[1],"-h"))) { + commandline_errormsg(stderr, option_table, argv[0], "Options:\n"); + fprintf(stderr,"\n"); + list_encodes(stderr); + exit(1); + } + /* Also, accept "--version" as a special case */ + if (argc == 2 && (!strcmp(argv[1],"--version"))) { + printf("barcode frontend (GNU barcode) " BARCODE_VERSION "\n"); + exit(0); + } + + /* Otherwise, parse the commandline */ + retval = commandline(option_table, argc, argv, "Use: %s [options]\n"); + if (retval) { + if (retval == -1) /* help printed, complete it */ + list_encodes(stderr); + else /* no help printed, suggest it */ + fprintf(stderr, "%s: try \"%s --help\"\n", prgname, prgname); + exit(1); + } + + /* If no paper size has been specified, use the default, if any */ + if (!page_name) { + page_wid = 595; page_hei = 842; + page_name = "A4"; /* I live in Europe :) */ +#ifndef NO_LIBPAPER + get_page_geometry(systempapername()); /* or the system default */ +#endif + } + + /* FIXME: print warnings for incompatible options */ + + /* open the input stream if specified */ + if (ifilename) + ifile = fopen(ifilename,"r"); + if (!ifile) { + fprintf(stderr, "%s: %s: %s\n", argv[0], ifilename, + strerror(errno)); + exit(1); + } + + /* open the output stream if specified */ + if (ofilename) + ofile = fopen(ofilename,"w"); + if (!ofile) { + fprintf(stderr, "%s: %s: %s\n", argv[0], ofilename, + strerror(errno)); + exit(1); + } + + if (encoding_type < 0) { /* unknown type specified */ + fprintf(stderr,"%s: Unknown endoding. Try \"%s --help\"\n", + argv[0], argv[0]); + exit(1); + } + flags |= encoding_type; + if (pcl) { + flags |= BARCODE_OUT_PCL; + } else { + ps = !eps; /* a shortcut */ + if (eps) + flags |= BARCODE_OUT_EPS; /* print headers too */ + else + flags |= BARCODE_OUT_PS | BARCODE_OUT_NOHEADERS; + } + if (noascii) + flags |= BARCODE_NO_ASCII; + if (nochecksum) + flags |= BARCODE_NO_CHECKSUM; + + /* the table is not available in eps mode */ + if (eps && (lines>1 || columns>1)) { + fprintf(stderr, "%s: can't print tables in EPS format\n",argv[0]); + exit(1); + } + + if (ps) { /* The header is independent of single/table mode */ + /* Headers. Don't let the library do it, we may need multi-page */ + fprintf(ofile, "%%!PS-Adobe-2.0\n"); + /* It would be nice to know the bounding box. Leave it alone */ + fprintf(ofile, "%%%%Creator: \"barcode\", " + "libbarcode sample frontend\n"); + if (page_name) + fprintf(ofile, "%%%%DocumentPaperSizes: %s\n", page_name); + fprintf(ofile, "%%%%EndComments\n"); + fprintf(ofile, "%%%%EndProlog\n\n"); + } + + /* + * Here we are, ready to work. Handle the one-per-page case first, + * as it is shorter. + */ + if (!lines && !columns) { + page = 0; + while ( (line = retrieve_input_string(ifile)) ) { + page++; + if (ps) { + fprintf(ofile, "%%%%Page: %i %i\n\n",page,page); + } + if (Barcode_Encode_and_Print(line, ofile, code_width, code_height, + xmargin0, ymargin0, flags) < 0) { + fprintf(stderr, "%s: can't encode \"%s\"\n", argv[0], line); + } + if (eps) break; /* if output is eps, do it once only */ + if (ps) fprintf(ofile, "showpage\n"); + if (pcl) fprintf(ofile, "\f"); + } + /* no more lines, print footers */ + if (ps) { + fprintf(ofile, "%%%%Trailer\n\n"); + } + } else { + + /* table mode, the header has been already printed */ + + int xstep = (page_wid - xmargin0 - xmargin1)/columns; + int ystep = (page_hei - ymargin0 - ymargin1)/lines; + int x = columns, y = -1; /* position in the table, start off-page */ + + if (!ximargin) ximargin = BARCODE_DEFAULT_MARGIN; + if (!yimargin) yimargin = BARCODE_DEFAULT_MARGIN; + /* Assign default size unless -g did it (Joachim Reichelt) */ + if ( !code_width && !code_height) { + code_width = xstep - 2*ximargin; + code_height = ystep - 2*yimargin; + } + + page=0; + while ( (line = retrieve_input_string(ifile)) ) { + x++; /* fit x and y */ + if (x >= columns) { + x=0; y--; + if (y<0) { + y = lines-1; page++; + /* flush page */ + if (ps && page > 1) fprintf(ofile, "showpage\n"); + if (pcl && page > 1) fprintf(ofile, "\f"); + /* new page */ + if (ps) fprintf(ofile, "%%%%Page: %i %i\n\n",page,page); + } + } + + /* + * Create a barcode item. This allows to set the margin to 0, as + * we have [xy]imargin to use. But don't use Encode_and_Print(), + * unroll it here instead + */ + bc = Barcode_Create(line); + if (!bc) { + fprintf(stderr, "%s: Barcode_Create(): %s\n", argv[0], + strerror(errno)); + exit(1); + } + bc->margin = 0; + if ( (Barcode_Position(bc, code_width, code_height, + xmargin0 + ximargin + x * xstep, + ymargin0 + yimargin + y * ystep, 0.0) < 0) + || (Barcode_Encode(bc, flags) < 0) + || (Barcode_Print(bc, ofile, flags) < 0) ) { + fprintf(stderr, "%s: can't encode \"%s\": %s\n", argv[0], + line, strerror(bc->error)); + } + Barcode_Delete(bc); + } + if (ps) fprintf(ofile, "showpage\n\n%%%%Trailer\n\n"); + if (pcl) fprintf(ofile, "\f"); + } + return 0; +} + + + diff --git a/barcode-0.98/missing b/barcode-0.98/missing new file mode 100755 index 00000000..d46f79f6 --- /dev/null +++ b/barcode-0.98/missing @@ -0,0 +1,198 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. +# Franc,ois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.in; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing - GNU libit 0.0" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`$configure_ac'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`$configure_ac'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`$configure_ac'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/barcode-0.98/mkinstalldirs b/barcode-0.98/mkinstalldirs new file mode 100755 index 00000000..6b3b5fc5 --- /dev/null +++ b/barcode-0.98/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id$ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/barcode-0.98/msi.c b/barcode-0.98/msi.c new file mode 100644 index 00000000..77a373b2 --- /dev/null +++ b/barcode-0.98/msi.c @@ -0,0 +1,155 @@ +/* + * msi.c -- encoding for MSI-Plessey + * + * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + + +/* Patterns */ +static char *patterns[] = { "13", "31" }; + +static char *fillers[] = { "031", "131" }; + +static int width = 16 /* each character uses 4 patterns */, + startpos = 6 /* length of the first filler */; + +/* + * Check that the text can be encoded. Returns 0 or -1. + */ +int Barcode_msi_verify(unsigned char *text) +{ + int i; + + if (!strlen(text)) + return -1; + for (i=0; text[i]; i++) { + if (!isdigit(text[i])) + return -1; + } + return 0; +} + +static int add_one(char *ptr, int code) +{ + sprintf(ptr, "%s%s%s%s", + patterns[(code >> 3) & 1], + patterns[(code >> 2) & 1], + patterns[(code >> 1) & 1], + patterns[code & 1]); + return 0; +} + +/* + * The encoding functions fills the "partial" and "textinfo" fields. + * Lowercase chars are converted to uppercase + */ +int Barcode_msi_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *ptr, *textptr; + int i, code, textpos, usesum, checksum = 0; + + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("msi"); + + if ((bc->flags & BARCODE_NO_CHECKSUM)) + usesum = 0; + else + usesum = 1; + + text = bc->ascii; + + /* the partial code is head + 8 * (text + check) + tail + margin + term. */ + partial = malloc( 3 + 8 * (strlen(text) + 1) + 3 + 2 ); + if (!partial) { + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * strlen +term */ + textinfo = malloc(10*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + strcpy(partial, fillers[0]); + ptr = partial + strlen(partial); + textptr = textinfo; + textpos = startpos; + + for (i=0; ipartial = partial; + bc->textinfo = textinfo; + + return 0; +} diff --git a/barcode-0.98/pcl.c b/barcode-0.98/pcl.c new file mode 100644 index 00000000..d5ec097a --- /dev/null +++ b/barcode-0.98/pcl.c @@ -0,0 +1,200 @@ +/* + * pcl.c -- printing the "partial" bar encoding in PCL format + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * Copyright (c) 2001 Andrea Scopece (a.scopece@tin.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + +#define SHRINK_AMOUNT 0.15 /* shrink the bars to account for ink spreading */ + + +/* + * How do the "partial" and "textinfo" strings work? See file "ps.c" + */ + + +int Barcode_pcl_print(struct Barcode_Item *bc, FILE *f) +{ + int i, j, k, barlen; + double f1, f2, fsav=0; + int mode = '-'; /* text below bars */ + double scalef=1, xpos, x0, y0, yr; + unsigned char *ptr; + unsigned char c; + + char font_id[6]; /* default font, should be "scalable" */ + /* 0 Line printer, use on older LJet II, isn't scalable */ + /* 4148 Univers, use on LJet III series, and Lj 4L, 5L */ + /* 16602 Arial, default LJ family 4, 5, 6, Color, Djet */ + + if (!bc->partial || !bc->textinfo) { + bc->error = EINVAL; + return -1; + } + + /* + * Maybe this first part can be made common to several printing back-ends, + * we'll see how that works when other ouput engines are added + */ + + /* First, calculate barlen */ + barlen = bc->partial[0] - '0'; + for (ptr = bc->partial+1; *ptr; ptr++) + if (isdigit(*ptr)) + barlen += (*ptr - '0'); + else if (islower(*ptr)) + barlen += (*ptr - 'a'+1); + + /* The scale factor depends on bar length */ + if (!bc->scalef) { + if (!bc->width) bc->width = barlen; /* default */ + scalef = bc->scalef = (double)bc->width / (double)barlen; + } + + /* The width defaults to "just enough" */ + if (!bc->width) bc->width = barlen * scalef +1; + + /* But it can be too small, in this case enlarge and center the area */ + if (bc->width < barlen * scalef) { + int wid = barlen * scalef + 1; + bc->xoff -= (wid - bc->width)/2 ; + bc->width = wid; + /* Can't extend too far on the left */ + if (bc->xoff < 0) { + bc->width += -bc->xoff; + bc->xoff = 0; + } + } + + /* The height defaults to 80 points (rescaled) */ + if (!bc->height) bc->height = 80 * scalef; + +#if 0 + /* If too small (5 + text), enlarge and center */ + i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); + if (bc->height < i * scalef ) { + int hei = i * scalef; + bc->yoff -= (hei-bc->height)/2; + bc->height = hei; + if (bc->yoff < 0) { + bc->height += -bc->yoff; + bc->yoff = 0; + } + } +#else + /* If too small (5 + text), reduce the scale factor and center */ + i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); + if (bc->height < i * scalef ) { + double scaleg = ((double)bc->height) / i; + int wid = bc->width * scaleg / scalef; + bc->xoff += (bc->width - wid)/2; + bc->width = wid; + scalef = scaleg; + } +#endif + + /* + * deal with PCL output + */ + + xpos = bc->margin + (bc->partial[0]-'0') * scalef; + for (ptr = bc->partial+1, i=1; *ptr; ptr++, i++) { + /* special cases: '+' and '-' */ + if (*ptr == '+' || *ptr == '-') { + mode = *ptr; /* don't count it */ i++; continue; + } + + /* j is the width of this bar/space */ + if (isdigit (*ptr)) j = *ptr-'0'; + else j = *ptr-'a'+1; + if (i%2) { /* bar */ + x0 = bc->xoff + xpos; + y0 = bc->yoff + bc->margin; + yr = bc->height; + if (!(bc->flags & BARCODE_NO_ASCII)) { /* leave space for text */ + if (mode == '-') { + /* text below bars: 10 points or five points */ + yr -= (isdigit(*ptr) ? 10 : 5) * scalef; + } else { /* '+' */ + /* text above bars: 10 or 0 from bottom, and 10 from top */ + y0 += (isdigit(*ptr) ? 10 : 0) * scalef; + yr -= (isdigit(*ptr) ? 20 : 10) * scalef; + } + } + + fprintf(f,"%c&a%.0fH", 27, x0 * 10.0); + fprintf(f,"%c&a%.0fV", 27, y0 * 10.0); + fprintf(f,"%c*c%.0fH", 27, ((j*scalef)-SHRINK_AMOUNT) * 10.0); + fprintf(f,"%c*c%.0fV", 27, yr * 10.0); + fprintf(f,"%c*c0P\n", 27); + } + xpos += j * scalef; + } + + /* the text */ + + mode = '-'; /* reinstantiate default */ + if (!(bc->flags & BARCODE_NO_ASCII)) { + k=0; /* k is the "previous font size" */ + for (ptr = bc->textinfo; ptr; ptr = strchr(ptr, ' ')) { + while (*ptr == ' ') ptr++; + if (!*ptr) break; + if (*ptr == '+' || *ptr == '-') { + mode = *ptr; continue; + } + if (sscanf(ptr, "%lf:%lf:%c", &f1, &f2, &c) != 3) { + fprintf(stderr, "barcode: impossible data: %s\n", ptr); + continue; + } + + /* select a Scalable Font */ + + if (fsav != f2) + { + if ((bc->flags & BARCODE_OUT_PCL_III) == BARCODE_OUT_PCL_III) + { strcpy(font_id, "4148"); /* font Univers */ + } + else + { strcpy(font_id, "16602"); /* font Arial */ + } + + fprintf(f,"%c(8U%c(s1p%5.2fv0s0b%sT", 27, 27, f2 * scalef, font_id); + } + fsav = f2; + + fprintf(f,"%c&a%.0fH", 27, (bc->xoff + f1 * scalef + bc->margin) * 10.0); + fprintf(f,"%c&a%.0fV", 27, + mode != '-' + ? ((double)bc->yoff + bc->margin + 8*scalef) * 10.0 + : ((double)bc->yoff + bc->margin + bc->height ) * 10.0); + + fprintf(f, "%c", c); + } + + } + + return 0; +} diff --git a/barcode-0.98/plessey.c b/barcode-0.98/plessey.c new file mode 100644 index 00000000..ec471005 --- /dev/null +++ b/barcode-0.98/plessey.c @@ -0,0 +1,164 @@ +/* + * plessey.c -- encoding for Plessey + * + * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + +static char * patterns[] = { "13", "31" }; + +/* this is ordered in decades to simplify encoding */ +static char alphabet[] = + "0123456789" "ABCDEF"; + +/* stop sequence may be 231311313 (barcodemill.com) */ +static char *fillers[] = { "031311331", "331311313" }; + +static int width = 16, startpos = 16; + +/* + * Check that the text can be encoded. Returns 0 or -1. + * If it's all lowecase convert to uppercase and accept it + */ +int Barcode_pls_verify(unsigned char *text) +{ + int i, upper = 0, lower = 0; + + if (!strlen(text)) + return -1; + for (i=0; text[i]; i++) { + if (!strchr(alphabet,toupper(text[i]))) + return -1; + if (isupper(text[i])) upper++; + if (islower(text[i])) lower++; + } + if (upper && lower) + return -1; + return 0; +} + +static int add_one(char *ptr, int code) +{ + sprintf(ptr, "%s%s%s%s", + patterns[code & 1], + patterns[(code >> 1) & 1], + patterns[(code >> 2) & 1], + patterns[(code >> 3) & 1] + ); + return 0; +} + +/* + * The encoding functions fills the "partial" and "textinfo" fields. + * Lowercase chars are converted to uppercase + */ +int Barcode_pls_encode(struct Barcode_Item *bc) +{ + static char *text; + static char *partial; /* dynamic */ + static char *textinfo; /* dynamic */ + char *c, *ptr, *textptr; + unsigned char *checkptr; + int i, code, textpos; + static char check[9] = {1,1,1,1,0,1,0,0,1}; + if (bc->partial) + free(bc->partial); + if (bc->textinfo) + free(bc->textinfo); + bc->partial = bc->textinfo = NULL; /* safe */ + + if (!bc->encoding) + bc->encoding = strdup("plessey"); + + text = bc->ascii; + if (!text) { + bc->error = EINVAL; + return -1; + } + /* the partial code is 8 * (head + text + check + tail) + margin + term. */ + partial = malloc( (strlen(text) + 4) * 8 + 3); + checkptr = calloc (1, strlen(text) * 4 + 8); + + if (!partial || !checkptr) { + if (partial) free(partial); + if (checkptr) free(checkptr); + bc->error = errno; + return -1; + } + + /* the text information is at most "nnn:fff:c " * strlen +term */ + textinfo = malloc(10*strlen(text) + 2); + if (!textinfo) { + bc->error = errno; + free(partial); + return -1; + } + + strcpy(partial, fillers[0]); + ptr = partial + strlen(partial); + textptr = textinfo; + textpos = startpos; + + for (i=0; ierror = EINVAL; /* impossible if text is verified */ + free(partial); + free(textinfo); + return -1; + } + code = c - alphabet; + add_one(ptr, code); + sprintf(textptr, "%i:12:%c ", textpos, toupper(text[i])); + + textpos += width; /* width of each code */ + textptr += strlen(textptr); + ptr += strlen(ptr); + checkptr[4*i] = code & 1; + checkptr[4*i+1] = (code >> 1) & 1; + checkptr[4*i+2] = (code >> 2) & 1; + checkptr[4*i+3] = (code >> 3) & 1; + } + /* The CRC checksum is required */ + for (i=0; i < 4*strlen(text); i++) { + int j; + if (checkptr[i]) + for (j = 0; j < 9; j++) + checkptr[i+j] ^= check[j]; + } + for (i = 0; i < 8; i++) { + sprintf(ptr, patterns[checkptr[strlen(text) * 4 + i]]); + ptr += 2; + } + fprintf(stderr, "CRC: "); + for (i = 0; i < 8; i++) { + fputc('0' + checkptr[strlen(text) * 4 + i], stderr); + } + fputc('\n', stderr); + strcpy(ptr, fillers[1]); + bc->partial = partial; + bc->textinfo = textinfo; + + return 0; +} diff --git a/barcode-0.98/ps.c b/barcode-0.98/ps.c new file mode 100644 index 00000000..35917517 --- /dev/null +++ b/barcode-0.98/ps.c @@ -0,0 +1,272 @@ +/* + * ps.c -- printing the "partial" bar encoding + * + * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) + * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include +#include + +#include "barcode.h" + +#define SHRINK_AMOUNT 0.15 /* shrink the bars to account for ink spreading */ + + +/* + * How do the "partial" and "textinfo" strings work? + * + * The first char in "partial" tells how much extra space to add to the + * left of the bars. For EAN-13, it is used to leave space to print the + * first digit, other codes may have '0' for no-extra-space-needed. + * + * The next characters are alternating bars and spaces, as multiples + * of the base dimension which is 1 unless the code is + * rescaled. Rescaling is calculated as the ratio from the requested + * width and the calculated width. Digits represent bar/space + * dimensions. Lower-case letters represent those bars that should + * extend lower than the others: 'a' is equivalent to '1', 'b' is '2' and + * so on. + * + * The "textinfo" string is made up of fields "%lf:%lf:%c" separated by + * blank space. The first integer is the x position of the character, + * the second is the font size (before rescaling) and the char item is + * the charcter to be printed. + * + * Both the "partial" and "textinfo" strings may include "-" or "+" as + * special characters (in "textinfo" the char should be a standalone + * word). They state where the text should be printed: below the bars + * ("-", default) or above the bars. This is used, for example, to + * print the add-5 and add-2 codes to the right of UPC or EAN codes + * (the add-5 extension is mostly used in ISBN codes. + */ + + +int Barcode_ps_print(struct Barcode_Item *bc, FILE *f) +{ + int i, j, k, barlen, printable=1; + double f1, f2, fsav=0; + int mode = '-'; /* text below bars */ + double scalef=1, xpos, x0, y0, yr; + unsigned char *ptr; + unsigned char c; + + if (!bc->partial || !bc->textinfo) { + bc->error = EINVAL; + return -1; + } + + + /* + * Maybe this first part can be made common to several printing back-ends, + * we'll see how that works when other ouput engines are added + */ + + /* First, calculate barlen */ + barlen = bc->partial[0] - '0'; + for (ptr = bc->partial+1; *ptr; ptr++) + if (isdigit(*ptr)) + barlen += (*ptr - '0'); + else if (islower(*ptr)) + barlen += (*ptr - 'a'+1); + + /* The scale factor depends on bar length */ + if (!bc->scalef) { + if (!bc->width) bc->width = barlen; /* default */ + scalef = bc->scalef = (double)bc->width / (double)barlen; + } + + /* The width defaults to "just enough" */ + if (!bc->width) bc->width = barlen * scalef +1; + + /* But it can be too small, in this case enlarge and center the area */ + if (bc->width < barlen * scalef) { + int wid = barlen * scalef + 1; + bc->xoff -= (wid - bc->width)/2 ; + bc->width = wid; + /* Can't extend too far on the left */ + if (bc->xoff < 0) { + bc->width += -bc->xoff; + bc->xoff = 0; + } + } + + /* The height defaults to 80 points (rescaled) */ + if (!bc->height) bc->height = 80 * scalef; + +#if 0 + /* If too small (5 + text), enlarge and center */ + i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); + if (bc->height < i * scalef ) { + int hei = i * scalef; + bc->yoff -= (hei-bc->height)/2; + bc->height = hei; + if (bc->yoff < 0) { + bc->height += -bc->yoff; + bc->yoff = 0; + } + } +#else + /* If too small (5 + text), reduce the scale factor and center */ + i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); + if (bc->height < i * scalef ) { + double scaleg = ((double)bc->height) / i; + int wid = bc->width * scaleg / scalef; + bc->xoff += (bc->width - wid)/2; + bc->width = wid; + scalef = scaleg; + } +#endif + + /* + * Ok, then deal with actual ps (eps) output + */ + + if (!(bc->flags & BARCODE_OUT_NOHEADERS)) { /* spit a header first */ + if (bc->flags & BARCODE_OUT_EPS) + fprintf(f, "%%!PS-Adobe-2.0 EPSF-1.2\n"); + else + fprintf(f, "%%!PS-Adobe-2.0\n"); + fprintf(f, "%%%%Creator: libbarcode\n"); + if (bc->flags & BARCODE_OUT_EPS) { + fprintf(f, "%%%%BoundingBox: %i %i %i %i\n", + bc->xoff, + bc->yoff, + bc->xoff + bc->width + 2* bc->margin, + bc->yoff + bc->height + 2* bc->margin); + } + fprintf(f, "%%%%EndComments\n"); + if (bc->flags & BARCODE_OUT_PS) { + fprintf(f, "%%%%EndProlog\n\n"); + fprintf(f, "%%%%Page: 1 1\n\n"); + } + } + + /* Print some informative comments */ + for (i=0; bc->ascii[i]; i++) + if (bc->ascii[i] < ' ') + printable = 0; + + fprintf(f,"%% Printing barcode for \"%s\", scaled %5.2f", + printable ? bc->ascii : "", scalef); + if (bc->encoding) + fprintf(f,", encoded using \"%s\"",bc->encoding); + fprintf(f, "\n"); + fprintf(f,"%% The space/bar succession is represented " + "by the following widths (space first):\n" + "%% "); + for (i=0; ipartial); i++) { + unsigned char c = bc->partial[i]; + if (isdigit(c)) putc(c, f); + if (islower(c)) putc(c-'a'+'1', f); + if (isupper(c)) putc(c-'A'+'1', f); + } + /* open array for "forall" */ + fprintf(f, "\n[\n%% height xpos ypos width" + " height xpos ypos width\n"); + + xpos = bc->margin + (bc->partial[0]-'0') * scalef; + for (ptr = bc->partial+1, i=1; *ptr; ptr++, i++) { + /* special cases: '+' and '-' */ + if (*ptr == '+' || *ptr == '-') { + mode = *ptr; /* don't count it */ i++; continue; + } + /* j is the width of this bar/space */ + if (isdigit (*ptr)) j = *ptr-'0'; + else j = *ptr-'a'+1; + if (i%2) { /* bar */ + x0 = bc->xoff + xpos + (j*scalef)/2; + y0 = bc->yoff + bc->margin; + yr = bc->height; + if (!(bc->flags & BARCODE_NO_ASCII)) { /* leave space for text */ + if (mode == '-') { + /* text below bars: 10 points or five points */ + y0 += (isdigit(*ptr) ? 10 : 5) * scalef; + yr -= (isdigit(*ptr) ? 10 : 5) * scalef; + } else { /* '+' */ + /* text above bars: 10 or 0 from bottom, and 10 from top */ + y0 += (isdigit(*ptr) ? 10 : 0) * scalef; + yr -= (isdigit(*ptr) ? 20 : 10) * scalef; + } + } + /* Define an array and then use "forall" (Hans Schou) */ + fprintf(f," [%5.2f %6.2f %6.2f %5.2f]%s", + yr, x0, y0, (j * scalef) - SHRINK_AMOUNT, + i%4 == 1 ? " " : "\n"); + } + xpos += j * scalef; + } + fprintf(f,"\n]\t{ {} forall setlinewidth moveto 0 exch rlineto stroke} " + "bind forall\n"); + + /* Then, the text */ + + mode = '-'; /* reinstantiate default */ + if (!(bc->flags & BARCODE_NO_ASCII)) { + fprintf(f, "[\n%% char xpos ypos fontsize\n"); + k=0; /* k is the "previous font size" */ + for (ptr = bc->textinfo; ptr; ptr = strchr(ptr, ' ')) { + while (*ptr == ' ') ptr++; + if (!*ptr) break; + if (*ptr == '+' || *ptr == '-') { + mode = *ptr; continue; + } + if (sscanf(ptr, "%lf:%lf:%c", &f1, &f2, &c) != 3) { + fprintf(stderr, "barcode: impossible data: %s\n", ptr); + continue; + } + + fprintf(f, " [("); + /* Both the backslash and the two parens are special */ + if (c=='\\' || c==')' || c=='(') + fprintf(f, "\\%c) ", c); + else + fprintf(f, "%c) ", c); + fprintf(f, "%6.2f %6.2f %5.2f]\n", + bc->xoff + f1 * scalef + bc->margin, + mode == '-' + ? (double)bc->yoff + bc->margin + : (double)bc->yoff + bc->margin+bc->height - 8*scalef, + fsav == f2 ? 0.0 : f2 * scalef); + fsav = f2; + } + fprintf(f,"] { {} forall dup 0.00 ne {\n\t" + "/Helvetica findfont exch scalefont setfont\n" + " } {pop} ifelse\n" + " moveto show} bind forall\n"); + + + } + + fprintf(f,"%% End barcode for \"%s\"\n\n", + printable ? bc->ascii : ""); + + if (!(bc->flags & BARCODE_OUT_NOHEADERS)) { + if (bc->flags & BARCODE_OUT_PS) { + fprintf(f,"showpage\n"); + fprintf(f, "%%%%Trailer\n\n"); + } + } + return 0; +} + + + + diff --git a/barcode-0.98/sample.c b/barcode-0.98/sample.c new file mode 100644 index 00000000..46e62058 --- /dev/null +++ b/barcode-0.98/sample.c @@ -0,0 +1,98 @@ +#include +#include + +#include "barcode.h" + +int main(int argc, char **argv) +{ + int ps = 1, pcl = 0, oflags; + if (argc == 2 && !strcmp(argv[1],"-P")) { + ps = 0; pcl = 1; argc=1; + } + if (argc>2) { + fprintf(stderr, "%s: use \"%s\" for postscript or \"%s -P\" for PCL\n", + argv[0], argv[0], argv[0]); + exit(1); + } + if (pcl) { + oflags = BARCODE_OUT_PCL; + } else { + oflags = BARCODE_OUT_PS | BARCODE_OUT_NOHEADERS; + printf("%%!PS-Adobe-2.0\n"); + printf("%%%%Creator: barcode sample program\n"); + printf("%%%%EndComments\n"); + printf("%%%%EndProlog\n\n"); + printf("%%%%Page: 1 1\n\n"); + } + /* Print a few barcodes in several places in the page */ + + /* default size, bottom left */ + Barcode_Encode_and_Print("800894002700",stdout, 0, 0, 40, 40, + BARCODE_EAN | oflags); + + /* smaller */ + Barcode_Encode_and_Print("800894002700",stdout, 70, 50, 160, 55, + BARCODE_EAN | oflags); + + /* smallest */ + Barcode_Encode_and_Print("800894002700",stdout, 40, 30, 270, 70, + BARCODE_EAN | oflags); + + /* A bigger all-0 */ + Barcode_Encode_and_Print("000000000000",stdout, 170, 0, 40, 160, + BARCODE_EAN | oflags); + + /* Still bigger all-0 (but UPC, this time) */ + Barcode_Encode_and_Print("00000000000",stdout, 250, 0, 270, 160, + BARCODE_UPC | oflags); + + /* A few code-39 ones */ + Barcode_Encode_and_Print("silly code",stdout, 0, 0, 40, 320, + BARCODE_39 | oflags); + Barcode_Encode_and_Print("SAMPLE CODES",stdout, 100, 30, 400, 80, + BARCODE_39 | oflags); + + /* ISBN with add-5 */ + Barcode_Encode_and_Print("1-56592-292-1 90000",stdout, 0, 0, 40, 430, + BARCODE_ISBN | oflags); + + /* UPC with add-2 */ + Barcode_Encode_and_Print("07447084452 07",stdout, 0, 0, 300, 410, + BARCODE_UPC | oflags); + + /* code 128-C */ + Barcode_Encode_and_Print("12345678900123456789",stdout, 0, 0, 40, 530, + BARCODE_128C | oflags); + + /* and my data as code-128B autodetected */ + Barcode_Encode_and_Print("RBNLSN68T11E897W",stdout, 0, 60, 240, 510, + oflags); + /* same as code-39, forced */ + Barcode_Encode_and_Print("RBNLSN68T11E897W",stdout, 0, 60, 240, 590, + BARCODE_NO_CHECKSUM | BARCODE_39 | oflags); + + /* one interleaved 2 of 5 */ + Barcode_Encode_and_Print("0123456789",stdout, 0, 0, 40, 620, + BARCODE_I25 | oflags); + + /* upc-e and ean-8 (autotected based on code size) */ + Barcode_Encode_and_Print("012345",stdout, 0, 0, 50, 720, oflags); + Barcode_Encode_and_Print("0123456",stdout, 0, 0, 160, 720, oflags); + + + + if (pcl) { + printf("\f"); + } else { + printf("\nshowpage\n"); + printf("%%%%Trailer\n\n"); + } + return 0; +} + + + + + + + diff --git a/configure.in b/configure.in new file mode 100644 index 00000000..06bd811c --- /dev/null +++ b/configure.in @@ -0,0 +1,228 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.52) + +AC_INIT(glabels, 2.2.5, http://sourceforge.net/tracker/?func=add&group_id=46122&atid=445116) +AC_CONFIG_SRCDIR(src/glabels.c) +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) + +AM_MAINTAINER_MODE +AM_CONFIG_HEADER(config.h) + +AC_PROG_INTLTOOL([0.21]) +PKG_PROG_PKG_CONFIG + +AM_PROG_LIBTOOL + +AC_ISC_POSIX +AC_PROG_CC +AM_PROG_CC_STDC +AC_HEADER_STDC + +GNOME_COMPILE_WARNINGS + +AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) + +GTK_DOC_CHECK(1.0) + +dnl --------------------------------------------------------------------------- +dnl - LIBGLABELS API versioning +dnl --------------------------------------------------------------------------- +dnl From the libtool manual: +dnl 1. Start with version information of `0:0:0' for each libtool library. +dnl 2. Update the version information only immediately before a public release. +dnl More frequent updates are unnecessary, and only guarantee that the current +dnl interface number gets larger faster. +dnl 3. If the library source code has changed at all since the last update, then increment +dnl revision (`c:r:a' becomes `c:r+1:a'). +dnl 4. If any interfaces have been added, removed, or changed since the last update, +dnl increment current, and set revision to 0. +dnl 5. If any interfaces have been added since the last public release, then increment age. +dnl 6. If any interfaces have been removed since the last public release, then set age +dnl to 0. +LIBGLABELS_C=6 +LIBGLABELS_R=1 +LIBGLABELS_A=1 + +LIBGLABELS_VERSION_INFO=${LIBGLABELS_C}:${LIBGLABELS_R}:${LIBGLABELS_A} +AC_SUBST(LIBGLABELS_VERSION_INFO) + + +dnl --------------------------------------------------------------------------- +dnl - Library dependencies +dnl --------------------------------------------------------------------------- +GLIB_REQUIRED=2.12.0 +GTK_REQUIRED=2.10.0 +LIBGNOME_REQUIRED=2.16.0 +LIBGNOMEUI_REQUIRED=2.16.0 +LIBXML_REQUIRED=2.6.0 +LIBGLADE_REQUIRED=2.6.0 +LIBEBOOK_REQUIRED=1.8.0 + +dnl Make above strings available for packaging files (e.g. rpm spec files) +AC_SUBST(GLIB_REQUIRED) +AC_SUBST(GTK_REQUIRED) +AC_SUBST(LIBGNOME_REQUIRED) +AC_SUBST(LIBGNOMEUI_REQUIRED) +AC_SUBST(LIBXML_REQUIRED) +AC_SUBST(LIBGLADE_REQUIRED) +AC_SUBST(LIBEBOOK_REQUIRED) + + +dnl --------------------------------------------------------------------------- +dnl - Check for evolution data server +dnl --------------------------------------------------------------------------- +AC_ARG_WITH(libebook, + [AC_HELP_STRING([--without-libebook], + [build without Evolution Data Server support])]) +have_libebook=no +if test "x$with_libebook" != xno; then + PKG_CHECK_MODULES(LIBEBOOK, libebook-1.2 >= $LIBEBOOK_REQUIRED, + [have_libebook=yes], [have_libebook=no]) +fi + +if test "x$have_libebook" = "xyes"; then + AC_DEFINE(HAVE_LIBEBOOK,1,[Define to 1 for EDS support]) + OPTIONAL_MODULES="$OPTIONAL_MODULES libebook-1.2 >= $LIBEBOOK_REQUIRED" +fi + + +dnl --------------------------------------------------------------------------- +dnl - GLABELS prerequisites +dnl --------------------------------------------------------------------------- +PKG_CHECK_MODULES(GLABELS, \ +glib-2.0 >= $GLIB_REQUIRED \ +gtk+-2.0 >= $GTK_REQUIRED \ +libgnome-2.0 >= $LIBGNOME_REQUIRED \ +libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED \ +libxml-2.0 >= $LIBXML_REQUIRED \ +libglade-2.0 >= $LIBGLADE_REQUIRED \ +$OPTIONAL_MODULES \ +) + +AC_SUBST(GLABELS_CFLAGS) +AC_SUBST(GLABELS_LIBS) + + +dnl --------------------------------------------------------------------------- +dnl - LIBGLABELS more modest prerequisites +dnl --------------------------------------------------------------------------- +PKG_CHECK_MODULES(LIBGLABELS, \ +glib-2.0 >= $GLIB_REQUIRED \ +libxml-2.0 >= $LIBXML_REQUIRED \ +) + +AC_SUBST(LIBGLABELS_CFLAGS) +AC_SUBST(LIBGLABELS_LIBS) + + +dnl --------------------------------------------------------------------------- +dnl - MYGAL prerequisites +dnl --------------------------------------------------------------------------- +PKG_CHECK_MODULES(MYGAL, \ +gtk+-2.0 >= $GTK_REQUIRED \ +libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED \ +) + +AC_SUBST(MYGAL_CFLAGS) +AC_SUBST(MYGAL_LIBS) + + +dnl --------------------------------------------------------------------------- +dnl - Enable deprecation testing +dnl --------------------------------------------------------------------------- +AC_ARG_ENABLE(deprecations, + [AC_HELP_STRING([--enable-deprecations], + [warn about deprecated usages [default=no]])],, + [enable_deprecations=no]) + +if test "x$enable_deprecations" = "xyes"; then + DISABLE_DEPRECATED_CFLAGS="\ +-DG_DISABLE_DEPRECATED \ +-DGDK_DISABLE_DEPRECATED \ +-DGTK_DISABLE_DEPRECATED \ +-DGDK_PIXBUF_DISABLE_DEPRECATED \ +-DGNOME_DISABLE_DEPRECATED \ +-DLIBGLADE_DISABLE_DEPRECATED" + AC_SUBST(DISABLE_DEPRECATED_CFLAGS) +fi + + +dnl --------------------------------------------------------------------------- +dnl - Is freedesktop mime dbase available? +dnl --------------------------------------------------------------------------- +AC_PATH_PROG(UPDATE_MIME_DATABASE, update-mime-database, no) +AM_CONDITIONAL(HAVE_NEW_MIME, test x$UPDATE_MIME_DATABASE != xno) + +AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, update-desktop-database, no) +AM_CONDITIONAL(HAVE_NEWER_MIME, test x$UPDATE_DESKTOP_DATABASE != xno) + +AC_ARG_ENABLE(update-mimedb, AC_HELP_STRING([--disable-update-mimedb], + [disable the update-mime-database after install [default=no]]),, + enable_update_mimedb=yes) +AM_CONDITIONAL(ENABLE_UPDATE_MIMEDB, test x$enable_update_mimedb = xyes) + +AC_ARG_ENABLE(update-desktopdb, AC_HELP_STRING([--disable-update-desktopdb], + [disable the update-desktop-database after install [default=no]]),, + enable_update_desktopdb=yes) +AM_CONDITIONAL(ENABLE_UPDATE_DESKTOPDB, test x$enable_update_desktopdb = xyes) + + +dnl --------------------------------------------------------------------------- +dnl - Supported languages +dnl --------------------------------------------------------------------------- +GETTEXT_PACKAGE=glabels +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package]) + +dnl Add the languages here. +ALL_LINGUAS="fr de ja pt_BR es ru zh_TW.Big5 pl cs it eo ko" +AM_GLIB_GNU_GETTEXT + + +dnl --------------------------------------------------------------------------- +dnl - Makefiles, etc. +dnl --------------------------------------------------------------------------- +AC_OUTPUT([ +Makefile +barcode-0.98/Makefile +iec16022-0.2.1/Makefile +libglabels/Makefile +libglabels/libglabels.pc +src/Makefile +src/pixmaps/Makefile +src/stock-pixmaps/Makefile +src/mygal/Makefile +data/Makefile +data/templates/Makefile +data/pixmaps/Makefile +data/mime/Makefile +data/glade/Makefile +data/desktop/Makefile +data/dtd/Makefile +data/man/Makefile +po/Makefile.in +help/Makefile +help/C/Makefile +docs/Makefile +docs/libglabels/Makefile +glabels.spec +]) + + +dnl --------------------------------------------------------------------------- +dnl - Print configuration information +dnl --------------------------------------------------------------------------- +echo " +Configuration: + + Package: ${PACKAGE}-${VERSION}: + Installation prefix ${prefix} + Source code location: ${srcdir} + Compiler: ${CC} + Evolution Data Server support: ${have_libebook} + +" + +dnl cat ${srcdir}/MESSAGE-OF-DOOM + diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 00000000..6b00c464 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,5 @@ +## Process this file with automake to produce Makefile.in + +SUBDIRS = desktop dtd glade man mime pixmaps templates + + diff --git a/data/desktop/Makefile.am b/data/desktop/Makefile.am new file mode 100644 index 00000000..ce2a21fc --- /dev/null +++ b/data/desktop/Makefile.am @@ -0,0 +1,13 @@ +## Process this file with automake to produce Makefile.in + +@INTLTOOL_DESKTOP_RULE@ + +DESKTOP_IN_FILES = glabels.desktop.in +DESKTOP_FILES =$(DESKTOP_IN_FILES:.desktop.in=.desktop) + +desktopdir = $(datadir)/applications +desktop_DATA = $(DESKTOP_FILES) + +EXTRA_DIST = $(DESKTOP_IN_FILES) + +CLEANFILES = $(DESKTOP_FILES) diff --git a/data/desktop/glabels.desktop.in b/data/desktop/glabels.desktop.in new file mode 100644 index 00000000..be70f928 --- /dev/null +++ b/data/desktop/glabels.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +_Name=gLabels Label Designer +_Comment=Create labels, business cards and media covers +Exec=glabels %F +Icon=glabels.png +Terminal=false +Type=Application +Categories=GNOME;Application;Office; +StartupNotify=true +MimeType=application/x-glabels; diff --git a/data/dtd/Makefile.am b/data/dtd/Makefile.am new file mode 100644 index 00000000..0dce23d6 --- /dev/null +++ b/data/dtd/Makefile.am @@ -0,0 +1,9 @@ +## Process this file with automake to produce Makefile.in + +dtddir = $(datadir)/glabels/dtd + +dtd_DATA = \ + glabels-2.2.dtd + +EXTRA_DIST = $(dtd_DATA) + diff --git a/data/dtd/glabels-2.2.dtd b/data/dtd/glabels-2.2.dtd new file mode 100644 index 00000000..b23519fc --- /dev/null +++ b/data/dtd/glabels-2.2.dtd @@ -0,0 +1,381 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/glade/Makefile.am b/data/glade/Makefile.am new file mode 100644 index 00000000..4747c88f --- /dev/null +++ b/data/glade/Makefile.am @@ -0,0 +1,18 @@ +## Process this file with automake to produce Makefile.in + +gladedir = $(datadir)/glabels/glade/ + +glade_DATA = \ + object-editor.glade \ + prefs-dialog.glade \ + template-designer.glade \ + merge-properties-dialog.glade \ + property-bar.glade \ + print-custom-widget.glade \ + wdgt-media-select.glade \ + wdgt-rotate-label.glade \ + new-label-dialog.glade + +EXTRA_DIST = $(glade_DATA) + + diff --git a/data/glade/merge-properties-dialog.glade b/data/glade/merge-properties-dialog.glade new file mode 100644 index 00000000..b62dcedf --- /dev/null +++ b/data/glade/merge-properties-dialog.glade @@ -0,0 +1,375 @@ + + + + + + + True + dialog1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 6 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + 12 + True + 2 + 2 + False + 6 + 6 + + + + True + Format: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + False + True + + + 1 + 2 + 0 + 1 + fill + + + + + + True + False + 0 + + + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + Location: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + + + + + True + <b>Source</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 6 + + + + 6 + 500 + 350 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + 6 + True + False + 12 + + + + True + True + Select all + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + True + True + Unselect all + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + False + True + + + + + + + + + + True + <b>Record selection/preview</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + diff --git a/data/glade/new-label-dialog.glade b/data/glade/new-label-dialog.glade new file mode 100644 index 00000000..b282a365 --- /dev/null +++ b/data/glade/new-label-dialog.glade @@ -0,0 +1,158 @@ + + + + + + + True + window1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 12 + True + False + 12 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + + + + + + + + + True + <b>Media type</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + + + + + + + + + True + <b>Label orientation</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + + diff --git a/data/glade/object-editor.glade b/data/glade/object-editor.glade new file mode 100644 index 00000000..d4ba2fe4 --- /dev/null +++ b/data/glade/object-editor.glade @@ -0,0 +1,3471 @@ + + + + + + + + 6 + True + dialog1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -7 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 12 + + + + True + False + 12 + + + + True + 0.5 + 0.5 + 0 + 0 + + + 0 + False + True + + + + + + True + <span weight="bold" size="larger">Xxx object properties</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + + True + True + True + True + GTK_POS_TOP + True + False + + + + 12 + True + False + 6 + + + + True + False + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + 232 + True + True + True + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 12 + + + + True + Key: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + + + 0 + True + True + + + + + + True + True + Insert merge field + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + False + False + + + + + False + False + + + + + + True + Text + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + False + 12 + + + + True + Family: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 12 + + + + True + Size: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 1 1 100 1 10 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 12 + + + + True + Style: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + + + + True + gtk-bold + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + + + + True + gtk-italic + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 12 + + + + True + Color: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.140000000596 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + False + 6 + + + + True + True + + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + False + 12 + + + + True + gl_object_editor_construct_color_combo + 2 + 0 + Sun, 16 Nov 2003 06:52:23 GMT + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 6 + + + + True + True + Key: + True + GTK_RELIEF_NORMAL + True + False + False + True + text_color_radio + + + 0 + False + False + + + + + + True + False + 12 + + + + True + False + True + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 12 + + + + True + Alignment: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + + + + True + gtk-justify-left + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + + + + True + gtk-justify-center + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + + + + True + gtk-justify-right + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 12 + + + + True + Line Spacing: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 2 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 5 0.01 0.1 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + True + Allow merge to automatically shrink text + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + False + False + + + + + + True + Style + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + False + 12 + + + + True + Width: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 2 + True + GTK_UPDATE_ALWAYS + False + False + 1 0.25 4 0.25 1 0 + + + 0 + False + False + + + + + + True + points + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 12 + + + + True + Color: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.140000000596 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + False + 6 + + + + True + True + + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + False + 12 + + + + True + gl_object_editor_construct_color_combo + 1 + 0 + Sun, 16 Nov 2003 06:52:23 GMT + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 6 + + + + True + True + Key: + True + GTK_RELIEF_NORMAL + True + False + False + True + line_color_radio + + + 0 + False + False + + + + + + True + False + 12 + + + + True + False + True + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + False + False + + + + + False + True + + + + + + True + Line + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 0 + + + + True + False + 12 + + + + True + Color: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.140000000596 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + False + 6 + + + + True + True + + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + False + 12 + + + + True + gl_object_editor_construct_color_combo + 0 + 0 + Sun, 16 Nov 2003 06:52:23 GMT + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 6 + + + + True + True + Key: + True + GTK_RELIEF_NORMAL + True + False + False + True + fill_color_radio + + + 0 + False + False + + + + + + True + False + 12 + + + + True + False + True + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + False + False + + + + + False + True + + + + + + True + Fill + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + False + 12 + + + + True + True + File: + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + Select A File + GTK_FILE_CHOOSER_ACTION_OPEN + True + True + False + -1 + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 12 + + + + True + False + True + Key: + True + GTK_RELIEF_NORMAL + True + False + False + True + img_file_radio + + + 0 + False + False + + + + + + True + False + True + + + 0 + True + True + + + + + 0 + False + False + + + + + False + True + + + + + + True + Image + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + False + 12 + + + + True + True + Literal: + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + * + False + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + Key: + True + GTK_RELIEF_NORMAL + True + False + False + True + data_literal_radio + + + 0 + False + False + + + + + + True + False + True + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 12 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 2 + 2 + False + 6 + 6 + + + + True + format: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + 00000000000 00000 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + digits: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + False + 0 + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 1 1 100 1 10 0 + + + 0 + False + False + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + 0 + True + True + + + + + 0 + False + False + + + + + False + True + + + + + + True + Data + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + False + 12 + + + + True + Style: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + True + Text + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Checksum + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + False + 12 + + + + True + Color: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.140000000596 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + False + 6 + + + + True + True + + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + False + 12 + + + + True + gl_object_editor_construct_color_combo + 1 + 0 + Sun, 16 Nov 2003 06:52:23 GMT + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 6 + + + + True + True + Key: + True + GTK_RELIEF_NORMAL + True + False + False + True + bc_color_radio + + + 0 + False + False + + + + + + True + False + 12 + + + + True + False + True + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + False + False + + + + + True + True + + + + + + True + Style + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + 3 + 3 + False + 12 + 12 + + + + True + Width: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Height: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 2 + True + GTK_UPDATE_ALWAYS + True + False + 1 0 100 0.01 10 0 + + + 0 + False + True + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + False + 12 + + + + True + True + Reset image size + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + 2 + 2 + 3 + fill + + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 2 + True + GTK_UPDATE_ALWAYS + True + False + 1 0 100 0.01 10 0 + + + 0 + False + True + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 1 + 2 + 0 + 1 + fill + fill + + + + + + True + gl_object_editor_construct_chain_button + 0 + 0 + Sat, 07 Feb 2004 02:56:47 GMT + + + 2 + 3 + 0 + 2 + + fill + + + + + 0 + True + True + + + + + False + True + + + + + + True + Size + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + 2 + 2 + False + 12 + 12 + + + + True + Length: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Angle: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 2 + True + GTK_UPDATE_ALWAYS + True + False + 1 0 100 0.01 10 0 + + + 0 + False + True + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 1 + 2 + 0 + 1 + fill + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 1 + True + GTK_UPDATE_ALWAYS + True + False + 0 -180 180 0.1 5 0 + + + 0 + False + True + + + + + + True + degrees + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + 0 + True + True + + + + + False + True + + + + + + True + Size + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + 2 + 3 + False + 12 + 12 + + + + 50 + True + X: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Y: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + True + 0.00999999977648 + 2 + True + GTK_UPDATE_ALWAYS + True + False + 0 0 100 0.01 10 0 + + + 1 + 2 + 0 + 1 + + + + + + + + True + True + 0.00999999977648 + 2 + True + GTK_UPDATE_ALWAYS + True + False + 0 0 100 0.01 10 0 + + + 1 + 2 + 1 + 2 + + + + + + + 0 + True + True + + + + + False + True + + + + + + True + Position + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + True + Enable shadow + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + False + 12 + + + + True + False + 12 + + + + True + X Offset: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 2 + True + GTK_UPDATE_ALWAYS + True + False + 0 0 100 0.00999999977648 10 0 + + + 0 + False + True + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 12 + + + + True + Y Offset: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 2 + True + GTK_UPDATE_ALWAYS + True + False + 0 0 100 0.00999999977648 10 0 + + + 0 + False + True + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 12 + + + + True + Color: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.140000000596 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + False + 6 + + + + True + True + + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + False + 12 + + + + True + gl_object_editor_construct_color_combo + 3 + 0 + Sun, 16 Nov 2003 06:52:23 GMT + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 6 + + + + True + True + Key: + True + GTK_RELIEF_NORMAL + True + False + False + True + shadow_color_radio + + + 0 + False + False + + + + + + True + False + 12 + + + + True + False + True + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 12 + + + + True + Opacity: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 0 + + + 0 + False + True + + + + + + True + % + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + False + False + + + + + False + True + + + + + + True + Shadow + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + + + + False + True + + + + + + True + label48 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + diff --git a/data/glade/prefs-dialog.glade b/data/glade/prefs-dialog.glade new file mode 100644 index 00000000..b169a381 --- /dev/null +++ b/data/glade/prefs-dialog.glade @@ -0,0 +1,1309 @@ + + + + + + + True + gLabels Preferences + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -7 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + 12 + True + False + 12 + + + + True + Select locale specific behavior. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 6 + True + False + 6 + + + + True + True + Points + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Inches + True + GTK_RELIEF_NORMAL + True + False + False + True + units_points_radio + + + 0 + False + False + + + + + + True + True + Millimeters + True + GTK_RELIEF_NORMAL + True + False + False + True + units_points_radio + + + 0 + False + False + + + + + 0 + True + True + + + + + + + + True + <span weight="bold">Units</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 6 + True + False + 6 + + + + True + True + US Letter + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + ISO A4 + True + GTK_RELIEF_NORMAL + True + False + False + True + page_size_us_letter_radio + + + 0 + False + False + + + + + 0 + True + True + + + + + + + + True + <span weight="bold">Default page size</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + False + True + + + + + + True + Locale + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 12 + True + False + 12 + + + + True + Select default properties for new objects. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 4 + 2 + False + 12 + 12 + + + + True + Font: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Color: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Alignment: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + 90 + True + Line Spacing: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + False + 12 + + + + True + False + True + + + 0 + True + True + + + + + + True + True + 1 + 0 + True + GTK_UPDATE_ALWAYS + False + False + 1 1 100 1 10 0 + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + + + + True + gtk-bold + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + + + + True + gtk-italic + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 1 + 2 + 0 + 1 + fill + + + + + + True + False + 12 + + + + True + gl_object_editor_construct_color_combo + 2 + 0 + Sun, 23 Nov 2003 15:42:02 GMT + + + 0 + False + False + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + False + 12 + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + + + + True + gtk-justify-left + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + + + + True + gtk-justify-center + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + + + + True + gtk-justify-right + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 1 + 2 + 2 + 3 + fill + fill + + + + + + True + False + 40 + + + + True + True + 0.00999999977648 + 2 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 5 0.01 0.1 0 + + + 0 + False + False + + + + + 1 + 2 + 3 + 4 + fill + fill + + + + + 0 + True + True + + + + + + + + True + <span weight="bold">Text</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 2 + 2 + False + 12 + 12 + + + + 90 + True + Width: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Color: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 2 + True + GTK_UPDATE_ALWAYS + False + False + 1 0.25 4 0.25 1 0 + + + 0 + False + False + + + + + + True + points + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 1 + 2 + 0 + 1 + fill + + + + + + True + False + 12 + + + + True + gl_object_editor_construct_color_combo + 1 + 0 + Sun, 23 Nov 2003 15:42:41 GMT + + + 0 + False + False + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + 0 + True + True + + + + + + + + True + <span weight="bold">Line</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 1 + 2 + False + 12 + 12 + + + + 90 + True + Color: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + False + 12 + + + + True + gl_object_editor_construct_color_combo + 0 + 0 + Sun, 23 Nov 2003 15:43:12 GMT + + + 0 + False + False + + + + + 1 + 2 + 0 + 1 + fill + + + + + 0 + True + True + + + + + + + + True + <span weight="bold">Fill</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + False + True + + + + + + True + Object defaults + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + + + diff --git a/data/glade/print-custom-widget.glade b/data/glade/print-custom-widget.glade new file mode 100644 index 00000000..f5063abc --- /dev/null +++ b/data/glade/print-custom-widget.glade @@ -0,0 +1,287 @@ + + + + + + + True + window1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 12 + True + False + 12 + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + + + + + + + + + True + <b>Print control (Simple)</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + + + + + + + + + True + <b>Print control (Merge)</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + print outlines (to test printer alignment) + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + print in reverse (i.e. a mirror image) + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + print crop marks + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + + + + + True + <b>Options</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + + diff --git a/data/glade/property-bar.glade b/data/glade/property-bar.glade new file mode 100644 index 00000000..f86d7730 --- /dev/null +++ b/data/glade/property-bar.glade @@ -0,0 +1,375 @@ + + + + + + + True + window1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + + + + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_ICONS + True + False + + + + True + True + True + False + + + + True + Font family + True + False + + + + True + False + False + + + + + + + False + False + + + + + + True + True + True + False + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 6 + 0 + + + + True + Font size + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 1 250 1 10 0 + + + + + + + False + False + + + + + + True + True + True + True + + + False + False + + + + + + True + Bold + + True + gtk-bold + True + True + False + False + + + False + True + + + + + + True + Italic + + True + gtk-italic + True + True + False + False + + + False + True + + + + + + True + True + True + True + + + False + False + + + + + + True + Left align + + True + gtk-justify-left + True + True + False + False + + + False + True + + + + + + True + Center align + + True + gtk-justify-center + True + True + False + False + text_align_left_radio + + + False + True + + + + + + True + Right align + + True + gtk-justify-right + True + True + False + False + text_align_left_radio + + + False + True + + + + + + True + True + True + True + + + False + False + + + + + + True + True + True + False + + + + True + Text Color + True + False + + + + True + Text color + gl_ui_property_bar_construct_color_combo + 0 + 0 + Sun, 01 May 2005 15:21:11 GMT + + + + + + + False + False + + + + + + True + True + True + False + + + + True + Fill color + True + False + + + + True + Fill color + gl_ui_property_bar_construct_color_combo + 1 + 0 + Sun, 01 May 2005 15:21:18 GMT + + + + + + + False + False + + + + + + True + True + True + False + + + + True + Line color + True + False + + + + True + Line color + gl_ui_property_bar_construct_color_combo + 2 + 0 + Sun, 01 May 2005 15:21:24 GMT + + + + + + + False + False + + + + + + True + True + True + True + + + False + False + + + + + + True + True + True + False + + + + True + Line width + True + 1 + 2 + False + GTK_UPDATE_ALWAYS + False + False + 1 0.25 4 0.25 1 0 + + + + + False + False + + + + + + + diff --git a/data/glade/template-designer.glade b/data/glade/template-designer.glade new file mode 100644 index 00000000..22a0be78 --- /dev/null +++ b/data/glade/template-designer.glade @@ -0,0 +1,3445 @@ + + + + + + + + True + window1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 6 + True + True + True + True + GTK_POS_TOP + False + False + + + + True + Welcome to the gLabels Template Designer. + +This dialog will assist you in the creation of a custom gLabels template. + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + False + True + + + + + + True + start_page + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 18 + True + False + 24 + + + + True + Please enter the following identifying information about the template stationery. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 6 + 2 + False + 12 + 12 + + + + True + Brand/Manufacturer: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Part #: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + False + 12 + + + + True + True + True + True + 0 + + True + * + False + + + 0 + False + False + + + + + + True + (e.g., 8163A) + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + False + 12 + + + + True + True + True + True + 0 + + True + * + False + + + 0 + False + False + + + + + + True + (e.g., Avery, Acme, ...) + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 1 + 2 + 0 + 1 + fill + fill + + + + + + True + Description: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 4 + 5 + + + + + + + True + (e.g., "Mailing Labels," "Business Cards," ...) + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 5 + 6 + fill + + + + + + + True + False + 6 + + + + True + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + 1 + 2 + 2 + 3 + fill + + + + + + 0 + True + True + + + + + False + True + + + + + + True + name_page + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 18 + True + False + 24 + + + + True + Please select the page size of the template stationery. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 3 + 2 + False + 12 + 12 + + + + True + Page size: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Width: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Height: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + False + 0 + + + + True + False + True + + + 0 + False + False + + + + + + + + + 1 + 2 + 0 + 1 + fill + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 0 + + + 0 + False + False + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + False + 12 + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 0 + + + 0 + False + False + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 1 + 2 + 2 + 3 + fill + fill + + + + + 0 + False + False + + + + + False + True + + + + + + True + pg_size_page + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 18 + True + False + 24 + + + + True + Please select the basic shape of the labels or cards. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + True + Rectangular or square (can have rounded corners) + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + Round + True + GTK_RELIEF_NORMAL + True + False + False + True + shape_rect_radio + + + 0 + False + False + + + + + + True + True + CD/DVD (including credit card CDs) + True + GTK_RELIEF_NORMAL + True + False + False + True + shape_rect_radio + + + 0 + False + False + + + + + 0 + True + True + + + + + False + True + + + + + + True + shape_page + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 18 + True + False + 24 + + + + True + Please enter the following size parameters of a single label or card in your template. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + 6 + 3 + False + 12 + 12 + + + + True + 1. Width: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + 2. Height: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + 3. Round (radius of corner): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + 4. Horiz. waste (overprint allowed): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 2 + 3 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 3 + 4 + fill + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 0 + 1 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 2 + 3 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 3 + 4 + + + + + + + True + 6. Margin + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 5 + 6 + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 5 + 6 + fill + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 4 + 5 + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 4 + 5 + fill + + + + + + + True + 5. Vert. waste (overprint allowed): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + 0 + False + False + + + + + + True + 1 + 0 + 0 + 0 + + + 0 + True + True + + + + + 0 + False + False + + + + + False + True + + + + + + True + rect_size_page + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 18 + True + False + 24 + + + + True + Please enter the following size parameters of a single label in your template. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + 3 + 3 + False + 12 + 12 + + + + True + 1. Radius: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + 2. Waste (overprint allowed): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 0 + 1 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + 3. Margin + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 2 + 3 + fill + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 2 + 3 + + + + + + 0 + False + False + + + + + + True + 1 + 0 + 0 + 0 + + + 0 + True + True + + + + + 0 + False + False + + + + + False + True + + + + + + True + round_size_page + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 18 + True + False + 24 + + + + True + Please enter the following size parameters of a single label in your template. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + 6 + 3 + False + 12 + 12 + + + + True + 1. Outer radius: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + 2. Inner radius: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + 3. Clipping width: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + 4. Clipping height: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + 5. Waste (overprint allowed): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 0 + 1 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 2 + 3 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 3 + 4 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 4 + 5 + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 2 + 3 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 3 + 4 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 4 + 5 + fill + + + + + + + True + 6. Margin + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 5 + 6 + fill + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 5 + 6 + + + + + + 0 + False + False + + + + + + True + 1 + 0 + 0 + 0 + + + 0 + True + True + + + + + 0 + False + False + + + + + False + True + + + + + + True + cd_size_page + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 18 + True + False + 24 + + + + True + How many layouts will your template contain? + +A layout is a set of labels or cards that can be arranged in a simple grid. +Most templates only need one layout, as in the first example. +The second example illustrates when two layouts are needed. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + False + 0 + + + + True + 0.5 + 0.5 + 0 + 0 + + + 0 + True + True + + + + + + True + Templates needing only +one layout. + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + 0.5 + 0.5 + 0 + 0 + + + 0 + True + True + + + + + + True + Templates needing +two layouts. + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 12 + + + + True + Number of layouts: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 0.10000000149 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 1 2 1 1 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + False + True + + + + + + True + nlayouts_page + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + 18 + True + False + 12 + + + + True + Please enter the following layout information. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 18 + + + + True + 7 + 4 + False + 6 + 12 + + + + True + Layout #1 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + Layout #2 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + Number across (nx): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Number down (ny): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + Distance from left edge (x0): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + Distance from top edge (y0): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + Horizontal pitch (dx): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + + True + Vertical pitch (dy): + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 6 + 7 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 3 + 4 + 3 + 4 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 3 + 4 + 4 + 5 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 3 + 4 + 5 + 6 + fill + + + + + + + True + inches + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 3 + 4 + 6 + 7 + fill + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 1 100 1 10 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 1 100 1 10 0 + + + 1 + 2 + 2 + 3 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 1 100 1 10 0 + + + 2 + 3 + 1 + 2 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 1 100 1 10 0 + + + 2 + 3 + 2 + 3 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 3 + 4 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 2 + 3 + 3 + 4 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 4 + 5 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 2 + 3 + 4 + 5 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 5 + 6 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 2 + 3 + 5 + 6 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 1 + 2 + 6 + 7 + + + + + + + True + True + 0.00999999977648 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 0 + + + 2 + 3 + 6 + 7 + + + + + + 0 + False + False + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + False + 6 + + + + True + gl_template_designer_construct_mini_preview + 175 + 200 + Mon, 29 Dec 2003 21:27:10 GMT + + + 0 + True + True + + + + + + 6 + True + True + Print test sheet + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + False + False + + + + + False + True + + + + + + True + layout_page + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + Congratulations! + +You have completed the gLabels Template Designer. +If you wish to accept and save your design, click "Apply." + +Otherwise, you may click "Cancel" to abandon your design +or "Back" to continue editing this design. + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + False + True + + + + + + True + finish_page + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + + diff --git a/data/glade/wdgt-media-select.glade b/data/glade/wdgt-media-select.glade new file mode 100644 index 00000000..b4dc6c7c --- /dev/null +++ b/data/glade/wdgt-media-select.glade @@ -0,0 +1,352 @@ + + + + + + + True + window1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + 12 + True + True + True + True + GTK_POS_TOP + False + False + + + + True + False + 0 + + + + 12 + 480 + 320 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + False + False + False + + + + + 0 + True + True + + + + + False + True + + + + + + True + Recent templates + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + 12 + True + False + 12 + + + + True + False + 6 + + + + True + Brand: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + + + 0 + False + True + + + + + 0 + False + False + + + + + + True + False + 6 + + + + True + Page size: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + + + 0 + False + True + + + + + 0 + False + True + + + + + + True + False + 6 + + + + True + Category: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + True + + + 0 + False + True + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + 12 + 480 + 320 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + False + False + False + + + + + 0 + True + True + + + + + False + True + + + + + + True + Search all templates + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + + + diff --git a/data/glade/wdgt-rotate-label.glade b/data/glade/wdgt-rotate-label.glade new file mode 100644 index 00000000..89e24a03 --- /dev/null +++ b/data/glade/wdgt-rotate-label.glade @@ -0,0 +1,62 @@ + + + + + + + True + window1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + 12 + True + False + 6 + + + + True + True + Rotate + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + + + 0 + True + True + + + + + + + diff --git a/data/man/Makefile.am b/data/man/Makefile.am new file mode 100644 index 00000000..34051904 --- /dev/null +++ b/data/man/Makefile.am @@ -0,0 +1,6 @@ +## Process this file with automake to produce Makefile.in + +man_MANS = glabels.1 + +EXTRA_DIST = $(man_MANS) + diff --git a/data/man/glabels.1 b/data/man/glabels.1 new file mode 100644 index 00000000..489b2a42 --- /dev/null +++ b/data/man/glabels.1 @@ -0,0 +1,67 @@ +.TH glabels 1 "Jun 28, 2004" +.SH NAME +glabels \- Label and business card creation program for GNOME +.SH SYNOPSIS +.B glabels +.RI [OPTIONS] +.RI [label-filename...] +.sp +.B glabels-batch +.RI [OPTIONS] +.RI [label-filename...] +.SH DESCRIPTION +.B glabels +is a lightweight program for creating labels and business cards for +the GNOME desktop environment. It is designed to work with various +laser/ink-jet peel-off label and business card sheets that you'll find at most +office supply stores. +.B glabels +is pre-configured with templates for many of these products. +It also provides an interactive template designer for creating new +templates according to user specifications. +.PP +For full documentation see the \fBgLabels\fR online help. + +.PP +.B glabels-batch +is a command line utility to print labels previously prepared with +.B glabels. +.SH OPTIONS +.TP +\fB\-?\fR, \fB\-\-help\fR +Display a summary of available command-line options. +.TP +\fB\-\-usage\fR +Display a short usage summary. +.TP +\fB\-v\fR, \fB\-\-version\fR +Print program version information. +.PP +.B Options specific to glabels-batch +.TP +\fB\-o\fR \fIfilename\fR, \fB\-\-output\fR=\fIfilename\fR +Set output filename to \fIfilename\fR. (default="output.ps") +.TP +\fB\-s\fR \fIn\fR, \fB\-\-sheets\fR=\fIn\fR +Set number of sheets to \fIn\fR. (default=1) +.TP +\fB\-c\fR \fIn\fR, \fB\-\-copies\fR=\fIn\fR +Set number of copies to \fIn\fR. (default=1) +.TP +\fB\-f\fR \fIn\fR, \fB\-\-first\fR=\fIn\fR +Set label on first sheet to start printing from to \fIn\fR. (default=1) +.TP +\fB\-l\fR, \fB\-\-outline\fR +Print outlines around labels. This is useful for testing printer alignment +or printing proof sheets. +.TP +\fB\-r\fR, \fB\-\-reverse\fR +Print mirror image of labels. This is useful for clear labels intended to be +seen from the back through glass. + +.SH FILES +The $HOME/.glabels directory contains all user-defined templates. +.SH SEE ALSO +The gLabels homepage at . +.SH AUTHOR +Jim Evins diff --git a/data/mime/Makefile.am b/data/mime/Makefile.am new file mode 100644 index 00000000..027c1022 --- /dev/null +++ b/data/mime/Makefile.am @@ -0,0 +1,53 @@ +## Process this file with automake to produce Makefile.in + +keys_in_files=glabels.keys.in +keys_files = $(keys_in_files:.keys.in=.keys) +@INTLTOOL_KEYS_RULE@ + +xml_in_files=glabels.xml.in +xml_files = $(xml_in_files:.xml.in=.xml) +@INTLTOOL_XML_RULE@ + +mimedir = $(datadir)/mime-info +mime_DATA = $(keys_files) glabels.mime + +appdir = $(datadir)/application-registry +app_DATA = glabels.applications + +newmimedir = $(datadir)/mime/packages +newmime_DATA = $(xml_files) + +EXTRA_DIST = \ + $(keys_in_files) \ + $(mime_DATA) \ + $(app_DATA) \ + $(xml_in_files) \ + $(newmime_DATA) + +CLEANFILES = $(keys_files) $(xml_files) + + +install-data-hook: +if ENABLE_UPDATE_MIMEDB +if HAVE_NEW_MIME + $(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime" +endif +endif +if ENABLE_UPDATE_DESKTOPDB +if HAVE_NEWER_MIME + $(UPDATE_DESKTOP_DATABASE) +endif +endif + +uninstall-hook: +if ENABLE_UPDATE_MIMEDB +if HAVE_NEW_MIME + $(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime" +endif +endif +if ENABLE_UPDATE_DESKTOPDB +if HAVE_NEWER_MIME + $(UPDATE_DESKTOP_DATABASE) +endif +endif + diff --git a/data/mime/glabels.applications b/data/mime/glabels.applications new file mode 100644 index 00000000..1391018e --- /dev/null +++ b/data/mime/glabels.applications @@ -0,0 +1,9 @@ +glabels + command=glabels + name=gLabels + can_open_multiple_files=true + expects_uris=false + requires_terminal=false + mime_types=application/x-glabels + uses_gnomevfs=false + diff --git a/data/mime/glabels.keys.in b/data/mime/glabels.keys.in new file mode 100644 index 00000000..596c96c7 --- /dev/null +++ b/data/mime/glabels.keys.in @@ -0,0 +1,9 @@ +application/x-glabels: + open=glabels %f + _description=gLabels Project File + icon_filename=glabels-application-x-glabels.png + default_action_type=application + category=Documents + short_list_application_ids_for_novice_user_level=glabels + short_list_application_ids_for_intermediate_user_level=glabels + short_list_application_ids_for_advanced_user_level=glabels diff --git a/data/mime/glabels.mime b/data/mime/glabels.mime new file mode 100644 index 00000000..ab2f8cd3 --- /dev/null +++ b/data/mime/glabels.mime @@ -0,0 +1,2 @@ +application/x-glabels + ext: glabels diff --git a/data/mime/glabels.xml.in b/data/mime/glabels.xml.in new file mode 100644 index 00000000..70f0e2f3 --- /dev/null +++ b/data/mime/glabels.xml.in @@ -0,0 +1,8 @@ + + + + <_comment>gLabels Project File + + + + diff --git a/data/pixmaps/Makefile.am b/data/pixmaps/Makefile.am new file mode 100644 index 00000000..4cebb802 --- /dev/null +++ b/data/pixmaps/Makefile.am @@ -0,0 +1,26 @@ +## Process this file with automake to produce Makefile.in + +glabels_pixmapsdir = $(datadir)/pixmaps/glabels + +glabels_pixmaps_DATA = \ + glabels-splash.png \ + glabels-about-logo.png \ + ex-rect-size.png \ + ex-round-size.png \ + ex-cd-size.png \ + ex-1layout.png \ + ex-2layouts.png + +glabels_app_icondir = $(datadir)/pixmaps + +glabels_app_icon_DATA = \ + glabels.png + +glabels_mime_icondir = $(datadir)/pixmaps + +glabels_mime_icon_DATA = \ + glabels-application-x-glabels.png + +EXTRA_DIST = $(glabels_pixmaps_DATA) \ + $(glabels_app_icon_DATA) \ + $(glabels_mime_icon_DATA) diff --git a/data/pixmaps/ex-1layout.png b/data/pixmaps/ex-1layout.png new file mode 100644 index 00000000..3045c5f2 Binary files /dev/null and b/data/pixmaps/ex-1layout.png differ diff --git a/data/pixmaps/ex-2layouts.png b/data/pixmaps/ex-2layouts.png new file mode 100644 index 00000000..1bb5931a Binary files /dev/null and b/data/pixmaps/ex-2layouts.png differ diff --git a/data/pixmaps/ex-cd-size.png b/data/pixmaps/ex-cd-size.png new file mode 100644 index 00000000..68261f03 Binary files /dev/null and b/data/pixmaps/ex-cd-size.png differ diff --git a/data/pixmaps/ex-rect-size.png b/data/pixmaps/ex-rect-size.png new file mode 100644 index 00000000..2710472f Binary files /dev/null and b/data/pixmaps/ex-rect-size.png differ diff --git a/data/pixmaps/ex-round-size.png b/data/pixmaps/ex-round-size.png new file mode 100644 index 00000000..c45d6c3b Binary files /dev/null and b/data/pixmaps/ex-round-size.png differ diff --git a/data/pixmaps/glabels-about-logo.png b/data/pixmaps/glabels-about-logo.png new file mode 100644 index 00000000..9997c67e Binary files /dev/null and b/data/pixmaps/glabels-about-logo.png differ diff --git a/data/pixmaps/glabels-application-x-glabels.png b/data/pixmaps/glabels-application-x-glabels.png new file mode 100644 index 00000000..59c749f3 Binary files /dev/null and b/data/pixmaps/glabels-application-x-glabels.png differ diff --git a/data/pixmaps/glabels-splash.png b/data/pixmaps/glabels-splash.png new file mode 100644 index 00000000..713cb8a2 Binary files /dev/null and b/data/pixmaps/glabels-splash.png differ diff --git a/data/pixmaps/glabels.png b/data/pixmaps/glabels.png new file mode 100644 index 00000000..afb7ecfb Binary files /dev/null and b/data/pixmaps/glabels.png differ diff --git a/data/templates/Makefile.am b/data/templates/Makefile.am new file mode 100644 index 00000000..236c93f5 --- /dev/null +++ b/data/templates/Makefile.am @@ -0,0 +1,19 @@ +## Process this file with automake to produce Makefile.in + +templatesdir = $(datadir)/glabels/templates + +templates_DATA = \ + paper-sizes.xml \ + categories.xml \ + avery-us-templates.xml \ + avery-iso-templates.xml \ + avery-other-templates.xml \ + zweckform-iso-templates.xml \ + brother-other-templates.xml \ + dymo-other-templates.xml \ + misc-us-templates.xml \ + misc-iso-templates.xml \ + misc-other-templates.xml + +EXTRA_DIST = $(templates_DATA) + diff --git a/data/templates/avery-iso-templates.xml b/data/templates/avery-iso-templates.xml new file mode 100644 index 00000000..b0ca5765 --- /dev/null +++ b/data/templates/avery-iso-templates.xml @@ -0,0 +1,301 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/templates/avery-other-templates.xml b/data/templates/avery-other-templates.xml new file mode 100644 index 00000000..796657cf --- /dev/null +++ b/data/templates/avery-other-templates.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/data/templates/avery-us-templates.xml b/data/templates/avery-us-templates.xml new file mode 100644 index 00000000..2c2bab62 --- /dev/null +++ b/data/templates/avery-us-templates.xml @@ -0,0 +1,807 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/templates/brother-other-templates.xml b/data/templates/brother-other-templates.xml new file mode 100644 index 00000000..6fb666bc --- /dev/null +++ b/data/templates/brother-other-templates.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + diff --git a/data/templates/categories.xml b/data/templates/categories.xml new file mode 100644 index 00000000..cae2d4c3 --- /dev/null +++ b/data/templates/categories.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/data/templates/dymo-other-templates.xml b/data/templates/dymo-other-templates.xml new file mode 100644 index 00000000..b1518ce1 --- /dev/null +++ b/data/templates/dymo-other-templates.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/templates/misc-iso-templates.xml b/data/templates/misc-iso-templates.xml new file mode 100644 index 00000000..1db04adc --- /dev/null +++ b/data/templates/misc-iso-templates.xml @@ -0,0 +1,641 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/templates/misc-other-templates.xml b/data/templates/misc-other-templates.xml new file mode 100644 index 00000000..4f57e745 --- /dev/null +++ b/data/templates/misc-other-templates.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/data/templates/misc-us-templates.xml b/data/templates/misc-us-templates.xml new file mode 100644 index 00000000..73bdb62f --- /dev/null +++ b/data/templates/misc-us-templates.xml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/templates/paper-sizes.xml b/data/templates/paper-sizes.xml new file mode 100644 index 00000000..17149aeb --- /dev/null +++ b/data/templates/paper-sizes.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/templates/zweckform-iso-templates.xml b/data/templates/zweckform-iso-templates.xml new file mode 100644 index 00000000..e3aecea4 --- /dev/null +++ b/data/templates/zweckform-iso-templates.xml @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 00000000..0cb49459 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,3 @@ +## Process this file with automake to produce Makefile.in. + +SUBDIRS = libglabels diff --git a/docs/libglabels/Makefile.am b/docs/libglabels/Makefile.am new file mode 100644 index 00000000..28e56fdb --- /dev/null +++ b/docs/libglabels/Makefile.am @@ -0,0 +1,69 @@ +## Process this file with automake to produce Makefile.in + +# We require automake 1.6 at least. +AUTOMAKE_OPTIONS = 1.6 + +# This is a blank Makefile.am for using gtk-doc. +# Copy this to your project's API docs directory and modify the variables to +# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples +# of using the various options. + +# The name of the module, e.g. 'glib'. +DOC_MODULE=libglabels + +# The top-level SGML file. You can change this if you want to. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml + +# The directory containing the source code. Relative to $(srcdir). +# gtk-doc will search all .c & .h files beneath here for inline comments +# documenting the functions and macros. +# e.g. DOC_SOURCE_DIR=../../../gtk +DOC_SOURCE_DIR=../../libglabels + +# Extra options to pass to gtkdoc-scangobj. Not normally needed. +SCANGOBJ_OPTIONS= + +# Extra options to supply to gtkdoc-scan. +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +SCAN_OPTIONS= + +# Extra options to supply to gtkdoc-mkdb. +# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml +MKDB_OPTIONS=--sgml-mode --output-format=xml + +# Extra options to supply to gtkdoc-fixref. Not normally needed. +# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html +FIXXREF_OPTIONS= + +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB= +CFILE_GLOB= + +# Header files to ignore when scanning. +# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h +IGNORE_HFILES=libglabels-private.h + +# Images to copy into HTML directory. +# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png +HTML_IMAGES= + +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml +content_files= + +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) +# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) +INCLUDES= +GTKDOC_LIBS= + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +include $(top_srcdir)/gtk-doc.make + +# Other files to distribute +# e.g. EXTRA_DIST += version.xml.in +EXTRA_DIST += diff --git a/docs/libglabels/libglabels-decl-list.txt b/docs/libglabels/libglabels-decl-list.txt new file mode 100644 index 00000000..d3e6343c --- /dev/null +++ b/docs/libglabels/libglabels-decl-list.txt @@ -0,0 +1,166 @@ +
    +xml-paper +lgl_xml_paper_read_papers_from_file +lgl_xml_paper_parse_papers_doc +lgl_xml_paper_parse_paper_node +
    + +
    +enums +lglUnitsType +
    + +
    +xml-category +lgl_xml_category_read_categories_from_file +lgl_xml_category_parse_categories_doc +lgl_xml_category_parse_category_node +
    + +
    +libglabels +
    + +
    +db +lglDbRegStatus +lgl_db_init +lgl_db_get_paper_id_list +lgl_db_free_paper_id_list +lgl_db_get_paper_name_list +lgl_db_free_paper_name_list +lgl_db_lookup_paper_from_name +lgl_db_lookup_paper_from_id +lgl_db_lookup_paper_id_from_name +lgl_db_lookup_paper_name_from_id +lgl_db_is_paper_id_known +lgl_db_is_paper_id_other +lgl_db_get_category_id_list +lgl_db_free_category_id_list +lgl_db_get_category_name_list +lgl_db_free_category_name_list +lgl_db_lookup_category_from_name +lgl_db_lookup_category_from_id +lgl_db_lookup_category_id_from_name +lgl_db_lookup_category_name_from_id +lgl_db_is_category_id_known +lgl_db_get_brand_list +lgl_db_free_brand_list +lgl_db_register_template +lgl_db_does_template_exist +lgl_db_does_template_name_exist +lgl_db_get_template_name_list_unique +lgl_db_get_template_name_list_all +lgl_db_free_template_name_list +lgl_db_lookup_template_from_name +lgl_db_print_known_papers +lgl_db_print_known_categories +lgl_db_print_known_templates +lgl_db_print_aliases +
    + +
    +str +lgl_str_utf8_casecmp +
    + +
    +template +lglTemplate +lglTemplateAlias +lglTemplateFrameAll +lglTemplateFrameRect +lglTemplateFrameRound +lglTemplateFrameCD +lglTemplateLayout +lglTemplateMarkupMargin +lglTemplateMarkupLine +lglTemplateMarkupCircle +lglTemplateMarkupRect +lglTemplateOrigin +lglTemplateFrameShape +lglTemplateFrame +lglTemplateMarkupType +lglTemplateMarkup +lgl_template_get_name +lgl_template_do_templates_match +lgl_template_does_brand_match +lgl_template_does_page_size_match +lgl_template_does_category_match +lgl_template_frame_get_size +lgl_template_frame_get_n_labels +lgl_template_frame_get_origins +lgl_template_new +lgl_template_add_alias +lgl_template_add_category +lgl_template_add_frame +lgl_template_frame_rect_new +lgl_template_alias_new +lgl_template_frame_round_new +lgl_template_frame_cd_new +lgl_template_frame_add_layout +lgl_template_frame_add_markup +lgl_template_layout_new +lgl_template_markup_margin_new +lgl_template_markup_line_new +lgl_template_markup_circle_new +lgl_template_markup_rect_new +lgl_template_dup +lgl_template_free +lgl_template_alias_dup +lgl_template_alias_free +lgl_template_frame_dup +lgl_template_frame_free +lgl_template_layout_dup +lgl_template_layout_free +lgl_template_markup_dup +lgl_template_markup_free +
    + +
    +category +lglCategory +lgl_category_new +lgl_category_dup +lgl_category_free +
    + +
    +xml +LGL_XML_NAME_SPACE +lgl_xml_get_prop_string +lgl_xml_get_prop_i18n_string +lgl_xml_get_prop_double +lgl_xml_get_prop_boolean +lgl_xml_get_prop_int +lgl_xml_get_prop_uint +lgl_xml_get_prop_length +lgl_xml_set_prop_string +lgl_xml_set_prop_double +lgl_xml_set_prop_boolean +lgl_xml_set_prop_int +lgl_xml_set_prop_uint_hex +lgl_xml_set_prop_length +lgl_xml_is_node +lgl_xml_get_node_content +lgl_xml_set_default_units +
    + +
    +xml-template +lgl_xml_template_read_templates_from_file +lgl_xml_template_parse_templates_doc +lgl_xml_template_parse_template_node +lgl_xml_template_write_templates_to_file +lgl_xml_template_write_template_to_file +lgl_xml_template_create_template_node +
    + +
    +paper +lglPaper +lgl_paper_new +lgl_paper_dup +lgl_paper_free +
    + diff --git a/docs/libglabels/libglabels-docs.sgml b/docs/libglabels/libglabels-docs.sgml new file mode 100644 index 00000000..a4b5b381 --- /dev/null +++ b/docs/libglabels/libglabels-docs.sgml @@ -0,0 +1,33 @@ + + + + + + + LibGlabels Reference Manual + + + + Basic LibGlabels Usage + + + + + + + + Working Directly With LibGlabels XML + + + + + + + + Miscellaneous + + + + + diff --git a/docs/libglabels/libglabels-overrides.txt b/docs/libglabels/libglabels-overrides.txt new file mode 100644 index 00000000..e69de29b diff --git a/docs/libglabels/libglabels-sections.txt b/docs/libglabels/libglabels-sections.txt new file mode 100644 index 00000000..658d109c --- /dev/null +++ b/docs/libglabels/libglabels-sections.txt @@ -0,0 +1,194 @@ +
    +db +libglabels/db.h +lglDbRegStatus + +lgl_db_init + +lgl_db_get_paper_id_list +lgl_db_free_paper_id_list +lgl_db_get_paper_name_list +lgl_db_free_paper_name_list +lgl_db_lookup_paper_from_id +lgl_db_lookup_paper_from_name +lgl_db_lookup_paper_id_from_name +lgl_db_lookup_paper_name_from_id +lgl_db_is_paper_id_known +lgl_db_is_paper_id_other + +lgl_db_get_category_id_list +lgl_db_free_category_id_list +lgl_db_get_category_name_list +lgl_db_free_category_name_list +lgl_db_lookup_category_from_id +lgl_db_lookup_category_from_name +lgl_db_lookup_category_id_from_name +lgl_db_lookup_category_name_from_id +lgl_db_is_category_id_known + +lgl_db_get_brand_list +lgl_db_free_brand_list + +lgl_db_register_template +lgl_db_does_template_exist +lgl_db_does_template_name_exist +lgl_db_get_template_name_list_unique +lgl_db_get_template_name_list_all +lgl_db_free_template_name_list +lgl_db_lookup_template_from_name + +lgl_db_print_known_papers +lgl_db_print_known_categories +lgl_db_print_known_templates +lgl_db_print_aliases +
    + +
    +template +libglabels/template.h +lglTemplate + +lglTemplateAlias + +lglTemplateFrameShape +lglTemplateFrame +lglTemplateFrameAll +lglTemplateFrameRect +lglTemplateFrameRound +lglTemplateFrameCD + +lglTemplateLayout + +lglTemplateMarkupType +lglTemplateMarkup +lglTemplateMarkupMargin +lglTemplateMarkupLine +lglTemplateMarkupCircle +lglTemplateMarkupRect + +lglTemplateOrigin + +lgl_template_new +lgl_template_dup +lgl_template_free +lgl_template_add_category +lgl_template_add_frame +lgl_template_add_alias + +lgl_template_get_name +lgl_template_do_templates_match +lgl_template_does_brand_match +lgl_template_does_page_size_match +lgl_template_does_category_match + +lgl_template_alias_new +lgl_template_alias_dup +lgl_template_alias_free + +lgl_template_frame_rect_new +lgl_template_frame_round_new +lgl_template_frame_cd_new +lgl_template_frame_dup +lgl_template_frame_free +lgl_template_frame_add_layout +lgl_template_frame_add_markup + +lgl_template_frame_get_size +lgl_template_frame_get_n_labels +lgl_template_frame_get_origins + +lgl_template_layout_new +lgl_template_layout_dup +lgl_template_layout_free + +lgl_template_markup_margin_new +lgl_template_markup_line_new +lgl_template_markup_circle_new +lgl_template_markup_rect_new +lgl_template_markup_dup +lgl_template_markup_free +
    + +
    +paper +libglabels/paper.h +lglPaper +lgl_paper_new +lgl_paper_dup +lgl_paper_free +
    + +
    +category +libglabels/category.h +lglCategory +lgl_category_new +lgl_category_dup +lgl_category_free +
    + +
    +xml-paper +libglabels/xml-paper.h +lgl_xml_paper_read_papers_from_file +lgl_xml_paper_parse_papers_doc +lgl_xml_paper_parse_paper_node +
    + +
    +xml-category +libglabels/xml-category.h +lgl_xml_category_read_categories_from_file +lgl_xml_category_parse_categories_doc +lgl_xml_category_parse_category_node +
    + +
    +xml-template +libglabels/xml-templates.h +lgl_xml_template_read_templates_from_file +lgl_xml_template_parse_templates_doc +lgl_xml_template_parse_template_node +lgl_xml_template_write_templates_to_file +lgl_xml_template_write_template_to_file +lgl_xml_template_create_template_node +
    + +
    +xml +libglabels/xml.h +LGL_XML_NAME_SPACE + +lgl_xml_get_prop_string +lgl_xml_get_prop_i18n_string +lgl_xml_get_prop_double +lgl_xml_get_prop_boolean +lgl_xml_get_prop_int +lgl_xml_get_prop_uint +lgl_xml_get_prop_length + +lgl_xml_set_prop_string +lgl_xml_set_prop_double +lgl_xml_set_prop_boolean +lgl_xml_set_prop_int +lgl_xml_set_prop_uint_hex +lgl_xml_set_prop_length + +lgl_xml_is_node +lgl_xml_get_node_content + +lgl_xml_set_default_units +
    + +
    +enums +libglabels/enums.h +lglUnitsType +
    + +
    +str +libglabels/str.h +lgl_str_utf8_casecmp +
    + diff --git a/docs/libglabels/libglabels-undocumented.txt b/docs/libglabels/libglabels-undocumented.txt new file mode 100644 index 00000000..d4b8b2f7 --- /dev/null +++ b/docs/libglabels/libglabels-undocumented.txt @@ -0,0 +1,9 @@ +99% symbol docs coverage. +141 symbols documented. +0 symbols incomplete. +1 not documented. + + +LGL_XML_NAME_SPACE + + diff --git a/docs/libglabels/libglabels.types b/docs/libglabels/libglabels.types new file mode 100644 index 00000000..e69de29b diff --git a/docs/libglabels/tmpl/category.sgml b/docs/libglabels/tmpl/category.sgml new file mode 100644 index 00000000..2143fd19 --- /dev/null +++ b/docs/libglabels/tmpl/category.sgml @@ -0,0 +1,55 @@ + +The lglCategory Structure + + +Template category definitions + + + +This section describes a structure for representing a category of stationary and related +functions. + + + + + + + + + + + + +This structure defines a category. + + +@id: Category ID. +@name: Localized category name. + + + + + + +@id: +@name: +@Returns: + + + + + + + +@orig: +@Returns: + + + + + + + +@category: + + diff --git a/docs/libglabels/tmpl/db.sgml b/docs/libglabels/tmpl/db.sgml new file mode 100644 index 00000000..3d5d2de3 --- /dev/null +++ b/docs/libglabels/tmpl/db.sgml @@ -0,0 +1,314 @@ + +Database + + +Database of pre-defined templates + + + +This section describes a set of functions to locate and add templates and related information in +the LibGlabels template database. + + + + + + + + + + + + +This enumeration defines a set of possible return values for lgl_db_register_template(). + + +@LGL_DB_REG_OK: Registration successful. +@LGL_DB_REG_BAD_PAPER_ID: Registration failed because paper id is unknown. +@LGL_DB_REG_BRAND_PART_EXISTS: Registration failed because template with same brand and part name/number already exists. +@LGL_DB_REG_FILE_WRITE_ERROR: Registration failed because an error while writing to disk. + + + + + + + + + + + + + +@Returns: + + + + + + + +@ids: + + + + + + + +@Returns: + + + + + + + +@names: + + + + + + + +@id: +@Returns: + + + + + + + +@name: +@Returns: + + + + + + + +@name: +@Returns: + + + + + + + +@id: +@Returns: + + + + + + + +@id: +@Returns: + + + + + + + +@id: +@Returns: + + + + + + + +@Returns: + + + + + + + +@ids: + + + + + + + +@Returns: + + + + + + + +@names: + + + + + + + +@id: +@Returns: + + + + + + + +@name: +@Returns: + + + + + + + +@name: +@Returns: + + + + + + + +@id: +@Returns: + + + + + + + +@id: +@Returns: + + + + + + + +@paper_id: +@category_id: +@Returns: + + + + + + + +@brands: + + + + + + + +@template: +@Returns: + + + + + + + +@brand: +@part: +@Returns: + + + + + + + +@name: +@Returns: + + + + + + + +@brand: +@paper_id: +@category_id: +@Returns: + + + + + + + +@brand: +@paper_id: +@category_id: +@Returns: + + + + + + + +@names: + + + + + + + +@name: +@Returns: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@template: + + diff --git a/docs/libglabels/tmpl/enums.sgml b/docs/libglabels/tmpl/enums.sgml new file mode 100644 index 00000000..b74f00d1 --- /dev/null +++ b/docs/libglabels/tmpl/enums.sgml @@ -0,0 +1,33 @@ + +Enumerations + + +Common enumerations used by libglabels + + + +This section defines enumerations used to interact with libglabels. + + + + + + + + + + + + +This enumeration defines a set of units of distance supported by the libglabels XML distance +attributes. + + +@LGL_UNITS_POINT: Points. Encoded as "pt" in XML distance attributes. +@LGL_UNITS_INCH: Inches. Encoded as "in" in XML distance attributes. +@LGL_UNITS_MM: Millmeters. Encoded as "mm" in XML distance attributes. +@LGL_UNITS_CM: Centimeters. Encoded as "cm" in XML distance attributes. +@LGL_UNITS_PICA: Picas. Encoded as "pc" in XML distance attributes. +@LGL_UNITS_FIRST: First enumeration. Used for generic iteration through supported units.. +@LGL_UNITS_LAST: Last enumeration. Used for generic iteration through supported units. + diff --git a/docs/libglabels/tmpl/libglabels-unused.sgml b/docs/libglabels/tmpl/libglabels-unused.sgml new file mode 100644 index 00000000..dc089b42 --- /dev/null +++ b/docs/libglabels/tmpl/libglabels-unused.sgml @@ -0,0 +1,1519 @@ + + + + + + + + + + + + + + + + + + + + + +init + + + + + + + + + + + + + + + + + + + + + + + +libglabels + + + + +This section describes a set of functions for constructing new template structures. + + + + + + + + + + +Functions to help create new templates + + + + + + + +Construction Functions + + + + +This section describes a set of functions to locate pre-defined templates and add templates +to the LibGlabels template database. + + + + + + + + + + +Database of pre-defined templates + + + + + + + +Database + + + + +This section describes miscellaneous template functions. + + + + + + + + + + +Miscellaneous template functions + + + + + + + +Miscellaneous Functions + + + + + + + + + + + + + + + + + + + + + + + +template2 + + + + + + + + + + + + + + + + + + + + + + + +template3 + + + + + + + + + + + + + +@id: +@name: + + + + + + +@id: +@name: +@width: +@height: + + + + + + +@name: +@description: +@page_size: +@page_width: +@page_height: +@categories: +@frames: +@aliases: + + + + + + + + + + + + +@shape: +@id: +@layouts: +@markups: + + + + + + +@shape: +@id: +@layouts: +@markups: +@r1: +@r2: +@w: +@h: +@waste: + + + + + + +@shape: +@id: +@layouts: +@markups: +@w: +@h: +@r: +@x_waste: +@y_waste: + + + + + + +@shape: +@id: +@layouts: +@markups: +@r: +@waste: + + + + + + +@GL_TEMPLATE_FRAME_SHAPE_RECT: +@GL_TEMPLATE_FRAME_SHAPE_ROUND: +@GL_TEMPLATE_FRAME_SHAPE_CD: + + + + + + +@GL_TEMPLATE_SHAPE_RECT: +@GL_TEMPLATE_SHAPE_ROUND: +@GL_TEMPLATE_SHAPE_CD: + + + + + + +@id: +@layouts: +@markups: +@shape: + + + + + + +@nx: +@ny: +@x0: +@y0: +@dx: +@dy: + + + + + + + + + + + + +@type: +@x0: +@y0: +@r: + + + + + + +@type: +@x1: +@y1: +@x2: +@y2: + + + + + + +@type: +@size: + + + + + + +@type: +@x1: +@y1: +@w: +@h: +@r: + + + + + + +@GL_TEMPLATE_MARKUP_MARGIN: +@GL_TEMPLATE_MARKUP_LINE: +@GL_TEMPLATE_MARKUP_CIRCLE: +@GL_TEMPLATE_MARKUP_RECT: + + + + + + +@x: +@y: + + + +Enumerations for the units of length supported by libglabels. Internally +all lengths are in points. Externally libglabels supports points ("pt"), +inches ("in"), millimeters ("mm"), centimeters ("cm"), and picas ("pc"). +These units are identical to the absolute length units supported in +the CSS2 Specification (Section 4.3.2). + + +@GL_UNITS_POINT: +@GL_UNITS_INCH: +@GL_UNITS_MM: +@GL_UNITS_CM: +@GL_UNITS_PICA: +@GL_UNITS_FIRST: +@GL_UNITS_LAST: + + + + + + +@orig: +@Returns: + + + + + + +@category: + + + + + + +@names: + + + + + + +@id: +@Returns: + + + + + + +@name: +@Returns: + + + + + + +@Returns: + + + + + + + + + + + + +@name: +@Returns: + + + + + + +@id: +@Returns: + + + + + + +@id: +@name: +@Returns: + + + + + + +@orig: +@Returns: + + + + + + +@paper: + + + + + + +@ids: + + + + + + +@names: + + + + + + +@id: +@Returns: + + + + + + +@name: +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + + + + + + + +@id: +@Returns: + + + + + + +@id: +@Returns: + + + + + + +@name: +@Returns: + + + + + + +@id: +@Returns: + + + + + + +@id: +@name: +@width: +@height: +@Returns: + + + + + + + + + + + + +@template: +@alias: + + + + + + +@template: +@category: + + + + + + +@template: +@frame: + + + + + + +@template: +@label_type: + + + + + + +@frame: +@layout: + + + + + + +@frame: +@markup: + + + + + + +@id: +@r1: +@r2: +@w: +@h: +@waste: +@Returns: + + + + + + +@template: +@category: +@Returns: + + + + + + +@template: +@page_size: +@Returns: + + + + + + +@orig: +@Returns: + + + + + + +@id: +@r1: +@r2: +@w: +@h: +@waste: +@Returns: + + + + + + +@orig_frame: +@Returns: + + + + + + +@frame: + + + + + + +@frame: +@Returns: + + + + + + +@frame: +@Returns: + + + + + + +@frame: +@w: +@h: + + + + + + +@id: +@w: +@h: +@r: +@x_waste: +@y_waste: +@Returns: + + + + + + +@id: +@r: +@waste: +@Returns: + + + + + + +@template: + + + + + + +@names: + + + + + + +@name: +@Returns: + + + + + + +@template: +@Returns: + + + + + + +@template: +@Returns: + + + + + + +@label_type: +@w: +@h: + + + + + + +@label_type: +@Returns: + + + + + + +@page_size: +@Returns: + + + + + + +@page_size: +@category: +@Returns: + + + + + + +@page_size: +@category: +@Returns: + + + + + + +@template: +@Returns: + + + + + + +@label_type: +@Returns: + + + + + + + + + + + + +@orig_ltype: +@Returns: + + + + + + +@ltype: + + + + + + +@orig_layout: +@Returns: + + + + + + +@layout: + + + + + + +@nx: +@ny: +@x0: +@y0: +@dx: +@dy: +@Returns: + + + + + + +@x0: +@y0: +@r: +@Returns: + + + + + + +@orig_markup: +@Returns: + + + + + + +@markup: + + + + + + +@x1: +@y1: +@x2: +@y2: +@Returns: + + + + + + +@size: +@Returns: + + + + + + +@x1: +@y1: +@w: +@h: +@r: +@Returns: + + + + + + +@name: +@description: +@page_size: +@page_width: +@page_height: +@Returns: + + + + + + +@template: + + + + + + + + + + + + +@id: +@w: +@h: +@r: +@x_waste: +@y_waste: +@Returns: + + + + + + +@template: + + + + + + +@id: +@r: +@waste: +@Returns: + + + + + + +@categories_doc: +@Returns: + + + + + + +@category_node: +@Returns: + + + + + + +@utf8_filename: +@Returns: + + + + + + +@node: +@Returns: + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + +@node: +@name: +@Returns: + + + + + + +@paper_node: +@Returns: + + + + + + +@papers_doc: +@Returns: + + + + + + +@utf8_filename: +@Returns: + + + + + + +@units: + + + + + + +@node: +@property: +@val: + + + + + + +@node: +@property: +@val: + + + + + + +@node: +@property: +@val: + + + + + + +@node: +@property: +@val: + + + + + + +@node: +@property: +@val: + + + + + + +@node: +@property: +@val: + + + + + + +@template: +@root: +@ns: + + + + + + +@templates: +@Returns: + + + + + + +@template_node: +@Returns: + + + + + + +@templates_doc: +@Returns: + + + + + + +@utf8_filename: +@Returns: + + + + + + +@template: +@utf8_filename: + + + + + + +@templates: +@utf8_filename: + + + + + + +@ids: + + + + + + +@names: + + + + + + +@id: +@Returns: + + + + + + +@name: +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + + + + + + + +@name: +@Returns: + + + + + + +@id: +@Returns: + + + + + + + + + + + + +@ids: + + + + + + +@names: + + + + + + +@id: +@Returns: + + + + + + +@name: +@Returns: + + + + + + +@Returns: + + + + + + +@Returns: + + + + + + + + + + + + +@id: +@Returns: + + + + + + +@id: +@Returns: + + + + + + +@name: +@Returns: + + + + + + +@id: +@Returns: + + + + + + + + + + + + +@frame: +@layout: + + + + + + +@frame: +@markup: + + + + + + +@brands: + + + + + + +@names: + + + + + + +@name: +@Returns: + + + + + + +@page_size: +@category: +@Returns: + + + + + + +@template: +@Returns: + + + + + + +@brand: +@page_size: +@category: +@Returns: + + + + + + +@brand: +@page_size: +@category: +@Returns: + + + + + + + + + + + + +@template: + + + + + + + + + + + + +@template: + + + + + + +@templates: +@Returns: + diff --git a/docs/libglabels/tmpl/libglabels.sgml b/docs/libglabels/tmpl/libglabels.sgml new file mode 100644 index 00000000..0552a20b --- /dev/null +++ b/docs/libglabels/tmpl/libglabels.sgml @@ -0,0 +1,19 @@ + +libglabels + + + + + + + + + + + + + + + + + diff --git a/docs/libglabels/tmpl/paper.sgml b/docs/libglabels/tmpl/paper.sgml new file mode 100644 index 00000000..dc69d746 --- /dev/null +++ b/docs/libglabels/tmpl/paper.sgml @@ -0,0 +1,61 @@ + +The lglPaper Structure + + +Paper size definitions + + + +This section describes a structure for representing a paper size definition +and related functions. + + + + + + + + + + + + +This structure defines a paper (page) size. + + +@id: Paper size ID. +@name: Localized paper size name. +@width: Width of paper in points. +@height: Height of paper in points. +@pwg_size: PWG 5101.1-2002 size name. + + + + + + +@id: +@name: +@width: +@height: +@pwg_size: +@Returns: + + + + + + + +@orig: +@Returns: + + + + + + + +@paper: + + diff --git a/docs/libglabels/tmpl/str.sgml b/docs/libglabels/tmpl/str.sgml new file mode 100644 index 00000000..53cbd3b9 --- /dev/null +++ b/docs/libglabels/tmpl/str.sgml @@ -0,0 +1,30 @@ + +String Utility Functions + + +String utility functions provided by libglabels + + + +This section defines string utility functions used by libglabels and of +possible use to a user of libglabels. + + + + + + + + + + + + + + + +@s1: +@s2: +@Returns: + + diff --git a/docs/libglabels/tmpl/template.sgml b/docs/libglabels/tmpl/template.sgml new file mode 100644 index 00000000..e7a58879 --- /dev/null +++ b/docs/libglabels/tmpl/template.sgml @@ -0,0 +1,532 @@ + +The lglTemplate Structure + + +How templates are represented in memory + + + +This section describes a set of structures that represent a template in memory. It also +describes functions to help create and interpret these structures. + + + + + + + + + + + + +This is the main structure of a libglabels template. A template represents a single sheet +of peel-off labels or cards. + + +@brand: Brand name of label or card. E.g. "Avery." +@part: Part name or number of label or card. E.g. "8160." +@description: A description of the template. E.g. "Mailing labels." +@paper_id: A paper ID. E.g. "A4" or "US-Letter." +@page_width: Page width in points. Used only if paper_id is "Other." +@page_height: Page height in points. Used only if paper_id is "Other." +@aliases: A list of alternate names for this template. Often a single template can be used for +multiple products. +@category_ids: A list of category IDs that this template belongs to. +@frames: A list of (#lglTemplateFrame *) structures. GLabels currently only supports one frame +per template -- future versions may support multiple frames per template. + + + +This structure defines an alias for the parent template structure. An alias is used for +different products that can use the same template. + + +@brand: Brand name of label or card. E.g. "Avery." +@part: Part name or number of label or card. E.g. "8160." + + + +This enumeration defines frame types that are supported by libglabels + + +@LGL_TEMPLATE_FRAME_SHAPE_RECT: A rectangular frame. (May have rounded corners.) +@LGL_TEMPLATE_FRAME_SHAPE_ROUND: A round frame. +@LGL_TEMPLATE_FRAME_SHAPE_CD: A CD or DVD frame. (Includes credit-card style CDs.) + + + +A union of all possible frame structures. The type of structure is indicated by the shape +member, which overlays the first field of all other member structures. + + + + + +This structure is composed of a set of fields common to all frame structures. All frame types +can be cast to this structure. + + +@shape: The shape of the frame. +@id: Reserved for future use. Should always be zero. +@layouts: A list of (#lglTemplateLayout *) structures. Typically a frame will have a single +layout, representing a simple grid of labels or cards. If the layout of labels or cards is +more complex, multiple (#lglTemplateLayout *) structures may be needed. +@markups: A list of (#lglTemplateMarkup *) structures, which represent non-printing markup lines. + + + +This structure defines the frame for a rectangular label or card. + + +@shape: Common field. Always #LGL_TEMPLATE_FRAME_SHAPE_RECT for #lglTemplateFrameRect. +@id: Common field. See #lglTemplateFrameAll. +@layouts: Common field. See #lglTemplateFrameAll. +@markups: Common field. See #lglTemplateFrameAll. +@w: Width of label or card in points. +@h: Height of label or card in points. +@r: Radius of corners in points. +@x_waste: Amount of horizontal over-print to allow in points. +@y_waste: Amount of vertical over-print to allow in points. + + + +This structure defines the frame for a round label or card. + + +@shape: Common field. Always #LGL_TEMPLATE_FRAME_SHAPE_ROUND for #lglTemplateFrameRound. +@id: Common field. See #lglTemplateFrameAll. +@layouts: Common field. See #lglTemplateFrameAll. +@markups: Common field. See #lglTemplateFrameAll. +@r: Radius of label or card in points. +@waste: Amount of over-print to allow in points. + + + +This structure defines the frame for a CD or DVD label. This structure also supports +credit-card CD labels. + + +@shape: Common field. Always #LGL_TEMPLATE_FRAME_SHAPE_CD for #lglTemplateFrameCD. +@id: Common field. See #lglTemplateFrameAll. +@layouts: Common field. See #lglTemplateFrameAll. +@markups: Common field. See #lglTemplateFrameAll. +@r1: Outer radius of label in points. +@r2: Radius of center hole in points. +@w: Clip width in points. Used for credit-card CD labels. This field is ignored if zero. +@h: Clip height in points. Used for credit-card CD labels. This field is ignored if zero. +@waste: Amount of over-print to allow in points. + + + +This structure defines a simple grid layout of labels or cards. + + +@nx: Number of labels or cards across in the grid (horizontal). +@ny: Number of labels or cards down in the grid (vertical). +@x0: Distance (in points) from the left edge of page to the left edge of the left column of +cards or labels in the layout. +@y0: Distance (in points) from the top edge of page to the top edge of the top row of +cards or labels in the layout. +@dx: Horizontal pitch of grid in points. This is the distance from left edge to left edge +(not the gap between labels or cards). +@dy: Vertical pitch of grid in points. This is the distance from top edge to top edge +(not the gap between labels or cards). + + + +This enumeration defines markup types that are supported by libglabels + + +@LGL_TEMPLATE_MARKUP_MARGIN: A margin line around perimeter of label or card. +@LGL_TEMPLATE_MARKUP_LINE: A simple line segment. +@LGL_TEMPLATE_MARKUP_CIRCLE: A circle. +@LGL_TEMPLATE_MARKUP_RECT: A rectangle. Possibly with rounded corners. + + + +A union of all possible markup structures. The type of structure is indicated by the type +member, which overlays the first field of all other member structures. + + + + + +This structure defines a simple margin markup around the perimeter of a label or card. + + +@type: Common field. Always #LGL_TEMPLATE_MARKUP_MARGIN for #lglTemplateMarkupMargin. +@size: Distance of margin from edge of label or card. + + + +This structure defines a simple line segment markup. + + +@type: Common field. Always #LGL_TEMPLATE_MARKUP_LINE for #lglTemplateMarkupLine. +@x1: Distance (in points) of first endpoint from left edge of label or card. +@y1: Distance (in points) of first endpoint from top edge of label or card. +@x2: Distance (in points) of second endpoint from left edge of label or card. +@y2: Distance (in points) of second endpoint from top edge of label or card. + + + +This structure defines a simple circle markup. + + +@type: Common field. Always #LGL_TEMPLATE_MARKUP_CIRCLE for #lglTemplateMarkupCircle. +@x0: Distance (in points) of vertex from left edge of label or card. +@y0: Distance (in points) of vertex from top edge of label or card. +@r: Radius of circle in points. + + + +This structure defines a simple rectangle markup. The rectangle can have rounded corners. + + +@type: Common field. Always #LGL_TEMPLATE_MARKUP_RECT for #lglTemplateMarkupRect. +@x1: Distance (in points) of left edge of markup from left edge of label or card. +@y1: Distance (in points) of top edge of markup from top edge of label or card. +@w: Width of rectangle in points. +@h: Height of rectangle in points. +@r: Radius of corners in points. Should be zero for sharp corners. + + + +This structure represents the cartesian coordinates of the origin of a label or card on the page. +The orign is the upper left corner of the extent of the label or card. These coordinates are +relative to the upper left corner of the page. + + +@x: Distance in points from top edge of page. +@y: Distance in points from left edge of page. + + + + + + +@brand: +@part: +@description: +@paper_id: +@page_width: +@page_height: +@Returns: + + + + + + + +@orig_template: +@Returns: + + + + + + + +@template: + + + + + + + +@template: +@category_id: + + + + + + + +@template: +@frame: + + + + + + + +@template: +@alias: + + + + + + + +@template: +@Returns: + + + + + + + +@template1: +@template2: +@Returns: + + + + + + + +@template: +@brand: +@Returns: + + + + + + + +@template: +@paper_id: +@Returns: + + + + + + + +@template: +@category_id: +@Returns: + + + + + + + +@brand: +@part: +@Returns: + + + + + + + +@orig_alias: +@Returns: + + + + + + + +@alias: + + + + + + + +@id: +@w: +@h: +@r: +@x_waste: +@y_waste: +@Returns: + + + + + + + +@id: +@r: +@waste: +@Returns: + + + + + + + +@id: +@r1: +@r2: +@w: +@h: +@waste: +@Returns: + + + + + + + +@orig_frame: +@Returns: + + + + + + + +@frame: + + + + + + + +@frame: +@layout: + + + + + + + +@frame: +@markup: + + + + + + + +@frame: +@w: +@h: + + + + + + + +@frame: +@Returns: + + + + + + + +@frame: +@Returns: + + + + + + + +@nx: +@ny: +@x0: +@y0: +@dx: +@dy: +@Returns: + + + + + + + +@orig_layout: +@Returns: + + + + + + + +@layout: + + + + + + + +@size: +@Returns: + + + + + + + +@x1: +@y1: +@x2: +@y2: +@Returns: + + + + + + + +@x0: +@y0: +@r: +@Returns: + + + + + + + +@x1: +@y1: +@w: +@h: +@r: +@Returns: + + + + + + + +@orig_markup: +@Returns: + + + + + + + +@markup: + + diff --git a/docs/libglabels/tmpl/xml-category.sgml b/docs/libglabels/tmpl/xml-category.sgml new file mode 100644 index 00000000..f22b59ed --- /dev/null +++ b/docs/libglabels/tmpl/xml-category.sgml @@ -0,0 +1,47 @@ + +XML Category Functions + + +Functions to parse glabels XML category definition files + + + +This section describes a number of functions for parsing glabels +XML category definition files. + + + + + + + + + + + + + + + +@utf8_filename: +@Returns: + + + + + + + +@categories_doc: +@Returns: + + + + + + + +@category_node: +@Returns: + + diff --git a/docs/libglabels/tmpl/xml-paper.sgml b/docs/libglabels/tmpl/xml-paper.sgml new file mode 100644 index 00000000..0909d2cf --- /dev/null +++ b/docs/libglabels/tmpl/xml-paper.sgml @@ -0,0 +1,47 @@ + +XML Paper Functions + + +Functions to parse glabels XML paper definition files + + + +This section describes a number of functions for parsing glabels +XML paper definition files. + + + + + + + + + + + + + + + +@utf8_filename: +@Returns: + + + + + + + +@papers_doc: +@Returns: + + + + + + + +@paper_node: +@Returns: + + diff --git a/docs/libglabels/tmpl/xml-template.sgml b/docs/libglabels/tmpl/xml-template.sgml new file mode 100644 index 00000000..071a08ab --- /dev/null +++ b/docs/libglabels/tmpl/xml-template.sgml @@ -0,0 +1,78 @@ + +XML Template Functions + + +Functions to create and parse glabels XML template nodes and files + + + +This section describes a number of functions for creating and parsing +glabels XML template nodes and files. Template nodes are used in both +template files and document files. + + + + + + + + + + + + + + + +@utf8_filename: +@Returns: + + + + + + + +@templates_doc: +@Returns: + + + + + + + +@template_node: +@Returns: + + + + + + + +@templates: +@utf8_filename: +@Returns: + + + + + + + +@template: +@utf8_filename: +@Returns: + + + + + + + +@template: +@root: +@ns: + + diff --git a/docs/libglabels/tmpl/xml.sgml b/docs/libglabels/tmpl/xml.sgml new file mode 100644 index 00000000..e0803379 --- /dev/null +++ b/docs/libglabels/tmpl/xml.sgml @@ -0,0 +1,194 @@ + +XML Helper Functions + + +Functions to help format and parse glabels XML properties + + + +This section describes a number of "helper" functions for formatting and +parsing various types of properties for tags in glabels XML file formats. + + +These functions are basically wrappers to functions from libxml2. + + + + + + + + + + + + + + + + + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + + +@node: +@property: +@default_val: +@Returns: + + + + + + + +@node: +@property: +@val: + + + + + + + +@node: +@property: +@val: + + + + + + + +@node: +@property: +@val: + + + + + + + +@node: +@property: +@val: + + + + + + + +@node: +@property: +@val: + + + + + + + +@node: +@property: +@val: + + + + + + + +@node: +@name: +@Returns: + + + + + + + +@node: +@Returns: + + + + + + + +@units: + + diff --git a/glabels.spec.in b/glabels.spec.in new file mode 100644 index 00000000..6050b0d6 --- /dev/null +++ b/glabels.spec.in @@ -0,0 +1,106 @@ +Summary: glabels is a GNOME program to create labels and business cards +Name: glabels +Version: @VERSION@ +Release: 1 +License: GPL +Group: Applications/Publishing +URL: http://glabels.sourceforge.net/ + +Source: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/root-%{name}-%{version} +Prefix: %{_prefix} + +BuildRequires: gtk2-devel >= @GTK_REQUIRED@ +BuildRequires: libxml2-devel >= @LIBXML_REQUIRED@ +BuildRequires: libgnomeui-devel >= @LIBGNOMEUI_REQUIRED@ +BuildRequires: libglade2-devel >= @LIBGLADE_REQUIRED@ + +Requires: gtk2 >= @GTK_REQUIRED@ +Requires: libxml2 >= @LIBXML_REQUIRED@ +Requires: libgnomeui >= @LIBGNOMEUI_REQUIRED@ +Requires: libglade2 >= @LIBGLADE_REQUIRED@ + +%description +gLabels is a lightweight program for creating labels and +business cards for the GNOME desktop environment. +It is designed to work with various laser/ink-jet peel-off +label and business card sheets that you'll find at most office +supply stores. + +%prep +%setup + +%build +%configure +%{__make} %{?_smp_mflags} + +%install +%{__rm} -rf %{buildroot} +%makeinstall +%find_lang %{name} + +desktop-file-install --vendor gnome --delete-original \ + --add-category X-Red-Hat-Base \ + --dir %{buildroot}%{_datadir}/applications \ + %{buildroot}%{_datadir}/applications/%{name}.desktop + +%{__rm} -rf %{buildroot}/var/scrollkeeper +%{__rm} -f %{buildroot}%{_datadir}/mime/XMLnamespaces +%{__rm} -f %{buildroot}%{_datadir}/mime/globs +%{__rm} -f %{buildroot}%{_datadir}/mime/magic +%{__rm} -f %{buildroot}%{_datadir}/mime/mime.cache +%{__rm} -rf %{buildroot}%{_datadir}/mime/application +%{__rm} -rf %{buildroot}%{_datadir}/mime/aliases +%{__rm} -rf %{buildroot}%{_datadir}/mime/subclasses + + +%clean +%{__rm} -rf %{buildroot} + +%post +scrollkeeper-update +if (update-mime-database -v &> /dev/null); then + update-mime-database "%{_datadir}/mime" > /dev/null +fi + +%postun +scrollkeeper-update +if (update-mime-database -v &> /dev/null); then + update-mime-database "%{_datadir}/mime" > /dev/null +fi + +%files -f %{name}.lang +%defattr(-, root, root) +%doc README COPYING.README_FIRST COPYING COPYING-DOCS COPYING-LIBGLABELS ChangeLog NEWS AUTHORS INSTALL +%doc %{_datadir}/gnome/help/glabels/ +%{_bindir}/glabels +%{_bindir}/glabels-batch +%{_libdir}/libglabels.* +%{_libdir}/pkgconfig/libglabels.pc +%{_includedir}/libglabels/* +%{_datadir}/glabels/ +%{_datadir}/pixmaps/* +%{_datadir}/omf/ +%{_datadir}/applications/*.desktop +%{_datadir}/application-registry/* +%{_datadir}/mime-info/* +%{_datadir}/mime/packages/* +%{_datadir}/man/* +%{_datadir}/gtk-doc/html/libglabels/* + +%changelog +* Sun Aug 8 2004 Jim Evins +- Added support for freedesktop.org mime database registration + +* Sat Feb 21 2004 Jim Evins +- Added libglabels related files + +* Tue Dec 23 2003 Jim Evins +- Added support for scrollkeeper + +* Sat Oct 18 2003 Jim Evins +- Updated, based largely on Dag Wieers glabels.spec + +* Sat May 19 2001 Jim Evins +- Created + diff --git a/glabels2/AUTHORS b/glabels2/AUTHORS deleted file mode 100644 index d83a63f5..00000000 --- a/glabels2/AUTHORS +++ /dev/null @@ -1,182 +0,0 @@ -gLabels Author -============== - -Jim Evins - -Acknowledgments -=============== - -- The GNU Barcode Library provides a large chunk of the barcode functionality -and is distributed with glabels. See ./barcode-0.98/README for more -information. The author: - - Alessandro Rubini - -- The iec16022 library provides encoding for 2D barcodes. See -iec16022-0.2.1/README for more information. - -- Glabels includes modified versions of several widgets from the GAL library. -These are copyright: - - * Copyright 2000, 2001, Ximian, Inc. - * Copyright 2000, Michael Levy - * Copyright 2001, Almer S. Tigelaar - -- Glabels includes a modified version of the gimpchainbutton widget from the -gimp, as well as several stock icons from the gimp's default theme. -These are copyright: - - * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball - * Copyright (C) 1999-2000 Sven Neumann - -Glabels includes contributions from: - Frederic Ruaudel - Emmanuel Pacaud - Wayne Schuller - Austin Henry -- EDS and vcard backends - nestor di -- excellent splash screen - that first appeared in - 0.4.3: - Darren Warner - Javier Donaire Segarra - Alessandro Zummo - José Dapena Paz - Akkana - Dag Wieers - Mário Meyer - Peter Cherriman - -Translations: - - Olivier Berger -- French (original) - Florent Morel -- French (2.0.2) - Claude Paroz -- French (2.1.4) - Marcus Bauer -- German (original) - Christian Neumair -- German (1.89.1) - Mario Blättermann -- German (2.2.5) - Takeshi AIHANA -- Japanese - Paulo Rogério Ormenese -- Brazilian Portuguese - Víctor Moral -- Spanish translations - sergio rivadero -- Spanish Translations (2.0.3) - Vitaly Lipatov -- Russian translations - Shell, Hin-lik Hung -- Chinese Translations - Arkadiusz Lipiec -- Polish Translations - David Makovský (Yakeen) -- Czech Translations - Zbynek Mrkvicka -- Czech Translations (2.0.3) - Mancio -- Italian Translations - Daniele Medri -- Italian Translations (2.0.3) - Antonio C. Codazzi "la Filozofo" -- Esperanto - -The following people have submitted label templates or information about -particular products (I apologize if I have missed anybody): - - Hap - Olivier Berger - Marcus Bauer - Jochen Hein - Jonathan Buzzard - Jeff Davis - Ludger Solbach - Darren Ross - George Mitchell - Douglas Bollinger - Tim Jackson - John Stoffel - Dany De Bontridder - Andy Longton - Bostjan Muller - John Helms - no-exit - Mozilla from marela - Holger - Bill Tihen - Dan Gray - Keith Hudson - Tamas Bondar - George Mitchell - Erich Pfennig - Gwen Patton - Miek Gieben - Joerg Schmitz-Linneweber - David Makovský - Oliver Schwank - Akkana - Ted Poe - hans-helmut.belter - Uli Wachowitz - Stephan Hegel - Holger Reinmann - Michael Wojciechowski - Jim Mueller - Mark Fullalove - Zamiel Al'Shaitan - Philip Paeps - Bryan Fields - Martin Klaffenboeck - Lauri Ampuja - Allan Wind - Mark S Burgunder - Christian Holländer - Marvin P. Dickens - Julien BLACHE - James D Strandboge - Linas Jakucionis - Henrik Brix Andersen - Nigel Titley - Sean 'Shaleh' Perry - Anthony Brockman - Thorsten Hirsch - John Ross - Mike Machado - Rob Elshire - Niels - Ernst W. Winter - regis rampnoux - Sven Salzwedel - Dick Middleton - Ian Peake - Wayne Schuller - Thomas Vill - Fred Bacon - JBadger - Frank Altpeter - Matthew J. Lockner - Larry Harriman - Juan Carlos Valero - Nick Hill - Ali Akcaagac - Dan Clark - Peter L. Berghold - Vitaly Lipatov - Steve Saxon - Roman Kreisel - Steve Reppucci - Lionel CONS - Richard Lance - Anand Kumria - Alexandre Sauvé - Ironblade - Matthias Mailänder - Bernhard Walle - Stephen Hilliard - Alessandro Zummo - Herbert Straub - Dennis Böckmann - Anon - D. Leitner - Georg Ostertag - Manuel Siggen - David Huber - Harald Welte - Richard Rothwell - Gernot Hassenpflug - Pau Ruŀlan Ferragut - Richard Hurt - Phil Endecott - Koen Wybo - Mark Moeller - Bertus W. - Oliver Friedrich - - -And many others for their many helpful suggestions and bug reports -- thanks. diff --git a/glabels2/COPYING b/glabels2/COPYING deleted file mode 100644 index d60c31a9..00000000 --- a/glabels2/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - 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 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/glabels2/COPYING-DOCS b/glabels2/COPYING-DOCS deleted file mode 100644 index b42936be..00000000 --- a/glabels2/COPYING-DOCS +++ /dev/null @@ -1,355 +0,0 @@ - GNU Free Documentation License - Version 1.1, March 2000 - - Copyright (C) 2000 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - -0. PREAMBLE - -The purpose of this License is to make a manual, textbook, or other -written document "free" in the sense of freedom: to assure everyone -the effective freedom to copy and redistribute it, with or without -modifying it, either commercially or noncommercially. Secondarily, -this License preserves for the author and publisher a way to get -credit for their work, while not being considered responsible for -modifications made by others. - -This License is a kind of "copyleft", which means that derivative -works of the document must themselves be free in the same sense. It -complements the GNU General Public License, which is a copyleft -license designed for free software. - -We have designed this License in order to use it for manuals for free -software, because free software needs free documentation: a free -program should come with manuals providing the same freedoms that the -software does. But this License is not limited to software manuals; -it can be used for any textual work, regardless of subject matter or -whether it is published as a printed book. We recommend this License -principally for works whose purpose is instruction or reference. - - -1. APPLICABILITY AND DEFINITIONS - -This License applies to any manual or other work that contains a -notice placed by the copyright holder saying it can be distributed -under the terms of this License. The "Document", below, refers to any -such manual or work. Any member of the public is a licensee, and is -addressed as "you". - -A "Modified Version" of the Document means any work containing the -Document or a portion of it, either copied verbatim, or with -modifications and/or translated into another language. - -A "Secondary Section" is a named appendix or a front-matter section of -the Document that deals exclusively with the relationship of the -publishers or authors of the Document to the Document's overall subject -(or to related matters) and contains nothing that could fall directly -within that overall subject. (For example, if the Document is in part a -textbook of mathematics, a Secondary Section may not explain any -mathematics.) The relationship could be a matter of historical -connection with the subject or with related matters, or of legal, -commercial, philosophical, ethical or political position regarding -them. - -The "Invariant Sections" are certain Secondary Sections whose titles -are designated, as being those of Invariant Sections, in the notice -that says that the Document is released under this License. - -The "Cover Texts" are certain short passages of text that are listed, -as Front-Cover Texts or Back-Cover Texts, in the notice that says that -the Document is released under this License. - -A "Transparent" copy of the Document means a machine-readable copy, -represented in a format whose specification is available to the -general public, whose contents can be viewed and edited directly and -straightforwardly with generic text editors or (for images composed of -pixels) generic paint programs or (for drawings) some widely available -drawing editor, and that is suitable for input to text formatters or -for automatic translation to a variety of formats suitable for input -to text formatters. A copy made in an otherwise Transparent file -format whose markup has been designed to thwart or discourage -subsequent modification by readers is not Transparent. A copy that is -not "Transparent" is called "Opaque". - -Examples of suitable formats for Transparent copies include plain -ASCII without markup, Texinfo input format, LaTeX input format, SGML -or XML using a publicly available DTD, and standard-conforming simple -HTML designed for human modification. Opaque formats include -PostScript, PDF, proprietary formats that can be read and edited only -by proprietary word processors, SGML or XML for which the DTD and/or -processing tools are not generally available, and the -machine-generated HTML produced by some word processors for output -purposes only. - -The "Title Page" means, for a printed book, the title page itself, -plus such following pages as are needed to hold, legibly, the material -this License requires to appear in the title page. For works in -formats which do not have any title page as such, "Title Page" means -the text near the most prominent appearance of the work's title, -preceding the beginning of the body of the text. - - -2. VERBATIM COPYING - -You may copy and distribute the Document in any medium, either -commercially or noncommercially, provided that this License, the -copyright notices, and the license notice saying this License applies -to the Document are reproduced in all copies, and that you add no other -conditions whatsoever to those of this License. You may not use -technical measures to obstruct or control the reading or further -copying of the copies you make or distribute. However, you may accept -compensation in exchange for copies. If you distribute a large enough -number of copies you must also follow the conditions in section 3. - -You may also lend copies, under the same conditions stated above, and -you may publicly display copies. - - -3. COPYING IN QUANTITY - -If you publish printed copies of the Document numbering more than 100, -and the Document's license notice requires Cover Texts, you must enclose -the copies in covers that carry, clearly and legibly, all these Cover -Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -the back cover. Both covers must also clearly and legibly identify -you as the publisher of these copies. The front cover must present -the full title with all words of the title equally prominent and -visible. You may add other material on the covers in addition. -Copying with changes limited to the covers, as long as they preserve -the title of the Document and satisfy these conditions, can be treated -as verbatim copying in other respects. - -If the required texts for either cover are too voluminous to fit -legibly, you should put the first ones listed (as many as fit -reasonably) on the actual cover, and continue the rest onto adjacent -pages. - -If you publish or distribute Opaque copies of the Document numbering -more than 100, you must either include a machine-readable Transparent -copy along with each Opaque copy, or state in or with each Opaque copy -a publicly-accessible computer-network location containing a complete -Transparent copy of the Document, free of added material, which the -general network-using public has access to download anonymously at no -charge using public-standard network protocols. If you use the latter -option, you must take reasonably prudent steps, when you begin -distribution of Opaque copies in quantity, to ensure that this -Transparent copy will remain thus accessible at the stated location -until at least one year after the last time you distribute an Opaque -copy (directly or through your agents or retailers) of that edition to -the public. - -It is requested, but not required, that you contact the authors of the -Document well before redistributing any large number of copies, to give -them a chance to provide you with an updated version of the Document. - - -4. MODIFICATIONS - -You may copy and distribute a Modified Version of the Document under -the conditions of sections 2 and 3 above, provided that you release -the Modified Version under precisely this License, with the Modified -Version filling the role of the Document, thus licensing distribution -and modification of the Modified Version to whoever possesses a copy -of it. In addition, you must do these things in the Modified Version: - -A. Use in the Title Page (and on the covers, if any) a title distinct - from that of the Document, and from those of previous versions - (which should, if there were any, be listed in the History section - of the Document). You may use the same title as a previous version - if the original publisher of that version gives permission. -B. List on the Title Page, as authors, one or more persons or entities - responsible for authorship of the modifications in the Modified - Version, together with at least five of the principal authors of the - Document (all of its principal authors, if it has less than five). -C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. -D. Preserve all the copyright notices of the Document. -E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. -F. Include, immediately after the copyright notices, a license notice - giving the public permission to use the Modified Version under the - terms of this License, in the form shown in the Addendum below. -G. Preserve in that license notice the full lists of Invariant Sections - and required Cover Texts given in the Document's license notice. -H. Include an unaltered copy of this License. -I. Preserve the section entitled "History", and its title, and add to - it an item stating at least the title, year, new authors, and - publisher of the Modified Version as given on the Title Page. If - there is no section entitled "History" in the Document, create one - stating the title, year, authors, and publisher of the Document as - given on its Title Page, then add an item describing the Modified - Version as stated in the previous sentence. -J. Preserve the network location, if any, given in the Document for - public access to a Transparent copy of the Document, and likewise - the network locations given in the Document for previous versions - it was based on. These may be placed in the "History" section. - You may omit a network location for a work that was published at - least four years before the Document itself, or if the original - publisher of the version it refers to gives permission. -K. In any section entitled "Acknowledgements" or "Dedications", - preserve the section's title, and preserve in the section all the - substance and tone of each of the contributor acknowledgements - and/or dedications given therein. -L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section titles. -M. Delete any section entitled "Endorsements". Such a section - may not be included in the Modified Version. -N. Do not retitle any existing section as "Endorsements" - or to conflict in title with any Invariant Section. - -If the Modified Version includes new front-matter sections or -appendices that qualify as Secondary Sections and contain no material -copied from the Document, you may at your option designate some or all -of these sections as invariant. To do this, add their titles to the -list of Invariant Sections in the Modified Version's license notice. -These titles must be distinct from any other section titles. - -You may add a section entitled "Endorsements", provided it contains -nothing but endorsements of your Modified Version by various -parties--for example, statements of peer review or that the text has -been approved by an organization as the authoritative definition of a -standard. - -You may add a passage of up to five words as a Front-Cover Text, and a -passage of up to 25 words as a Back-Cover Text, to the end of the list -of Cover Texts in the Modified Version. Only one passage of -Front-Cover Text and one of Back-Cover Text may be added by (or -through arrangements made by) any one entity. If the Document already -includes a cover text for the same cover, previously added by you or -by arrangement made by the same entity you are acting on behalf of, -you may not add another; but you may replace the old one, on explicit -permission from the previous publisher that added the old one. - -The author(s) and publisher(s) of the Document do not by this License -give permission to use their names for publicity for or to assert or -imply endorsement of any Modified Version. - - -5. COMBINING DOCUMENTS - -You may combine the Document with other documents released under this -License, under the terms defined in section 4 above for modified -versions, provided that you include in the combination all of the -Invariant Sections of all of the original documents, unmodified, and -list them all as Invariant Sections of your combined work in its -license notice. - -The combined work need only contain one copy of this License, and -multiple identical Invariant Sections may be replaced with a single -copy. If there are multiple Invariant Sections with the same name but -different contents, make the title of each such section unique by -adding at the end of it, in parentheses, the name of the original -author or publisher of that section if known, or else a unique number. -Make the same adjustment to the section titles in the list of -Invariant Sections in the license notice of the combined work. - -In the combination, you must combine any sections entitled "History" -in the various original documents, forming one section entitled -"History"; likewise combine any sections entitled "Acknowledgements", -and any sections entitled "Dedications". You must delete all sections -entitled "Endorsements." - - -6. COLLECTIONS OF DOCUMENTS - -You may make a collection consisting of the Document and other documents -released under this License, and replace the individual copies of this -License in the various documents with a single copy that is included in -the collection, provided that you follow the rules of this License for -verbatim copying of each of the documents in all other respects. - -You may extract a single document from such a collection, and distribute -it individually under this License, provided you insert a copy of this -License into the extracted document, and follow this License in all -other respects regarding verbatim copying of that document. - - -7. AGGREGATION WITH INDEPENDENT WORKS - -A compilation of the Document or its derivatives with other separate -and independent documents or works, in or on a volume of a storage or -distribution medium, does not as a whole count as a Modified Version -of the Document, provided no compilation copyright is claimed for the -compilation. Such a compilation is called an "aggregate", and this -License does not apply to the other self-contained works thus compiled -with the Document, on account of their being thus compiled, if they -are not themselves derivative works of the Document. - -If the Cover Text requirement of section 3 is applicable to these -copies of the Document, then if the Document is less than one quarter -of the entire aggregate, the Document's Cover Texts may be placed on -covers that surround only the Document within the aggregate. -Otherwise they must appear on covers around the whole aggregate. - - -8. TRANSLATION - -Translation is considered a kind of modification, so you may -distribute translations of the Document under the terms of section 4. -Replacing Invariant Sections with translations requires special -permission from their copyright holders, but you may include -translations of some or all Invariant Sections in addition to the -original versions of these Invariant Sections. You may include a -translation of this License provided that you also include the -original English version of this License. In case of a disagreement -between the translation and the original English version of this -License, the original English version will prevail. - - -9. TERMINATION - -You may not copy, modify, sublicense, or distribute the Document except -as expressly provided for under this License. Any other attempt to -copy, modify, sublicense or distribute the Document 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. - - -10. FUTURE REVISIONS OF THIS LICENSE - -The Free Software Foundation may publish new, revised versions -of the GNU Free Documentation 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. See -http://www.gnu.org/copyleft/. - -Each version of the License is given a distinguishing version number. -If the Document specifies that a particular numbered version of this -License "or any later version" applies to it, you have the option of -following the terms and conditions either of that specified version or -of any later version that has been published (not as a draft) by the -Free Software Foundation. If the Document does not specify a version -number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. - - -ADDENDUM: How to use this License for your documents - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and -license notices just after the title page: - - Copyright (c) YEAR YOUR NAME. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with the Invariant Sections being LIST THEIR TITLES, with the - Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. - A copy of the license is included in the section entitled "GNU - Free Documentation License". - -If you have no Invariant Sections, write "with no Invariant Sections" -instead of saying which ones are invariant. If you have no -Front-Cover Texts, write "no Front-Cover Texts" instead of -"Front-Cover Texts being LIST"; likewise for Back-Cover Texts. - -If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, -to permit their use in free software. diff --git a/glabels2/COPYING-LIBGLABELS b/glabels2/COPYING-LIBGLABELS deleted file mode 100644 index 161a3d1d..00000000 --- a/glabels2/COPYING-LIBGLABELS +++ /dev/null @@ -1,482 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: 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 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., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, 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! diff --git a/glabels2/COPYING.README_FIRST b/glabels2/COPYING.README_FIRST deleted file mode 100644 index 2d76f43e..00000000 --- a/glabels2/COPYING.README_FIRST +++ /dev/null @@ -1,28 +0,0 @@ - The gLabels official distribution is an aggregate of several components. - Each component is licensed as follows - - The gLabels application core, and other portions of the official gLabels - distribution not explicitly licensed otherwise, are licensed under - the GNU GENERAL PUBLIC LICENSE (GPL); either version 2 of the License, or - (at your option) any later version -- see the 'COPYING' file in this - directory for details. - - The libglabels library, located in the "libglabels/" subdirectory, is - licensed under the GNU LESSER GENERAL PUBLIC LICENSE (LGPL); either - version 2 of the License, or (at your option) any later version -- see - the 'COPYING-LIBGLABELS' in this directory for details. - - The gLabels and libglabels documentation, located in the "docs/" and "help/" - subdirectories, is licensed under the GNU FREE DOCUMENTATION LICENSE (GFDL) - with no Invariant Sections; either version 1.1 or (at your option) any - later version -- see 'COPYING-DOCS' in this directory for details. - - The "barcode-0.98/" and "iec16022-0.2.1/" subdirectories contain 3rd party - libraries, each licensed under the GNU GENERAL PUBLIC LICENSE (GPL); either - version 2 of the License, or (at your option) any later version -- see the - 'LICENSE' or 'COPYING' file in each of these directories for details. - - The XML files in the "data/templates/" subdirectory constitute the glabels - label database. This database is a simple collection of facts so it is - therefore considered to be public domain and can be used for any purpose. - diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog deleted file mode 100644 index eea2a733..00000000 --- a/glabels2/ChangeLog +++ /dev/null @@ -1,4289 +0,0 @@ -2009-04-29 Jim Evins - - * NEWS: - * configure.in: - * docs/libglabels/libglabels-decl-list.txt: - * gtk-doc.make: - * src/ui-commands.c: (gl_ui_cmd_help_about): - Prepare for 2.2.5 release. - -2009-04-29 Jim Evins - - * data/templates/avery-iso-templates.xml: - * data/templates/misc-iso-templates.xml: - * data/templates/misc-us-templates.xml: - Make sure new descriptions are marked translatable. - -2009-04-29 Jim Evins - - * data/templates/avery-iso-templates.xml: - * data/templates/misc-iso-templates.xml: - * data/templates/misc-us-templates.xml: - Caught up on user submitted templates. - * AUTHORS: - Acknowledgements for above templates. - -2009-04-29 Jim Evins - - * po/de.po: - Updated german translation (Mario Blättermann). - -2009-04-29 Jim Evins - - * src/color.c: (gl_color_to_gdk_color), (gl_color_from_gdk_color): - * src/mygal/widget-color-combo.c: (color_combo_new): - * src/object-editor.c: (gl_object_editor_construct_color_combo): - * src/ui-property-bar.c: (gl_ui_property_bar_construct_color_combo): - Bug #2760830. Display correct preview color in color combos when default - color selected. - -2009-04-28 Jim Evins - - * data/glade/object-editor.glade: - * data/glade/prefs-dialog.glade: - * data/glade/property-bar.glade: - * data/glade/template-designer.glade: - * src/wdgt-print-copies.c: (gl_wdgt_print_copies_construct), - (first_spin_cb), (last_spin_cb): - * src/wdgt-print-merge.c: (gl_wdgt_print_merge_construct): - Zero out adjustment->page_size for all spinbuttons. With gtk-2.14 this causes - many warning and with gtk-2.16 this actually breaks the spinbuttons. - -2009-01-07 Jim Evins - - * src/critical-error-handler.c: (critical_error_handler): - * src/ui-commands.c: (gl_ui_cmd_help_contents): - * src/warning-handler.c: (warning_handler): - * src/view.c: (selection_received_cb): - Compile without warning with additional CFLAGS of - -O1 -Wall -Wformat=2. - -2009-01-02 Jim Evins - - * COPYING.README_FIRST: - Fixed typo. - -2008-12-27 Jim Evins - - * data/templates/avery-iso-templates.xml: - * data/templates/avery-other-templates.xml: - * data/templates/avery-us-templates.xml: - * data/templates/brother-other-templates.xml: - * data/templates/misc-iso-templates.xml: - * data/templates/misc-other-templates.xml: - * data/templates/zweckform-iso-templates.xml: - Make sure all descriptions are marked as translatable. - -2008-12-27 Jim Evins - - * de.po: - Updated german translation (Mario Blättermann) - * AUTHORS: - Updated credits to reflect above translation. - * data/glade/object-editor.glade: - * data/glade/prefs-dialog.glade: - * data/glade/template-designer.glade: - Removed "translatable" attribute from whitespace strings, - which are used only to help layout. - -2008-12-22 Jim Evins - - * NEWS: - * configure.in: - Prepare for 2.2.4 release. - -2008-12-21 Jim Evins - - * data/templates/avery-us-templates.xml: - * data/templates/misc-iso-templates.xml: - A couple of recent template submissions. - * AUTHORS: - Acknowledgements for above templates. - -2008-12-21 Jim Evins - - * src/view.c: (motion_notify_event_cb), (button_press_event_cb): - Don't check for handles on aggregate selections. - -2008-12-18 Jim Evins - - * src/view.c: (selection_received_cb): - Fixed paste bug that caused a duplicate phantom view_object to be created for - each new label_object. This is because the view now (as of r673) the view - monitiors the label for new objects and creates view_objects automatically. - -2008-12-14 Jim Evins - - * po/POTFILES.in: - Bug #2395628. Reconciled POTFILES.in with current files. - -2008-12-14 Jim Evins - - * src/ui.c: (gl_ui_new): - Bug #2395628. Fixed i18n for application shell. - -2008-12-14 Jim Evins - - * configure.in: - Bug #2316013. Added PKG_PROG_PKG_CONFIG. - -2008-11-15 Jim Evins - - * libglabels/db.c: (lgl_db_register_template): - * libglabels/xml-template.c: - (lgl_xml_template_parse_template_node): - * src/glabels-batch.c: - * src/view-text.c: (gl_view_text_create_button_press_event): - Fixed several issues such as possible use of uninitialized variables found with "-O1 -Wall". - -2008-11-09 Jim Evins - - * data/templates/misc-iso-templates.xml: - Another user submitted template. - -2008-10-27 Jim Evins - - * data/templates/avery-us-templates.xml: - * data/templates/misc-iso-templates.xml: - * data/templates/zweckform-iso-templates.xml: - Caught up on user submitted templates. - * AUTHORS: - Acknowledgements for above templates. - -2008-10-23 Jim Evins - - * src/label-text.c: (set_font_family): - * src/object-editor-text-page.c: - (gl_object_editor_prepare_text_page), - (gl_object_editor_set_font_family): - * src/prefs-dialog.c: (construct_object_page), - (update_object_page_from_prefs): - * src/ui-property-bar.c: (gl_ui_property_bar_construct), - (reset_to_default_properties): - * src/util.c: (gl_util_get_font_family_list): - * src/util.h: - Bug #1902275 and Bug #2186214. Cache font list so that it is not re-created everytime - the list is requested. - * src/object-editor-text-page.c: (gl_object_editor_set_font_family): - Don't change font-family if it hasn't actually changed. - -2008-08-29 Jim Evins - - * src/file.c: (gl_file_open), (gl_file_save_as): - Bug #2069668. Corrected button order in Open and "Save as" - dialogs. - -2008-08-18 Jim Evins - - * NEWS: - * configure.in: - * docs/libglabels/tmpl/paper.sgml: - Prepare for 2.2.3 release. - -2008-08-17 Jim Evins - - * data/dtd/glabels-2.2.dtd: - * data/templates/paper-sizes.xml: - * libglabels/db.c: (lgl_db_init): - * libglabels/paper.c: (lgl_paper_new), (lgl_paper_dup), (lgl_paper_free): - * libglabels/paper.h: - * libglabels/xml-paper.c: (lgl_xml_paper_parse_paper_node): - * src/print-op.c: (set_page_size): - Bug #2049431. Always explicitely set page size. Added pwg_size field (PWG 5101.1-2002 - size specification) to the libglabels paper database to allow the page size to be - communicated to GtkPrintOp un-ambiguously. - -2008-07-25 Jim Evins - - * src/object-editor-size-page.c: (size_reset_cb), - (gl_object_editor_set_max_size): - Bug #1993550. Set size limits based on longest side of label. - -2008-07-19 Jim Evins - - * configure.in: - * src/mygal/Makefile.am: - Make sure libtool handles library dependencies for mygal - properly. - -2008-05-21 Jim Evins - - * src/glabels-batch.c: (main): - Bug #1968653. Initialize prefs subsystem. - -2008-05-09 Jim Evins - - * data/glade/object-editor.glade: - Bug #1959135. A couple of radio buttons somehow became - ungrouped. - -2008-04-04 Jim Evins - - * data/templates/brother-other-templates.xml: - Added categories to existing templates. - * data/templates/misc-other-templates.xml: - Moved dymo templates to their own file. - * data/templates/Makefile.am: - * data/templates/dymo-other-templates.xml: - Additional dymo templates provided by Harald Welte . - * AUTHORS: - Acknowledgement for above templates. - -2008-03-24 Jim Evins - - * src/xml-label.c: (xml_doc_to_label): - Bug #1872584. Don't refuse to parse label file if namespace is - unrecognized -- it may be from a newer version of glabels. - -2008-03-15 Jim Evins - - * data/templates/Makefile.am: - * data/templates/brother-other-templates.xml: - Added brother templates. - * src/cairo-markup-path.c: (gl_cairo_markup_margin_rect_path), - (gl_cairo_markup_margin_cd_path): - * src/view.c: (draw_markup_layer): - Fixed markup drawing errors when label is rotated. - -2008-03-03 Jim Evins - - * configure.in: - * ko.po: - Added korean translation provided by xein@naver.com. - -2008-02-21 Jim Evins - - * src/ui.c: - Last minute bug fix for 2.2.2 release. - Fixed typo that prevented "Save" from being deactivated when - document is not modified. - -2008-02-21 Jim Evins - - * NEWS: - * configure.in: - Prepare for 2.2.2 release. - -2008-02-18 Jim Evins - - * src/prefs-model.c: (gl_prefs_model_save_settings), - (gl_prefs_model_load_settings): - Set default units for file output. - -2008-02-18 Jim Evins - - * help/C/glabels.xml: - Fixed example template. - -2008-02-16 Jim Evins - - * AUTHORS: - * data/templates/avery-iso-templates.xml: - * data/templates/avery-us-templates.xml: - * data/templates/misc-iso-templates.xml: - * data/templates/misc-us-templates.xml: - Caught up on user submitted templates. - -2008-02-04 Jim Evins - - * src/view-image.c: (update_object_from_editor_cb): - Bug #1886438. Don't update the image size unless it is actually - triggered by a change in image source. The result of this bug - was that any attempt to edit the size spinboxes, immediately - reset the size. - -2008-02-03 Jim Evins - - * src/label-image.c: (gl_label_image_class_init), (set_size): - Enforce minimum size for images. - -2008-02-03 Jim Evins - - * src/object-editor-lsize-page.c: (gl_object_editor_set_max_lsize): - * src/object-editor-private.h: - * src/object-editor-shadow-page.c: - (gl_object_editor_set_max_shadow_offset): - * src/object-editor-size-page.c: (gl_object_editor_set_max_size): - * src/object-editor.c: (gl_object_editor_finalize), - (gl_object_editor_new), (gl_object_notebook_construct_valist), - (label_changed_cb): - * src/object-editor.h: - * src/ui-sidebar.c: (gl_ui_sidebar_construct): - * src/view-barcode.c: (construct_properties_editor): - * src/view-box.c: (construct_properties_editor): - * src/view-ellipse.c: (construct_properties_editor): - * src/view-image.c: (construct_properties_editor): - * src/view-line.c: (construct_properties_editor): - * src/view-object.c: (gl_view_object_finalize): - * src/view-text.c: (construct_properties_editor): - Move update_editor_from_label callback from individual view objects - to the object editor, so that signals can be disconnected when - object editor is finalized. - * src/view-text.c: (gl_view_text_create_button_press_event): - Fixed bug that caused multiple view objects to be created for a - single text object. This bug would manifest itself as a crash - when deleting multi-object selections which included text objects. - -2008-01-31 Jim Evins - - * src/label-barcode.c: (draw_object): - Fixed rendering problem when "Invalid data" is displayed when text - object is lower in stacking order. - -2008-01-30 Jim Evins - - * src/label-text.c: (get_size), (draw_object), (draw_shadow): - Don't turn off cairo_hint_metrics. This causes serious issues with - bitmap fonts. - -2008-01-29 Jim Evins - - * src/print-op.c: (gl_print_op_construct), - (gl_print_op_construct_batch), (set_page_size): - Explicitly set page size for "other" page sizes. - -2008-01-25 Jim Evins - - * src/bc.c: - Fixed Code128C backend parameters. - * src/label-barcode.c: (get_size): - Bug #1766425. If barcode is not renderable with either - input data or default data, use a default size. Also - fixed small leak. - -2008-01-22 Jim Evins - - * NEWS: - * configure.in: - Preparation for 2.2.1 release. - -2008-01-16 Jim Evins - - * src/print.c: (print_label): - Bug #1872568. Don't apply special transforms (rotate and - mirror) to clipping region or outline. - -2008-01-01 Jim Evins - - * src/util.c: - Sort font lists alphabetically. - -2008-01-01 Jim Evins - - * src/merge-evolution.c: - Do a case-insensitive sort. - -2008-01-01 Jim Evins - - * src/merge-evolution.c: - Sort evolution by "file_under" field. Original patch provided - by Peter Cherriman in - Patch #1860423. - * AUTHORS: - Added acknowledgement for above patch. - -2007-12-25 Jim Evins - - * glabels.spec.in: - Fix spec file. - -2007-12-25 Jim Evins - - * MESSAGE-OF-DOOM: - Removed for 2.2 stable branch. - * Makefile.am: - * NEWS: - * configure.in: - Prepare for 2.2.0 release. - -2007-12-21 Jim Evins - - * COPYING.LIBGLABELS: - * COPYING.README_FIRST: - * README: - Updating license information to make more complete and understandable. - -2007-12-16 Jim Evins - - * configure.in: - Updated version to 2.pre2. - * help/C/glabels.xml: - Updated documentation. - * src/ui-commands.c: (gl_ui_cmd_help_about): - Updated copyright string. - -2007-12-15 Jim Evins - - * data/glade/object-editor.glade: - Removed any GtkTable that contained a GtkComboBox because the size of - the combo box was not constrained properly. This sacrifices the nice - orderly labels for combo boxes that don't extend beyond the edge of the - window. - -2007-12-15 Jim Evins - - * libglabels/db.c: (lgl_db_lookup_template_from_name): - * src/object-editor.c: (gl_object_editor_finalize): - * src/wdgt-media-select.c: (gl_wdgt_media_select_finalize): - Fixed several small memory leaks. - -2007-12-14 Jim Evins - - * libglabels/db.c: - Optimize template search by name by using a GHashTable. - * src/mini-preview-pixbuf-cache.c: - * src/mini-preview-pixbuf-cache.h: - Store one pixbuf per template, but use a key for each alias. - * src/wdgt-media-select.c: - Optimize loading of tree data, thus optimizing the "new label" dialog. - -2007-12-12 Jim Evins - - * data/templates/avery-us-templates.xml: - More templates and aliases. - -2007-12-08 Jim Evins - - * TODO: - More prep for 2.1.5/2.2.0. - -2007-12-08 Jim Evins - - * NEWS: - * README: - * TODO: - * configure.in: - Preparation for 2.1.5. - -2007-12-08 Jim Evins - - * docs/libglabels/libglabels-decl-list.txt: - * docs/libglabels/libglabels-docs.sgml: - * docs/libglabels/libglabels-sections.txt: - * docs/libglabels/libglabels-undocumented.txt: - * docs/libglabels/tmpl/db.sgml: - * docs/libglabels/tmpl/str.sgml: - * libglabels/str.c: - Documentation cleanup for libglabels. - -2007-11-29 Jim Evins - - * libglabels/db.h: - * libglabels/db.c: - Added lgl_db_does_template_name_exist(). - In lgl_db_lookup_template_from_name() substitute brand/part of new template from - requested alias. - * src/prefs-model.c: - Proof read recent templates -- make sure they still exist. - * src/wdgt-media-select.c: - Default to "search all templates" tab if no recent templates found. - -2007-11-28 Jim Evins - - * data/glade/wdgt-media-select.glade: - * src/wdgt-media-select.c: - Added tabbed notebook to allow selection of recent template versus searching the - entire database. - - -2007-11-26 Jim Evins - - * libglabels/Makefile.am: - * libglabels/libglabels.h: - Make str.h public. - * src/label.c: - * src/prefs-dialog.c: - * src/prefs-model.c: - * src/prefs-model.h: - * src/prefs.c: - * src/prefs.h: - Added tracking of recently used templates. - -2007-11-20 Jim Evins - - * data/glade/template-designer.glade: - * src/template-designer.c: - Added warning icon when match brand and part match an existing template. - -2007-11-18 Jim Evins - - * libglabels/Makefile.am: - * libglabels/str.h: - * libglabels/str.c: - Added lgl_str_utf8_casecmp(). - * libglabels/libglabels-private.h: - Use lgl_str_utf8_casecmp() for UTF8_EQUAL macro -- do case insensitive comparisons. - * libglabels/db.c: (lgl_db_get_brand_list): - Use lgl_str_utf8_casecmp() to determine if we have seen brand before when building - brand list. - -2007-11-18 Jim Evins - - * data/glade/template-designer.glade: - * src/template-designer.c: - Don't advance past name page, if brand and part match an existing template. - -2007-11-18 Jim Evins - - * libglabels/db.c: (lgl_db_register_template), (read_templates): - When registering a new template, don't add to "User defined" category before - writing to file. Add to "User defined" category when reading from "~/.glabels" - directory instead. This will allow legacy templates (and manually created - templates) to be automatically added to the "user defined" category. - * libglabels/xml-template.c: - (lgl_xml_template_create_template_node): - Fixed typo/bug causing brand to be wrong. - -2007-11-16 Jim Evins - - * libglabels/db.c: - * libglabels/db.h: - Added return codes to lgl_db_register_template(). Added lgl_db_does_template_exist() - function. Automatically create "User defined" category and add to all user - registered templates. - * libglabels/xml-template.c: - * libglabels/xml-template.h: - Return number of bytes written from lgl_xml_template_write_templates_to_file() and - lgl_xml_template_write_template_to_file(). - * docs/libglabels/libglabels-decl-list.txt: - * docs/libglabels/libglabels-sections.txt: - * docs/libglabels/libglabels-undocumented.txt: - * docs/libglabels/tmpl/db.sgml: - * docs/libglabels/tmpl/xml-template.sgml: - Update documentation to reflect above changes. - -2007-10-28 Jim Evins - - * libglabels/xml-template.c: - Remove any leading white space from part #s when parsing old names. - * src/mini-preview-pixbuf-cache.c: - If name isn't in cache add it. - -2007-10-26 Jim Evins - - * libglabels/Makefile.am: - * libglabels/category.c: - * libglabels/category.h: - * libglabels/db.c: - * libglabels/db.h: - * libglabels/libglabels-private.h: - * libglabels/libglabels.h: - * libglabels/paper.c: - * libglabels/paper.h: - * libglabels/template.c: - * libglabels/template.h: - * libglabels/xml-template.c: - Another pass at screwing with the libglabels API. Moved all - database related stuff to db.[ch]. - * docs/libglabels/libglabels-decl-list.txt: - * docs/libglabels/libglabels-docs.sgml: - * docs/libglabels/libglabels-sections.txt: - * docs/libglabels/libglabels-undocumented.txt: - * docs/libglabels/tmpl/category.sgml: - * docs/libglabels/tmpl/db.sgml: - * docs/libglabels/tmpl/init.sgml: - * docs/libglabels/tmpl/libglabels-unused.sgml: - * docs/libglabels/tmpl/paper.sgml: - * docs/libglabels/tmpl/template-construction.sgml: - * docs/libglabels/tmpl/template-db.sgml: - * docs/libglabels/tmpl/template-misc.sgml: - * docs/libglabels/tmpl/template-struct.sgml: - * docs/libglabels/tmpl/template.sgml: - Updated documentation to reflect above changes to libglabels API. - * src/file.c: - * src/glabels-batch.c: - * src/glabels.c: - * src/mini-preview-pixbuf-cache.c: - * src/prefs-model.c: - * src/print.c: - * src/template-designer.c: - * src/wdgt-media-select.c: - * src/wdgt-mini-preview.c: - * src/wdgt-rotate-label.c: - * src/xml-label-04.c: - * src/xml-label.c: - Reconciled usage with above libglabels API changes. - -2007-10-21 Jim Evins - - * data/glade/wdgt-media-select.glade: - * src/wdgt-media-select.c: - Added brand to filter settings. - -2007-10-21 Jim Evins - - * data/dtd/glabels-2.2.dtd: - Forgot to replace Alias name attribute with brand and part attributes. - * data/templates/avery-iso-templates.xml: - * data/templates/avery-other-templates.xml: - * data/templates/avery-us-templates.xml: - * data/templates/misc-iso-templates.xml: - * data/templates/misc-other-templates.xml: - * data/templates/misc-us-templates.xml: - * data/templates/zweckform-iso-templates.xml: - Replaced all name attributes with brand/part attribute pairs. - -2007-10-20 Jim Evins - - * src/stock-pixmaps/*.png - Updated icons to use Tango color palette. - -2007-10-20 Jim Evins - - * data/dtd/Makefile.am: - * data/dtd/glabels-2.0.dtd: - * data/dtd/glabels-2.2.dtd: - Rename glabels-2.0.dtd to glabels-2.2.dtd. Added brand and part attributes to - template node. - * libglabels/template.c: - * libglabels/template.h: - * libglabels/xml-template.c: - * libglabels/xml.h: - Added brand and part attributes to template and alias structures and nodes. - * src/file.c: - * src/label.c: - * src/mini-preview-pixbuf-cache.c: - * src/template-designer.c: - * src/wdgt-media-select.c: - Use modified libglabels API. - * docs/libglabels/libglabels-decl-list.txt: - * docs/libglabels/libglabels-sections.txt: - * docs/libglabels/libglabels-undocumented.txt: - * docs/libglabels/tmpl/template-construction.sgml: - * docs/libglabels/tmpl/template-db.sgml: - * docs/libglabels/tmpl/template-struct.sgml: - Update libglabels documentation to reflect above modifications. - -2007-10-14 Jim Evins - - * docs/libglabels/libglabels-decl-list.txt: - * docs/libglabels/libglabels-sections.txt: - * docs/libglabels/libglabels-undocumented.txt: - * docs/libglabels/tmpl/category.sgml: - * libglabels/category.c: - * libglabels/category.h: - Added lgl_category_get_id_list() and lgl_category_free_id_list() to have - parity with paper functions. - -2007-10-12 Jim Evins - - * docs/libglabels/libglabels-decl-list.txt: - * docs/libglabels/libglabels-sections.txt: - * docs/libglabels/libglabels-undocumented.txt: - * docs/libglabels/tmpl/category.sgml: - * docs/libglabels/tmpl/enums.sgml: - * docs/libglabels/tmpl/libglabels-unused.sgml: - * docs/libglabels/tmpl/paper.sgml: - * docs/libglabels/tmpl/template-struct.sgml: - * libglabels/init.c: - * libglabels/template.c: - * libglabels/template.h: - Another pass at fleshing out the libglabels documentation. - * src/cairo-label-path.c: - * src/cairo-markup-path.c: - * src/label.c: - * src/mini-preview-pixbuf.c: - * src/print-op.c: - * src/print.c: - * src/view.c: - * src/wdgt-media-select.c: - * src/wdgt-mini-preview.c: - * src/wdgt-print-copies.c: - * src/wdgt-print-merge.c: - * src/wdgt-rotate-label.c: - Removed lgl_template_get_first_frame() from libglabels API and all references. - -2007-10-11 Jim Evins - * configure.in: - Extended checks for deprecated symbols. - * libglabels/template.c: - Removed g_strcasecmp references, which are deprecated. - -2007-10-09 Jim Evins - - * src/merge-evolution.c: - Create address book if it does not exist. Also, be more robust about handling - error conditions -- don't just assume GError has been set. - -2007-10-08 Jim Evins - - * libglabels/template.c: - * libglabels/xml-template.c: - * src/template-designer.c: - Missed some symbols with libglabels API work. - -2007-10-01 Jim Evins - - * docs/libglabels/libglabels-decl-list.txt: - * docs/libglabels/libglabels-docs.sgml: - * docs/libglabels/libglabels-sections.txt: - * docs/libglabels/libglabels-undocumented.txt: - * docs/libglabels/tmpl/category.sgml: - * docs/libglabels/tmpl/enums.sgml: - * docs/libglabels/tmpl/init.sgml: - * docs/libglabels/tmpl/libglabels-unused.sgml: - * docs/libglabels/tmpl/paper.sgml: - * docs/libglabels/tmpl/template-construction.sgml: - * docs/libglabels/tmpl/template-db.sgml: - * docs/libglabels/tmpl/template-misc.sgml: - * docs/libglabels/tmpl/template-struct.sgml: - * docs/libglabels/tmpl/template.sgml: - * docs/libglabels/tmpl/xml-category.sgml: - * docs/libglabels/tmpl/xml-template.sgml: - * libglabels/category.h: - * libglabels/init.c: - * libglabels/libglabels-private.h: - * libglabels/paper.h: - * libglabels/template.c: - * libglabels/template.h: - * libglabels/xml-template.h: - Basic documentation framework for libglabels updated. This still needs some - fleshing out. - -2007-09-27 Jim Evins - - * docs/libglabels/libglabels-decl-list.txt: - * docs/libglabels/libglabels-docs.sgml: - * docs/libglabels/libglabels-sections.txt: - * docs/libglabels/libglabels-undocumented.txt: - * docs/libglabels/tmpl/enums.sgml: - * docs/libglabels/tmpl/init.sgml: - * docs/libglabels/tmpl/libglabels-unused.sgml: - * docs/libglabels/tmpl/paper.sgml: - * docs/libglabels/tmpl/template.sgml: - * docs/libglabels/tmpl/xml-paper.sgml: - * docs/libglabels/tmpl/xml-template.sgml: - * docs/libglabels/tmpl/xml.sgml: - * libglabels/Makefile.am: - * libglabels/category.c: - * libglabels/category.h: - * libglabels/enums.h: - * libglabels/init.c: - * libglabels/init.h: - * libglabels/libglabels-private.h: - * libglabels/libglabels.h: - * libglabels/paper.c: - * libglabels/paper.h: - * libglabels/template.c: - * libglabels/template.h: - * libglabels/xml-category.c: - * libglabels/xml-category.h: - * libglabels/xml-paper.c: - * libglabels/xml-paper.h: - * libglabels/xml-template.c: - * libglabels/xml-template.h: - * libglabels/xml.c: - * libglabels/xml.h: - * src/cairo-label-path.c: - * src/cairo-label-path.h: - * src/cairo-markup-path.c: - * src/cairo-markup-path.h: - * src/file.c: - * src/glabels-batch.c: - * src/glabels.c: - * src/label-object.c: - * src/label.c: - * src/label.h: - * src/mini-preview-pixbuf-cache.c: - * src/mini-preview-pixbuf.c: - * src/mini-preview-pixbuf.h: - * src/prefs-dialog.c: - * src/prefs-model.c: - * src/prefs-model.h: - * src/prefs.c: - * src/prefs.h: - * src/print-op.c: - * src/print.c: - * src/template-designer.c: - * src/view-barcode.c: - * src/view-box.c: - * src/view-ellipse.c: - * src/view-image.c: - * src/view-line.c: - * src/view.c: - * src/wdgt-media-select.c: - * src/wdgt-mini-preview.c: - * src/wdgt-mini-preview.h: - * src/wdgt-print-copies.c: - * src/wdgt-print-merge.c: - * src/wdgt-rotate-label.c: - * src/xml-label-04.c: - * src/xml-label.c: - Major cleanup of libglabels API -- this breaks API compatibility with older - development and stable versions -- as far as I know, there are currently - no external users of this library yet. - -2007-09-14 Jim Evins - - * src/marshal.list: - * src/label.c: - * src/label.h: - * src/label-object.c: - * src/label-object.h: - * src/label-barcode.c: - * src/label-ellipse.c: - * src/view.c: - * src/view-object.c: - * src/view-barcode.c: - * src/view-box.c: - * src/view-ellipse.c: - * src/view-image.c: - * src/view-line.c: - * src/view-text.c: - Better separation of model from view. - -2007-08-21 Jim Evins - - * src/print-op.c: (create_custom_widget_cb): - Fix problem with force_outline_flag -- don't override with default. - -2007-08-21 Jim Evins - - * data/dtd/glabels-2.0.dtd: - * libglabels/template.c: - * libglabels/template.h: - * libglabels/xml-template.c: - * src/cairo-markup-path.c: - Added "Markup-rect" element to template format. - -2007-08-21 Jim Evins - - * configure.in: - Changed version to 2.1.pre5svn. - * src/view.c: (draw_markup_layer): - Do a stroke for each markup path, otherwise multiple markups - get connected. - -2007-08-17 Jim Evins - - * configure.in: - Bump libglabels revision numbers for 2.1.4 release. - -2007-08-16 Jim Evins - - * Makefile.am: - Include subdir iec16022-0.2.1. - * NEWS: - * configure.in: - * glabels.spec.in: - Preparation for 2.1.4. - - -2007-08-11 Jim Evins - - * po/POTFILES.in: - Updated file list. - * configure.in: - * po/eo.po: - Added Esperanto translation. Provided by Antonio C. - Codazzi "la Filozofo" . - * po/fr.po: - Updated French translation. Provided by Claude Paroz - . - * AUTHORS: - Updated to reflect above translations. - -2007-08-11 Jim Evins - - * AUTHORS: - * data/templates/avery-iso-templates.xml: - * data/templates/avery-us-templates.xml: - * data/templates/misc-iso-templates.xml: - * data/templates/misc-other-templates.xml: - * data/templates/misc-us-templates.xml: - * data/templates/zweckform-iso-templates.xml: - Caught up with backlog of template submissions. - -2007-08-10 Jim Evins - - * src/bc-postnet.c: (gl_barcode_postnet_new): - * src/bc.c: - Added support for Brazilian CEPNet barcodes. This is simply an - instance of the US POSTNET format with 8 digits. Patch supplied - by Mário Meyer in bug # 1768792. - * AUTHORS: - Updated acknowledgments to reflect above patch and recent shuffling - of underlying technology. - -2007-05-13 Jim Evins - - * src/merge-text.c: (parse_line), (parse_field): - Remove leading and trailing spaces from CSV fields, unless quoted. - -2007-05-09 Jim Evins - - * src/object-editor-bc-page.c: - * src/object-editor-data-page.c: - * src/object-editor-fill-page.c: - * src/object-editor-image-page.c: - * src/object-editor-line-page.c: - * src/object-editor-lsize-page.c: - * src/object-editor-position-page.c: - * src/object-editor-private.h: - * src/object-editor-shadow-page.c: - * src/object-editor-size-page.c: - * src/object-editor-text-page.c: - * src/object-editor.c: - * src/prefs-dialog.c: - * src/template-designer.c: - * src/ui-property-bar.c: - * src/wdgt-media-select.c: - Replaced signal block/unblock pairs with simple flags. This reduces - some code clutter, hopefully making it easier to read. - -2007-05-05 Jim Evins - - * src/template-designer.c: (apply_cb): - Add new template to mini-preview pixbuf cache. - -2007-05-03 Jim Evins - - * src/label-image.c: (gl_label_image_init), (draw_object): - Scale default pixbuf up, to prevent bluring. Use cairo_fill to - render image. - -2007-05-02 Jim Evins - - * src/view.c: (draw_select_region_layer), (motion_notify_event_cb), - (button_release_event_cb): - Removed attempt at rendering optimization by clipping the updates - to areas affected -- this actually seemed to hurt update performance. - -2007-04-30 Jim Evins - - * src/color.h: - * src/color.c: (gl_color_shadow), (gl_color_node_new_default), - (gl_color_node_equal), (gl_color_node_expand): - * src/label-barcode.c: (draw_object): - * src/label-box.c: (draw_object), (draw_shadow): - * src/label-ellipse.c: (draw_object), (draw_shadow): - * src/label-line.c: (draw_object), (draw_shadow): - * src/label-text.c: (draw_object), (draw_shadow): - * src/wdgt-mini-preview.c: (draw_shadow), (draw_labels): - * src/wdgt-rotate-label.c: (drawingarea_update): - Some cleanup to color related code. - -2007-04-30 Jim Evins - - * src/label.h: - Added glLabelRegion structure type. - * src/label-object.c: (gl_label_object_get_extent): - * src/label-object.h: - Modified gl_label_object_get_extent() to fill in a glLabelRegion struct. - * src/view.h: - * src/view.c: (gl_view_update_region), (draw_select_region_layer), - (gl_view_select_region), (gl_view_align_selection_left), - (gl_view_align_selection_right), (gl_view_align_selection_hcenter), - (gl_view_align_selection_top), (gl_view_align_selection_bottom), - (gl_view_align_selection_vcenter), - (gl_view_center_selection_horiz), (gl_view_center_selection_vert), - (gl_view_move_selection), (gl_view_can_selection_text), - (motion_notify_event_cb), (button_press_event_cb), - (button_release_event_cb): - - Reconcile with new gl_label_object_get_extent() API. - - Use glLabelRegion for view->select_region. - - Added gl_view_update_region() to clip updates to region. - - Use gl_view_update_region() during manipulation of view->select_region. - -2007-04-26 Jim Evins - - * src/mini-preview-pixbuf.c: (draw_paper), (draw_label_outlines), - (draw_label_outline): - * src/print.c: (print_crop_marks), (draw_outline): - * src/view-object.c: (gl_view_object_draw_handles): - * src/view.c: (draw_bg_layer), (draw_grid_layer), - (draw_markup_layer), (draw_fg_layer), (draw_select_region_layer): - * src/wdgt-mini-preview.c: (draw_paper), (draw_labels): - * src/wdgt-rotate-label.c: (drawingarea_update): - Added defines for various magic numbers. - -2007-04-25 Jim Evins - - * src/label-text.c: (get_size), (draw_object), (draw_shadow): - Scale text down. Cairo seems to render text too large. - -2007-04-25 Jim Evins - - * src/view.h: - * src/view.c: (gl_view_update), (expose_cb), - (motion_notify_event_cb), (button_press_event_cb), - (button_release_event_cb): - - Try not to let updates get backed up. - - Grab pointer when doing any drag operations. - -2007-04-11 Jim Evins - - * src/cairo-label-path.c: (gl_cairo_label_path), - (gl_cairo_rect_label_path), (gl_cairo_round_label_path), - (gl_cairo_cd_label_path): - * src/cairo-label-path.h: - * src/mini-preview-pixbuf.c: (draw_paper), (draw_label_outlines), - (draw_label_outline): - * src/print.c: (draw_outline), (clip_to_outline): - * src/view.c: (draw_bg_layer), (draw_fg_layer): - * src/wdgt-mini-preview.c: (draw_labels): - * src/wdgt-rotate-label.c: (drawingarea_update): - Modified to universally use gl_cairo_label_path() to create paths - for labels. Added shadow to mini preview in rotate widget. - -2007-04-10 Jim Evins - - * libglabels/template.h: - * libglabels/template.c: (gl_template_get_name_list_unique), - (gl_template_get_name_list_all), (gl_template_from_name): - Modified libglabels to allow you to get a list of all template names - including all aliases or just a list of primary names of each unique - template. - * src/Makefile.am: - * src/file.c: (gl_file_properties): - * src/glabels.c: (main): - * src/mini-preview-pixbuf-cache.h: - * src/mini-preview-pixbuf-cache.c: - * src/wdgt-media-select.c: (gl_wdgt_media_select_construct), - (filter_changed_cb), (load_list): - Added mini-preview pixbuf cache, so that only one mini-preview is - needed for a unique template and gets reused for all aliases. These - pixbufs will also live for the life of the program so they are not - rebuilt everytime a new label dialog is invoked. - * src/mini-preview-pixbuf.c: (draw_paper), - (draw_rect_label_outline), (draw_round_label_outline), - (draw_cd_label_outline): - Removed some comment artifacts. - -2007-04-04 Jim Evins - - * src/mini-preview-pixbuf.c: (gl_mini_preview_pixbuf_new), - (draw_paper), (draw_label_outlines), (draw_rect_label_outline), - (draw_round_label_outline), (draw_cd_label_outline): - * src/wdgt-media-select.c: (load_list): - * src/wdgt-rotate-label.c: (draw_cd_label_outline): - Cosmetic enhancments to mini previews. - -2007-04-04 Jim Evins - - * src/ui-property-bar.c: (gl_ui_property_bar_finalize), - (gl_ui_property_bar_construct): - Save copy of GladeXML tree so that we don't lose tooltips. - -2007-04-02 Jim Evins - - * src/merge-properties-dialog.c: - * src/new-label-dialog.c: - * src/object-editor.c: - * src/prefs-dialog.c: - * src/print-op.c: - * src/template-designer.c: - * src/ui-property-bar.c: - * src/wdgt-media-select.c: - * src/wdgt-rotate-label.c: - Fixed several memory leaks. - -2007-04-01 Jim Evins - - * src/label-text.c: (gl_label_text_init), (copy), - (gl_label_text_set_lines), (buffer_changed_cb), (get_size), - (set_font_family), (set_font_size), (set_font_weight), - (set_font_italic_flag), (set_text_alignment), - (set_text_line_spacing): - Cache object size, so that expensive extent calculations are only done - when needed. - -2007-03-30 Jim Evins - - * src/prefs-model.c: (gl_prefs_model_load_settings): - Default to an unlimited list of recent documents, since this parameter - seems to be pre-filter anyway. - -2007-03-30 Jim Evins - - * src/label-box.c: (draw_shadow): - * src/label-ellipse.c: (draw_shadow): - Added missing shadow fill. - -2007-03-28 Jim Evins - - * src/ui-commands.c: (gl_ui_cmd_file_print): - Unreferencing the print operation sometimes crashes. Just don't do it - right now. - -2007-03-28 Jim Evins - - * src/print-op.c: (gl_print_op_construct), - (gl_print_op_get_settings), (gl_print_op_set_settings), - (gl_print_op_free_settings), (create_custom_widget_cb): - * src/print-op.h: - * src/ui-commands.c: (gl_ui_cmd_file_print): - * src/window.c: (gl_window_init): - * src/window.h: - Save print settings and custom settings between print operations - on the same window. - -2007-03-24 Jim Evins - - * src/object-editor-image-page.c: - (gl_object_editor_prepare_image_page), - (gl_object_editor_set_image), (img_selection_changed_cb): - Workaround for GtkFileChooserButton bug # 327243. This the root - cause for gLabels bug # 1192884. I have actually observed 3 delayed - "selection-changed" signals -- the first 2 return NULL -- this is - what caused the image to reset to the default followed by setting - it back to the original image, trying to fit it into a new bounding - box. This sequence of events is much more evident with the new - cairo rendering. - -2007-03-23 Jim Evins - - Merged all changes from experimental cairo branch to trunk. - Trunk no longer depends on libgnomecanvas or libgnomeprint[ui]. - -2007-03-23 Jim Evins - - * src/label-object.h: - * src/label-object.c: (gl_label_object_class_init), - (gl_label_object_get_raw_size), (gl_label_object_get_size): - Created "get_raw_size" method. - * src/label-barcode.c: (get_size): - * src/xml-label.c: (xml_create_object_text), - (xml_create_object_barcode): - Use new "get_raw_size" method on label-objects when apropos. - * src/label-text.h: - * src/label-text.c: (get_size), (draw_object), (draw_shadow), - (auto_shrink_font_size): - Added "auto shrink" functionality back. - -2007-03-19 Jim Evins - - * src/label-text.c: (draw_object), (draw_shadow): - Don't use negative scales in workaround from previous commit. - - -2007-03-18 Jim Evins - - * src/xml-label.c: - Forgot to remove include of xml-lable-191 in previous commit. - * src/label-text.c: (get_size), (draw_object), (draw_shadow): - Workaround for pango Bug #341481. Render text at device scale, - and scale font size accordingly. Also, don't do any hinting. - -2007-03-18 Jim Evins - - * src/cairo-ellipse-path.c: - * src/cairo-ellipse-path.h: - Forgot to add these new files during last mass commit. - -2007-03-18 Jim Evins - - * src/Makefile.am: - * src/xml-label-191.c: - * src/xml-label-191.h: - Removed -- Very buggy. Version 1.91 is a very old "unstable" version, - so there is no need to keep compatability. - * src/base64.c: - * src/bc-iec16022.c: - * src/cairo-label-path.c: - * src/cairo-label-path.h: - * src/cairo-markup-path.c: - * src/color.c: - * src/debug.c: - * src/file.c: - * src/glabels-batch.c: - * src/glabels.c: - * src/label-barcode.c: - * src/label-box.c: - * src/label-ellipse.c: - * src/label-image.c: - * src/label-line.c: - * src/label-object.c: - * src/label-object.h: - * src/label-text.c: - * src/label.c: - * src/label.h: - * src/merge-properties-dialog.c: - * src/merge.c: - * src/new-label-dialog.c: - * src/object-editor-bc-page.c: - * src/object-editor-data-page.c: - * src/object-editor-edit-page.c: - * src/object-editor-fill-page.c: - * src/object-editor-image-page.c: - * src/object-editor-line-page.c: - * src/object-editor-private.h: - * src/object-editor-shadow-page.c: - * src/object-editor-text-page.c: - * src/object-editor.c: - * src/pixbuf-cache.c: - * src/print-op.c: - * src/print.c: - * src/recent.c: - * src/stock.c: - * src/template-designer.c: - * src/text-node.c: - * src/ui-property-bar.c: - * src/ui.c: - * src/view-barcode.c: - * src/view-box.c: - * src/view-ellipse.c: - * src/view-image.c: - * src/view-line.c: - * src/view-object.c: - * src/view-object.h: - * src/view-text.c: - * src/view.c: - * src/wdgt-media-select.c: - * src/wdgt-print-copies.c: - * src/wdgt-print-merge.c: - * src/window.c: - * src/xml-label-04.c: - * src/xml-label.c: - Many changes, including: - - Move draw methods from view-*() to label-*(). - - Use same drawing code for on screen view and printing. - - Fix all issues exposed with '-Wall -Werror'. - -2007-03-14 Jim Evins - - * src/Makefile.am: - * src/cairo-handle-path.c: - * src/cairo-handle-path.h: - * src/cairo-object-path.c: - * src/cairo-object-path.h: - Removed cairo-handle-path.[ch] and cairo-object-path.[ch]. - * src/view-barcode.c: (gl_view_barcode_class_init), (draw_object), - (object_at): - * src/view-box.c: (gl_view_box_class_init), (draw_object), - (draw_shadow), (object_at): - * src/view-ellipse.c: (gl_view_ellipse_class_init), - (create_ellipse_path), (draw_object), (draw_shadow), (object_at): - * src/view-image.c: (gl_view_image_class_init), (draw_object), - (object_at): - * src/view-line.c: (gl_view_line_class_init), (draw_object), - (draw_shadow), (object_at): - * src/view-object.c: (gl_view_object_draw), (gl_view_object_at), - (create_handle_path), (gl_view_object_draw_handles), - (gl_view_object_handle_at): - * src/view-object.h: - * src/view-text.c: (gl_view_text_class_init), (draw_object), - (draw_shadow), (object_at): - * src/view.c: (motion_notify_event_cb), (button_press_event_cb): - Some restructuring of new code. - -2007-03-12 Jim Evins - - * src/Makefile.am: - * src/cairo-object-path.c: - * src/view-barcode.c: - * src/view-barcode.h: - * src/view.c: - Added barcode object support to view. - -2007-03-12 Jim Evins - - * src/Makefile.am: - * src/view-text.h: - * src/view-text.c: - * src/view.c: - * src/cairo-object-path.c: - * src/cairo-object-path.h: - * src/view-box.c: - * src/view-ellipse.c: - * src/view-image.c: - * src/view-line.c: - * src/view-object.c: - * src/view-object.h: - Added text object support to view. Added object_at method to all - view_objects. - -2007-03-11 Jim Evins - - * src/Makefile.am: - * src/cairo-object-path.c: (gl_cairo_object_path), - (gl_cairo_image_object_path): - * src/view-image.c: (gl_view_image_class_init), - (gl_view_image_finalize), (gl_view_image_new), - (update_editor_from_label_cb), (draw), - (gl_view_image_get_create_cursor), - (gl_view_image_create_button_press_event), - (gl_view_image_create_motion_event), - (gl_view_image_create_button_release_event): - * src/view-image.h: - * src/view.c: (gl_view_construct), (gl_view_object_create_mode), - (selection_received_cb), (motion_notify_event_cb), - (button_press_event_cb), (button_release_event_cb): - Added image object support to view. - -2007-03-11 Jim Evins - - * src/Makefile.am: - * src/cairo-object-path.c: (gl_cairo_object_path), - (gl_cairo_line_object_path): - * src/view-line.c: (gl_view_line_class_init), (gl_view_line_new), - (update_object_from_editor_cb), (update_editor_from_object_cb), - (update_editor_from_label_cb), (draw), - (gl_view_line_get_create_cursor), - (gl_view_line_create_button_press_event), - (gl_view_line_create_motion_event), - (gl_view_line_create_button_release_event): - * src/view-line.h: - * src/view-object.c: (gl_view_object_resize_event): - * src/view.c: (gl_view_construct), (gl_view_object_create_mode), - (selection_received_cb), (motion_notify_event_cb), - (button_press_event_cb), (button_release_event_cb): - Added line object support to view. - * src/cairo-handle-path.c: - Made handles slightly larger. - - -2007-03-11 Jim Evins - - * src/Makefile.am: - * src/cairo-handle-path.c: - * src/cairo-label-path.c: (gl_cairo_rect_label_path), - (gl_cairo_round_label_path), (gl_cairo_cd_label_path): - * src/cairo-markup-path.c: (gl_cairo_markup_margin_rect_path), - (gl_cairo_markup_margin_round_path), - (gl_cairo_markup_margin_cd_path), (gl_cairo_markup_circle_path): - * src/cairo-object-path.c: (gl_cairo_object_path), - (gl_cairo_ellipse_object_path): - * src/label-object.c: (gl_label_object_rotate): - * src/view-box.c: - * src/view-box.h: - * src/view-ellipse.c: (gl_view_ellipse_class_init), - (gl_view_ellipse_new), (update_object_from_editor_cb), - (update_editor_from_object_cb), (update_editor_from_label_cb), - (draw), (gl_view_ellipse_get_create_cursor), - (gl_view_ellipse_create_button_press_event), - (gl_view_ellipse_create_motion_event), - (gl_view_ellipse_create_button_release_event): - * src/view-ellipse.h: - * src/view-object.c: - * src/view-object.h: - * src/view.c: (gl_view_construct), (gl_view_object_create_mode), - (select_object_real), (selection_received_cb), - (motion_notify_event_cb), (button_press_event_cb), - (button_release_event_cb): - * src/view.h: - Added ellipse object support to view. Plus other cleanup. - -2007-03-11 Jim Evins - - * src/view-box.h: - * src/view-box.c: (gl_view_box_get_create_cursor), - (gl_view_box_create_button_press_event), - (gl_view_box_create_motion_event), - (gl_view_box_create_button_release_event): - * src/view-object.c: (gl_view_object_set_view), - (gl_view_object_handle_at): - * src/view.h: - * src/view.c: (gl_view_arrow_mode), (gl_view_object_create_mode), - (motion_notify_event_cb), (button_press_event_cb), - (button_release_event_cb), (key_press_event_cb): - Added creation code for box object. - -2007-03-09 Jim Evins - - * src/view-object.c: (gl_view_object_resize_event): - * src/view-object.h: - * src/view.c: (motion_notify_event_cb): - Fix bugs with resizing transformed objects. - * src/cairo-handle-path.c: (gl_cairo_handle_path): - * src/cairo-object-path.c: (gl_cairo_object_path): - * src/cairo-object-path.h: - * src/label-object.c: (gl_label_object_init), - (gl_label_object_dup), (gl_label_object_get_extent), - (gl_label_object_flip_horiz), (gl_label_object_flip_vert), - (gl_label_object_rotate), (gl_label_object_set_matrix), - (gl_label_object_get_matrix): - * src/label-object.h: - * src/print.c: (draw_object): - * src/view-box.c: - * src/view-highlight.c: - * src/view-highlight.h: - * src/xml-label-191.c: (xml191_parse_object): - * src/xml-label.c: (xml_parse_affine_attrs), - (xml_create_affine_attrs): - Replace libart affine matrices with cairo matrices. - -2007-03-08 Jim Evins - - * src/view-object.h: - * src/view.c: (gl_view_update), (motion_notify_event_cb): - * src/view-object.c: (gl_view_object_handle_at), - (gl_view_object_resize_event): - Added resize code -- still a bit buggy. - -2007-03-07 Jim Evins - - * src/Makefile.am: - * src/cairo-handle-path.c: - * src/cairo-handle-path.h: - * src/view-box.c: (gl_view_box_new): - * src/view-object.c: (gl_view_object_set_object), - (gl_view_object_draw_handles), (gl_view_object_handle_at): - * src/view-object.h: - * src/view.c: (draw_highlight_layer), (select_object_real), - (unselect_object_real), (view_handle_at), (motion_notify_event_cb), - (button_press_event_cb), (button_release_event_cb), - (key_press_event_cb): - * src/view.h: - Added beginnings of object resize handles. - -2007-03-07 Jim Evins - - * src/view.h: - * src/view.c: (gl_view_init), (gl_view_arrow_mode), - (gl_view_object_create_mode), (motion_notify_event_cb), - (button_press_event_cb), (button_release_event_cb), - (key_press_event_cb): - Added move selection support. - -2007-03-05 Jim Evins - - * src/cairo-object-path.c: (gl_cairo_object_path): - * src/view-object.c: (gl_view_object_draw), - (gl_view_object_draw_highlight): - * src/view.c: (view_object_at), (motion_notify_event_cb), - (button_press_event_cb), (button_release_event_cb): - Additional refinements to select logic. - -2007-03-05 Jim Evins - - * src/view.h: - * src/view.c: (gl_view_init), (gl_view_construct), - (label_changed_cb), (draw_layers), (draw_select_region_layer), - (gl_view_select_region), (object_at), (motion_notify_event_cb), - (button_press_event_cb), (button_release_event_cb): - Added initial select region support and context menu. - -2007-03-04 Jim Evins - - * configure.in: - * src/Makefile.am: - * src/debug.c: - * src/debug.h: - * src/file.c: - * src/label.c: - * src/label.h: - * src/print-op.c: - * src/print.c: - * src/ui-commands.c: - * src/view-box.c: - * src/view-box.h: - * src/view-object.c: - * src/view-object.h: - * src/view.c: - * src/view.h: - * src/wdgt-print-copies.c: - * src/wdgt-print-merge.c: - * src/xml-label.c: - Initial port to a raw Cairo canvas. This removes all remaining - dependencies on libgnomecanvas and libgnomeprint[ui]. Basically - the view is becoming a canvas widget in its own right. Still needs - a lot of work. - * src/cairo-label-path.c: - * src/cairo-label-path.h: - * src/cairo-markup-path.c: - * src/cairo-markup-path.h: - * src/cairo-object-path.c: - * src/cairo-object-path.h: - New files to support cairo canvas. - * src/canvas-hacktext.c: - * src/canvas-hacktext.h: - Removed. - -2007-02-18 Jim Evins - - * src/bc.h: - GNOME_FONT_BOOK changed to PANGO_WEIGHT_NORMAL. - -2007-02-14 Jim Evins - - * src/base64.c: - * src/base64.h: - * src/bc-gnubarcode.c: - * src/bc-gnubarcode.h: - * src/bc-postnet.c: - * src/bc-postnet.h: - * src/bc.c: - * src/bc.h: - * src/canvas-hacktext.c: - * src/canvas-hacktext.h: - * src/debug.c: - * src/debug.h: - * src/file.c: - * src/file.h: - * src/glabels.c: - * src/hig.h: - * src/label-barcode.c: - * src/label-barcode.h: - * src/label-box.c: - * src/label-box.h: - * src/label-ellipse.c: - * src/label-ellipse.h: - * src/label-image.c: - * src/label-image.h: - * src/label-line.c: - * src/label-line.h: - * src/label-object.c: - * src/label-object.h: - * src/label-text.c: - * src/label-text.h: - * src/label.c: - * src/label.h: - * src/merge-evolution.c: - * src/merge-evolution.h: - * src/merge-init.c: - * src/merge-init.h: - * src/merge-properties-dialog.c: - * src/merge-properties-dialog.h: - * src/merge-text.c: - * src/merge-text.h: - * src/merge-vcard.c: - * src/merge-vcard.h: - * src/merge.c: - * src/merge.h: - * src/mini-preview-pixbuf.h: - * src/new-label-dialog.c: - * src/new-label-dialog.h: - * src/object-editor-bc-page.c: - * src/object-editor-data-page.c: - * src/object-editor-edit-page.c: - * src/object-editor-fill-page.c: - * src/object-editor-image-page.c: - * src/object-editor-line-page.c: - * src/object-editor-lsize-page.c: - * src/object-editor-position-page.c: - * src/object-editor-private.h: - * src/object-editor-size-page.c: - * src/object-editor-text-page.c: - * src/object-editor.c: - * src/object-editor.h: - * src/pixbuf-cache.c: - * src/pixbuf-cache.h: - * src/prefs-dialog.c: - * src/prefs-dialog.h: - * src/prefs-model.c: - * src/prefs-model.h: - * src/prefs.c: - * src/prefs.h: - * src/print-op.c: - * src/stock.c: - * src/stock.h: - * src/template-designer.c: - * src/text-node.c: - * src/text-node.h: - * src/ui-commands.c: - * src/ui-commands.h: - * src/ui-property-bar.c: - * src/ui-property-bar.h: - * src/ui-sidebar.c: - * src/ui-sidebar.h: - * src/ui-util.c: - * src/ui-util.h: - * src/ui.c: - * src/ui.h: - * src/util.c: - * src/util.h: - * src/view-barcode.c: - * src/view-barcode.h: - * src/view-box.c: - * src/view-box.h: - * src/view-ellipse.c: - * src/view-ellipse.h: - * src/view-highlight.c: - * src/view-highlight.h: - * src/view-image.c: - * src/view-image.h: - * src/view-line.c: - * src/view-line.h: - * src/view-object.c: - * src/view-object.h: - * src/view-text.c: - * src/view-text.h: - * src/view.c: - * src/view.h: - * src/wdgt-chain-button.c: - * src/wdgt-chain-button.h: - * src/wdgt-media-select.c: - * src/wdgt-mini-preview.c: - * src/wdgt-print-copies.c: - * src/wdgt-print-copies.h: - * src/wdgt-print-merge.c: - * src/wdgt-print-merge.h: - * src/wdgt-rotate-label.c: - * src/window.h: - * src/xml-label-04.c: - * src/xml-label-04.h: - * src/xml-label-191.c: - * src/xml-label-191.h: - * src/xml-label.c: - * src/xml-label.h: - - Assorted superficial cleanup. Including: - - Use G_DEFINE_TYPE for all objects. - - Reconcile style of all class initializer functions - - Reconcile style of all finalize functions - - Add emacs mode line to all source files - -2007-02-06 Jim Evins - -Assorted cleanup and removal of deprecated items. - - * src/splash.c: - * src/splash.h: - * src/Makefile.am: - Removed annoying splash screen. - * src/glabels-batch.c: (main): - * src/glabels.c: (main): - Converted from popt to GOption. - * src/object-editor-shadow-page.c: - (gl_object_editor_set_shadow_state): - Removed deprecated method on GtkToggleButton. - * src/ui-commands.c: (gl_ui_cmd_help_about): - Removed dependency on libgnomui/qnome-url.h. - * src/template-designer.c: - Removed dependency on libgnome/gnome-program.h. - - -2007-02-04 Jim Evins - - * src/color.c: - * src/color.h: - * src/prefs-model.c: - * src/print.c: (draw_text_object): - * src/wdgt-mini-preview.c: (gl_wdgt_mini_preview_construct): - Removed GnomeCanvas artifacts from color.[ch] and related modules. - -2007-02-04 Jim Evins - - * src/wdgt-mini-preview.c: - * src/wdgt-mini-preview.h: - Ported widget from GnomeCanvas to Cairo. - -2007-02-03 Jim Evins - - * data/glade/template-designer.glade: - * src/template-designer.c: - * src/template-designer.h: - Ported GnomeDruid to GtkAssistant. Since libglade does not - yet support the GtkAssistant and we derive directly from - the Assistant, the pages are layed out in a GtkNotebook in - the glade description -- we then append each page to the - assistant. - -2007-01-25 Jim Evins - - * data/glade/object-editor.glade: - Added dummy page to notebook, to prevent shadow page from - becoming the default current page at creation. - * src/view-box.c: (construct_properties_editor): - * src/view-ellipse.c: (construct_properties_editor): - * src/view-line.c: (construct_properties_editor): - * src/view-text.c: (construct_properties_editor): - Reconciled order of params. - -2007-01-19 Jim Evins - - * src/label-barcode.h: - * src/label-object.c: (gl_label_object_set_font_weight), - (gl_label_object_set_text_alignment), - (gl_label_object_get_font_weight), - (gl_label_object_get_text_alignment): - * src/label-object.h: - * src/label-text.c: (gl_label_text_instance_init), (copy), - (get_size), (set_font_family), (set_font_weight), - (set_text_alignment), (get_font_weight), (get_text_alignment): - * src/label-text.h: - * src/object-editor-text-page.c: - (gl_object_editor_prepare_text_page), - (gl_object_editor_set_font_family), - (gl_object_editor_set_font_weight), - (gl_object_editor_get_font_weight), - (gl_object_editor_set_text_alignment), - (gl_object_editor_get_text_alignment), - (gl_object_editor_set_text_color): - * src/object-editor.h: - * src/prefs-dialog.c: (construct_object_page), - (update_object_page_from_prefs), (update_prefs_from_object_page): - * src/prefs-model.c: (gl_prefs_model_save_settings), - (gl_prefs_model_load_settings): - * src/prefs-model.h: - * src/print.c: (draw_text_object): - * src/ui-property-bar.c: (gl_ui_property_bar_construct), - (reset_to_default_properties), (update_text_properties), - (font_bold_toggled_cb), (text_align_toggled_cb): - * src/ui-sidebar.c: - * src/util.c: (gl_util_align_to_string), (gl_util_string_to_align), - (gl_util_weight_to_string), (gl_util_string_to_weight), - (gl_util_get_font_family_list), (gl_util_font_family_list_free): - * src/util.h: - * src/view-text.c: (update_object_from_editor_cb), - (update_editor_from_object_cb), (draw_hacktext), (draw_cursor): - * src/view.c: (gl_view_set_selection_text_alignment), - (gl_view_set_default_text_alignment), - (gl_view_get_default_text_alignment): - * src/view.h: - * src/xml-label-04.c: (xml04_parse_text_props): - * src/xml-label-191.c: (xml191_parse_text_props): - * src/xml-label.c: (xml_parse_object_text), - (xml_parse_toplevel_span), (xml_create_object_text), - (xml_create_toplevel_span): - Converted all model internals to Pango. GnomeFont remains in - view until GnomeCanvas can be replaced with a cairo-based canvas. - -2007-01-17 Jim Evins - - * src/Makefile.am: - * src/hig.c: - Deleted hig.c. - * src/hig.h: - * src/wdgt-print-copies.c: (gl_wdgt_print_copies_get_type), - (gl_wdgt_print_copies_construct): - * src/wdgt-print-copies.h: - * src/wdgt-print-merge.c: (gl_wdgt_print_merge_get_type), - (gl_wdgt_print_merge_construct): - * src/wdgt-print-merge.h: - Removed all remaining HIG wrapper widgets. - -2007-01-16 Jim Evins - - * src/Makefile.am: - * src/print-dialog.c: - * src/print-dialog.h: - * src/print-op.c: - * src/print-op.h: - * src/template-designer.c: (print_test_cb): - * src/ui-commands.c: (gl_ui_cmd_file_print): - * src/print.c: - Renamed PrintDialog to PrintOp. Added constructor for batch - printing. - * src/glabels-batch.c: (main): - Converted to use new PrintOp object for printing. - -2007-01-15 Jim Evins - - * data/glade/Makefile.am: - * data/glade/print-custom-widget.glade: - * src/print-dialog.c: - * src/print-dialog.h: - * src/print.c: - * src/print.h: - * src/template-designer.c: (print_test_cb): - * src/ui-commands.c: (gl_ui_cmd_file_print): - * src/wdgt-print-merge.c: (gl_wdgt_print_merge_get_copies): - * src/wdgt-print-merge.h: - * src/window.c: (gl_window_init): - * src/window.h: - Initial conversion to GtkPrintOperation. - Still to do: - - Remove font and other libgnomeprint[ui] from elsewhere - - Add batch initialization of print operation - -2007-01-08 Jim Evins - * configure.in: - Updated dependencies. Set version to 2.1.pre4cvs. - -2007-01-03 Jim Evins - - * src/recent-files/* - Removed EggRecent stuff. - * configure.in: - * src/Makefile.am: - * src/file.c: - * src/recent.c: - * src/recent.h: - * src/ui-commands.c: - * src/ui-commands.h: - * src/ui.c: - Ported from EggRecent to GtkRecentManager. - - -2007-01-02 Jim Evins - - * configure.in: - * iec16022-0.2.1/BUGS: - * iec16022-0.2.1/CHANGELOG: - * iec16022-0.2.1/CREDITS: - * iec16022-0.2.1/INSTALL: - * iec16022-0.2.1/LICENSE: - * iec16022-0.2.1/Makefile.am: - * iec16022-0.2.1/Makefile.dist: - * iec16022-0.2.1/README: - * iec16022-0.2.1/README.glabels: - * iec16022-0.2.1/TODO: - * iec16022-0.2.1/iec16022.1: - * iec16022-0.2.1/iec16022.c: - * iec16022-0.2.1/iec16022ecc200.c: - * iec16022-0.2.1/iec16022ecc200.h: - * iec16022-0.2.1/image.c: - * iec16022-0.2.1/image.h: - * iec16022-0.2.1/reedsol.c: - * iec16022-0.2.1/reedsol.h: - * iec16022-0.2.1/test/testsuite-example.bin: - * iec16022-0.2.1/test/testsuite-example.eps: - * iec16022-0.2.1/test/testsuite-example.hex: - * iec16022-0.2.1/test/testsuite-example.png: - * iec16022-0.2.1/test/testsuite-example.text: - * iec16022-0.2.1/test/testsuite.sh: - Include modified copy of iec16022-0.2.1 to provide encoding - support for datamatrix 2D barcodes. - * src/Makefile.am: - * src/bc-iec16022.c: - * src/bc-iec16022.h: - * src/bc.c: - Added initial datamatrix 2D barcode backend to barcode code. - * INSTALL: - * gtk-doc.make: - Automatic updates to later versions of these files. - -2006-11-28 Jim Evins - - * data/templates/avery-iso-templates.xml: - * data/templates/avery-us-templates.xml: - * data/templates/categories.xml: - * data/templates/misc-iso-templates.xml: - * data/templates/misc-us-templates.xml: - * data/templates/zweckform-iso-templates.xml: - More categorization. - -2006-09-12 Jim Evins - - * data/dtd/glabels-2.0.dtd: - * data/templates/Makefile.am: - * data/templates/avery-iso-templates.xml: - * data/templates/avery-other-templates.xml: - * data/templates/avery-us-templates.xml: - * data/templates/categories.xml: - * data/templates/misc-iso-templates.xml: - * data/templates/misc-other-templates.xml: - * data/templates/zweckform-iso-templates.xml: - * data/glade/Makefile.am: - * data/glade/new-label-dialog.glade: - * data/glade/wdgt-media-select.glade: - * data/glade/wdgt-rotate-label.glade: - * libglabels/Makefile.am: - * libglabels/category.c: - * libglabels/category.h: - * libglabels/libglabels.h: - * libglabels/paper.c: - * libglabels/template.c: - * libglabels/template.h: - * libglabels/xml-category.c: - * libglabels/xml-category.h: - * libglabels/xml-template.c: - Added support for category meta data. - * src/Makefile.am: - * src/file.c: - * src/mini-preview-pixbuf.c: - * src/mini-preview-pixbuf.h: - * src/new-label-dialog.c: - * src/new-label-dialog.h: - * src/wdgt-media-select.c: - * src/wdgt-media-select.h: - * src/wdgt-rotate-label.c: - * src/wdgt-rotate-label.h: - New "new label" dialog. - -2006-05-27 Jim Evins - - * NEWS: - * autogen.sh: - * configure.in: - Preparation for 2.1.3. - * acinclude.m4: - * omf.make: - * xmldocs.make: - Removed. - -2006-05-22 Jim Evins - - * src/print.c: (draw_barcode_object): - Don't print "Invalid barcode data" if data field is empty. Patch provided - by Darren Warner . Fixes Bug #1479839. - * AUTHORS: - Added acknowledgment for above patch. - * src/bc-gnubarcode.c: (gl_barcode_gnubarcode_new): - * src/bc-postnet.c: (postnet_code): - Removed "Invalid barcode data" warnings from stderr. - * src/view-barcode.c: (draw_barcode): - Draw box around barcode extent if data empty or invalid. Center a - message whether the data is empty or invalid in box. - -2006-05-22 Jim Evins - - * src/print.c: (draw_text_object): - Check shadow state when printing text. - -2006-05-20 Jim Evins - - * src/ui-commands.c: (gl_ui_cmd_view_grid_toggle), - (gl_ui_cmd_view_markup_toggle): - Fixed crash when grid or markup have been toggled off during - a previous session. Bug #1434324. - -2006-04-05 Jim Evins - - * src/object-editor.c: (gl_object_editor_set_key_names): - Fixed potential crash when freeing empty key list. - -2006-03-11 Jim Evins - - * src/print.c: (draw_text_object): - * src/view-text.c: (gl_view_text_new), - (construct_properties_editor), (update_object_from_editor_cb), - (update_editor_from_object_cb), (update_editor_from_label_cb), - (draw_hacktext): - Added shadow support to text object. - -2006-02-18 Jim Evins - - * src/print.c: (draw_line_object): - * src/view-line.c: (gl_view_line_new), - (construct_properties_editor), (update_canvas_item_from_object_cb), - (update_object_from_editor_cb), (update_editor_from_object_cb), - (update_editor_from_label_cb): - Added shadow support to line object. - -2006-02-16 Jim Evins - - * src/view-box.c: - Comment changes. - * src/print.c: (draw_ellipse_object): - * src/view-ellipse.c: (gl_view_ellipse_new), - (construct_properties_editor), (update_canvas_item_from_object_cb), - (update_object_from_editor_cb), (update_editor_from_object_cb), - (update_editor_from_label_cb): - Added shadow support to ellipse object. - -2006-02-15 Jim Evins - - * src/label-object.c: - Changed default shadow offsets. - * src/view-box.c: (gl_view_box_new): - Simplified gl_view_box_new() so that is does not duplicate code - in update_canvas_item_from_object_cb(). - -2006-02-07 Jim Evins - - * data/glade/object-editor.glade: - Fixed color groups of color combos. - * src/color.h: - Added default shadow color. - * src/object-editor.c: (gl_object_editor_construct_color_combo): - Added shadow color group. - -2006-02-06 Jim Evins - - * src/object-editor-shadow-page.c: - Forgot to add this file. - * src/view-box.c: (gl_view_box_new), - (update_canvas_item_from_object_cb), (update_editor_from_label_cb): - Update limits on shadow offset spinbuttons. - -2006-01-19 Jim Evins - - * src/merge-evolution.c: (gl_merge_evolution_get_key_list): - Initialize key_list to NULL. - * data/glade/object-editor.glade: - * src/Makefile.am: - * src/color.c: - * src/color.h: - * src/label-object.c: - * src/label-object.h: - * src/object-editor-fill-page.c: - * src/object-editor-private.h: - * src/object-editor.c: - * src/object-editor.h: - * src/xml-label.c: - Created infrastructure for shadow support. - * src/view-box.c: - * src/print.c: - Initial shadow support in box object only. - -2006-01-05 Jim Evins - - * src/merge-properties-dialog.c: (src_changed_cb): - Be extra paranoid before calling strcmp(). - * src/merge.c: (gl_merge_set_src): - Don't make (merge == NULL) a critical error. - -2005-12-22 Jim Evins - - * src/glabels-batch.c: (main): - Compile warning free with gcc 4.0. - -2005-12-21 Jim Evins - - * glabels.spec.in: - Updated example RPM spec file. - -2005-12-21 Jim Evins - - * NEWS: - * configure.in: - Preparation for 2.1.2. - -2005-12-20 Jim Evins - - * src/Makefile.am: - Define unique G_LOG_DOMAIN for glabels. - * src/critical-error-handler.c: (gl_critical_error_handler_init): - * src/warning-handler.c: (gl_warning_handler_init), - (warning_handler): - Register for G_LOG_DOMAIN instead of NULL. - -2005-12-10 Jim Evins - - * src/merge-evolution.c: - * src/merge-vcard.c: - Fixed indentation. - -2005-12-08 Jim Evins - - * libglabels/paper.c: (read_paper_files_from_dir): - * libglabels/template.c: (gl_template_register), - (read_template_files_from_dir): - * libglabels/xml-paper.c: (gl_xml_paper_read_papers_from_file), - (gl_xml_paper_parse_papers_doc): - * libglabels/xml-template.c: - (gl_xml_template_read_templates_from_file), - (gl_xml_template_parse_templates_doc), - (gl_xml_template_parse_template_node), - (xml_parse_label_rectangle_node), (xml_parse_label_round_node), - (xml_parse_label_cd_node), (xml_parse_layout_node), - (xml_parse_markup_margin_node), (xml_parse_markup_line_node), - (xml_parse_markup_circle_node), - (gl_xml_template_write_templates_to_file), (xml_create_label_node): - * libglabels/xml.c: (gl_xml_get_prop_length): - Re-classified g_warnings to g_messages. - * src/Makefile.am: - * src/glabels.c: (main): - * src/warning-handler.c: (gl_warning_handler_init), - (warning_handler): - * src/warning-handler.h: - Added warning message handler to make sure the user is - presented with appropriate non-fatal errors. - * src/critical-error-handler.c: (critical_error_handler): - Changed exit to abort. - * src/bc-gnubarcode.c: (gl_barcode_gnubarcode_new), (render_pass1): - * src/bc-postnet.c: (postnet_code): - * src/bc.c: (id_to_index), (name_to_index): - * src/merge.c: (gl_merge_register_backend), (gl_merge_new): - * src/object-editor.c: (gl_object_notebook_construct_valist): - * src/prefs-dialog.c: (update_locale_page_from_prefs): - * src/prefs.c: (gl_prefs_get_units_per_point), - (gl_prefs_get_units_precision), (gl_prefs_get_units_step_size), - (gl_prefs_get_units_string): - * src/print.c: (draw_outline), (clip_to_outline), (clip_punchouts): - * src/splash.c: (gl_splash): - * src/ui-commands.c: (gl_ui_cmd_help_contents): - * src/view-highlight.c: (gl_view_highlight_new), - (highlight_resizable_box_construct), (object_changed_cb), - (view_scale_changed_cb): - * src/view.c: (draw_label_layer), (draw_bg_fg_layers), - (draw_markup_layer), (draw_markup_margin), - (gl_view_object_create_mode), (canvas_event), - (selection_received_cb): - * src/wdgt-mini-preview.c: (mini_outline_list_new): - * src/wdgt-rotate-label.c: (mini_preview_canvas_update): - * src/xml-label-04.c: (gl_xml_label_04_parse), - (xml04_parse_media_description), (xml04_parse_text_props), - (xml04_parse_barcode_props): - * src/xml-label-191.c: (gl_xml_label_191_parse), - (xml191_parse_objects), (xml191_parse_object), - (xml191_parse_text_props), (xml191_parse_image_props), - (xml191_parse_barcode_props), (xml191_parse_data), - (xml191_parse_sheet), (xml191_parse_label), (xml191_parse_layout), - (xml191_parse_markup): - * src/xml-label.c: (gl_xml_label_open), (gl_xml_label_open_buffer), - (xml_doc_to_label), (xml_parse_label), (xml_parse_objects), - (xml_parse_object_text), (xml_parse_object_image), - (xml_parse_object_barcode), (xml_parse_data), - (xml_parse_toplevel_span), (gl_xml_label_save), - (xml_create_objects): - Re-classified g_warnings to g_messages. - * src/merge-evolution.c: (gl_merge_evolution_open), - (gl_merge_evolution_close), (gl_merge_evolution_get_record): - Use g_warning to output errors encountered while - communicating with the evolution data server - instead of embedding them in the data. - -2005-12-08 Jim Evins - - * libglabels/libglabels-private.h: - Set G_LOG_DOMAIN - * libglabels/paper.c: (read_papers): - * libglabels/template.c: (read_templates): - Made appropriate warnings critical. - * src/Makefile.am: - * src/critical-error-handler.h: - * src/critical-error-handler.c: (gl_critical_error_handler_init), - (critical_error_handler): - Created critical error handler. - * src/glabels.c: (main): - Register critical error handler. - * src/merge-properties-dialog.c: (gl_merge_properties_dialog_init): - * src/object-editor.c: (gl_object_editor_init): - * src/prefs-dialog.c: (gl_prefs_dialog_init): - * src/template-designer.c: (gl_template_designer_init): - * src/ui-property-bar.c: (gl_ui_property_bar_instance_init): - Made appropriate warnings critical. - -2005-11-27 Jim Evins - - * src/merge-evolution.c: (gl_merge_evolution_get_key_list), - (gl_merge_evolution_get_primary_key), - (gl_merge_evolution_get_record): - Don't create "record_key" pseudo-key. Don't populate - fields with null data. - -2005-11-25 Jim Evins - - * src/merge-evolution.c: (gl_merge_evolution_finalize), - (gl_merge_evolution_get_key_list), (gl_merge_evolution_open), - (gl_merge_evolution_get_record), (gl_merge_evolution_copy), - (free_field_list): - Query EDS for all supported fields. Patch provided by - Austin Henry . - -2005-10-29 Jim Evins - - * src/glabels.c: (main): - * src/label-barcode.c: (gl_label_barcode_finalize): - * src/label-text.c: (gl_label_text_finalize), (set_font_family): - * src/label.c: (gl_label_instance_init), (gl_label_finalize): - * src/object-editor.c: (gl_object_editor_finalize): - Another pass at valgrinding -- plugged several memory leaks. - * src/view-text.c: (gl_view_text_new), - (update_canvas_item_from_object_cb), (draw_hacktext): - Commented out artifacts of edit-in-place code. - -2005-10-28 Jim Evins - - * src/canvas-hacktext.c: (gl_canvas_hacktext_set_arg): - Fixed use of uninitialized variable. Caught by - d binderman . - -2005-10-27 Jim Evins - - * src/merge-evolution.c: (gl_merge_evolution_get_record): - * src/merge-vcard.c: (gl_merge_vcard_get_record), - (parse_next_vcard): - Additional cleanup of EDS and vcard backends. Provided by - Austin Henry . - -2005-10-24 Jim Evins - - * AUTHORS: - * src/Makefile.am: - * src/merge-evolution.c: - * src/merge-evolution.h: - * src/merge-init.c: (gl_merge_init): - * src/merge-properties-dialog.c: (type_changed_cb): - * src/merge-vcard.c: - * src/merge-vcard.h: - * src/ui-commands.c: (gl_ui_cmd_help_about): - Added Evolution Data Server and VCard merge backends. Original patch - provided by Austin Henry . - * configure.in: - Only support EDS and VCard backends if libebook is installed. Allow - user to disable support, even if installed. - -2005-10-24 Jim Evins - - * AUTHORS: - * data/templates/avery-iso-templates.xml: - * data/templates/avery-us-templates.xml: - * data/templates/misc-iso-templates.xml: - * data/templates/zweckform-iso-templates.xml: - Collected all template changes and submissions since last - release. - -2005-10-23 Jim Evins - - * configure.in: - * data/mime/Makefile.am: - Added configure options to disable update-mime-database and - update-desktop-database as part of the install. Patch - provided by Leonardo Boshell (qhoracio@sourceforge.net). - -2005-10-23 Jim Evins - - * libglabels/xml.h: - * libglabels/xml.c: (gl_xml_get_prop_string), - (gl_xml_get_prop_i18n_string), (gl_xml_set_prop_string), - (gl_xml_is_node), (gl_xml_get_node_content): - Added new XML utility functions. - * libglabels/xml-paper.c: - * libglabels/xml-template.c: - * src/xml-label.c: - Cleanup by using new xml utilities created above. - * libglabels/paper.c: (gl_paper_free): - * src/file.c: (new_response): - * src/object-editor-image-page.c: (add_image_filters_to_chooser): - * src/pixbuf-cache.c: (gl_pixbuf_cache_add_pixbuf), - (gl_pixbuf_cache_get_pixbuf): - * src/ui-property-bar.c: - (gl_ui_property_bar_construct_color_combo): - * src/view-highlight.c: (gl_view_highlight_finalize): - * src/view-image.c: (update_object_from_editor_cb): - * src/view.c: (gl_view_finalize), (draw_bg_fg_layers), - (draw_bg_fg_rounded_rect), (draw_bg_fg_round), (draw_bg_fg_cd), - (draw_bg_fg_cd_bc), (draw_markup_layer), (draw_markup_margin), - (draw_markup_margin_rect), (draw_markup_margin_rounded_rect), - (draw_markup_margin_round), (draw_markup_margin_cd), - (draw_markup_margin_cd_bc): - * src/wdgt-mini-preview.c: (mini_outline_list_new): - * src/wdgt-rotate-label.c: (gl_wdgt_rotate_label_finalize): - Plugged various memory leaks located with valgrind. - * src/view-image.c: (update_canvas_item_from_object_cb): - Don't allow a width or height of zero when drawing pixbuf. - -2005-10-22 Jim Evins - - * libglabels/xml-paper.c: - * libglabels/xml-template.c: - * libglabels/xml.c: - * src/base64.c: - * src/bc-gnubarcode.c: - * src/canvas-hacktext.c: - * src/label-text.c: - * src/object-editor-data-page.c: - * src/print-dialog.c: - * src/print.c: - * src/recent.c: - * src/template-designer.c: - * src/text-node.c: - * src/ui-property-bar.c: - * src/ui.c: - * src/view-barcode.c: - * src/view-box.c: - * src/view-ellipse.c: - * src/view-image.c: - * src/view-line.c: - * src/view-text.c: - * src/view.c: - * src/wdgt-media-select.c: - * src/xml-label-04.c: - * src/xml-label-191.c: - * src/xml-label.c: - Modified to compile warning free with gcc-4.0. Mostly - casting to change signedness of characters. Did not - attack gnu-barcode library yet. - -2005-10-22 Jim Evins - - * src/glabels.c: (main): - * src/splash.c: (gl_splash): - Removed some small memory leaks. - * gtk-doc.make: - Added. - -2005-09-19 Jim Evins - - * data/glade/property-bar.glade: - Remove items from font_family_combo. This prevents the - double entry after adding text model and list of fonts. - * src/ui-property-bar.c: (reset_to_default_properties): - Free font_family_list. - -2005-07-01 Jim Evins - - * po/it.po: - Updated italian translation (Daniele Medri) - -2005-06-26 Jim Evins - - * docs/libglabels/libglabels-decl-list.txt: - Somehow never got checked in before. - * docs/libglabels/libglabels.types: - Removed -- don't need it afterall. - -2005-06-20 Jim Evins - - * NEWS: - Final prep for 2.1.1 release. - -2005-06-20 Jim Evins - - * configure.in: - Final preps for 2.1.1 release. - * docs/libglabels/libglabels.types: - Somehow never got checked in before. - * po/POTFILES.in: - Bring up-to-date with recent reorg of ui code. - - -2005-06-19 Jim Evins - - * src/template-designer.c: (construct_layout_page): - Removed attempt to match background color of mini preview widget to - background. - -2005-06-17 Jim Evins - - * help/C/figures/merge-ex2-4.png: - * help/C/glabels.xml: - Fixed spelling error. - -2005-06-13 Jim Evins - - * help/C/figures/merge-ex1-1.png: - * help/C/figures/merge-ex1-2.png: - * help/C/figures/merge-ex1-3.png: - * help/C/figures/merge-ex1-4.png: - * help/C/figures/merge-ex2-1.png: - * help/C/figures/merge-ex2-2.png: - * help/C/figures/merge-ex2-3.png: - * help/C/figures/merge-ex2-4.png: - Added figures for document merge tutorial. - * help/C/glabels.xml: - Added document merge tutorial. - -2005-05-19 Jim Evins - - * data/glade/merge-properties-dialog.glade: - Fixed irregular spacing. - * src/merge-properties-dialog.c: (gl_merge_properties_dialog_init), - (gl_merge_properties_dialog_construct): - Set outer padding and remove separator. - -2005-05-18 Jim Evins - - * src/hig.h: - * src/hig.c: - Removed glHigDialog class. - * src/file.c: (gl_file_new), (create_new_dialog_widgets), - (gl_file_properties), (create_properties_dialog_widgets): - * src/prefs-dialog.h: - * src/prefs-dialog.c: (gl_prefs_dialog_get_type), - (gl_prefs_dialog_init), (gl_prefs_dialog_construct): - * src/print-dialog.h: - * src/prefs-dialog.h: - * src/print-dialog.c: (gl_print_dialog_get_type), - (gl_print_dialog_init), (gl_print_dialog_construct): - Replaced all instances of glHigDialog with GtkDialog. - -2005-05-17 Jim Evins - - * src/hig.h: - * src/hig.c: - Removed HigAlert class since it is obsoleted by the GtkMessageDialog class. - * src/file.c: (open_response), (gl_file_open_real), (gl_file_save), - (save_as_response), (gl_file_close): - Replaced all instances of HigAlert widgets with GtkMessageDialog widgets. - -2005-05-15 Jim Evins - - * src/ui-commands.h: - * src/ui-util.c: - * src/ui-util.h: - * src/ui.c: - * src/ui.h: - * src/view.c: - * src/window.c: - * src/window.h: - A little code reformatting -- no functional changes. - -2005-05-14 Jim Evins - - * src/Makefile.am: - Removed obsolete macros. - * src/marshal.list: - Added marshalling template to support new view signal: "context_menu_activate." - * src/view.h: - * src/view.c: (gl_view_class_init), (gl_view_construct), - (canvas_event_arrow_mode): - - Removed hardcoded context menus and added new signal "context_menu_activate" - to push this up to the uimanager. - - Removed merge properties and print dialogs so that they can be managed with - the window by the uimanager. - * src/merge-properties-dialog.h: - * src/merge-properties-dialog.c: (gl_merge_properties_dialog_new), - (gl_merge_properties_dialog_construct): - Changed calling convention of gl_merge_properties_dialog_new() to use - glLabel and GtkWindow instead of view to make more consistent with other - dialogs. - * src/print-dialog.h: - * src/print-dialog.c: (gl_print_dialog_new), - (gl_print_dialog_construct): - Removed last artifact of libbonoboui. - * src/ui-commands.c: (gl_ui_cmd_file_print), - (gl_ui_cmd_objects_merge_properties), (gl_ui_cmd_help_about): - Reconciled style for launching dialogs. - * src/ui.c: (gl_ui_new): - Added context menus to ui manager. - * src/view-object.c: (item_event_arrow_mode): - No longer try to select objects with right-click. - * src/window.h: - * src/window.c: (gl_window_init), (gl_window_set_label), - (context_menu_activate_cb): - Context menus and all dialogs are now managed in a consistent way in window - by the ui manager. - -2005-05-11 Jim Evins - - * src/window.h: - * src/window.c: (gl_window_init), (gl_window_destroy): - * src/ui.c: (gl_ui_new), (gl_ui_unref), (recent_tooltip_func): - * src/ui-commands.c: (gl_ui_cmd_file_open_recent): - Moved management of recent_view back from window.c to ui.c -- it just feels - better there. - -2005-05-10 Jim Evins - - * src/window.h: - * src/window.c: (gl_window_init): - * src/ui.h: - * src/ui.c: (gl_ui_new), (connect_proxy_cb), (disconnect_proxy_cb), - (menu_item_select_cb), (menu_item_deselect_cb): - Added GtkStatusbar which displays menu tooltips. - -2005-05-09 Jim Evins - - Replaced libbonoboui with GtkUIManager for creation of basic user interface menus - and toolbars. - - * configure.in: - * glabels.spec.in: - Removed dependencies on libbonoboui. - * data/Makefile.am: - * data/ui/Makefile.am: - * data/ui/glabels-ui.xml: - Removed data/ui directory. - * data/glade/Makefile.am: - * data/property-bar.glade: - Added glade description of property-bar for new libglade implementation - of glUIPropertyBar. - * src/Makefile.am: - * src/commands.h: - * src/commands.c: - * src/tools.h: - * src/tools.c: - * src/ui-commands.h: - * src/ui-commands.c: - Replaced commands.[ch] and tools.[ch] with the single ui-commands.[ch] module - since the distinction between "commands" and "tools" is no longer that clear. - * src/file.h: - * src/file.c: - Modified to expect glWindow instead of GtkWindow. gl_file_open_recent() - no longer has knowledge of eggRecent*. - * src/glabels.c: (main): - Removed libbonobo initialization and replaced bonobo_main loop with gtk_main - loop. - * src/object-editor.c: (gl_object_editor_init): - Make sure notebook does not respond to a "show_all" on the parent. - * src/recent-files/Makefile.am: - * src/recent-files/*.[ch] - Updated from latest version of libegg which now has a view based on - GtkUIManager. Removed unused bonobo and gtk views. - * src/ui-property-bar.h: - * src/ui-property-bar.c: - New implementation based on libglade. - * src/ui-sidebar.h: - * src/ui-sidebar.c: - Sidebar is now simply a GtkWidget and does not expect to be a part of - a libbonoboui interface. - * src/ui-util.h: - * src/ui-util.c: - * src/ui.h: - * src/ui.c: - Converted for use with GtkUIManager. - * src/window.h: - * src/window.c: - Now derived from GtkWindow instead of BonoboWindow and uses GtkUIManager - to create menus and toolbars. - -2005-04-25 Jim Evins - - * data/templates/misc-iso-templates.xml: - Added Fellows 04715 template provided by Steve Saxon. - * AUTHORS: - Updated acknowledgement for above. - -2005-04-23 Jim Evins - - * src/util.c: (gl_util_combo_box_set_strings): - Make sure to clear model before loading a new list of strings. - * src/wdgt-media-select.h: - * src/wdgt-media-select.c: (gl_wdgt_media_select_instance_init), - (gl_wdgt_media_select_construct), (page_size_combo_changed_cb), - (template_combo_changed_cb), (prefs_changed_cb), - (gl_wdgt_media_select_get_name), (gl_wdgt_media_select_set_name), - (gl_wdgt_media_select_get_page_size), - (gl_wdgt_media_select_set_page_size): - Replaced the deprecated GtkCombo widget with the new - GtkComboBox. - -2005-04-21 Jim Evins - - * data/glade/template-designer.glade: - * src/template-designer.c: (construct_pg_size_page), - (pg_size_page_changed_cb), (build_template): - Replaced the deprecated GtkCombo widget with the new - GtkComboBox. - -2005-04-20 Jim Evins - - * data/glade/prefs-dialog.glade: - * src/prefs-dialog.c: (construct_object_page), - (update_object_page_from_prefs), (update_prefs_from_object_page): - Replaced the deprecated GtkCombo widget with the new - GtkComboBox. - -2005-04-19 Jim Evins - - * data/glade/object-editor.glade: - * src/object-editor-bc-page.c: (gl_object_editor_prepare_bc_page), - (style_changed_cb), (gl_object_editor_set_bc_style), - (gl_object_editor_get_bc_style), (gl_object_editor_set_bc_color), - (gl_object_editor_get_bc_color): - * src/object-editor-data-page.c: - (gl_object_editor_prepare_data_page), (gl_object_editor_set_data), - (gl_object_editor_get_data): - * src/object-editor-edit-page.c: - (gl_object_editor_prepare_edit_page), (insert_button_cb): - * src/object-editor-fill-page.c: - (gl_object_editor_prepare_fill_page), - (gl_object_editor_set_fill_color), - (gl_object_editor_get_fill_color): - * src/object-editor-image-page.c: - (gl_object_editor_prepare_image_page), - (gl_object_editor_set_image), (gl_object_editor_get_image): - * src/object-editor-line-page.c: - (gl_object_editor_prepare_line_page), - (gl_object_editor_set_line_color), - (gl_object_editor_get_line_color): - * src/object-editor-private.h: - * src/object-editor-text-page.c: - (gl_object_editor_prepare_text_page), - (gl_object_editor_set_font_family), - (gl_object_editor_get_font_family), - (gl_object_editor_set_text_color), - (gl_object_editor_get_text_color): - * src/object-editor.c: (gl_object_editor_set_key_names): - * src/ui-sidebar.c: - In the object editor: replaced all instances of the deprecated - GtkCombo widget with the new GtkComboBox. - -2005-04-18 Jim Evins - - * src/stock.c: - Neglected to save this one in previous checkin to support - header cleanup. - -2005-04-17 Jim Evins - - * libglabels/libglabels-private.h: - * libglabels/paper.c: - * libglabels/paper.h: - * libglabels/template.c: - * libglabels/template.h: - * libglabels/xml-paper.c: - * libglabels/xml-paper.h: - * libglabels/xml-template.c: - * libglabels/xml.c: - * libglabels/xml.h: - * src/base64.c: - * src/base64.h: - * src/bc-gnubarcode.c: - * src/bc-postnet.c: - * src/bc.c: - * src/bc.h: - * src/commands.c: - * src/debug.c: - * src/debug.h: - * src/file.c: - * src/file.h: - * src/hig.c: - * src/hig.h: - * src/label-barcode.c: - * src/label-box.c: - * src/label-ellipse.c: - * src/label-image.c: - * src/label-image.h: - * src/label-line.c: - * src/label-object.c: - * src/label-text.c: - * src/label-text.h: - * src/label.c: - * src/merge-properties-dialog.c: - * src/object-editor-bc-page.c: - * src/object-editor-data-page.c: - * src/object-editor-edit-page.c: - * src/object-editor-fill-page.c: - * src/object-editor-image-page.c: - * src/object-editor-line-page.c: - * src/object-editor-lsize-page.c: - * src/object-editor-position-page.c: - * src/object-editor-private.h: - * src/object-editor-size-page.c: - * src/object-editor-text-page.c: - * src/object-editor.c: - * src/object-editor.h: - * src/pixbuf-cache.h: - * src/prefs-dialog.c: - * src/prefs-dialog.h: - * src/prefs-model.c: - * src/prefs-model.h: - * src/prefs.c: - * src/print-dialog.c: - * src/print-dialog.h: - * src/print.c: - * src/print.h: - * src/recent.c: - * src/recent.h: - * src/splash.c: - * src/splash.h: - * src/stock.h: - * src/template-designer.c: - * src/template-designer.h: - * src/text-node.h: - * src/tools.c: - * src/ui-property-bar.c: (gl_ui_property_bar_construct): - * src/ui-sidebar.c: - * src/ui-util.c: - * src/ui.c: - * src/util.c: - * src/util.h: - * src/view-barcode.c: - * src/view-box.c: - * src/view-ellipse.c: - * src/view-highlight.c: - * src/view-highlight.h: - * src/view-image.c: - * src/view-line.c: - * src/view-object.c: - * src/view-object.h: - * src/view-text.c: - * src/view.c: - * src/view.h: - * src/wdgt-chain-button.c: - * src/wdgt-media-select.c: - * src/wdgt-media-select.h: - * src/wdgt-mini-preview.c: - * src/wdgt-mini-preview.h: - * src/wdgt-print-copies.c: - * src/wdgt-print-copies.h: - * src/wdgt-print-merge.c: - * src/wdgt-print-merge.h: - * src/wdgt-rotate-label.c: - * src/wdgt-rotate-label.h: - * src/window.c: - * src/window.h: - * src/xml-label-04.c: - * src/xml-label-191.c: - * src/xml-label.c: - Cleanup of header files: - - all header files are now stand-alone, verified by including - first in corresponding "c" files - - replaced blanket includes of gnome, gtk, and glib with - targetted includes - -2005-04-16 Jim Evins - - * data/glade/Makefile.am: - * data/glade/merge-properties-dialog.glade: - Added merge properties dialog glade description file. - * src/merge-properties-dialog.h: - * src/merge-properties-dialog.c: - (gl_merge_properties_dialog_get_type), - (gl_merge_properties_dialog_init), - (gl_merge_properties_dialog_finalize), - (gl_merge_properties_dialog_new), - (gl_merge_properties_dialog_construct), (type_changed_cb), - (src_changed_cb), (response_cb), (load_tree), - (record_select_toggled_cb), (select_all_button_clicked_cb), - (unselect_all_button_clicked_cb): - Modified merge properties dialog to use libglade. Added - "select all" and "unselect all" buttons. - * src/merge-text.c: (parse_line): - Handle empty lines better. - * src/merge.c: (gl_merge_eval_key): - Evaluate the key whether the record is selected or not. - * src/util.h: - * src/util.c: (gl_util_combo_box_add_text_model): - Since libglade does not use the gtk_combo_box_new_text() - constructor for GtkComboBoxes, a utility function was created - to add an appropriate text model to a GtkComboBox. - * src/view.c: (gl_view_edit_merge_props): - Removed unnecessary "show all's". - -2005-04-15 Jim Evins - - * po/ru.po: - Updated russian translation (Vitaly Lipatov) - * data/templates/misc-iso-templates.xml: - Added templates for russian business cards provided by Vitaly Lipatov. - * AUTHORS: - Updated acknowledgements for above. - -2005-04-15 Jim Evins - - * data/templates/avery-us-templates.xml: - Added Avery 5388 and 5389 templates provided by Peter L. Berghold. - * data/templates/misc-iso-templates.xml: - Added Ryman standard CD/DVD template, provided by Dan Clark. - * AUTHORS: - Added acknowledgements for above. - -2005-04-10 Jim Evins - - * libglabels/xml-paper.c: (gl_xml_paper_parse_paper_node): - * libglabels/xml-template.c: (gl_xml_template_parse_template_node), - (xml_parse_label_rectangle_node), (xml_parse_label_round_node), - (xml_parse_label_cd_node), (xml_parse_alias_node): - * libglabels/xml.c: (gl_xml_get_prop_double), - (gl_xml_get_prop_boolean), (gl_xml_get_prop_int), - (gl_xml_get_prop_uint), (gl_xml_get_prop_length): - * src/xml-label-04.c: (xml04_parse_media_description), - (xml04_parse_text_props), (xml04_parse_barcode_props), - (xml04_parse_merge_properties): - * src/xml-label-191.c: (xml191_parse_object), - (xml191_parse_text_props), (xml191_parse_barcode_props), - (xml191_parse_merge_fields), (xml191_parse_pixdata), - (xml191_parse_sheet), (xml191_parse_label), (xml191_parse_markup), - (xml191_parse_alias): - * src/xml-label.c: (xml_parse_object_text), - (xml_parse_object_barcode), (xml_parse_merge_fields), - (xml_parse_pixdata), (xml_parse_toplevel_span): - Make sure to use xmlFree for anything obtained from libxml - in case libxml and glib use different memory management - space. - -2005-04-08 Jim Evins - - * src/util.h: - * src/util.c: (gl_util_combo_box_set_strings), (search_text_func), - (gl_util_combo_box_set_active_text): - Added utility functions to simplify working with GtkComboBox - widgets in GTK-2.6. - * src/ui-property-bar.h: - * src/ui-property-bar.c: (gl_ui_property_bar_construct), - (reset_to_default_properties), (update_text_properties), - (font_family_changed_cb): - Replaced deprecated GtkCombo with GtkComboBox. - - -2005-04-03 Jim Evins - - * src/Makefile.am: - * src/wdgt-image-select.h: - * src/wdgt-image-select.c: - Removed obsolete wdgt-image-select.[ch] files. - * libglabels/paper.c: (gl_paper_dup): - Fixed rename of parameter introduced during documentation - updates. - * data/glade/object-editor.glade: - * src/object-editor-image-page.c: - (gl_object_editor_prepare_image_page), (img_radio_toggled_cb), - (gl_object_editor_set_image), (gl_object_editor_get_image), - (update_preview_cb), (add_image_filters_to_chooser): - * src/object-editor-private.h: - Replaced deprecated GnomePixmapEntry with - GtkFileChooserButton. - -2005-04-02 Jim Evins - - * src/mygal/mygal-combo-box.c: (deactivate_arrow), - (mygal_combo_box_popup_hide_unconditional), - (mygal_combo_box_popup_hide), (mygal_combo_box_popup_display), - (mygal_combo_toggle_pressed), (mygal_combo_box_init), - (mygal_combo_popup_tear_off), (mygal_combo_set_tearoff_state), - (mygal_combo_tearoff_bg_copy), (mygal_combo_popup_reparent), - (cb_tearable_button_release), (mygal_combo_box_set_tearable): - Renamed all internal gtk_combo functions to mygal_combo - to prevent namespace confusion. - -2005-04-02 Jim Evins - - * src/mygal/color-palette.c: (color_palette_change_custom_color), - (cust_color_set), (color_palette_setup): - * src/mygal/color-palette.h: - Replaced deprecated GnomeColorPicker with GtkColorButton. - -2005-04-02 Jim Evins - - * docs/libglabels/libglabels-sections.txt: - * docs/libglabels/libglabels-undocumented.txt: - * docs/libglabels/tmpl/enums.sgml: - * docs/libglabels/tmpl/paper.sgml: - * docs/libglabels/tmpl/xml-paper.sgml: - * docs/libglabels/tmpl/xml-template.sgml: - * libglabels/enums.h: - * libglabels/paper.c: (gl_paper_dup): - * libglabels/paper.h: - * libglabels/xml-paper.c: - * libglabels/xml-template.c: - More documentation updates for libglabels. - -2005-03-23 Jim Evins - - * INSTALL: - Automatically updated. - * Makefile.am: - * autogen.sh: - * configure.in: - * docs/Makefile.am: - * docs/libglabels/Makefile.am: - * docs/libglabels/libglabels-docs.sgml: - * docs/libglabels/libglabels-sections.txt: - * docs/libglabels/libglabels-undocumented.txt: - * docs/libglabels/tmpl/enums.sgml: - * docs/libglabels/tmpl/libglabels-unused.sgml: - * docs/libglabels/tmpl/libglabels.sgml: - * docs/libglabels/tmpl/paper.sgml: - * docs/libglabels/tmpl/template.sgml: - * docs/libglabels/tmpl/xml-paper.sgml: - * docs/libglabels/tmpl/xml-template.sgml: - * docs/libglabels/tmpl/xml.sgml: - Added basic gtk-doc stuff to support documenting libglabels - API. - * libglabels/xml.c: - Updated function comments with gtk-doc markup. - * missing: - Removed. - -2005-03-22 Jim Evins - - Since the development version now requires gtk-2.6/gnome-2.10, I - have made a first pass at removing deprecations. - - * configure.in: - * libglabels/Makefile.am: - * src/Makefile.am: - Added configure option to turn on X_DISABLE_DEPRECATED flags. - Also removed all remnants of HAVE_FILECHOOSER. - * src/file.c: (gl_file_open_real): - Removed code for old GtkFileSelection. - * libglabels/libglabels-private.h: - * libglabels/paper.c: - * libglabels/template.c: - * libglabels/xml-paper.c: - * libglabels/xml-template.c: - * libglabels/xml.c: - * src/bc.c: - * src/file.c: - * src/glabels-batch.c: - * src/glabels.c: - * src/label.c: - * src/merge-init.c: - * src/merge-properties-dialog.c: - * src/merge.c: - * src/object-editor.c: - * src/prefs-dialog.c: - * src/prefs.c: - * src/print-dialog.c: - * src/print.c: - * src/stock.c: - * src/template-designer.c: - * src/ui-property-bar.c: - * src/ui-sidebar.c: - * src/view-barcode.c: - * src/view-box.c: - * src/view-ellipse.c: - * src/view-image.c: - * src/view-line.c: - * src/view-text.c: - * src/view.c: - * src/wdgt-image-select.c: - * src/wdgt-media-select.c: - * src/wdgt-print-copies.c: - * src/wdgt-print-merge.c: - * src/wdgt-rotate-label.c: - * src/window.c: - * src/xml-label-04.c: - * src/xml-label-191.c: - * src/xml-label.c: - Added '#include " where needed. - Removed any unused '#include "s. - -2005-03-22 Jim Evins - - * src/commands.c: (activate_url), (gl_cmd_help_about): - Replaced GnomeAbout with GtkAboutDialog. Therefore the - development version of glabels now depends on GTK 2.6 and - GNOME 2.10. - * configure.in: - Updated library dependencies. - -2005-02-28 Jim Evins - - * AUTHORS: - * data/templates/misc-iso-templates.xml: - Added 'Ednet 45021' template provided by Ali Akcaagac - . - -2005-02-14 Jim Evins - - * data/templates/avery-us-templates.xml: - Updated templates to use inches instead of points. - * src/print-dialog.c: (printer_page_new): - Changed packing style when adding printer selector widget. This fixes - debian Bug#295274. - -2005-02-13 Jim Evins - - * AUTHORS: - * po/es.po: - Updated spanish translations. (sergio rivadero) - -2005-02-05 Jim Evins - - Some cleanup to libglabels. - - * configure.in: - Updated version to 2.1.1cvs. Added generation of libglabels.pc. - * libglabels/libglabels.pc.in - Created. - * libglabels/enums.h - Created. Currently only contains glUnitsType which provides enumerations - for all possible units of distance. - * libglabels/Makefile.am: - Incorporated new files enums.h and libglabels.pc[.in]. - * libglabels/libglabels.h: - Include enums.h. - * libglabels/template.h: - * libglabels/template.c: (gl_template_layout_new): - Changed parameters nx and ny to gint from gdouble. - * libglabels/xml.h: - * libglabels/xml.c: (gl_xml_get_prop_length), - (gl_xml_set_prop_length), (gl_xml_set_default_units): - Added support for different output units. - * src/prefs-dialog.c: (update_locale_page_from_prefs), - (update_prefs_from_locale_page): - * src/prefs-model.c: (string_to_units), (units_to_string): - * src/prefs-model.h: - * src/prefs.c: (gl_prefs_get_units_per_point), - (gl_prefs_get_units_precision), (gl_prefs_get_units_step_size), - (gl_prefs_get_units_string): - * src/prefs.h: - * src/wdgt-media-select.c: (details_update), (get_label_size_desc): - Reconciled all length enumerations with the new enumerations provided - in libglabels/enums.h. - -2005-02-03 Jim Evins - - * po/cs.po: - Updated Czech translations. (David Makovský and Zbynek Mrkvick) - * po/it.po: - Updated Italian translations. (Daniele Medri) - * AUTHORS: - Updated credits to reflect above translations. - - -2005-01-22 Jim Evins - - * MESSAGE-OF-DOOM: - Added. - * Makefile.am: - Added MESSAGE-OF-DOOM to EXTRA_DIST. - * NEWS: - Final prep for 2.1.0. - * configure.in: - Set version to 2.1.0. Output MESSAGE-OF-DOOM. - * glabels.spec.in: - Added '--remove-original' flag to desktop-file-install, so that there is - only one menu entry. - -2005-01-20 Jim Evins - - * data/glade/object-editor.glade: - - Font family entry should not be editable. - - img_key_entry should have sensitivity=YES, so that it follows the - sensitivity of img_key_combo. - -2005-01-19 Jim Evins - - * AUTHORS: - Give credit to Frederic Ruaudel for the color merge patches. - -2005-01-18 Frederic Ruaudel - - Add support to merge color for all other color attribute (Feature - Requests item #1008635. If the data is invalid, the color used is transparent - (GL_COLOR_NONE). The format for color in merge data file are those accepted - by gdk_color_parse() these include name for a color from rgb.txt, such as - DarkSlateGray, or a hex specification such as #305050. File format has been - changed but backward compatibility is preserved for all format. For - box/ellipse/line, keep attribute "line_color" for static color or replace by - "line_color_field" for merge data. For text/barcode objects, keep attribute - "color" for static color or replace by "color_field" for merge data. In the - edit canvas window, merged color are represented by half-transparent black - line/area. - - * data/dtd/glabels-2.0.dtd: - Added line_color_field to line_attrs. Added color_field to - Object-barcode and Span. - * data/glade/object-editor.glade: - Modify the layout of the editor to add merge possibility to color options - * src/color.c: - Fix a copy/paste error in a comment - * src/color.h: - Add default color for merge color representation in the editor canvas. - * src/label-barcode.c: - * src/object-editor-bc-page.c: - * src/view-barcode.c: - Add merge color support for barcode color. - * src/label-box.c: - * src/view-box.c: - Add merge color support for box border color. - * src/label-ellipse.c: - * src/view-ellipse.c: - Add merge color support for ellipse border color. - * src/label-line.c: - * src/view-line.c: - Add merge color support for line color. - * src/label-object.c: - * src/label-object.h: - * src/object-editor.c: - * src/object-editor.h: - * src/ui-property-bar.c: - * src/view.c: - * src/view.h: - * src/xml-label-04.c: - * src/xml-label-191.c: - Add support for merging to other color attribute. - * src/label-text.c: - * src/object-editor-text-page.c: - * src/view-text.c: - Add merge color support for text color. - * src/object-editor-fill-page.c: - Change a blocked handler that didn't match the good widget. Fix the type - of some debug message. - * src/object-editor-line-page.c: - Add merging support to line color option. - * src/object-editor-private.h: - Add variables for new widget. - * src/print.c: - Modify the draw functions to get merge data if needed. - * src/window.c: - Change the default size of the window in order to see all widget in the - "text style tab" of the editor. - * src/xml-label.c: - Modify the parser to record/retreive the field value for objects that need - "color" attribute. For box/ellipse/line, keep attribute "line_color" for - static color or replace by "line_color_field" for merge data. For - text/barcode objects, keep attribute "color" for static color or replace - by "color_field" for merge data. - -2005-01-17 Jim Evins - - * src/view.c: (screen_changed_cb): - Don't do anything if we don't have a screen. - -2005-01-06 Jim Evins - - * src/view.c: (get_home_scale): - Fixed bad call to gtk_widget_has_screen() -- huh?. - -2005-01-06 Jim Evins - - * data/dtd/glabels-2.0.dtd: - Added fill_color_field to fill_attrs. Also added xmlns attribute to all - top-level elements. - -2005-01-06 Jim Evins - - * data/glade/object-editor.glade: - Set entries for fill and data field key dropdowns to NOT editable. - * src/view-box.c: (construct_properties_editor): - * src/view-ellipse.c: (construct_properties_editor): - Update object editor when label's merge property has changed. - * src/xml-label.c: (xml_parse_object_ellipse): - Completed the merge color support for the ellipse item. - -2005-01-06 Frederic Ruaudel - - Add support to merge color for object that have a "Fill color" attribute (Feature - Requests item #1008635. If the data is invalid, the color used is transparent - (GL_COLOR_NONE). The format for color in merge data file are those accepted - by gdk_color_parse() these include name for a color from rgb.txt, such as - DarkSlateGray, or a hex specification such as #305050. File format has been - changed but backward compatibility is preserved for all format. For box/ellipse, - keep attribute "fill_color" for static color or replace by "fill_color_field" - for merge data. - - * data/glade/object-editor.glade: - Modify "Fill" tab to add the merge key combo and convert the labels into - radio button. - * src/color.h: - * src/color.c: - Add "glColorNode" structure and associated functions to manage it. This - structure is equivalent for color than the "glTextNode". It holds the color - and the key field. - * src/label-object.h: - * src/label-object.c: - * src/label-box.c: - * src/label-ellipse.c: - * src/ui-property-bar.c: - * src/view.h: - * src/view.c: - * src/view-box.c: - * src/view-ellipse.c: - * src/xml-label-04.c: - * src/xml-label-191.c: - Change functions of objects that have a "fill color" attribute to use the - new "glColorNode" structure. Use barcode code as example. - * src/Makefile.am: - Add the color.[ch] file to glabels_batch binary that now need support for - "glColorNode". - * src/object-editor.h: - * src/object-editor.c: - * src/object-editor-fill-page.c: - Manage the new widget of the editor's "Fill" tab : key combo and radio button - to choose between static color or merge key. Use barcode code as example. - * src/object-editor-private.h: - Add new widget in the "_glObjectEditorPrivate" structure. - * src/print.c: - Modify the draw functions to get merge data if needed. - * src/xml-label.c: - Modify the parser to record/retreive the field value for objects that need - "Fill color" attribute. For box/ellipse, put attribute "fill_color" for static - color or "fill_color_field" for merge data. - -2005-01-04 Jim Evins - - * AUTHORS: - * data/templates/avery-iso-templates.xml: - * data/templates/misc-iso-templates.xml: - * data/templates/misc-us-templates.xml: - Added templates, submitted by Larry Harriman, Juan Carlos Valero, and - Nick Hill. - -2004-11-26 Jim Evins - - * AUTHORS: - * po/fr.po: - Updated french translations provided by Florent Morel . - * src/view-barcode.c: - * src/view-box.c: - * src/view-ellipse.c: - * src/view-image.c: - * src/view-line.c: - * src/view-text.c: - Added '#include ' -- HAVE_*GETTEXT macros were not defined and - thus _() strings were not being translated. - -2004-11-14 Jim Evins - - * src/debug.h: - * src/debug.c: (gl_debug_init), (gl_debug): - Borrowed from gedit: use environmental variables to select debug - sections. - * src/splash.c: - Removed unused include of debug.h. - * src/glabels.c: (main): - Added call to gl_debug_init(), and removed debug clutter from command line - options. - * src/glabels-batch.c: (main): - Added call to gl_debug_init(). - -2004-11-13 Jim Evins - - Drawing and property toolbars were being initialized with the "icons and text" - look in Fedora Core 3. Even though none of the buttons had any text attached to - them, the buttons were being sized as if they were. This led to less real estate - for the property editor, leading to Bug #1064630. The - - * data/ui/glabels-ui.xml: - Added explicit "look" property to both drawing and property toolbars. - * src/prefs-model.c: (gl_prefs_model_save_settings), - (gl_prefs_model_load_settings): - * src/prefs-model.h: - Removed drawing_toolbar_button_style configuration parameter. - * src/ui.c: (view_menu_item_toggled_cb), - (set_app_drawing_toolbar_style): - Do not attempt to adjust look property of the drawing toolbar. - -2004-10-28 Jim Evins - - * data/pixmaps/glabels-about-logo.png: - Updated about logo. - -2004-10-28 Jim Evins - - * data/man/glabels.1: - * src/glabels-batch.c: (main): - * src/print.h: - * src/print.c: (gl_print_batch): - - Added option to glabels-batch to select the first label to begin - printing on. - -2004-09-26 Jim Evins - - * data/desktop/glabels.desktop.in: - Point to app icon, "glabels.png" - * data/mime/glabels.keys.in: - Point at mime icon, "glabels-application-x-glabels.png" - * data/pixmaps/Makefile.am: - Added glabels_app_icondir. Renamed icons. - * data/pixmaps/glabels.png: - New cleaned up app icon. Deleted glabels-icon.png. - * data/pixmaps/glabels-application-x-glabels.png: - New mime icon. - * data/pixmaps/glabels-splash.png: - Renamed glabels-logo to glabels-splash to be more correct about role. - * src/glabels.c: - * src/template-designer.c: - Point at app icon, "glabels.png" - * src/splash.c: - Point at renamed splash image, "glabels-splash.png" - -2004-08-22 Jim Evins - - * AUTHORS: - * src/glabels-batch.c: (main): - Applied patch with minor mods to allow selecting merge source and - crop-marks on glabels-batch's command line. Original patch provided by - José Dapena Paz . - -2004-08-15 Jim Evins - - * data/desktop/glabels.desktop.in: - - Added encoding line - - Removed period from comment - - Fixed Terminal line, changed "0" to "false" - - Added semicolen to Categories line - * po/ja.po: - - Made sure desktop.in comment string above still translated properly - -2004-08-14 Jim Evins - - * libglabels/xml-paper.c: (gl_xml_paper_parse_paper_node): - * libglabels/xml-template.c: (gl_xml_template_parse_template_node): - * src/xml-label-191.c: (xml191_parse_sheet): - Fixed improper freeing of gettext strings. Merged from 2.0.1. - * configure.in: - Reconciled libglabels versioning with 2.0.1. - - -2004-08-14 Jim Evins - - * configure.in: - Updated version to 2.1cvs. - -2004-08-14 Jim Evins - - * po/ja.po: - Updated 2.0.x translation by Takeshi AIHANA . - -2004-08-14 Jim Evins - - Fixes for Bug #1008181. - - * src/bc.c: (gl_barcode_default_digits): - Make a format of zero digits, harmless. - * src/xml-label.c: (xml_parse_object_barcode): - Set default value of the format property of barcode objects to 10, not - zero. This will prevent crashes when reading pre 2.0.x files. - -2004-08-09 Jim Evins - - * NEWS: - * TODO: - * help/C/glabels-C.omf: - * help/C/glabels.xml: - Brought documentation up-to-date for 2.0.0 release. - -2004-08-09 Jim Evins - - These are hopefully the final preparations for 2.0.0. - - * data/mime/Makefile.am: - Include glabels.xml in EXTRA_DIST. - * configure.in: - - Updated comment style. - - Added LIBGLABELS_VERSION_INFO macro, updated Current. - - Added package and version info to configuration printout - - Update version to 2.0.0 - * libglabels/Makefile.am: - Use the new LIBGLABELS_VERSION_INFO macro. - -2004-08-09 Jim Evins - - * configure.in: - * glabels.spec.in: - Cleanup of required library macros. - -2004-08-08 Jim Evins - - * glabels.spec.in: - - Updated URL - - More specific of what to install in /usr/bin and /usr/lib - - Remove built mime registration files from staging directory - -2004-08-08 Jim Evins - - * data/mime/Makefile.am: - Fixed typo: key_files should have been keys_files. - -2004-08-08 Jim Evins - - Reorganization of runtime data files. Also added registration of mimetype with - new freedesktop.org mime database if available. - - * data/* - Moved files to appropriate subdirectories, creating local Makefile.am - in each subdirectory. - - Moved paper-sizes.xml and *-templates.xml to templates subdirectory. - These are now installed at $datadir/glabels/templates. - - Moved glabels.1 to man subdirectory. - - Moved glabels-2.0.dtd to dtd subdirectory. - - Moved glabels.desktop.in to desktop subdirectory. - - Moved glabels.keys.in and glabels.mime to mime subdirectory. - * data/pixmaps/* - Moved "./pixmaps" to "./data/pixmaps" - * data/ui/* - Moved src/glabels-ui.xml to data/ui directory. Created Makefile.am. - * data/glade/* - Moved libglade files from src to data/glade. Created Makefile.am. - * Makefile.am: - Removed pixmaps from SUBDIRS. - * configure.in: - - Removed pixmaps from makefiles. - - Added makefiles for new subdirs of data. - - Added tests for freedesktop.org mime database. - * glabels.spec.in: - - Added tests for freedesktop.org mime database for post install and - post un-install actions. - * libglabels/Makefile.am: - Moved system template files to $(datadir)/glabels/templates. - * libglabels/libglabels-private.h: - Moved system template files to $(datadir)/glabels/templates. - * po/POTFILES.in: - - Accounted for movement of ui and libglade files. - - Added missing .in files. - - Reorganized by directory. - * src/Makefile.am: - Accounted for movement of ui and libglade files. - * data/mime/glabels.xml.in: - New file for registering with freedesktop.org mime database. - -2004-08-07 Jim Evins - - * src/recent-files/*: - Re-synced to latest libegg/recent-files. - -2004-08-07 Jim Evins - - * Makefile.am: - * configure.in: - * help/* - Renamed "./doc" directory to "./help" which contains user documentation, - to be more consistent with other GNOME applications. - - -2004-07-26 Jim Evins - - * src/merge-properties-dialog.c: (gl_merge_properties_dialog_init): - Corrected button order of merge properties dialog. - -2004-07-18 Jim Evins - - * data/glabels-2.0.dtd: - * src/bc.c: (gl_barcode_default_digits), (gl_barcode_can_freeform), - (gl_barcode_get_prefered_n): - * src/bc.h: - * src/label-barcode.c: (copy), (gl_label_barcode_set_props), - (gl_label_barcode_get_props), (get_size): - * src/label-barcode.h: - * src/object-editor-bc-page.c: (gl_object_editor_prepare_bc_page), - (style_changed_cb), (gl_object_editor_set_bc_style), - (gl_object_editor_get_bc_style): - * src/object-editor-data-page.c: (data_radio_toggled_cb), - (gl_object_editor_set_data), (gl_object_editor_get_data): - * src/object-editor-private.h: - * src/object-editor.c: (gl_object_editor_set_key_names): - * src/object-editor.glade: - * src/object-editor.h: - * src/print.c: (draw_barcode_object): - * src/view-barcode.c: (update_object_from_editor_cb), - (update_editor_from_object_cb), - (gl_view_barcode_create_event_handler), (draw_barcode): - * src/xml-label-04.c: (xml04_parse_barcode_props): - * src/xml-label-191.c: (xml191_parse_barcode_props): - * src/xml-label.c: (xml_parse_object_barcode), - (xml_create_object_barcode): - Added "format" attribute to barcode objects. This attribute is used - to properly format freeform barcodes barcodes prior to merge data is - applied, so that barcodes can be accurately layed out. This addresses - remaining issues of feature request #824787. Also added an example of - the format in the object editor. - -2004-07-12 Jim Evins - - Various code cleanups. - - * src/label-barcode.c: - Removed unneeded include of gnome-glyphlist.h. - - * src/label-text.c: (get_size): - Fixed memory leak: unref glyphlists when done with them. - - * src/object-editor-bc-page.c: (gl_object_editor_prepare_bc_page): - * src/object-editor-data-page.c: - (gl_object_editor_prepare_data_page): - * src/object-editor-image-page.c: - (gl_object_editor_prepare_image_page): - * src/object-editor-line-page.c: - (gl_object_editor_prepare_line_page): - * src/object-editor-lsize-page.c: - (gl_object_editor_prepare_lsize_page): - * src/object-editor-position-page.c: - (gl_object_editor_prepare_position_page): - * src/object-editor-size-page.c: - (gl_object_editor_prepare_size_page): - * src/object-editor-text-page.c: - (gl_object_editor_prepare_text_page): - Removed unneeded size groups, originally intended to keep widgets aligned. - Now use tables to lay these out in object-editor.glade. - - * src/print.c: (draw_text_object): - Fixed memory leak: unref glyphlists when done with them. - - * src/view-barcode.c: (draw_barcode): - Fixed memory leak: unref glyphlists when done with them. - - * src/view-text.c: (update_object_from_editor_cb), (draw_hacktext): - - Removed unneeded cast of gl_object_editor_get_text_line_spacing()s - return value. - - Fixed memory leak: unref glyphlists when done with them. - -2004-07-11 Jim Evins - - * data/glabels-2.0.dtd: - * src/label-text.c: (gl_label_text_instance_init), (copy), - (gl_label_text_set_auto_shrink), (gl_label_text_get_auto_shrink): - * src/label-text.h: - * src/object-editor-private.h: - * src/object-editor-text-page.c: - (gl_object_editor_prepare_text_page), - (gl_object_editor_set_text_auto_shrink), - (gl_object_editor_get_text_auto_shrink): - * src/object-editor.c: (gl_object_editor_set_key_names): - * src/object-editor.glade: - * src/object-editor.h: - * src/print.c: (draw_text_object): - * src/view-text.c: (update_object_from_editor_cb), - (update_editor_from_object_cb): - * src/xml-label.c: (xml_parse_object_text), - (xml_create_object_text): - Added option to allow document merge to auto shrink text size to fit - within the text box. The code in print.c that actually shrinks the - text is loosely based on a patch submitted by Mark Harrison - . This addresses feature request - #661421. - -2004-07-11 Jim Evins - - * data/glabels-2.0.dtd: - * libglabels/template.c: (gl_template_rect_label_type_new), - (gl_template_round_label_type_new), - (gl_template_cd_label_type_new), (gl_template_label_type_dup), - (template_full_page): - * libglabels/template.h: - * libglabels/xml-template.c: (xml_parse_label_rectangle_node), - (xml_create_label_node): - * pixmaps/ex-rect-size.png: - * src/print.c: (clip_to_outline), (clip_punchouts): - * src/template-designer.c: (construct_rect_size_page), - (rect_size_page_prepare_cb), (layout_page_prepare_cb), - (build_template): - * src/template-designer.glade: - * src/xml-label-191.c: (xml191_parse_label): - Modifications to allow separate horizontal (x_waste) and vertical (y_waste) - properties for rectangular labels. Templates remain backwards compatible, - but this breaks the libglabels API (I don't know of anyone outside of - glabels using libglabels at this time -- what can I say, the program is - is still "unstable"). This addresses the suggestion in Feature Request - #976313. - -2004-07-05 Jim Evins - * src/print.c: (print_crop_marks), (draw_outline): - Changed crop marks and label outlines to black, instead of 25% gray. - This addresses debian Bug #257460. - -2004-07-05 Jim Evins - - * src/object-editor-fill-page.c: (gl_object_editor_set_fill_color): - * src/object-editor-line-page.c: (gl_object_editor_set_line_color): - Preserve "is_default" of fill and line color_combos when creating from - existing objects. - -2004-07-02 Jim Evins - - * data/glabels.1: - Created man page. Based on page submitted by Matthew J. Lockner, however - it has been severely edited. - - * data/avery-other-templates.xml - * data/misc-other-templates.xml: - Started new files for predefined templates with non-standard sheet sizes. - These have been initially populated with the Avery 06141 and - OfficeMax #86112, both provided by Matthew J. Lockner. - - * data/Makefile.am: - Install above manpage and template files. - - * glabels.spec.in: - Make sure we install man pages. - - * src/glabels-batch.c: - Changed short form of help option to '-?' to be consistent with glabels. - - * AUTHORS: - Added acknowledgement for above labels. - -2004-07-02 Jim Evins - - * src/glabels.c: (main), (save_session_cb): - - Now include libbonoboui.h, recent.h, and file.h to provide missing - prototypes. - - save_session_cb() now returns gboolean. - - Minor formatting changes. - - * src/window.h: - * src/window.c: - - Now include file.h to provide missing prototype. - - gl_window_get_type() now returns GType, not guint. I believe this may - ultimately be cause of the segfault reported in Bug #982287, since - GType is actually a gulong, which may not be compatible on other - architectures (64bit) -- I cannot personally test this at this time. - I was sloppy in several other xxx_get_type() functions which also - returned guint -- see next group of files: - - * src/window.c: (gl_window_get_type): - * src/canvas-hacktext.c: (gl_canvas_hacktext_get_type): - * src/canvas-hacktext.h: - * src/hig.c: (gl_hig_alert_get_type), (gl_hig_dialog_get_type), - (gl_hig_category_get_type), (gl_hig_vbox_get_type), - (gl_hig_hbox_get_type): - * src/hig.h: - * src/label-barcode.c: (gl_label_barcode_get_type): - * src/label-barcode.h: - * src/label-box.c: (gl_label_box_get_type): - * src/label-box.h: - * src/label-ellipse.c: (gl_label_ellipse_get_type): - * src/label-ellipse.h: - * src/label-image.c: (gl_label_image_get_type): - * src/label-image.h: - * src/label-line.c: (gl_label_line_get_type): - * src/label-line.h: - * src/label-object.c: (gl_label_object_get_type): - * src/label-object.h: - * src/label-text.c: (gl_label_text_get_type): - * src/label-text.h: - * src/label.c: (gl_label_get_type): - * src/label.h: - * src/merge-properties-dialog.c: - (gl_merge_properties_dialog_get_type): - * src/merge-properties-dialog.h: - * src/merge-text.c: (gl_merge_text_get_type): - * src/merge-text.h: - * src/merge.c: (gl_merge_get_type): - * src/merge.h: - * src/object-editor.c: (gl_object_editor_get_type): - * src/prefs-dialog.c: (gl_prefs_dialog_get_type): - * src/prefs-dialog.h: - * src/prefs-model.c: (gl_prefs_model_get_type): - * src/prefs-model.h: - * src/print-dialog.c: (gl_print_dialog_get_type): - * src/print-dialog.h: - * src/template-designer.c: (gl_template_designer_get_type): - * src/template-designer.h: - * src/ui-property-bar.c: (gl_ui_property_bar_get_type): - * src/ui-property-bar.h: - * src/ui-sidebar.c: (gl_ui_sidebar_get_type): - * src/ui-sidebar.h: - * src/view-barcode.c: (gl_view_barcode_get_type): - * src/view-barcode.h: - * src/view-box.c: (gl_view_box_get_type): - * src/view-box.h: - * src/view-ellipse.c: (gl_view_ellipse_get_type): - * src/view-ellipse.h: - * src/view-highlight.c: (gl_view_highlight_get_type): - * src/view-highlight.h: - * src/view-image.c: (gl_view_image_get_type): - * src/view-image.h: - * src/view-line.c: (gl_view_line_get_type): - * src/view-line.h: - * src/view-object.c: (gl_view_object_get_type): - * src/view-object.h: - * src/view-text.c: (gl_view_text_get_type): - * src/view-text.h: - * src/view.c: (gl_view_get_type): - * src/view.h: - * src/wdgt-chain-button.c: (gl_wdgt_chain_button_get_type): - * src/wdgt-image-select.c: (gl_wdgt_image_select_get_type): - * src/wdgt-image-select.h: - * src/wdgt-media-select.c: (gl_wdgt_media_select_get_type): - * src/wdgt-media-select.h: - * src/wdgt-mini-preview.c: (gl_wdgt_mini_preview_get_type): - * src/wdgt-mini-preview.h: - * src/wdgt-print-copies.c: (gl_wdgt_print_copies_get_type): - * src/wdgt-print-copies.h: - * src/wdgt-print-merge.c: (gl_wdgt_print_merge_get_type): - * src/wdgt-print-merge.h: - * src/wdgt-rotate-label.c: (gl_wdgt_rotate_label_get_type): - * src/wdgt-rotate-label.h: - - Made sure all xxx_get_type functions returned GType, not guint. This - was the case in hig.[ch], window.[ch], ui-property-bar.[ch], - ui-sidebar.[ch], view.[ch], wdgt-image-select.[ch], - wdgt-media-select.[ch], wdgt-mini-preview.[ch], wdgt-print-copies.[ch], - wdt-print-merge.[ch], and wdgt-rotate-label.[ch]. See separate - window.[ch] details above for more info. - - Reconciled various coding style differences in all xxx_get_type() - functions: - * All prototypes include G_GNUC_CONST. - * All prototypes specify the return value as GType, not GtkType - or guint. - * Info structures are all declared as "static const." - * Generalized the names of type and info variables. - * Miscelaneous formatting. - -2004-06-08 Jim Evins - - * src/label.c: - * src/label.h: - * src/xml-label.c: - * AUTHORS: - Don't touch compression of original file -- still defaults to 9 for - new files. Original patch provided by Javier Donaire Segarra - (#912252 in patch tracker). - -2004-05-05 Jim Evins - - * data/glabels-2.0.dtd: - Broke DTD previously when adding new barcode types that contain a - plus sign (+). Simply changed the BC_STYLE_TYPE entity to "CDATA" - to avoid the problem. - * data/avery-iso-templates.xml: - * data/zweckform-iso-templates.xml: - * AUTHORS: - Added templates for Avery 7165, Zweckform 3688, 4732, and 6021. Templates - provided by Frank Altpeter. - * libglabels/xml-template.c: (xml_create_label_node): - Reordered markup and layout sub-nodes so that resulting templates will - validate against DTD. - -2004-03-13 Jim Evins - - * src/object-editor-size-page.c: (gl_object_editor_prepare_size_page): - Changed spin callback signals from "value-changed" back to "changed." - This was accidentally introduced in a previous revision, and can cause - size changes just by selecting the size tab. - -2004-03-06 Jim Evins - - * src/view.c: (draw_grid_layer): - For round labels (round and cd) adjust grid so that it lines up with - center of label. Also, no longer draw box around label in the grid layer, - it is hidden by he fg layer anyway. Feature suggested by - nemolivier@free.fr. Although the grid is aligned with the center of the - label, the coordinate system is still relative to the upper left corner - of the rectangle containing the label. - -2004-02-25 Jim Evins - - * configure.in: - Changed version to 2.0pre1cvs - - * libglabels/xml-template.c: (gl_xml_template_parse_templates_doc): - Removed extra xmlFreeDoc() calls upon error. Also print the doc->URL - instead of doc->name fields when errors encountered. - -2004-02-21 Jim Evins - - * data/avery-iso-templates.xml: - Added aliases for Avery 8651. Patch provided by Wayne Schuller. - - * glabels.spec.in: - Added libglabels library and include file to installed files. - - * configure.in: - Final prep for 1.93.3. - -2004-02-20 Jim Evins - - * src/glabels-batch.c: (main): - Changed key for setting output filename to GNOME_PRINT_KEY_OUTPUT_FILENAME - as suggested by Javier Donaire Segarra. This addresses bug #901063. - -2004-02-16 Jim Evins - - * configure.in: - If gtk+ >= 2.3.2 then define HAVE_FILE_CHOOSER. - - * src/Makefile.am: - Added HAVE_FILE_CHOOSER to INCLUDES. - - * src/file.c: (gl_file_open), (open_response), (gl_file_open_real), - (gl_file_save_as), (save_as_response): - Ported to use GtkFileChooserDialog if HAVE_FILE_CHOOSER is defined. - -2004-02-16 Jim Evins - - * src/xml-label-04.c: (xml04_parse_image_props): - * src/xml-label-191.c: (xml191_parse_image_props): - * src/xml-label.c: (xml_parse_object_image): - Delay setting image size until after image has been applied to new - object. - -2004-02-15 Jim Evins - - * src/label-barcode.c: (gl_label_barcode_set_data), - (gl_label_barcode_set_props): - Don't emit "changed" signal, if no change actually made for these - methods. Reduces number of unnecessary redraws of barcodes. - - * src/label-object.h: - * src/label-object.c: (gl_label_object_set_position), - (gl_label_object_set_position_relative), (set_size), - (gl_label_object_set_size), - (gl_label_object_set_size_honor_aspect): - Don't emit "changed" signal, if no change actually made for these - methods. - -2004-02-15 Jim Evins - - * data/glabels-2.0.dtd: - Added specific subtypes for various barcode types. - - * src/bc.h: - * src/bc.c: (id_to_index), (name_to_index), (gl_barcode_new), - (gl_barcode_get_styles_list), (gl_barcode_default_digits), - (gl_barcode_can_text), (gl_barcode_text_optional), - (gl_barcode_can_csum), (gl_barcode_csum_optional), - (gl_barcode_id_to_name), (gl_barcode_name_to_id): - Changed API to use a string id, rather than a fixed enumeration. Id and - name are separate strings. Added entries to backend table for specific - subtypes for various barcode types. - - * src/bc-postnet.h: - * src/bc-postnet.c: (gl_barcode_postnet_new), (postnet_code), - (is_length_valid): - Modified to conform to above API. Now more stringent with data length - for various subtypes. - - * src/bc-gnubarcode.h: - * src/bc-gnubarcode.c: (gl_barcode_gnubarcode_new), - (is_length_valid), (is_length1_valid), (is_length2_valid): - Modified to conform to above API. Now more stringent with data length - for various subtypes. - - * src/label-barcode.h: - * src/label-barcode.c: (copy), (gl_label_barcode_set_props), - (gl_label_barcode_get_props), (get_size): - Modified to use above API for storing barcode type. - - * src/object-editor.h: - * src/object-editor-bc-page.c: (style_changed_cb), - (gl_object_editor_set_bc_style), (gl_object_editor_get_bc_style): - Modified to use above API for storing barcode type. - - * src/object-editor-size-page.c: - (gl_object_editor_prepare_size_page), (aspect_toggle_cb), - (w_spin_cb), (h_spin_cb), (size_reset_cb): - Added debug markers. - - * src/object-editor.glade: - Made barcode style combo's text entry non-editable. - - * src/print.c: (draw_barcode_object): - Modified to use above API for barcode type. - - * src/view-barcode.c: (update_object_from_editor_cb), - (update_editor_from_object_cb), - (gl_view_barcode_create_event_handler), (draw_barcode): - Modified to use above API for barcode type. - - * src/xml-label-04.c: (xml04_parse_barcode_props): - * src/xml-label-191.c: (xml191_parse_barcode_props): - * src/xml-label.c: (xml_parse_object_barcode), - (xml_create_object_barcode): - Modified to use above API for barcode type. - -2004-02-07 Jim Evins - - * src/stock-pixmaps/Makefile.am: - * src/stock-pixmaps/stock_hchain_24.png: - * src/stock-pixmaps/stock_hchain_broken_24.png: - * src/stock-pixmaps/stock_vchain_24.png: - * src/stock-pixmaps/stock_vchain_broken_24.png: - Added chain pixmaps borrowed from the gimp's default theme. - - * src/stock.h: - * src/stock.c: (gl_stock_init), (add_button_icon): - Added above pixmaps to stock icon sets. Created add_button_icon() to - add these pixmaps sized as GTK_ICON_SIZE_BUTTON. - - * src/wdgt-chain-button.h - * src/wdgt-chain-button.c - * src/Makefile.am: - * po/POTFILES.in: - Added this Modified version of gimpchainbutton widget, borrowed from - the gimp. - - * AUTHORS: - Added acknowledgements of the above borrowing from the gimp. - - * src/object-editor-size-page.c: (aspect_toggle_cb), (w_spin_cb), - (h_spin_cb): - * src/object-editor.c: (gl_object_editor_construct_chain_button): - * src/object-editor.glade: - Replaced the keep aspect ratio check box with the above chain-button - widget. - - * src/text-node.c: (gl_text_node_equal): - * src/text-node.h: - Added function gl_text_node_equal() to compare text_nodes. - - * src/label-image.c: (gl_label_image_set_filename): - Replaced incomplete text_node comparison code with invocation of - gl_text_node_equal. This fixed the problem of not being able to - resize an image using the object_editor if the aspect ratio is not - locked. - -2004-02-04 Jim Evins - - * src/object-editor-image-page.c: - (gl_object_editor_prepare_image_page): - Track "changed" signal of pixmap entry's GtkEntry rather than its - "activate" signal -- this catches all changes to the entry rather than - just changes resulting from a browse, so one can easily pull previous - entries from the history. (This change is marked below on 2004-02-03, - but somehow never got checked in.) - - * src/view-highlight.c: (sl_resize_event_handler), - (sr_resize_event_handler), (st_resize_event_handler), - (sb_resize_event_handler): - Side resize handles will now confirm the actual resize that the object - accepted before adjusting position parameters. Previously some interesting - things happened when resizing a barcode to its minimum size. - -2004-02-03 Jim Evins - - * src/object-editor-image-page.c: - (gl_object_editor_prepare_image_page): - Track "changed" signal of pixmap entry's GtkEntry rather than its - "activate" signal -- this catches all changes to the entry rather than - just changes resulting from a browse, so one can easily pull previous - entries from the history. - - * src/view-highlight.c: (tl_resize_event_handler), - (tr_resize_event_handler), (bl_resize_event_handler), - (br_resize_event_handler): - Allow control key to be dropped while dragging a corner resize handle - without losing the aspect ratio lock. - -2004-02-02 Jim Evins - - * src/label-image.c: (gl_label_image_set_filename): - When setting a new filename adjust size such that the aspect ratio of - the image is preserved using the current size as a bounding box. - - * src/view-image.c: (update_object_from_editor_cb): - When updating object from editor, feed back possible size changes to - editor as a result of a possible change in image. - - * src/object-editor-size-page.c: (size_reset_cb): - Fixed typo when blocking spin handlers. If the base size is larger than - the max size, treat max size as a bounding box while keeping aspect - ratio. - - -2004-02-02 Jim Evins - - * src/label-object.h: - * src/label-object.c: (gl_label_object_set_size), - (gl_label_object_set_size_honor_aspect): - Added gl_label_object_set_size_honor_aspect() which will maintain the - current aspect ratio by modifying the supplied w or h apropriately. - - * src/view-highlight.c: (tl_resize_event_handler), - (tr_resize_event_handler), (bl_resize_event_handler), - (br_resize_event_handler): - Corner handles will now maintain the current aspect ratio if the - control key is pressed while resizing. This addresses feature - request #816603. - - -2004-01-31 Jim Evins - - * AUTHORS: - * data/avery-us-templates.xml: - Added entries for "LSK-3," "LSK-5," and "LSK-8." Submitted by JBadger. - - * libglabels/template.c: (read_template_files_from_dir): - Corrected problem with testing for extensions. - - * src/object-editor.glade: - Corrected grouping of radio buttons in barcode data page. - - * src/print.c: (draw_barcode_object): - * src/view-barcode.c: (draw_barcode): - Corrected problem with calculation of y_offset for locating characters. - -2004-01-24 Jim Evins - - * AUTHORS: - * data/avery-us-templates.xml: - Added Avery 5824, submitted by Fred Bacon. - -2004-01-20 Jim Evins - - Catching up on a couple of backlogged user template submissions. - - * data/avery-iso-templates.xml: - Added "DECAdry OLW-4731" and "DECAdry DLW-1731" aliases for Avery 7160. - Suggested by Linas Jakucionis. - - * data/zweckform-iso-templates.xml: - Added Zweckform 4760, submitted by Thomas Vill. - - * AUTHORS: - Updated to reflect above submissions. - -2004-01-06 Jim Evins - - Split-out template.[ch], paper.[ch], xml-template.[ch], xml-paper.[ch], and - xml.[ch] into a separate library called libglabels, to facilitate third - party use of glabels template files. This was suggested by Wayne Schuller. - Once split-out, some modifications to the structures and functions to - make a cleaner more useful API, hopefully. Rather extensive changes have - propogated to other modules. - - * src/paper.h: - * src/paper.c: - * src/template.h: - * src/template.c: - * src/xml-paper.h: - * src/xml-paper.c: - * src/xml-template.h: - * src/xml-template.c: - * src/xml.h: - * src/xml.c: - These files have been moved to libglabels/. API cleanup performed. - - * libglabels/libglabels.h: - * libglabels/libglabels-private.h: - * libglabels/Makefile.am: - These files have been added to finish out libglabels. - - * Makefile.am: - * configure.in: - * glabels.spec.in: - * po/POTFILES.in: - * src/Makefile.am: - Modified to reflect new sets of files in src/ and libglabels/. - - * COPYING.LIBGLABELS: - * COPYING-DOCS: - Added copy of the LGPL for libglabels, and a copy the GFDL for - documentation. - - * src/glabels-batch.c: - * src/glabels.c: - * src/label.c: (gl_label_finalize), (gl_label_set_template), - (gl_label_get_size): - * src/label.h: - * src/prefs-model.c: (gl_prefs_model_load_settings): - * src/print-dialog.c: - * src/print.c: (gl_print_simple), (gl_print_merge_collated), - (gl_print_merge_uncollated), (gl_print_batch), (print_info_free), - (print_crop_marks), (print_label), (draw_outline), - (clip_to_outline), (clip_punchouts): - * src/template-designer.c: (construct_pg_size_page), - (pg_size_page_changed_cb), (layout_page_changed_cb), - (print_test_cb), (build_template): - * src/util.c: (gl_util_fraction): - * src/util.h: - * src/view.c: (draw_bg_fg_layers), (draw_bg_fg_rect), - (draw_bg_fg_rounded_rect), (draw_bg_fg_round), (draw_bg_fg_cd), - (draw_bg_fg_cd_bc), (draw_markup_layer), (draw_markup_margin), - (draw_markup_margin_rect), (draw_markup_margin_rounded_rect), - (draw_markup_margin_round), (draw_markup_margin_cd), - (draw_markup_margin_cd_bc), (draw_markup_line), - (draw_markup_circle), (gl_view_copy): - * src/wdgt-media-select.c: (gl_wdgt_media_select_construct), - (page_size_entry_changed_cb), (details_update), (get_layout_desc), - (get_label_size_desc): - * src/wdgt-mini-preview.c: - (gl_wdgt_mini_preview_set_label_by_name), (mini_outline_list_new), - (cdbc_item): - * src/wdgt-print-copies.c: (gl_wdgt_print_copies_construct): - * src/wdgt-print-merge.c: (gl_wdgt_print_merge_construct): - * src/wdgt-rotate-label.c: (mini_preview_canvas_update), - (gl_wdgt_rotate_label_set_template_name), (cdbc_item): - * src/wdgt-rotate-label.h: - * src/xml-label-04.c: (xml04_parse_media_description): - * src/xml-label-191.c: (gl_xml_label_191_parse), - (xml191_parse_sheet), (xml191_parse_label), (xml191_parse_layout), - (xml191_parse_markup), (xml191_parse_alias): - * src/xml-label.c: (xml_doc_to_label), (xml_parse_label), - (xml_label_to_doc): - Various changes to accomodate new libglabels API. - -2004-01-03 Jim Evins - - * configure.in: - Release 1.93.2. - -2004-01-03 Jim Evins - - * AUTHORS: - Added acknowledgement of contributions by Wayne Schuller. - - * src/commands.c: (gl_cmd_file_print): - Create extra reference to print dialog, so that it can be properly re-used. - - * src/mygal/mygal-combo-box.h: - * src/mygal/mygal-combo-box.c: - (mygal_combo_box_popup_hide_unconditional), - (mygal_combo_box_popup_display), (mygal_combo_box_set_display), - (gtk_combo_set_tearoff_state), (mygal_combo_box_construct), - (mygal_combo_box_set_arrow_relief), (mygal_combo_box_set_title), - (mygal_combo_box_set_tearable): - Changed all occurances of GTK_IS_COMBO_BOX to MYGAL_IS_COMBO_BOX, to - complete the rename of this widget to prevent namespace collisions - with Gtk+-2.3. - - * src/prefs-dialog.glade: - Fixed alignment of Fill/Color widgets. - -2004-01-03 Jim Evins - - * data/avery-iso-templates.xml: - Added user submitted templates. - Avery 8435A & 8435B, submitted by Ludger Solbach. - - * doc/C/glabels.xml: - Added minimal documentation, noting the new template designer. - -2004-01-03 Jim Evins - - * pixmaps/ex-rect-size.png: - * pixmaps/ex-round-size.png: - * pixmaps/ex-cd-size.png: - * pixmaps/Makefile.am: - Added ex-rect-size.png, ex-round-size.png, and ex-cd-size.png image - files to be used as illustrations/examples in the template-designer. - - * src/template-designer.c: (construct_rect_size_page), - (construct_round_size_page), (construct_cd_size_page), - (construct_nlayouts_page), (rect_size_page_prepare_cb), - (round_size_page_prepare_cb), (cd_size_page_prepare_cb), - (layout_page_prepare_cb), (build_template): - * src/template-designer.glade: - Added illustrations for rectangle, round, and cd label size pages. - Added margin spinboxes to these pages, and now add a margin markup - to the constructed template. Added realistic default values for - some of the size spinboxes. Cleaned up the code for setting spinbox - ranges on the layouts page. - -2004-01-02 Jim Evins - - * src/object-editor-size-page.c: (h_spin_cb): - Fixed cut-n-paste error in h_spin_cb that loaded h from - the wrong spinbutton. - - * src/object-editor.h: - * src/object-editor.c: (gl_object_editor_class_init), - (gl_object_editor_changed_cb), (gl_object_editor_size_changed_cb): - * src/object-editor-private.h: - * src/object-editor-size-page.c: (w_spin_cb), (h_spin_cb), - (size_reset_cb): - Added "size_changed" signal. - - * src/view-text.c: (construct_properties_editor), - (update_object_from_editor_cb), - (update_object_from_editor_size_cb): - Track size changes from object editor separately from other - properties. This is so the default size (0,0) of a text - object is not modified unintentionally. - -2003-12-30 Wayne Schuller - - Added feature: line spacing - allows you to comfortably space a text box to - fit a label perfectly. - - * data/glabels-2.0.dtd: - * src/label-object.c: (gl_label_object_set_text_line_spacing), - (gl_label_object_get_text_alignment), - (gl_label_object_get_text_line_spacing): - * src/label-object.h: - * src/label-text.c: (gl_label_text_class_init), - (gl_label_text_instance_init), (copy), (get_size), - (set_text_line_spacing), (get_text_alignment), - (get_text_line_spacing): - * src/object-editor-private.h: - * src/object-editor-text-page.c: - (gl_object_editor_prepare_text_page), - (gl_object_editor_set_text_line_spacing), - (gl_object_editor_get_text_line_spacing): - * src/object-editor.glade: - * src/object-editor.h: - * src/prefs-dialog.c: (construct_object_page), - (update_object_page_from_prefs), (update_prefs_from_object_page): - * src/prefs-dialog.glade: - * src/prefs-model.c: (gl_prefs_model_save_settings), - (gl_prefs_model_load_settings), (get_float): - * src/prefs-model.h: - * src/print.c: (draw_text_object): - * src/ui-sidebar.c: - * src/view-text.c: (update_object_from_editor_cb), - (update_editor_from_object_cb), - (gl_view_text_create_event_handler), (draw_hacktext): - * src/view.c: (gl_view_construct), - (gl_view_set_selection_text_line_spacing), - (gl_view_set_default_text_line_spacing), - (gl_view_get_default_text_line_spacing): - * src/view.h: - * src/xml-label.c: (xml_parse_toplevel_span), - (xml_create_toplevel_span): - -2003-12-30 Jim Evins - - * src/template-designer.c: - * src/template-designer.h: - * src/template-designer.glade: - New template designer assistant. - - * po/POTFILES.in: - * src/Makefile.am: - Added entries for src/template-designer.* files. - - * pixmaps/ex-1layout.png - * pixmaps/ex-2layouts.png - * pixmaps/Makefile.am: - Added the new image files ex-*.png used as illustrations in the - template designer assistant. - - * src/print-dialog.h: - * src/print-dialog.c: (gl_print_dialog_finalize), - (gl_print_dialog_new), (gl_print_dialog_construct), - (gl_print_dialog_force_outline_flag): - Changed first argument of gl_print_dialog_new() from glView to glLabel, - to support printing from the template designer assistant which does not - have a full-fledged view. Nothing else from the view object was being - used by the dialog anyway. - - Added the gl_print_dialog_force_outline_flag() method, for better - integration with the template designer assistant. - - - * src/commands.h: - * src/commands.c: (gl_cmd_file_template_designer), - (gl_cmd_file_print): - Modified print command to provide label instead of view to dialog. - Added the gl_cmd_file_template_designer() command to invoke the - template designer assistant. - - * src/ui.c: - * src/glabels-ui.xml: - Added support for template designer assistant. - - * src/wdgt-mini-preview.h: - * src/wdgt-mini-preview.c: (gl_wdgt_mini_preview_set_template), - (gl_wdgt_mini_preview_set_bg_color): - Preview is now centered in canvas. Added - gl_wdgt_mini_preview_set_bg_color() to allow the template designer - assistant to match the background color with its own. - - * src/print.c: (clip_to_outline): - Fixed really stupid bug when adding waste to clip region of rectangular - labels/cards. Each side of the clip region needs to be extended by - twice the waste margin, as well as negatively offset by the waste - margin. - -2003-12-28 Jim Evins - - * src/prefs-dialog.c: (update_object_page_from_prefs): - Block intermediary function align_toggle_cb() instead of - update_prefs_from_object_page() for the three alignment - widgets. - -2003-12-28 Wayne Schuller - - * src/file.c: (gl_file_new), (gl_file_properties): - Swap button order and set default for higificatory pleasure. - -2003-12-27 Jim Evins - - * barcode-0.98/Makefile.am: - One last time: removed doc/Makefile and po/Makefile.in.in from - EXTRA_DIST files. - -2003-12-27 Jim Evins - - * barcode-0.98/Makefile.am: - Removed config.stat entry from EXTRA_DIST files. - - * barcode-0.98/Makefile.in: - Removed. - -2003-12-27 Jim Evins - - * configure.in: - Updated to work with latest gnome-common package from CVS. - Removed recursive configuration of barcode-0.98. - - * acconfig.h: - * macros/*: - Removed. - - * Makefile.am: - Added barcode-0.98/ as a SUBDIR, and removed dist-hook. - - * barcode-0.98/Makefile.in: - * barcode-0.98/configure.in: - * barcode-0.98/Makefile.am: - * barcode-0.98/README.glabels: - Modified to ignore the barcode package's build system, and build - as a part of glabels. - Renamed Makefile.in to Makefile.in.dist. - Renamed configure.in to configure.in.dist. - Added barcode-0.98/Makefile.am and barcode-0.98/README.glabels. - - * src/Makefile.am: - * src/mygal/Makefile.am: - * src/recent-files/Makefile.am: - In order to build against the GNOME 2.5 platform, - all use of *_DISABLE_DEPRECATED compile-time flags has been removed. - - * src/mygal/Makefile.am: - * src/mygal/mygal-combo-box.c: - * src/mygal/mygal-combo-box.h: - * src/mygal/widget-color-combo.c: - * src/mygal/widget-color-combo.h: - * po/POTFILES.in: - In order to build against the GNOME 2.5 platform, - Renamed gtk_combo_box widget to mygal_combo_box, to prevent namespace - collisions with the real gtk_combo_box widget, now a part of gtk. - -2003-12-26 Jim Evins - - * src/paper.c: - * src/template.c: - * src/util.c: - * src/util.h: - Moved local versions of get_home_data_dir() in paper.c and - template.c to util package. Cleaned up formatting in - util.[ch]. - - * src/template.c: - In gl_template_register() save a copy of the template in - ~/.glabels if the template is not known. Still need to - handle duplicate filename case and duplicate name but - different template case. - - * src/xml-label.c: - * src/xml.h: - Moved local definition of NAME_SPACE macro from xml-label.c - to xml.h. - - * src/xml-template.c: - * src/xml-template.h: - Added function gl_xml_template_write_template_to_file(), used - in gl_template_register(). diff --git a/glabels2/INSTALL b/glabels2/INSTALL deleted file mode 100644 index 23e5f25d..00000000 --- a/glabels2/INSTALL +++ /dev/null @@ -1,236 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free -Software Foundation, Inc. - -This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - -These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is -disabled by default to prevent problems with accidental use of stale -cache files.) - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - -Some systems require unusual options for compilation or linking that the -`configure' script does not know about. Run `./configure --help' for -details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - -You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. - -Installation Names -================== - -By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - -Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - -There may be some features `configure' cannot figure out automatically, -but needs to determine by the type of machine the package will run on. -Usually, assuming the package is built to be run on the _same_ -architectures, `configure' can figure that out, but if it prints a -message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - -If you want to set default values for `configure' scripts to share, you -can create a site shell script called `config.site' that gives default -values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - -Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). Here is a another example: - - /bin/bash ./configure CONFIG_SHELL=/bin/bash - -Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent -configuration-related scripts to be executed by `/bin/bash'. - -`configure' Invocation -====================== - -`configure' recognizes the following options to control how it operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/glabels2/Makefile.am b/glabels2/Makefile.am deleted file mode 100644 index d7b22a01..00000000 --- a/glabels2/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -## Process this file with automake to produce Makefile.in - -LIB_BARCODE_DIR = barcode-0.98 -LIB_IEC16022_DIR = iec16022-0.2.1 - -SUBDIRS = \ - po \ - $(LIB_BARCODE_DIR) \ - $(LIB_IEC16022_DIR) \ - libglabels \ - src \ - data \ - help \ - docs - -EXTRA_DIST = \ - README \ - COPYING.README_FIRST \ - COPYING \ - COPYING-DOCS \ - COPYING-LIBGLABELS \ - AUTHORS \ - ChangeLog \ - INSTALL \ - NEWS \ - TODO \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in \ - glabels.spec.in \ - glabels.spec diff --git a/glabels2/NEWS b/glabels2/NEWS deleted file mode 100644 index 9fd2b224..00000000 --- a/glabels2/NEWS +++ /dev/null @@ -1,169 +0,0 @@ -* gLabels 2.2.5 (stable) release. Release date 2009-04-30 - -- Fixed spinbutton/adjustment bugs that made glabels unusable with Gtk 2.16. -- Fixed default preview colors in color combos. -- Updated german translation (Mario Blättermann). -- New templates. - - -* gLabels 2.2.4 (stable) release. Release date 2008-12-22 - -- Corrected button order in "Open" and "Save as" dialogs. -- Fixed performance problem when large number of fonts are installed. -- Corrected several i18n problems. -- Fixed "paste" bug that created phantom object views. -- Fixed performacne problem when many objects are selected. -- New templates. - - -* gLabels 2.2.3 (stable) release. Release date 2008-08-17 - -- Explicitely set page size when printing -- don't let print back-end use - a default size (Bug #2049431). -- Sets more appropriate object size limits for any aspect ratio (Bug #1993550). -- Fixed crash of glabels-batch (Bug #1968653). -- Fixed bug with barcode and image merge radio buttons (Bug #1959135). -- Will now attempt to parse newer namespaces (Bug #1872584). -- Fixed drawing errors when drawing markup on rotated labels. -- New korean translation (xein@navir.com). -- New templates. - - -* gLabels 2.2.2 (stable) release. Release date 2008-02-22 - -- Fixed crash when creating Code128C barcode (Bug #1766425). -- Explicitely set page size when printing "other" page size. -- Fixed rendering bug with bitmap fonts. -- Fixed rendering problem when displaying "Invalid barcode data". -- Fixed crash when deleting multi-object selections. -- Enforce minimum size for images to prevent rendering of images of zero size. -- Fixed problem with image size spinboxes (Bug #1886438). -- Fixed template example in documentation. -- Use default units when writing xml files. -- New templates. - -* gLabels 2.2.1 (stable) release. Release date 2008-01-23 - -- Sort font lists alphabetically. -- Sort evolution records by "file_under" field. -- Fixed clipping bug when rotating labels. - - -* gLabels 2.2.0 (stable) release. Release date 2007-12-26 - -- Migrated from EggRecent to GtkRecentManager -- Migrated from libgnomeprint to GtkPrintOperation and Cairo. -- Migrated from libgnomeprint to Pango for text layout. -- Migrated GnomeDruid to GtkAssistant for template designer. -- Migrated from GnomeCanvas to Cairo. -- Removed all deprecated widgets as of Gnome-2.16/Gtk-2.10. -- Added categorization of templates and an updated New Label dialog. -- New label dialog now allows selection of recently used templates -- Removed splash screen. -- Added initial support for datamatrix 2D barcodes. -- Added support for Brazilian CEPNet barcodes. -- Added shadow attribute to label objects. -- New merge backend for evolution data server (Austin Henry) -- Various bug fixes. -- New templates. - - -* gLabels 2.1.5 (unstable) release. Release date 2007-12-09. - -- New label dialog now allows selection of recently used templates -- Store brand and part number as separate fields in templates -- Major cleanup of libglabels API and documentation -- Minor bug fixes (and probably some new bugs). - - -* gLabels 2.1.4 (unstable) release. Release date 2007-08-17. - -- Added categorization of templates and an updated New Label dialog. -- Added initial support for datamatrix 2D barcodes. -- Migrated from EggRecent to GtkRecentManager. -- Migrated from libgnomeprint to GtkPrintOperation and Cairo. -- Migrated from libgnomeprint to Pango for text layout. -- Migrated GnomeDruid to GtkAssistant for template designer. -- Migrated from GnomeCanvas to Cairo. -- Removed splash screen. -- Added support for Brazilian CEPNet barcodes. -- Updated French translation (Claude Paroz) -- New Esperanto translation (Antonio C. Codazzi) -- Minor bug fixes (and probably some new bugs). -- New templates. - - -* gLabels 2.1.3 (unstable) release. Release date 2006-05-27. - -- Don't print "Invalid barcode data" if data field is empty. (Bug #1479839) (Darren Warner) -- Fixed hangup when grid or markup have been toggled during a previous session. (Bug #1434324) -- Added shadow attribute to label objects. -- Fixed color groups in color combo widgets. -- Fixed several potential crashes. - - -* gLabels 2.1.2 (unstable) release. Release date 2005-12-21. - -- Updated Italian translation (Daniele Medri) -- Fixed double entry in property bar's font family combobox -- Don't allow zero width or height when drawing pixbufs -- Fixed various memory leaks -- New configure option to disable update-mime-database and update-desktop-database -- New merge backend for evolution data server (Austin Henry) -- New minimal merge backend for VCards using evolution data server API (Austin Henry) -- New templates and fixes - - -* gLabels 2.1.1 (unstable) release. Release date 2005-06-21. - -- Added document merge tutorial to help documentation -- Replaced deprecated widgets (now requires Gnome 2.10 and GTK+ 2.6) -- Replaced libbonoboui with GtkUIManager (now requires Gnome 2.10 and GTK+ 2.6) -- Updated Russian translation (Vitaly Lipatov) -- Updated Spanish translation (Sergio Rivadero) -- Updated Czech translation (David Makovský and Zbynek Mrkvick) -- Updated Italian translation (Daniele Medri) -- Added documentation for libglabels -- Minor bug fixes and cleanup -- New templates - - -* gLabels 2.1.0 (unstable) release. Release date 2005-01-22. - -- Added ability to select color from merge source (Frederic Ruaudel) -- See 2.0.2 - - -* gLabels 2.0.2 release. Release date 2005-01-22. - -- Desktop file reconciled with desktop-entry-spec -- New cleaned-up icon -- Added option to glabels-batch to allow selection of first label. -- Added options to glabels-batch to allow selection of merge source and crop marks. - (José Dapena Paz) -- Updated french translation (Florent Morel) -- Fixed translation problem with object editor labels -- Minor bug fixes and cleanup -- New templates - -* gLabels 2.0.1 release. Release date 2004-08-15. - -- Fixed crash when reading some labels created with 1.93.x. -- Updated japanese translations (Takeshi AIHANA) -- Fixed crash from improperly freeing translation strings. - - -* gLabels 2.0.0 release. Release date 2004-08-09. - -- Fixed crash when encountering old template files -- Align grid to label center for DVD/CD and round labels -- Don't touch compression of original file -- 64-bit fixes -- Added man page -- Fixed missing outline problem experienced with some printers -- Added separate horizontal and vertical waste properties for rectangular templates -- Added option to auto-shrink text during document merge -- Fixed memory leaks -- Added format attibute to barcode objects, to allow correct layout of merged labels -- Fixed mime type registration for GNOME 2.6 - diff --git a/glabels2/README b/glabels2/README deleted file mode 100644 index a8c42416..00000000 --- a/glabels2/README +++ /dev/null @@ -1,44 +0,0 @@ -Copyright -========= - - Copyright (C) 2001-2007 Jim Evins - - gLabels contains components copyrighted by others -- see th 'AUTHORS' file in - this directory. - - For license information see the 'COPYING.README_FIRST' file in this directory. - - - -What is gLabels -=============== - -gLabels is a small stand-alone program for creating labels and business -cards using a laser or ink-jet printer. - - - -System Requirements -=================== - -GTK+-2.10.x -LIBGNOME[UI]-2.16.x -LIBXML-2.6.x -LIBGLADE-2.6.x - -All of these libraries are available as part of Gnome 2.16 - - - -Author and Acknowledgments: -=========================== - -See the AUTHORS file. - - - -Website -======= - -http://glabels.sourceforge.net/ - diff --git a/glabels2/TODO b/glabels2/TODO deleted file mode 100644 index ed3140cc..00000000 --- a/glabels2/TODO +++ /dev/null @@ -1,46 +0,0 @@ - -Development plan ----------------- -This development plan sets a specific set of milestones for future versions of glabels. - - -Goals for 2.2.x: - - - Bugfixes - - - Translations - - -Possible Goals for 2.3.x (current development branch): - - - Undo, Redo capability - - - Make text items rich. I.e. allow multiple characteristics - to exist within a single object. - - - Text effects. (follow contour, non-rectangular text boxes, - ...) - - - Ability to select/unselect individual records during a merge-print. - - - Add additional "merge" backends. Candidates include: - generic XML - freedb (CDDB) for CD labels - gnome-db - ADIF for generating QSL-cards - - - Printer calibration tool: a facility for tweaking output origin and - scale. This should really be part of the underlying print system but - currently is not, so I may want to add the hack. - - - Adjustable grid spacing. Spacing of visible grid should be user - adjustable. This grid spacing should be an integral multiple of - a finer invisible grid. There should be a "snap to grid" toggle, - that causes all posistioning and sizing performed on the canvas - to snap to the closest grid. The possible grid spacing should be - appropriate for the current units selected (e.g. .1 points, .01 mm, - 1/64 inch, 0.001 inch). - - - Allow for management of custom templates - (i.e. delete, rename, edit). - diff --git a/glabels2/autogen.sh b/glabels2/autogen.sh deleted file mode 100755 index 66bb0fd8..00000000 --- a/glabels2/autogen.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -REQUIRED_AUTOMAKE_VERSION=1.8 - -PKG_NAME="glabels" - -(test -f $srcdir/configure.in \ - && test -f $srcdir/README \ - && test -d $srcdir/src) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level $PKG_NAME directory" - exit 1 -} - -which gnome-autogen.sh || { - echo "You need to install gnome-common from the GNOME CVS" - exit 1 -} -USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh - diff --git a/glabels2/barcode-0.98/COPYING b/glabels2/barcode-0.98/COPYING deleted file mode 100644 index a43ea212..00000000 --- a/glabels2/barcode-0.98/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/glabels2/barcode-0.98/ChangeLog b/glabels2/barcode-0.98/ChangeLog deleted file mode 100644 index 024706de..00000000 --- a/glabels2/barcode-0.98/ChangeLog +++ /dev/null @@ -1,460 +0,0 @@ -2002-03-01 Alessandro Rubini - - * library.c (Barcode_Encode): handle bitsets separately, like - in Barcode_Print (otherwise, you might loose NO_CHECKSUM). - - * debian/changelog: moved to 0.98 (but should fix all debian/ stuff) - - * contrib/barcode-for-delphi.tar.gz: new, contributed by Michael Geddes - - * contrib/barcode-for-delphi.tar.gz.README: short info for file above - - * main.c (main): allow "-g" to set size of code in a table as well - -- suggested and initiallt implemented by Joachim Reichelt. - (main): fixed missing "Page: 1 1" in postscript for tables - (main): for tables don't use Encode_and_Print, use a local - unrolled version, so the default margin can be removed and - we avoid problems with negative xoff in the output phase - (first column may be offset, as noted by Karl Magnus Kolstoe) - - * doc/doc.barcode: documented change above. - - * README: removed refernces to systemy.it, I'm no more there - Added link to FreeBSD ports tree and GLabels - Organized as sections with titles - - * contrib/barcode-SVG.tar.gz: new contribution, by David J. Humphreys - - * contrib/barcode-SVG.tar.gz.README: short description of file above - - * contrib/grab-0.0.4.tar.gz: new program, by Tuukka Toivonen. - - * contrib/grab-0.0.4.tar.gz.README: short description of file above - -2002-03-01 Boszormenyi Zoltan - - * barcode.spec: new file - -2002-02-27 Alessandro Rubini - - * bookland/bookland.py: updated to version 0.92 by Judah Milgram - -2001-11-13 Alessandro Rubini - - * README: Added a pointer to the Windows port. - -2001-11-09 Cloyce D. Spradling - - * code128.c (Barcode_128b_verify): prototype fix (unsigned char). - - * ps.c (Barcode_ps_print): the comment for ascii codes must only - be printed if ascii is being printed (benign bug). - -2001-11-06 Christoph Pross - - * pcl.c (Barcode_pcl_print): bugfix: bars were misplaced - -2001-10-16 Nathan D. Holmes - - ====> Version 0.97 released to ftp.systemy.it and ftp.gnu.org - - * code93.c: new file (I modified something as well - Alessandro) - - * doc/doc.barcode (Supported Encodings): added docs for code93 - - * main.c: added code93 names - - * Makefile.in (LIBOBJECTS): added code93.o - - * library.c: added code93 entry points - -2001-10-16 Alessandro Rubini - - * doc/manpager: added (trivial) support for @itemize, added copyright - - * sample.c (main): accept -P to create PCL output - - * doc/doc.barcode (PCL Output): added the section, using text - provided by Andrea Scopece and turning it into texinfo. - Removed also a few extra newlines that made bad man pages - -2001-10-16 Andrea Scopece - - * barcode.h: added BARCODE_OUT_PCL and BARCODE_OUT_PCL_III - - * library.c (Barcode_Print): use BARCODE_OUT_PCL to select pcl_print() - - * Makefile.in (LIBOBJECTS): added pcl.o - - * pcl.c: new file, with PCL output support - -2001-10-16 Alessandro Rubini - - * doc/doc.barcode (Supported Encodings): added documentation for - EAN and UPC with checksum, as coded by mr. Böszörményi (below) - -2001-10-16 Boszormenyi Zoltan - - * ean.c: - - I found that barcode-0.96 does not correctly encodes UPC-E. - This was mainly because in upc_e_to_a() the switch() branches - all ended without "break;". - - Printing UPC-E did not print the leading encoding number and - the trailing UPC-A checksum. Now it does. - - Accept EAN-13 and EAN-8 with and without the checksum. - So always treat 7 and 12 digit sequences as valid EAN codes - and accept 8 and 13 digit sequences as valid EAN codes when - the last digit is the same as the calculated one. - - Accept UPC-A as above (11 or 12 digit sequences.) - - Accepts UPC-E as: - 6 digit sequence: the middle part of the code (leading '0' assumed) - 7 digit sequence: the middle part and either a leading '0' or '1', - or a trailing UPC-A checksum. In that case, leading '0' assumed. - 8 digit sequence: a leading '0' or '1', middle part, checksum - - UPC-A, UPC-E, EAN-13, and EAN-8 may all include - an additional barcode to the right of the main barcode. - - As a 7 or a 12 digit sequence may be ambiguous, please remember - that EAN is checked before UPC if you specified BARCODE_ANY. - -2001-08-20 Alessandro Rubini - - * sample.c (main): added upc-e and ean-8 samples - -2001-08-11 Boszormenyi Zoltan - - * ps.c (Barcode_ps_print): don't output "showpage" in EPS mode - -2001-08-11 Alessandro Rubini - - * README: Changed host names, added barcode-commit list. - -2000-11-29 Alessandro Rubini - - * doc/doc.barcode (The Field List): 1pt == 0.352mm, not 0.0352 - (thanks to Stephen Irven for reporting) - -2000-11-09 Alessandro Rubini - - ====> Version 0.96 released to ftp.systemy.it and ftp.gnu.org - - * doc/Makefile.in ($(TARGET).html): fixed bug introduced on Sep 08 - - * doc/doc.barcode (top): correctly deal with "makeinfo --html" - -2000-11-08 Alessandro Rubini - - * README: new network pointers added - - * codabar.c (Barcode_cbr_encode): don't print ascii text for the - checksum. - - * doc/doc.barcode (The Intermediate Representaion): new section - Documented the new encodings by Leonid. - Promoted two sections to chapters - Added Leonid in the AUTHORS section of the manpage. - - * Makefile.in: don't remove docs in distclean, as the distribution - now includes the docs - -2000-11-07 Alessandro Rubini - - * Makefile.in (clean): don't remove docs, do that only in distclean - - * doc/Makefile.in: a new life for the former Makefile (to build - with both gmake and pmake with features added on 2000-09-08) - - * configure.in: use $MAKE in checking for gmake if set - (to allow testing with BSD make) - Check if makeinfo can manage html, used for doc/Makefile.in - -2000-11-07 Leonid A. Broukhis - - * code128.c (Barcode_encode_as): fixed a bug that prevented F - symbols to be correctly encoded. - - * plessey.c: new file, for Plessey encoding. - - * msi.c: new file, for MSI encoding. - - * codabar.c: new file, for CodaBar encoding. - - * code128.c (Barcode_128raw_encode): new encoding - (Barcode_128raw_verify): checker for new encoding - - * barcode.h, library.c, main.c: added code128raw, codabar, - MSI and Plessey - -2000-11-07 Hans Schou - - * contrib/barcodeps-0.1.tgz: new file, sent to Alessandro on Oct 7 - -2000-10-10 Alessandro Rubini - - * doc/manpager: use gsub instead of gensub, even though it may - leas to problems with some input. This achieves compatibility - with the original awk, so gawk is not needed any more - -2000-10-02 Alessandro Rubini - - * ps.c (Barcode_ps_print): add a backslash in front of '(' too. - Suggested by H Y . - (Barcode_ps_print): use ps arrays to get compact (and prettier) - PostScript output. Suggested by Hans Schou . - - * main.c (get_geometry): accept "+offset+offset" to keep default size. - Suggested by Godmar Back . - -2000-09-16 Alessandro Rubini - - * ps.c (Barcode_ps_print): use "half text height" instead of - "two text heights" as minimum bar height. Suggested by - Oliver Vecernik . - -2000-09-14 Alessandro Rubini - - * barcode.h: added the standard ``extern "C"'' stuff for C++ - (bug reported by Dany Pardo ) - -2000-09-08 Andrea Ferraris - - * doc/Makefile: added support for pdf and html via makeinfo - - * doc/doc.barcode: added a missing trailing dot in an xref - -2000-08-28 Alessandro Rubini - - * i25.c (Barcode_i25_encode): fixed checksum calculation - (thanks to Hans Schou for reporting) - -2000-05-19 Alessandro Rubini - - ====> Version 0.95.1 released to ftp.prosa.it - - * code128.c (Barcode_128_make_array): use code C if encoding 2 digits - -2000-05-08 Alessandro Rubini - - * cmdline.c (commandline_errormsg): removed "?:" gcc extension - - * configure.in: added checks for unistd.h and strcasecmp, as - windows doesn't have them (thanks Marten Karl) - -2000-04-21 Alessandro Rubini - - * doc/Makefile: modified to build with both gmake and pmake - - * Makefile: modified to build with both gmake and pmake - -2000-04-20 Alessandro Rubini - - * Makefile.in (.depend): removed gmake-specific features. - Thanks to Jukka A. Ukkonen for reporting. - - * configure.in: detect gmake and avoid its features if not there - - * ps.c (Barcode_ps_print): fix: codes with (relatively) short bars - were enlarged in height instead of reduced in width (also - the enlarging was wrong). Thanks to Rob Seace for reporting. - -2000-04-09 Alessandro Rubini - - * code128.c (Barcode_128_encode): removed extra messages to stderr, - forgot in the code when I finished code128 support - - * doc/doc.barcode: bugfix: in the description of geometry, the unit - of measure is configurable - -2000-02-03 Alessandro Rubini - -====> Version 0.95 released to ftp.prosa.it and ftp.gnu.org - -2000-01-26 Alessandro Rubini - - * code128.c (Barcode_128_encode): new encoding: full-featured code128 - - * README: added reference to original ftp site - -2000-01-05 Alessandro Rubini - - * main.c (get_page_geometry): avoid using snprintf(), missing in HP/UX - - * code39.c (Barcode_39_verify): added missing parens (a syntax error, - but only apparent where islower() is not a macro). Thanks to - Alexandre Oliva for finding it out. - -2000-01-04 Alessandro Rubini - - * doc/doc.barcode (The API): removed spurious "flags" argument - from description of Barcode_Encode_and_Print(). - Thanks to Willy Wittesaele for noting the error. - -1999-12-24 Alessandro Rubini - - * main.c (get_geometry): fixed the y margin (thanks to Steve Kunath) - -====> Version 0.94 released to ftp.prosa.it and ftp.gnu.org - -1999-10-24 Alessandro Rubini - - * INSTALL: added instructions to install on a Debian GNU/Linux system - - * debian/*: edited information for proper Debian support - - * debian/rules (binary-arch): new file, from "deb-make" - - * Makefile.in (install): added "-m 0644" to install non-executables - - * code128.c (Barcode_128b_encode): fixed checksum calculation. - -====> Version 0.93 released to ftp.prosa.it and ftp.gnu.org - -1999-09-26 Alessandro Rubini - - * doc/doc.barcode: fixed the rendering of complex options (-g and -t) - Removed extra "table of contents" heading in the ps output - Changed attribution on cover page - - * main.c (get_table and others): be more specific in error msgs - (get_page_geometry): numeric specification is according to "-u" - (get_table): accept unsymmetric margin specification - (option_table): added "-u" to accept "cm", "mm", "in", "pt" - (get_page_geometry): bugfix: numeric spec was always consideder mm - - * cmdline.c (commandline): don't always print help - - * Makefile.in ($(INFO)): added missing dependency: distributed docs - formats were out of date with distributed doc source. - -1999-09-13 Alessandro Rubini - - * main.c (main): print tables: y used xmargin (Tim Withers,Jon Bakken) - -1999-09-06 Alessandro Rubini - - * Makefile.in: prevent -Wall when compiling getopt. - - * i25.c, ean.c, ps.c: switched to unsigned char, to prevent warnings - on newer gcc's (thanks Al Piszcz) - -====> Version 0.92 released to ftp.prosa.it and ftp.gnu.org - -1999-08-31 Alessandro Rubini - - * i25.c: the right guard was thinner than other bars - - * doc/doc.barcode: spelling and manpage fixes (thanks Joachim Schaaf) - -====> Version 0.91.4 released to ftp.prosa.it - -1999-08-23 Thad Floryan - - * main.c (strerror): replacement strerror selected by autoconf - -1999-08-06 Alessandro Rubini - - * changed all "ENODATA" in "EINVAL", as some system miss ENODATA - - * Makefile.in (all): removed ".depend" from all, as it needs gcc - - * i25.c (Barcode_i25_encode): fixed wrong free() in an unlinely path - - * ean.c (Barcode_ean_encode): don't use sprintf's result, as some - systems return a char pointer instead of the number of chars. - - * configure.in: new file, as autoconf support is being added - -====> Version 0.91.3 released to ftp.prosa.it - -1999-08-05 Alessandro Rubini - - * code128.c (Barcode_128c_encode): fixed malloc of textinfo (was short) - - * i25.c (Barcode_i25_encode): new encoding: interleaved 2 of 5 - - * ean.c (Barcode_ean_encode): enlarged static "text", to fit add-5 - - * code128.c (Barcode_128b_encode): new encoding: 128-B - -====> Version 0.91.2 released to ftp.prosa.it - -1999-08-04 Alessandro Rubini - - * bookland/bookland.py: upgraded to version 0.06 (Judas Milgram) - - * ean.c (Barcode_ean_encode): fixed layout of 1st/last digit in UPC-A - - * code128.c (Barcode_128c_encode): fixed checksum calculation - -====> Version 0.91.1 released to ftp.prosa.it - -1999-07-09 Alessandro Rubini - - * sample.c (main): due changes to show code128-C - - * code128.c (Barcode_128c_encode): implemented code 128-C - - * ps.c (Barcode_ps_print): Accept float position and font size - - * code39.c (Barcode_39_encode): reduced font (looked too big) - -====> Version 0.91 released to both ftp.prosa.it and ftp.gnu.org - -1999-07-08 Alessandro Rubini - - * ps.c (Barcode_ps_print): shrink all the bars by 0.15 points - (Barcode_ps_print): Use Helvetica as font, not Courier-Bold - (Barcode_ps_print): remember previous font to make shorter ps output - -1999-07-07 Alessandro Rubini - - * bookland/bookland.py: new enntry, by Judah Milgram. - - * ean.c (Barcode_isbn_verify): fixed bug with "-X" codes (thanks Judah) - -====> Version 0.90.3 released to ftp.prosa.it/pub/software - -1999-07-07 Alessandro Rubini - - * doc/doc.barcode: fixed the "BUGS" section (remove fixed stuff) - - * ean.c (Barcode_ean_encode): added '+' markers in partial and textinfo - - * ps.c (Barcode_ps_print): added support for text over bars ('+' mode) - -====> Version 0.90.2, internal checkpoint - -1999-07-06 Alessandro Rubini - - * Makefile: dirty autodetect of libpaper - - * main.c (get_page_geometry): parse a cmdline argument (mcm@glisco.it) - (main): added "--version" - (main): added diagnostic message for unencodable strings - -====> Version 0.90.1 released to ftp.prosa.it/pub/software - -1999-07-03 Alessandro Rubini - - * barcode.h: removed BARCODE_OUT_PG_* as only the library doesn't - need to hack with the page size. - - * ean.c (Barcode_ean_encode): supplemental 2 and 5 encodings (no text) - - * library.c: use unsigned char all over the place, to prevent warnings - -1999-07-01 Alessandro Rubini - - * ean.c: added EAN-8 and UPC-E support - - * Updated the address of the FSF in any source file - - * README: new file. - -====> Version 0.90 is the first public release. No Changelog up to now. diff --git a/glabels2/barcode-0.98/INSTALL b/glabels2/barcode-0.98/INSTALL deleted file mode 100644 index 5a6cb878..00000000 --- a/glabels2/barcode-0.98/INSTALL +++ /dev/null @@ -1,31 +0,0 @@ - -Installing on generic Unix systems ----------------------------------- - -The package includes both a library and a standalone program. -To install everything try - - ./configure && make && make install - -To uninstall, try - - make uninstall - -You may have problems compiling the package on non-GNUish systems, -because the tool currently uses both gmake and gawk features, and I have -no access to non-gnu systems. If your operating system isn't able to -compile barcode and you are willing to help porting, feel free to call me. - - -Installing on Debian/GNU systems --------------------------------- - -The suggested installation here includes creation of a Debian package: - - debian/rules binary - -Then, just install using dpkg: - - dpkg -i ../barcode-0.98_*.deb - -(the "*" here will represent your architecture: "i386", "alpha", "sparc", ...) diff --git a/glabels2/barcode-0.98/Makefile.am b/glabels2/barcode-0.98/Makefile.am deleted file mode 100644 index e7456ab9..00000000 --- a/glabels2/barcode-0.98/Makefile.am +++ /dev/null @@ -1,73 +0,0 @@ -INCLUDES = \ - $(GLABELS_CFLAGS) - - -BC_FILES = \ - library.c \ - ean.c \ - code128.c \ - code39.c \ - code93.c \ - i25.c \ - msi.c \ - plessey.c \ - codabar.c \ - ps.c \ - pcl.c \ - barcode.h - -noinst_LTLIBRARIES = libbarcode.la - -libbarcode_la_SOURCES = $(BC_FILES) - -EXTRA_DIST = \ - barcode.spec \ - ChangeLog \ - cmdline.c \ - cmdline.h \ - configure \ - configure.in.dist \ - COPYING \ - INSTALL \ - install-sh \ - main.c \ - Makefile.in.dist \ - missing \ - mkinstalldirs \ - README \ - README.glabels \ - sample.c \ - TODO \ - bookland/bookland.py \ - compat/getopt.c \ - compat/getopt.h \ - contrib/barcode-for-delphi.tar.gz \ - contrib/barcode-SVG.tar.gz.README \ - contrib/barcode-for-delphi.tar.gz.README \ - contrib/barcodeps-0.1.tgz \ - contrib/grab-0.0.4.tar.gz \ - contrib/barcodeps-0.1.tgz.README \ - contrib/grab-0.0.4.tar.gz.README \ - contrib/barcode-SVG.tar.gz \ - debian/changelog \ - debian/control \ - debian/copyright \ - debian/dirs \ - debian/info \ - debian/README.debian \ - debian/rules \ - doc/barcodedoc.txt \ - doc/barcode.ps \ - doc/infofilter \ - doc/manpager \ - doc/texi2html \ - doc/barcode.info \ - doc/mktxt \ - doc/barcode.pdf \ - doc/doc.barcode \ - doc/Makefile.in \ - doc/README - - - - diff --git a/glabels2/barcode-0.98/Makefile.in.dist b/glabels2/barcode-0.98/Makefile.in.dist deleted file mode 100644 index 848aa265..00000000 --- a/glabels2/barcode-0.98/Makefile.in.dist +++ /dev/null @@ -1,141 +0,0 @@ -# -# This Makefile should run fine with both pmake and gmake -# - -CC = @CC@ -CFLAGS = @CFLAGS@ @DEFS@ @NO_GETOPT@ @NO_LIBPAPER@ @NO_STRERROR@ -RANLIB = @RANLIB@ - -INSTALL = @INSTALL@ - -LDFLAGS = -L. -l$(TARGET) @LIBPAPER@ - -prefix = @prefix@ -BINDIR = $(prefix)/bin -LIBDIR = $(prefix)/lib -INCDIR = $(prefix)/include -MAN1DIR = $(prefix)/man/man1 -MAN3DIR = $(prefix)/man/man3 -INFODIR = $(prefix)/info - -# getopt may be installed or not, if not take our copy -GETOPT_O = @GETOPT_O@ - -TARGET = barcode -LIBRARY = lib$(TARGET).a -MAN1 = $(TARGET).1 -MAN3 = $(TARGET).3 -INFO = doc/$(TARGET).info -HEADER = $(TARGET).h - -LIBOBJECTS = library.o ean.o code128.o code39.o code93.o i25.o \ - msi.o plessey.o codabar.o \ - ps.o pcl.o -EXEOBJECTS = main.o cmdline.o $(GETOPT_O) -ALLSOURCES = $(LIBOBJECTS:.o=.c) $(EXEOBJECT:.o=.c) - - -#Hmm... "RM" is undefined in pmake -RM = rm - -all: $(TARGET) $(LIBRARY) $(MAN1) $(MAN3) $(INFO) sample - -$(TARGET): $(LIBRARY) $(EXEOBJECTS) - $(CC) $(CFLAGS) $(EXEOBJECTS) $(LDFLAGS) -o $(TARGET) - -sample: sample.o $(LIBRARY) - $(CC) $(CFLAGS) sample.o $(LDFLAGS) -o $@ - -# Avoid the standard CFLAGS, to avoid -Wall and -DNO_GETOPT -compat/getopt.o: compat/getopt.c - $(CC) -O -c compat/getopt.c -o $@ - -$(LIBRARY): $(LIBOBJECTS) - $(AR) r $(LIBRARY) $(LIBOBJECTS) - $(RANLIB) $(LIBRARY) - -$(MAN1) $(MAN3): doc/doc.$(TARGET) - awk -f doc/manpager doc/doc.$(TARGET) - - -# Unfortunately, pmake has no "-C". Also, "pmake -n" doesn't follow the cd. -$(INFO): doc/doc.$(TARGET) - cd doc && $(MAKE) - -install: - $(INSTALL) -d $(BINDIR) $(INCDIR) $(LIBDIR) $(MAN1DIR) \ - $(MAN3DIR) $(INFODIR) - $(INSTALL) -c $(TARGET) $(BINDIR) - $(INSTALL) -c -m 0644 $(HEADER) $(INCDIR) - $(INSTALL) -c -m 0644 $(LIBRARY) $(LIBDIR) - $(INSTALL) -c -m 0644 $(MAN1) $(MAN1DIR) - $(INSTALL) -c -m 0644 $(MAN3) $(MAN3DIR) - $(INSTALL) -c -m 0644 $(INFO) $(INFODIR) - -uninstall: - $(RM) -f $(BINDIR)/$(TARGET) - $(RM) -f $(INCDIR)/$(HEADER) - $(RM) -f $(LIBDIR)/$(LIBRARY) - $(RM) -f $(MAN1DIR)/$(MAN1) - $(RM) -f $(MAN3DIR)/$(MAN3) - $(RM) -f $(INDODIR)/$(INFO) - -#Make clean keeps the compiled documents -clean: - $(RM) -f *.o */*.o *~ */*~ $(TARGET) $(LIBRARY) - $(RM) -f $(MAN1) $(MAN3) core sample - cd doc && $(MAKE) terse - $(RM) -f .depend - -distclean: clean - if [ -f build ]; then debian/rules clean; fi - # remove the configure stuff as well - $(RM) -f Makefile config.h config.log config.status config.cache \ - doc/Makefile - -cleanest: clean - cd doc && $(MAKE) clean - -Makefile: Makefile.in configure - ./configure - -configure: configure.in - autoconf - -.depend: $(ALLSOURCES) - $(CC) $(CFLAGS) -MM $(ALLSOURCES) > $@ - -depend: .depend - -tar: - @if [ "x" = "x$(RELEASE)" ]; then \ - n=`basename \`pwd\``; cd ..; tar cvf - $$n | gzip > $$n.tar.gz; \ - echo 'you can set a numeric $$(RELEASE) to make a named tar'; \ - else \ - if [ -d ../$(TARGET)-$(RELEASE) ]; then \ - rm -rf ../$(TARGET)-$(RELEASE); \ - fi; \ - mkdir ../$(TARGET)-$(RELEASE) || exit 1; \ - cp -a . ../$(TARGET)-$(RELEASE) && cd .. && \ - tar --exclude '*/CVS*' \ - -cvzf $(TARGET)-$(RELEASE).tar.gz $(TARGET)-$(RELEASE); \ - fi - -# print the version, as I usually forget to update it when distributing -printv: - @grep -n VERSION $(HEADER) /dev/null - @grep -n set.version doc/doc.$(TARGET) /dev/null - @grep -n dpkg.-i INSTALL /dev/null - -# and this is how I make the distribution -distrib: $(INFO) distclean tar printv - - -.PHONY: all install uninstall mostlyclean clean disclean depend \ - tar printv distrib - -# Only if make is gmake, have a rule to conditionally include .depend -@GMAKEDEPEND0@ -@GMAKEDEPEND1@ -@GMAKEDEPEND2@ - diff --git a/glabels2/barcode-0.98/README b/glabels2/barcode-0.98/README deleted file mode 100644 index d3ae2a7f..00000000 --- a/glabels2/barcode-0.98/README +++ /dev/null @@ -1,93 +0,0 @@ - -NETWORK LINKS -============= - -This is GNU-barcode. The latest release can be downloaded from ftp.gnu.org -and mirrors: - ftp://ftp.gnu.org/pub/gnu/barcode/ - -It is also available from my own ftp/http server - ftp://ar.linux.it/pub/barcode/ - http://ar.linux.it/pub/barcode/ (same as above). - -The current source tree is available by anonymous CVS. See - http://ar.linux.it/software/#cvs - -Plesae note that ar.linux.it/pub/barcode also includes CVS snapshots, -semi-atumatically taken when I commit stuff to CVS. Note that CVS -snapshots include "CVS/" directories, so you can then "cvs update" for -further updates. - -The documentation is online at: - http://ar.linux.it/software/barcode - -The MS-Windows port is maintained at: - http://gnuwin32.sourceforge.net/packages/barcode.htm - -It as also been included in the FreeBSD ports tree in the "graphics" section. -This means /usr/ports/graphics/barcode. It's thus available from: - http://www.freebsd.org/ports/graphics.html - -GLabels, at http://snaught.com/glabels/, uses barcode internally, too. - -DESCRIPTION -=========== - -The package is meant to solve most needs in barcode creation with a -conventional printer. It can create printouts for the conventional -product tagging standards: UPC-A, UPC-E, EAN-13, EAN-8, ISBN, as well -as a few other formats. Ouput is generated as either Postscript or -Encapsulated Postscript (other back-ends may be added if needed). - -The package is released as both a library and a command-line frontend, -so that you can include barcode-generation into your application. The -program is released in the hope that is proves useful but without any -warranty, according to the GPL Licence (see ./COPYING). - -If you're specifically interested in making an ISBN (Bookland EAN) -symbol, you might try to get "bookland.py" by Judah Milgram -(http://www.cgpp.com/bookland/, whose version 0.92 is also included in -the directory "bookland" within this package, for your convenience). -While my main target is flexibility his main target is strict -adherence to the standards. Bookland is free software like the barcode -library and will probabily have its role in the GNU project. -Bookland.py is a self-documenting program, you'll enjoy browsing its -source code. - -Other contributed patches and/or software are available in the -contrib/ directory. - -Please take the "no-warranty" disclaimer seriously: even though I -spent reasonable efforts to make sure the output is useable in -production you should verify it suits your needs as a faulty bar can -cost you a bundle, and you'll be on your own. It's up to you to verify -that the symbol is valid (and, obviously, I'd like to know about any -problem you encounter). [This paragraph copied verbatim from bookland.py] - - -ACKNOWLEDGMENTS -=============== - -I would like to thank both Judah Milgram and Michele Comitini -(mcm@glisco.it) for their help with this tool, as well as Jim Westveer -for introducing me to Debian packaging. Several encodings have been -implemented by Leonid A. Broukhis (leob@mailcom.com). - - -MAILING LISTS -============= - -There is a mailing list where development is coordinated, called -barcode@lists.linux.it . To get subscribed you should - echo subscribe | mail barcode-request@lists.linux.it -or anything equivalent. - -To receive notification of CVS commit messages, please subscribe to -barcode-commit@ar.linux.it, by issuing: - echo subscribe | mail barcode-commit-request@ar.linux.it - -(if you guess, "ar" or "arcana" is my own server, while lists.linux.it -is the mail server of the italian association of gnu/linux users). - -/alessandro (rubini@gnu.org) - diff --git a/glabels2/barcode-0.98/README.glabels b/glabels2/barcode-0.98/README.glabels deleted file mode 100644 index b0dc9592..00000000 --- a/glabels2/barcode-0.98/README.glabels +++ /dev/null @@ -1,7 +0,0 @@ -The following changes have been made to the stock barcode-0.98 distribution -to facilitate compilation with glabels: - - Makefile.in renamed to Makefile.in.dist - configure.in renamed to configure.in.dist - added Makefile.am, which is configured from ../configure.in - diff --git a/glabels2/barcode-0.98/TODO b/glabels2/barcode-0.98/TODO deleted file mode 100644 index c91c79cf..00000000 --- a/glabels2/barcode-0.98/TODO +++ /dev/null @@ -1,23 +0,0 @@ - - Possible enhancements that I'd like to add - -* verbose mode, printing position information to stderr - -* document how a new encoding standard can be added - -* add Barcode_String, which has been contributed - -* EAN128 (as agreed with Dani Pardo) - -* Postnet and associated encoding-specific bar definitions - -* Use texinfo 4 with images - -* shrink the bars to account for ink spreading - - Currently, small barcodes don't get rendered well. While - version 0.91 and later subtracts 0.15 points from the size of - the bars (I found that this makes good results for small - bars), a smart alghorithm to shrink the bars is needed to get - lighter prints at small sizes without loosing readability. - diff --git a/glabels2/barcode-0.98/barcode.h b/glabels2/barcode-0.98/barcode.h deleted file mode 100644 index 6b9bdf4e..00000000 --- a/glabels2/barcode-0.98/barcode.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * barcode.h -- definitions for libbarcode - * - * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) - * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _BARCODE_H_ -#define _BARCODE_H_ - -#include - -#define BARCODE_VERSION "0.98" -#define BARCODE_VERSION_INT 9800 - -/* - * The object - */ -struct Barcode_Item { - int flags; /* type of encoding and decoding */ - char *ascii; /* malloced */ - char *partial; /* malloced too */ - char *textinfo; /* information about text positioning */ - char *encoding; /* code name, filled by encoding engine */ - int width, height; /* output units */ - int xoff, yoff; /* output units */ - int margin; /* output units */ - double scalef; /* requested scaling for barcode */ - int error; /* an errno-like value, in case of failure */ -}; - -/* - * The flags field - */ -#define BARCODE_DEFAULT_FLAGS 0x00000000 - -#define BARCODE_ENCODING_MASK 0x000000ff /* 256 possibilites... */ -#define BARCODE_NO_ASCII 0x00000100 /* avoid text in output */ -#define BARCODE_NO_CHECKSUM 0x00000200 /* avoid checksum in output */ - -#define BARCODE_OUTPUT_MASK 0x000ff000 /* 256 output types */ -#define BARCODE_OUT_EPS 0x00001000 -#define BARCODE_OUT_PS 0x00002000 -#define BARCODE_OUT_PCL 0x00004000 /* by Andrea Scopece */ -/* PCL_III 0x00008000 */ -#define BARCODE_OUT_PCL_III 0x0000C000 -#define BARCODE_OUT_NOHEADERS 0x00100000 /* no header nor footer */ - -enum { - BARCODE_ANY = 0, /* choose best-fit */ - BARCODE_EAN, - BARCODE_UPC, /* upc == 12-digit ean */ - BARCODE_ISBN, /* isbn numbers (still EAN13) */ - BARCODE_39, /* code 39 */ - BARCODE_128, /* code 128 (a,b,c: autoselection) */ - BARCODE_128C, /* code 128 (compact form for digits) */ - BARCODE_128B, /* code 128, full printable ascii */ - BARCODE_I25, /* interleaved 2 of 5 (only digits) */ - BARCODE_128RAW, /* Raw code 128 (by Leonid A. Broukhis) */ - BARCODE_CBR, /* Codabar (by Leonid A. Broukhis) */ - BARCODE_MSI, /* MSI (by Leonid A. Broukhis) */ - BARCODE_PLS, /* Plessey (by Leonid A. Broukhis) */ - BARCODE_93 /* code 93 (by Nathan D. Holmes) */ -}; - -#define BARCODE_DEFAULT_MARGIN 10 - -#ifdef __cplusplus -extern "C" { -#endif -/* - * Create and destroy barcode structures - */ -extern struct Barcode_Item *Barcode_Create(char *text); -extern int Barcode_Delete(struct Barcode_Item *bc); - -/* - * Encode and print - */ -extern int Barcode_Encode(struct Barcode_Item *bc, int flags); -extern int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags); - -/* - * Choose the position - */ -extern int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, - int xoff, int yoff, double scalef); - -/* - * Do it all in one step - */ -extern int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, - int xoff, int yoff, int flags); - - -/* - * Return current version (integer and string) - */ -extern int Barcode_Version(char *versionname); - -#ifdef __cplusplus -} -#endif - -#endif /* _BARCODE_H_ */ diff --git a/glabels2/barcode-0.98/barcode.spec b/glabels2/barcode-0.98/barcode.spec deleted file mode 100644 index eccb6026..00000000 --- a/glabels2/barcode-0.98/barcode.spec +++ /dev/null @@ -1,84 +0,0 @@ -%define name barcode -%define ver 0.98 -%define rel 1 -%define prefix /usr -%define sysconfdir /etc - -Summary: GNU barcode -Name: %name -Version: %ver -Release: %rel -Copyright: GPL -Group: Applications/Productivity -Source: ftp://ar.linux.it/pub/barcode/%name-%{ver}.tar.gz -BuildRoot: /var/tmp/%name-%{ver}-root -URL: http://gnu.systemy.it/software/barcode -Prefix: %prefix - -%description -This is GNU-barcode. -The package is meant to solve most needs in barcode creation with a -conventional printer. It can create printouts for the conventional -product tagging standards: UPC-A, UPC-E, EAN-13, EAN-8, ISBN, as well -as a few other formats. Ouput is generated as either Postscript or -Encapsulated Postscript (other back-ends may be added if needed). - -%package devel -Summary: GNU barcode files for development -Group: Development/Libraries - -%description devel -This is GNU-barcode. -The package is meant to solve most needs in barcode creation with a -conventional printer. It can create printouts for the conventional -product tagging standards: UPC-A, UPC-E, EAN-13, EAN-8, ISBN, as well -as a few other formats. Ouput is generated as either Postscript or -Encapsulated Postscript (other back-ends may be added if needed). - -This package contain the C header, the static library and man page -for development. - -%prep -%setup - -%ifarch alpha - ARCH_FLAGS="--host=alpha-redhat-linux" -%endif - -export -n LANG LINGUAS LC_ALL -if [ ! -f configure ]; then - CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh $ARCH_FLAGS --prefix=%{prefix} --sysconfdir=%{sysconfdir} -else - CFLAGS="$RPM_OPT_FLAGS" ./configure $ARCH_FLAGS --prefix=%{prefix} --sysconfdir=%{sysconfdir} -fi - -%build -export -n LANG LINGUAS LC_ALL - -if [ "$SMP" != "" ]; then - (make "MAKE=make -k -j $SMP"; exit 0) - make -else - make -fi - -%install -[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT -make prefix=$RPM_BUILD_ROOT%{prefix} sysconfdir=$RPM_BUILD_ROOT%{sysconfdir} install - -%clean -[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-, root, root) - -%doc COPYING ChangeLog INSTALL README TODO doc/*.html doc/*.pdf doc/*.ps - -%attr(0755,root,root) %{prefix}/bin/barcode -%attr(0644,root,root) %{prefix}/info/barcode.info* -%attr(0644,root,root) %{prefix}/man/man1/barcode.1* - -%files devel -%attr(0644,root,root) %{prefix}/include/barcode.h -%attr(0644,root,root) %{prefix}/lib/libbarcode.a -%attr(0644,root,root) %{prefix}/man/man3/barcode.3* diff --git a/glabels2/barcode-0.98/bookland/bookland.py b/glabels2/barcode-0.98/bookland/bookland.py deleted file mode 100644 index 373587cb..00000000 --- a/glabels2/barcode-0.98/bookland/bookland.py +++ /dev/null @@ -1,884 +0,0 @@ -#!/usr/local/bin/python - -MYNAME="bookland.py" -MYVERSION="0.92" -COPYRIGHT="(C) 1999-2001 J. Milgram" -DATE = "Jan. 2002" -MAINTAINER = "bookland-bugs@cgpp.com" - -# Copyright (C) 1999,2000 Judah Milgram -# -# bookland.py - generate Bookland EAN symbol for ISBN encoding -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# ============================================================================== -# -# usage: bookland.py [ISBN] [price-code] > output.eps -# -# ISBN - the ISBN, with or without check digit, with or without hyphens. -# default: 1-56592-197-6 ("Programming Python"). If the check digit -# is provided on the command line, it is verified. If not, it is -# calculated. It's up to you to get the hyphenation right - it's -# important, and something the program can't calculate for you. -# -# price - the five digit add-on code. Usually used to indicate the price, -# in which case the first digit indicates the currency (4=$CAN, -# 5=$US, etc.). The remaining digits indicate the price, with -# decimal point assumed to be between the digit 3 and 4. -# For example: $US 6.95 = 50695, $CAN 35.00 = 43500. Instead of a -# price code, a 5 digit add-on ranging from 90000-98999 can be -# used for internal purposes. BISG recommends just using 90000 if -# you don't want to specify a price. Add-ons ranging from 99000 to -# 99999 have been reserved for special use. -# -# An Encapsulated Postscript file (eps) is sent to standard out. This may in turn -# be converted to other formats using the pbmplus package. You may have trouble -# getting the OCRB to map correctly. If you already have the font, you can look in -# the Fontmap file to see what your system calls it, and edit the fontnames accordingly -# (see below). If you don't have it, you might find it on your DOS system. You -# need a .pfa/.pfb (Type 1) or .ttf (TrueType). Your Postscript interpreter might -# or might not be able to deal with TrueType. In any event, in an emergency, you -# might get away with Helvetica. Note that as of 1990 BISG no longer requires the -# ISBN to be printed in OCR-A. -# -# Take the "no-warranty" disclaimer seriously. Going to print with a faulty bar -# can cost you a bundle, and you'll be on your own. It's up to you to verify that -# the symbol is valid. If you need "corporate accountability", try the Book -# Industry Study Group at (212) 929-1393 or the US ISBN Agency at (908) 665-6770 -# and ask for a list of commercial vendors. Outside the US, don't know. -# -# Feedback welcome. If you discover a case where the program generates a faulty -# symbol, I definitely want to hear about it - write me at milgram@cgpp.com or -# P.O. Box 8376, Langley Park, MD 20787, USA -# -# INSTALLATION: -# -# If you have a Python interpreter on your system, you're done. Just put this file -# somewhere in your path and give it execute permission. If you haven't installed -# Python, see http://www.python.org. It has been ported to Macs, DOS, and MS-Windows. -# -# ABOUT THE BOOKLAND EAN -# -# The most difficult part of this project was finding the documents that define -# the Bookland EAN. There appears to be no single, authoritative source that -# provides all the information required. Some good sources: -# -# [1] "Machine-Readable Coding Guidelines for the U.S. Book Industry", Book -# Industry Study Group, New York, Jan., 1992. (212) 929-1393 -# [2] "UPC Symbol Specification Manual", Uniform Code Council Inc., -# Dayton, Ohio, January 1986 (May 1995 Reprint). (937) 435-3870; I found it -# at http://www.uc-council.org/d36-t.htm -# [3] "EAN Identification for Retail/Trade Items", EAN International. I found it -# in Feb. 1999 at http://www.ean.be/html/Numbering.html -# [4] "Hyphenation Instructions", web page at: -# http://www.isbn.org/standards/home/isbn/international/hyphenation-instructions.asp -# -# The starting point of the exercise is the ISBN, assigned by the national ISBN -# Agency. This is a 10 digit number, the last being a check digit. The ISBN is -# converted to a 13 digit EAN number. The first three digits of the EAN-13 indicate -# the country or region. A prefix of 978 has been assigned to books, regardless -# of country of origin (hence, "Bookland") [3]. The remaining ten digits are the -# first 9 digits of the ISBN followed by the EAN-13 check digit. -# -# It seems the EAN-13 check digit can be calculated using the same algorithm as the -# UPC Version A number. Note that the EAN-13 check digit is always between 0 and 9, -# compare with ISBN check digit which can range to 10 ("X"). See Reference [2], -# Section 2 and Appendix G for details of creation of the EAN-13 symbol. Table 2 of -# Appendix G provides a good comparison of the UPC-A and EAN-13 symbols. -# -# The 5 digit add-on (here called, "UPC5") is defined in Ref. [2] Appendix D. -# The ">" to the right of the five digit code serves to enforce the "quiet zone" to -# the right of the bar pattern. Can't remember where I read that. It's probably -# optional. According to [1], in the UK, three horizontal bars appear over price -# add-ons. Haven't implemented that here. The UPC5 encoding is based on UPC-A and -# UPC-E. -# -# According to [2], Section 3, the EAN-13 numbers and 5-digit add-ons are supposed -# to be printed in OCR-B. The ISBN itself is printed above the EAN-13 symbol. At -# one time it was to be printed in OCR-A, but as of 1990 this requirement has been -# dropped [1], and I assume this means you can use any font you like. -# -# SEE ALSO: -# -# "TinyHelp 5 - Making ISBN Barcodes", D. Byram-Wigfield. Another approach to making -# the ISBN barcode symbol. I saw it at -# http://www.cappella.demon.co.uk/index.html/ -# but haven't tried it. -# -# "XBarcode" - nice open-source X-Windows program for generating all sorts of bar codes. -# It does much more than this program, but didn't seem to do the UPC -# 5-digit add-on or do the ISBN->EAN13 calculation (as of v. 2.11). Might -# have made more sense to add this capability, but I needed a Python project. -# In any event, their license forbids distribution in modified form! -# -# HYPHENATION -# -# bookland.py includes automatic hyphenation for ISBN's in group 0 and 1 -# (English-language). This is based on my reading of Ref [4]. If in doubt, -# users can use the "-y" option to force the program to accept the hyphenation -# as input. For other ISBN groups and for ISMN's, no hyphenation is performed -# other than to ensure a hyphen is placed after the group identifier and before -# the check digit. -# -# ABOUT THE ISMN: -# -# See the ISMN Users' Manual, 3rd Edition, 1998, ISBN 3-88053-070-X, published by -# the International ISMN Agency, Staatsbibliothek Preussischer Kulturbesitz, Berlin. -# I found my copy at http://www.ismn.spk-berlin.de/download/ISMNmanual.pdf -# -# An ISMN is just like an ISBN, except: -# - first character is an "M" -# - the "M" counts as a "3" for computing the ISMN check digit (last digit) -# - the checksum weights are 3,1,3,1,3,1,3,1,3, sum to be divisible by "10". This -# means the last character is always a numerical digit, never an "X". -# - the EAN number is "979" plus the *entire* ten character ISMN, except the -# "M" is replaced by "0". Note this means the ISMN checksum is identical to the -# corresponding EAN-13 checksum (excercise left to the reader). -# -# When bookland.py detects an "M" in the first position of the ISBN, it interprets -# it as an ISMN and proceeds accordingly. The 5-digit price code symbol is suppressed. -# -# BAR WIDTH REDUCTIONS -# -# Starting Version 0.92, the widths of the individual bars can be reduced using the -# "-r" option (units are inches). This is to compensate for bleed during printing. -# I don't know when it's a good idea to actually use this; in any event consult with -# your printer first. If not input, it defaults to zero (no reduction). -# -# ABOUT PYTHON -# -# See http://www.python.org -# -# TO DO: -# -# - Generalize to more bar codes, starting with UPC-A and UPC-E. "Plain" EAN13 is -# already built in, could add command line argument to generate that instead of -# Bookland. -# - Make font sizes and placement easier to configure - not sure I have it right. -# Does human-readable 5-digit code take wider font spacing? -# - Clean up bounding box stuff. -# - Bells and whistles. -# - GUI? -# -# HISTORY: -# -# 1/2002 - v 0.92 add ISMN support (thanks to Lars-Henrik Nysten for this suggestion) -# re-wrote bar generation to preclude possibility of white hairlines -# between adjacent black modules. Thanks to Tero Lindfors for -# reporting this bug. -# new -o option to write eps to file rather than stdout -# new -x option for "check only" (verifies check digit) -# new -r option for bar width reduction (compensate for print bleed) -# new -s option to scale module (bar) height (Lars-Henrik Nysten again) -# can suppress UPC-5 price code by entering empty string. (thanks to -# Jacques Du Pasquier for this suggestion) -# re-wrote ISBN/ISMN sanity checks -# lowercase alphas ("x" for ISBN and "m" for ISMN) now ok on input -# fix "long" command line options. -# 10/2001 - v 0.91 add -z option for quiet zone ">" -# add -f option for fonts -# re-write command line parsing to use getopt -# 1/2000 - v 0.09 eliminate use of eval -# 9/99 - v 0.08 accomodate different versions of OCRB by fitting -# all strings to prescribed width. Thanks to Toby Gadd -# for reporting this problem and Peter Deutsch for -# help finding the fix. -# 7/99 -v0.05-0.07 improve error handling. -# 3/27/99 - v0.04 add "--help" and "--version". -# 3/13/99 - v0.03, do a showpage at end (it's allowed) -# fixed checksum calculations for certain cases -# 2/7/99 - v0.02, fixed LH parity pattern for EAN13. It's not the check digit! -# 2/7/99 - initial release -# ================================================================================ - -# -# barCodeSymbol - the whole printed symbol, including bar code(s) and product code(s). -# UPC, UPCA, UPC5, EAN13 - the number itself, with check digit, string representation, -# and barcode bits -# - -import re # we should get rid of regsub and regex in favor of re - # hope there's no conflict. -import string -import sys -import regsub -from regex_syntax import * -import regex -regex.set_syntax(RE_SYNTAX_AWK) -from types import * - -BooklandError = "Something wrong" - - -A="A";B="B";C="C";O="O";E="E" -UPCABITS = [{O:"0001101",E:"1110010"}, - {O:"0011001",E:"1100110"}, - {O:"0010011",E:"1101100"}, - {O:"0111101",E:"1000010"}, - {O:"0100011",E:"1011100"}, - {O:"0110001",E:"1001110"}, - {O:"0101111",E:"1010000"}, - {O:"0111011",E:"1000100"}, - {O:"0110111",E:"1001000"}, - {O:"0001011",E:"1110100"}] -UPCAPARITY = [ "OOOOOOEEEEEE" ] * 10 -UPCEBITS = [{O:"0001101",E:"0100111"}, - {O:"0011001",E:"0110011"}, - {O:"0010011",E:"0011011"}, - {O:"0111101",E:"0100001"}, - {O:"0100011",E:"0011101"}, - {O:"0110001",E:"0111001"}, - {O:"0101111",E:"0000101"}, - {O:"0111011",E:"0010001"}, - {O:"0110111",E:"0001001"}, - {O:"0001011",E:"0010111"}] -# what about UPCEPARITY? Don't need for isbn. -UPC5BITS = UPCEBITS -UPC5PARITY = ["EEOOO","EOEOO","EOOEO","EOOOE","OEEOO", - "OOEEO","OOOEE","OEOEO","OEOOE","OOEOE"] -EAN13BITS = [{A:"0001101", B:"0100111", C:"1110010"}, - {A:"0011001", B:"0110011", C:"1100110"}, - {A:"0010011", B:"0011011", C:"1101100"}, - {A:"0111101", B:"0100001", C:"1000010"}, - {A:"0100011", B:"0011101", C:"1011100"}, - {A:"0110001", B:"0111001", C:"1001110"}, - {A:"0101111", B:"0000101", C:"1010000"}, - {A:"0111011", B:"0010001", C:"1000100"}, - {A:"0110111", B:"0001001", C:"1001000"}, - {A:"0001011", B:"0010111", C:"1110100"}] -EAN13PARITY = map(lambda x: x+"CCCCCC", - ["AAAAAA","AABABB","AABBAB","AABBBA","ABAABB", - "ABBAAB","ABBBAA","ABABAB","ABABBA","ABBABA"]) - -PSFORMAT = "%.6f" -# Default fonts. -# Fonts might have a different name on your system. -# Edit if required. -ISBNFONT = "OCRB" # Doesn't have to be OCR-B -EAN13FONT = "OCRB" -UPC5FONT = "OCRB" - -class psfile: - - def __init__(self): - self.x0 = 100; self.y0 = 100 - self.lines=[] - self.bb=[self.x0,self.y0,self.x0,self.y0] - - def orbb(self,arg): - self.bb[0] = min(self.bb[0],self.x0+arg[0]) - self.bb[1] = min(self.bb[1],self.y0+arg[1]) - self.bb[2] = max(self.bb[2],self.x0+arg[2]) - self.bb[3] = max(self.bb[3],self.y0+arg[3]) - - def translate(self,dx,dy): - self.x0 = self.x0 + dx - self.y0 = self.y0 + dy - return "%d %d translate 0 0 moveto" % (dx,dy) - - def out(self,file=None): - if file: - outfid=open(file,"w") - else: - outfid=sys.stdout - for line in self.lines: - outfid.write("%s\n"%line) - outfid.close() - - def do(self,arg): - self.lines = self.lines + arg - - def setbb(self): - for i in range(len(self.lines)): - if self.lines[i]=="%%BoundingBox: TBD": - self.lines[i]= "%%BoundingBox:" + \ - " %d"%self.bb[0] + \ - " %d"%self.bb[1] + \ - " %d"%self.bb[2] + \ - " %d"%self.bb[3] - return - - def header(self,title,comments,ean13font,isbnfont,upc5font): - for i in range(len(comments)): - comments[i] = regsub.gsub("^","% ",comments[i]) - # There's a more elegant way to do the bounding box line: - return [ "%!PS-Adobe-2.0 EPSF-1.2", - "%%Creator: " + MYNAME + " " + MYVERSION + " " + DATE, - "%%Title: " + title, - "%%BoundingBox: TBD", - "%%EndComments" ] +\ - comments + \ - [ "\n% These font names might be different on your system:", - "/ean13font { /" + ean13font + " findfont 10 scalefont setfont } def", - "/isbnfont { /" + isbnfont + " findfont 8 scalefont setfont } def", - "/upc5font { /" + upc5font +" findfont 14 scalefont setfont } def\n", - "/nextModule { moduleWidth 0 rmoveto } def", - "% The following shenanigans is to deal with different implementations", - "% of same font having different char sizes and spacing.", - "% function fitstring:", - "% usage: width string font fitstring", - "% set font, scaled so that string exactly fits desired width", - "% leave string on stack", - "/fitstring { dup findfont 1 scalefont setfont % w s f", - "3 1 roll % f w s", - "dup stringwidth pop % f w s sw", - "3 2 roll exch div % f s x", - "3 2 roll findfont exch scalefont setfont", - "} def", - "/barHeight { 72 } def", - "/nextModule { moduleWidth 0 rmoveto } def", - "/topcentershow {dup stringwidth pop neg 2 div -9 rmoveto show} def", - "/toprightshow {dup stringwidth pop neg -9 rmoveto show} def", - "/bottomcentershow {dup stringwidth pop neg 2 div 0 rmoveto show} def", - "/bottomrightshow {dup stringwidth pop neg 0 rmoveto show} def", - "/W { moduleWidth mul 0 rmoveto } def", - "/B { dup moduleWidth mul 2 div 0 rmoveto", - "dup moduleWidth mul barWidthReduction sub setlinewidth", - "0 barHeight rlineto 0 barHeight neg rmoveto", - "currentpoint stroke moveto", - "moduleWidth mul 2 div 0 rmoveto } def", - "/L { dup moduleWidth mul 2 div 0 rmoveto", - "dup moduleWidth mul barWidthReduction sub setlinewidth", - "0 -5 rmoveto 0 5 rlineto", - "0 barHeight rlineto 0 barHeight neg rmoveto", - "currentpoint stroke moveto", - "moduleWidth mul 2 div 0 rmoveto } def", - self.x0,self.y0,"translate", - "0 0 moveto" ] - - def trailer(self): - return ["stroke","% showpage supposedly OK in EPS", - "showpage","\n% Good luck!"] - - -class UPC: - - # Includes UPC-A, UPC-E, EAN-13 (sorry), UPC-5 et al. - - def __init__(self,arg): - # arg is a string, either: - # - product code including checksum - # - same, with hyphens (hyphens not verified) - # - same, but with last digit (checksum) dropped, possibly leaving a - # trailing hyphen. - # If checksum is included, it will be verified. - # N.B. "integer" representation is still a string! Just has no hyphens. - - self.s=arg - self.verifyChars(self.s) - self.n = regsub.gsub("-","",self.s) # create "integer" representation - self.x = self.checkDigit(self.n) # always calculate check digit - if len(self.n) == self.ndigits: - self.verifyCheckDigit() # if check digit given, verify it - elif len(self.n) == self.ndigits-1: - self.tackonCheckDigit() # tack on check digit - else: - raise BooklandError, "UPC: wrong number of digits in \"" + self.s + "\"" - - def setbits(self,arg): # UPC (all) - self.bits="" - parityPattern=self.parityPattern() - bitchar=self.bitchar() - for p in range(len(arg)): - digit=int(arg[p]) - # maybe better to define parityPattern with a leading blank? - parity=parityPattern[p] - bit=bitchar[digit][parity] - self.bits=self.bits + bit - - def verifyChars(self,s): # UPC (all) - # Trailing hyphen allowed. - nevergood = "--|^-|[^0-9-]" - ierr=regex.search(nevergood,s) - if ierr != -1: - raise BooklandError, \ - "UPCA: in %s: illegal characters beginning with: %s" % (s,s[ierr]) - - def verifyCheckDigit(self): # UPC (all) - # first verify correct number of digits. - soll=self.checkDigit(self.n) - ist=self.s[-1:] - if ist != soll: - raise BooklandError, "For %s checksum %s is wrong, should be %s" % \ - (self.s,ist,soll) - - def xstring(self,p): # UPC (all) - return "%d" % p - - def tackonCheckDigit(self): - self.n = self.n + self.x # UPC (all) - self.s = self.s + self.x - -class UPCA(UPC): - - def __init__(self,arg): - UPC.__init__(self,arg) - self.setbits(self.n[1:]) # skip first digit - - def parityPattern(self): - return UPCAPARITY[int(self.x)] - def bitchar(self): - return UPCABITS - - def checkDigit(self,arg): # UPCA/EAN13 - weight=[1,3]*6; magic=10; sum = 0 - for i in range(12): # checksum based on first 12 digits. - sum = sum + int(arg[i]) * weight[i] - z = ( magic - (sum % magic) ) % magic - if z < 0 or z >= magic: - raise BooklandError, "UPC checkDigit: something wrong." - return self.xstring(z) - - -class ISBN: - # Includes ISMN, if the plan falls together. - def __init__(self,arg): - self.ndigits=10 # Includes check digit! - self.s=string.upper(arg) - self.n=re.sub("[ -]","",self.s) # "integer" representation - # In ISMN, I allow spaces in place of hyphens. See ISMN User's manual. - if re.match("^M( |-)?\d(( |-)?\d){7,7}(-| )?\d?$",self.s): - # ISMN - self.name="ISMN" - self.n=re.sub("^M","3",self.n) - self.weight=[3,1,3,1,3,1,3,1,3] - self.magic=10 - elif re.match("^\d-?\d(-?\d){7,7}-?(\d|X)?$",self.s): - # ISBN - self.name="ISBN" - self.weight=[10,9,8,7,6,5,4,3,2] - self.magic=11 - else: - raise BooklandError, "%s invalid (hyphenation, characters, or length)" % self.s - self.x = self.checkDigit() - if len(self.n) == self.ndigits: - self.verifyCheckDigit() # if check digit given, verify it - elif len(self.n) == self.ndigits-1: - self.tackonCheckDigit() # tack on check digit - else: - raise BooklandError, "%s failed. Please report as bug" % self.s - - - def checkDigit(self): # ISBN and ISMN; UPCA/EAN13 similar but for weights etc. - # now that we're checking regex's in init, we don't have to check the - # argument at all. (used to check length and bad characters) - sum = 0 - for i in range(9): # checksum based on first nine digits. - sum = sum + int(self.n[i]) * self.weight[i] - z = ( self.magic - (sum % self.magic) ) % self.magic - if z < 0 or z >= self.magic: - raise BooklandError, \ - "%s: checksum %d is wrong - please report as bug" % (self.s,z) - return self.xstring(z) - - def xstring(self,p): - if p == 10: - return "X" - else: - return "%d" % p - - def tackonCheckDigit(self): - if self.s[-1:] == "-": - # Already have a trailing hyphen - self.s = self.s + self.x - else: - self.s = self.s + "-" + self.x - - def verifyCheckDigit(self): # UPC A; EAN13 - # first verify correct number of digits. - soll=self.x - ist=self.s[-1:] - if ist != soll: raise BooklandError, \ - "For %s checksum %s is wrong, should be %s\n" % (self.s,ist,soll) - -class Bar: - # a run of adjacent modules of identical value. - def __init__(self,val): - self.val=val - if not self.val in "L01": - raise BooklandError, "bar bit: %s, pls report as a bug" % self.val - self.width=1 - if self.val=="1": - self.color="Black" - elif self.val=="0": - self.color="White" - elif self.val=="L": - self.color="Long Black" - def __cmp__(self,other): - if self.val==other or (self.val=="L" and other=="1"): - return 0 - else: - return 1 - def inc(self): - self.width=self.width+1 - def pslines(self): - if self.val=="L": - rval = [ "%d L " % self.width ] - elif self.val=="1": - rval = [ "%d B " % self.width ] - else: - rval = [ "%d W " % self.width ] - return rval - def __repr__(self): - return "%s bar of width %d" % (self.color,self.width) - -class barCodeSymbol: - - def __init__(self): - self.patternWidth = len(self.bits)*self.moduleWidth - # Anything else? - - def bitsComment(self): - return [ "%% Bits:\n%% %s" % self.bits ] - - def psbars(self): - # new version, try to prevent all hairlines between adjacent modules. - bars = [] - bar=Bar(self.bits[0]) - for bit in self.bits[1:]: - if bit==bar: - bar.inc() - else: - bars.append(bar) - bar=Bar(bit) - bars.append(bar) - rval = ["0 0 moveto"] - for bar in bars: - rval = rval + bar.pslines() - rval = rval + [ "stroke" ] - return rval - - def psbarsold(self): - psbits=regsub.gsub("1","I ",self.bits) - psbits=regsub.gsub("0","O ",psbits) - psbits=regsub.gsub("L","L ",psbits) - linewidth=50 - p=0; j=linewidth; m=len(psbits); psbarlines=[]; blanks="^ | $" - while p <= m: - j = min(linewidth,m-p) - psbarlines = psbarlines + [ regsub.gsub(blanks,"",psbits[p:p+j]) ] - p=p+linewidth - return [ "0 0 moveto" ] + psbarlines + [ "stroke" ] - - def psSetBarHeight(self): - return [ "/barHeight { " + PSFORMAT % self.moduleHeight + " 72 mul } def" ] - - def psSetBarWidthReduction(self): - return [ "/barWidthReduction { " + \ - PSFORMAT % self.barWidthReduction + " 72 mul } def" ] - - def psSetModuleWidth(self): - rval = [ "/moduleWidth { " + PSFORMAT % self.moduleWidth + " 72 mul } def" ] - return rval - - def psBottomRightText(self,text,font): - # this is specifically for the upc5 price code. - # this is all starting to get messy. - return [ PSFORMAT % self.patternWidth + " 72 mul dup 2 div", - PSFORMAT % self.moduleHeight + " 72 mul 2 add moveto", - "(" + text + ") /" + font + " fitstring bottomcentershow" ] - - def psTopCenterText(self,text,font): - # the text at the top center of the bar pattern (i.e. the ISBN) - return [ PSFORMAT % self.patternWidth + " 72 mul dup 2 div", - PSFORMAT % self.moduleHeight + " 72 mul 3 add moveto", - " (" + text + ") /" + font + " fitstring bottomcentershow" ] - - def psFittedText(self,width,text,font): - return [ PSFORMAT % width + " (" + text + ") " + font + " fitstring" ] - - # This is optional; serves to enforce quiet zone to right of UPC 5 add-on - def psGreaterThan(self,font): - return [ PSFORMAT % self.patternWidth + " 72 mul", - PSFORMAT % self.moduleHeight + " 72 mul 2 add moveto", - "/%s (>) show" % font ] - -class EAN13Symbol(barCodeSymbol): - - def __init__(self,arg,font=EAN13FONT,heightMultiplier=1,barWidthReduction=0): - # arg is a string with the EAN product code - self.barWidthReduction=barWidthReduction - self.ean13 = EAN13(arg) - self.moduleWidth = 0.0130 - specModuleHeight = 1.00 - self.moduleHeight = 1.00 * heightMultiplier - self.bits = self.ean13.bits - barCodeSymbol.__init__(self) - self.font=font - - def bb(self): - return [ -12, -10, self.patternWidth*72+10, self.moduleHeight*72+12 ] - - def pslines(self): - return self.bitsComment() + \ - self.psSetModuleWidth() + \ - self.psSetBarWidthReduction() + \ - self.psSetBarHeight() + \ - self.psbars() + \ - self.psLRDigitLines() - - def psLRDigitLines(self): - # 24 = 3+6*7/2 - # 70 = 3+6*7+4+6*7/2 "4" so we center on the "L" bars (the rightmost of - # the center guard bars is an "O". - # "5" in check digit is the five-module spacing recommended by [2], section 3. - return [ "% We do the left digits first and leave the font scaled", - "% as is for the 9-digit and the right-digits.", - "% EAN13 Left Digits:", - "moduleWidth 24 mul 0 moveto", - "moduleWidth 40 mul (" + self.ean13.leftDigits + ") ", - "/" + self.font + " fitstring topcentershow", - "\n% EAN13 human-readable number", - "% The \"9\" digit (only when encoding ISBN's and ISMN's, I think):", - "-5 0 moveto (" + self.ean13.n[0] + ") toprightshow", - "% EAN13 Right Digits:", - "moduleWidth 70 mul 0 moveto", - "moduleWidth 40 mul (" + self.ean13.rightDigits + ") topcentershow" ] - -class EAN13(UPCA): - - def __init__(self,arg): - self.ndigits=13 # Includes check digit! - UPCA.__init__(self,arg) - leftBits = self.bits[0:42] - rightBits = self.bits[42:] - leftGuard="L0L" - rightGuard="L0L" - center="0L0L0" - self.bits = leftGuard + leftBits + center + rightBits + rightGuard - self.leftDigits = self.n[1:7] - self.rightDigits = self.n[7:13] - - def parityPattern(self): - # N.B. parity pattern based on leftmost digit, the UCC Spec calls this - # the "13th" digit. It's not the check digit! - return EAN13PARITY[int(self.n[0])] - def bitchar(self): - return EAN13BITS - -class UPC5Symbol(barCodeSymbol): - - def __init__(self,arg,heightMultiplier=1,barWidthReduction=0): - # arg is a string with the 5 digit add-on. - self.barWidthReduction=barWidthReduction - self.upc5 = UPC5(arg) - self.moduleWidth = 0.0130 - specModuleHeight = 0.852 - self.moduleHeight = 0.852 * heightMultiplier - self.bits = self.upc5.bits - barCodeSymbol.__init__(self) - - def pslines(self): - return self.bitsComment() + \ - self.psSetModuleWidth() + \ - self.psSetBarHeight() + \ - self.psbars() - - def bb(self): - # Note quiet zone is there even if we don't print the ">". - return [ 0, 0, self.patternWidth*72+10, self.moduleHeight*72+10 ] - -UPC5Error = "Something wrong with 5-digit price code add-on." -class UPC5(UPC): - - def __init__(self,arg): - self.ndigits=5 # Includes check digit! - p=re.search("[^0-9]",arg) - if p: - badchar=arg[p.start()] - raise UPC5Error, "\"%s\" is wrong. The character \"%s\" is not allowed. Price code add-on should contain %d digits and nothing else. Or leave blank to suppress the UPC-5 code." % (arg,badchar,self.ndigits) - elif len(arg) != self.ndigits: - raise UPC5Error, \ - "\"%s\" is wrong. Price code add-on should have exactly %d digits." % (arg,self.ndigits) - UPC.__init__(self,arg) - self.setbits(self.n) - leftGuard="1011" - # no right guard for UPC 5-digit add-on - # Have to insert pesky delineators: - delineator = "01" - self.bits = leftGuard + \ - self.bits[0:7] + delineator + \ - self.bits[7:14] + delineator + \ - self.bits[14:21] + delineator + \ - self.bits[21:28] + delineator + \ - self.bits[28:35] - - def checkDigit(self,arg): # UPC5 - weight=[3,9,3,9,3]; sum = 0 - for i in range(5): - sum = sum + int(arg[i]) * weight[i] - return self.xstring(sum % 10) - - def verifyCheckDigit(self): # UPC2/5 checksum not in number - return - - def parityPattern(self): - return UPC5PARITY[int(self.x)] - def bitchar(self): - return UPC5BITS - -class bookland(barCodeSymbol): - - def __init__(self,isbn,price="",*rest): - - - # Some defaults: - ean13font=EAN13FONT - isbnfont=ISBNFONT - upc5font = UPC5FONT - zone=None - heightMultiplier=1.0 - commandLine="" - barWidthReduction=0 - - # Maybe different fonts: - if len(rest)>0: - font=rest[0] - if font: - ean13font=font - isbnfont=font - upc5font=font - if len(rest)>1: - zone=rest[1] - if len(rest)>2: - heightMultiplier=float(rest[2]) - if len(rest) > 3: - commandLine=rest[3] - if len(rest) > 4: - barWidthReduction=float(rest[4]) - - # Initial setup: - - self.ps = psfile() - self.isbn = ISBN(isbn) - - # Header, EAN13 bars, EAN13 number, and ISBN: - - if self.isbn.name=="ISMN": - self.ean13Symbol = EAN13Symbol("9790"+self.isbn.n[1:9],ean13font,heightMultiplier,barWidthReduction) - elif self.isbn.name=="ISBN": - self.ean13Symbol = EAN13Symbol("978"+self.isbn.n[:9],ean13font,heightMultiplier,barWidthReduction) - else: - raise BooklandError, "Internal error doing %s, please report as bug" % isbn - - self.ps.orbb(self.ean13Symbol.bb()) - comments = ["", - " This is free software and comes with NO WARRANTY WHATSOVER", - " Think twice before going to press with this bar code!", - "", - "Command line: %s" % commandLine, - "" ] - self.ps.lines = self.ps.header(self.isbn.s,comments,ean13font,isbnfont,upc5font) + \ - [ "ean13font" ] + \ - self.ean13Symbol.pslines() +\ - [ "isbnfont" ] + \ - self.ean13Symbol.psTopCenterText("%s %s" % (self.isbn.name,self.isbn.s),isbnfont) - - # 5-digit add-on: (optional for ISBN only) - BLANK=re.compile("^ *$") - if self.isbn.name=="ISBN" and not BLANK.match(price): - # 105 = 95 + 10; 10 = separation (min is 9) - translate=[ self.ps.translate( self.ean13Symbol.moduleWidth * 72 * 105, 0 ) ] - self.upc5Symbol = UPC5Symbol(price,heightMultiplier,barWidthReduction) - self.ps.orbb(self.upc5Symbol.bb()) - self.ps.lines = self.ps.lines + \ - translate + \ - self.upc5Symbol.pslines() + \ - [ "upc5font" ] +\ - self.upc5Symbol.psBottomRightText(price,upc5font) - if zone: self.ps.lines=self.ps.lines + self.upc5Symbol.psGreaterThan(upc5font) - else: - self.ps.lines.append("%% Skipping UPC-5 price code symbol per request") - - self.ps.lines=self.ps.lines + self.ps.trailer() - - # Can now set bounding box. - - self.ps.setbb() - -# Here we go ... - -if __name__ == '__main__': - - def printUsage(): - print "Usage: bookland [-h|--help] [-v|--version] [-x|--check] [-f|--font=] [-s|--height=] [-r|--reduction=] [-o|outfile=] [-z|--quietzone] [| ]" - print "Report bugs to " + MAINTAINER - - def printVersion(): - sys.stderr.write("%s version %s %s.\n" % (MYNAME,MYVERSION,COPYRIGHT)) - sys.stderr.write("Bugs to %s\n" % MAINTAINER) - sys.stderr.write("This is free software and comes with NO WARRANTY\n") - - import getopt - try: - opts,args = getopt.getopt(sys.argv[1:], - "xr:s:uvf:hzo:", - ["reduction=","outfile=","height=","noupc", - "check","version","help","font=","quietzone"]) - except: - printUsage() - sys.exit(0) - - # some initial defaults: - isbn = "1-56592-197-6" # Mark Lutz, "Programming Python", - # O'Reilly, Sebastopol CA, 1996 - price = "90000" - font=None - zone=None - checkonly=None - outfile=None - heightMultiplier=1 - commandLine = string.join(sys.argv) - barWidthReduction = 0 - - # parse command line: - for opt,val in opts: - if opt in ("-v","--version"): - printVersion() - sys.exit(0) - elif opt in ("-h","--help"): - printUsage() - sys.exit(0) - elif opt in ("-f","--font"): - font=val - elif opt in ("-z","--quietzone"): - zone=1 - elif opt in ("-x","--check"): - checkonly=1 - elif opt in ("-s","--height"): - heightMultiplier = float(val) - elif opt in ("-r","--reduction"): - barWidthReduction = val - elif opt in ("-o","--outfile"): - outfile=val - if len(args)==1: - isbn=args[0] - elif len(args)==2: - isbn=args[0] - price=args[1] - - # Do stuff. - - printVersion() - try: - b = bookland(isbn,price,font,zone,heightMultiplier, - commandLine,barWidthReduction) - if not checkonly: b.ps.out(outfile) - if outfile: - sys.stderr.write("Output written to %s\n" % outfile) - except BooklandError, message: - sys.stderr.write(BooklandError + ": " + message + "\n") - sys.exit(1) diff --git a/glabels2/barcode-0.98/cmdline.c b/glabels2/barcode-0.98/cmdline.c deleted file mode 100644 index a69a825b..00000000 --- a/glabels2/barcode-0.98/cmdline.c +++ /dev/null @@ -1,177 +0,0 @@ -/* - * cmdline.c -- parse a command line using getopt, environment and defaults - * - * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) - * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * Changes: - * Michele Comitini (mcm@glisco.it): better handling of numeric type args. - */ - -#include -#include -#include - -#ifdef NO_GETOPT - /* use replacement */ - #include "compat/getopt.h" -#else - #include -#endif - -#include "cmdline.h" - -/* In case of error, print help string and return error (-1) */ -int commandline_errormsg(FILE *f, struct commandline *args, - char *prgname, char *messagehead) -{ - char *buffer; - char *buffer2; - int len; - struct commandline *ptr; - - if (!messagehead) { - fprintf(f,"%s: Error in cmdline\nPossible options:\n",prgname); - } else { - fprintf(f,"%s: %s",prgname,messagehead); - } - - for (ptr = args; ptr->option; ptr++) { - if (ptr->descrip) { - len = strlen(ptr->descrip); - len += ptr->default_v ? strlen(ptr->default_v) : 6; - len += ptr->env ? strlen(ptr->env) : 6; - buffer2 = malloc(len+3); /* 3 to be safe :) */ - len += 32; - if (buffer2) { - buffer = malloc(len); - if (buffer) { - sprintf(buffer2, ptr->descrip, - ptr->default_v ? ptr->default_v : "(none)", - ptr->env ? ptr->env : "(none)"); - sprintf(buffer, " -%c %s %s", ptr->option, - ptr->type ? "" : " ", buffer2); - fprintf(f, "%s\n",buffer); - free(buffer); - } - free(buffer2); - } - } - } - return -1; -} - -/* - * Associate formats to type. - */ -struct type_fmt { - enum option_type type; - char *fmt; -}; -static struct type_fmt formats[] = { - {CMDLINE_I, "%i%s"}, /* the trailing "%s" is used for error check */ - {CMDLINE_D, "%d%s"}, - {CMDLINE_X, "%x%s"}, - {CMDLINE_O, "%o%s"}, - {CMDLINE_F, "%lf%s"}, - {CMDLINE_P, "%p%s"}, - {0, NULL} /* If we get here, it's CMDLINE_S: no sscanf buf strcpy() */ -}; - - -/* Parse one argument (default or provided) */ -static int commandline_oneopt(struct commandline *ptr, char *value) -{ - struct type_fmt *tptr; - char *trash = value ? strdup(value) : NULL; - - /* convert it, if needed */ - if ((ptr->type != CMDLINE_NONE) && ptr->result) { - for (tptr = formats; tptr->type; tptr++) - if (tptr->type == ptr->type) - break; - if (!tptr->type) /* not found: it is a string */ - *(char **)(ptr->result) = value; - else - if (sscanf(value, tptr->fmt, ptr->result, trash)!=1) { - free(trash); - return -1; - } - } - if (trash) - free(trash); - - if ((ptr->type == CMDLINE_NONE) && ptr->result) /* no type, just count */ - (*(int *)(ptr->result))++; - - /* call the function, if needed */ - if (ptr->fun) { - if (ptr->type) { - if (ptr->result) return ptr->fun(ptr->result); /* converted */ - return ptr->fun(value); /* type, but not converted */ - } - return ptr->fun(NULL); /* no type: just call it */ - } - return 0; -} - -/* The main function */ -int commandline(struct commandline *args, int argc, char **argv, - char *errorhead) -{ - struct commandline *ptr; - char *getopt_desc = (char *)calloc(512, 1); - int desc_offset = 0; - int opt, retval; - char *value; - - /* Build getopt string and process defaults values */ - for (ptr = args; ptr->option; ptr++) { - getopt_desc[desc_offset++] = ptr->option; - if (ptr->type) getopt_desc[desc_offset++] = ':'; - - value = NULL; - if (ptr->env) - value = getenv(ptr->env); - if (!value) - value = ptr->default_v; - if (value && (retval = commandline_oneopt(ptr, value))) { - /* - * if the function returns a specific (not -1) value, it already - * printed its message, so avoid the generic help - */ - if (retval == -1) - commandline_errormsg(stderr, args, argv[0], errorhead); - return retval; - } - } - - /* Run getopt and process material */ - while ((opt = getopt(argc, argv, getopt_desc)) != -1) { - for (ptr = args; ptr->option; ptr++) - if (opt == ptr->option) - break; - if (!ptr->option) /* unknown option */ - return commandline_errormsg(stderr, args, argv[0], errorhead); - if ( (retval = commandline_oneopt(ptr, optarg)) ) { /* wrong arg */ - if (retval == -1) - commandline_errormsg(stderr, args, argv[0], errorhead); - return retval; - } - } - return 0; -} diff --git a/glabels2/barcode-0.98/cmdline.h b/glabels2/barcode-0.98/cmdline.h deleted file mode 100644 index 69319915..00000000 --- a/glabels2/barcode-0.98/cmdline.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * cmdline.h -- generic commandline editing (uses getopt, only short) - * - * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) - * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - */ - -/* - * The options may have different arguments of different type - */ -enum option_type { - CMDLINE_NONE=0, /* no argument after option */ - CMDLINE_I, /* integer (any base) */ - CMDLINE_D, /* decimal integer */ - CMDLINE_X, /* hex integer */ - CMDLINE_O, /* octal integer */ - CMDLINE_S, /* string */ - CMDLINE_F, /* double float */ - CMDLINE_P, /* pointer */ -}; - - -struct commandline { - int option; /* Single byte: option id */ - int type; /* Type of argument, used in sscanf */ - void *result; /* Store data here, if non null */ - int (*fun)(void *); /* Call if defined: arg is "result" or input string */ - char *env; /* Where to get runtime defaults, may be NULL */ - char *default_v; /* The compile-time default, may be NULL */ - char *descrip; /* For err msg. May have %s's for default and env */ -}; - -/* returns: 0 or -1. "optarg" is global (see getopt) */ -extern int commandline(struct commandline *args, - int argc, char **argv, char *errorhead); - -/* prints an error message based on "args" */ -extern int commandline_errormsg(FILE *f, struct commandline *args, - char *prgname, char *messagehead); - - - - diff --git a/glabels2/barcode-0.98/codabar.c b/glabels2/barcode-0.98/codabar.c deleted file mode 100644 index 7065b9ea..00000000 --- a/glabels2/barcode-0.98/codabar.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - * codabar.c -- encoding for Codabar - * - * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include - -#include "barcode.h" - - -/* this is ordered in decades to simplify encoding */ -static char alphabet[] = - "0123456789" "-$:/.+ABCD"; - -#define CODE_A 16 -#define CODE_B 17 - -#define NARROW 12 -#define WIDE 14 - -/* Patterns */ -static char *patterns[] = { -"1111133","1111331","1113113","3311111","1131131", -"3111131","1311113","1311311","1331111","3113111", -"1113311","1133111","3111313","3131113","3131311", -"1131313","1133131","1313113","1113133","1113331" }; - -/* - * Check that the text can be encoded. Returns 0 or -1. - * If it's all lowecase convert to uppercase and accept it. - * If the first character is a letter (A to D), the last one must be too; - * no other character should be a letter. - */ -int Barcode_cbr_verify(unsigned char *text) -{ - int i, lower=0, upper=0; - int startpresent = 0; - - if (!strlen(text)) - return -1; - for (i=0; text[i]; i++) { - char * pos; - if (isupper(text[i])) upper++; - if (islower(text[i])) lower++; - pos = strchr(alphabet,toupper(text[i])); - if (!pos) - return -1; - if (i == 0 && pos - alphabet >= CODE_A) - startpresent = 1; - else if (pos - alphabet >= CODE_A && - (!startpresent || i != strlen(text) - 1)) - return -1; - } - if (lower && upper) - return -1; - return 0; -} - -static int add_one(char *ptr, int code) -{ - sprintf(ptr,"1%s", /* separator */ patterns[code]); - return 0; -} - -/* - * The encoding functions fills the "partial" and "textinfo" fields. - * Lowercase chars are converted to uppercase - */ -int Barcode_cbr_encode(struct Barcode_Item *bc) -{ - static char *text; - static char *partial; /* dynamic */ - static char *textinfo; /* dynamic */ - char *c, *ptr, *textptr; - int i, code, textpos, usesum, checksum = 0, startpresent; - - if (bc->partial) - free(bc->partial); - if (bc->textinfo) - free(bc->textinfo); - bc->partial = bc->textinfo = NULL; /* safe */ - - if (!bc->encoding) - bc->encoding = strdup("codabar"); - - text = bc->ascii; - if (!text) { - bc->error = EINVAL; - return -1; - } - /* the partial code is 8 * (head + text + check + tail) + margin + term. */ - partial = malloc( (strlen(text) + 3) * 8 + 2); - if (!partial) { - bc->error = errno; - return -1; - } - - /* the text information is at most "nnn:fff:c " * (strlen + check) +term */ - textinfo = malloc(10*(strlen(text) + 1) + 2); - if (!textinfo) { - bc->error = errno; - free(partial); - return -1; - } - - ptr = partial; - textptr = textinfo; - textpos = 0; - usesum = bc->flags & BARCODE_NO_CHECKSUM ? 0 : 1; - /* if no start character specified, A is used as a start character */ - if (!isalpha(text[0])) { - add_one(ptr, CODE_A); - ptr += strlen(ptr); - textpos = WIDE; - checksum = CODE_A; - startpresent = 0; - } else { - startpresent = 1; - } - for (i=0; ierror = EINVAL; /* impossible if text is verified */ - free(partial); - free(textinfo); - return -1; - } - code = c - alphabet; - add_one(ptr, code); - sprintf(textptr, "%i:12:%c ", textpos, toupper(text[i])); - textpos += code < 12 ? NARROW : WIDE; - textptr += strlen(textptr); - ptr += strlen(ptr); - checksum += code; - if (startpresent && usesum && i == strlen(text) - 2) { - /* stuff a check symbol before the stop */ - c = strchr(alphabet, toupper(text[i+1])); - if (!c) /* impossible */ - continue; - code = c - alphabet; - checksum += code; - - /* Complement to a multiple of 16 */ - checksum = (checksum + 15) / 16 * 16 - checksum; - add_one(ptr, checksum); - ptr += strlen(ptr); - } - } - if (!startpresent) { - if (usesum) { - /* if no start character specified, B is used as a stop char */ - checksum += CODE_B; - checksum = (checksum + 15) / 16 * 16 - checksum; - add_one(ptr, checksum); - ptr += strlen(ptr); - } - add_one(ptr, CODE_B); - } - bc->partial = partial; - bc->textinfo = textinfo; - - return 0; -} diff --git a/glabels2/barcode-0.98/code128.c b/glabels2/barcode-0.98/code128.c deleted file mode 100644 index cebba54c..00000000 --- a/glabels2/barcode-0.98/code128.c +++ /dev/null @@ -1,607 +0,0 @@ -/* - * code128.c -- encoding for code128 (A, B, C) - * - * Copyright (c) 1999,2000 Alessandro Rubini (rubini@gnu.org) - * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) - * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include - -#include "barcode.h" - -static char *codeset[] = { - "212222", "222122", "222221", "121223", "121322", /* 0 - 4 */ - "131222", "122213", "122312", "132212", "221213", - "221312", "231212", "112232", "122132", "122231", /* 10 - 14 */ - "113222", "123122", "123221", "223211", "221132", - "221231", "213212", "223112", "312131", "311222", /* 20 - 24 */ - "321122", "321221", "312212", "322112", "322211", - "212123", "212321", "232121", "111323", "131123", /* 30 - 34 */ - "131321", "112313", "132113", "132311", "211313", - "231113", "231311", "112133", "112331", "132131", /* 40 - 44 */ - "113123", "113321", "133121", "313121", "211331", - "231131", "213113", "213311", "213131", "311123", /* 50 - 54 */ - "311321", "331121", "312113", "312311", "332111", - "314111", "221411", "431111", "111224", "111422", /* 60 - 64 */ - "121124", "121421", "141122", "141221", "112214", - "112412", "122114", "122411", "142112", "142211", /* 70 - 74 */ - "241211", "221114", "413111", "241112", "134111", - "111242", "121142", "121241", "114212", "124112", /* 80 - 84 */ - "124211", "411212", "421112", "421211", "212141", - "214121", "412121", "111143", "111341", "131141", /* 90 - 94 */ - "114113", "114311", "411113", "411311", "113141", - "114131", "311141", "411131", "b1a4a2", "b1a2a4", /* 100 - 104 */ - "b1a2c2", "b3c1a1b" -}; - -#define START_A 103 -#define START_B 104 -#define START_C 105 -#define STOP 106 -#define SHIFT 98 /* only A and B */ -#define CODE_A 101 /* only B and C */ -#define CODE_B 100 /* only A and C */ -#define CODE_C 99 /* only A and B */ -#define FUNC_1 102 /* all of them */ -#define FUNC_2 97 /* only A and B */ -#define FUNC_3 96 /* only A and B */ -/* FUNC_4 is CODE_A when in A and CODE_B when in B */ - -#define SYMBOL_WID 11 /* all of them are 11-bar wide */ - -/* - * code 128-b includes all printable ascii chars - */ - -int Barcode_128b_verify(unsigned char *text) -{ - if (text[0] == '\0') - return -1; - while (*text && *text>=32 && !(*text&0x80)) - text++; - if (*text) - return -1; /* a non-ascii char */ - return 0; /* ok */ -} - -int Barcode_128b_encode(struct Barcode_Item *bc) -{ - static char *text; - static char *partial; /* dynamic */ - static char *textinfo; /* dynamic */ - char *textptr; - int i, code, textpos, checksum = 0; - - if (bc->partial) - free(bc->partial); - if (bc->textinfo) - free(bc->textinfo); - bc->partial = bc->textinfo = NULL; /* safe */ - - if (!bc->encoding) - bc->encoding = strdup("code 128-B"); - - text = bc->ascii; - if (!text) { - bc->error = EINVAL; - return -1; - } - /* the partial code is 6* (head + text + check + tail) + final + term. */ - partial = malloc( (strlen(text) + 4) * 6 +2); - if (!partial) { - bc->error = errno; - return -1; - } - - /* the text information is at most "nnn:fff:c " * strlen +term */ - textinfo = malloc(10*strlen(text) + 2); - if (!textinfo) { - bc->error = errno; - free(partial); - return -1; - } - - /* up to now, it was the same code as other encodings */ - - strcpy(partial, "0"); /* the first space */ - strcat(partial, codeset[START_B]); - checksum += START_B; /* the start char is counted in the checksum */ - textptr = textinfo; - textpos = SYMBOL_WID; - - for (i=0; ierror = EINVAL; /* impossible if text is verified */ - free(partial); - free(textinfo); - return -1; - } - code = text[i]-32; - strcat(partial, codeset[code]); - checksum += code * (i+1); /* first * 1 + second * 2 + third * 3... */ - sprintf(textptr, "%i:12:%c ", textpos, text[i]); - textptr += strlen(textptr); - textpos += SYMBOL_WID; /* width of each code */ - } - /* Add the checksum, independent of BARCODE_NO_CHECKSUM */ - checksum %= 103; - strcat(partial, codeset[checksum]); - /* and the end marker */ - strcat(partial, codeset[STOP]); - - bc->partial = partial; - bc->textinfo = textinfo; - - return 0; -} - -/* - * code 128-c is only digits, but two per symbol - */ - -int Barcode_128c_verify(unsigned char *text) -{ - if (text[0] == '\0') - return -1; - /* must be an even number of digits */ - if (strlen(text)%2) - return -1; - /* and must be all digits */ - for (; *text; text++) - if (!isdigit(*text)) - return -1; - return 0; -} - -int Barcode_128c_encode(struct Barcode_Item *bc) -{ - static char *text; - static char *partial; /* dynamic */ - static char *textinfo; /* dynamic */ - char *textptr; - int i, code, textpos, checksum = 0; - - if (bc->partial) - free(bc->partial); - if (bc->textinfo) - free(bc->textinfo); - bc->partial = bc->textinfo = NULL; /* safe */ - - if (!bc->encoding) - bc->encoding = strdup("code 128-C"); - - text = bc->ascii; - if (!text) { - bc->error = EINVAL; - return -1; - } - /* the partial code is 6* (head + text + check + tail) + final + term. */ - partial = malloc( (strlen(text) + 3) * 6 +2); - if (!partial) { - bc->error = errno; - return -1; - } - - /* the text information is at most "nnn.5:fff:c " * strlen +term */ - textinfo = malloc(12*strlen(text) + 2); - if (!textinfo) { - bc->error = errno; - free(partial); - return -1; - } - - strcpy(partial, "0"); /* the first space */ - strcat(partial, codeset[START_C]); - checksum += START_C; /* the start char is counted in the checksum */ - textptr = textinfo; - textpos = SYMBOL_WID; - - for (i=0; text[i]; i+=2) { - if (!isdigit(text[i]) || !isdigit(text[i+1])) { - bc->error = EINVAL; /* impossible if text is verified */ - free(partial); - free(textinfo); - return -1; - } - code = (text[i]-'0') * 10 + text[i+1]-'0'; - strcat(partial, codeset[code]); - checksum += code * (i/2+1); /* first * 1 + second * 2 + third * 3... */ - - /* print as "%s", because we have ".5" positions */ - sprintf(textptr, "%g:9:%c %g:9:%c ", (double)textpos, text[i], - textpos + (double)SYMBOL_WID/2, text[i+1]); - textptr += strlen(textptr); - textpos += SYMBOL_WID; /* width of each code */ - } - /* Add the checksum, independent of BARCODE_NO_CHECKSUM */ - checksum %= 103; - strcat(partial, codeset[checksum]); - /* and the end marker */ - strcat(partial, codeset[STOP]); - - bc->partial = partial; - bc->textinfo = textinfo; - - return 0; -} - -/* - * generic (full-featured) code128 implementation: it selects between - * A, B, C according to the data being encoded. F1, F2, F3, F4 are expressed - * using ascii chars 0xc1, 0xc2, 0xc3, 0xc4 (0301, 0302, 0303, 0304). - * Char '\0' is expressed by 0x80 (0200). - */ - -int Barcode_128_verify(unsigned char *text) -{ - if (text[0] == '\0') - return -1; - while (*text && (*text<=0x80 || (*text >= 0xc1 && *text <= 0xc4))) - text++; - if (*text) - return -1; /* unencodable character */ - return 0; /* ok */ -} - - -/* - * These functions are extracted from Barcode_128_encode for clarity. - * It deals with choosing the symbols used to represent the text - * and returns a dynamic array of integers, terminated by -1. - * - * The algorithm used in choosing the codes comes from App 2 of - * "El Codigo Estandar EAN/UCC 128", courtesy of AECOC, Spain. - * Thanks to Dani Pardo for getting permission and giving me a copy - * of the document - */ - -#define NEED_CODE_A(c) ((c)<32 || (c)==0x80) -#define NEED_CODE_B(c) ((c)>=96 && (c)<128) - -static int Barcode_a_or_b(unsigned char *text) -{ - for ( ; *text; text++) { - if (NEED_CODE_A(*text)) - return 'A'; - if (NEED_CODE_B(*text)) - return 'B'; - } - return 0; /* any */ -} - -/* code is either 'A' or 'B', and value must be valid */ -static int Barcode_encode_as(int code, int value) -{ - - /* first check the special chars */ - if (value == 0xC1) return FUNC_1; - if (value == 0xC2) return FUNC_2; - if (value == 0xC3) return FUNC_3; - if (value == 0xC4) { /* F4 */ - if (code == 'A') return CODE_A; - return CODE_B; - } - - /* then check ascii values */ - if (value >= 0x20 && value <= 0x5F) - return value - 0x20; /* both codes */ - if (value == 0x80) return 64; /* code A */ - if (value < 0x20) return value+64; /* code A */ - if (value >= 0x60) return value - 0x20; /* code B */ - /* can't happen */ - return -1; -} - -static int *Barcode_128_make_array(struct Barcode_Item *bc, int *lptr) -{ - int len, *codes; - unsigned char *s; - int i=0, j, code, checksum; - - /* allocate twice the text length + 5, as this is the worst case */ - len = 2 * strlen(bc->ascii) + 5; - codes = malloc(len * sizeof(int)); - s = bc->ascii; - - /* choose the starting code */ - if (s[2]=='\0' && isdigit(s[0]) && isdigit(s[1])) { - code = 'C'; - } else if (isdigit(s[0])&&isdigit(s[1]) && isdigit(s[2])&&isdigit(s[3])) { - code = 'C'; - } else { - code = Barcode_a_or_b(s); - if (!code) code = 'B'; /* default */ - } - codes[i++] = START_A + code - 'A'; - - for (s = bc->ascii; *s; /* increments are in the loop */) { - switch(code) { - - case 'C': - if (s[0] == 0xC1) { /* F1 is valid */ - codes[i++] = FUNC_1; - s++; - } else if (isdigit(s[0]) && isdigit(s[1])) { - /* encode two digits */ - codes[i++] = (s[0]-'0') * 10 + s[1]-'0'; - s += 2; - } else { - /* change code */ - code = Barcode_a_or_b(s); - if (!code) code = 'B'; - codes[i++] = (code == 'A') ? CODE_A : CODE_B; - } - break; - - case 'B': - case 'A': - for (j=0; isdigit(s[j]); j++) - ; - if (j>=4) { /* if there are 4 or more digits, turn to C */ - if (j&1) { - /* odd number: encode one first */ - codes[i++] = *(s++) - ' '; - } - codes[i++] = CODE_C; - code = 'C'; - } else if (code == 'A' && NEED_CODE_B(*s)) { - /* check whether we should use SHIFT or change code */ - j = Barcode_a_or_b(s+1); - if (j == 'B') { - codes[i++] = CODE_B; - code = 'B'; - } else { - codes[i++] = SHIFT; - codes[i++] = Barcode_encode_as('B', *s); - s++; - } - } else if (code == 'B' && NEED_CODE_A(*s)) { - /* check whether we should use SHIFT or change code */ - j = Barcode_a_or_b(s+1); - if (j == 'A') { - codes[i++] = CODE_A; - code = 'A'; - } else { - codes[i++] = SHIFT; - codes[i++] = Barcode_encode_as('A', *s); - s++; - } - } else { - codes[i++] = Barcode_encode_as(code, *s); - s++; - } - break; - } - } - /* add the checksum */ - checksum = codes[0]; - for (j=1; j len) { - fprintf(stderr, "impossible: length is > allocated len\n"); - } - *lptr = i; - return codes; -} - -/* - * Encoding is tricky, in that we cannot print the ascii - * representation in an easy way. Therefore, just skip non-printable - * chars and try to fit the rest somehow. - */ -int Barcode_128_encode(struct Barcode_Item *bc) -{ - static char *text; - static char *partial; /* dynamic */ - static char *textinfo; /* dynamic */ - char *textptr; - int *codes; /* dynamic */ - int i, c, len; - double textpos, size, step; - - if (bc->partial) - free(bc->partial); - if (bc->textinfo) - free(bc->textinfo); - bc->partial = bc->textinfo = NULL; /* safe */ - - if (!bc->encoding) - bc->encoding = strdup("code 128"); - - text = bc->ascii; - if (!text) { - bc->error = EINVAL; - return -1; - } - - codes = Barcode_128_make_array(bc, &len); - if (!codes) return -1; - - /* the partial code is 6*codelen + ini + term (+margin) */ - partial = malloc( 6 * len + 4); - if (!partial) { - bc->error = errno; - free(codes); - return -1; - } - - /* the text information is at most "nnn.n:ff.f:c " * strlen +term */ - textptr = textinfo = malloc(13*strlen(text) + 2); - if (!textinfo) { - bc->error = errno; - free(partial); - free(codes); - return -1; - } - - /* up to now, it was almost the same code as other encodings */ - - strcpy(partial, "0"); /* the first space */ - for (i=0; i 12.0) size = 12.0; - - /* align the text to the left, using its natural size */ - step = (int)(10 * (size/18.0 * SYMBOL_WID) + .5) / 10.0; - textpos = SYMBOL_WID; - - for (i=0; i 0xc0) c = ' '; /* F code */ - sprintf(textptr, "%g:%g:%c ", textpos, size, c); - textptr += strlen(textptr); - textpos += step; - } - - bc->partial = partial; - bc->textinfo = textinfo; - free(codes); - return 0; -} - -/* - * A raw 128 code is given as a sequence of space separated numbers - * from 0 to 105, starting from the start code to be (Leonid) - */ - -int Barcode_128raw_verify(unsigned char *text) -{ - int n; - unsigned val; - - if (!strlen(text)) - return -1; - while (*text) { - if (sscanf(text, "%u%n", &val, &n) < 1) - return -1; - if (val > 105) - return -1; - text += n; - } - return 0; -} - -int Barcode_128raw_encode(struct Barcode_Item *bc) -{ - static char *text; - static char *partial; /* dynamic */ - static char *textinfo; /* dynamic */ - char *textptr; - int i, n, count, code, textpos, checksum = 0; - - if (bc->partial) - free(bc->partial); - if (bc->textinfo) - free(bc->textinfo); - bc->partial = bc->textinfo = NULL; /* safe */ - - if (!bc->encoding) - bc->encoding = strdup("128raw"); - - text = bc->ascii; - if (!text) { - bc->error = EINVAL; - return -1; - } - /* - * length of partial code is unknown in advance, but it is - * at most 6* (1+text/2 + check + tail) + final + terminator - */ - partial = malloc( (3+ strlen(text)/2) * 6 + 2); - if (!partial) { - bc->error = errno; - return -1; - } - - /* the text information is at most "nnn.5:fff:c " * 1+strlen/2 +term */ - textinfo = malloc(12 * (1+strlen(text)/2) + 2); - if (!textinfo) { - bc->error = errno; - free(partial); - return -1; - } - - strcpy(partial, "0"); /* the first space */ - textptr = textinfo; - textpos = 0; - - for (i=0, count = 0; i < strlen(text); count++) { - if (sscanf(text + i, "%u%n", &code, &n) < 1) { - bc->error = EINVAL; /* impossible if text is verified */ - free(partial); - free(textinfo); - return -1; - } - strcat(partial, codeset[code]); - - /* - * since the start code is part of the "raw" input, it is - * counted in the checksum by itself - */ - if (!count) checksum += code; /* the start code */ - else checksum += code * count; /* first * 1 + second * 2 ... */ - - /* - * print as "%s", because we have ".5" positions - * also, use a size of 9 like codeC above, as each symbol is - * represented by two chars - */ - sprintf(textptr, "%g:9:%c %g:9:%c ", (double)textpos, - code >= 100 ? 'A' : code/10 + '0', - textpos + (double)SYMBOL_WID/2, code%10 + '0'); - textptr += strlen(textptr); - textpos += SYMBOL_WID; /* width of each code */ - i += n; - } - /* Add the checksum, independent of BARCODE_NO_CHECKSUM */ - checksum %= 103; - strcat(partial, codeset[checksum]); - /* and the end marker */ - strcat(partial, codeset[STOP]); - - bc->partial = partial; - bc->textinfo = textinfo; - - return 0; -} - diff --git a/glabels2/barcode-0.98/code39.c b/glabels2/barcode-0.98/code39.c deleted file mode 100644 index 3308c950..00000000 --- a/glabels2/barcode-0.98/code39.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - * code39.c -- encoding for code39 - * - * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) - * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include - -#include "barcode.h" - - -/* this is ordered in decades to simplify encoding */ -static char alphabet[] = - "1234567890" "ABCDEFGHIJ" "KLMNOPQRST" "UVWXYZ-. *" "$/+%"; - -/* the checksum alphabet has a different order */ -static char checkbet[] = - "0123456789" "ABCDEFGHIJ" "KLMNOPQRST" "UVWXYZ-. $" "/+%"; - -/* The first 40 symbols repeat this bar pattern */ -static char *bars[] = { - "31113","13113","33111","11313","31311", - "13311","11133","31131","13131","11331"}; - -/* The first 4 decades use these space patterns */ -static char *spaces[] = {"1311","1131","1113","3111"}; - -/* the last four symbols are special */ -static char *specialbars[] = { - "11111","11111","11111","11111"}; - -static char *specialspaces[] = { - "3331","3313","3133","1333"}; - -static char *fillers[]= { - "0a3a1c1c1a", - "1a3a1c1c1a" -}; - - -/* - * Check that the text can be encoded. Returns 0 or -1. - * If it's all lowecase convert to uppercase and accept it - */ -int Barcode_39_verify(unsigned char *text) -{ - int i, lower=0, upper=0; - - if (text[0] == '\0') - return -1; - for (i=0; text[i]; i++) { - if (isupper(text[i])) upper++; - if (islower(text[i])) lower++; - if (!strchr(alphabet,toupper(text[i]))) - return -1; - } - if (lower && upper) - return -1; - return 0; -} - -static int add_one(char *ptr, int code) -{ - char *b, *s; - - if (code < 40) { - b = bars[code%10]; - s = spaces[code/10]; - } else { - b = specialbars[code-40]; - s = specialspaces[code-40]; - } - sprintf(ptr,"1%c%c%c%c%c%c%c%c%c", /* separator */ - b[0], s[0], b[1], s[1], b[2], s[2], - b[3], s[3], b[4]); - return 0; -} - -/* - * The encoding functions fills the "partial" and "textinfo" fields. - * Lowercase chars are converted to uppercase - */ -int Barcode_39_encode(struct Barcode_Item *bc) -{ - static char *text; - static char *partial; /* dynamic */ - static char *textinfo; /* dynamic */ - char *c, *ptr, *textptr; - int i, code, textpos, checksum = 0; - - if (bc->partial) - free(bc->partial); - if (bc->textinfo) - free(bc->textinfo); - bc->partial = bc->textinfo = NULL; /* safe */ - - if (!bc->encoding) - bc->encoding = strdup("code 39"); - - text = bc->ascii; - if (!text) { - bc->error = EINVAL; - return -1; - } - /* the partial code is 10* (head + text + check + tail) + margin + term. */ - partial = malloc( (strlen(text) + 3) * 10 +2); - if (!partial) { - bc->error = errno; - return -1; - } - - /* the text information is at most "nnn:fff:c " * strlen +term */ - textinfo = malloc(10*strlen(text) + 2); - if (!textinfo) { - bc->error = errno; - free(partial); - return -1; - } - - strcpy(partial, fillers[0]); - ptr = partial + strlen(partial); - textptr = textinfo; - textpos = 22; - - for (i=0; text[i]; i++) { - c = strchr(alphabet, toupper(text[i])); - if (!c) { - bc->error = EINVAL; /* impossible if text is verified */ - free(partial); - free(textinfo); - return -1; - } - code = c - alphabet; - add_one(ptr, code); - c = strchr(checkbet,*c); - if (c) /* the '*' is not there */ - checksum += (c-checkbet); - sprintf(textptr, "%i:12:%c ", textpos, toupper(text[i])); - - textpos += 16; /* width of each code */ - textptr += strlen(textptr); - ptr += strlen(ptr); - } - /* Add the checksum */ - if ( (bc->flags & BARCODE_NO_CHECKSUM)==0 ) { - code = (strchr(alphabet, checkbet[checksum % 43]) - alphabet); - add_one(ptr, code); - } - strcat(ptr, fillers[1]); /* end */ - bc->partial = partial; - bc->textinfo = textinfo; - - return 0; -} diff --git a/glabels2/barcode-0.98/code93.c b/glabels2/barcode-0.98/code93.c deleted file mode 100644 index 73f8cee3..00000000 --- a/glabels2/barcode-0.98/code93.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - * code39.c -- encoding for code39 - * - * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) - * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) - * Copyright (c) 2001 Nathan D. Holmes / FedEx Services (ndholmes@fedex.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include - -#include "barcode.h" - - -/* this is ordered in decades to simplify encoding */ -static char alphabet[] = - "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"; - -static char *codeset[] = { - "131112", "111213", "111312", "111411", "121113", /* 0 - 4 */ - "121212", "121311", "111114", "131211", "141111", /* 5 - 9 */ - "211113", "211212", "211311", "221112", "221211", /* A - E */ - "231111", "112113", "112212", "112311", "122112", /* F - J */ - "132111", "111123", "111222", "111321", "121122", /* K - O */ - "131121", "212112", "212211", "211122", "211221", /* P - T */ - "221121", "222111", "112122", "112221", "122121", /* U - Y */ - "123111", "121131", "311112", "311211", "321111", /* Z - $ */ - "112131", "113121", "211131", "121221", "312111", /* / - (%) */ - "311121", "122211", "111141" /* (/) - (terminator) */ -}; - - -/* 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111 */ -/* 00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222 */ -/* 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 */ -static char shiftset[] = - "%$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%% /// ///// / /%%%%%% %%%%%%++++++++++++++++++++++++++%%%%%"; -static char shiftset2[] = - "UABCDEFGHIJKLMNOPQRSTUVWXYZABCDE ABC FGHIJ L ZFGHIJV KLMNOWABCDEFGHIJLKMNOPQRSTUVWXYZPQRST"; - -#define START_STOP 47 -#define EXTEND_DOLLAR 43 -#define EXTEND_PERCENT 44 -#define EXTEND_SLASH 45 -#define EXTEND_PLUS 46 - -/* - * Check that the text can be encoded. Returns 0 or -1. - * All of ASCII-7 is accepted. - */ -int Barcode_93_verify(unsigned char *text) -{ - int i; - - if (!strlen(text)) - return -1; - for (i=0; text[i]; i++) { - - /* Test if beyond the range of 7-bit ASCII */ - if ((int)text[i] > 127) - return -1; - } - return 0; -} - -/* - * The encoding functions fills the "partial" and "textinfo" fields. - * Lowercase chars are converted to uppercase - */ -int Barcode_93_encode(struct Barcode_Item *bc) -{ - static unsigned char *text; - static char *partial; /* dynamic */ - static char *textinfo; /* dynamic */ - char *c, *textptr; - int *checksum_str; - int i, code, textpos, checksum_len=0; - int c_checksum = 0; - int k_checksum = 0; - - if (bc->partial) - free(bc->partial); - if (bc->textinfo) - free(bc->textinfo); - bc->partial = bc->textinfo = NULL; /* safe */ - - if (!bc->encoding) - bc->encoding = strdup("code 93"); - - text = bc->ascii; - if (!text) { - bc->error = EINVAL; - return -1; - } - - /* the partial code is 6 * (head + 2* text + 2* check + tail) + margin + term. */ - partial = malloc( (strlen(text) *2 + 4) * 6 +2); - if (!partial) { - bc->error = errno; - return -1; - } - - checksum_str = (int *)malloc( (strlen(text) + 3) * 2 * sizeof(int)); - if (!checksum_str) { - free(partial); - bc->error = errno; - return -1; - } - - /* the text information is at most "nnn:fff:c " * strlen +term */ - textinfo = malloc(10*strlen(text) + 2); - if (!textinfo) { - bc->error = errno; - free(partial); - free(checksum_str); - return -1; - } - - textptr = textinfo; - textpos = 22; - strcpy(partial, "0"); - strcat(partial, codeset[START_STOP]); - - for (i=0; iflags & BARCODE_NO_CHECKSUM)==0 ) - { - for(i=1; i<=checksum_len; i++) - { - c_checksum += i * (int)checksum_str[checksum_len - i]; - k_checksum += (i+1) * (int)checksum_str[checksum_len - i]; - } - - c_checksum = c_checksum % 47; - k_checksum += c_checksum; - k_checksum = k_checksum % 47; - - strcat(partial, codeset[c_checksum]); - strcat(partial, codeset[k_checksum]); - - } - strcat(partial, codeset[START_STOP]); /* end */ - - /* Encodes final 1-unit width bar to turn the start character into a stop char */ - strcat(partial, "1"); - bc->partial = partial; - bc->textinfo = textinfo; - - return 0; -} diff --git a/glabels2/barcode-0.98/compat/getopt.c b/glabels2/barcode-0.98/compat/getopt.c deleted file mode 100644 index 91f00b55..00000000 --- a/glabels2/barcode-0.98/compat/getopt.c +++ /dev/null @@ -1,831 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in . - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -#define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -#include -#if defined (_LIBC) || defined (HAVE_UNISTD_H) -#include -#endif -#endif /* GNU C library. */ - -#ifdef VMS -#include -#if HAVE_STRING_H - 0 -#include -#endif -#endif - -#ifdef WIN32 -/* It's not Unix, really. See? Capital letters. */ -#include -#define getpid() GetCurrentProcessId() -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -#ifdef HAVE_LIBINTL_H -# include -# define _(msgid) gettext (msgid) -#else -# define _(msgid) (msgid) -#endif -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg = NULL; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* XXX 1003.2 says this must be 1 before any call. */ -int optind = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return EOF with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -#include -#define my_index strchr -#else - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -char *getenv (); - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -#if !defined (__STDC__) || !__STDC__ -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -#endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -static const char *nonoption_flags; -static int nonoption_flags_len; - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined (__STDC__) && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined (__STDC__) && __STDC__ -static const char *_getopt_initialize (const char *); -#endif -static const char * -_getopt_initialize (optstring) - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind = 1; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - - if (posixly_correct == NULL) - { - /* Bash 2.0 puts a special variable in the environment for each - command it runs, specifying which ARGV elements are the results of - file name wildcard expansion and therefore should not be - considered as options. */ - char var[100]; - sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); - nonoption_flags = getenv (var); - if (nonoption_flags == NULL) - nonoption_flags_len = 0; - else - nonoption_flags_len = strlen (nonoption_flags); - } - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns `EOF'. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - optarg = NULL; - - if (optind == 0) - { - optstring = _getopt_initialize (optstring); - optind = 1; /* Don't scan ARGV[0], the program name. */ - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. */ -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && nonoption_flags[optind] == '1')) - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return EOF; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return EOF; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - -#ifdef lint /* Suppress `used before initialized' warning. */ - indfound = 0; -#endif - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if (nameend - nextchar == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* _LIBC or not __GNU_LIBRARY__. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == EOF) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/glabels2/barcode-0.98/compat/getopt.h b/glabels2/barcode-0.98/compat/getopt.h deleted file mode 100644 index 952f4830..00000000 --- a/glabels2/barcode-0.98/compat/getopt.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -#if defined (__STDC__) && __STDC__ - const char *name; -#else - char *name; -#endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* __GNU_LIBRARY__ */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -#else /* not __STDC__ */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* _GETOPT_H */ diff --git a/glabels2/barcode-0.98/configure b/glabels2/barcode-0.98/configure deleted file mode 100755 index f0e5d457..00000000 --- a/glabels2/barcode-0.98/configure +++ /dev/null @@ -1,5197 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57. -# -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# 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 Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; 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 - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - 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 - - ;; - 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 - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # 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 sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_config_libobj_dir=. -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="barcode.h" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_STAT_H -# include -#endif -#if STDC_HEADERS -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif -#if HAVE_STRINGS_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif -#if HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP GETOPT_O NO_GETOPT NO_LIBPAPER LIBPAPER NO_STRERROR GMAKEDEPEND0 GMAKEDEPEND1 GMAKEDEPEND2 LIBOBJS LTLIBOBJS MAKEINFO REMOVEHTMLTAGS INFOTOHTML' -ac_subst_files='' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# 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. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -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 - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -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 | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$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 ;; - - -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 ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - 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 ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=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 ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - 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'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -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 - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - 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 - - -# 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 its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - 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 - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - -# -# 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 \`..'] - -_ACEOF - - cat <<_ACEOF -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] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --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] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -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 - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style 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 - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -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 0 -fi -exec 5>config.log -cat >&5 <<_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.57. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -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` -hostinfo = `(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=. - echo "PATH: $as_dir" -done - -} >&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_sep= -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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$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 - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - sed "/^$/d" confdefs.h | sort - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >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 - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - 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. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -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 `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -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 - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`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. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -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 -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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_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" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -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 - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - 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 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out 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. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$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 -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* 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; -} -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 -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext -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}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; 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 - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -if test x$GCC = xyes; then - CFLAGS="$CFLAGS -Wall" -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 -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f 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 -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -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 - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f 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 >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#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)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -if test "${ac_cv_header_getopt_h+set}" = set; then - echo "$as_me:$LINENO: checking for getopt.h" >&5 -echo $ECHO_N "checking for getopt.h... $ECHO_C" >&6 -if test "${ac_cv_header_getopt_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_getopt_h" >&5 -echo "${ECHO_T}$ac_cv_header_getopt_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking getopt.h usability" >&5 -echo $ECHO_N "checking getopt.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking getopt.h presence" >&5 -echo $ECHO_N "checking getopt.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: getopt.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: getopt.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: getopt.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: getopt.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: getopt.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: getopt.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: getopt.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: getopt.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: getopt.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: getopt.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for getopt.h" >&5 -echo $ECHO_N "checking for getopt.h... $ECHO_C" >&6 -if test "${ac_cv_header_getopt_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_getopt_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_getopt_h" >&5 -echo "${ECHO_T}$ac_cv_header_getopt_h" >&6 - -fi -if test $ac_cv_header_getopt_h = yes; then - : -else - NO_GETOPT=-DNO_GETOPT;GETOPT_O=compat/getopt.o -fi - - -if test "${ac_cv_header_paper_h+set}" = set; then - echo "$as_me:$LINENO: checking for paper.h" >&5 -echo $ECHO_N "checking for paper.h... $ECHO_C" >&6 -if test "${ac_cv_header_paper_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_paper_h" >&5 -echo "${ECHO_T}$ac_cv_header_paper_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking paper.h usability" >&5 -echo $ECHO_N "checking paper.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking paper.h presence" >&5 -echo $ECHO_N "checking paper.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: paper.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: paper.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: paper.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: paper.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: paper.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: paper.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: paper.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: paper.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: paper.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: paper.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for paper.h" >&5 -echo $ECHO_N "checking for paper.h... $ECHO_C" >&6 -if test "${ac_cv_header_paper_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_paper_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_paper_h" >&5 -echo "${ECHO_T}$ac_cv_header_paper_h" >&6 - -fi -if test $ac_cv_header_paper_h = yes; then - LIBPAPER=-lpaper -else - NO_LIBPAPER=-DNO_LIBPAPER -fi - - - -for ac_header in unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -echo "$as_me:$LINENO: checking for strerror" >&5 -echo $ECHO_N "checking for strerror... $ECHO_C" >&6 -if test "${ac_cv_func_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char strerror (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strerror (); -/* 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_strerror) || defined (__stub___strerror) -choke me -#else -char (*f) () = strerror; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != strerror; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_strerror=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_strerror=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_strerror" >&5 -echo "${ECHO_T}$ac_cv_func_strerror" >&6 -if test $ac_cv_func_strerror = yes; then - : -else - NO_STRERROR=-DNO_STRERROR -fi - - -for ac_func in strcasecmp -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* 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_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -echo "$as_me:$LINENO: checking \"for gmake\"" >&5 -echo $ECHO_N "checking \"for gmake\"... $ECHO_C" >&6 -GMAKE=no -${MAKE=make} --version 2> /dev/null | grep GNU > /dev/null && GMAKE=yes -echo "$as_me:$LINENO: result: $GMAKE" >&5 -echo "${ECHO_T}$GMAKE" >&6 -if test "$GMAKE" = "yes"; then - GMAKEDEPEND0='ifeq (.depend,$(wildcard .depend))' - GMAKEDEPEND1='include .depend' - GMAKEDEPEND2='endif' -fi - -echo "$as_me:$LINENO: checking \"if makeinfo can output html\"" >&5 -echo $ECHO_N "checking \"if makeinfo can output html\"... $ECHO_C" >&6 -MAKEINFOHTML=no -${MAKEINFO=makeinfo} --help | grep .--html > /dev/null && MAKEINFOHTML=yes -echo "$as_me:$LINENO: result: $MAKEINFOHTML" >&5 -echo "${ECHO_T}$MAKEINFOHTML" >&6 -if test "$MAKEINFOHTML" = "yes"; then - REMOVEHTMLTAGS="cat" - INFOTOHTML="$MAKEINFO --html" -else - REMOVEHTMLTAGS="sed 's/ifnottex/ifinfo/; s/ifnotinfo/iftex/'" - INFOTOHTML="perl texi2html -monolithic" -fi - - - - - - - - - - - - ac_config_files="$ac_config_files Makefile" -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, don't put newlines in cache variables' values. -# 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. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *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 \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - 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}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ 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[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g -t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g -t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $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} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; 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 - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - 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 - - ;; - 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 - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # 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 sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet 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 - -Configuration files: -$config_files - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.57, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -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=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - 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 -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - - - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - 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 -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@GETOPT_O@,$GETOPT_O,;t t -s,@NO_GETOPT@,$NO_GETOPT,;t t -s,@NO_LIBPAPER@,$NO_LIBPAPER,;t t -s,@LIBPAPER@,$LIBPAPER,;t t -s,@NO_STRERROR@,$NO_STRERROR,;t t -s,@GMAKEDEPEND0@,$GMAKEDEPEND0,;t t -s,@GMAKEDEPEND1@,$GMAKEDEPEND1,;t t -s,@GMAKEDEPEND2@,$GMAKEDEPEND2,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # 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. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# 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 || { (exit 1); exit 1; } -fi - - - - - - - ac_config_files="$ac_config_files doc/Makefile" -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, don't put newlines in cache variables' values. -# 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. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *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 \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - 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}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ 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[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g -t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g -t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $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} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; 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 - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - 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 - - ;; - 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 - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # 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 sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet 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 - -Configuration files: -$config_files - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.57, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -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=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - 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 -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - - - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - 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 -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@GETOPT_O@,$GETOPT_O,;t t -s,@NO_GETOPT@,$NO_GETOPT,;t t -s,@NO_LIBPAPER@,$NO_LIBPAPER,;t t -s,@LIBPAPER@,$LIBPAPER,;t t -s,@NO_STRERROR@,$NO_STRERROR,;t t -s,@GMAKEDEPEND0@,$GMAKEDEPEND0,;t t -s,@GMAKEDEPEND1@,$GMAKEDEPEND1,;t t -s,@GMAKEDEPEND2@,$GMAKEDEPEND2,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -s,@MAKEINFO@,$MAKEINFO,;t t -s,@REMOVEHTMLTAGS@,$REMOVEHTMLTAGS,;t t -s,@INFOTOHTML@,$INFOTOHTML,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # 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. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# 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 || { (exit 1); exit 1; } -fi - - diff --git a/glabels2/barcode-0.98/configure.in.dist b/glabels2/barcode-0.98/configure.in.dist deleted file mode 100644 index 07120b48..00000000 --- a/glabels2/barcode-0.98/configure.in.dist +++ /dev/null @@ -1,65 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -AC_INIT(barcode.h) -AC_PREREQ(2.12) - -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_INSTALL - -dnl Add "-Wall" if this is gcc -if test x$GCC = xyes; then - CFLAGS="$CFLAGS -Wall" -fi - - -dnl Check for getopt and libpaper. If getopt is missing, use our version -AC_CHECK_HEADER(getopt.h, ,NO_GETOPT=-DNO_GETOPT;GETOPT_O=compat/getopt.o) -AC_CHECK_HEADER(paper.h, LIBPAPER=-lpaper, NO_LIBPAPER=-DNO_LIBPAPER) -AC_CHECK_HEADERS(unistd.h) - -AC_CHECK_FUNC(strerror, , NO_STRERROR=-DNO_STRERROR) -AC_CHECK_FUNCS(strcasecmp) - -dnl Check if this is gmake, but allow ovverriding using $MAKE -AC_MSG_CHECKING("for gmake") -GMAKE=no -${MAKE=make} --version 2> /dev/null | grep GNU > /dev/null && GMAKE=yes -AC_MSG_RESULT($GMAKE) -if test "$GMAKE" = "yes"; then - GMAKEDEPEND0='ifeq (.depend,$(wildcard .depend))' - GMAKEDEPEND1='include .depend' - GMAKEDEPEND2='endif' -fi - -dnl Check if we use makeinfo or the local texi2html tool -AC_MSG_CHECKING("if makeinfo can output html") -MAKEINFOHTML=no -${MAKEINFO=makeinfo} --help | grep .--html > /dev/null && MAKEINFOHTML=yes -AC_MSG_RESULT($MAKEINFOHTML) -if test "$MAKEINFOHTML" = "yes"; then - REMOVEHTMLTAGS="cat" - INFOTOHTML="$MAKEINFO --html" -else - REMOVEHTMLTAGS="sed 's/ifnottex/ifinfo/; s/ifnotinfo/iftex/'" - INFOTOHTML="perl texi2html -monolithic" -fi - - -AC_SUBST(GETOPT_O) -AC_SUBST(NO_GETOPT) -AC_SUBST(NO_LIBPAPER) -AC_SUBST(LIBPAPER) -AC_SUBST(NO_STRERROR) -AC_SUBST(GMAKEDEPEND0) -AC_SUBST(GMAKEDEPEND1) -AC_SUBST(GMAKEDEPEND2) - -AC_OUTPUT(Makefile) - -AC_SUBST(MAKEINFO) -AC_SUBST(REMOVEHTMLTAGS) -AC_SUBST(INFOTOHTML) - -AC_OUTPUT(doc/Makefile) - diff --git a/glabels2/barcode-0.98/contrib/barcode-SVG.tar.gz b/glabels2/barcode-0.98/contrib/barcode-SVG.tar.gz deleted file mode 100644 index 69df9562..00000000 Binary files a/glabels2/barcode-0.98/contrib/barcode-SVG.tar.gz and /dev/null differ diff --git a/glabels2/barcode-0.98/contrib/barcode-SVG.tar.gz.README b/glabels2/barcode-0.98/contrib/barcode-SVG.tar.gz.README deleted file mode 100644 index 1608ebaf..00000000 --- a/glabels2/barcode-0.98/contrib/barcode-SVG.tar.gz.README +++ /dev/null @@ -1,24 +0,0 @@ - -[readme written by GNU-barcode maintainer] - -This is a stripped version of what you can find at: - http://www.onefour.net/barcode/SVG/barcode097-SVG.tar.gz - -It's by David J. Humphreys, it's GPL code and the original tarball -(as per the previous URL) contains: - --rwxr--r-- david/david 243 2002-01-02 04:18:00 Makefile --rwxr--r-- david/david 1284 2002-01-08 00:26:42 main.c --rwxr--r-- david/david 37796 2002-01-02 04:33:00 screen1.png --rwxr--r-- david/david 5503 2002-01-08 00:30:00 svg.c --rwxr--r-- david/david 2499 2002-01-02 03:37:00 test1.svg --rwxr--r-- david/david 2499 2002-01-02 03:44:00 test2.svg --rwxr--r-- david/david 2499 2002-01-02 03:49:00 test3.svg --rwxr--r-- david/david 34185 2002-01-02 04:41:00 test4.png --rwxr--r-- david/david 1834 2002-01-02 04:19:00 test4.svg --rwxr--r-- david/david 92713 2002-01-02 04:36:00 transformation.png --rwxr--r-- david/david 586 2002-01-02 04:11:00 transformation.svg - -Here I only included Makefile, main.c, svg.c, after converting -newlines to unix-style and changing permissions. - diff --git a/glabels2/barcode-0.98/contrib/barcode-for-delphi.tar.gz b/glabels2/barcode-0.98/contrib/barcode-for-delphi.tar.gz deleted file mode 100644 index cbc8e676..00000000 Binary files a/glabels2/barcode-0.98/contrib/barcode-for-delphi.tar.gz and /dev/null differ diff --git a/glabels2/barcode-0.98/contrib/barcode-for-delphi.tar.gz.README b/glabels2/barcode-0.98/contrib/barcode-for-delphi.tar.gz.README deleted file mode 100644 index 36d216d7..00000000 --- a/glabels2/barcode-0.98/contrib/barcode-for-delphi.tar.gz.README +++ /dev/null @@ -1,10 +0,0 @@ - -The barcode-for-delphi tarball includes a version of this package -ported to run under Delphi. Please note that you can't distribute the -executable because of the GPL (i.e., disitributing it would be -copyright violation, because the executable is a derived work of GNU -barcode, whose authors don't allow distributing under non-GPL terms. - -I still think it may be useful to some users. - -The code has been contributed by Michael Geddes . diff --git a/glabels2/barcode-0.98/contrib/barcodeps-0.1.tgz b/glabels2/barcode-0.98/contrib/barcodeps-0.1.tgz deleted file mode 100644 index 1dadb1c6..00000000 Binary files a/glabels2/barcode-0.98/contrib/barcodeps-0.1.tgz and /dev/null differ diff --git a/glabels2/barcode-0.98/contrib/barcodeps-0.1.tgz.README b/glabels2/barcode-0.98/contrib/barcodeps-0.1.tgz.README deleted file mode 100644 index b0364f6e..00000000 --- a/glabels2/barcode-0.98/contrib/barcodeps-0.1.tgz.README +++ /dev/null @@ -1,25 +0,0 @@ - - ***** barcodeps 0.1 ***** - 2000-10-07 - -Barcodes generated in PostScript -by Hans Schou http://www.schou.dk - -PostScript is a programming language. It has all the control structures -needed for creating barcodes on the fly. With this example it is not -needed to have another programming language than PostScript as the -barcodes are generated within the PostScript printer. - -This contribution gives some examples of how to generate Interleave 2 of 5 -barcodes. Edit the bottom of i25.ps with a new number and send it to -a PostScript printer to see an example. - -Usage, in PostScript: -To draw a Interleave 2 of 5 use the following command in i25.ps - (123456789) BarCodeI25 - -This method is very usefull used together with other scripts -or programming language as it is only necessary to copy some -files to the printer. No program execution is needed. - - diff --git a/glabels2/barcode-0.98/contrib/grab-0.0.4.tar.gz b/glabels2/barcode-0.98/contrib/grab-0.0.4.tar.gz deleted file mode 100644 index 91fa9e6a..00000000 Binary files a/glabels2/barcode-0.98/contrib/grab-0.0.4.tar.gz and /dev/null differ diff --git a/glabels2/barcode-0.98/contrib/grab-0.0.4.tar.gz.README b/glabels2/barcode-0.98/contrib/grab-0.0.4.tar.gz.README deleted file mode 100644 index 4a048075..00000000 --- a/glabels2/barcode-0.98/contrib/grab-0.0.4.tar.gz.README +++ /dev/null @@ -1,13 +0,0 @@ - -The purpose of this program is to read a (scanned) image containing a -barcode. The image is then interpreted and the barcode is decoded. -The decoded string is outputted to stdout. - -Currently, only Code-128 is supported. - -The program is GPL'd and it's the work of Tuukka Toivonen. - -The home page for this and other programs by Tuukka is - http://www.ee.oulu.fi/~tuukkat/releases.html -while a bare ls-like listing of all packages is at - http://www.ee.oulu.fi/~tuukkat/rel/ diff --git a/glabels2/barcode-0.98/debian/README.debian b/glabels2/barcode-0.98/debian/README.debian deleted file mode 100644 index 7223023a..00000000 --- a/glabels2/barcode-0.98/debian/README.debian +++ /dev/null @@ -1,9 +0,0 @@ -The Debian Package barcode ----------------------------- - -This Debian package is integrated in the upstream release of GNU -barcode, maintained by Alessandro Rubini (rubini@gnu.org, -rubini@prosa.it). Since I have no extended experience with Debian -packages, I'm willing to accept any fixes that seem fit, as well as a -real Debian maintainer for the Debian package. - diff --git a/glabels2/barcode-0.98/debian/changelog b/glabels2/barcode-0.98/debian/changelog deleted file mode 100644 index b43e686f..00000000 --- a/glabels2/barcode-0.98/debian/changelog +++ /dev/null @@ -1,27 +0,0 @@ -barcode (0.98) unstable; urgency=low - - * New upstream release - - -- Alessandro Rubini Fri, 1 Mar 2002 23:04:14 +0100 - -barcode (0.96) unstable; urgency=low - - * New upstream release - - -- Alessandro Rubini Wed, 8 Nov 2000 18:29:18 +0200 - -barcode (0.95) unstable; urgency=low - - * New upstream release - - -- Alessandro Rubini Thu, 3 Feb 2000 21:16:59 +0200 - -barcode (0.94) unstable; urgency=low - - * Initial Release. - - -- Alessandro Rubini Sun, 24 Oct 1999 01:10:23 +0200 - -Local variables: -mode: debian-changelog -End: diff --git a/glabels2/barcode-0.98/debian/control b/glabels2/barcode-0.98/debian/control deleted file mode 100644 index aacbfd49..00000000 --- a/glabels2/barcode-0.98/debian/control +++ /dev/null @@ -1,14 +0,0 @@ -Source: barcode -Section: misc -Priority: optional -Maintainer: Alessandro Rubini -Standards-Version: 2.5.0 - -Package: barcode -Architecture: any -Depends: ${shlibs:Depends} -Description: Creates barcodes in .ps format - GNU barcode can create printouts for the conventional - product packagging standards: UPC-A, UPC-E, EAN-13, EAN-8, ISBN, code 39 - code 128 (b and c), and interleaved 2 of 5 . Ouput is generated as - either Postscript or Encapsulated Postscript. diff --git a/glabels2/barcode-0.98/debian/copyright b/glabels2/barcode-0.98/debian/copyright deleted file mode 100644 index c193af2c..00000000 --- a/glabels2/barcode-0.98/debian/copyright +++ /dev/null @@ -1,8 +0,0 @@ -This package was written by Alessandro Rubini rubini@gnu.org on Sun, 24 Oct 1999 01:10:23 +0200. - -The pristine source can be downloaded from ftp://ftp.gnu.org/pub/barcode -and GNU mirrors. Latest and greatest version (also beta) are immediately -uploaded to ftp://ftp.prosa.it/pub/software. - -Copyright: GPL (see /usr/doc/copyright/GPL) - diff --git a/glabels2/barcode-0.98/debian/dirs b/glabels2/barcode-0.98/debian/dirs deleted file mode 100644 index 6822e402..00000000 --- a/glabels2/barcode-0.98/debian/dirs +++ /dev/null @@ -1,3 +0,0 @@ -usr/bin -usr/include -usr/info diff --git a/glabels2/barcode-0.98/debian/info b/glabels2/barcode-0.98/debian/info deleted file mode 100644 index 18336bfb..00000000 --- a/glabels2/barcode-0.98/debian/info +++ /dev/null @@ -1,15 +0,0 @@ -# This is a configuration files for installing a .info menu -# The Description to be placed into the directory -DESCR="Barcode library and frontend" - -# The section this info file should be placed in (Regexp) followed by -# the new section name to be created if the Regexp does not match -# (Optional. If not given the .info will be appended to the directory) -SECTION_MATCH="[cC]ommands" -SECTION_NAME="General Commands" - -# The file referred to from the Info directory -FILE=barcode.info - -# Optional. The files to be copied to /usr/info -FILES=doc/*.info diff --git a/glabels2/barcode-0.98/debian/rules b/glabels2/barcode-0.98/debian/rules deleted file mode 100755 index c48c5a1c..00000000 --- a/glabels2/barcode-0.98/debian/rules +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/make -f -# Made with the aid of debmake, by Christoph Lameter, -# based on the sample debian/rules file for GNU hello by Ian Jackson. - -package=barcode - -build: - $(checkdir) - ./configure --prefix=/usr - $(MAKE) CFLAGS="-O2 -g -Wall" - touch build - -clean: - $(checkdir) - -rm -f build - -$(MAKE) distclean - -rm -f `find . -name "*~"` - -rm -rf debian/tmp debian/files* core debian/substvars - -binary-indep: checkroot build - $(checkdir) -# There are no architecture-independent files to be uploaded -# generated by this package. If there were any they would be -# made here. - -binary-arch: checkroot build - $(checkdir) - -rm -rf debian/tmp - install -d debian/tmp - cd debian/tmp && install -d `cat ../dirs` - $(MAKE) install prefix=`pwd`/debian/tmp/usr -# Must have debmake installed for this to work. Otherwise please copy -# /usr/bin/debstd into the debian directory and change debstd to debian/debstd - debstd ChangeLog README TODO INSTALL - dpkg-gencontrol - chown -R root.root debian/tmp - chmod -R go=rX debian/tmp - dpkg --build debian/tmp .. - -define checkdir - test -f debian/rules -endef - -binary: binary-indep binary-arch - -checkroot: - $(checkdir) - test root = "`whoami`" - -.PHONY: binary binary-arch binary-indep clean checkroot diff --git a/glabels2/barcode-0.98/doc/Makefile.in b/glabels2/barcode-0.98/doc/Makefile.in deleted file mode 100644 index dae8f6b6..00000000 --- a/glabels2/barcode-0.98/doc/Makefile.in +++ /dev/null @@ -1,135 +0,0 @@ -# -# Makefile (now .in) for the documentation directory -# -# Copyright 1994,2000 rubini@gnu.org (Alessandro Rubini) -# -################# -# -# BE CAREFUL in editing: -# due to the large number of index files, and my use of a non standard -# info input file, any file $(TARGET).* is removed by "make clean" -# -# I chose to use a prefix for the input file ("doc.$(TARGET)"), to ease -# makeing clean and applying my own rules. -# -################################################################### -# -# First of all, retrieve features of makeinfo, to know if we can do images -# and --html. Also, allow MAKEINFO to be specified on the commandline to -# allow me testing with various versions. - -# NOTE: it looks like semi-old versions can do images too, so CANDOIMAGES -# is not (yet?) used - - -MAKEINFO = @MAKEINFO@ -# According to whether this makeinfo can output html, autoconf define these -REMOVEHTMLTAGS = @REMOVEHTMLTAGS@ -INFOTOHTML = @INFOTOHTML@ - -############################################## - - -TARGET = barcode -ALL = $(TARGET).ps $(TARGET).info $(TARGET)doc.txt $(TARGET).html \ - $(TARGET).pdf - -all: $(ALL) terse - -info: $(TARGET).info - -$(TARGET)doc.txt: mktxt - -mpage: all - mv $(TARGET).ps $(TARGET)1.ps - mpage -2A $(TARGET)1.ps > $(TARGET)2.ps && rm $(TARGET)1.ps - -terse: - # preserve the pdf copy - -mv -f $(TARGET).pdf PDF 2> /dev/null && \ - rm -f *~ *.dvi *.log *.aux \ - $(TARGET).*.bak $(TARGET).??? $(TARGET).texinfo && \ - mv PDF $(TARGET).pdf; - - # preserve the ps copy - -mv $(TARGET).ps PS; - -rm -f $(TARGET).??; - -mv PS $(TARGET).ps; - -clean: terse - rm -f $(ALL) $(TARGET)_toc.html - - -#################################################### - -# These rules used to be expressed as "%.texinfo: doc.%" etc. However, this -# is gmake-specific, so I turned every % to $(TARGET), thus loosing generality -# but gaining portability. I also had to drop "$^": it worked with gmake -# and not pmake, while "$<" worked with pmake and not gmake. -# with gmake and not pmake. -# ARub 2000-04-21 - -$(TARGET).texinfo: doc.$(TARGET) - @rm -f $@ 2> /dev/null - sed -f ./infofilter doc.$(TARGET) | $(REMOVEHTMLTAGS) > $@ - chmod 400 $@ - - -# This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-) -# This had to be rewritten too, as "$*" is different in gmake and pmake - -$(TARGET).dvi: $(TARGET).texinfo - -# create a spurious index file to please silly sh (bash will work anyway) - touch $(TARGET).oo - -# get the index list - if test "x`ls $(TARGET).?? $(TARGET).aux`" != "x"; then \ - for i in `ls $(TARGET).?? $(TARGET).aux`; do \ - cp $$i $$i~; \ - done; \ - fi - tex $(TARGET).texinfo - -#check the file list, the file and if needed run TeX again - old="`ls $(TARGET).??~ $(TARGET).aux~ | sed 's/~//g'`"; \ - new="`ls $(TARGET).?? $(TARGET).aux`"; \ - need="n"; \ - if test "$$old" != "$$new"; then need="y"; \ - else \ - for i in `ls $(TARGET).?? $(TARGET).aux`; do \ - cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \ - done; \ - fi; \ - if test "$$need" = "y"; then \ - texindex $(TARGET).?? && tex $(TARGET).texinfo; \ - fi - - -$(TARGET).ps: $(TARGET).dvi - dvips -f $(TARGET).dvi > $@ - -$(TARGET).pdf: $(TARGET).ps - ps2pdf $(TARGET).ps > $@ - -$(TARGET).lj: $(TARGET).dvi - dvilj -e- $(TARGET).dvi > $@ - -$(TARGET).info: $(TARGET).texinfo - makeinfo $(TARGET).texinfo -o $@ - -$(TARGET).html: $(TARGET).texinfo - $(INFOTOHTML) -o $@ $< - -#$(TARGET).man: doc.$(TARGET) -# manpages are created by the toplevel Makefile - -$(TARGET)doc.txt: $(TARGET).info - awk -f ./mktxt $(TARGET).info > $@ - - - - - - - diff --git a/glabels2/barcode-0.98/doc/README b/glabels2/barcode-0.98/doc/README deleted file mode 100644 index 5af5490f..00000000 --- a/glabels2/barcode-0.98/doc/README +++ /dev/null @@ -1,5 +0,0 @@ - -The input file is "doc.barcode". I preprocess this file to -build both a "barcode.texinfo" file and manual pages. - -The intermediat diff --git a/glabels2/barcode-0.98/doc/barcode.info b/glabels2/barcode-0.98/doc/barcode.info deleted file mode 100644 index 66b59d06..00000000 --- a/glabels2/barcode-0.98/doc/barcode.info +++ /dev/null @@ -1,747 +0,0 @@ -This is barcode.info, produced by makeinfo version 4.0b from -barcode.texinfo. - - This file is the User's Manual for the barcode library (version -0.98). - - -File: barcode.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) - -Barcode tools -************* - - This file documents version 0.98 of the barcode library and sample -programs (March 2002). - -* Menu: - -* Overview:: -* The Barcode Object:: -* Supported Flags:: -* The API:: -* The barcode Executable:: -* Supported Encodings:: -* PCL Output:: -* Bugs and Pending Issues:: - - -File: barcode.info, Node: Overview, Next: The Barcode Object, Prev: Top, Up: Top - -Overview -******** - - The "barcode" package is mainly a C library for creating bar-code -output files. It also includes a command line front-end and (in a -foreseeable future) a graphic frontend. - - The package is designed as a library because we think the main use -for barcode-generation tools is inside more featured applications. The -library addresses bar code printing as two distinct problems: creation -of bar information and actual conversion to an output format. To this -aim we use an intermediate representation for bar codes, which is -currently documented in the `ps.c' source file (not in this document). - - Note that the library and the accompanying material is released -according to the GPL license, not the LGPL one. A copy of the GPL is -included in the distribution tarball. - - -File: barcode.info, Node: The Barcode Object, Next: Supported Flags, Prev: Overview, Up: Top - -The Underlying Data Structure -***************************** - - Every barcode-related function acts on a data structure defined in -the `barcode.h' header, which must be included by any C source file -that uses the library. The header is installed by make install. - - The definition of the data structure is included here for reference: - - struct Barcode_Item { - int flags; /* type of encoding and other flags */ - char *ascii; /* malloced */ - char *partial; /* malloced too */ - char *textinfo; /* information about text placement */ - char *encoding; /* code name, filled by encoding engine */ - int width, height; /* output units */ - int xoff, yoff; /* output units */ - int margin; /* output units */ - double scalef; /* requested scaling for barcode */ - int error; /* an errno-like value, in case of failure */ - }; - - The exact meaning of each field and the various flags implemented are -described in the following sections. - - Even though you won't usually need to act on the contents of this -structure, some of the functions in the library receive arguments that -are directly related to one or more of these fields. - -* Menu: - -* The Field List:: -* The Intermediate Representation:: - - -File: barcode.info, Node: The Field List, Next: The Intermediate Representation, Prev: The Barcode Object, Up: The Barcode Object - -The Fields -========== - -`int flags;' - The flags are, as you may suspect, meant to specify the exact - behaviour of the library. They are often passed as an argument to - barcode functions and are discussed in the next section. - -`char *ascii;' -`char *partial;' -`char *textinfo;' -`char *encoding;' - These fields are internally managed by the library, and you are - not expected to touch them if you use the provided API. All of - them are allocated with malloc. - -`int width;' -`int height;' - They specify the width and height of the active barcode region - (i.e., excluding the white margin), in the units used to create - output data (for postscript they are points, 1/72th of an inch, - 0.352 mm). The fields can be either assigned to in the structure - or via Barcode_Position(), at your choice. If either value or - both are left to their default value of zero, the output engine - will assign default values according to the specified scaling - factor. If the specified width is bigger than needed (according to - the scaling factor), the output barcode will be centered in its - requested region. If either the width of the height are too small - for the specified scale factor, the output bar code will expand - symmetrically around the requested region. - -`int xoff;' -`int yoff;' - The fields specify offset from the coordinate origin of the output - engine (for postscript, position 0,0 is the lower left corner of - the page). The fields can be either assigned to in the structure - or via Barcode_Position(), at your choice. The offset specifies - where the white margin begins, not where the first bar will be - printed. To print real ink to the specified position you should - set margin to 0. - -`int margin;' - The white margin that will be left around the printed area of the - bar code. The same margin is applied to all sides of the printed - area. The default value for the margin is defined in `barcode.h' - as BARCODE_DEFAULT_MARGIN (10). - -`double scalef;' - The enlarge or shrink value for the bar code over its default - dimension. The width and scalef fields interact deeply in the - creation of the output, and a complete description of the issues - appears later in this section. - -`int error;' - The field is used when a barcode function fails to host an - errno-like integer value. - -Use of the width and scalef fields. ------------------------------------ - - A width unit is the width of the thinnest bar and/or space in the -chosen code; it defaults to 1 point if the output is postscript or -encapsulated postscript. - - Either or both the code width and the scale factor can be left -unspecified (i.e., zero). The library deals with defaults in the -following way: - -Both unspecified - If both the width and the scale factor are unspecified, the scale - factor will default to 1.0 and the width is calculated according - to the actual width of the bar code being printed. - -Width unspecified - If the width is not specified, it is calculated according to the - values of scalef. - -Scale factor unspecified - If the scale factor is not specified, it will be chosen so that - the generated bar code exactly fits the specified width. - -Both specified - The code will be printed inside the specified region according to - the specified scale factor. It will be aligned to the left. If, - however, the chosen width is too small for the specific bar code - and scaling factor, then the code will extend symmetrically to the - left and to the right of the chosen region. - - -File: barcode.info, Node: The Intermediate Representation, Prev: The Field List, Up: The Barcode Object - -The Intermediate Representation -=============================== - - The encoding functions print their output into the partial and -texinfo fields of the barcode data structure. Those fields, together -with position information, are then used to generate actual output. -This is an informal description of the intermediate format. - - The first char in partial tells how much extra space to add to the -left of the bars. For EAN-13, it is used to leave space to print the -first digit, other codes may have '0' for no-extra-space-needed. - - The next characters are alternating bars and spaces, as multiples of -the base dimension which is 1 unless the code is rescaled. Rescaling is -calculated as the ratio from the requested width and the calculated -width. Digits represent bar/space dimensions. Lower-case letters -represent those bars that should extend lower than the others: 'a' is -equivalent to '1', 'b' is '2' and so on up to 'i' which is equivalent to -'9'. Other letters will be used for encoding-specific meanings, as soon -as I implement them. - - The textinfo string is made up of fields %lf:%lf:%c separated by -blank space. The first integer is the x position of the character, the -second is the font size (before rescaling) and the char item is the -character to be printed. - - Both the partial and textinfo strings may include "-" or "+" as -special characters (in textinfo the char should be a stand-alone word). -They state where the text should be printed: below the bars ("-", -default) or above the bars. This is used, for example, to print the -add-5 and add-2 codes to the right of UPC or EAN codes (the add-5 -extension is mostly used in ISBN codes). - - -File: barcode.info, Node: Supported Flags, Next: The API, Prev: The Barcode Object, Up: Top - -The Flags -********* - - The following flags are supported by version 0.98 of the library: - -`BARCODE_ENCODING_MASK' - The mask is used to extract the encoding-type identifier from the - flags field. - -`BARCODE_EAN' -`BARCODE_UPC' -`BARCODE_ISBN' -`BARCODE_128B' -`BARCODE_128C' -`BARCODE_128' -`BARCODE_128RAW' -`BARCODE_39' -`BARCODE_I25' -`BARCODE_CBR' -`BARCODE_MSI' -`BARCODE_PLS' -`BARCODE_93' - The currently supported encoding types: EAN (13 digits, 8 digits, - 13 + 2 add-on and 13 + 5 add-on), UPC (UPC-A, UPC-E, UPC-A with 2 - or 5 digit add-on), ISBN (with or without the 5-digit add-on), - CODE128-B (the whole set of printable ASCII characters), CODE128-C - (two digits encoded by each barcode symbol), CODE128 (all ASCII - values), a "raw-input" pseudo-code that generates CODE128 output, - CODE39 (alphanumeric), "interleaved 2 of 5" (numeric), Codabar - (numeric plus a few symbols), MSI (numeric) and Plessey (hex - digits). *Note Supported Encodings::. - -`BARCODE_ANY' - This special encoding type (represented by a value of zero, so it - will be the default) tells the encoding procedure to look for the - first encoding type that can deal with a textual string. - Therefore, a 11-digit code will be printed as UPC (as well as - 6-digit, 11+2 and 11+5), a 12-digit (or 7-digit, or 12+2 or 12+5) - as EAN13, an ISBN code (with or without hyphens, with or without - add-5) will be encoded in its EAN13 representation, an even number - of digits is encoded using CODE128C and a generic string is - encoded using CODE128B. Since code-39 offers a much larger - representation for the same text string, code128-b is preferred - over code39 for alphanumeric strings. - -`BARCODE_NO_ASCII' - Instructs the engine not to print the ascii string on output. By - default the bar code is accompanied with an ascii version of the - text it encodes. - -`BARCODE_NO_CHECKSUM' - Instructs the engine not to add the checksum character to the - output. Not all the encoding types can drop the checksum; those - where the checksum is mandatory (like EAN and UPC) just ignore the - flag. - -`BARCODE_OUTPUT_MASK' - The mask is used to extract the output-type identifier from the - flags field. - -`BARCODE_OUT_PS' -`BARCODE_OUT_EPS' -`BARCODE_OUT_PCL' -`BARCODE_OUT_PCL_III' - The currently supported encoding types: full-page postscript and - encapsulated postscript; PCL (print command language, for HP - printers) and PCL-III (same as PCL, but uses a font not available - on older printers). - -`BARCODE_OUT_NOHEADERS' - The flag instructs the printing engine not to print the header and - footer part of the file. This makes sense for the postscript - engine but might not make sense for other engines; such other - engines will silently ignore the flag just like the PCL back-end - does. - - -File: barcode.info, Node: The API, Next: The barcode Executable, Prev: Supported Flags, Up: Top - -Functions Exported by the Library -********************************* - - The functions included in the barcode library are declared in the -header file barcode.h. They perform the following tasks: - -`struct Barcode_Item *Barcode_Create(char *text);' - The function creates a new barcode object to deal with a specified - text string. It returns NULL in case of failure and a pointer to - a barcode data structure in case of success. - -`int Barcode_Delete(struct Barcode_Item *bc);' - Destroy a barcode object. Always returns 0 (success) - -`int Barcode_Encode(struct Barcode_Item *bc, int flags);' - Encode the text included in the bc object. Valid flags are the - encoding type (other flags are ignored) and BARCODE_NO_CHECKSUM - (other flags are silently ignored); if the flag argument is zero, - bc->flags will apply. The function returns 0 on success and -1 in - case of error. After successful termination the data structure - will host the description of the bar code and its textual - representation, after a failure the error field will include the - reason of the failure. - -`int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags);' - Print the bar code described by bc to the specified file. Valid - flags are the output type, BARCODE_NO_ASCII and - BARCODE_OUT_NOHEADERS, other flags are ignored. If any of these - flags is zero, it will be inherited from bc->flags which therefore - takes precedence. The function returns 0 on success and -1 in case - of error (with bc->error set accordingly). In case of success, the - bar code is printed to the specified file, which won't be closed - after use. - -`int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, int xoff, int yoff, double scalef);' - The function is a shortcut to assign values to the data structure. - -`int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, int xoff, int yoff, int flags);' - The function deals with the whole life of the barcode object by - calling the other functions; it uses all the specified flags. - -`int Barcode_Version(char *versionname);' - Returns the current version as an integer number of the form major - * 10000 + minor * 100 + release. Therefore, version 1.03.5 will be - returned as 10305 and version 0.53 as 5300. If the argument is - non-null, it will be used to return the version number as a - string. Note that the same information is available from two - preprocessor macros: BARCODE_VERSION (the string) and - BARCODE_VERSION_INT (the integer number). - - -File: barcode.info, Node: The barcode Executable, Next: Supported Encodings, Prev: The API, Up: Top - -The barcode frontend program -**************************** - - The barcode program is a front-end to access some features of the -library from the command line. It is able to read user supplied -strings from the command line or a data file (standard input by default) -and encode all of them. - -* Menu: - -* The Command Line:: - - -File: barcode.info, Node: The Command Line, Prev: The barcode Executable, Up: The barcode Executable - -The Command Line -================ - - barcode accepts the following options: - -`--help or -h' - Print a usage summary and exit. - -`-i filename' - Identify a file where strings to be encoded are read from. If - missing (and if -b is not used) it defaults to standard input. - Each data line of the input file will be used to create one - barcode output. - -`-o filename' - Output file. It defaults to standard output. - -`-b string' - Specify a single "barcode" string to be encoded. The option can - be used multiple times in order to encode multiple strings (this - will result in multi-page postscript output or a table of barcodes - if -t is specified). The strings must match the encoding chosen; - if it doesn't match the program will print a warning to stderr and - generate "blank" output (although not zero-length). Please note - that a string including spaces or other special characters must be - properly quoted. - -`-e encoding' - encoding is the name of the chosen encoding format being used. It - defaults to the value of the environment variable BARCODE_ENCODING - or to auto detection if the environment is also unset. - -`-g geometry' - The geometry argument is of the form "[ x ] [+ - + ]" (with no intervening spaces). Unspecified - margin values will result in no margin; unspecified size results - in default size. The specified values represent print points by - default, and can be inches, millimeters or other units according - to the -u option or the BARCODE_UNIT environment variable. The - argument is used to place the printout code on the page. Note that - an additional white margin of 10 points is added to the printout. - If the option is unspecified, BARCODE_GEOMETRY is looked up in the - environment, if missing a default size and no margin (but the - default 10 points) are used. - -`-t table-geometry' - Used to print several barcodes to a single page, this option is - meant to be used to print stickers. The argument is of the form - " x [+ + [- - [- ]]]" (with no intervening spaces); if - missing, the top and right margin will default to be the same as - the bottom and left margin. The margins are specified in print - points or in the chosen unit (see -u below). If the option is not - specified, BARCODE_TABLE is looked up in the environment, - otherwise no table is printed and each barcode will get its own - page. The size (but not the position) of a barcode item within a - table can also be selected using -g (see "geometry" above), - without struggling with external and internal margins. I still - think management of geometries in a table is suboptimal, but I - can't make it better without introducing incompatibilities. - -`-m margin(s)' - Specifies an internal margin for each sticker in the table. The - argument is of the form "," and the margin is - applied symmetrically to the sticker. If unspecified, the - environment variable BARCODE_MARGIN is used or a default internal - margin of 10 points is used. - -`-n' - "Numeric" output: don't print the ASCII form of the code, only the - bars. - -`-c' - No checksum character (for encodings that allow it, like code 39, - other codes, like UPC or EAN, ignore this option). - -`-E' - Encapsulated postscript (default is normal postscript). When the - output is generated as EPS only one barcode is encoded. - -`-P' - PCL output. Please note that the Y direction goes from top to - bottom for PCL, and the origin for an image is the top-left corner - instead of the bottom-left - -`-p pagesize' - Specify a non-default page size. The page size can be specified in - millimeters, inches or plain numbers (for example: "210x297mm", - "8.5x11in", "595x842"). A page specification as numbers will be - interpreted according to the current unit specification (see -u - below). If libpaper is available, you can also specify the page - size with its name, like "A3" or "letter" (libpaper is a standard - component of Debian GNU/Linux, but may be missing elsewhere). The - default page size is your system-wide default if libpaper is - there, A4 otherwise. - -`-u unit' - Choose the unit used in size specifications. Accepted values are - "mm", "cm", "in" and "pt". By default, the program will check - BARCODE_UNIT in the environment, and assume points otherwise (this - behaviour is compatible with 0.92 and previous versions. If -u - appears more than once, each instance will modified the behaviour - for the arguments at its right, as the command line is processes - left to right. The program internally works with points, and any - size is approximated to the nearest multiple of one point. The -u - option affect -g (geometry), -t (table) and -p (page size). - - -File: barcode.info, Node: Supported Encodings, Next: PCL Output, Prev: The barcode Executable, Up: Top - -Supported Encodings -******************* - - The program encodes text strings passed either on the command line -(with -b) or retrieved from standard input. The text representation is -interpreted according to the following rules. When auto-detection of -the encoding is enabled (i.e, no explicit encoding type is specified), -the encoding types are scanned to find one that can digest the text -string. The following list of supported types is sorted in the same -order the library uses when auto-detecting a suitable encoding for a -string. - -EAN - The EAN frontend is similar to UPC; it accepts strings of digits, - 12 or 7 characters long. Strings of 13 or 8 characters are - accepted if the provided checksum digit is correct. I expect most - users to feed input without a checksum, though. The add-2 and - add-5 extension are accepted for both the EAN-13 and the EAN-8 - encodings. The following are example of valid input strings: - "123456789012" (EAN-13), "1234567890128" (EAN-13 wih checksum), - "1234567" (EAN-8), "12345670 12345" (EAN-8 with checksum and - add-5), "123456789012 12" (EAN-13 with add-2), "123456789012 - 12345" (EAN-13 with add-5). - -UPC - The UPC frontend accepts only strings made up of digits (and, if a - supplemental encoding is used, a blank to separate it). It - accepts strings of 11 or 12 digits (UPC-A) and 6 or 7 or 8 digits - (UPC-E). - - The 12th digit of UPC-A is the checksum and is added by the - library if not specified in the input; if it is specified, it must - be the right checksum or the code is rejected as invalid. For - UPC-E, 6 digit are considered to be the middle part of the code, a - leading 0 is assumed and the checksum is added; 7 digits are - either considered the initial part (leading digit 0 or 1, checksum - missing) or the final part (checksum specified, leading 0 - assumed); 8 digits are considered to be the complete code, with - leading 0 or 1 and checksum. For both UPC-A and UPC-E, a trailing - string of 2 digits or 5 digits is accepted as well. Therefore, the - following are examples of valid strings that can be encoded as UPC: - "01234567890" (UPC-A) "012345678905" (UPC-A with checksum), - "012345" (UPC-E), "01234567890 12" (UPC-A, add-2) and "01234567890 - 12345" (UPC-A, add-5), "0123456 12" (UPC-E, add-2). Please note - that when setting BARCODE_ANY to auto-detect the encoding to be - used, 12-digit strings and 7-digit strings will always be - identified as EAN. This because I expect most user to provide - input without a checksum. If you need to specify UPC-with-checksum - as input you must explicitly set BARCODE_UPC as a flag or use -e - upc on the command line. - -ISBN - ISBN numbers are encoded as EAN-13 symbols, with an optional add-5 - trailer. The ISBN frontend of the library accepts real ISBN - numbers and deals with any hyphen and, if present, the ISBN - checksum character before encoding data. Valid representations for - ISBN strings are for example: "1-56592-292-1", "3-89721-122-X" and - "3-89721-122-X 06900". - -CODE 128-B - This encoding can represent all of the printing ASCII characters, - from the space (32) to DEL (127). The checksum digit is mandatory - in this encoding. - -CODE 128-C - The "C" variation of Code-128 uses Code-128 symbols to represent - two digits at a time (Code-128 is made up of 104 symbols whose - interpretation is controlled by the start symbol being used). Code - 128-C is thus the most compact way to represent any even number of - digits. The encoder refuses to deal with an odd number of digits - because the caller is expected to provide proper padding to an - even number of digits. (Since Code-128 includes control symbols to - switch charset, it is theoretically possible to represent the odd - digit as a Code 128-A or 128-B symbol, but this tool doesn't - currently implement this option). - -CODE 128 RAW - Code-128 output represented symbol-by-symbol in the input string. - To override part of the problems outlined below in specifying - code128 symbols, this pseudo-encoding allows the used to specify a - list of code128 symbols separated by spaces. Each symbol is - represented by a number in the range 0-105. The list should - include the leading character.The checksum and the stop character - are automatically added by the library. Most likely this - pseudo-encoding will be used with BARCODE_NO_ASCII and some - external program to supply the printed text. - -CODE 39 - The code-39 standard can encode uppercase letters, digits, the - blank space, plus, minus, dot, star, dollar, slash, percent. Any - string that is only composed of such characters is accepted by the - code-39 encoder. To avoid loosing information, the encoder refuses - to encode mixed-case strings (a lowercase string is nonetheless - accepted as a shortcut, but is encoded as uppercase). - -INTERLEAVED 2 OF 5 - This encoding can only represent an even number of digits (odd - digits are represented by bars, and even digits by the - interleaving spaces). The name stresses the fact that two of the - five items (bars or spaces) allocated to each symbol are wide, - while the rest are narrow. The checksum digit is optional (can be - disabled via BARCODE_NO_CHECKSUM). Since the number of digits, - including the checksum, must be even, a leading zero is inserted - in the string being encoded if needed (this is specifically stated - in the specs I have access to). - -CODE 128 - Automatic selection between alphabet A, B and C of the Code-128 - standard. This encoding can represent all ASCII symbols, from 0 - (NUL) to 127 (DEL), as well as four special symbols, named F1, F2, - F3, F4. The set of symbols available in this encoding is not - easily represented as input to the barcode library, so the - following convention is used. In the input string, which is a - C-language null-terminated string, the NUL char is represented by - the value 128 (0x80, 0200) and the F1-F4 characters are - represented by the values 193-196 (0xc1-0xc4, 0301-0304). The - values have been chosen to ease their representation as escape - sequences. - - Since the shell doesn't seem to interpret escape sequences on the - command line, the "-b" option cannot be easily used to designate - the strings to be encoded. As a workaround you can resort to the - command echo, either within back-ticks or used separately to - create a file that is then fed to the standard-input of barcode - - assuming your echo command processes escape sequences. The - newline character is especially though to encode (but not - impossible unless you use a csh variant. - - These problems only apply to the command-line tool; the use of - library functions doesn't give any problem. In needed, you can use - the "code 128 raw" pseudo-encoding to represent code128 symbols by - their numerical value. This encoding is used late in the - auto-selection mechanism because (almost) any input string can be - represented using code128. - -CODABAR - Codabar can encode the ten digits and a few special symbols - (minus, plus, dollar, colon, bar, dot). The characters "A", "B", - "C" and "D" are used to represent four different start/stop - characters. The input string to the barcode library can include - the start and stop characters or not include them (in which case - "A" is used as start and "B" as stop). Start and stop characters - in the input string can be either all lowercase or all uppercase - and are always printed as uppercase. - -PLESSEY - Plessey barcodes can encode all the hexadecimal digits. Alphabetic - digits in the input string must either be all lowercase or all - uppercase. The output text is always uppercase. - -MSI - MSI can only encode the decimal digits. While the standard - specifies either one or two check digits, the current - implementation in this library only generates one check digit. - -CODE 93 - The code-93 standard can natively encode 48 different characters, - including uppercase letters, digits, the blank space, plus, minus, - dot, star, dollar, slash, percent, as well as five special - characters: a start/stop delimiter and four "shift characters" - used for extended encoding. Using this "extended encoding" - method, any standard 7-bit ASCII character can be encoded, but it - takes up two symbol lengths in barcode if the character is not - natively supported (one of the 48). The encoder here fully - implements the code 93 encoding standard. Any characters natively - supported (A-Z, 0-9, ".+-/$&%") will be encoded as such - for any - other characters (such as lower case letters, brackets, - parentheses, etc.), the encoder will revert to extended encoding. - As a note, the option to exclude the checksum will eliminate the - two modulo-47 checksums (called C and K) from the barcode, but this - probably will make it unreadable by 99% of all scanning systems. - These checksums are specified to be used at the firmware level, - and their absence will be interpreted as an invalid barcode. - - -File: barcode.info, Node: PCL Output, Next: Bugs and Pending Issues, Prev: Supported Encodings, Up: Top - -PCL Output -********** - - While the default output is Postscript (possibly EPS), and Postscript -can be post-processed to almost anything, it is sometimes desirable to -create output directly usable by the specific printer at hand. PCL is -currently supported as an output format for this reason. Please note -that the Y coordinate for PCL goes from top to bottom, while for -Postscript it goes from bottom to top. Consistently, while in -Postscript you specify the bottom-left corner as origin, for PCL you -specify the top-left corner. - - Barcode output for PCL Printers (HP LaserJet and compatibles), was -developed using PCL5 Reference manuals from HP. that really refers to -these printers: - * LaserJet III, III P, III D, III Si, - - * LaserJet 4 family - - * LaserJet 5 family - - * LaserJet 6 family - - * Color LaserJet - - * DeskJet 1200 and 1600. - - - However, barcode printing uses a very small subset of PCL, probably -also LaserJet II should print it without problem, but the resulting -text may be horrible. - - The only real difference from one printer to another really depends -on which font are available in the printer, used in printing the label -associated to the bars (if requested). - - Earlier LaserJet supports only bitmaps fonts, so these are not -"scalable". (Ljet II ?), Also these fonts, when available, have a -specified direction, and not all of them are available in both Portrait -and Landscape mode. - - From LaserJet 4 series, (except 4L/5L that are entry-level printers), -Arial scalable font should be available, so it's the "default font" -used by this program. - - LaserJet III series printers (and 4L, 5L), don't feature "Arial" as a -resident font, so you should use BARCODE_OUT_PCL_III instead of -BARCODE_OUT_PCL., and font the font used will be "Univers" instead of -"Arial". - - Results on compatible printers, may depend on consistency of PCL5 -compatibility, in doubt, try BARCODE_OUT_PCL_III - - PJL commands are not used here, as it's not very compatible. - - Tested Printers: - * Hp LaserJet 4050 - - * Hp LaserJet 2100 - - * Epson N-1200 emul PCL - - * Toshiba DP2570 (copier) + PCL option - - * Epson EPL-7100 emul. HP LaserJet II: bars print fine but text is - bad. - - -File: barcode.info, Node: Bugs and Pending Issues, Prev: PCL Output, Up: Top - -Bugs and Pending Issues. -************************ - - The current management of borders/margins is far from optimal. The -"default" margin applied by the library interferes with the external -representation, but I feel it is mandatory to avoid creating barcode -output with no surrounding white space (the problem is especially -relevant for EPS output). - - EAN-128 is not (yet) supported. I plan to implement it pretty soon -and then bless the package as version 1.0. - - - -Tag Table: -Node: Top154 -Node: Overview526 -Node: The Barcode Object1404 -Node: The Field List2821 -Node: The Intermediate Representation6586 -Node: Supported Flags8359 -Node: The API11343 -Node: The barcode Executable14029 -Node: The Command Line14458 -Node: Supported Encodings19557 -Node: PCL Output28997 -Node: Bugs and Pending Issues31316 - -End Tag Table diff --git a/glabels2/barcode-0.98/doc/barcode.pdf b/glabels2/barcode-0.98/doc/barcode.pdf deleted file mode 100644 index b2268f4d..00000000 Binary files a/glabels2/barcode-0.98/doc/barcode.pdf and /dev/null differ diff --git a/glabels2/barcode-0.98/doc/barcode.ps b/glabels2/barcode-0.98/doc/barcode.ps deleted file mode 100644 index cc6cc2c4..00000000 --- a/glabels2/barcode-0.98/doc/barcode.ps +++ /dev/null @@ -1,2378 +0,0 @@ -%!PS-Adobe-2.0 -%%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software -%%Title: barcode.dvi -%%Pages: 12 -%%PageOrder: Ascend -%%BoundingBox: 0 0 596 842 -%%EndComments -%DVIPSWebPage: (www.radicaleye.com) -%DVIPSCommandLine: dvips -f barcode.dvi -%DVIPSParameters: dpi=600, compressed -%DVIPSSource: TeX output 2002.08.21:2135 -%%BeginProcSet: texc.pro -%! -/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S -N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72 -mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0 -0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{ -landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize -mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ -matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round -exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ -statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] -N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin -/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array -/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 -array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N -df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A -definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get -}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub} -B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr -1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3 -1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx -0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx -sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{ -rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp -gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B -/chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{ -/cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{ -A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy -get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse} -ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp -fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17 -{2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add -chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{ -1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop} -forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn -/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put -}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{ -bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A -mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ -SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ -userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X -1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 -index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N -/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ -/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) -(LaserWriter 16/600)]{A length product length le{A length product exch 0 -exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse -end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask -grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot} -imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round -exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto -fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p -delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M} -B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{ -p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S -rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end - -%%EndProcSet -TeXDict begin 39158280 55380996 1000 600 600 (barcode.dvi) -@start -%DVIPSBitmapFont: Fa cmbxti10 14.4 8 -/Fa 8 115 df<13FCEA03FF000F13804813C05AA25AA2B5FCA31480A214006C5A6C5A6C -5AEA0FE0121271912B>46 D97 DI<923807FF80037F13F00203B512FC02 -0F80023F8091B500031380499038F8007F010701E0EBFFC049EB800149495A49485B495A -49485B5A485BA248491580180048496D5A486F5A93C8FC485BA35A91CAFCA3B5FC5BA45B -A65B17036C6CED0780170FEF3FC0003F167F6DEC01FF001F4B13806C6C021F13006C6DEB -7FFC6C9039F00FFFF86C90B612E06C5E013F4AC7FC010F14F0010049C8FC323773B540> -II<923807FF8092B512E0020714F8021F80027F80903A01FFFE03FF49D9F000 -13804901C0EB7FC0495B013F90C7123F495A495A5C5A485B4849147F18804816FF4A4913 -00485DEE0FFE4849EB7FFC923807FFF891B612E0485E94C7FC16F04BC8FCB5CAFC5BA45B -A7007F1603EF0780170F003FEE3FC0177F6C6CEC01FF4C13806C6C021F13006C01C0EB7F -FC6C9039F00FFFF86C90B612E06C6C5D6D4AC7FC010714F09026007FFEC8FC323773B540 ->I<923807FFC0037F13FC0203B6FC020F15C0023F8191B5000313F8499039F8007FFC01 -0701E0133F4901806D7E4990C76C7E49481680495A4948804818C0485BA2485BA248494A -13E05AA2485BA24D13C05A91C8FCA25FB517805BA25F19005B6017FF605E60495E5E6C6C -4A5B604C5B003F4B90C7FC6D4A5A001F4B5A6C6C4A5A6CD980035B6CD9F01F13C06C90B6 -5A6C4BC8FC013F14F0010F14C0010001F8C9FC3B3773B547>111 -D114 -D E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Fb cmsy10 10.95 1 -/Fb 1 16 df15 -D E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Fc cmb10 10.95 10 -/Fc 10 115 df97 D<13FFB5FCA512077EAFEC03FE91381FFF -C0027F13F091B57E9138FE0FFE9138F003FF4A7E02C014804A6C13C017E0A3EE7FF0A317 -F8AC17F0A3EEFFE0A217C05D02C014806E4813006E485A9138FC1FFC01FCB55A496C13E0 -D9F01F1380C7D807FCC7FC2D407EBE33>III<49B47E010F13F0013F7F90B512FE48EBC3FF480100 -13804848EB7FC04848133F001F15E05B003FEC1FF0A2485A150F16F8A212FFA290B6FCA4 -01F0C8FCA5127FA37F003F15F8A26C6C1301000F15F06D13036C6CEB07E06C9038800FC0 -6C9038F07F806C6CB512006D5B010F13F8010013C0252B7EA92A>I103 -D105 D<01FFEB7FE0B53801FFF802077F4A7F91381FC3FFDA3E03 -13800007137C6CEB780102F014C014E0A214C0A31480B3A4B5D8FE1F13FFA530297EA833 ->110 D<49B47E010F13F0013F13FC90B6FC48018113803A03FE007FC04848EB3FE0000F -15F049131F001F15F8A24848EB0FFCA2007F15FEA400FF15FFAB007F15FEA3003F15FC6D -131F001F15F8A26C6CEB3FF0000715E06C6CEB7FC03A01FF81FF806C90B51200013F13FC -010F13F001011380282B7EA92D>I<3901FE07F800FFEB0FFE91383FFF804A13C0EC7C7F -9138F8FFE03807FFF06C5B5CA2ED7FC09138803F80ED1F0092C7FCA291C8FCB3A3B6FCA5 -23297FA827>114 D E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Fd cmbxti10 17.28 7 -/Fd 7 115 df97 -DII<963803FFC0061FB512E06060A47214C0F000 -1F61A21B80A261A21B00A296B5FCA262A260A262A260A262A260A262A260A2DCFFE05C03 -0F13FC037FEBFF1F4AB6129F020792B55A4AEBE07F023FEB000F4A487F4948486D5C4913 -F04981495B49496D91C7FC495B5B92C8FC90B55E485B5F485B4860A248495CA248605C5F -5A4A5EA2485EA24A5EA2B55DA24A5EA25FA291C85CA24DEC3F801A7F19005B94B513FFA2 -4E1400A24C5C007F614C13FC4C1403003F4B5D6D4A14076C4B5D6C6D49140F4BB55C6CD9 -C007013F495A6C9026F03FFEEBFE3FC690B5D8F81FB55A6DDAF0075C011FDAC00349C7FC -010749C75B9026007FF0EC1FF04B6571E355>II<93381FFF804BB512F8031F14 -FF037F15C04AB77E0207D9FC0313F8021FD9E0007F4A0180EB3FFEDAFFFEC76C7E494916 -8049496E13C0495B49496E13E0495B494916F05B90B5C87E1AF8485B485F5C5A5C5AA248 -5B605A5CA2485FA24A17F0A2B55EA24A17E0A2601AC091C9FC95B51280A21A005F615F49 -5F4D5B127F6D4B5B616C4C5B4D5B6C6D4A90C7FC4D5A6C6D495B6C4B5B6C6D010F13E06C -01F8013F5B6CD9FE01B5C8FC013FB612FC6D15F0010715C0010002FCC9FC020F13C04542 -71C055>111 D114 D E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Fe cmbxti10 13.15 11 -/Fe 11 120 df97 D99 D<943801FF800403B512C05E1980A282EE000F1900A25FA260A2173FA260 -A2177FA260A217FFA260A25EEDFFC1020701F15B023F13FD91B7FC4913E00107D9003F5B -49487F49487F495A49486D5B495A485D5C4894C7FC5A4A5B5A91C75B5A163FA248485DA2 -167F127F495DA216FF12FF495DA25D181E49EDE03FA24B5C187E17C0A2007F5F5D4B1380 -003F4AEB81F85D6C6C49EB83F06C6C48B55B2707FE0FFC13CF6CB539F07FFFC06C4A6C5B -6C6CD9800F90C7FC903A0FFC0003FC3A4D75CB41>III104 D<15F8EC03FC4A7E4A7EA25CA35DA2 -5D6E5AEC03E091C8FCAEEB07F8EB1FFEEB7FFF90B57E3901FC7FC0D803F07FEA07E0D80F -C07FA2381F80FFA2485A5B007E5CA25B00FE5C485A007C5C12005B92C7FCA25B5C133F5C -A2137F5CA213FFECF00F48EC1F8014E0153F48150014C05D48147E14805D14816CEB01F8 -4A5A4A5A6CEB1FC06CEBFF806D90C7FC6D5AEB07F0214E78CC27>I108 D<913801FFC0021F13F8027F13FE91B6FC4901001380D903FC -EB3FC0D907F0130F010FEC3FE04948137F4A13FF133FA2017F4913C0A26F138017006E13 -7E02FC90C7FCECFFC015FE6F7E16E06D80826D807F6D80010180EB003F1403EC003FD803 -C0130FD80FE01303EA3FF0486C7FA200FF5DA34B5A5B49495A495C49130F6CC7485AD83F -C0EB7FC03A1FF803FF806CB548C7FC6C14F8000114E026001FFEC8FC2B3377B135>115 -DI119 -D E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Ff cmbx12 13.14 13 -/Ff 13 117 df<923803FFE092B512FC020714FF021F81027F9038007FC0DAFFF0EB0FE0 -010301C0804990C7EA3FF84948147F4A81494814FF495AA2137F5CA2715A715A715AEF07 -8094C8FCA8EF07FCB9FCA526007FF0C7123F171FB3B3003FB5D8E00FB512F8A53D4D7ECC -44>12 D46 D85 D97 D100 DII< -EB7FC0B5FCA512037EB3A2923801FFC0030F13F8033F13FE4B7F9126C1FE077F9126C3F0 -037F9138C7C001DACF8080150002DE7F02FC81A25CA25CA35CB3A9B6D8C07FEBFFE0A53B -4C7BCB44>104 D108 -D<903A7FC001FFC0B5010F13F8033F13FE4B7F9126C1FE077F9126C3F0037F00039038C7 -C0016CD9CF8080150002DE7F02FC81A25CA25CA35CB3A9B6D8C07FEBFFE0A53B317BB044 ->110 D<913807FF80027F13F80103B6FC010F15C090261FFE017F903A7FF0003FF8D9FF -C0EB0FFC48496D7E4890C76C7E4817804980000F17C048486E13E0A2003F17F049157FA2 -007F17F8A400FF17FCAB007F17F8A36C6CEDFFF0A3001F17E06D5C000F17C06C6C4A1380 -6C17006C6D495A6C01E0EB1FFC6D6C495A903A3FFE01FFF0010FB612C0010392C7FCD900 -7F13F80207138036337DB13D>I<90390FFF8070017FEBF1F048B6FC1207380FFC01391F -E0003F4848130F491307127F90C712035A1501A27FA213E06D90C7FC13FE387FFFF0ECFF -C015F06C14FC6C14FF6C15806C15C06C15E0C615F0013F14F8010714FCEB007F14019138 -003FFE150F0078140700F81403A26C1401A37E16FC6C14036D14F87F6DEB07F001F8EB1F -E001FFEBFFC091B51280D8FC7F1400D8F81F13FCD8E00313C027337CB130>115 -D<14F8A61301A41303A21307A2130FA2131F133F137F13FF1203000F90B512F0B7FCA426 -007FF8C7FCB3A6167CAA013F14F880A290391FFE01F0010F1303903907FF87E06DEBFFC0 -6D14806D6C1300EC0FFC26467EC430>I E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Fg cmti10 10.95 35 -/Fg 35 122 df<933807FF80043F13E09338FE00F8DB01F0133EDB07E0130E4B48131F4C -137F031F14FF4BC7FCA218FE157E1878180015FE5DA31401A25DA414030103B712F0A218 -E0903A0003F000070207140F4B14C0A3171F020F15805DA2173F1800141F5D5F177EA214 -3F92C712FE5FA34A1301027EECF81CA3160302FEECF03C4A1538A21878187013014A0101 -13F018E0933800F1C0EF7F804948EC1F0094C7FCA35C1307A2001E5B127F130F00FF5BA2 -49CAFC12FEEAF81EEA703CEA7878EA1FF0EA07C0385383BF33>12 -DI40 -D<14031580A2EC01C0EC00E0A21570A215781538153CA3151EA4151FA2150FA7151FA915 -3FA2153EA3157EA2157CA215FCA215F8A21401A215F0A2140315E0A2140715C0A2EC0F80 -A2141F15005C143EA25CA25CA2495A5C1303495A5C130F49C7FC131E5B137C5B5B485A48 -5A485A48C8FC121E5A12705A5A205A7FC325>I<387FFFFCA3B5FCA21605799521>45 -D<120FEA3FC0127FA212FFA31380EA7F00123C0A0A77891C>I<15031507150F151F151E -153E157EEC01FEEC03FC1407141FEB01FF90380FFBF8EB1FC3EB0E07130015F0A2140FA2 -15E0A2141FA215C0A2143FA21580A2147FA21500A25CA25CA21301A25CA21303A25CA213 -07A25CA2130FA25CA2131FA25CEB7FE0B612F0A215E0203D77BC2E>49 -D<15FE913803FFC091380F01F091383C00F84A137C4A7F4948133F49487F4A148049C7FC -5BEB0E0C011E15C0EB1C0EEB3C06133813781370020E133FD9F00C148013E0141C021813 -7F00011600EBC0384A13FEEC600102E05B3A00E3C003F89039FF0007F0013C495A90C748 -5A5E037FC7FC15FC4A5A4A5AEC0FC04AC8FC147E14F8EB03E0495A011FC9FC133E491418 -01F0143C48481438485A1678485A48C85A120E001E4A5AD83FE0130301FF495A397C3FF0 -1FD8780FB55AD8700391C7FCD8F0015B486C6C5A6E5AEC07C02A3F79BC2E>I<157F9138 -01FFE0913807C0F091381F007C023C133C4A133E4A131F1301495A5C1307A2495AA2163F -011F143EA2167E6E137C16F8ECE00102F013F09138F803E09138FC07C090390FFE0F00EC -FFBE6D13F86D5B7F6D7F8101037F90380F9FFFD91F0F1380D97C0713C0497E48486C13E0 -3903E0007F4848133F4848131F001F140F90C7FC003E1407A2127E127CA200FC15C05AA2 -ED0F80A2ED1F00153E007C143C157C007E5C6CEB03F0391F8007C0390FE03F802607FFFE -C7FC000113F838003FC0283F78BC2E>56 D<49B712C018F818FE903B0003FC0001FF9438 -007F804BEC3FC0A2F01FE014074B15F0180FA2140F5D181FA2021F16E05D183F19C0023F -ED7F804B14FF19004D5A027F4A5A92C7EA07F0EF1FE0EF7F804AD903FEC7FC92B512F017 -FE4AC7EA3F800101ED1FE04A6E7E17078401036F7E5CA30107825CA3010F5E4A1407A260 -011F150F5C4D5A60013F153F4A4A5A4D5A017F4A90C7FC4C5A91C7EA0FF849EC3FF0B812 -C094C8FC16F83C3E7BBD40>66 D<49B77E18F018FC903B0003FE0003FEEF00FF4BEC7F80 -F03FC00207151F19E05DA2020F16F0A25DA2141FF03FE05DA2023F16C0187F4B1580A202 -7FEDFF00604B495A4D5A02FF4A5A4D5A92C7EA3FC04CB4C7FC4990B512FC17E04ACAFCA2 -1303A25CA21307A25CA2130FA25CA2131FA25CA2133FA25CA2137FA25C497EB67EA33C3E -7BBD3E>80 D<92391FE00380ED7FFC913A01FFFE0700913907F01F8F91390FC007DF4AC6 -6CB4FC023E6D5A4A130014FC495A4948147CA2495AA2010F15785CA3011F1570A46E91C7 -FCA2808014FE90380FFFE015FC6DEBFF8016E06D806D806D6C7F141F02037FEC003FED07 -FF1501A281A282A212075A167E120EA2001E15FE5EA25E003E14015E003F14034B5A486C -5C150F6D495A6D49C8FCD8F9F0137C39F8FE01F839F03FFFF0D8E00F13C026C001FEC9FC -314279BF33>83 D<277FFFFE01B500FC90B512E0B5FCA20003902680000790C7380FFC00 -6C90C701FCEC07F049725A04035EA26350C7FCA20407150EA2040F5D1A3C041F15386216 -3B6216734F5A6D14E303014B5A6C15C303034BC8FC1683DB0703140E191E030E151C6103 -1C7F61ED380161157003F04A5A15E002014B5A15C0DA03804AC9FC60DA0700140E60140E -605C029C5D14B8D97FF85D5C715A5C4A5DA24A92CAFC5F91C7FC705A137E5F137C5F1378 -01705D53406EBD5B>87 D<147E49B47E903907C1C38090391F80EFC090383F00FF017E13 -7F4914804848133F485AA248481400120F5B001F5C157E485AA215FE007F5C90C7FCA214 -01485C5AA21403EDF0385AA21407EDE078020F1370127C021F13F0007E013F13E0003E13 -7FECF3E1261F01E313C03A0F8781E3803A03FF00FF00D800FC133E252977A72E>97 -DIIII<167C4BB4FC923807C78092380F83C0ED1F87161FED3F3FA2157EA21780EE0E004B -C7FCA414015DA414035DA30103B512F8A390260007E0C7FCA3140F5DA5141F5DA4143F92 -C8FCA45C147EA414FE5CA413015CA4495AA4495AA4495A121E127F5C12FF49C9FCA2EAFE -1EEAF83C1270EA7878EA3FE0EA0F802A5383BF1C>III<1478EB01FCA21303A314F8EB00E01400AD137C48 -B4FC38038F80EA0707000E13C0121E121CEA3C0F1238A2EA781F00701380A2EAF03F1400 -12005B137E13FE5BA212015BA212035B1438120713E0000F1378EBC070A214F0EB80E0A2 -EB81C01383148038078700EA03FEEA00F8163E79BC1C>I108 -DIII<903903E001F890390FF807FE903A1E7C1E0F80903A1C3E3C07C001 -3C137801389038E003E0EB783F017001C013F0ED80019038F07F0001E015F8147E160300 -0113FEA2C75AA20101140717F05CA20103140F17E05CA20107EC1FC0A24A1480163F010F -15005E167E5E131F4B5A6E485A4B5A90393FB80F80DA9C1FC7FCEC0FFCEC03E049C9FCA2 -137EA213FEA25BA21201A25BA21203A2387FFFE0B5FCA22D3A80A72E>I114 DII<137C48B4141C26038F80137EEA0707000E7F001E15FE -121CD83C0F5C12381501EA781F007001805BA2D8F03F1303140000005D5B017E1307A201 -FE5C5B150F1201495CA2151F0003EDC1C0491481A2153F1683EE0380A2ED7F07000102FF -13005C01F8EBDF0F00009038079F0E90397C0F0F1C90391FFC07F8903907F001F02A2979 -A731>I<017CEB01C048B4EB07F038038F80EA0707000E01C013F8121E001C1403EA3C0F -0038EC01F0A2D8781F130000705BA2EAF03F91C712E012005B017E130116C013FE5B1503 -000115805BA2ED07001203495B150EA25DA25D1578000114706D5B0000495A6D485AD97E -0FC7FCEB1FFEEB03F0252979A72A>I<017C167048B491387001FC3A038F8001F8EA0707 -000E01C015FE001E1403001CEDF000EA3C0F0038177C1507D8781F4A133C00701380A2D8 -F03F130F020049133812005B017E011F14784C137013FE5B033F14F0000192C712E05BA2 -170100034A14C049137E17031880A2EF070015FE170E00010101141E01F86D131C0000D9 -039F5BD9FC076D5A903A3E0F07C1E0903A1FFC03FFC0902703F0007FC7FC372979A73C> -I<903903F001F890390FFC07FE90393C1E0E0F9026780F1C138001F0EBB83FD801E013F8 -9039C007F07FEA0380000714E0D9000F140048151C000E4AC7FCA2001E131FA2C75BA214 -3F92C8FCA35C147EA314FE4A131CA30101143C001E1538003F491378D87F811470018314 -F000FF5D9039077801C039FE0F7C033A7C0E3C078027783C1E1EC7FC391FF80FFC3907E0 -03F029297CA72A>I<137C48B4143826038F8013FCEA0707000E7F001E1401001C15F8EA -3C0F12381503D8781F14F000701380A2D8F03F1307020013E012005B017E130F16C013FE -5B151F1201491480A2153F000315005BA25D157EA315FE5D00011301EBF8030000130790 -387C1FF8EB3FF9EB07E1EB00035DA21407000E5CEA3F80007F495AA24A5AD8FF0090C7FC -143E007C137E00705B387801F0383803E0381E0FC06CB4C8FCEA03F8263B79A72C>I -E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Fh cmsl10 10.95 33 -/Fh 33 122 df<007FB5FCA2B512FEA418067C961E>45 D<157015F014011407143F9038 -03FFE0137FEBFFCFEBF80F1300141F15C0A5143F1580A5147F1500A55C5CA513015CA513 -035CA513075CA5130F5CA3131F497EB612F8A31D3D78BC2D>49 DII<01061403D90780131F90390FF801FE91B512FC16F816F016E0168049EB -FE0015F890381C7FC091C8FCA3133C1338A513781370A2EC1FE0ECFFF8903873E03E9038 -FF001F01FCEB0F804914C049EB07E04914F049130390C7FC16F8A61507A21206EA3F8048 -7EA2150F00FF15F0A24914E090C7121F00FC15C000F0143F00701580ED7F0012786C14FE -4A5A6C495A390F800FE03907E03FC06CB5C7FCC613FCEB1FE0283F7ABC2D>53 -D56 DI<17E016011603831607A2160FA2161F83163FA2167F167716F7EEE7FCED -01E316C3150316831507EE03FEED0F01150E151E151C153C03387FED7800157015F05D4A -4880177F4A5AA24AC7FCA2020E81173F5C021FB6FC5CA20270C7EA3FE0171F5CA2495AA2 -494881170F49C8FCA2130EA24982013C1507A2137CD801FE4B7E2607FF80EC3FFEB500F0 -0107B512FC19F85E3E417DC044>65 D<013FB7FC18E018FC903B007FE00007FE6E489038 -01FF809438007FC05DF03FE0F01FF0A3027F16F892C8FCA54A16F04A153F19E0187F19C0 -F0FF8001014B13004A4A5A4D5AEF1FF04D5ADC03FFC7FC49B612F8EFFF8002F8C7EA3FE0 -EF0FF0EF07FC717E010715014A81711380A319C0130F5CA5011F4B13805C19005F601707 -013F4B5A4A4A5A4D5A4D5A017F913801FF8001FF020F90C7FCB812FC17F094C8FC3D3E7D -BD40>II<013FB812F8A39026007F -F0C7127F6E48140F18034B14011800A31978147F4B1570A502FF147092C7FCA3190017F0 -495D4A1301A21607161F91B6FC495DA29138FC003F160F1607160301075D5CA219E01801 -19C0010FEC07004A90C712031980A218071900011F5E5C181EA2183E183C013F167C4A15 -FC4D5A1707017F151F01FF4AB45AB9FCA2603D3E7DBD3E>69 D<011FB512FC5BA2903900 -3FF8006E5AA25DA5143F5DA5147F5DA514FF92C7FCA55B5CA513035CA513075CA5130F5C -A5131F5CA3133F497E007FB512F0A2B6FC263E7EBD21>73 D<90263FFFF093381FFFF850 -13F0629026007FF8EFF000023F4D5AA2023B933801DFC0A2DA39FCED039FA2F1073F1479 -0271040E5BEC70FE191C19381A7F02F01670DAE07F94C7FC19E0A2F001C06201016D6C49 -5A02C05FF00700A2180E6F6C14010103161C028003385BA218706F7EF0E00313070200DA -01C05BA2923907F00380A294380700075B010E902603F80E5C5FA25F190F011E6D6C5A01 -1C605FA2EEFDC0DB00FF141F013C5D013860013C92C7FC017C5C01FE027E143F2607FF80 -017C4A7EB500FC037FB512E004785E4A1338553E7CBD53>77 D<90263FFFE0023FB5FC6F -16FEA29026003FF8020313C0021F030013004A6C157C023B163C6F153814398102381678 -02787FDA707F157082153F82031F15F002F07FDAE00F5D8215078203031401010180DAC0 -015D82811780047F1303010315C04A013F5C17E0161F17F0040F1307010715F891C70007 -91C7FC17FC160317FE04015B4915FF010E6E130E188E177F18CEEF3FDE011E16FE011C6F -5AA2170FA21707133C01386F5A133C017C150113FE2607FF801400B512FC18705C483E7D -BD44>I<013FB612FEEFFFE018F8903B007FF0000FFC6E48EB01FF7113804BEC7FC0183F -19E0F01FF0A2147F5D19F8A402FFED3FF092C8FCA219E0A2F07FC05B4AEDFF8019004D5A -4D5AEF0FF80103ED3FE04A903801FF8091B648C7FC17F002FCCAFCA213075CA5130F5CA5 -131F5CA5133F5CA3137F497EB612E0A25D3D3E7DBD3E>80 D<9238FF80070207EBE00F02 -1FEBF81E91387F00FE02FCEB1F3ED903F0EB0FFE49481307494813034AEB01FC49C7FC49 -1400133E137E177C491578A57F1770A26D1500808080EB7FFEECFFE06D13FEEDFFC06D14 -F06D14FC010380010080143F02031480DA003F13C015031500EE7FE0163F161FA2160F12 -1CA31607160F003C16C0A31780003E151F1700007E5D007F153E6D5C16FC01E0495AD87D -F0495AD8FCFCEB0FC03AF87F803F8027F01FFFFEC7FCD8E00713F839C0007FC030427BBF -33>83 D85 D97 DIIIII<1478EB01FE130314FFA25B14FE130314FCEB00F0 -1400ACEB03F8EA01FF14F0A2EA001F130FA314E0A5131F14C0A5133F1480A5137F1400A5 -5B5BA4EA03FF007F13F0A2B5FC183E7DBD1A>105 D<143FEB1FFF5BA213017FA214FEA5 -130114FCA5130314F8A5130714F0A5130F14E0A5131F14C0A5133F1480A5137F1400A55B -5BA4EA03FF007F13F8A2B5FC183F7DBE1A>108 D<903907F007F8D803FFEB1FFF9139E0 -781FC09138E1E00F3B001FE38007E090380FE70002EE14F014FC14D814F85CA24A130F13 -1F4A14E0A4161F133F4A14C0A4163F137F91C71380A4167F5B491500A300015D486C4913 -80B5D8F87F13FCA32E287DA733>110 DI<903907F01F80D803 -FFEB7FE09138E1E1F09138E387F839001FE707EB0FE614EE02FC13F002D813E09138F801 -804AC7FCA25C131FA25CA4133F5CA5137F91C8FCA55B5BA31201487EB512FEA325287EA7 -24>114 D<9138FF81C0010713E390381F807F90397C003F8049131F4848130F5B000314 -07A248481400A27FA27F6D90C7FCEBFF8014FC6C13FF6C14C015F06C6C7F011F7F130790 -38007FFE1403140100381300157EA2123C153E157E007C147CA2007E147815F8007F495A -4A5A486C485A26F9E01FC7FC38E0FFFC38C01FE0222A7DA824>II118 -DI<90B539E007 -FFF05E18E0902707FE000313006D48EB01FC705A5F01014A5A5F16036E5C0100140794C7 -FC160E805E805E1678ED8070023F13F05EED81C015C191381FC38015C793C8FC15EF15EE -EC0FFCA25DA26E5AA25DA26E5A5DA24AC9FC5C140E141E141C5C121C003F5B5A485B495A -130300FE5B4848CAFCEA701EEA783CEA3FF0EA0FC0343A80A630>121 -D E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Fi cmbx12 17.28 43 -/Fi 43 122 df46 D<16F04B7E1507151F153FEC01FF1407 -147F010FB5FCB7FCA41487EBF007C7FCB3B3B3B3007FB91280A6395E74DD51>49 -D<913801FFF8021FEBFFC091B612F8010315FF010F16C0013F8290267FFC0114F89027FF -E0003F7F4890C7000F7F48486E7FD807F86E148048486E14C048486E14E048486F13F001 -FC17F8486C816D17FC6E80B56C16FE8380A219FFA283A36C5BA26C5B6C90C8FCD807FC5D -EA01F0CA14FEA34D13FCA219F85F19F04D13E0A294B512C019804C14004C5B604C5B4C5B -604C13804C90C7FC4C5A4C5A4B13F05F4B13804B90C8FC4B5AED1FF84B5A4B5A4B48143F -4A5B4A48C8FC4A5A4A48157E4A5A4A5AEC7F8092C9FC02FE16FE495A495A4948ED01FCD9 -0FC0150749B8FC5B5B90B9FC5A4818F85A5A5A5A5ABAFCA219F0A4405E78DD51>I<92B5 -FC020F14F8023F14FF49B712C04916F0010FD9C01F13FC90271FFC00077FD93FE001017F -49486D8049C86C7F484883486C6F7F14C0486D826E806E82487FA4805CA36C5E4A5E6C5B -6C5B6C495E011FC85A90C95CA294B55A614C91C7FC604C5B4C5B4C5B4C5B047F13809226 -0FFFFEC8FC020FB512F817E094C9FC17F817FF91C7003F13E0040713F8040113FE707F71 -7F7113E085717FA2717F85A285831A80A31AC0EA03FCEA0FFF487F487F487FA2B57EA31A -80A34D14005C7E4A5E5F6C495E49C8485BD81FF85F000F5ED807FE92B55A6C6C6C491480 -6C01F0010791C7FC6C9026FF803F5B6D90B65A011F16F0010716C001014BC8FCD9001F14 -F0020149C9FC426079DD51>II<01C0EE01C0D801F8160F01FF167F02F0EC07FFDAFF8090B5FC92B712 -8019006060606060606095C7FC17FC5F17E0178004FCC8FC16E09026FC3FFCC9FC91CBFC -ADED3FFE0203B512F0020F14FE023F6E7E91B712E001FDD9E00F7F9027FFFE00037F02F8 -01007F02E06EB4FC02806E138091C8FC496F13C04917E07113F0EA00F090C914F8A219FC -83A219FEA419FFA3EA03F0EA0FFC487E487E487FA2B57EA319FEA35C4D13FC6C90C8FC5B -4917F8EA3FF001804B13F06D17E0001F5E6C6C17C06D4B1380D807FC92B512006C6C4A5B -6C6C6C01075B6C01E0011F5BD97FFE90B55A6DB712C0010F93C7FC6D15FC010115F0D900 -3F1480020301F0C8FC406078DD51>III<92383FFF800203B512FC021FECFF80027F -15E049B712F849D9F0077F010F90C76C7ED91FFCEC1FFFD93FF06E7F494802037F494882 -717F484980854890C9127FA24884183FA25A80A380806E157F6E5E14FE6E7E6F4A5A6C14 -F003FC495B03FF495B6C1580DCE0075B6CDBF80F90C7FC9338FE1FFE6C9238FF7FF84D5A -6D16C06D5E6D4BC8FC6D6F7E6D16E00101826D16FC023F814A8149B87E01078349839026 -3FFE3F8190267FFC0F819026FFF003814849C6FC48496D804849131F4890C70007801601 -48486E1580003F163F49150F007F7014C0491501717E8400FF835B8484A384A21A80A27F -007F1900607F003F606D160F001F606D4C5A6C6D153F6C6D4B5A6C01F04B5A6C01FC0203 -5B6C01FF021F5B6D9027F001FFFEC7FC6D90B65A010F16F001035E010093C8FC020F14F8 -DA007F90C9FC426079DD51>I66 D<4DB5ED03C0057F02F01407 -0407B600FE140F047FDBFFC0131F4BB800F0133F030F05FC137F033F9127F8007FFE13FF -92B6C73807FF814A02F0020113C3020702C09138007FE74A91C9001FB5FC023F01FC1607 -4A01F08291B54882490280824991CB7E49498449498449498449865D49498490B5FC484A -84A2484A84A24891CD127FA25A4A1A3F5AA348491A1FA44899C7FCA25CA3B5FCB07EA380 -A27EA2F50FC0A26C7FA37E6E1A1F6C1D80A26C801D3F6C6E1A00A26C6E616D1BFE6D7F6F -4E5A7F6D6D4E5A6D6D4E5A6D6D4E5A6D6E171F6D02E04D5A6E6DEFFF806E01FC4C90C7FC -020F01FFEE07FE6E02C0ED1FF8020102F8ED7FF06E02FF913803FFE0033F02F8013F1380 -030F91B648C8FC030117F86F6C16E004071680DC007F02F8C9FC050191CAFC626677E375 ->IIII73 D76 D<94381FFFE00407B67E043F15F04BB712FE030F -EEFFC0033FD9FC0014F092B500C0010F13FC020349C7000113FF4A01F86E6C7F021F496F -13E04A01C0030F7F4A496F7F91B5C96C7F0103497013FF494970804B834949717F498749 -49717F49874B8390B586484A717FA24891CB6C7FA2481D804A84481DC0A348497214E0A3 -481DF0A34A85481DF8A5B51CFCB06C1DF8A36E96B5FCA36C1DF0A46C6D4E14E0A36C1DC0 -6E606C1D80A26C6E4D1400A26C6E4D5BA26C6E4D5BA26D6D4D5B6D636D6D4D5B6F94B5FC -6D636D6D4C5C6D6D4C91C7FC6D6E4B5B6D02E0031F5B023F6D4B13F06E01FC92B55A6E01 -FF02035C020302C0010F91C8FC020002FC90B512FC033F90B712F0030F17C0030394C9FC -DB007F15F804071580DC001F01E0CAFC666677E379>79 DI83 D<001FBEFCA64849C79126E0000F -148002E0180091C8171F498601F81A0349864986A2491B7FA2491B3F007F1DC090C9181F -A4007E1C0FA600FE1DE0481C07A5CA95C7FCB3B3B3A3021FBAFCA663617AE070>II<913803FFFE027FEBFF -F00103B612FE010F6F7E4916E090273FFE001F7FD97FE001077FD9FFF801017F486D6D7F -717E486D6E7F85717FA2717FA36C496E7FA26C5B6D5AEB1FC090C9FCA74BB6FC157F0207 -B7FC147F49B61207010F14C0013FEBFE004913F048B512C04891C7FC485B4813F85A5C48 -5B5A5CA2B55AA45FA25F806C5E806C047D7F6EEB01F96C6DD903F1EBFF806C01FED90FE1 -14FF6C9027FFC07FC01580000191B5487E6C6C4B7E011F02FC130F010302F001011400D9 -001F90CBFC49437CC14E>97 D<903807FF80B6FCA6C6FC7F7FB3A8EFFFF8040FEBFF8004 -7F14F00381B612FC038715FF038F010014C0DBBFF0011F7FDBFFC001077F93C76C7F4B02 -007F03F8824B6F7E4B6F13804B17C0851BE0A27313F0A21BF8A37313FCA41BFEAE1BFCA4 -4F13F8A31BF0A24F13E0A24F13C06F17804F1300816F4B5A6F4A5B4AB402075B4A6C6C49 -5B9126F83FE0013F13C09127F00FFC03B55A4A6CB648C7FCDAC00115F84A6C15E091C700 -1F91C8FC90C8000313E04F657BE35A>I<92380FFFF04AB67E020F15F0023F15FC91B77E -01039039FE001FFF4901F8010113804901E0010713C04901804913E0017F90C7FC49484A -13F0A2485B485B5A5C5A7113E0485B7113C048701380943800FE0095C7FC485BA4B5FCAE -7EA280A27EA2806C18FCA26C6D150119F87E6C6D15036EED07F06C18E06C6D150F6D6DEC -1FC06D01E0EC7F806D6DECFF00010701FCEB03FE6D9039FFC03FFC010091B512F0023F5D -020F1580020102FCC7FCDA000F13C03E437BC148>II<92380FFFC04AB512FC020FECFF8002 -3F15E091B712F80103D9FE037F499039F0007FFF011F01C0011F7F49496D7F4990C76C7F -49486E7F48498048844A804884485B727E5A5C48717EA35A5C721380A2B5FCA391B9FCA4 -1A0002C0CBFCA67EA380A27EA27E6E160FF11F806C183F6C7FF17F006C7F6C6D16FE6C17 -016D6C4B5A6D6D4A5A6D01E04A5A6D6DEC3FE0010301FC49B45A6D9026FFC01F90C7FC6D -6C90B55A021F15F8020715E0020092C8FC030713F041437CC14A>III<903807FF80B6FCA6C6FC7F7FB3A8EF1FFF94B512F0040714FC041F14FF4C8193267F -E07F7F922781FE001F7FDB83F86D7FDB87F07FDB8FC0814C7F039FC78015BE03BC8003FC -825DA25DA25DA45DB3B2B7D8F007B71280A651647BE35A>II<903807FF80B6FCA6C6FC7F7FB3B3B3B3 -ADB712E0A623647BE32C>108 D<902607FF80D91FFFEEFFF8B691B500F00207EBFF8004 -0702FC023F14E0041F02FF91B612F84C6F488193267FE07F6D4801037F922781FE001F90 -27E00FF0007FC6DA83F86D9026F01FC06D7F6DD987F06D4A487F6DD98FC0DBF87EC7804C -6D027C80039FC76E488203BEEEFDF003BC6E4A8003FC04FF834B5FA24B5FA24B94C8FCA4 -4B5EB3B2B7D8F007B7D8803FB612FCA67E417BC087>I<902607FF80EB1FFFB691B512F0 -040714FC041F14FF4C8193267FE07F7F922781FE001F7FC6DA83F86D7F6DD987F07F6DD9 -8FC0814C7F039FC78015BE03BC8003FC825DA25DA25DA45DB3B2B7D8F007B71280A65141 -7BC05A>I<923807FFE092B6FC020715E0021F15F8027F15FE494848C66C6C7E010701F0 -010F13E04901C001037F49496D7F4990C87F49486F7E49486F7E48496F13804819C04A81 -4819E048496F13F0A24819F8A348496F13FCA34819FEA4B518FFAD6C19FEA46C6D4B13FC -A36C19F8A26C6D4B13F0A26C19E06C6D4B13C0A26C6D4B13806C6D4B13006D6C4B5A6D6D -495B6D6D495B010701F0010F13E06D01FE017F5B010090B7C7FC023F15FC020715E00200 -92C8FC030713E048437CC151>I<902607FF80EBFFF8B6010FEBFF80047F14F00381B612 -FC038715FF038F010114C09227BFF0003F7FC6DAFFC0010F7F6D91C76C7F6D496E7F03F8 -6E7F4B6E7F4B17804B6F13C0A27313E0A27313F0A21BF885A21BFCA3851BFEAE4F13FCA4 -1BF861A21BF0611BE0611BC06F92B512801B006F5C6F4A5B6F4A5B03FF4A5B70495B04E0 -017F13C09226CFFC03B55A03C7B648C7FC03C115F803C015E0041F91C8FC040313E093CB -FCB3A3B712F0A64F5D7BC05A>I114 -D<913A3FFF8007800107B5EAF81F011FECFE7F017F91B5FC48B8FC48EBE0014890C7121F -D80FFC1407D81FF0801600485A007F167F49153FA212FF171FA27F7F7F6D92C7FC13FF14 -E014FF6C14F8EDFFC06C15FC16FF6C16C06C16F06C826C826C826C82013F1680010F16C0 -1303D9007F15E0020315F0EC001F1500041F13F81607007C150100FC81177F6C163FA217 -1F7EA26D16F0A27F173F6D16E06D157F6D16C001FEEDFF806D0203130002C0EB0FFE02FC -EB7FFC01DFB65A010F5DD8FE0315C026F8007F49C7FC48010F13E035437BC140>II<902607FFC0ED3F -FEB60207B5FCA6C6EE00076D826D82B3B3A260A360A2607F60183E6D6D147E4E7F6D6D49 -48806D6DD907F0ECFF806D01FFEB3FE06D91B55A6E1500021F5C020314F8DA003F018002 -F0C7FC51427BC05A>III<007FB600C0017FB512F8A6 -D8001F01F8C70007EBF0006D040190C7FC6D6D5D6D6D4A5A6D6D4A5A70495A6D4C5A6E7F -6E6D495A6E6D495A7049C8FC6E4A5A6E6D485A6E6D485A6E13FFEF8FF06EEC9FE06FEBFF -C06F5C6F91C9FC5F6F5B816F7F6F7F8481707F8493B57E4B805D4B80DB0FF37FDB1FE17F -04C080153F4B486C7F4B486C7F4A486D7F4A486D7F4A5A4B6D7F020F6E7F4A486D7F4A48 -6D804A5A4AC86C7F49486F7F4A6F7F0107707FEB3FFFB600F049B7FCA650407EBF55>I< -B700C00103B512FCA6D8003F01C0C8381FFE006FED07F0A26D6D5E190F6D6D5E191F6D6D -5E193F6D95C7FC6F5D6D177E6F15FEA26D6E495AA26E6D5C18036E6D5C18076E5E70130F -6E5E70131FA26E6D495AA26E6D91C8FC606E6D137E18FE6E5D17816F5C17C3A26FEBE7F0 -A26FEBF7E017FF6F5CA26F5CA26F91C9FCA36F5BA26F5BA2705AA2705AA2705AA35FA25F -163F94CAFC5E167E16FED807E05CD81FF81301487E486C495AA2B5495AA24B5A5E151F4B -5A6C4849CBFC15FEEBFC01393FF807FC391FF03FF06CB55A6C5C6C91CCFCC613FCEB1FE0 -4E5D7DBF55>I E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Fj cmtt10 10.95 76 -/Fj 76 126 df<00101304007C131F00FEEB3F80A26C137FA248133FB2007E1400007C7F -003C131E00101304191C75B830>34 D37 D<141E147F14FF5BEB03FEEB07FCEB0FF0EB1FE0EB3FC0 -EB7F80EBFF00485A5B12035B485A120F5BA2485AA2123F5BA2127F90C7FCA412FEAD127F -A47F123FA27F121FA26C7EA27F12076C7E7F12017F6C7EEB7F80EB3FC0EB1FE0EB0FF0EB -07FCEB03FEEB01FF7F147F141E184771BE30>40 D<127812FE7E7F6C7E6C7EEA0FF06C7E -6C7E6C7E6C7EEB7F80133F14C0131FEB0FE014F01307A2EB03F8A214FC1301A214FE1300 -A4147FAD14FEA4130114FCA2130314F8A2EB07F0A2130F14E0EB1FC0133F1480137FEBFF -00485A485A485A485AEA3FE0485A485A90C7FC5A1278184778BE30>I<14E0497E497EA6 -0038EC0380007EEC0FC0D8FF83EB3FE001C3137F9038F3F9FF267FFBFB13C06CB6128000 -0FECFE00000314F86C5C6C6C13C0011F90C7FC017F13C048B512F04880000F14FE003FEC -FF80267FFBFB13C026FFF3F913E09038C3F87F0183133FD87E03EB0FC00038EC03800000 -91C7FCA66D5A6D5A23277AAE30>I<143EA2147FAF007FB7FCA2B81280A36C1600A2C76C -C8FCAF143EA229297DAF30>II<007FB612F0A2B712F8A36C15F0A225077B9E30>I<120FEA3FC0EA7FE0A2EAFFF0A4EA -7FE0A2EA3FC0EA0F000C0C6E8B30>I<16F01501ED03F8A21507A2ED0FF0A2ED1FE0A2ED -3FC0A2ED7F80A2EDFF00A24A5AA25D1403A24A5AA24A5AA24A5AA24A5AA24A5AA24AC7FC -A2495AA25C1303A2495AA2495AA2495AA2495AA2495AA249C8FCA2485AA25B1203A2485A -A2485AA2485AA2485AA2485AA248C9FCA25AA2127CA225477BBE30>I<14FE903807FFC0 -497F013F13F8497F90B57E48EB83FF4848C6138049137F4848EB3FC04848EB1FE049130F -001F15F0491307A24848EB03F8A290C712014815FCA400FEEC00FEAD6C14016C15FCA36D -1303003F15F8A26D1307001F15F0A26D130F6C6CEB1FE0A26C6CEB3FC06C6CEB7F806D13 -FF2601FF8313006CEBFFFE6D5B6D5B010F13E06D5BD900FEC7FC273A7CB830>IIIII<000FB612804815C05AA316800180C8FCAEEB -83FF019F13C090B512F015FC8181D9FE0313809039F0007FC049133F0180EB1FE06CC712 -0F000E15F0C81207A216F81503A31218127EA2B4FC150716F048140F6C15E06C141F6DEB -3FC06D137F3A3FE001FF80261FFC0F13006CB55A6C5C6C5C6C14E06C6C1380D90FFCC7FC -25397BB730>II<127CB712FC16FEA416FC48C7EA0FF816F0ED1FE0007CEC3FC0 -C8EA7F80EDFF00A24A5A4A5A5D14075D140F5D4A5AA24A5AA24AC7FCA25C5C13015CA213 -035CA213075CA4495AA6131F5CA96D5A6DC8FC273A7CB830>I<49B4FC011F13F0017F13 -FC90B57E0003ECFF804815C048010113E03A1FF8003FF049131FD83FC0EB07F8A24848EB -03FC90C71201A56D1303003F15F86D13076C6CEB0FF06C6CEB1FE0D807FCEB7FC03A03FF -83FF806C90B512006C6C13FC011F13F0497F90B512FE48802607FE0013C0D80FF8EB3FE0 -D81FE0EB0FF04848EB07F8491303007F15FC90C712014815FE481400A66C14016C15FC6D -1303003F15F86D1307D81FF0EB1FF06D133F3A0FFF01FFE06C90B512C06C1580C6ECFE00 -6D5B011F13F0010190C7FC273A7CB830>I<49B4FC010F13E0013F13F890B57E48804880 -48010113803A0FFC007FC0D81FF0EB3FE04848131F49EB0FF048481307A290C7EA03F85A -4815FC1501A416FEA37E7E6D1303A26C6C13076C6C130F6D133FD80FFC13FF6CB6FC7E6C -14FE6C14F9013FEBE1FC010F138190380060011400ED03F8A2150716F0150F000F15E048 -6C131F486CEB3FC0157FEDFF804A1300EC07FE391FF01FFC90B55A6C5C6C5C6C1480C649 -C7FCEB3FF0273A7CB830>I<120FEA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA0F00C7 -FCAF120FEA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA0F000C276EA630>II<16F01503ED07F8151F157FEDFFF014034A13C0021F138091383F -FE00ECFFF8495B010713C0495BD93FFEC7FC495A3801FFF0485B000F13804890C8FCEA7F -FC5BEAFFE05B7FEA7FF87FEA1FFF6C7F000313E06C7F38007FFC6D7E90380FFF806D7F01 -0113F06D7FEC3FFE91381FFF80020713C06E13F01400ED7FF8151F1507ED03F01500252F -7BB230>I<1278127EB4FC13C07FEA7FF813FEEA1FFF6C13C000037F6C13F86C6C7EEB1F -FF6D7F010313E06D7F9038007FFC6E7E91380FFF806E13C0020113F080ED3FF8151F153F -EDFFF05C020713C04A138091383FFE004A5A903801FFF0495B010F13804990C7FCEB7FFC -48485A4813E0000F5B4890C8FCEA7FFE13F8EAFFE05B90C9FC127E1278252F7BB230>62 -D64 -D<147F4A7EA2497FA4497F14F7A401077F14E3A3010F7FA314C1A2011F7FA490383F80FE -A590387F007FA4498049133F90B6FCA34881A39038FC001F00038149130FA40007814913 -07A2D87FFFEB7FFFB56CB51280A46C496C130029397DB830>I<007FB512F0B612FE6F7E -82826C813A03F8001FF815076F7E1501A26F7EA615015EA24B5A1507ED1FF0ED7FE090B6 -5A5E4BC7FC6F7E16E0829039F8000FF8ED03FC6F7E1500167FA3EE3F80A6167F1700A25E -4B5A1503ED1FFC007FB6FCB75A5E16C05E6C02FCC7FC29387EB730>I<91387F803C9039 -03FFF03E49EBFC7E011F13FE49EBFFFE5B9038FFE07F48EB801F3903FE000F484813075B -48481303A2484813015B123F491300A2127F90C8FC167C16005A5AAC7E7EA2167C6D14FE -123FA27F121F6D13016C6C14FCA26C6CEB03F86D13076C6CEB0FF03901FF801F6C9038E0 -7FE06DB512C06D14806D1400010713FC6D13F09038007FC0273A7CB830>I<003FB512E0 -4814FCB67E6F7E6C816C813A03F8007FF0ED1FF8150F6F7E6F7E15016F7EA2EE7F80A216 -3F17C0161FA4EE0FE0AC161F17C0A3163F1780A2167F17005E4B5A15034B5A150F4B5AED -7FF0003FB65A485DB75A93C7FC6C14FC6C14E02B387FB730>I<007FB7FCB81280A47ED8 -03F8C7123FA8EE1F0093C7FCA4157C15FEA490B5FCA6EBF800A4157C92C8FCA5EE07C0EE -0FE0A9007FB7FCB8FCA46C16C02B387EB730>I<003FB712804816C0B8FCA27E7ED801FC -C7121FA8EE0F8093C7FCA5153E157FA490B6FCA69038FC007FA4153E92C8FCAE383FFFF8 -487FB5FCA27E6C5B2A387EB730>I<02FF13F00103EBC0F8010F13F1013F13FD4913FF90 -B6FC4813C1EC007F4848133F4848131F49130F485A491307121F5B123F491303A2127F90 -C7FC6F5A92C8FC5A5AA892B5FC4A14805CA26C7F6C6D1400ED03F8A27F003F1407A27F12 -1F6D130F120F7F6C6C131FA2D803FE133F6C6C137FECC1FF6C90B5FC7F6D13FB010F13F3 -0103EBC1F0010090C8FC293A7DB830>I<3B3FFF800FFFE0486D4813F0B56C4813F8A26C -496C13F06C496C13E0D803F8C7EAFE00B290B6FCA601F8C7FCB3A23B3FFF800FFFE0486D -4813F0B56C4813F8A26C496C13F06C496C13E02D387FB730>I<007FB6FCB71280A46C15 -00260007F0C7FCB3B3A8007FB6FCB71280A46C1500213879B730>I75 -D<383FFFF8487FB57EA26C5B6C5BD801FCC9FCB3B0EE0F80EE1FC0A9003FB7FC5AB8FCA2 -7E6C16802A387EB730>III<90383FFFE048B512FC000714FF4815804815C04815E0EB -F80001E0133FD87F80EB0FF0A290C71207A44815F8481403B3A96C1407A26C15F0A36D13 -0FA26D131F6C6CEB3FE001F813FF90B6FC6C15C06C15806C1500000114FCD8003F13E025 -3A7BB830>I<007FB512F0B612FE6F7E16E0826C813903F8003FED0FFCED03FE15016F7E -A2821780163FA6167F17005EA24B5A1503ED0FFCED3FF890B6FC5E5E16804BC7FC15F001 -F8C9FCB0387FFFC0B57EA46C5B29387EB730>I<003FB57E4814F0B612FC15FF6C816C81 -2603F8017F9138003FF0151F6F7E15071503821501A515035E1507150F4B5A153F4AB45A -90B65A5E93C7FC5D8182D9F8007FED3FE0151F150F821507A817F8EEF1FCA53A3FFF8003 -FB4801C0EBFFF8B56C7E17F06C496C13E06C49EB7FC0C9EA1F002E397FB730>82 -D<90390FF803C0D97FFF13E048B512C74814F74814FF5A381FF80F383FE001497E484813 -7F90C7123F5A48141FA2150FA37EED07C06C91C7FC7F7FEA3FF0EA1FFEEBFFF06C13FF6C -14E0000114F86C80011F13FF01031480D9003F13C014019138007FE0151FED0FF0A2ED07 -F8A2007C140312FEA56C140716F07F6DEB0FE06D131F01F8EB3FC001FF13FF91B5128016 -0000FD5CD8FC7F13F8D8F81F5BD878011380253A7BB830>I<003FB712C04816E0B8FCA4 -3AFE003F800FA8007CED07C0C791C7FCB3B1011FB5FC4980A46D91C7FC2B387EB730>I< -3B7FFFC007FFFCB56C4813FEA46C496C13FCD803F8C7EA3F80B3B16D147F00011600A36C -6C14FE6D13016D5CEC800390393FE00FF890391FF83FF06DB55A6D5C6D5C6D91C7FC9038 -007FFCEC1FF02F3980B730>III<3A3FFF01FFF84801837F02C77FA202835B6C01015B3A01FC007F806D91C7FC00 -005C6D5BEB7F01EC81FCEB3F8314C3011F5B14E7010F5B14FF6D5BA26D5BA26D5BA26D90 -C8FCA4497FA2497FA2815B81EB0FE781EB1FC381EB3F8181EB7F0081497F49800001143F -49800003141F49800007140FD87FFEEB7FFFB590B5128080A25C6C486D130029387DB730 ->II<007FB612F0A2B712F8A36C15F0A225077B7D30>95 D97 DII<913801FFE04A -7F5CA28080EC0007AAEB03FE90381FFF874913E790B6FC5A5A481303380FFC00D81FF013 -3F49131F485A150F4848130790C7FCA25AA25AA87E6C140FA27F003F141F6D133F6C7E6D -137F390FF801FF2607FE07EBFFC06CB712E06C16F06C14F76D01C713E0011F010313C0D9 -07FCC8FC2C397DB730>I<49B4FC010713E0011F13F8017F7F90B57E488048018113803A -07FC007FC04848133FD81FE0EB1FE0150F484814F0491307127F90C7FCED03F85A5AB7FC -A516F048C9FC7E7EA27F003FEC01F06DEB03F86C7E6C7E6D1307D807FEEB1FF03A03FFC0 -7FE06C90B5FC6C15C0013F14806DEBFE00010713F8010013C0252A7CA830>IIII<14E0EB03F8A2497EA36D5AA2EB00E091C8FCA9381FFFF8487F5AA27E7EEA0001B3A9 -003FB612C04815E0B7FCA27E6C15C023397AB830>I107 -D<387FFFF8B57EA47EEA0001B3B3A8007FB612F0B712F8A46C15F025387BB730>I<02FC -137E3B7FC3FF01FF80D8FFEF01877F90B500CF7F15DF92B57E6C010F13872607FE07EB03 -F801FC13FE9039F803FC01A201F013F8A301E013F0B3A23C7FFE0FFF07FF80B548018F13 -C0A46C486C01071380322881A730>II<49B4FC010F -13E0013F13F8497F90B57E0003ECFF8014013A07FC007FC04848EB3FE0D81FE0EB0FF0A2 -4848EB07F8491303007F15FC90C71201A300FEEC00FEA86C14016C15FCA26D1303003F15 -F86D13076D130F6C6CEB1FF06C6CEB3FE06D137F3A07FF01FFC06C90B512806C15006C6C -13FC6D5B010F13E0010190C7FC272A7CA830>II<49B413F8010FEBC1FC013F13F14913FD48B6FC5A481381390FFC00 -7F49131F4848130F491307485A491303127F90C7FC15015A5AA77E7E15037FA26C6C1307 -150F6C6C131F6C6C133F01FC137F3907FF01FF6C90B5FC6C14FD6C14F9013F13F1010F13 -C1903803FE0190C7FCAD92B512F84A14FCA46E14F82E3C7DA730>II<9038 -1FFC1E48B5129F000714FF5A5A5A387FF007EB800100FEC7FC4880A46C143E007F91C7FC -13E06CB4FC6C13FC6CEBFF806C14E0000114F86C6C7F01037F9038000FFF02001380007C -147F00FEEC1FC0A2150F7EA27F151F6DEB3F806D137F9039FC03FF0090B6FC5D5D00FC14 -F0D8F83F13C026780FFEC7FC222A79A830>III<3B3FFFC07FFF80 -486DB512C0B515E0A26C16C06C496C13803B01F80003F000A26D130700005DA26D130F01 -7E5CA2017F131F6D5CA2EC803F011F91C7FCA26E5A010F137EA2ECE0FE01075BA214F101 -035BA3903801FBF0A314FF6D5BA36E5A6E5A2B277EA630>I<3B3FFFC01FFFE0486D4813 -F0B515F8A26C16F06C496C13E0D807E0C7EA3F00A26D5C0003157EA56D14FE00015DEC0F -80EC1FC0EC3FE0A33A00FC7FF1F8A2147DA2ECFDF9017C5C14F8A3017E13FBA290393FF0 -7FE0A3ECE03FA2011F5C90390F800F802D277FA630>I<3A3FFF81FFFC4801C37FB580A2 -6C5D6C01815BC648C66CC7FC137FEC80FE90383F81FC90381FC3F8EB0FE3ECE7F06DB45A -6D5B7F6D5B92C8FC147E147F5C497F81903803F7E0EB07E790380FE3F0ECC1F890381F81 -FC90383F80FE90387F007E017E137F01FE6D7E48486D7E267FFF80B5FCB500C1148014E3 -A214C16C0180140029277DA630>I<3B3FFFC07FFF80486DB512C0B515E0A26C16C06C49 -6C13803B01FC0003F000A2000014076D5C137E150F017F5C7F151FD91F805BA214C0010F -49C7FCA214E00107137EA2EB03F0157C15FCEB01F85DA2EB00F9ECFDF0147D147FA26E5A -A36E5AA35DA2143F92C8FCA25C147EA2000F13FE486C5AEA3FC1EBC3F81387EB8FF0EBFF -E06C5B5C6C90C9FC6C5AEA01F02B3C7EA630>I<001FB612FC4815FE5AA316FC90C7EA0F -F8ED1FF0ED3FE0ED7FC0EDFF80003E491300C7485A4A5A4A5A4A5A4A5A4A5A4A5A4990C7 -FC495A495A495A495A495A495A4948133E4890C7127F485A485A485A485A485A48B7FCB8 -FCA46C15FE28277DA630>II125 D E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Fk cmbx12 14.4 49 -/Fk 49 122 df<151E153E157E15FCEC01F8EC07F0EC0FE0EC1FC01580143FEC7F0014FE -1301495A5C1307495AA2495A133F5C137FA2495AA24890C7FCA25A5BA21207A2485AA312 -1F5BA3123FA25BA3127FA55B12FFB3A3127F7FA5123FA37FA2121FA37F120FA36C7EA212 -03A27F7EA26C7FA26D7EA2133F80131F6D7EA26D7E1303806D7E1300147FEC3F80141F15 -C0EC0FE0EC07F0EC01F8EC00FC157E153E151E1F7973D934>40 D<127012F8127C127E7E -EA1FC06C7E6C7E12037F6C7E6C7E7F6D7E133F806D7EA26D7E80130780A26D7EA26D7EA2 -15807FA215C0A2EC7FE0A315F0143FA315F8A2141FA315FCA5140F15FEB3A315FC141FA5 -15F8A3143FA215F0A3147F15E0A3ECFFC0A21580A25B1500A2495AA2495AA25C130F5C49 -5AA2495A5C137F49C7FC5B485A485A5B1207485A485A48C8FC127E127C5A12701F7979D9 -34>I46 -D<913803FFC0023F13FC91B6FC010315C0010F018113F0903A1FFC003FF849486D7E4948 -6D7E49486D7E48496D138048496D13C0A24817E04890C813F0A34817F8A24817FC49157F -A3007F17FEA600FF17FFB3A5007F17FEA6003F17FCA26D15FFA26C17F8A36C17F0A26C6D -4913E0A26C6D4913C06C17806E5B6C6D4913006D6C495AD91FFCEB3FF8903A0FFF81FFF0 -6D90B55A01011580D9003F01FCC7FC020313C0384F7BCD43>48 D<157815FC1403140714 -1F14FF130F0007B5FCB6FCA2147F13F0EAF800C7FCB3B3B3A6007FB712FEA52F4E76CD43 ->II<91380FFFC091B512FC0107ECFF80011F15E090 -263FF8077F9026FF800113FC4848C76C7ED803F86E7E491680D807FC8048B416C080486D -15E0A4805CA36C17C06C5B6C90C75AD801FC1680C9FC4C13005FA24C5A4B5B4B5B4B13C0 -4B5BDBFFFEC7FC91B512F816E016FCEEFF80DA000713E0030113F89238007FFE707E7013 -807013C018E07013F0A218F8A27013FCA218FEA2EA03E0EA0FF8487E487E487EB57EA318 -FCA25E18F891C7FC6C17F0495C6C4816E001F04A13C06C484A1380D80FF84A13006CB44A -5A6CD9F0075BC690B612F06D5D011F1580010302FCC7FCD9001F1380374F7ACD43>I<17 -7C17FEA2160116031607160FA2161F163F167FA216FF5D5DA25D5DED1FBFED3F3F153E15 -7C15FCEC01F815F0EC03E01407EC0FC01580EC1F005C147E147C5C1301495A495A5C495A -131F49C7FC133E5B13FC485A5B485A1207485A485A90C8FC123E127E5ABA12C0A5C96C48 -C7FCAF020FB712C0A53A4F7CCE43>III<121F7F7F -EBFF8091B81280A45A1900606060A2606060485F0180C86CC7FC007EC95A4C5A007C4B5A -5F4C5A160F4C5A484B5A4C5A94C8FC16FEC812014B5A5E4B5A150F4B5AA24B5AA24B5A15 -FFA24A90C9FCA25C5D1407A2140FA25D141FA2143FA4147F5DA314FFA55BAC6D5BA2EC3F -C06E5A395279D043>I<913807FFC0027F13FC0103B67E010F15E090261FFC0113F8903A -3FE0003FFCD97F80EB0FFE49C76C7E48488048486E1380000717C04980120F18E0177FA2 -121F7FA27F7F6E14FF02E015C014F802FE4913806C7FDBC00313009238F007FE6C02F85B -9238FE1FF86C9138FFBFF06CEDFFE017806C4BC7FC6D806D81010F15E06D81010115FC01 -0781011F81491680EBFFE748018115C048D9007F14E04848011F14F048487F4848130303 -0014F8484880161F4848020713FC1601824848157F173FA2171FA2170FA218F8A27F007F -17F06D151FA26C6CED3FE0001F17C06D157F6C6CEDFF806C6C6C010313006C01E0EB0FFE -6C01FCEBFFFC6C6CB612F06D5D010F1580010102FCC7FCD9000F13C0364F7ACD43>I<91 -380FFF8091B512F8010314FE010F6E7E4901037F90267FF8007F4948EB3FF048496D7E48 -4980486F7E484980824817805A91C714C05A7013E0A218F0B5FCA318F8A618FCA46C5DA3 -7EA25E6C7F6C5DA26C5D6C7F6C6D137B6C6D13F390387FF803011FB512E36D14C3010302 -8313F89039007FFE03EC00401500A218F05EA3D801F816E0487E486C16C0487E486D4913 -80A218005E5F4C5A91C7FC6C484A5A494A5A49495B6C48495BD803FC010F5B9027FF807F -FEC7FC6C90B55A6C6C14F06D14C0010F49C8FC010013F0364F7ACD43>I<171F4D7E4D7E -A24D7EA34C7FA24C7FA34C7FA34C7FA24C7FA34C8083047F80167E8304FE804C7E030181 -16F8830303814C7E03078116E083030F814C7E031F81168083033F8293C77E4B82157E84 -03FE824B800201835D840203834B800207835D844AB87EA24A83A3DA3F80C88092C97E4A -84A2027E8202FE844A82010185A24A820103854A82010785A24A82010F855C011F717FEB -FFFCB600F8020FB712E0A55B547BD366>65 DI<932601FFFCEC01C0047FD9FFC013030307B600F81307033F03FE131F -92B8EA803F0203DAE003EBC07F020F01FCC7383FF0FF023F01E0EC0FF94A01800203B5FC -494848C9FC4901F8824949824949824949824949824990CA7E494883A2484983485B1B7F -485B481A3FA24849181FA3485B1B0FA25AA298C7FC5CA2B5FCAE7EA280A2F307C07EA36C -7FA21B0F6C6D1980A26C1A1F6C7F1C006C6D606C6D187EA26D6C606D6D4C5A6D6D16036D -6D4C5A6D6D4C5A6D01FC4C5A6D6DEE7F806D6C6C6C4BC7FC6E01E0EC07FE020F01FEEC1F -F80203903AFFE001FFF0020091B612C0033F93C8FC030715FCDB007F14E0040101FCC9FC -525479D261>I -III73 D76 -D<93380FFFC00303B6FC031F15E092B712FC0203D9FC0013FF020F01C0010F13C0023F90 -C7000313F0DA7FFC02007F494848ED7FFE4901E0ED1FFF49496F7F49496F7F4990C96C7F -49854948707F4948707FA24849717E48864A83481B804A83481BC0A2481BE04A83A2481B -F0A348497113F8A5B51AFCAF6C1BF86E5FA46C1BF0A26E5F6C1BE0A36C6D4D13C0A26C6D -4D1380A26C1B006C6D4D5A6E5E6C626D6C4C5B6D6D4B5B6D6D4B5B6D6D4B5B6D6D4B5B6D -6D4B90C7FC6D6D4B5A6D01FF02035B023F01E0011F13F0020F01FC90B512C0020390B7C8 -FC020016FC031F15E0030392C9FCDB001F13E0565479D265>79 DI82 D<91260FFF80130791B500F85B010702FF5B011FEDC0 -3F49EDF07F9026FFFC006D5A4801E0EB0FFD4801800101B5FC4848C87E48488149150F00 -1F824981123F4981007F82A28412FF84A27FA26D82A27F7F6D93C7FC14C06C13F014FF15 -F86CECFF8016FC6CEDFFC017F06C16FC6C16FF6C17C06C836C836D826D82010F82130301 -0082021F16801400030F15C0ED007F040714E01600173F050F13F08383A200788200F882 -A3187FA27EA219E07EA26CEFFFC0A27F6D4B13806D17006D5D01FC4B5A01FF4B5A02C04A -5A02F8EC7FF0903B1FFFC003FFE0486C90B65AD8FC0393C7FC48C66C14FC48010F14F048 -D9007F90C8FC3C5479D24B>I<003FBC1280A59126C0003F9038C0007F49C71607D87FF8 -060113C001E08449197F49193F90C8171FA2007E1A0FA3007C1A07A500FC1BE0481A03A6 -C994C7FCB3B3AC91B912F0A553517BD05E>II97 DI<913801FFF8021FEB -FF8091B612F0010315FC010F9038C00FFE903A1FFE0001FFD97FFC491380D9FFF05B4817 -C048495B5C5A485BA2486F138091C7FC486F1300705A4892C8FC5BA312FFAD127F7FA27E -A2EF03E06C7F17076C6D15C07E6E140F6CEE1F806C6DEC3F006C6D147ED97FFE5C6D6CEB -03F8010F9038E01FF0010390B55A01001580023F49C7FC020113E033387CB63C>I<4DB4 -7E0407B5FCA5EE001F1707B3A4913801FFE0021F13FC91B6FC010315C7010F9038E03FE7 -4990380007F7D97FFC0101B5FC49487F4849143F484980485B83485B5A91C8FC5AA3485A -A412FFAC127FA36C7EA37EA26C7F5F6C6D5C7E6C6D5C6C6D49B5FC6D6C4914E0D93FFED9 -0FEFEBFF80903A0FFFC07FCF6D90B5128F0101ECFE0FD9003F13F8020301C049C7FC4154 -7CD24B>I<913803FFC0023F13FC49B6FC010715C04901817F903A3FFC007FF849486D7E -49486D7E4849130F48496D7E48178048497F18C0488191C7FC4817E0A248815B18F0A212 -FFA490B8FCA318E049CAFCA6127FA27F7EA218E06CEE01F06E14037E6C6DEC07E0A26C6D -EC0FC06C6D141F6C6DEC3F806D6CECFF00D91FFEEB03FE903A0FFFC03FF8010390B55A01 -0015C0021F49C7FC020113F034387CB63D>IIII<137F497E000313E0487FA2487FA76C5BA2 -6C5BC613806DC7FC90C8FCADEB3FF0B5FCA512017EB3B3A6B612E0A51B547BD325>I108 DII<913801FFE0021F13FE91B612C0010315F0010F9038807F -FC903A1FFC000FFED97FF86D6C7E49486D7F48496D7F48496D7F4A147F48834890C86C7E -A24883A248486F7EA3007F1880A400FF18C0AC007F1880A3003F18006D5DA26C5FA26C5F -6E147F6C5F6C6D4A5A6C6D495B6C6D495B6D6C495BD93FFE011F90C7FC903A0FFF807FFC -6D90B55A010015C0023F91C8FC020113E03A387CB643>I<903A3FF001FFE0B5010F13FE -033FEBFFC092B612F002F301017F913AF7F8007FFE0003D9FFE0EB1FFFC602806D7F92C7 -6C7F4A824A6E7F4A6E7FA2717FA285187F85A4721380AC1A0060A36118FFA2615F616E4A -5BA26E4A5B6E4A5B6F495B6F4990C7FC03F0EBFFFC9126FBFE075B02F8B612E06F148003 -1F01FCC8FC030313C092CBFCB1B612F8A5414D7BB54B>I<90397FE003FEB590380FFF80 -033F13E04B13F09238FE1FF89139E1F83FFC0003D9E3E013FEC6ECC07FECE78014EF1500 -14EE02FEEB3FFC5CEE1FF8EE0FF04A90C7FCA55CB3AAB612FCA52F367CB537>114 -D<903903FFF00F013FEBFE1F90B7FC120348EB003FD80FF81307D81FE0130148487F4980 -127F90C87EA24881A27FA27F01F091C7FC13FCEBFFC06C13FF15F86C14FF16C06C15F06C -816C816C81C681013F1580010F15C01300020714E0EC003F030713F015010078EC007F00 -F8153F161F7E160FA27E17E07E6D141F17C07F6DEC3F8001F8EC7F0001FEEB01FE9039FF -C00FFC6DB55AD8FC1F14E0D8F807148048C601F8C7FC2C387CB635>I<143EA6147EA414 -FEA21301A313031307A2130F131F133F13FF5A000F90B6FCB8FCA426003FFEC8FCB3A9EE -07C0AB011FEC0F8080A26DEC1F0015806DEBC03E6DEBF0FC6DEBFFF86D6C5B021F5B0203 -13802A4D7ECB34>IIII<007FB500 -F090387FFFFEA5C66C48C7000F90C7FC6D6CEC07F86D6D5C6D6D495A6D4B5A6F495A6D6D -91C8FC6D6D137E6D6D5B91387FFE014C5A6E6C485A6EEB8FE06EEBCFC06EEBFF806E91C9 -FCA26E5B6E5B6F7E6F7EA26F7F834B7F4B7F92B5FCDA01FD7F03F87F4A486C7E4A486C7E -020F7FDA1FC0804A486C7F4A486C7F02FE6D7F4A6D7F495A49486D7F01076F7E49486E7E -49486E7FEBFFF0B500FE49B612C0A542357EB447>II -E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Fl cmr10 10.95 83 -/Fl 83 124 df<4AB4EB0FE0021F9038E03FFC913A7F00F8FC1ED901FC90383FF03FD907 -F090397FE07F80494801FF13FF4948485BD93F805C137F0200ED7F00EF003E01FE6D91C7 -FC82ADB97EA3C648C76CC8FCB3AE486C4A7E007FD9FC3FEBFF80A339407FBF35>11 -DII<001E130F397F803FC000FF137F01C013E0A201E013F0A3007F13 -3F391E600F3000001300A401E01370491360A3000114E04913C000031301010013804813 -03000EEB070048130E0018130C0038131C003013181C1C7DBE2D>34 -D<14E0A4EB07FC90383FFF8090B512E03901F8E3F03903E0E0FCD807C0133CD80F807FD8 -1F007F003E80003C1580007C140316C00078141F00F8143F157FA47EED3F806CEC0E0092 -C7FC127F138013C0EA3FF013FEEA1FFF6C13FC6C13FF6C14C06C806C6C13F8011F7F1303 -01007FECE7FF14E102E01380157F153FED1FC0A2003E140F127FD8FF801307A5130000FC -158000F0140F1270007815005D6C141E153E6C5C6C5C3907C0E1F03903F8EFE0C6B51280 -D93FFEC7FCEB0FF8EB00E0A422497BC32D>36 D<013F1603D9FFC04B7E2601E0E0150F26 -07C070151F48486C4BC7FC023E157E48486C15FE48D90FC0EB03FC003ED90EF0EB0FF8DA -0F3F13FD007E903A070FFFF1F0007C0200EB03E0160000FC6D6C495A170F604DC8FC5F17 -3E5F17FC5F4C5A1603007CD907005B4C5A007E150F003E495C020E49C9FC003F5D6C4913 -3E260F803C5B023813FC6C6C485B3A01E0E001F03800FFC090273F0003E0133F90C70007 -ECFFC09339C001E0E0923A0F8007C070031F49487E0400143C033E90381F001C037E497F -037C133E4B150F0201027E7F4B137C4A5A020702FCEB03805D4A5A141F92C7FC143E147E -147C5CA2495A0103037CEB07005C4948147E010F033E5B4A160E49C8123F496F5B013E92 -380F803C49173801FC6F6C5A49923801E0E0496FB45A0160043FC7FC41497BC34C>II<121EEA7F8012FF13C0A213E0A3127FEA1E601200A413E013C0A3 -12011380120313005A120E5A1218123812300B1C79BE19>I<1430147014E0EB01C0EB03 -801307EB0F00131E133E133C5B13F85B12015B1203A2485AA2120F5BA2121F90C7FCA25A -A3123E127EA6127C12FCB2127C127EA6123E123FA37EA27F120FA27F1207A26C7EA21201 -7F12007F13787F133E131E7FEB07801303EB01C0EB00E014701430145A77C323>I<12C0 -7E12707E7E121E7E6C7E7F12036C7E7F12007F1378137CA27FA2133F7FA21480130FA214 -C0A3130714E0A6130314F0B214E01307A614C0130FA31480A2131F1400A25B133EA25BA2 -137813F85B12015B485A12075B48C7FC121E121C5A5A5A5A145A7BC323>II<121EEA7F80 -12FF13C0A213E0A3127FEA1E601200A413E013C0A312011380120313005A120E5A121812 -3812300B1C798919>44 DI<121EEA7F80A2EAFFC0A4EA7F80A2 -EA1E000A0A798919>IIIIII<150E151E153EA2157EA215FE -1401A21403EC077E1406140E141CA214381470A214E0EB01C0A2EB0380EB0700A2130E5B -A25B5BA25B5B1201485A90C7FC5A120E120C121C5AA25A5AB8FCA3C8EAFE00AC4A7E49B6 -FCA3283E7EBD2D>I<00061403D80780131F01F813FE90B5FC5D5D5D15C092C7FC14FCEB -3FE090C9FCACEB01FE90380FFF8090383E03E090387001F8496C7E49137E497F90C71380 -0006141FC813C0A216E0150FA316F0A3120C127F7F12FFA416E090C7121F12FC007015C0 -12780038EC3F80123C6CEC7F00001F14FE6C6C485A6C6C485A3903F80FE0C6B55A013F90 -C7FCEB07F8243F7CBC2D>II<1238 -123C123F90B612FCA316F85A16F016E00078C712010070EC03C0ED078016005D48141E15 -1C153C5DC8127015F04A5A5D14034A5A92C7FC5C141EA25CA2147C147814F8A213015C13 -03A31307A3130F5CA2131FA6133FAA6D5A0107C8FC26407BBD2D>III<121EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCB3121EEA7F80A2EAFFC0A4EA -7F80A2EA1E000A2779A619>I<121EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCB3121E12 -7FEAFF80A213C0A4127F121E1200A412011380A3120313005A1206120E120C121C5A1230 -A20A3979A619>I63 D<15074B7EA34B7EA34B7EA34B7EA34B7E15E7A2913801C7FC -15C3A291380381FEA34AC67EA3020E6D7EA34A6D7EA34A6D7EA34A6D7EA34A6D7EA34948 -6D7E91B6FCA249819138800001A249C87EA24982010E157FA2011E82011C153FA2013C82 -0138151FA2017882170F13FC00034C7ED80FFF4B7EB500F0010FB512F8A33D417DC044> -65 DIIIII -III<011FB512FCA3D9000713006E5A1401B3B3A6123F -EA7F80EAFFC0A44A5A1380D87F005B007C130700385C003C495A6C495A6C495A2603E07E -C7FC3800FFF8EB3FC026407CBD2F>IIIIIII82 DI<003FB91280A3903AF0007FE001018090393FC0003F48C7ED1FC0007E17 -07127C00781703A300701701A548EF00E0A5C81600B3B14B7E4B7E0107B612FEA33B3D7D -BC42>IIII89 -D<003FB712F8A391C7EA1FF013F801E0EC3FE00180EC7FC090C8FC003EEDFF80A2003C4A -1300007C4A5A12784B5A4B5AA200704A5AA24B5A4B5AA2C8485A4A90C7FCA24A5A4A5AA2 -4A5AA24A5A4A5AA24A5A4A5AA24990C8FCA2495A4948141CA2495A495AA2495A495A173C -495AA24890C8FC485A1778485A484815F8A24848140116034848140F4848143FED01FFB8 -FCA32E3E7BBD38>II<486C13C000 -03130101001380481303000EEB070048130E0018130C0038131C00301318007013380060 -1330A300E01370481360A400CFEB678039FFC07FE001E013F0A3007F133FA2003F131F01 -C013E0390F0007801C1C73BE2D>I -I96 D -II<49B4FC010F13E090383F00F8017C131E4848131F -4848137F0007ECFF80485A5B121FA24848EB7F00151C007F91C7FCA290C9FC5AAB6C7EA3 -003FEC01C07F001F140316806C6C13076C6C14000003140E6C6C131E6C6C137890383F01 -F090380FFFC0D901FEC7FC222A7DA828>II -II<167C903903F801 -FF903A1FFF078F8090397E0FDE1F9038F803F83803F001A23B07E000FC0600000F6EC7FC -49137E001F147FA8000F147E6D13FE00075C6C6C485AA23901F803E03903FE0FC026071F -FFC8FCEB03F80006CAFC120EA3120FA27F7F6CB512E015FE6C6E7E6C15E06C810003813A -0FC0001FFC48C7EA01FE003E140048157E825A82A46C5D007C153E007E157E6C5D6C6C49 -5A6C6C495AD803F0EB0FC0D800FE017FC7FC90383FFFFC010313C0293D7EA82D>III<1478EB01FEA2EB03FFA4EB01FEA2EB00781400AC147FEB7FFFA313 -017F147FB3B3A5123E127F38FF807E14FEA214FCEB81F8EA7F01387C03F0381E07C0380F -FF803801FC00185185BD1C>II -I<2701F801FE14FF00FF902707FFC00313E0913B1E07E00F03F0913B7803F03C01F80007 -903BE001F87000FC2603F9C06D487F000101805C01FBD900FF147F91C75B13FF4992C7FC -A2495CB3A6486C496CECFF80B5D8F87FD9FC3F13FEA347287DA74C>I<3901F801FE00FF -903807FFC091381E07E091387803F000079038E001F82603F9C07F0001138001FB6D7E91 -C7FC13FF5BA25BB3A6486C497EB5D8F87F13FCA32E287DA733>I<14FF010713E090381F -81F890387E007E01F8131F4848EB0F804848EB07C04848EB03E0000F15F04848EB01F8A2 -003F15FCA248C812FEA44815FFA96C15FEA36C6CEB01FCA3001F15F86C6CEB03F0A26C6C -EB07E06C6CEB0FC06C6CEB1F80D8007EEB7E0090383F81FC90380FFFF0010090C7FC282A -7EA82D>I<3901FC03FC00FF90381FFF8091387C0FE09039FDE003F03A07FFC001FC6C49 -6C7E6C90C7127F49EC3F805BEE1FC017E0A2EE0FF0A3EE07F8AAEE0FF0A4EE1FE0A2EE3F -C06D1580EE7F007F6E13FE9138C001F89039FDE007F09039FC780FC0DA3FFFC7FCEC07F8 -91C9FCAD487EB512F8A32D3A7EA733>I<02FF131C0107EBC03C90381F80F090397F0038 -7C01FC131CD803F8130E4848EB0FFC150748481303121F485A1501485AA448C7FCAA6C7E -A36C7EA2001F14036C7E15076C6C130F6C7E6C6C133DD8007E137990383F81F190380FFF -C1903801FE0190C7FCAD4B7E92B512F8A32D3A7DA730>I<3901F807E000FFEB1FF8EC78 -7CECE1FE3807F9C100031381EA01FB1401EC00FC01FF1330491300A35BB3A5487EB512FE -A31F287EA724>I<90383FC0603901FFF8E03807C03F381F000F003E1307003C1303127C -0078130112F81400A27E7E7E6D1300EA7FF8EBFFC06C13F86C13FE6C7F6C1480000114C0 -D8003F13E0010313F0EB001FEC0FF800E01303A214017E1400A27E15F07E14016C14E06C -EB03C0903880078039F3E01F0038E0FFFC38C01FE01D2A7DA824>I<131CA6133CA4137C -A213FCA2120112031207001FB512C0B6FCA2D801FCC7FCB3A215E0A912009038FE01C0A2 -EB7F03013F138090381F8700EB07FEEB01F81B397EB723>IIIIII<001FB61280A2EBE0000180140049485A001E495A121C4A5A003C -495A141F00385C4A5A147F5D4AC7FCC6485AA2495A495A130F5C495A90393FC00380A2EB -7F80EBFF005A5B484813071207491400485A48485BA248485B4848137F00FF495A90B6FC -A221277EA628>II E -%EndDVIPSBitmapFont -%DVIPSBitmapFont: Fm cmbx12 20.736 11 -/Fm 11 115 df<137F3801FFC0000713F0487F487F487F487FA2B61280A96C1400A26C5B -6C5B6C5B6C5B000113C06C6CC7FC1919729836>46 D48 D<93B57E031F14FC92B7 -7E020316F0020F16FC023F16FF4A8349B5D8800314E04901F8C7003F7F4901C0020F7F49 -90C800037FD91FFC6F7F49486F6C7E137F4A7013804948827313C05A4A821BE05AA28548 -7FA38080806E5E8003C017C08103F85D03FE17806F6C5C6C6F160004F05C04FC4A5A6C6F -5D706C13FFDDE0015B6CDCF8035BDDFC0F13C06DDBFF1F5B6D93B5C7FC19FC6D17F06D5F -6D17806D17E06D836D6C16FC6E16FF020F836E17E06E83020F83023F8391B97E49840107 -01F0178049D9C07F16C0013FD9801F16E049EB00074948010116F048497F4849023F15F8 -4849140F4A6E15FC48160148496E6C14FE4A151F488391C9120348050014FF193F498385 -00FF84854983A28586A3861BFEA27FA2007F1AFC7F1A7F1BF86C7FF2FFF06C7F6E4C13E0 -6C6D4C13C06C6D5E6E4C13806C6D4C13006C6D6CED7FFE6C02E04A485A013F01FC020F13 -F06D9026FFC001B55A010791B712806D95C7FC010017FC021F16F002071680DA007F02FC -C8FC030191C9FC507378F061>56 D<93B5FC031F14F092B612FE02076F7E021F16E04A16 -F891B87E49DAF00713FF0107DA0001804901FC6D6C7F49496E7F49496E7F49496E7F90B5 -486E7F484A8048854891C86C7FA2487114805C481AC0A2487213E0A2484918F0A31BF8A2 -B5FCA27313FCA51BFEA71BFF61A27EA396B6FC7EA2806C5FA27E606C7F607E6C6E5C6CEF -1FBF6D6DEC3F3F6D6D147F6D6D14FE6D6DEB01FC6D01FE130701019039FFC01FF86D91B5 -00F014FE023F15C06E15800203ECFE00DA007F13F8030713C092C9FC4F13FCA41BF8A31B -F0D91FF093B5FCEB7FFC496C18E0487F486E17C06048801B804E1400A26260624E5B4B5C -626C91C8485B4A4B5B4A92B55A6C01F04A91C7FC02804A5B6C01E0020F5B6D6C023F13F0 -02FE91B55A90273FFFE00F5C6D90B7C8FC010716FC6D16F0010016C0023F92C9FC020714 -F09126007FFECAFC507378F061>I<92383FFFF80207B612E0027F15FC49B87E010717E0 -011F83499026F0007F13FC4948C7000F7F90B502036D7E486E6D806F6D80727F486E6E7F -8486727FA28684A26C5C72806C5C6D90C8FC6D5AEB0FF8EB03E090CAFCA70507B6FC041F -B7FC0303B8FC157F0203B9FC021FECFE0391B612800103ECF800010F14C04991C7FC017F -13FC90B512F04814C0485C4891C8FC485B5A485B5C5A5CA2B5FC5CA360A36E5DA26C5F6E -5D187E6C6D846E4A48806C6D4A4814FC6C6ED90FF0ECFFFC6C02E090263FE07F14FE0001 -9139FC03FFC06C91B6487E013F4B487E010F4B1307010303F01301D9003F0280D9003F13 -FC020101F8CBFC57507ACE5E>97 D<903801FFFCB6FCA8C67E131F7FB3ADF0FFFC050FEB -FFE0057F14FE0403B77E040F16E0043F16F84CD9007F13FE9226FDFFF001077F92B500C0 -01018094C86C13E004FC6F7F4C6F7F04E06F7F4C6F7F5E747F93C915804B7014C0A27414 -E0A21DF087A21DF8A31DFC87A41DFEAF1DFCA4631DF8A31DF098B5FC1DE0A25014C0A26F -1980501400705D705F704B5B505B704B5B04FC4B5BDBE7FE92B55A9226C3FF8001035C03 -8101E0011F49C7FC9226807FFC90B55A4B6CB712F04A010F16C04A010393C8FC4A010015 -F84A023F14C090C9000301F0C9FC5F797AF76C>I<93383FFFF00307B612C0033F15F84A -B712FE0207707E021F17E0027F8391B526FC001F7F010302C001037F4991C7487F49495C -495B4901F04A7F5B90B55A485CA2485C4891C8FCA248715B5C48715B725B4A6F5B489438 -007FC0071FC7FC96C8FC5AA25CA3B5FCAF7E80A47E80A27E806CF11F80F23FC06C6E167F -A26C6EEEFF80816C606C6E17006D6D4B5A6D6D15076D6D4B5A6D6D6C4A5A6D02E0EC7FF0 -6D02F849485A01009126FF801F5B6E91B6C7FC021F5E020716F8020116E06E6C15800307 -02FCC8FCDB003F13804A507ACE56>I<97380FFFE00607B6FCA8F00003190086B3AD9338 -3FFF800307B512F8033F14FF4AB712C0020716F0021F16FC027F9039FE007FFE91B500F0 -EB0FFF01030280010190B5FC4949C87E49498149498149498149498190B548814884484A -8192CAFC5AA2485BA25A5C5AA35A5CA4B5FCAF7EA4807EA37EA2807EA26C7F616C6E5D6C -606C80616D6D5D6D6D5D6D6D92B67E6D6D4A15FC010301FF0207EDFFFE6D02C0EB3FFE6D -6C9039FC01FFF86E90B65A020F16C002031600DA007F14FC030F14E09226007FFEC749C7 -FC5F797AF76C>I<93387FFF80030FB512FC037FECFF804AB712E0020716F8021F16FE02 -7FD9F8077F49B5D8C000804991C7003F13E04901FC020F7F49496E7F49498049496E7F49 -496E7F90B55A48727E92C914804884485B1BC048841BE0485BA27313F05AA25C5AA21BF8 -85A2B5FCA391BAFCA41BF002F8CCFCA67EA3807EA47E806CF103F0F207F86C7F1A0F6C6E -17F06C191F6F17E06C6E163F6D6DEE7FC06D6D16FF6D6D4B13806D6D4B13006D6D6CEC0F -FE6D02E0EC3FFC6D02F8ECFFF86D9126FFC00F5B023F91B65A020F178002034CC7FC0200 -16F8031F15E0030392C8FCDB000F13E04D507BCE58>I<93381FFFE00303B6FC031F15E0 -92B712FC020316FF020F17C0023FD9FC0014F091B500C0010F13FC4991C700037F4901FC -02007F010F496F13C049496F7F49496F7F4B8149496F7F90B5C96C7F4886A24849707F48 -1B80A248497014C0A2481BE0A348497113F0A3481BF8A5B51AFCAE6C1BF8A46C1BF06E94 -B5FCA36C1BE0A26C6D4C14C0A26C1B806E5E6C1B006C6E4B5BA26C6E4B5B6D6D4B5B6D6D -4B5B6D6D4B5B6D6D92B55A6D01FF02035C6D02C0010F91C7FC010002FC90B512FC6E90B7 -5A021F17E00207178002014CC8FCDA003F15F0030392C9FCDB001F13E056507BCE61> -111 D<902601FFF8EB07FEB691383FFFC094B512F00403804C14FE4C8093261FFC3F1380 -93263FE07F13C0DC7F80B5FCC66C5D011FDAFE0114E06DEBF9FC16F815FB16F016E015FF -16C07114C05E72138095381FFE0093C76C5AF001E095C8FCA25DA65DB3B3A2B812F8A843 -4E7ACD4F>114 D E -%EndDVIPSBitmapFont -end -%%EndProlog -%%BeginSetup -%%Feature: *Resolution 600dpi -TeXDict begin -%%PaperSize: A4 - -%%EndSetup -%%Page: 1 1 -1 0 bop 94 1385 a Fm(barco)5 b(de)65 b(0.98)p 94 1451 -3780 34 v 2617 1548 a Fl(A)31 b(library)d(for)i(dra)m(wing)f(bar)h(co)s -(des)3409 1656 y(Marc)m(h)h(2002)94 5367 y Fk(b)l(y)45 -b(Alessandro)h(Rubini)f(\()p Fj(rubini@gnu.org)p Fk(\))p -94 5446 3780 17 v eop -%%Page: 1 2 -1 1 bop 94 -116 a Fl(Chapter)30 b(2:)41 b(The)30 b(Underlying)e(Data)k -(Structure)2012 b(1)94 365 y Fi(Barco)t(de)54 b(to)t(ols)219 -549 y Fl(This)29 b(\014le)g(do)s(cumen)m(ts)h(v)m(ersion)g(0.98)i(of)e -(the)h(barco)s(de)f(library)e(and)i(sample)f(programs)h(\(Marc)m(h)i -(2002\).)94 815 y Fi(1)81 b(Ov)l(erview)219 999 y Fl(The)26 -b Fh(barco)s(de)32 b Fl(pac)m(k)-5 b(age)29 b(is)d(mainly)f(a)i(C)f -(library)f(for)h(creating)i(bar-co)s(de)f(output)f(\014les.)39 -b(It)27 b(also)f(includes)94 1099 y(a)31 b(command)f(line)f(fron)m -(t-end)h(and)g(\(in)f(a)i(foreseeable)g(future\))f(a)h(graphic)e(fron)m -(tend.)219 1215 y(The)k(pac)m(k)-5 b(age)35 b(is)d(designed)g(as)i(a)f -(library)e(b)s(ecause)i(w)m(e)h(think)e(the)h(main)g(use)f(for)h(barco) -s(de-generation)94 1315 y(to)s(ols)23 b(is)f(inside)f(more)i(featured)g -(applications.)37 b(The)22 b(library)f(addresses)h(bar)h(co)s(de)g -(prin)m(ting)e(as)i(t)m(w)m(o)i(distinct)94 1415 y(problems:)43 -b(creation)33 b(of)f(bar)g(information)e(and)i(actual)h(con)m(v)m -(ersion)f(to)h(an)f(output)g(format.)47 b(T)-8 b(o)32 -b(this)g(aim)94 1514 y(w)m(e)25 b(use)f(an)g(in)m(termediate)g -(represen)m(tation)g(for)g(bar)f(co)s(des,)j(whic)m(h)d(is)g(curren)m -(tly)g(do)s(cumen)m(ted)h(in)e(the)j(`)p Fj(ps.c)p Fl(')94 -1614 y(source)31 b(\014le)e(\(not)i(in)f(this)f(do)s(cumen)m(t\).)219 -1730 y(Note)24 b(that)e(the)h(library)d(and)h(the)i(accompan)m(ying)g -(material)e(is)h(released)g(according)g(to)h(the)f(GPL)h(license,)94 -1830 y(not)31 b(the)g(LGPL)f(one.)41 b(A)30 b(cop)m(y)h(of)g(the)g(GPL) -f(is)f(included)f(in)h(the)i(distribution)26 b(tarball.)94 -2096 y Fi(2)81 b(The)53 b(Underlying)h(Data)g(Structure)219 -2280 y Fl(Ev)m(ery)33 b(barco)s(de-related)g(function)f(acts)i(on)f(a)h -(data)f(structure)g(de\014ned)f(in)g(the)h(`)p Fj(barcode.h)p -Fl(')e(header,)94 2380 y(whic)m(h)j(m)m(ust)h(b)s(e)f(included)e(b)m(y) -j(an)m(y)g(C)g(source)g(\014le)f(that)h(uses)g(the)g(library)-8 -b(.)52 b(The)35 b(header)f(is)g(installed)f(b)m(y)94 -2480 y Fj(make)47 b(install)p Fl(.)219 2596 y(The)30 -b(de\014nition)e(of)i(the)h(data)g(structure)f(is)f(included)f(here)i -(for)g(reference:)334 2717 y Fj(struct)47 b(Barcode_Item)d({)525 -2820 y(int)j(flags;)428 b(/*)47 b(type)g(of)g(encoding)f(and)h(other)f -(flags)g(*/)525 2924 y(char)h(*ascii;)332 b(/*)47 b(malloced)f(*/)525 -3028 y(char)h(*partial;)236 b(/*)47 b(malloced)f(too)h(*/)525 -3132 y(char)g(*textinfo;)188 b(/*)47 b(information)e(about)h(text)h -(placement)e(*/)525 3236 y(char)i(*encoding;)188 b(/*)47 -b(code)g(name,)f(filled)g(by)i(encoding)d(engine)h(*/)525 -3339 y(int)h(width,)f(height;)g(/*)h(output)f(units)h(*/)525 -3443 y(int)g(xoff,)g(yoff;)189 b(/*)47 b(output)f(units)h(*/)525 -3547 y(int)g(margin;)380 b(/*)47 b(output)f(units)h(*/)525 -3651 y(double)f(scalef;)237 b(/*)47 b(requested)f(scaling)f(for)i -(barcode)f(*/)525 3754 y(int)h(error;)428 b(/*)47 b(an)h(errno-like)d -(value,)h(in)h(case)f(of)i(failure)d(*/)334 3858 y(};)219 -3975 y Fl(The)e(exact)i(meaning)e(of)g(eac)m(h)i(\014eld)d(and)h(the)g -(v)-5 b(arious)43 b(\015ags)g(implemen)m(ted)f(are)i(describ)s(ed)e(in) -g(the)94 4074 y(follo)m(wing)29 b(sections.)219 4191 -y(Ev)m(en)38 b(though)f(y)m(ou)h(w)m(on't)g(usually)d(need)i(to)h(act)h -(on)e(the)h(con)m(ten)m(ts)h(of)f(this)e(structure,)j(some)f(of)g(the) -94 4290 y(functions)25 b(in)f(the)i(library)d(receiv)m(e)k(argumen)m -(ts)e(that)i(are)f(directly)e(related)i(to)g(one)g(or)g(more)f(of)h -(these)g(\014elds.)94 4524 y Fk(2.1)69 b(The)44 b(Fields)94 -4715 y Fj(int)30 b(flags;)574 4815 y Fl(The)42 b(\015ags)g(are,)j(as)d -(y)m(ou)g(ma)m(y)g(susp)s(ect,)j(mean)m(t)d(to)h(sp)s(ecify)d(the)i -(exact)h(b)s(eha)m(viour)e(of)h(the)574 4914 y(library)-8 -b(.)37 b(They)22 b(are)h(often)h(passed)e(as)h(an)g(argumen)m(t)g(to)h -Fg(b)-5 b(ar)g(c)g(o)g(de)32 b Fl(functions)21 b(and)i(are)g(discussed) -574 5014 y(in)30 b(the)g(next)h(section.)94 5147 y Fj(char)f(*ascii;)94 -5247 y(char)g(*partial;)94 5347 y(char)g(*textinfo;)94 -5446 y(char)g(*encoding;)574 5546 y Fl(These)41 b(\014elds)f(are)h(in)m -(ternally)e(managed)i(b)m(y)g(the)h(library)-8 b(,)41 -b(and)g(y)m(ou)g(are)h(not)f(exp)s(ected)g(to)574 5645 -y(touc)m(h)31 b(them)g(if)e(y)m(ou)i(use)f(the)h(pro)m(vided)d(API.)j -(All)e(of)h(them)h(are)g(allo)s(cated)f(with)f Fg(mal)5 -b(lo)-5 b(c)p Fl(.)p eop -%%Page: 2 3 -2 2 bop 94 -116 a Fl(Chapter)30 b(2:)41 b(The)30 b(Underlying)e(Data)k -(Structure)2012 b(2)94 365 y Fj(int)30 b(width;)94 465 -y(int)g(height;)574 565 y Fl(They)i(sp)s(ecify)e(the)i(width)d(and)i -(heigh)m(t)h(of)g(the)f Fg(active)39 b Fl(barco)s(de)31 -b(region)g(\(i.e.,)i(excluding)d(the)574 664 y(white)21 -b(margin\),)i(in)d(the)i(units)e(used)h(to)h(create)i(output)d(data)h -(\(for)g(p)s(ostscript)e(they)i(are)g(p)s(oin)m(ts,)574 -764 y(1/72th)33 b(of)d(an)g(inc)m(h,)g(0.352)j(mm\).)40 -b(The)30 b(\014elds)f(can)i(b)s(e)f(either)g(assigned)f(to)j(in)d(the)h -(structure)574 863 y(or)37 b(via)e Fg(Bar)-5 b(c)g(o)g(de)p -1161 863 28 4 v 36 w(Position\(\))p Fl(,)39 b(at)e(y)m(our)f(c)m -(hoice.)59 b(If)35 b(either)h(v)-5 b(alue)35 b(or)h(b)s(oth)g(are)g -(left)g(to)h(their)574 963 y(default)c(v)-5 b(alue)33 -b(of)g(zero,)i(the)e(output)g(engine)g(will)d(assign)j(default)f(v)-5 -b(alues)33 b(according)g(to)h(the)574 1063 y(sp)s(eci\014ed)g(scaling)f -(factor.)55 b(If)35 b(the)g(sp)s(eci\014ed)e(width)g(is)h(bigger)g -(than)h(needed)f(\(according)h(to)574 1162 y(the)g(scaling)f(factor\),) -j(the)d(output)g(barco)s(de)h(will)c(b)s(e)j(cen)m(tered)i(in)d(its)h -(requested)g(region.)52 b(If)574 1262 y(either)27 b(the)h(width)d(of)i -(the)h(heigh)m(t)f(are)h(to)s(o)g(small)d(for)i(the)h(sp)s(eci\014ed)d -(scale)j(factor,)h(the)e(output)574 1362 y(bar)j(co)s(de)h(will)d -(expand)h(symmetrically)g(around)g(the)i(requested)f(region.)94 -1513 y Fj(int)g(xoff;)94 1612 y(int)g(yoff;)574 1738 -y Fl(The)53 b(\014elds)f(sp)s(ecify)g(o\013set)j(from)e(the)g(co)s -(ordinate)h(origin)e(of)h(the)h(output)f(engine)g(\(for)574 -1838 y(p)s(ostscript,)46 b(p)s(osition)c(0,0)i(is)f(the)g(lo)m(w)m(er)h -(left)f(corner)h(of)f(the)h(page\).)81 b(The)43 b(\014elds)f(can)i(b)s -(e)574 1937 y(either)36 b(assigned)e(to)j(in)d(the)i(structure)f(or)g -(via)g Fg(Bar)-5 b(c)g(o)g(de)p 2572 1937 V 36 w(Position\(\))p -Fl(,)39 b(at)d(y)m(our)f(c)m(hoice.)57 b(The)574 2037 -y(o\013set)24 b(sp)s(eci\014es)d(where)h(the)g(white)g(margin)f(b)s -(egins,)h(not)h(where)f(the)g(\014rst)g(bar)g(will)d(b)s(e)j(prin)m -(ted.)574 2136 y(T)-8 b(o)31 b(prin)m(t)e(real)h(ink)f(to)j(the)e(sp)s -(eci\014ed)f(p)s(osition)f(y)m(ou)j(should)d(set)j Fg(mar)-5 -b(gin)39 b Fl(to)31 b(0.)94 2288 y Fj(int)f(margin;)574 -2387 y Fl(The)36 b(white)g(margin)f(that)j(will)33 b(b)s(e)j(left)g -(around)g(the)h(prin)m(ted)e(area)i(of)g(the)f(bar)g(co)s(de.)59 -b(The)574 2487 y(same)37 b(margin)e(is)g(applied)f(to)j(all)e(sides)g -(of)h(the)g(prin)m(ted)f(area.)59 b(The)35 b(default)g(v)-5 -b(alue)36 b(for)g(the)574 2587 y(margin)30 b(is)f(de\014ned)g(in)g(`)p -Fj(barcode.h)p Fl(')g(as)h Fj(BARCODE_DEFAULT_MARGIN)25 -b Fl(\(10\).)94 2738 y Fj(double)k(scalef;)574 2837 y -Fl(The)j(enlarge)f(or)h(shrink)d(v)-5 b(alue)31 b(for)g(the)h(bar)f(co) -s(de)h(o)m(v)m(er)h(its)e(default)g(dimension.)42 b(The)31 -b Fg(width)574 2937 y Fl(and)j Fg(sc)-5 b(alef)54 b Fl(\014elds)33 -b(in)m(teract)h(deeply)f(in)g(the)h(creation)h(of)f(the)g(output,)h -(and)f(a)g(complete)h(de-)574 3037 y(scription)29 b(of)i(the)f(issues)f -(app)s(ears)h(later)g(in)f(this)g(section.)94 3188 y -Fj(int)h(error;)574 3288 y Fl(The)g(\014eld)f(is)h(used)f(when)h(a)g -Fg(b)-5 b(ar)g(c)g(o)g(de)40 b Fl(function)29 b(fails)g(to)i(host)g(an) -f Fj(errno)p Fl(-lik)m(e)f(in)m(teger)h(v)-5 b(alue.)94 -3515 y Ff(Use)42 b(of)f(the)g Fe(width)50 b Ff(and)41 -b Fe(sc)-6 b(alef)64 b Ff(\014elds.)219 3700 y Fl(A)29 -b(width)f(unit)f(is)h(the)i(width)d(of)i(the)h(thinnest)d(bar)i(and/or) -g(space)h(in)d(the)j(c)m(hosen)f(co)s(de;)h(it)f(defaults)f(to)94 -3800 y(1)j(p)s(oin)m(t)f(if)f(the)i(output)e(is)h(p)s(ostscript)f(or)h -(encapsulated)g(p)s(ostscript.)219 3926 y(Either)j(or)h(b)s(oth)g(the)g -(co)s(de)h(width)d(and)i(the)g(scale)h(factor)g(can)g(b)s(e)e(left)h -(unsp)s(eci\014ed)e(\(i.e.,)k(zero\).)53 b(The)94 4026 -y(library)28 b(deals)i(with)f(defaults)h(in)f(the)h(follo)m(wing)f(w)m -(a)m(y:)94 4178 y Fg(Both)34 b(unsp)-5 b(e)g(ci\014e)g(d)574 -4277 y Fl(If)26 b(b)s(oth)f(the)h(width)e(and)h(the)h(scale)g(factor)g -(are)g(unsp)s(eci\014ed,)f(the)h(scale)g(factor)g(will)d(default)i(to) -574 4377 y(1.0)31 b(and)e(the)h(width)e(is)g(calculated)i(according)f -(to)i(the)e(actual)h(width)e(of)i(the)g(bar)f(co)s(de)g(b)s(eing)574 -4477 y(prin)m(ted.)94 4628 y Fg(Width)34 b(unsp)-5 b(e)g(ci\014e)g(d) -574 4728 y Fl(If)30 b(the)h(width)e(is)g(not)i(sp)s(eci\014ed,)d(it)i -(is)g(calculated)g(according)g(to)i(the)e(v)-5 b(alues)30 -b(of)g Fg(sc)-5 b(alef)p Fl(.)94 4879 y Fg(Sc)g(ale)34 -b(factor)f(unsp)-5 b(e)g(ci\014e)g(d)574 4978 y Fl(If)32 -b(the)h(scale)f(factor)i(is)d(not)i(sp)s(eci\014ed,)e(it)h(will)d(b)s -(e)j(c)m(hosen)h(so)f(that)h(the)g(generated)g(bar)f(co)s(de)574 -5078 y(exactly)g(\014ts)e(the)g(sp)s(eci\014ed)f(width.)94 -5229 y Fg(Both)34 b(sp)-5 b(e)g(ci\014e)g(d)574 5329 -y Fl(The)31 b(co)s(de)g(will)d(b)s(e)i(prin)m(ted)g(inside)e(the)j(sp)s -(eci\014ed)f(region)g(according)h(to)g(the)g(sp)s(eci\014ed)f(scale)574 -5429 y(factor.)48 b(It)33 b(will)d(b)s(e)h(aligned)h(to)h(the)f(left.) -47 b(If,)33 b(ho)m(w)m(ev)m(er,)h(the)f(c)m(hosen)g(width)e(is)g(to)s -(o)i(small)e(for)574 5528 y(the)f(sp)s(eci\014c)e(bar)h(co)s(de)h(and)e -(scaling)h(factor,)h(then)f(the)h(co)s(de)g(will)c(extend)k -(symmetrically)d(to)574 5628 y(the)k(left)f(and)g(to)h(the)g(righ)m(t)f -(of)g(the)h(c)m(hosen)g(region.)p eop -%%Page: 3 4 -3 3 bop 94 -116 a Fl(Chapter)30 b(3:)41 b(The)30 b(Flags)2872 -b(3)94 365 y Fk(2.2)69 b(The)44 b(In)l(termediate)j(Represen)l(tation) -219 565 y Fl(The)23 b(enco)s(ding)g(functions)f(prin)m(t)g(their)g -(output)h(in)m(to)h(the)g Fj(partial)d Fl(and)i Fj(texinfo)f -Fl(\014elds)g(of)h(the)h(barco)s(de)94 664 y(data)g(structure.)37 -b(Those)23 b(\014elds,)g(together)h(with)d(p)s(osition)g(information,)h -(are)h(then)f(used)g(to)i(generate)g(actual)94 764 y(output.)41 -b(This)28 b(is)i(an)g(informal)e(description)h(of)h(the)h(in)m -(termediate)f(format.)219 905 y(The)38 b(\014rst)g(c)m(har)h(in)f -Fj(partial)f Fl(tells)g(ho)m(w)i(m)m(uc)m(h)g(extra)g(space)h(to)f(add) -f(to)i(the)f(left)f(of)h(the)g(bars.)65 b(F)-8 b(or)94 -1005 y(EAN-13,)33 b(it)d(is)f(used)h(to)h(lea)m(v)m(e)h(space)f(to)g -(prin)m(t)e(the)i(\014rst)f(digit,)f(other)i(co)s(des)f(ma)m(y)h(ha)m -(v)m(e)h('0')f(for)g(no-extra-)94 1104 y(space-needed.)219 -1245 y(The)23 b(next)h(c)m(haracters)i(are)e(alternating)f(bars)g(and)h -(spaces,)h(as)g(m)m(ultiples)c(of)j(the)g(base)g(dimension)d(whic)m(h) -94 1345 y(is)35 b(1)g(unless)f(the)i(co)s(de)f(is)f(rescaled.)56 -b(Rescaling)34 b(is)h(calculated)g(as)g(the)h(ratio)f(from)g(the)h -(requested)f(width)94 1445 y(and)e(the)h(calculated)f(width.)48 -b(Digits)33 b(represen)m(t)g(bar/space)h(dimensions.)47 -b(Lo)m(w)m(er-case)35 b(letters)f(represen)m(t)94 1544 -y(those)d(bars)f(that)h(should)e(extend)i(lo)m(w)m(er)f(than)h(the)f -(others:)41 b('a')32 b(is)d(equiv)-5 b(alen)m(t)30 b(to)h('1',)h('b')f -(is)e('2')i(and)f(so)h(on)94 1644 y(up)e(to)h('i')g(whic)m(h)e(is)g -(equiv)-5 b(alen)m(t)29 b(to)i('9'.)41 b(Other)29 b(letters)h(will)d(b) -s(e)i(used)g(for)g(enco)s(ding-sp)s(eci\014c)f(meanings,)h(as)94 -1743 y(so)s(on)i(as)f(I)g(implemen)m(t)f(them.)219 1885 -y(The)35 b Fj(textinfo)e Fl(string)h(is)h(made)g(up)f(of)i(\014elds)e -Fj(\045lf:\045lf:\045c)e Fl(separated)k(b)m(y)g(blank)e(space.)56 -b(The)35 b(\014rst)94 1984 y(in)m(teger)f(is)e(the)h(x)g(p)s(osition)e -(of)i(the)h(c)m(haracter,)h(the)e(second)g(is)f(the)i(fon)m(t)f(size)g -(\(b)s(efore)g(rescaling\))f(and)h(the)94 2084 y(c)m(har)e(item)f(is)g -(the)g(c)m(haracter)i(to)f(b)s(e)f(prin)m(ted.)219 2225 -y(Both)39 b(the)g Fj(partial)d Fl(and)i Fj(textinfo)f -Fl(strings)g(ma)m(y)i(include)d(\\)p Fj(-)p Fl(")j(or)g(\\)p -Fj(+)p Fl(")g(as)g(sp)s(ecial)e(c)m(haracters)j(\(in)94 -2325 y Fj(textinfo)25 b Fl(the)j(c)m(har)f(should)e(b)s(e)i(a)g -(stand-alone)g(w)m(ord\).)40 b(They)26 b(state)j(where)d(the)i(text)g -(should)d(b)s(e)h(prin)m(ted:)94 2424 y(b)s(elo)m(w)34 -b(the)g(bars)f(\(\\)p Fj(-)p Fl(",)j(default\))e(or)g(ab)s(o)m(v)m(e)h -(the)f(bars.)51 b(This)32 b(is)h(used,)i(for)e(example,)i(to)g(prin)m -(t)e(the)h(add-5)94 2524 y(and)27 b(add-2)g(co)s(des)g(to)h(the)f(righ) -m(t)f(of)i(UPC)e(or)h(EAN)g(co)s(des)g(\(the)h(add-5)f(extension)g(is)f -(mostly)g(used)g(in)g(ISBN)94 2623 y(co)s(des\).)94 2939 -y Fi(3)81 b(The)53 b(Flags)219 3213 y Fl(The)30 b(follo)m(wing)f -(\015ags)h(are)h(supp)s(orted)e(b)m(y)h(v)m(ersion)g(0.98)i(of)e(the)h -(library:)94 3387 y Fj(BARCODE_ENCODING_MASK)574 3487 -y Fl(The)f(mask)h(is)e(used)h(to)h(extract)h(the)e(enco)s(ding-t)m(yp)s -(e)g(iden)m(ti\014er)f(from)h(the)g Fg(\015ags)39 b Fl(\014eld.)94 -3653 y Fj(BARCODE_EAN)94 3753 y(BARCODE_UPC)94 3852 y(BARCODE_ISBN)94 -3952 y(BARCODE_128B)94 4051 y(BARCODE_128C)94 4151 y(BARCODE_128)94 -4251 y(BARCODE_128RAW)94 4350 y(BARCODE_39)94 4450 y(BARCODE_I25)94 -4550 y(BARCODE_CBR)94 4649 y(BARCODE_MSI)94 4749 y(BARCODE_PLS)94 -4848 y(BARCODE_93)574 4948 y Fl(The)d(curren)m(tly)f(supp)s(orted)g -(enco)s(ding)g(t)m(yp)s(es:)52 b(EAN)36 b(\(13)i(digits,)e(8)h(digits,) -f(13)h Fj(+)f Fl(2)g(add-on)574 5048 y(and)26 b(13)i -Fj(+)e Fl(5)h(add-on\),)g(UPC)f(\(UPC-A,)i(UPC-E,)e(UPC-A)h(with)e(2)i -(or)f(5)h(digit)f(add-on\),)h(ISBN)574 5147 y(\(with)e(or)f(without)g -(the)i(5-digit)e(add-on\),)i(CODE128-B)h(\(the)e(whole)g(set)g(of)g -(prin)m(table)e(ASCI)s(I)574 5247 y(c)m(haracters\),)36 -b(CODE128-C)d(\(t)m(w)m(o)i(digits)c(enco)s(ded)h(b)m(y)h(eac)m(h)h -(barco)s(de)e(sym)m(b)s(ol\),)h(CODE128)574 5347 y(\(all)41 -b(ASCI)s(I)f(v)-5 b(alues\),)44 b(a)e(\\ra)m(w-input")f(pseudo-co)s(de) -h(that)g(generates)h(CODE128)f(output,)574 5446 y(CODE39)32 -b(\(alphan)m(umeric\),)e Fj(")p Fl(in)m(terlea)m(v)m(ed)i(2)f(of)h(5)p -Fj(")f Fl(\(n)m(umeric\),)g(Co)s(dabar)f(\(n)m(umeric)g(plus)g(a)574 -5546 y(few)36 b(sym)m(b)s(ols\),)g(MSI)f(\(n)m(umeric\))g(and)g -(Plessey)g(\(hex)g(digits\).)55 b(See)36 b(Chapter)f(6)h([Supp)s(orted) -574 5645 y(Enco)s(dings],)30 b(page)h(7.)p eop -%%Page: 4 5 -4 4 bop 94 -116 a Fl(Chapter)30 b(4:)41 b(F)-8 b(unctions)30 -b(Exp)s(orted)g(b)m(y)g(the)h(Library)1871 b(4)94 365 -y Fj(BARCODE_ANY)574 465 y Fl(This)27 b(sp)s(ecial)g(enco)s(ding)g(t)m -(yp)s(e)h(\(represen)m(ted)h(b)m(y)f(a)h(v)-5 b(alue)27 -b(of)i(zero,)h(so)e(it)g(will)d(b)s(e)j(the)g(default\))574 -565 y(tells)33 b(the)g(enco)s(ding)f(pro)s(cedure)g(to)h(lo)s(ok)g(for) -g(the)g(\014rst)f(enco)s(ding)g(t)m(yp)s(e)i(that)f(can)h(deal)e(with) -574 664 y(a)44 b(textual)f(string.)77 b(Therefore,)46 -b(a)d(11-digit)f(co)s(de)h(will)e(b)s(e)h(prin)m(ted)f(as)i(UPC)g(\(as) -g(w)m(ell)f(as)574 764 y(6-digit,)48 b(11)p Fj(+)p Fl(2)e(and)e(11)p -Fj(+)p Fl(5\),)49 b(a)c(12-digit)g(\(or)g(7-digit,)i(or)e(12)p -Fj(+)p Fl(2)h(or)e(12)p Fj(+)p Fl(5\))i(as)f(EAN13,)k(an)574 -863 y(ISBN)39 b(co)s(de)f(\(with)g(or)g(without)f(h)m(yphens,)i(with)e -(or)i(without)e(add-5\))i(will)d(b)s(e)h(enco)s(ded)h(in)574 -963 y(its)e(EAN13)i(represen)m(tation,)g(an)e(ev)m(en)h(n)m(um)m(b)s -(er)e(of)i(digits)e(is)g(enco)s(ded)h(using)f(CODE128C)574 -1063 y(and)45 b(a)h(generic)f(string)f(is)h(enco)s(ded)g(using)f -(CODE128B.)j(Since)d(co)s(de-39)j(o\013ers)e(a)h(m)m(uc)m(h)574 -1162 y(larger)38 b(represen)m(tation)f(for)h(the)f(same)h(text)h -(string,)f(co)s(de128-b)h(is)e(preferred)f(o)m(v)m(er)j(co)s(de39)574 -1262 y(for)31 b(alphan)m(umeric)d(strings.)94 1411 y -Fj(BARCODE_NO_ASCII)574 1510 y Fl(Instructs)f(the)h(engine)e(not)i(to)g -(prin)m(t)e(the)i(ascii)e(string)h(on)g(output.)39 b(By)28 -b(default)e(the)i(bar)f(co)s(de)574 1610 y(is)j(accompanied)g(with)f -(an)i(ascii)e(v)m(ersion)h(of)h(the)f(text)i(it)d(enco)s(des.)94 -1759 y Fj(BARCODE_NO_CHECKSUM)574 1858 y Fl(Instructs)j(the)h(engine)f -(not)h(to)g(add)f(the)h(c)m(hec)m(ksum)g(c)m(haracter)h(to)f(the)g -(output.)47 b(Not)33 b(all)f(the)574 1958 y(enco)s(ding)23 -b(t)m(yp)s(es)g(can)h(drop)f(the)h(c)m(hec)m(ksum;)i(those)e(where)f -(the)h(c)m(hec)m(ksum)g(is)f(mandatory)g(\(lik)m(e)574 -2058 y(EAN)31 b(and)f(UPC\))g(just)g(ignore)g(the)h(\015ag.)94 -2206 y Fj(BARCODE_OUTPUT_MASK)574 2306 y Fl(The)f(mask)h(is)e(used)h -(to)h(extract)h(the)e(output-t)m(yp)s(e)h(iden)m(ti\014er)d(from)i(the) -h Fg(\015ags)38 b Fl(\014eld.)94 2455 y Fj(BARCODE_OUT_PS)94 -2554 y(BARCODE_OUT_EPS)94 2654 y(BARCODE_OUT_PCL)94 2753 -y(BARCODE_OUT_PCL_III)574 2853 y Fl(The)48 b(curren)m(tly)f(supp)s -(orted)f(enco)s(ding)g(t)m(yp)s(es:)76 b(full-page)47 -b(p)s(ostscript)f(and)h(encapsulated)574 2953 y(p)s(ostscript;)h(PCL)41 -b(\(prin)m(t)g(command)i(language,)j(for)c(HP)g(prin)m(ters\))f(and)h -(PCL-I)s(I)s(I)e(\(same)574 3052 y(as)31 b(PCL,)f(but)g(uses)g(a)g(fon) -m(t)h(not)g(a)m(v)-5 b(ailable)30 b(on)g(older)f(prin)m(ters\).)94 -3201 y Fj(BARCODE_OUT_NOHEADERS)574 3301 y Fl(The)f(\015ag)h(instructs) -d(the)j(prin)m(ting)d(engine)h(not)i(to)f(prin)m(t)f(the)h(header)g -(and)g(fo)s(oter)h(part)e(of)i(the)574 3400 y(\014le.)40 -b(This)29 b(mak)m(es)i(sense)f(for)f(the)i(p)s(ostscript)d(engine)i -(but)f(migh)m(t)h(not)h(mak)m(e)g(sense)f(for)g(other)574 -3500 y(engines;)k(suc)m(h)f(other)h(engines)e(will)e(silen)m(tly)i -(ignore)g(the)i(\015ag)f(just)g(lik)m(e)f(the)h(PCL)f(bac)m(k-end)574 -3600 y(do)s(es.)94 3881 y Fi(4)81 b(F)-13 b(unctions)52 -b(Exp)t(orted)h(b)l(y)g(the)g(Library)219 4103 y Fl(The)41 -b(functions)f(included)f(in)h(the)i(barco)s(de)f(library)e(are)j -(declared)f(in)g(the)g(header)h(\014le)e Fj(barcode.h)p -Fl(.)94 4203 y(They)30 b(p)s(erform)f(the)i(follo)m(wing)e(tasks:)94 -4352 y Fj(struct)g(Barcode_Item)e(*Barcode_Create\(char)e(*text\);)574 -4451 y Fl(The)35 b(function)e(creates)j(a)f(new)g(barco)s(de)f(ob)5 -b(ject)36 b(to)f(deal)g(with)e(a)i(sp)s(eci\014ed)e(text)j(string.)53 -b(It)574 4551 y(returns)27 b(NULL)h(in)e(case)j(of)f(failure)e(and)i(a) -g(p)s(oin)m(ter)f(to)h(a)h(barco)s(de)e(data)i(structure)e(in)g(case)i -(of)574 4651 y(success.)94 4799 y Fj(int)h(Barcode_Delete\(struct)25 -b(Barcode_Item)i(*bc\);)574 4899 y Fl(Destro)m(y)32 b(a)f(barco)s(de)f -(ob)5 b(ject.)42 b(Alw)m(a)m(ys)31 b(returns)e(0)h(\(success\))94 -5048 y Fj(int)g(Barcode_Encode\(struct)25 b(Barcode_Item)i(*bc,)i(int)g -(flags\);)574 5147 y Fl(Enco)s(de)h(the)h(text)g(included)d(in)h(the)h -Fg(b)-5 b(c)35 b Fl(ob)5 b(ject.)42 b(V)-8 b(alid)29 -b(\015ags)i(are)f(the)h(enco)s(ding)e(t)m(yp)s(e)h(\(other)574 -5247 y(\015ags)45 b(are)f(ignored\))g(and)g(BAR)m(CODE)p -1994 5247 28 4 v 33 w(NO)p 2166 5247 V 33 w(CHECKSUM)f(\(other)i -(\015ags)f(are)h(silen)m(tly)d(ig-)574 5347 y(nored\);)35 -b(if)e(the)g(\015ag)h(argumen)m(t)g(is)e(zero,)j Fj(bc->flags)c -Fl(will)g(apply)-8 b(.)49 b(The)32 b(function)g(returns)h(0)574 -5446 y(on)h(success)g(and)f(-1)i(in)d(case)j(of)f(error.)51 -b(After)34 b(successful)e(termination)h(the)h(data)g(structure)574 -5546 y(will)21 b(host)i(the)h(description)d(of)j(the)f(bar)g(co)s(de)g -(and)g(its)g(textual)g(represen)m(tation,)i(after)f(a)g(failure)574 -5645 y(the)31 b Fj(error)e Fl(\014eld)g(will)f(include)g(the)i(reason)h -(of)f(the)h(failure.)p eop -%%Page: 5 6 -5 5 bop 94 -116 a Fl(Chapter)30 b(5:)41 b(The)30 b Fg(b)-5 -b(ar)g(c)g(o)g(de)40 b Fl(fron)m(tend)30 b(program)2063 -b(5)94 365 y Fj(int)30 b(Barcode_Print\(struct)25 b(Barcode_Item)i -(*bc,)i(FILE)g(*f,)h(int)f(flags\);)574 465 y Fl(Prin)m(t)39 -b(the)g(bar)g(co)s(de)g(describ)s(ed)e(b)m(y)i Fj(bc)g -Fl(to)h(the)f(sp)s(eci\014ed)f(\014le.)66 b(V)-8 b(alid)38 -b(\015ags)h(are)h(the)f(out-)574 565 y(put)25 b(t)m(yp)s(e,)h -Fj(BARCODE_NO_ASCII)21 b Fl(and)j Fj(BARCODE_OUT_NOHEADERS)p -Fl(,)d(other)k(\015ags)g(are)h(ignored.)574 664 y(If)39 -b(an)m(y)h(of)f(these)h(\015ags)g(is)e(zero,)43 b(it)c(will)d(b)s(e)j -(inherited)e(from)i Fj(bc->flags)d Fl(whic)m(h)i(therefore)574 -764 y(tak)m(es)f(precedence.)57 b(The)35 b(function)g(returns)f(0)i(on) -f(success)h(and)f(-1)h(in)e(case)j(of)f(error)f(\(with)574 -863 y Fj(bc->error)28 b Fl(set)j(accordingly\).)40 b(In)29 -b(case)j(of)e(success,)h(the)f(bar)g(co)s(de)g(is)f(prin)m(ted)g(to)i -(the)f(sp)s(ec-)574 963 y(i\014ed)f(\014le,)h(whic)m(h)f(w)m(on't)i(b)s -(e)f(closed)g(after)h(use.)94 1115 y Fj(int)f(Barcode_Position\(struct) -24 b(Barcode_Item)j(*bc,)i(int)h(wid,)f(int)g(hei,)h(int)f(xoff,)g(int) -h(yoff,)94 1215 y(double)f(scalef\);)574 1315 y Fl(The)h(function)f(is) -h(a)h(shortcut)f(to)h(assign)f(v)-5 b(alues)29 b(to)j(the)e(data)h -(structure.)94 1467 y Fj(int)f(Barcode_Encode_and_Print)o(\(cha)o(r)24 -b(*text,)29 b(FILE)g(*f,)h(int)f(wid,)g(int)h(hei,)f(int)h(xoff,)f(int) -94 1567 y(yoff,)g(int)h(flags\);)574 1666 y Fl(The)38 -b(function)e(deals)h(with)g(the)h(whole)f(life)f(of)i(the)g(barco)s(de) -g(ob)5 b(ject)39 b(b)m(y)e(calling)g(the)h(other)574 -1766 y(functions;)30 b(it)g(uses)g(all)f(the)h(sp)s(eci\014ed)f -(\015ags.)94 1918 y Fj(int)h(Barcode_Version\(char)25 -b(*versionname\);)574 2018 y Fl(Returns)g(the)g(curren)m(t)f(v)m -(ersion)h(as)g(an)g(in)m(teger)g(n)m(um)m(b)s(er)f(of)h(the)g(form)f -(ma)5 b(jor)25 b(*)h(10000)h Fj(+)d Fl(minor)574 2118 -y(*)k(100)h Fj(+)e Fl(release.)40 b(Therefore,)28 b(v)m(ersion)f -(1.03.5)i(will)c(b)s(e)i(returned)f(as)h(10305)j(and)d(v)m(ersion)f -(0.53)574 2217 y(as)i(5300.)41 b(If)27 b(the)h(argumen)m(t)f(is)f -(non-n)m(ull,)g(it)h(will)e(b)s(e)h(used)h(to)h(return)e(the)h(v)m -(ersion)g(n)m(um)m(b)s(er)f(as)574 2317 y(a)h(string.)39 -b(Note)28 b(that)f(the)f(same)h(information)e(is)h(a)m(v)-5 -b(ailable)26 b(from)g(t)m(w)m(o)i(prepro)s(cessor)d(macros:)574 -2416 y Fj(BARCODE_VERSION)i Fl(\(the)k(string\))e(and)h -Fj(BARCODE_VERSION_INT)25 b Fl(\(the)31 b(in)m(teger)g(n)m(um)m(b)s -(er\).)94 2705 y Fi(5)81 b(The)53 b Fd(b)-8 b(ar)g(c)g(o)g(de)65 -b Fi(fron)l(tend)51 b(program)219 2938 y Fl(The)26 b -Fc(barco)s(de)g Fl(program)g(is)f(a)h(fron)m(t-end)g(to)h(access)h -(some)e(features)h(of)f(the)g(library)e(from)i(the)g(command)94 -3037 y(line.)63 b(It)38 b(is)g(able)f(to)i(read)f(user)g(supplied)d -(strings)i(from)h(the)g(command)g(line)e(or)j(a)f(data)h(\014le)e -(\(standard)94 3137 y(input)29 b(b)m(y)h(default\))g(and)g(enco)s(de)g -(all)g(of)g(them.)94 3401 y Fk(5.1)69 b(The)44 b(Command)h(Line)219 -3587 y Fc(barco)s(de)30 b Fl(accepts)i(the)e(follo)m(wing)f(options:)94 -3741 y Fj(--help)g(or)h(-h)574 3840 y Fl(Prin)m(t)g(a)h(usage)g -(summary)e(and)h(exit.)94 3993 y Fj(-i)g(filename)574 -4092 y Fl(Iden)m(tify)35 b(a)h(\014le)f(where)g(strings)f(to)j(b)s(e)e -(enco)s(ded)g(are)h(read)f(from.)56 b(If)36 b(missing)d(\(and)i(if)g -Fj(-b)g Fl(is)574 4192 y(not)29 b(used\))f(it)g(defaults)f(to)i -(standard)e(input.)38 b(Eac)m(h)29 b(data)g(line)e(of)h(the)h(input)d -(\014le)i(will)d(b)s(e)j(used)574 4292 y(to)k(create)g(one)e(barco)s -(de)g(output.)94 4444 y Fj(-o)g(filename)574 4544 y Fl(Output)g -(\014le.)40 b(It)30 b(defaults)f(to)j(standard)d(output.)94 -4696 y Fj(-b)h(string)66 b Fl(Sp)s(ecify)32 b(a)j(single)d(\\barco)s -(de")i(string)f(to)h(b)s(e)g(enco)s(ded.)50 b(The)33 -b(option)g(can)h(b)s(e)f(used)g(m)m(ultiple)574 4796 -y(times)j(in)e(order)h(to)h(enco)s(de)g(m)m(ultiple)d(strings)i(\(this) -f(will)f(result)i(in)f(m)m(ulti-page)h(p)s(ostscript)574 -4895 y(output)22 b(or)g(a)g(table)g(of)g(barco)s(des)g(if)f -Fj(-t)g Fl(is)g(sp)s(eci\014ed\).)37 b(The)21 b(strings)g(m)m(ust)h -(matc)m(h)h(the)f(enco)s(ding)574 4995 y(c)m(hosen;)29 -b(if)c(it)g(do)s(esn't)h(matc)m(h)h(the)f(program)g(will)d(prin)m(t)i -(a)h(w)m(arning)f(to)i Fj(stderr)d Fl(and)h(generate)574 -5095 y(\\blank")44 b(output)g(\(although)h(not)f(zero-length\).)84 -b(Please)44 b(note)h(that)g(a)g(string)e(including)574 -5194 y(spaces)31 b(or)g(other)f(sp)s(ecial)f(c)m(haracters)j(m)m(ust)e -(b)s(e)g(prop)s(erly)e(quoted.)94 5347 y Fj(-e)i(encoding)574 -5446 y Fc(enco)s(ding)j Fl(is)e(the)i(name)f(of)h(the)g(c)m(hosen)g -(enco)s(ding)e(format)i(b)s(eing)e(used.)46 b(It)32 b(defaults)g(to)h -(the)574 5546 y(v)-5 b(alue)41 b(of)f(the)h(en)m(vironmen)m(t)g(v)-5 -b(ariable)39 b Fj(BARCODE_ENCODING)d Fl(or)41 b(to)g(auto)h(detection)f -(if)f(the)574 5645 y(en)m(vironmen)m(t)30 b(is)g(also)g(unset.)p -eop -%%Page: 6 7 -6 6 bop 94 -116 a Fl(Chapter)30 b(6:)41 b(Supp)s(orted)29 -b(Enco)s(dings)2417 b(6)94 365 y Fj(-g)30 b(geometry)574 -465 y Fl(The)e(geometry)g(argumen)m(t)g(is)f(of)h(the)f(form)g(\\[)p -Fj(<)p Fg(width)p Fj(>)i(x)f(<)p Fg(height)p Fj(>)p Fl(])f([)p -Fj(+)h(<)p Fg(xmar)-5 b(gin)p Fj(>)28 b(+)f(<)p Fg(ymar-)574 -565 y(gin)p Fj(>)p Fl(]")42 b(\(with)f(no)h(in)m(terv)m(ening)f -(spaces\).)75 b(Unsp)s(eci\014ed)40 b(margin)h(v)-5 b(alues)41 -b(will)e(result)i(in)f(no)574 664 y(margin;)31 b(unsp)s(eci\014ed)d -(size)j(results)e(in)h(default)g(size.)42 b(The)30 b(sp)s(eci\014ed)f -(v)-5 b(alues)30 b(represen)m(t)h(prin)m(t)574 764 y(p)s(oin)m(ts)e(b)m -(y)g(default,)g(and)g(can)g(b)s(e)g(inc)m(hes,)g(millimeters)e(or)i -(other)h(units)e(according)h(to)h(the)g Fj(-u)574 863 -y Fl(option)j(or)h(the)g Fj(BARCODE_UNIT)c Fl(en)m(vironmen)m(t)j(v)-5 -b(ariable.)49 b(The)33 b(argumen)m(t)h(is)e(used)h(to)h(place)574 -963 y(the)g(prin)m(tout)f(co)s(de)h(on)f(the)h(page.)51 -b(Note)35 b(that)f(an)f(additional)f(white)g(margin)h(of)h(10)g(p)s -(oin)m(ts)574 1063 y(is)e(added)f(to)i(the)g(prin)m(tout.)45 -b(If)31 b(the)i(option)f(is)f(unsp)s(eci\014ed,)f Fj(BARCODE_GEOMETRY)e -Fl(is)j(lo)s(ok)m(ed)574 1162 y(up)h(in)f(the)h(en)m(vironmen)m(t,)h -(if)e(missing)f(a)j(default)f(size)g(and)g(no)g(margin)f(\(but)h(the)h -(default)e(10)574 1262 y(p)s(oin)m(ts\))f(are)h(used.)94 -1409 y Fj(-t)f(table-geometry)574 1508 y Fl(Used)j(to)g(prin)m(t)e(sev) -m(eral)i(barco)s(des)f(to)i(a)f(single)e(page,)j(this)d(option)h(is)g -(mean)m(t)h(to)h(b)s(e)d(used)h(to)574 1608 y(prin)m(t)e(stic)m(k)m -(ers.)43 b(The)30 b(argumen)m(t)h(is)f(of)h(the)g(form)g(\\)p -Fj(<)p Fg(c)-5 b(olumns)p Fj(>)32 b(x)e(<)p Fg(lines)p -Fj(>)h Fl([)p Fj(+)g(<)p Fg(leftmar)-5 b(gin)p Fj(>)31 -b(+)574 1707 y(<)p Fg(b)-5 b(ottommar)g(gin)p Fj(>)39 -b Fl([)p Fj(-)d(<)p Fg(rightmar)-5 b(gin)p Fj(>)38 b -Fl([)p Fj(-)e(<)p Fg(topmar)-5 b(gin)p Fj(>)p Fl(]]]")39 -b(\(with)c(no)h(in)m(terv)m(ening)f(spaces\);)574 1807 -y(if)42 b(missing,)i(the)f(top)g(and)f(righ)m(t)g(margin)g(will)e -(default)i(to)i(b)s(e)e(the)h(same)g(as)g(the)g(b)s(ottom)574 -1907 y(and)c(left)g(margin.)66 b(The)38 b(margins)g(are)i(sp)s -(eci\014ed)d(in)h(prin)m(t)g(p)s(oin)m(ts)g(or)h(in)e(the)j(c)m(hosen)f -(unit)574 2006 y(\(see)f Fj(-u)d Fl(b)s(elo)m(w\).)59 -b(If)35 b(the)i(option)f(is)f(not)i(sp)s(eci\014ed,)f -Fj(BARCODE_TABLE)d Fl(is)i(lo)s(ok)m(ed)h(up)g(in)f(the)574 -2106 y(en)m(vironmen)m(t,)d(otherwise)f(no)h(table)f(is)g(prin)m(ted)f -(and)h(eac)m(h)i(barco)s(de)f(will)c(get)33 b(its)e(o)m(wn)h(page.)574 -2206 y(The)27 b(size)g(\(but)f(not)h(the)g(p)s(osition\))e(of)j(a)f -(barco)s(de)f(item)h(within)d(a)k(table)e(can)h(also)g(b)s(e)f -(selected)574 2305 y(using)43 b Fj(-g)g Fl(\(see)i Fj(")p -Fl(geometry)p Fj(")g Fl(ab)s(o)m(v)m(e\),)k(without)43 -b(struggling)f(with)h(external)h(and)f(in)m(ternal)574 -2405 y(margins.)71 b(I)40 b(still)e(think)h(managemen)m(t)j(of)f -(geometries)g(in)f(a)h(table)f(is)g(sub)s(optimal,)g(but)g(I)574 -2504 y(can't)32 b(mak)m(e)f(it)f(b)s(etter)h(without)e(in)m(tro)s -(ducing)f(incompatibilities.)94 2651 y Fj(-m)i(margin\(s\))574 -2751 y Fl(Sp)s(eci\014es)21 b(an)g(in)m(ternal)g(margin)g(for)g(eac)m -(h)i(stic)m(k)m(er)g(in)d(the)i(table.)38 b(The)21 b(argumen)m(t)i(is)d -(of)i(the)g(form)574 2850 y(\\)p Fj(<)p Fg(xmar)-5 b(gin)p -Fj(>,<)p Fg(ymar)g(gin)p Fj(>)p Fl(")35 b(and)c(the)g(margin)g(is)g -(applied)e(symmetrically)h(to)i(the)g(stic)m(k)m(er.)45 -b(If)574 2950 y(unsp)s(eci\014ed,)28 b(the)h(en)m(vironmen)m(t)g(v)-5 -b(ariable)28 b Fj(BARCODE_MARGIN)e Fl(is)i(used)h(or)g(a)h(default)e -(in)m(ternal)574 3050 y(margin)i(of)g(10)i(p)s(oin)m(ts)d(is)g(used.)94 -3196 y Fj(-n)384 b Fl(\\Numeric")31 b(output:)40 b(don't)31 -b(prin)m(t)e(the)h(ASCI)s(I)f(form)h(of)g(the)h(co)s(de,)g(only)e(the)i -(bars.)94 3343 y Fj(-c)384 b Fl(No)35 b(c)m(hec)m(ksum)f(c)m(haracter)h -(\(for)f(enco)s(dings)e(that)j(allo)m(w)e(it,)h(lik)m(e)f(co)s(de)h -(39,)h(other)f(co)s(des,)h(lik)m(e)574 3442 y(UPC)c(or)f(EAN,)h(ignore) -f(this)f(option\).)94 3589 y Fj(-E)384 b Fl(Encapsulated)32 -b(p)s(ostscript)f(\(default)h(is)g(normal)f(p)s(ostscript\).)47 -b(When)32 b(the)h(output)f(is)f(gener-)574 3689 y(ated)h(as)e(EPS)g -(only)f(one)i(barco)s(de)f(is)f(enco)s(ded.)94 3835 y -Fj(-P)384 b Fl(PCL)35 b(output.)56 b(Please)36 b(note)g(that)g(the)f(Y) -h(direction)e(go)s(es)i(from)f(top)h(to)g(b)s(ottom)g(for)f(PCL,)574 -3935 y(and)30 b(the)h(origin)e(for)h(an)g(image)h(is)e(the)i(top-left)f -(corner)h(instead)e(of)i(the)f(b)s(ottom-left)94 4081 -y Fj(-p)g(pagesize)574 4181 y Fl(Sp)s(ecify)44 b(a)h(non-default)f -(page)i(size.)85 b(The)45 b(page)h(size)f(can)g(b)s(e)f(sp)s(eci\014ed) -g(in)g(millimeters,)574 4281 y(inc)m(hes)34 b(or)g(plain)e(n)m(um)m(b)s -(ers)g(\(for)i(example:)48 b Fj("210x297mm")p Fl(,)32 -b Fj("8.5x11in")p Fl(,)g Fj("595x842")p Fl(\).)50 b(A)574 -4380 y(page)27 b(sp)s(eci\014cation)d(as)i(n)m(um)m(b)s(ers)e(will)f(b) -s(e)i(in)m(terpreted)g(according)g(to)i(the)f(curren)m(t)f(unit)f(sp)s -(ec-)574 4480 y(i\014cation)33 b(\(see)h Fj(-u)e Fl(b)s(elo)m(w\).)49 -b(If)33 b(libpap)s(er)d(is)i(a)m(v)-5 b(ailable,)33 b(y)m(ou)h(can)f -(also)g(sp)s(ecify)f(the)h(page)h(size)574 4580 y(with)40 -b(its)g(name,)k(lik)m(e)d Fj("A3")e Fl(or)i Fj("letter")e -Fl(\(libpap)s(er)f(is)i(a)h(standard)g(comp)s(onen)m(t)g(of)g(De-)574 -4679 y(bian)d(GNU/Lin)m(ux,)k(but)d(ma)m(y)h(b)s(e)e(missing)f -(elsewhere\).)68 b(The)39 b(default)f(page)i(size)g(is)e(y)m(our)574 -4779 y(system-wide)30 b(default)g(if)f(libpap)s(er)e(is)j(there,)h(A4)g -(otherwise.)94 4925 y Fj(-u)f(unit)162 b Fl(Cho)s(ose)32 -b(the)f(unit)f(used)g(in)g(size)i(sp)s(eci\014cations.)42 -b(Accepted)32 b(v)-5 b(alues)31 b(are)g(\\mm",)i(\\cm",)f(\\in")574 -5025 y(and)37 b(\\pt".)61 b(By)37 b(default,)h(the)f(program)f(will)f -(c)m(hec)m(k)j Fj(BARCODE_UNIT)33 b Fl(in)j(the)h(en)m(vironmen)m(t,) -574 5125 y(and)c(assume)g(p)s(oin)m(ts)g(otherwise)f(\(this)h(b)s(eha)m -(viour)f(is)g(compatible)h(with)f(0.92)j(and)d(previous)574 -5224 y(v)m(ersions.)50 b(If)33 b Fj(-u)g Fl(app)s(ears)g(more)g(than)g -(once,)j(eac)m(h)e(instance)f(will)e(mo)s(di\014ed)h(the)h(b)s(eha)m -(viour)574 5324 y(for)h(the)g(argumen)m(ts)g(at)g(its)f(righ)m(t,)i(as) -f(the)g(command)f(line)f(is)h(pro)s(cesses)g(left)h(to)g(righ)m(t.)50 -b(The)574 5424 y(program)32 b(in)m(ternally)f(w)m(orks)h(with)f(p)s -(oin)m(ts,)h(and)f(an)m(y)i(size)f(is)f(appro)m(ximated)h(to)h(the)f -(nearest)574 5523 y(m)m(ultiple)c(of)j(one)f(p)s(oin)m(t.)40 -b(The)30 b Fj(-u)f Fl(option)h(a\013ect)i Fj(-g)e Fl(\(geometry\),)i -Fj(-t)e Fl(\(table\))h(and)e Fj(-p)h Fl(\(page)574 5623 -y(size\).)p eop -%%Page: 7 8 -7 7 bop 94 -116 a Fl(Chapter)30 b(6:)41 b(Supp)s(orted)29 -b(Enco)s(dings)2417 b(7)94 365 y Fi(6)81 b(Supp)t(orted)51 -b(Enco)t(dings)219 558 y Fl(The)31 b(program)h(enco)s(des)g(text)g -(strings)f(passed)g(either)g(on)h(the)g(command)g(line)e(\(with)g(-b\)) -i(or)g(retriev)m(ed)94 658 y(from)38 b(standard)f(input.)61 -b(The)37 b(text)i(represen)m(tation)f(is)f(in)m(terpreted)g(according)g -(to)i(the)f(follo)m(wing)e(rules.)94 758 y(When)42 b(auto-detection)g -(of)g(the)f(enco)s(ding)f(is)h(enabled)f(\(i.e,)k(no)e(explicit)d(enco) -s(ding)h(t)m(yp)s(e)i(is)e(sp)s(eci\014ed\),)94 857 y(the)c(enco)s -(ding)e(t)m(yp)s(es)h(are)h(scanned)f(to)h(\014nd)d(one)j(that)g(can)f -(digest)g(the)g(text)i(string.)54 b(The)35 b(follo)m(wing)e(list)94 -957 y(of)h(supp)s(orted)e(t)m(yp)s(es)h(is)g(sorted)g(in)g(the)g(same)h -(order)f(the)h(library)d(uses)i(when)f(auto-detecting)k(a)d(suitable)94 -1056 y(enco)s(ding)d(for)g(a)h(string.)94 1193 y Fh(EAN)282 -b Fl(The)36 b(EAN)h(fron)m(tend)f(is)g(similar)d(to)38 -b(UPC;)e(it)g(accepts)i(strings)d(of)i(digits,)g(12)g(or)g(7)f(c)m -(harac-)574 1293 y(ters)c(long.)41 b(Strings)30 b(of)h(13)g(or)g(8)g(c) -m(haracters)i(are)e(accepted)h(if)e(the)h(pro)m(vided)f(c)m(hec)m(ksum) -h(digit)574 1393 y(is)40 b(correct.)73 b(I)40 b(exp)s(ect)i(most)f -(users)e(to)j(feed)e(input)f(without)h(a)h(c)m(hec)m(ksum,)j(though.)71 -b(The)574 1492 y(add-2)36 b(and)g(add-5)g(extension)f(are)h(accepted)i -(for)d(b)s(oth)g(the)i(EAN-13)g(and)e(the)h(EAN-8)h(en-)574 -1592 y(co)s(dings.)42 b(The)30 b(follo)m(wing)f(are)j(example)e(of)h(v) --5 b(alid)29 b(input)g(strings:)41 b(\\)p Fj(123456789012)p -Fl(")28 b(\(EAN-)574 1692 y(13\),)43 b(\\)p Fj(1234567890128)p -Fl(")37 b(\(EAN-13)k(wih)c(c)m(hec)m(ksum\),)43 b(\\)p -Fj(1234567)p Fl(")38 b(\(EAN-8\),)44 b(\\)p Fj(12345670)574 -1791 y(12345)p Fl(")23 b(\(EAN-8)h(with)e(c)m(hec)m(ksum)h(and)g -(add-5\),)i(\\)p Fj(123456789012)45 b(12)p Fl(")23 b(\(EAN-13)i(with)c -(add-)574 1891 y(2\),)32 b(\\)p Fj(123456789012)45 b(12345)p -Fl(")29 b(\(EAN-13)j(with)d(add-5\).)94 2028 y Fh(UPC)284 -b Fl(The)35 b(UPC)g(fron)m(tend)g(accepts)i(only)d(strings)g(made)i(up) -e(of)h(digits)f(\(and,)j(if)d(a)i(supplemen)m(tal)574 -2127 y(enco)s(ding)27 b(is)g(used,)g(a)h(blank)f(to)h(separate)g(it\).) -40 b(It)28 b(accepts)h(strings)d(of)i(11)g(or)g(12)g(digits)f(\(UPC-) -574 2227 y(A\))k(and)f(6)h(or)f(7)h(or)f(8)h(digits)e(\(UPC-E\).)574 -2345 y(The)c(12th)h(digit)e(of)h(UPC-A)g(is)f(the)h(c)m(hec)m(ksum)h -(and)e(is)g(added)h(b)m(y)g(the)g(library)d(if)i(not)i(sp)s(eci\014ed) -574 2445 y(in)k(the)h(input;)e(if)h(it)h(is)f(sp)s(eci\014ed,)f(it)h(m) -m(ust)h(b)s(e)f(the)h(righ)m(t)g(c)m(hec)m(ksum)g(or)g(the)g(co)s(de)g -(is)f(rejected)574 2545 y(as)38 b(in)m(v)-5 b(alid.)59 -b(F)-8 b(or)38 b(UPC-E,)f(6)h(digit)e(are)i(considered)e(to)i(b)s(e)e -(the)i(middle)d(part)i(of)g(the)g(co)s(de,)574 2644 y(a)i(leading)d(0)i -(is)f(assumed)g(and)g(the)h(c)m(hec)m(ksum)g(is)f(added;)k(7)d(digits)e -(are)i(either)f(considered)574 2744 y(the)30 b(initial)d(part)i -(\(leading)g(digit)f(0)i(or)g(1,)g(c)m(hec)m(ksum)g(missing\))e(or)i -(the)f(\014nal)g(part)g(\(c)m(hec)m(ksum)574 2844 y(sp)s(eci\014ed,)f -(leading)g(0)i(assumed\);)g(8)f(digits)f(are)i(considered)e(to)i(b)s(e) -e(the)i(complete)f(co)s(de,)h(with)574 2943 y(leading)k(0)i(or)f(1)g -(and)g(c)m(hec)m(ksum.)55 b(F)-8 b(or)36 b(b)s(oth)f(UPC-A)g(and)f -(UPC-E,)i(a)f(trailing)e(string)h(of)i(2)574 3043 y(digits)30 -b(or)h(5)g(digits)e(is)h(accepted)i(as)f(w)m(ell.)40 -b(Therefore,)31 b(the)g(follo)m(wing)e(are)i(examples)g(of)g(v)-5 -b(alid)574 3142 y(strings)41 b(that)h(can)f(b)s(e)g(enco)s(ded)g(as)h -(UPC:)f(\\)p Fj(01234567890)p Fl(")e(\(UPC-A\))j(\\)p -Fj(012345678905)p Fl(")574 3242 y(\(UPC-A)33 b(with)d(c)m(hec)m -(ksum\),)k(\\)p Fj(012345)p Fl(")d(\(UPC-E\),)i(\\)p -Fj(01234567890)45 b(12)p Fl(")32 b(\(UPC-A,)g(add-2\))574 -3342 y(and)21 b(\\)p Fj(01234567890)45 b(12345)p Fl(")20 -b(\(UPC-A,)i(add-5\),)h(\\)p Fj(0123456)47 b(12)p Fl(")20 -b(\(UPC-E,)i(add-2\).)38 b(Please)574 3441 y(note)24 -b(that)f(when)f(setting)h Fj(BARCODE_ANY)c Fl(to)24 b(auto-detect)h -(the)e(enco)s(ding)f(to)h(b)s(e)f(used,)i(12-digit)574 -3541 y(strings)32 b(and)h(7-digit)f(strings)g(will)e(alw)m(a)m(ys)k(b)s -(e)e(iden)m(ti\014ed)f(as)i(EAN.)h(This)d(b)s(ecause)i(I)f(exp)s(ect) -574 3641 y(most)h(user)f(to)h(pro)m(vide)f(input)e(without)i(a)g(c)m -(hec)m(ksum.)48 b(If)32 b(y)m(ou)h(need)f(to)h(sp)s(ecify)e(UPC-with-) -574 3740 y(c)m(hec)m(ksum)h(as)g(input)d(y)m(ou)i(m)m(ust)g(explicitly) -e(set)j Fj(BARCODE_UPC)c Fl(as)j(a)g(\015ag)h(or)f(use)g -Fj(-e)47 b(upc)30 b Fl(on)574 3840 y(the)h(command)f(line.)94 -3977 y Fh(ISBN)264 b Fl(ISBN)26 b(n)m(um)m(b)s(ers)e(are)i(enco)s(ded)f -(as)h(EAN-13)g(sym)m(b)s(ols,)g(with)e(an)h(optional)g(add-5)g -(trailer.)38 b(The)574 4076 y(ISBN)27 b(fron)m(tend)f(of)h(the)g -(library)e(accepts)j(real)e(ISBN)h(n)m(um)m(b)s(ers)e(and)h(deals)h -(with)e(an)m(y)i(h)m(yphen)574 4176 y(and,)h(if)f(presen)m(t,)h(the)g -(ISBN)f(c)m(hec)m(ksum)i(c)m(haracter)g(b)s(efore)e(enco)s(ding)f -(data.)41 b(V)-8 b(alid)26 b(represen-)574 4276 y(tations)j(for)e(ISBN) -h(strings)e(are)j(for)e(example:)40 b(\\)p Fj(1-56592-292-1)p -Fl(",)25 b(\\)p Fj(3-89721-122-X)p Fl(")h(and)574 4375 -y(\\)p Fj(3-89721-122-X)45 b(06900)p Fl(".)94 4512 y -Fh(co)s(de)31 b(128-B)574 4612 y Fl(This)37 b(enco)s(ding)g(can)h -(represen)m(t)g(all)f(of)h(the)h(prin)m(ting)c(ASCI)s(I)i(c)m -(haracters,)42 b(from)37 b(the)h(space)574 4711 y(\(32\))32 -b(to)g(DEL)e(\(127\).)43 b(The)30 b(c)m(hec)m(ksum)h(digit)e(is)g -(mandatory)i(in)e(this)g(enco)s(ding.)94 4848 y Fh(co)s(de)i(128-C)574 -4948 y Fl(The)h(\\C")g(v)-5 b(ariation)31 b(of)h(Co)s(de-128)h(uses)e -(Co)s(de-128)i(sym)m(b)s(ols)d(to)j(represen)m(t)f(t)m(w)m(o)h(digits)d -(at)j(a)574 5048 y(time)28 b(\(Co)s(de-128)g(is)f(made)g(up)f(of)i(104) -g(sym)m(b)s(ols)e(whose)i(in)m(terpretation)e(is)h(con)m(trolled)g(b)m -(y)g(the)574 5147 y(start)35 b(sym)m(b)s(ol)e(b)s(eing)g(used\).)52 -b(Co)s(de)34 b(128-C)h(is)e(th)m(us)h(the)h(most)f(compact)i(w)m(a)m(y) -f(to)g(represen)m(t)574 5247 y(an)m(y)41 b(ev)m(en)h(n)m(um)m(b)s(er)d -(of)i(digits.)70 b(The)40 b(enco)s(der)g(refuses)g(to)h(deal)f(with)g -(an)g(o)s(dd)g(n)m(um)m(b)s(er)f(of)574 5347 y(digits)24 -b(b)s(ecause)h(the)g(caller)f(is)g(exp)s(ected)h(to)h(pro)m(vide)e -(prop)s(er)f(padding)g(to)j(an)f(ev)m(en)g(n)m(um)m(b)s(er)f(of)574 -5446 y(digits.)38 b(\(Since)23 b(Co)s(de-128)i(includes)d(con)m(trol)j -(sym)m(b)s(ols)d(to)j(switc)m(h)f(c)m(harset,)j(it)c(is)g -(theoretically)574 5546 y(p)s(ossible)29 b(to)j(represen)m(t)f(the)h(o) -s(dd)e(digit)g(as)h(a)g(Co)s(de)g(128-A)i(or)e(128-B)i(sym)m(b)s(ol,)e -(but)f(this)g(to)s(ol)574 5645 y(do)s(esn't)h(curren)m(tly)e(implemen)m -(t)g(this)g(option\).)p eop -%%Page: 8 9 -8 8 bop 94 -116 a Fl(Chapter)30 b(6:)41 b(Supp)s(orted)29 -b(Enco)s(dings)2417 b(8)94 365 y Fh(co)s(de)31 b(128)h(ra)m(w)574 -465 y Fl(Co)s(de-128)24 b(output)d(represen)m(ted)h(sym)m(b)s(ol-b)m -(y-sym)m(b)s(ol)e(in)h(the)h(input)f(string.)36 b(T)-8 -b(o)23 b(o)m(v)m(erride)f(part)574 565 y(of)27 b(the)g(problems)d -(outlined)h(b)s(elo)m(w)g(in)g(sp)s(ecifying)f(co)s(de128)k(sym)m(b)s -(ols,)e(this)f(pseudo-enco)s(ding)574 664 y(allo)m(ws)42 -b(the)h(used)f(to)h(sp)s(ecify)e(a)i(list)e(of)i(co)s(de128)h(sym)m(b)s -(ols)d(separated)i(b)m(y)g(spaces.)77 b(Eac)m(h)574 764 -y(sym)m(b)s(ol)31 b(is)g(represen)m(ted)h(b)m(y)g(a)g(n)m(um)m(b)s(er)f -(in)g(the)h(range)g(0-105.)48 b(The)31 b(list)g(should)f(include)g(the) -574 863 y(leading)e(c)m(haracter.The)i(c)m(hec)m(ksum)g(and)e(the)h -(stop)g(c)m(haracter)h(are)f(automatically)g(added)f(b)m(y)574 -963 y(the)k(library)-8 b(.)42 b(Most)33 b(lik)m(ely)d(this)g -(pseudo-enco)s(ding)g(will)f(b)s(e)i(used)f(with)g Fj(BARCODE_NO_ASCII) -574 1063 y Fl(and)g(some)h(external)f(program)g(to)i(supply)27 -b(the)k(prin)m(ted)e(text.)94 1245 y Fh(co)s(de)37 b(39)180 -b Fl(The)36 b(co)s(de-39)h(standard)f(can)g(enco)s(de)g(upp)s(ercase)g -(letters,)i(digits,)e(the)g(blank)f(space,)k(plus,)574 -1345 y(min)m(us,)d(dot,)i(star,)f(dollar,)f(slash,)g(p)s(ercen)m(t.)57 -b(An)m(y)36 b(string)f(that)h(is)f(only)g(comp)s(osed)g(of)h(suc)m(h) -574 1445 y(c)m(haracters)j(is)e(accepted)h(b)m(y)g(the)f(co)s(de-39)i -(enco)s(der.)61 b(T)-8 b(o)38 b(a)m(v)m(oid)g(lo)s(osing)e -(information,)i(the)574 1544 y(enco)s(der)c(refuses)g(to)h(enco)s(de)f -(mixed-case)g(strings)f(\(a)i(lo)m(w)m(ercase)g(string)e(is)g -(nonetheless)h(ac-)574 1644 y(cepted)d(as)g(a)g(shortcut,)f(but)g(is)f -(enco)s(ded)h(as)h(upp)s(ercase\).)94 1826 y Fh(in)m(terlea)m(v)m(ed)g -(2)g(of)g(5)574 1926 y Fl(This)36 b(enco)s(ding)g(can)i(only)e -(represen)m(t)h(an)g(ev)m(en)h(n)m(um)m(b)s(er)e(of)h(digits)f(\(o)s -(dd)h(digits)f(are)h(repre-)574 2026 y(sen)m(ted)c(b)m(y)g(bars,)f(and) -g(ev)m(en)h(digits)e(b)m(y)i(the)f(in)m(terlea)m(ving)g(spaces\).)48 -b(The)32 b(name)g(stresses)h(the)574 2125 y(fact)i(that)g(t)m(w)m(o)g -(of)f(the)g(\014v)m(e)g(items)f(\(bars)h(or)f(spaces\))i(allo)s(cated)f -(to)g(eac)m(h)h(sym)m(b)s(ol)e(are)h(wide,)574 2225 y(while)41 -b(the)i(rest)g(are)g(narro)m(w.)78 b(The)42 b(c)m(hec)m(ksum)h(digit)f -(is)g(optional)f(\(can)j(b)s(e)e(disabled)e(via)574 2325 -y Fj(BARCODE_NO_CHECKSUM)p Fl(\).)f(Since)31 b(the)h(n)m(um)m(b)s(er)e -(of)h(digits,)g(including)d(the)j(c)m(hec)m(ksum,)i(m)m(ust)574 -2424 y(b)s(e)40 b(ev)m(en,)k(a)c(leading)f(zero)i(is)e(inserted)g(in)g -(the)i(string)e(b)s(eing)g(enco)s(ded)g(if)h(needed)f(\(this)h(is)574 -2524 y(sp)s(eci\014cally)29 b(stated)i(in)e(the)h(sp)s(ecs)g(I)g(ha)m -(v)m(e)i(access)g(to\).)94 2707 y Fh(co)s(de)f(128)136 -b Fl(Automatic)31 b(selection)g(b)s(et)m(w)m(een)g(alphab)s(et)f(A,)h -(B)g(and)f(C)h(of)g(the)g(Co)s(de-128)h(standard.)41 -b(This)574 2806 y(enco)s(ding)31 b(can)i(represen)m(t)f(all)f(ASCI)s(I) -f(sym)m(b)s(ols,)i(from)f(0)h(\(NUL\))h(to)g(127)g(\(DEL\),)g(as)g(w)m -(ell)e(as)574 2906 y(four)36 b(sp)s(ecial)e(sym)m(b)s(ols,)i(named)f -(F1,)j(F2,)g(F3,)g(F4.)58 b(The)35 b(set)h(of)g(sym)m(b)s(ols)f(a)m(v) --5 b(ailable)35 b(in)f(this)574 3005 y(enco)s(ding)g(is)f(not)i(easily) -e(represen)m(ted)i(as)f(input)e(to)k(the)e Fg(b)-5 b(ar)g(c)g(o)g(de)44 -b Fl(library)-8 b(,)33 b(so)i(the)f(follo)m(wing)574 -3105 y(con)m(v)m(en)m(tion)24 b(is)e(used.)38 b(In)22 -b(the)g(input)f(string,)j(whic)m(h)d(is)h(a)h(C-language)g(n)m -(ull-terminated)e(string,)574 3205 y(the)26 b(NUL)g(c)m(har)f(is)g -(represen)m(ted)g(b)m(y)h(the)f(v)-5 b(alue)25 b(128)i(\(0x80,)h -(0200\))g(and)d(the)g(F1-F4)i(c)m(haracters)574 3304 -y(are)f(represen)m(ted)g(b)m(y)f(the)h(v)-5 b(alues)25 -b(193-196)k(\(0xc1-0xc4,)h(0301-0304\).)43 b(The)25 b(v)-5 -b(alues)25 b(ha)m(v)m(e)i(b)s(een)574 3404 y(c)m(hosen)k(to)h(ease)f -(their)e(represen)m(tation)i(as)f(escap)s(e)h(sequences.)574 -3545 y(Since)39 b(the)h(shell)d(do)s(esn't)j(seem)f(to)i(in)m(terpret)d -(escap)s(e)i(sequences)g(on)f(the)h(command)f(line,)574 -3645 y(the)e Fj(")p Fl(-b)p Fj(")e Fl(option)g(cannot)h(b)s(e)f(easily) -g(used)g(to)i(designate)f(the)g(strings)f(to)h(b)s(e)f(enco)s(ded.)57 -b(As)574 3744 y(a)44 b(w)m(ork)-5 b(around)42 b(y)m(ou)i(can)f(resort)h -(to)f(the)h(command)f Fj(echo)p Fl(,)i(either)e(within)d(bac)m(k-tic)m -(ks)45 b(or)574 3844 y(used)34 b(separately)g(to)g(create)i(a)e(\014le) -f(that)i(is)e(then)g(fed)h(to)h(the)f(standard-input)d(of)j -Fg(b)-5 b(ar)g(c)g(o)g(de)44 b Fl({)574 3944 y(assuming)34 -b(y)m(our)h Fj(echo)f Fl(command)h(pro)s(cesses)g(escap)s(e)h -(sequences.)56 b(The)34 b(newline)f(c)m(haracter)574 -4043 y(is)d(esp)s(ecially)f(though)h(to)h(enco)s(de)f(\(but)g(not)h -(imp)s(ossible)c(unless)h(y)m(ou)j(use)f(a)h Fj(csh)e -Fl(v)-5 b(arian)m(t.)574 4184 y(These)35 b(problems)f(only)g(apply)g -(to)i(the)f(command-line)f(to)s(ol;)j(the)f(use)e(of)i(library)c -(functions)574 4284 y(do)s(esn't)44 b(giv)m(e)f(an)m(y)h(problem.)78 -b(In)42 b(needed,)47 b(y)m(ou)c(can)h(use)f(the)h(\\)p -Fg(c)-5 b(o)g(de)46 b(128)f(r)-5 b(aw)10 b Fl(")45 b(pseudo-)574 -4384 y(enco)s(ding)33 b(to)h(represen)m(t)g(co)s(de128)h(sym)m(b)s(ols) -d(b)m(y)h(their)g(n)m(umerical)f(v)-5 b(alue.)50 b(This)31 -b(enco)s(ding)i(is)574 4483 y(used)28 b(late)h(in)e(the)h -(auto-selection)i(mec)m(hanism)d(b)s(ecause)h(\(almost\))i(an)m(y)e -(input)f(string)g(can)i(b)s(e)574 4583 y(represen)m(ted)i(using)e(co)s -(de128.)94 4765 y Fh(Co)s(dabar)138 b Fl(Co)s(dabar)33 -b(can)h(enco)s(de)g(the)g(ten)f(digits)g(and)g(a)h(few)f(sp)s(ecial)f -(sym)m(b)s(ols)g(\(min)m(us,)i(plus,)e(dollar,)574 4865 -y(colon,)k(bar,)g(dot\).)54 b(The)34 b(c)m(haracters)i(\\)p -Fj(A)p Fl(",)h(\\)p Fj(B)p Fl(",)f(\\)p Fj(C)p Fl(")f(and)g(\\)p -Fj(D)p Fl(")g(are)g(used)f(to)h(represen)m(t)g(four)574 -4965 y(di\013eren)m(t)30 b(start/stop)i(c)m(haracters.)42 -b(The)30 b(input)e(string)i(to)h(the)f(barco)s(de)h(library)d(can)i -(include)574 5064 y(the)d(start)g(and)f(stop)h(c)m(haracters)h(or)e -(not)h(include)d(them)j(\(in)e(whic)m(h)h(case)h(\\)p -Fj(A)p Fl(")g(is)f(used)g(as)g(start)574 5164 y(and)38 -b(\\)p Fj(B)p Fl(")g(as)g(stop\).)64 b(Start)38 b(and)f(stop)h(c)m -(haracters)h(in)e(the)h(input)e(string)g(can)j(b)s(e)e(either)g(all)574 -5264 y(lo)m(w)m(ercase)32 b(or)f(all)e(upp)s(ercase)g(and)h(are)h(alw)m -(a)m(ys)g(prin)m(ted)e(as)h(upp)s(ercase.)94 5446 y Fh(Plessey)192 -b Fl(Plessey)39 b(barco)s(des)f(can)h(enco)s(de)g(all)f(the)h -(hexadecimal)f(digits.)64 b(Alphab)s(etic)37 b(digits)g(in)h(the)574 -5546 y(input)25 b(string)g(m)m(ust)h(either)g(b)s(e)f(all)g(lo)m(w)m -(ercase)j(or)e(all)f(upp)s(ercase.)38 b(The)26 b(output)g(text)h(is)e -(alw)m(a)m(ys)574 5645 y(upp)s(ercase.)p eop -%%Page: 9 10 -9 9 bop 94 -116 a Fl(Chapter)30 b(7:)41 b(PCL)30 b(Output)2761 -b(9)94 365 y Fh(MSI)313 b Fl(MSI)39 b(can)g(only)e(enco)s(de)i(the)g -(decimal)e(digits.)64 b(While)38 b(the)h(standard)e(sp)s(eci\014es)h -(either)g(one)574 465 y(or)e(t)m(w)m(o)h(c)m(hec)m(k)g(digits,)e(the)h -(curren)m(t)f(implemen)m(tation)f(in)g(this)g(library)f(only)i -(generates)i(one)574 565 y(c)m(hec)m(k)32 b(digit.)94 -701 y Fh(co)s(de)f(93)180 b Fl(The)30 b(co)s(de-93)h(standard)f(can)g -(nativ)m(ely)g(enco)s(de)g(48)h(di\013eren)m(t)e(c)m(haracters,)j -(including)27 b(upp)s(er-)574 801 y(case)39 b(letters,)h(digits,)e(the) -g(blank)e(space,)k(plus,)e(min)m(us,)g(dot,)h(star,)h(dollar,)e(slash,) -h(p)s(ercen)m(t,)574 901 y(as)31 b(w)m(ell)f(as)g(\014v)m(e)h(sp)s -(ecial)e(c)m(haracters:)43 b(a)30 b(start/stop)i(delimiter)c(and)i -(four)g Fj(")p Fl(shift)f(c)m(haracters)p Fj(")574 1000 -y Fl(used)f(for)f(extended)h(enco)s(ding.)39 b(Using)27 -b(this)g Fj(")p Fl(extended)g(enco)s(ding)p Fj(")g Fl(metho)s(d,)h(an)m -(y)g(standard)574 1100 y(7-bit)34 b(ASCI)s(I)e(c)m(haracter)k(can)e(b)s -(e)f(enco)s(ded,)i(but)e(it)h(tak)m(es)h(up)e(t)m(w)m(o)i(sym)m(b)s(ol) -d(lengths)i(in)e(bar-)574 1200 y(co)s(de)k(if)f(the)g(c)m(haracter)j -(is)c(not)i(nativ)m(ely)f(supp)s(orted)f(\(one)i(of)g(the)f(48\).)58 -b(The)35 b(enco)s(der)g(here)574 1299 y(fully)24 b(implemen)m(ts)g(the) -i(co)s(de)g(93)g(enco)s(ding)f(standard.)38 b(An)m(y)26 -b(c)m(haracters)h(nativ)m(ely)e(supp)s(orted)574 1399 -y(\(A-Z,)35 b(0-9,)h Fj(")p Fl(.)p Fj(+)p Fl(-/$&\045)p -Fj(")p Fl(\))e(will)d(b)s(e)j(enco)s(ded)f(as)h(suc)m(h)g(-)g(for)f(an) -m(y)h(other)h(c)m(haracters)g(\(suc)m(h)f(as)574 1498 -y(lo)m(w)m(er)h(case)g(letters,)g(brac)m(k)m(ets,)h(paren)m(theses,)g -(etc.\),)h(the)d(enco)s(der)f(will)f(rev)m(ert)i(to)h(extended)574 -1598 y(enco)s(ding.)68 b(As)40 b(a)g(note,)j(the)d(option)f(to)h -(exclude)f(the)h(c)m(hec)m(ksum)g(will)d(eliminate)i(the)h(t)m(w)m(o) -574 1698 y(mo)s(dulo-47)f(c)m(hec)m(ksums)g(\(called)g(C)f(and)g(K\))h -(from)f(the)h(barco)s(de,)i(but)d(this)g(probably)f(will)574 -1797 y(mak)m(e)c(it)e(unreadable)e(b)m(y)i(99\045)h(of)g(all)e -(scanning)g(systems.)43 b(These)31 b(c)m(hec)m(ksums)h(are)g(sp)s -(eci\014ed)574 1897 y(to)f(b)s(e)e(used)g(at)i(the)f(\014rm)m(w)m(are)f -(lev)m(el,)h(and)f(their)g(absence)h(will)d(b)s(e)j(in)m(terpreted)f -(as)h(an)f(in)m(v)-5 b(alid)574 1997 y(barco)s(de.)94 -2266 y Fi(7)81 b(PCL)53 b(Output)219 2459 y Fl(While)28 -b(the)h(default)g(output)f(is)g(P)m(ostscript)i(\(p)s(ossibly)c(EPS\),) -j(and)g(P)m(ostscript)g(can)g(b)s(e)f(p)s(ost-pro)s(cessed)94 -2558 y(to)40 b(almost)e(an)m(ything,)i(it)e(is)f(sometimes)i(desirable) -d(to)j(create)h(output)e(directly)f(usable)g(b)m(y)i(the)f(sp)s -(eci\014c)94 2658 y(prin)m(ter)33 b(at)h(hand.)50 b(PCL)33 -b(is)g(curren)m(tly)f(supp)s(orted)g(as)i(an)g(output)f(format)h(for)g -(this)e(reason.)51 b(Please)34 b(note)94 2758 y(that)25 -b(the)f(Y)g(co)s(ordinate)g(for)f(PCL)h(go)s(es)g(from)f(top)i(to)f(b)s -(ottom,)i(while)c(for)h(P)m(ostscript)h(it)g(go)s(es)g(from)g(b)s -(ottom)94 2857 y(to)35 b(top.)51 b(Consisten)m(tly)-8 -b(,)34 b(while)d(in)i(P)m(ostscript)g(y)m(ou)h(sp)s(ecify)f(the)g(b)s -(ottom-left)i(corner)e(as)h(origin,)f(for)h(PCL)94 2957 -y(y)m(ou)d(sp)s(ecify)e(the)i(top-left)f(corner.)219 -3075 y(Barco)s(de)c(output)e(for)h(PCL)f(Prin)m(ters)g(\(HP)h(LaserJet) -g(and)g(compatibles\),)g(w)m(as)h(dev)m(elop)s(ed)e(using)f(PCL5)94 -3175 y(Reference)32 b(man)m(uals)d(from)h(HP)-8 b(.)31 -b(that)g(really)e(refers)h(to)h(these)g(prin)m(ters:)169 -3293 y Fb(\017)60 b Fl(LaserJet)31 b(I)s(I)s(I,)f(I)s(I)s(I)e(P)-8 -b(,)31 b(I)s(I)s(I)e(D,)i(I)s(I)s(I)e(Si,)169 3411 y -Fb(\017)60 b Fl(LaserJet)31 b(4)g(family)169 3529 y Fb(\017)60 -b Fl(LaserJet)31 b(5)g(family)169 3648 y Fb(\017)60 b -Fl(LaserJet)31 b(6)g(family)169 3766 y Fb(\017)60 b Fl(Color)30 -b(LaserJet)169 3884 y Fb(\017)60 b Fl(DeskJet)32 b(1200)g(and)e(1600.) -219 4021 y(Ho)m(w)m(ev)m(er,)g(barco)s(de)e(prin)m(ting)d(uses)i(a)h(v) -m(ery)g(small)e(subset)h(of)g(PCL,)g(probably)f(also)h(LaserJet)h(I)s -(I)f(should)94 4121 y(prin)m(t)i(it)h(without)g(problem,)f(but)g(the)i -(resulting)e(text)i(ma)m(y)g(b)s(e)f(horrible.)219 4239 -y(The)22 b(only)g(real)h(di\013erence)f(from)h(one)g(prin)m(ter)e(to)j -(another)f(really)f(dep)s(ends)f(on)h(whic)m(h)g(fon)m(t)h(are)h(a)m(v) --5 b(ailable)94 4338 y(in)30 b(the)g(prin)m(ter,)f(used)h(in)f(prin)m -(ting)f(the)j(lab)s(el)d(asso)s(ciated)j(to)g(the)g(bars)f(\(if)f -(requested\).)219 4457 y(Earlier)j(LaserJet)j(supp)s(orts)d(only)h -(bitmaps)f(fon)m(ts,)k(so)e(these)g(are)h(not)f Fj(")p -Fl(scalable)p Fj(")p Fl(.)50 b(\(Ljet)35 b(I)s(I)e(?\),)i(Also)94 -4556 y(these)c(fon)m(ts,)f(when)f(a)m(v)-5 b(ailable,)29 -b(ha)m(v)m(e)i(a)f(sp)s(eci\014ed)e(direction,)h(and)g(not)h(all)f(of)g -(them)h(are)g(a)m(v)-5 b(ailable)29 b(in)g(b)s(oth)94 -4656 y(P)m(ortrait)i(and)f(Landscap)s(e)g(mo)s(de.)219 -4774 y(F)-8 b(rom)23 b(LaserJet)g(4)f(series,)i(\(except)g(4L/5L)f -(that)g(are)g(en)m(try-lev)m(el)f(prin)m(ters\),)h(Arial)e(scalable)h -(fon)m(t)h(should)94 4874 y(b)s(e)30 b(a)m(v)-5 b(ailable,)30 -b(so)h(it's)f(the)g Fj(")p Fl(default)g(fon)m(t)p Fj(")g -Fl(used)g(b)m(y)g(this)f(program.)219 4992 y(LaserJet)41 -b(I)s(I)s(I)d(series)i(prin)m(ters)e(\(and)i(4L,)g(5L\),)h(don't)f -(feature)h Fj(")p Fl(Arial)p Fj(")d Fl(as)i(a)h(residen)m(t)e(fon)m(t,) -k(so)e(y)m(ou)94 5092 y(should)27 b(use)i Fj(BARCODE_OUT_PCL_III)23 -b Fl(instead)28 b(of)h Fj(BARCODE_OUT_PCL.)p Fl(,)c(and)j(fon)m(t)h -(the)g(fon)m(t)h(used)d(will)g(b)s(e)94 5191 y Fj(")p -Fl(Univ)m(ers)p Fj(")j Fl(instead)f(of)i Fj(")p Fl(Arial)p -Fj(")p Fl(.)219 5309 y(Results)26 b(on)i(compatible)e(prin)m(ters,)h -(ma)m(y)h(dep)s(end)d(on)i(consistency)g(of)h(PCL5)f(compatibilit)m(y) --8 b(,)26 b(in)g(doubt,)94 5409 y(try)31 b(BAR)m(CODE)p -713 5409 28 4 v 33 w(OUT)p 951 5409 V 32 w(PCL)p 1168 -5409 V 32 w(I)s(I)s(I)219 5527 y(PJL)f(commands)g(are)g(not)h(used)f -(here,)g(as)h(it's)f(not)g(v)m(ery)h(compatible.)219 -5645 y(T)-8 b(ested)31 b(Prin)m(ters:)p eop -%%Page: 10 11 -10 10 bop 94 -116 a Fl(Chapter)30 b(8:)41 b(Bugs)31 b(and)f(P)m(ending) -f(Issues.)2211 b(10)169 365 y Fb(\017)60 b Fl(Hp)30 b(LaserJet)h(4050) -169 490 y Fb(\017)60 b Fl(Hp)30 b(LaserJet)h(2100)169 -614 y Fb(\017)60 b Fl(Epson)30 b(N-1200)j(em)m(ul)c(PCL)169 -739 y Fb(\017)60 b Fl(T)-8 b(oshiba)30 b(DP2570)i(\(copier\))f -Fj(+)f Fl(PCL)g(option)169 863 y Fb(\017)60 b Fl(Epson)30 -b(EPL-7100)i(em)m(ul.)40 b(HP)30 b(LaserJet)h(I)s(I:)f(bars)g(prin)m(t) -f(\014ne)g(but)h(text)i(is)d(bad.)94 1146 y Fi(8)81 b(Bugs)52 -b(and)i(P)l(ending)f(Issues.)219 1370 y Fl(The)42 b(curren)m(t)g -(managemen)m(t)h(of)g(b)s(orders/margins)d(is)h(far)h(from)g(optimal.) -75 b(The)42 b(\\default")g(margin)94 1469 y(applied)d(b)m(y)h(the)h -(library)d(in)m(terferes)i(with)f(the)i(external)g(represen)m(tation,)i -(but)d(I)g(feel)g(it)g(is)g(mandatory)94 1569 y(to)f(a)m(v)m(oid)f -(creating)g(barco)s(de)f(output)h(with)e(no)i(surrounding)c(white)j -(space)h(\(the)g(problem)e(is)h(esp)s(ecially)94 1669 -y(relev)-5 b(an)m(t)31 b(for)f(EPS)g(output\).)219 1793 -y(EAN-128)44 b(is)d(not)h(\(y)m(et\))i(supp)s(orted.)73 -b(I)42 b(plan)e(to)j(implemen)m(t)e(it)g(prett)m(y)h(so)s(on)g(and)f -(then)h(bless)f(the)94 1893 y(pac)m(k)-5 b(age)33 b(as)d(v)m(ersion)g -(1.0.)p eop -%%Page: -1 12 --1 11 bop 3849 -116 a Fl(i)94 365 y Fi(T)-13 b(able)55 -b(of)e(Con)l(ten)l(ts)94 697 y Fk(Barco)t(de)45 b(to)t(ols)16 -b Fa(.)k(.)g(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.) -f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g -(.)h(.)60 b Fk(1)94 955 y(1)135 b(Ov)l(erview)12 b Fa(.)21 -b(.)f(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h -(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.) -f(.)57 b Fk(1)94 1212 y(2)135 b(The)45 b(Underlying)g(Data)h(Structure) -41 b Fa(.)20 b(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)86 -b Fk(1)393 1337 y Fl(2.1)92 b(The)30 b(Fields)19 b Fg(.)14 -b(.)h(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)49 -b Fl(1)692 1436 y(Use)31 b(of)g(the)f Fg(width)39 b Fl(and)30 -b Fg(sc)-5 b(alef)50 b Fl(\014elds.)25 b Fg(.)15 b(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)56 b Fl(2)393 1536 y(2.2)92 b(The)30 b(In)m(termediate)h -(Represen)m(tation)24 b Fg(.)15 b(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)54 b Fl(3)94 1768 y Fk(3)135 b(The)45 b(Flags)28 -b Fa(.)20 b(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f -(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.) -f(.)g(.)73 b Fk(3)94 2026 y(4)135 b(F)-11 b(unctions)44 -b(Exp)t(orted)h(b)l(y)g(the)g(Library)37 b Fa(.)19 b(.)h(.)f(.)g(.)h(.) -f(.)h(.)f(.)h(.)f(.)g(.)81 b Fk(4)94 2283 y(5)135 b(The)45 -b Fa(b)-7 b(ar)g(c)g(o)g(de)52 b Fk(fron)l(tend)46 b(program)11 -b Fa(.)19 b(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h -(.)55 b Fk(5)393 2408 y Fl(5.1)92 b(The)30 b(Command)g(Line)24 -b Fg(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g -(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) -g(.)g(.)g(.)g(.)g(.)g(.)g(.)55 b Fl(5)94 2640 y Fk(6)135 -b(Supp)t(orted)44 b(Enco)t(dings)33 b Fa(.)20 b(.)f(.)g(.)h(.)f(.)h(.)f -(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.) -78 b Fk(7)94 2897 y(7)135 b(PCL)45 b(Output)40 b Fa(.)20 -b(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f -(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)85 -b Fk(9)94 3155 y(8)135 b(Bugs)45 b(and)f(P)l(ending)h(Issues.)36 -b Fa(.)19 b(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)h -(.)f(.)g(.)h(.)79 b Fk(10)p eop -%%Trailer -end -userdict /end-hook known{end-hook}if -%%EOF diff --git a/glabels2/barcode-0.98/doc/barcodedoc.txt b/glabels2/barcode-0.98/doc/barcodedoc.txt deleted file mode 100644 index 2d242f99..00000000 --- a/glabels2/barcode-0.98/doc/barcodedoc.txt +++ /dev/null @@ -1,734 +0,0 @@ - - -This is barcode.info, produced by makeinfo version 4.0b from -barcode.texinfo. - - This file is the User's Manual for the barcode library (version -0.98). - - - - -*Node: Overview - Overview - ******** - - The "barcode" package is mainly a C library for creating bar-code -output files. It also includes a command line front-end and (in a -foreseeable future) a graphic frontend. - - The package is designed as a library because we think the main use -for barcode-generation tools is inside more featured applications. The -library addresses bar code printing as two distinct problems: creation -of bar information and actual conversion to an output format. To this -aim we use an intermediate representation for bar codes, which is -currently documented in the `ps.c' source file (not in this document). - - Note that the library and the accompanying material is released -according to the GPL license, not the LGPL one. A copy of the GPL is -included in the distribution tarball. - - - - -*Node: The Barcode Object - The Underlying Data Structure - ***************************** - - Every barcode-related function acts on a data structure defined in -the `barcode.h' header, which must be included by any C source file -that uses the library. The header is installed by make install. - - The definition of the data structure is included here for reference: - - struct Barcode_Item { - int flags; /* type of encoding and other flags */ - char *ascii; /* malloced */ - char *partial; /* malloced too */ - char *textinfo; /* information about text placement */ - char *encoding; /* code name, filled by encoding engine */ - int width, height; /* output units */ - int xoff, yoff; /* output units */ - int margin; /* output units */ - double scalef; /* requested scaling for barcode */ - int error; /* an errno-like value, in case of failure */ - }; - - The exact meaning of each field and the various flags implemented are -described in the following sections. - - Even though you won't usually need to act on the contents of this -structure, some of the functions in the library receive arguments that -are directly related to one or more of these fields. - - - - -*Node: The Field List - The Fields - ========== - -`int flags;' - The flags are, as you may suspect, meant to specify the exact - behaviour of the library. They are often passed as an argument to - barcode functions and are discussed in the next section. - -`char *ascii;' -`char *partial;' -`char *textinfo;' -`char *encoding;' - These fields are internally managed by the library, and you are - not expected to touch them if you use the provided API. All of - them are allocated with malloc. - -`int width;' -`int height;' - They specify the width and height of the active barcode region - (i.e., excluding the white margin), in the units used to create - output data (for postscript they are points, 1/72th of an inch, - 0.352 mm). The fields can be either assigned to in the structure - or via Barcode_Position(), at your choice. If either value or - both are left to their default value of zero, the output engine - will assign default values according to the specified scaling - factor. If the specified width is bigger than needed (according to - the scaling factor), the output barcode will be centered in its - requested region. If either the width of the height are too small - for the specified scale factor, the output bar code will expand - symmetrically around the requested region. - -`int xoff;' -`int yoff;' - The fields specify offset from the coordinate origin of the output - engine (for postscript, position 0,0 is the lower left corner of - the page). The fields can be either assigned to in the structure - or via Barcode_Position(), at your choice. The offset specifies - where the white margin begins, not where the first bar will be - printed. To print real ink to the specified position you should - set margin to 0. - -`int margin;' - The white margin that will be left around the printed area of the - bar code. The same margin is applied to all sides of the printed - area. The default value for the margin is defined in `barcode.h' - as BARCODE_DEFAULT_MARGIN (10). - -`double scalef;' - The enlarge or shrink value for the bar code over its default - dimension. The width and scalef fields interact deeply in the - creation of the output, and a complete description of the issues - appears later in this section. - -`int error;' - The field is used when a barcode function fails to host an - errno-like integer value. - -Use of the width and scalef fields. ------------------------------------ - - A width unit is the width of the thinnest bar and/or space in the -chosen code; it defaults to 1 point if the output is postscript or -encapsulated postscript. - - Either or both the code width and the scale factor can be left -unspecified (i.e., zero). The library deals with defaults in the -following way: - -Both unspecified - If both the width and the scale factor are unspecified, the scale - factor will default to 1.0 and the width is calculated according - to the actual width of the bar code being printed. - -Width unspecified - If the width is not specified, it is calculated according to the - values of scalef. - -Scale factor unspecified - If the scale factor is not specified, it will be chosen so that - the generated bar code exactly fits the specified width. - -Both specified - The code will be printed inside the specified region according to - the specified scale factor. It will be aligned to the left. If, - however, the chosen width is too small for the specific bar code - and scaling factor, then the code will extend symmetrically to the - left and to the right of the chosen region. - - - - -*Node: The Intermediate Representation - The Intermediate Representation - =============================== - - The encoding functions print their output into the partial and -texinfo fields of the barcode data structure. Those fields, together -with position information, are then used to generate actual output. -This is an informal description of the intermediate format. - - The first char in partial tells how much extra space to add to the -left of the bars. For EAN-13, it is used to leave space to print the -first digit, other codes may have '0' for no-extra-space-needed. - - The next characters are alternating bars and spaces, as multiples of -the base dimension which is 1 unless the code is rescaled. Rescaling is -calculated as the ratio from the requested width and the calculated -width. Digits represent bar/space dimensions. Lower-case letters -represent those bars that should extend lower than the others: 'a' is -equivalent to '1', 'b' is '2' and so on up to 'i' which is equivalent to -'9'. Other letters will be used for encoding-specific meanings, as soon -as I implement them. - - The textinfo string is made up of fields %lf:%lf:%c separated by -blank space. The first integer is the x position of the character, the -second is the font size (before rescaling) and the char item is the -character to be printed. - - Both the partial and textinfo strings may include "-" or "+" as -special characters (in textinfo the char should be a stand-alone word). -They state where the text should be printed: below the bars ("-", -default) or above the bars. This is used, for example, to print the -add-5 and add-2 codes to the right of UPC or EAN codes (the add-5 -extension is mostly used in ISBN codes). - - - - -*Node: Supported Flags - The Flags - ********* - - The following flags are supported by version 0.98 of the library: - -`BARCODE_ENCODING_MASK' - The mask is used to extract the encoding-type identifier from the - flags field. - -`BARCODE_EAN' -`BARCODE_UPC' -`BARCODE_ISBN' -`BARCODE_128B' -`BARCODE_128C' -`BARCODE_128' -`BARCODE_128RAW' -`BARCODE_39' -`BARCODE_I25' -`BARCODE_CBR' -`BARCODE_MSI' -`BARCODE_PLS' -`BARCODE_93' - The currently supported encoding types: EAN (13 digits, 8 digits, - 13 + 2 add-on and 13 + 5 add-on), UPC (UPC-A, UPC-E, UPC-A with 2 - or 5 digit add-on), ISBN (with or without the 5-digit add-on), - CODE128-B (the whole set of printable ASCII characters), CODE128-C - (two digits encoded by each barcode symbol), CODE128 (all ASCII - values), a "raw-input" pseudo-code that generates CODE128 output, - CODE39 (alphanumeric), "interleaved 2 of 5" (numeric), Codabar - (numeric plus a few symbols), MSI (numeric) and Plessey (hex - digits). *Note Supported Encodings::. - -`BARCODE_ANY' - This special encoding type (represented by a value of zero, so it - will be the default) tells the encoding procedure to look for the - first encoding type that can deal with a textual string. - Therefore, a 11-digit code will be printed as UPC (as well as - 6-digit, 11+2 and 11+5), a 12-digit (or 7-digit, or 12+2 or 12+5) - as EAN13, an ISBN code (with or without hyphens, with or without - add-5) will be encoded in its EAN13 representation, an even number - of digits is encoded using CODE128C and a generic string is - encoded using CODE128B. Since code-39 offers a much larger - representation for the same text string, code128-b is preferred - over code39 for alphanumeric strings. - -`BARCODE_NO_ASCII' - Instructs the engine not to print the ascii string on output. By - default the bar code is accompanied with an ascii version of the - text it encodes. - -`BARCODE_NO_CHECKSUM' - Instructs the engine not to add the checksum character to the - output. Not all the encoding types can drop the checksum; those - where the checksum is mandatory (like EAN and UPC) just ignore the - flag. - -`BARCODE_OUTPUT_MASK' - The mask is used to extract the output-type identifier from the - flags field. - -`BARCODE_OUT_PS' -`BARCODE_OUT_EPS' -`BARCODE_OUT_PCL' -`BARCODE_OUT_PCL_III' - The currently supported encoding types: full-page postscript and - encapsulated postscript; PCL (print command language, for HP - printers) and PCL-III (same as PCL, but uses a font not available - on older printers). - -`BARCODE_OUT_NOHEADERS' - The flag instructs the printing engine not to print the header and - footer part of the file. This makes sense for the postscript - engine but might not make sense for other engines; such other - engines will silently ignore the flag just like the PCL back-end - does. - - - - -*Node: The API - Functions Exported by the Library - ********************************* - - The functions included in the barcode library are declared in the -header file barcode.h. They perform the following tasks: - -`struct Barcode_Item *Barcode_Create(char *text);' - The function creates a new barcode object to deal with a specified - text string. It returns NULL in case of failure and a pointer to - a barcode data structure in case of success. - -`int Barcode_Delete(struct Barcode_Item *bc);' - Destroy a barcode object. Always returns 0 (success) - -`int Barcode_Encode(struct Barcode_Item *bc, int flags);' - Encode the text included in the bc object. Valid flags are the - encoding type (other flags are ignored) and BARCODE_NO_CHECKSUM - (other flags are silently ignored); if the flag argument is zero, - bc->flags will apply. The function returns 0 on success and -1 in - case of error. After successful termination the data structure - will host the description of the bar code and its textual - representation, after a failure the error field will include the - reason of the failure. - -`int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags);' - Print the bar code described by bc to the specified file. Valid - flags are the output type, BARCODE_NO_ASCII and - BARCODE_OUT_NOHEADERS, other flags are ignored. If any of these - flags is zero, it will be inherited from bc->flags which therefore - takes precedence. The function returns 0 on success and -1 in case - of error (with bc->error set accordingly). In case of success, the - bar code is printed to the specified file, which won't be closed - after use. - -`int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, int xoff, int yoff, double scalef);' - The function is a shortcut to assign values to the data structure. - -`int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, int xoff, int yoff, int flags);' - The function deals with the whole life of the barcode object by - calling the other functions; it uses all the specified flags. - -`int Barcode_Version(char *versionname);' - Returns the current version as an integer number of the form major - * 10000 + minor * 100 + release. Therefore, version 1.03.5 will be - returned as 10305 and version 0.53 as 5300. If the argument is - non-null, it will be used to return the version number as a - string. Note that the same information is available from two - preprocessor macros: BARCODE_VERSION (the string) and - BARCODE_VERSION_INT (the integer number). - - - - -*Node: The barcode Executable - The barcode frontend program - **************************** - - The barcode program is a front-end to access some features of the -library from the command line. It is able to read user supplied -strings from the command line or a data file (standard input by default) -and encode all of them. - - - - -*Node: The Command Line - The Command Line - ================ - - barcode accepts the following options: - -`--help or -h' - Print a usage summary and exit. - -`-i filename' - Identify a file where strings to be encoded are read from. If - missing (and if -b is not used) it defaults to standard input. - Each data line of the input file will be used to create one - barcode output. - -`-o filename' - Output file. It defaults to standard output. - -`-b string' - Specify a single "barcode" string to be encoded. The option can - be used multiple times in order to encode multiple strings (this - will result in multi-page postscript output or a table of barcodes - if -t is specified). The strings must match the encoding chosen; - if it doesn't match the program will print a warning to stderr and - generate "blank" output (although not zero-length). Please note - that a string including spaces or other special characters must be - properly quoted. - -`-e encoding' - encoding is the name of the chosen encoding format being used. It - defaults to the value of the environment variable BARCODE_ENCODING - or to auto detection if the environment is also unset. - -`-g geometry' - The geometry argument is of the form "[ x ] [+ - + ]" (with no intervening spaces). Unspecified - margin values will result in no margin; unspecified size results - in default size. The specified values represent print points by - default, and can be inches, millimeters or other units according - to the -u option or the BARCODE_UNIT environment variable. The - argument is used to place the printout code on the page. Note that - an additional white margin of 10 points is added to the printout. - If the option is unspecified, BARCODE_GEOMETRY is looked up in the - environment, if missing a default size and no margin (but the - default 10 points) are used. - -`-t table-geometry' - Used to print several barcodes to a single page, this option is - meant to be used to print stickers. The argument is of the form - " x [+ + [- - [- ]]]" (with no intervening spaces); if - missing, the top and right margin will default to be the same as - the bottom and left margin. The margins are specified in print - points or in the chosen unit (see -u below). If the option is not - specified, BARCODE_TABLE is looked up in the environment, - otherwise no table is printed and each barcode will get its own - page. The size (but not the position) of a barcode item within a - table can also be selected using -g (see "geometry" above), - without struggling with external and internal margins. I still - think management of geometries in a table is suboptimal, but I - can't make it better without introducing incompatibilities. - -`-m margin(s)' - Specifies an internal margin for each sticker in the table. The - argument is of the form "," and the margin is - applied symmetrically to the sticker. If unspecified, the - environment variable BARCODE_MARGIN is used or a default internal - margin of 10 points is used. - -`-n' - "Numeric" output: don't print the ASCII form of the code, only the - bars. - -`-c' - No checksum character (for encodings that allow it, like code 39, - other codes, like UPC or EAN, ignore this option). - -`-E' - Encapsulated postscript (default is normal postscript). When the - output is generated as EPS only one barcode is encoded. - -`-P' - PCL output. Please note that the Y direction goes from top to - bottom for PCL, and the origin for an image is the top-left corner - instead of the bottom-left - -`-p pagesize' - Specify a non-default page size. The page size can be specified in - millimeters, inches or plain numbers (for example: "210x297mm", - "8.5x11in", "595x842"). A page specification as numbers will be - interpreted according to the current unit specification (see -u - below). If libpaper is available, you can also specify the page - size with its name, like "A3" or "letter" (libpaper is a standard - component of Debian GNU/Linux, but may be missing elsewhere). The - default page size is your system-wide default if libpaper is - there, A4 otherwise. - -`-u unit' - Choose the unit used in size specifications. Accepted values are - "mm", "cm", "in" and "pt". By default, the program will check - BARCODE_UNIT in the environment, and assume points otherwise (this - behaviour is compatible with 0.92 and previous versions. If -u - appears more than once, each instance will modified the behaviour - for the arguments at its right, as the command line is processes - left to right. The program internally works with points, and any - size is approximated to the nearest multiple of one point. The -u - option affect -g (geometry), -t (table) and -p (page size). - - - - -*Node: Supported Encodings - Supported Encodings - ******************* - - The program encodes text strings passed either on the command line -(with -b) or retrieved from standard input. The text representation is -interpreted according to the following rules. When auto-detection of -the encoding is enabled (i.e, no explicit encoding type is specified), -the encoding types are scanned to find one that can digest the text -string. The following list of supported types is sorted in the same -order the library uses when auto-detecting a suitable encoding for a -string. - -EAN - The EAN frontend is similar to UPC; it accepts strings of digits, - 12 or 7 characters long. Strings of 13 or 8 characters are - accepted if the provided checksum digit is correct. I expect most - users to feed input without a checksum, though. The add-2 and - add-5 extension are accepted for both the EAN-13 and the EAN-8 - encodings. The following are example of valid input strings: - "123456789012" (EAN-13), "1234567890128" (EAN-13 wih checksum), - "1234567" (EAN-8), "12345670 12345" (EAN-8 with checksum and - add-5), "123456789012 12" (EAN-13 with add-2), "123456789012 - 12345" (EAN-13 with add-5). - -UPC - The UPC frontend accepts only strings made up of digits (and, if a - supplemental encoding is used, a blank to separate it). It - accepts strings of 11 or 12 digits (UPC-A) and 6 or 7 or 8 digits - (UPC-E). - - The 12th digit of UPC-A is the checksum and is added by the - library if not specified in the input; if it is specified, it must - be the right checksum or the code is rejected as invalid. For - UPC-E, 6 digit are considered to be the middle part of the code, a - leading 0 is assumed and the checksum is added; 7 digits are - either considered the initial part (leading digit 0 or 1, checksum - missing) or the final part (checksum specified, leading 0 - assumed); 8 digits are considered to be the complete code, with - leading 0 or 1 and checksum. For both UPC-A and UPC-E, a trailing - string of 2 digits or 5 digits is accepted as well. Therefore, the - following are examples of valid strings that can be encoded as UPC: - "01234567890" (UPC-A) "012345678905" (UPC-A with checksum), - "012345" (UPC-E), "01234567890 12" (UPC-A, add-2) and "01234567890 - 12345" (UPC-A, add-5), "0123456 12" (UPC-E, add-2). Please note - that when setting BARCODE_ANY to auto-detect the encoding to be - used, 12-digit strings and 7-digit strings will always be - identified as EAN. This because I expect most user to provide - input without a checksum. If you need to specify UPC-with-checksum - as input you must explicitly set BARCODE_UPC as a flag or use -e - upc on the command line. - -ISBN - ISBN numbers are encoded as EAN-13 symbols, with an optional add-5 - trailer. The ISBN frontend of the library accepts real ISBN - numbers and deals with any hyphen and, if present, the ISBN - checksum character before encoding data. Valid representations for - ISBN strings are for example: "1-56592-292-1", "3-89721-122-X" and - "3-89721-122-X 06900". - -CODE 128-B - This encoding can represent all of the printing ASCII characters, - from the space (32) to DEL (127). The checksum digit is mandatory - in this encoding. - -CODE 128-C - The "C" variation of Code-128 uses Code-128 symbols to represent - two digits at a time (Code-128 is made up of 104 symbols whose - interpretation is controlled by the start symbol being used). Code - 128-C is thus the most compact way to represent any even number of - digits. The encoder refuses to deal with an odd number of digits - because the caller is expected to provide proper padding to an - even number of digits. (Since Code-128 includes control symbols to - switch charset, it is theoretically possible to represent the odd - digit as a Code 128-A or 128-B symbol, but this tool doesn't - currently implement this option). - -CODE 128 RAW - Code-128 output represented symbol-by-symbol in the input string. - To override part of the problems outlined below in specifying - code128 symbols, this pseudo-encoding allows the used to specify a - list of code128 symbols separated by spaces. Each symbol is - represented by a number in the range 0-105. The list should - include the leading character.The checksum and the stop character - are automatically added by the library. Most likely this - pseudo-encoding will be used with BARCODE_NO_ASCII and some - external program to supply the printed text. - -CODE 39 - The code-39 standard can encode uppercase letters, digits, the - blank space, plus, minus, dot, star, dollar, slash, percent. Any - string that is only composed of such characters is accepted by the - code-39 encoder. To avoid loosing information, the encoder refuses - to encode mixed-case strings (a lowercase string is nonetheless - accepted as a shortcut, but is encoded as uppercase). - -INTERLEAVED 2 OF 5 - This encoding can only represent an even number of digits (odd - digits are represented by bars, and even digits by the - interleaving spaces). The name stresses the fact that two of the - five items (bars or spaces) allocated to each symbol are wide, - while the rest are narrow. The checksum digit is optional (can be - disabled via BARCODE_NO_CHECKSUM). Since the number of digits, - including the checksum, must be even, a leading zero is inserted - in the string being encoded if needed (this is specifically stated - in the specs I have access to). - -CODE 128 - Automatic selection between alphabet A, B and C of the Code-128 - standard. This encoding can represent all ASCII symbols, from 0 - (NUL) to 127 (DEL), as well as four special symbols, named F1, F2, - F3, F4. The set of symbols available in this encoding is not - easily represented as input to the barcode library, so the - following convention is used. In the input string, which is a - C-language null-terminated string, the NUL char is represented by - the value 128 (0x80, 0200) and the F1-F4 characters are - represented by the values 193-196 (0xc1-0xc4, 0301-0304). The - values have been chosen to ease their representation as escape - sequences. - - Since the shell doesn't seem to interpret escape sequences on the - command line, the "-b" option cannot be easily used to designate - the strings to be encoded. As a workaround you can resort to the - command echo, either within back-ticks or used separately to - create a file that is then fed to the standard-input of barcode - - assuming your echo command processes escape sequences. The - newline character is especially though to encode (but not - impossible unless you use a csh variant. - - These problems only apply to the command-line tool; the use of - library functions doesn't give any problem. In needed, you can use - the "code 128 raw" pseudo-encoding to represent code128 symbols by - their numerical value. This encoding is used late in the - auto-selection mechanism because (almost) any input string can be - represented using code128. - -CODABAR - Codabar can encode the ten digits and a few special symbols - (minus, plus, dollar, colon, bar, dot). The characters "A", "B", - "C" and "D" are used to represent four different start/stop - characters. The input string to the barcode library can include - the start and stop characters or not include them (in which case - "A" is used as start and "B" as stop). Start and stop characters - in the input string can be either all lowercase or all uppercase - and are always printed as uppercase. - -PLESSEY - Plessey barcodes can encode all the hexadecimal digits. Alphabetic - digits in the input string must either be all lowercase or all - uppercase. The output text is always uppercase. - -MSI - MSI can only encode the decimal digits. While the standard - specifies either one or two check digits, the current - implementation in this library only generates one check digit. - -CODE 93 - The code-93 standard can natively encode 48 different characters, - including uppercase letters, digits, the blank space, plus, minus, - dot, star, dollar, slash, percent, as well as five special - characters: a start/stop delimiter and four "shift characters" - used for extended encoding. Using this "extended encoding" - method, any standard 7-bit ASCII character can be encoded, but it - takes up two symbol lengths in barcode if the character is not - natively supported (one of the 48). The encoder here fully - implements the code 93 encoding standard. Any characters natively - supported (A-Z, 0-9, ".+-/$&%") will be encoded as such - for any - other characters (such as lower case letters, brackets, - parentheses, etc.), the encoder will revert to extended encoding. - As a note, the option to exclude the checksum will eliminate the - two modulo-47 checksums (called C and K) from the barcode, but this - probably will make it unreadable by 99% of all scanning systems. - These checksums are specified to be used at the firmware level, - and their absence will be interpreted as an invalid barcode. - - - - -*Node: PCL Output - PCL Output - ********** - - While the default output is Postscript (possibly EPS), and Postscript -can be post-processed to almost anything, it is sometimes desirable to -create output directly usable by the specific printer at hand. PCL is -currently supported as an output format for this reason. Please note -that the Y coordinate for PCL goes from top to bottom, while for -Postscript it goes from bottom to top. Consistently, while in -Postscript you specify the bottom-left corner as origin, for PCL you -specify the top-left corner. - - Barcode output for PCL Printers (HP LaserJet and compatibles), was -developed using PCL5 Reference manuals from HP. that really refers to -these printers: - * LaserJet III, III P, III D, III Si, - - * LaserJet 4 family - - * LaserJet 5 family - - * LaserJet 6 family - - * Color LaserJet - - * DeskJet 1200 and 1600. - - - However, barcode printing uses a very small subset of PCL, probably -also LaserJet II should print it without problem, but the resulting -text may be horrible. - - The only real difference from one printer to another really depends -on which font are available in the printer, used in printing the label -associated to the bars (if requested). - - Earlier LaserJet supports only bitmaps fonts, so these are not -"scalable". (Ljet II ?), Also these fonts, when available, have a -specified direction, and not all of them are available in both Portrait -and Landscape mode. - - From LaserJet 4 series, (except 4L/5L that are entry-level printers), -Arial scalable font should be available, so it's the "default font" -used by this program. - - LaserJet III series printers (and 4L, 5L), don't feature "Arial" as a -resident font, so you should use BARCODE_OUT_PCL_III instead of -BARCODE_OUT_PCL., and font the font used will be "Univers" instead of -"Arial". - - Results on compatible printers, may depend on consistency of PCL5 -compatibility, in doubt, try BARCODE_OUT_PCL_III - - PJL commands are not used here, as it's not very compatible. - - Tested Printers: - * Hp LaserJet 4050 - - * Hp LaserJet 2100 - - * Epson N-1200 emul PCL - - * Toshiba DP2570 (copier) + PCL option - - * Epson EPL-7100 emul. HP LaserJet II: bars print fine but text is - bad. - - - - -*Node: Bugs and Pending Issues - Bugs and Pending Issues. - ************************ - - The current management of borders/margins is far from optimal. The -"default" margin applied by the library interferes with the external -representation, but I feel it is mandatory to avoid creating barcode -output with no surrounding white space (the problem is especially -relevant for EPS output). - - EAN-128 is not (yet) supported. I plan to implement it pretty soon -and then bless the package as version 1.0. - - - - - -Tag Table:Node: Top154 - Node: Overview526 - Node: The Barcode Object1404 -Node: The Field List2821 -Node: The Intermediate Representation6586 -Node: Supported Flags8359 -Node: The API11343 -Node: The barcode Executable14029 -Node: The Command Line14458 -Node: Supported Encodings19557 -Node: PCL Output28997 -Node: Bugs and Pending Issues31316 - - - -End Tag Table \ No newline at end of file diff --git a/glabels2/barcode-0.98/doc/doc.barcode b/glabels2/barcode-0.98/doc/doc.barcode deleted file mode 100644 index 7b460558..00000000 --- a/glabels2/barcode-0.98/doc/doc.barcode +++ /dev/null @@ -1,939 +0,0 @@ -\input texinfo @c -*-texinfo-*- -% -% doc.barcode - main file for the documentation -% -%%%% - -%------------------------------------------------------------------------------ -% -% NOTE FOR THE UNAWARE USER -% ========================= -% -% This file is a texinfo source. It isn't the binary file of some strange -% editor of mine. If you want ascii, you should "make barcodedoc.txt". -% -%------------------------------------------------------------------------------ - -% -% This is not a conventional info file... -% I use two extra features: -% - The '%' as a comment marker, if at beg. of line ("\%" -> "%") -% - leading blanks are allowed -% - -@comment %**start of header -@setfilename barcode.info -@settitle Barcode @value{version} -@iftex -@afourpaper -@end iftex -@comment %**end of header - -@setchapternewpage off - -@set version 0.98 -@set update-month March 2002 - -@finalout - -@ifinfo - -This file is the User's Manual for the barcode library (version -@value{version}). - -@end ifinfo - -@setchapternewpage odd -@titlepage -@c use the new format for titles -@title barcode @value{version} -@subtitle A library for drawing bar codes -@subtitle @value{update-month} - -@author by Alessandro Rubini (@code{rubini@@gnu.org}) - -@end titlepage -@setchapternewpage off -@headings single - - -@node Top, Overview, (dir), (dir) -@top Barcode tools - -This file documents version @value{version} of the barcode -library and sample programs (@value{update-month}). - -@menu -* Overview:: -* The Barcode Object:: -* Supported Flags:: -* The API:: -* The barcode Executable:: -* Supported Encodings:: -* PCL Output:: -* Bugs and Pending Issues:: -@end menu - - -%########################################################################## -%########################################################################## - -@node Overview, The Barcode Object, Top, Top -@chapter Overview - -The @dfn{barcode} package is mainly a C library for creating bar-code -output files. It also includes a command line front-end and (in a -foreseeable future) a graphic frontend. - -The package is designed as a library because we think the main use for -barcode-generation tools is inside more featured applications. The -library addresses bar code printing as two distinct problems: creation -of bar information and actual conversion to an output format. To this -aim we use an intermediate representation for bar codes, which is -currently documented in the @file{ps.c} source file (not in this -document). - -Note that the library and the accompanying material is released -according to the GPL license, not the LGPL one. A copy of the GPL is -included in the distribution tarball. - -%########################################################################## - -@node The Barcode Object, Supported Flags, Overview, Top -@chapter The Underlying Data Structure - -Every barcode-related function acts on a data structure defined in the -@file{barcode.h} header, which must be included by any C source file -that uses the library. The header is installed by @t{make install}. - -The definition of the data structure is included here for reference: - -@lisp -struct Barcode_Item @{ - int flags; /* type of encoding and other flags */ - char *ascii; /* malloced */ - char *partial; /* malloced too */ - char *textinfo; /* information about text placement */ - char *encoding; /* code name, filled by encoding engine */ - int width, height; /* output units */ - int xoff, yoff; /* output units */ - int margin; /* output units */ - double scalef; /* requested scaling for barcode */ - int error; /* an errno-like value, in case of failure */ -@}; -@end lisp - -The exact meaning of each field and the various flags implemented are -described in the following sections. - -Even though you won't usually need to act on the contents of this -structure, some of the functions in the library receive arguments that -are directly related to one or more of these fields. - -%========================================================================== - -@menu -* The Field List:: -* The Intermediate Representation:: -@end menu - -%-------------------------------------------------------------------------- -@node The Field List, The Intermediate Representation, The Barcode Object, The Barcode Object -@section The Fields - -@table @code - -@item int flags; - - The flags are, as you may suspect, meant to specify the exact - behaviour of the library. They are often passed as an argument - to @i{barcode} functions and are discussed in the next section. - -@item char *ascii; -@itemx char *partial; -@itemx char *textinfo; -@itemx char *encoding; - - These fields are internally managed by the library, and you are - not expected to touch them if you use the provided API. All - of them are allocated with @i{malloc}. - -@item int width; -@itemx int height; - - They specify the width and height of the @i{active} barcode - region (i.e., excluding the white margin), in the units used - to create output data (for postscript they are points, 1/72th - of an inch, 0.352 mm). The fields can be either assigned to - in the structure or via @i{Barcode_Position()}, at your - choice. If either value or both are left to their default - value of zero, the output engine will assign default values - according to the specified scaling factor. If the specified - width is bigger than needed (according to the scaling factor), - the output barcode will be centered in its requested - region. If either the width of the height are too small for - the specified scale factor, the output bar code will expand - symmetrically around the requested region. - -@item int xoff; -@itemx int yoff; - - The fields specify offset from the coordinate origin of the - output engine (for postscript, position 0,0 is the lower left - corner of the page). The fields can be either assigned to in - the structure or via @i{Barcode_Position()}, at your choice. - The offset specifies where the white margin begins, not where - the first bar will be printed. To print real ink to the - specified position you should set @i{margin} to 0. - -@item int margin; - - The white margin that will be left around the printed area of - the bar code. The same margin is applied to all sides of the - printed area. The default value for the margin is defined in - @file{barcode.h} as @t{BARCODE_DEFAULT_MARGIN} (10). - -@item double scalef; - - The enlarge or shrink value for the bar code over its default - dimension. The @i{width} and @i{scalef} fields interact deeply - in the creation of the output, and a complete description of - the issues appears later in this section. - -@item int error; - - The field is used when a @i{barcode} function fails to host - an @t{errno}-like integer value. - -@end table - - -@unnumberedsubsec Use of the @i{width} and @i{scalef} fields. - -A width unit is the width of the thinnest bar and/or space in the -chosen code; it defaults to 1 point if the output is postscript or -encapsulated postscript. - -Either or both the code width and the scale factor can be left -unspecified (i.e., zero). The library deals with defaults in the -following way: - -@table @i - -@item Both unspecified - - If both the width and the scale factor are unspecified, the - scale factor will default to 1.0 and the width is calculated - according to the actual width of the bar code being printed. - -@item Width unspecified - - If the width is not specified, it is calculated according to - the values of @i{scalef}. - -@item Scale factor unspecified - - If the scale factor is not specified, it will be chosen so - that the generated bar code exactly fits the specified width. - -@item Both specified - - The code will be printed inside the specified region according - to the specified scale factor. It will be aligned to the left. - If, however, the chosen width is too small for the specific - bar code and scaling factor, then the code will extend - symmetrically to the left and to the right of the chosen - region. - -@end table - -%-------------------------------------------------------------------------- -@node The Intermediate Representation, , The Field List, The Barcode Object -@section The Intermediate Representation - -The encoding functions print their output into the @t{partial} and -@t{texinfo} fields of the barcode data structure. Those fields, together -with position information, are then used to generate actual output. -This is an informal description of the intermediate format. - -The first char in @t{partial} tells how much extra space to add to the -left of the bars. For EAN-13, it is used to leave space to print the -first digit, other codes may have '0' for no-extra-space-needed. - -The next characters are alternating bars and spaces, as multiples of the -base dimension which is 1 unless the code is rescaled. Rescaling is -calculated as the ratio from the requested width and the calculated -width. Digits represent bar/space dimensions. Lower-case letters -represent those bars that should extend lower than the others: 'a' is -equivalent to '1', 'b' is '2' and so on up to 'i' which is equivalent to -'9'. Other letters will be used for encoding-specific meanings, as soon -as I implement them. - -The @t{textinfo} string is made up of fields @t{%lf:%lf:%c} separated by -blank space. The first integer is the x position of the character, -the second is the font size (before rescaling) and the char item is -the character to be printed. - -Both the @t{partial} and @t{textinfo} strings may include ``@t{-}'' or -``@t{+}'' as special characters (in @t{textinfo} the char should be a -stand-alone word). They state where the text should be printed: below -the bars (``@t{-}'', default) or above the bars. This is used, for -example, to print the add-5 and add-2 codes to the right of UPC or EAN -codes (the add-5 extension is mostly used in ISBN codes). - - - - -%========================================================================== - -@node Supported Flags, The API, The Barcode Object, Top -@chapter The Flags - -The following flags are supported by version @value{version} of the -library: - -@table @code - -@item BARCODE_ENCODING_MASK - - The mask is used to extract the encoding-type identifier from - the @i{flags} field. - -@item BARCODE_EAN -@itemx BARCODE_UPC -@itemx BARCODE_ISBN -@itemx BARCODE_128B -@itemx BARCODE_128C -@itemx BARCODE_128 -@itemx BARCODE_128RAW -@itemx BARCODE_39 -@itemx BARCODE_I25 -@itemx BARCODE_CBR -@itemx BARCODE_MSI -@itemx BARCODE_PLS -@itemx BARCODE_93 - - The currently supported encoding types: EAN (13 digits, 8 - digits, 13 + 2 add-on and 13 + 5 add-on), UPC (UPC-A, UPC-E, - UPC-A with 2 or 5 digit add-on), ISBN (with or without the - 5-digit add-on), CODE128-B (the whole set of printable - ASCII characters), CODE128-C (two digits encoded by each barcode - symbol), CODE128 (all ASCII values), a ``raw-input'' pseudo-code - that generates CODE128 output, CODE39 (alphanumeric), - "interleaved 2 of 5" (numeric), Codabar (numeric plus a few - symbols), MSI (numeric) and Plessey (hex digits). - @xref{Supported Encodings}. - -@item BARCODE_ANY - - This special encoding type (represented by a value of zero, so - it will be the default) tells the encoding procedure to look - for the first encoding type that can deal with a textual - string. Therefore, a 11-digit code will be printed as UPC (as - well as 6-digit, 11+2 and 11+5), a 12-digit (or 7-digit, or - 12+2 or 12+5) as EAN13, an ISBN code (with or without hyphens, - with or without add-5) will be encoded in its EAN13 - representation, an even number of digits is encoded using - CODE128C and a generic string is encoded using CODE128B. Since - code-39 offers a much larger representation for the same - text string, code128-b is preferred over code39 for - alphanumeric strings. - -@item BARCODE_NO_ASCII - - Instructs the engine not to print the ascii string on - output. By default the bar code is accompanied with an ascii - version of the text it encodes. - -@item BARCODE_NO_CHECKSUM - - Instructs the engine not to add the checksum character to the - output. Not all the encoding types can drop the checksum; - those where the checksum is mandatory (like EAN and UPC) - just ignore the flag. - -@item BARCODE_OUTPUT_MASK - - The mask is used to extract the output-type identifier from - the @i{flags} field. - -@item BARCODE_OUT_PS -@itemx BARCODE_OUT_EPS -@itemx BARCODE_OUT_PCL -@itemx BARCODE_OUT_PCL_III - - The currently supported encoding types: full-page postscript - and encapsulated postscript; PCL (print command language, for - HP printers) and PCL-III (same as PCL, but uses a font not - available on older printers). - -@item BARCODE_OUT_NOHEADERS - - The flag instructs the printing engine not to print the header - and footer part of the file. This makes sense for the - postscript engine but might not make sense for other engines; - such other engines will silently ignore the flag just like - the PCL back-end does. - -@end table - -%########################################################################## - -@node The API, The barcode Executable, Supported Flags, Top -@chapter Functions Exported by the Library - -%MANPAGE barcode.3 -%M .TH BARCODE 3 "October 1999" "GNU" "GNU barcode" -%M .UC 4 -%M .SH NAME -%M barcode \- a library to create and print bar codes -%M .SH SYNOPSIS -%M .B #include -%M .sp -%M .BI "struct Barcode_Item *Barcode_Create(char *" text ");" -%M .br -%M .BI "int Barcode_Delete(struct Barcode_Item *" bc ");" -%M .br -%M .BI "int Barcode_Encode(struct Barcode_Item *" bc ", int " flags ");" -%M .br -%M .BI "int Barcode_Print(struct Barcode_Item *" bc ", FILE *" f ", int " flags ");" -%M .br -%M .BI "int Barcode_Position(struct Barcode_Item *" bc ", int " wid ", int " hei ", int " xoff ", int " yoff " , double " scalef ");" -%M .br -%M .BI "int Barcode_Encode_and_Print(char *" text ", FILE *" f ", int " wid ", int " hei ", int " xoff ", int " yoff ", int " flags ");" -%M .br -%M .BI "int Barcode_Version(char *" versionname ");" -%M -%M .SH DESCRIPTION -%M -%M The barcode family of library functions is meant to ease -%M creation of bar-code printouts. -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. - -The functions included in the barcode library are declared in the -header file @t{barcode.h}. They perform the following tasks: - -@table @code - -@item struct Barcode_Item *Barcode_Create(char *text); - The function creates a new barcode object to deal with a - specified text string. It returns NULL in case of failure and - a pointer to a barcode data structure in case of success. - -@item int Barcode_Delete(struct Barcode_Item *bc); - Destroy a barcode object. Always returns 0 (success) - -@item int Barcode_Encode(struct Barcode_Item *bc, int flags); - Encode the text included in the @i{bc} object. Valid flags are - the encoding type (other flags are ignored) and - BARCODE_NO_CHECKSUM (other flags are silently ignored); if the - flag argument is zero, @t{bc->flags} will apply. The function - returns 0 on success and -1 in case of error. After - successful termination the data structure will host the - description of the bar code and its textual representation, - after a failure the @t{error} field will include the reason of - the failure. - -@item int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags); - Print the bar code described by @t{bc} to the specified file. - Valid flags are the output type, @t{BARCODE_NO_ASCII} and - @t{BARCODE_OUT_NOHEADERS}, other flags are ignored. If any of - these flags is zero, it will be inherited from @t{bc->flags} - which therefore takes precedence. The function returns 0 on - success and -1 in case of error (with @t{bc->error} set - accordingly). In case of success, the bar code is printed to - the specified file, which won't be closed after use. - -@item int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, int xoff, int yoff, double scalef); - The function is a shortcut to assign values to the data - structure. - -@item int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, int xoff, int yoff, int flags); - The function deals with the whole life of the barcode - object by calling the other functions; it uses all the specified - flags. - -@item int Barcode_Version(char *versionname); - Returns the current version as an integer number of the form - major * 10000 + minor * 100 + release. Therefore, version - 1.03.5 will be returned as 10305 and version 0.53 as 5300. If - the argument is non-null, it will be used to return the version - number as a string. Note that the same information is available from - two preprocessor macros: @t{BARCODE_VERSION} (the string) and - @t{BARCODE_VERSION_INT} (the integer number). - -@end table - -%MANPAGE END - -%########################################################################## - -@node The barcode Executable, Supported Encodings, The API, Top -@chapter The @i{barcode} frontend program - -%MANPAGE barcode.1 -%M .TH BARCODE 1 "October 2001" "GNU" "GNU barcode" -%M .UC 4 -%M .SH NAME -%M barcode \- a stand alone program to run the barcode library -%M .SH SYNOPSIS -%M .B barcode -%M [\-b - | string] [\-e encoding] [\-o - | outfile] [ -%M .I other-flags -%M ] -%M .SH DESCRIPTION -%M -%M The information below is extracted from the texinfo file, which is the -%M preferred source of information. -%M .PP -The @b{barcode} program is a front-end to access some features of the -library from the command line. It is able to read user supplied -strings from the command line or a data file (standard input by default) -and encode all of them. - -%M .SH OPTIONS -%M .PP - -@menu -* The Command Line:: -@end menu - -%-------------------------------------------------------------------------- -@node The Command Line, , The barcode Executable, The barcode Executable -@section The Command Line - - -@b{barcode} accepts the following options: - -@table @code - -@item --help or -h - Print a usage summary and exit. - -@item -i filename - Identify a file where strings to be encoded are read from. If - missing (and if @t{-b} is not used) it defaults to standard - input. Each data line of the input file will be used to create - one barcode output. - -@item -o filename - Output file. It defaults to standard output. - -@item -b string - Specify a single ``barcode'' string to be encoded. - The option can be used multiple times in order to encode - multiple strings (this will result in multi-page postscript - output or a table of barcodes if @t{-t} is specified). The - strings must match the encoding chosen; if it doesn't - match the program will print a warning to @t{stderr} and - generate ``blank'' output (although not zero-length). - Please note that a string including spaces or - other special characters must be properly quoted. - -@item -e encoding - @b{encoding} is the name of the chosen encoding format being - used. It defaults to the value of the environment variable - @t{BARCODE_ENCODING} or to auto detection if the environment is - also unset. - -@item -g geometry - The geometry argument is of the form ``[@i{} @t{x} - @i{}] [@t{+} @i{} @t{+} @i{}]'' (with - no intervening spaces). Unspecified margin values will result in - no margin; unspecified size results in default size. - The specified values represent print points by - default, and can be inches, millimeters or other units - according to the @t{-u} option or the @t{BARCODE_UNIT} - environment variable. The argument is used to place the - printout code on the page. Note that an additional white - margin of 10 points is added to the printout. If the option is - unspecified, @t{BARCODE_GEOMETRY} is looked up in the - environment, if missing a default size and no margin (but the - default 10 points) are used. - -@item -t table-geometry - Used to print several barcodes to a single page, this option - is meant to be used to print stickers. The argument is of the - form ``@i{} @t{x} @i{} [@t{+} @i{} - @t{+} @i{} [@t{-} @i{} [@t{-} - @i{}]]]'' (with no intervening spaces); if missing, - the top and right margin will default to be the same as the - bottom and left margin. The margins are specified in print - points or in the chosen unit (see @t{-u} below). If the - option is not specified, @t{BARCODE_TABLE} is looked up in the - environment, otherwise no table is printed and each barcode - will get its own page. The size (but not the position) - of a barcode item within a table can also be selected using - @t{-g} (see "geometry" above), without struggling with - external and internal margins. I still think management of - geometries in a table is suboptimal, but I can't make it - better without introducing incompatibilities. - - -@item -m margin(s) - Specifies an internal margin for each sticker in the - table. The argument is of the form - ``@i{}@t{,}@i{}'' and the margin is applied - symmetrically to the sticker. If unspecified, the environment - variable @t{BARCODE_MARGIN} is used or a default internal - margin of 10 points is used. - -@item -n - ``Numeric'' output: don't print the ASCII form of the code, - only the bars. - -@item -c - No checksum character (for encodings that allow it, like code 39, - other codes, like UPC or EAN, ignore this option). - -@item -E - Encapsulated postscript (default is normal postscript). When - the output is generated as EPS only one barcode is encoded. - -@item -P - PCL output. Please note that the Y direction goes from top - to bottom for PCL, and the origin for an image is the top-left - corner instead of the bottom-left - -@item -p pagesize - Specify a non-default page size. The page size can be specified - in millimeters, inches or plain numbers (for example: "@t{210x297mm}", - "@t{8.5x11in}", "@t{595x842}"). A page specification as numbers - will be interpreted according to the current unit specification - (see @t{-u} below). If libpaper is available, - you can also specify the page size with its name, like "@t{A3}" - or "@t{letter}" (libpaper is a standard component of Debian - GNU/Linux, but may be missing elsewhere). The default page - size is your system-wide default if libpaper is there, A4 otherwise. - -@item -u unit - Choose the unit used in size specifications. Accepted values - are ``mm'', ``cm'', ``in'' and ``pt''. By default, the program - will check @t{BARCODE_UNIT} in the environment, and assume - points otherwise (this behaviour is compatible with 0.92 and - previous versions. If @t{-u} appears more than once, each - instance will modified the behaviour for the arguments at its - right, as the command line is processes left to right. The - program internally works with points, and any size is - approximated to the nearest multiple of one point. The @t{-u} - option affect @t{-g} (geometry), @t{-t} (table) and @t{-p} - (page size). - -@end table - -%M .SH ENCODING TYPES -%M .PP - -%########################################################################## -@node Supported Encodings, PCL Output, The barcode Executable, Top -@chapter Supported Encodings - -The program encodes text strings passed either on the command line -(with -b) or retrieved from standard input. The text representation is -interpreted according to the following rules. When auto-detection -of the encoding is enabled (i.e, no explicit encoding type is specified), -the encoding types are scanned to find one that can digest the text string. -The following list of supported types is sorted in the same order -the library uses when auto-detecting a suitable encoding for a string. - -@table @var - -@item EAN - The EAN frontend is similar to UPC; it accepts strings of - digits, 12 or 7 characters long. Strings of 13 or 8 characters - are accepted if the provided checksum digit is correct. - I expect most users to feed input without a - checksum, though. The add-2 and add-5 extension are accepted for both - the EAN-13 and the EAN-8 encodings. - The following are example of valid input strings: - ``@t{123456789012}'' (EAN-13), ``@t{1234567890128}'' (EAN-13 wih - checksum), ``@t{1234567}'' (EAN-8), ``@t{12345670 12345}'' (EAN-8 - with checksum and add-5), - ``@t{123456789012 12}'' (EAN-13 with add-2), - ``@t{123456789012 12345}'' (EAN-13 with add-5). - -@item UPC - The UPC frontend accepts only strings made up of digits (and, - if a supplemental encoding is used, a blank to separate it). - It accepts strings of 11 or 12 digits (UPC-A) and 6 or 7 or 8 - digits (UPC-E). - - The 12th digit of UPC-A is the checksum and is added by the - library if not specified in the input; if it is specified, it - must be the right checksum or the code is rejected as invalid. - For UPC-E, 6 digit are considered to be the middle part of the - code, a leading 0 is assumed and the checksum is added; - 7 digits are either considered the initial part (leading digit - 0 or 1, checksum missing) or the final part (checksum specified, - leading 0 assumed); 8 digits are considered to be the complete code, - with leading 0 or 1 and checksum. - For both UPC-A and UPC-E, a trailing string of 2 digits or 5 digits - is accepted as well. Therefore, the following are examples - of valid strings that can be encoded as UPC: - ``@t{01234567890}'' (UPC-A) - ``@t{012345678905}'' (UPC-A with checksum), ``@t{012345}'' - (UPC-E), ``@t{01234567890 12}'' (UPC-A, add-2) and - ``@t{01234567890 12345}'' (UPC-A, add-5), ``@t{0123456 12}'' - (UPC-E, add-2). - Please note that when setting @t{BARCODE_ANY} to auto-detect - the encoding to be used, 12-digit strings and 7-digit strings - will always be identified as EAN. This because I expect most - user to provide input without a checksum. If you need to - specify UPC-with-checksum as input you must explicitly set - @t{BARCODE_UPC} as a flag or use @t{-e upc} on the command line. - -@item ISBN - ISBN numbers are encoded as EAN-13 symbols, with an optional - add-5 trailer. The ISBN frontend of the library accepts real - ISBN numbers and deals with any hyphen and, if present, the - ISBN checksum character before encoding data. Valid - representations for ISBN strings are for example: - ``@t{1-56592-292-1}'', ``@t{3-89721-122-X}'' and ``@t{3-89721-122-X - 06900}''. - -@item code 128-B - This encoding can represent all of the printing ASCII - characters, from the space (32) to DEL (127). The checksum - digit is mandatory in this encoding. - -@item code 128-C - The ``C'' variation of Code-128 uses Code-128 symbols to - represent two digits at a time (Code-128 is made up of 104 - symbols whose interpretation is controlled by the start symbol - being used). Code 128-C is thus the most compact way to - represent any even number of digits. The encoder refuses to - deal with an odd number of digits because the caller is - expected to provide proper padding to an even number of - digits. (Since Code-128 includes control symbols to switch - charset, it is theoretically possible to represent the odd - digit as a Code 128-A or 128-B symbol, but this tool doesn't - currently implement this option). - -@item code 128 raw - Code-128 output represented symbol-by-symbol in the input - string. To override part of the problems outlined below in - specifying code128 symbols, this pseudo-encoding allows the - used to specify a list of code128 symbols separated by - spaces. Each symbol is represented by a number in the range - 0-105. The list should include the leading character.The - checksum and the stop character are automatically added by the - library. Most likely this pseudo-encoding will be used with - @t{BARCODE_NO_ASCII} and some external program to supply the - printed text. - -@item code 39 - The code-39 standard can encode uppercase letters, digits, the - blank space, plus, minus, dot, star, dollar, slash, percent. - Any string that is only composed of such characters is - accepted by the code-39 encoder. To avoid loosing information, - the encoder refuses to encode mixed-case strings (a lowercase - string is nonetheless accepted as a shortcut, but is encoded - as uppercase). - -@item interleaved 2 of 5 - This encoding can only represent an even number of digits - (odd digits are represented by bars, and even digits by the - interleaving spaces). The name stresses the fact that two - of the five items (bars or spaces) allocated to each symbol - are wide, while the rest are narrow. The checksum digit is - optional (can be disabled via @t{BARCODE_NO_CHECKSUM}). - Since the number of digits, including the checksum, must be even, - a leading zero is inserted in the string being encoded if needed - (this is specifically stated in the specs I have access to). - -@item code 128 - Automatic selection between alphabet A, B and C of the Code-128 - standard. This encoding can represent all ASCII symbols, from - 0 (NUL) to 127 (DEL), as well as four special symbols, named - F1, F2, F3, F4. The set of symbols available in this encoding - is not easily represented as input to the @i{barcode} library, - so the following convention is used. In the input string, - which is a C-language null-terminated string, the NUL char - is represented by the value 128 (0x80, 0200) and the F1-F4 characters - are represented by the values 193-196 (0xc1-0xc4, 0301-0304). - The values have been chosen to ease their representation as - escape sequences. - - Since the shell doesn't seem to interpret escape sequences on the - command line, the "-b" option cannot be easily used to designate - the strings to be encoded. As a workaround you can resort - to the command @t{echo}, either within back-ticks or used - separately to create a file that is then fed to the standard-input - of @i{barcode} -- assuming your @t{echo} command processes escape - sequences. The newline character is especially though to encode - (but not impossible unless you use a @t{csh} variant. - - These problems only apply to the command-line tool; the use of - library functions doesn't give any problem. In needed, you can - use the ``@i{code 128 raw}'' pseudo-encoding to represent - code128 symbols by their numerical value. This encoding is - used late in the auto-selection mechanism because (almost) any - input string can be represented using code128. - -@item Codabar - Codabar can encode the ten digits and a few special symbols - (minus, plus, dollar, colon, bar, dot). The characters - ``@t{A}'', ``@t{B}'', ``@t{C}'' and ``@t{D}'' are used to - represent four different start/stop characters. The input - string to the barcode library can include the start and stop - characters or not include them (in which case ``@t{A}'' is - used as start and ``@t{B}'' as stop). Start and stop - characters in the input string can be either all lowercase or - all uppercase and are always printed as uppercase. - -@item Plessey - Plessey barcodes can encode all the hexadecimal - digits. Alphabetic digits in the input string must either be - all lowercase or all uppercase. The output text is always - uppercase. - -@item MSI - MSI can only encode the decimal digits. While the standard - specifies either one or two check digits, the current - implementation in this library only generates one check digit. - -@item code 93 - The code-93 standard can natively encode 48 different characters, - including uppercase letters, digits, the blank space, plus, minus, - dot, star, dollar, slash, percent, as well as five special - characters: a start/stop delimiter and four "shift characters" used - for extended encoding. Using this "extended encoding" method, any - standard 7-bit ASCII character can be encoded, but it takes up two - symbol lengths in barcode if the character is not natively supported - (one of the 48). - The encoder here fully implements the code 93 encoding standard. - Any characters natively supported (A-Z, 0-9, ".+-/$&%") will be - encoded as such - for any other characters (such as lower case - letters, brackets, parentheses, etc.), the encoder will revert - to extended encoding. - As a note, the option to exclude the checksum will eliminate the - two modulo-47 checksums (called C and K) from the barcode, but this - probably will make it unreadable by 99% of all scanning systems. - These checksums are specified to be used at the firmware level, - and their absence will be interpreted as an invalid barcode. - - -@end table - -%M .SH PCL OUTPUT - -%########################################################################## -@node PCL Output, Bugs and Pending Issues, Supported Encodings, Top -@chapter PCL Output - -While the default output is Postscript (possibly EPS), and Postscript -can be post-processed to almost anything, it is sometimes desirable to -create output directly usable by the specific printer at hand. -PCL is currently supported as an output format for this reason. -Please note that the Y coordinate for PCL goes from top to bottom, while -for Postscript it goes from bottom to top. Consistently, while in -Postscript you specify the bottom-left corner as origin, for PCL -you specify the top-left corner. - -Barcode output for PCL Printers (HP LaserJet and compatibles), -was developed using PCL5 Reference manuals from HP. -that really refers to these printers: -@itemize @bullet - -@item -LaserJet III, III P, III D, III Si, - -@item -LaserJet 4 family - -@item -LaserJet 5 family - -@item -LaserJet 6 family - -@item -Color LaserJet - -@item -DeskJet 1200 and 1600. - -@end itemize - -However, barcode printing uses a very small subset of PCL, probably also -LaserJet II should print it without problem, but the resulting text may -be horrible. - -The only real difference from one printer to another really depends on -which font are available in the printer, used in printing the label -associated to the bars (if requested). - -Earlier LaserJet supports only bitmaps fonts, so these are not -"scalable". (Ljet II ?), Also these fonts, when available, have a -specified direction, and not all of them are available in -both Portrait and Landscape mode. - -From LaserJet 4 series, (except 4L/5L that are entry-level printers), -Arial scalable font should be available, so it's the "default font" -used by this program. - -LaserJet III series printers (and 4L, 5L), don't feature "Arial" as a -resident font, so you should use @t{BARCODE_OUT_PCL_III} instead of -@t{BARCODE_OUT_PCL.}, and font the font used will be "Univers" instead -of "Arial". - -Results on compatible printers, may depend on consistency of -PCL5 compatibility, in doubt, try BARCODE_OUT_PCL_III - -PJL commands are not used here, as it's not very compatible. - - -Tested Printers: -@itemize @bullet -@item -Hp LaserJet 4050 -@item -Hp LaserJet 2100 -@item -Epson N-1200 emul PCL -@item -Toshiba DP2570 (copier) + PCL option -@item -Epson EPL-7100 emul. HP LaserJet II: bars print fine but text is bad. -@end itemize - - -%M .SH BUGS - -%########################################################################## -@node Bugs and Pending Issues, , PCL Output, Top -@chapter Bugs and Pending Issues. - -The current management of borders/margins is far from optimal. The -``default'' margin applied by the library interferes with the external -representation, but I feel it is mandatory to avoid creating barcode -output with no surrounding white space (the problem is especially -relevant for EPS output). - -EAN-128 is not (yet) supported. I plan to implement it pretty soon and -then bless the package as version 1.0. - -%M .SH "SEE ALSO" -%M \fBbarcode(3)\fP -%M -%M .SH AUTHORS -%M Alessandro Rubini (maintainer) -%M .PP -%M Leonid A. Broukhis (several encodings) -%M .PP -%M Andrea Scopece (PCL output) -%MANPAGE END - -@iftex -@contents -@end iftex - -@bye -@c LocalWords: barcode ifinfo titlepage iftex texinfo ascii frontend LGPL -@c LocalWords: tarball malloced textinfo scalef isbn Plessey codabar GPL Ljet -@c LocalWords: LocalWords LaserJet Univers Arial Debian libpaper pagesize -@c LocalWords: Epson MANPAGE stderr barcodes emul DeskJet xmargin ymargin -@c LocalWords: leftmargin rightmargin topmargin bottommargin unset struct -@c LocalWords: NOHEADERS yoff xoff versionname errno malloc behaviour charset diff --git a/glabels2/barcode-0.98/doc/infofilter b/glabels2/barcode-0.98/doc/infofilter deleted file mode 100755 index 92bc8b7d..00000000 --- a/glabels2/barcode-0.98/doc/infofilter +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/sed -f - - -# allow "%" as a comment char, but only at the beginning of the line -s/^%/@c / -#s/[^\\]%.*$// -s/^\\%/%/ - -#preserve blanks in @lisp blocks -/@lisp/,/@end lisp/ p -/@lisp/,/@end lisp/ d - -# remove leading blanks -s/^[ ]*// - -#s/\\t/@code/g diff --git a/glabels2/barcode-0.98/doc/manpager b/glabels2/barcode-0.98/doc/manpager deleted file mode 100755 index 46de5be2..00000000 --- a/glabels2/barcode-0.98/doc/manpager +++ /dev/null @@ -1,120 +0,0 @@ -#! /usr/bin/awk -f -# Copyright (c) 1998-2001 Alessandro Rubini - -BEGIN {IN=0} - -/^%MANPAGE END/ {IN=0; next} -/^%MANPAGE/ {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next} -IN==0 {next} - -/^%MSKIP/ {SKIP=1;next} -/^%M/ {SKIP=0} - -/^@menu/ {SKIP=1;next} -/^@end menu/ {SKIP=0;next} - -SKIP==1 {next} -/^%M$/ {next} -/^@ignore/ {next} -/^@end ign/ {next} - -#now perform all the substitutions needed - - { gsub("^%M ?",""); } - -# Use gensub for converting tags: itz Sep 30 1998 -# -# However, the gensub function is gawk-specific, and we want things -# to work with original-awk too (for portability). -# Therefore, use a normal gsub, even though it's a subobptimal solution -# as it may step in extra braces. The good solution will be piping to sed, -# or match, extract subesxpression, replace, reinsert -- bleah... -# (ARub, Oct 10 2000) -/@b\{/ { - #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g"); - gsub("@b\{","\\fB"); - gsub("\}","\\fP"); -} - -/@var\{/ { - #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g"); - gsub("@var\{","\\fB"); - gsub("\}","\\fP"); -} - -/@(samp|code|file)\{/ { - #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g"); - gsub("@(samp|code|file)\{",""); - gsub("\}",""); -} - - -/@xref\{.*\}\./ { - gsub(/@xref\{.*\}\./,""); -} - -/@ref\{.*\}/ { - gsub("@ref\{",""); - gsub("\}",""); -} - -/@\*/ { - gsub(/@\* */,"\n.br\n"); -} - -/@[a-z]+\{/ { - gsub("@[a-z]+\\{",""); - gsub("}",""); - } - -/^@table/ { TABLE=1; } -/^@itemize/ { TABLE=1; next} - -/^@item/ { - gsub("^@item *",""); - printf ".TP\n%s\n",$0 > NAME; - NEEDLP=0; next; - } - -/^@end table/ {TABLE=0} -/^@end itemize/ {TABLE=0} - -# discard other texinfo commands - -/^@/ {next} - -# manage comments and '%' - -/^%/ {next} - - - { - gsub("[^\\\\]%.*$",""); - gsub("\\%","%"); - } - -# remove leading blanks - -/^[ \t]/ {gsub("^[ \t]*","");} - -# put a .LP at blank lines - -/^.nf/ {USELP=0} -/^.fi/ {USELP=1} - -/^$/ {if (USELP) {NEEDLP++; next;} } - - -/./ { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } } - -/^.TH/ {USELP=1} - -# Escape single slashes (e.g. in documentation for `-l' command line option) - - {gsub("\\\\ ", "\\\\ ");} - - {gsub("~", "~~");} - - {print > NAME} - - diff --git a/glabels2/barcode-0.98/doc/mktxt b/glabels2/barcode-0.98/doc/mktxt deleted file mode 100755 index bd3f88ba..00000000 --- a/glabels2/barcode-0.98/doc/mktxt +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/awk -f - -# Warning: this may use gnu-awk features - -# Program to create ascii from info; -# Missing: table of contents - -# skip - -BEGIN {NODELINE=0; NODE=0; KEEP=1; printf "\n\n"} - - -/^\037$/ { NODELINE=1; NODE=NODE+1; KEEP=1; next} - -NODE==1 { next } - -NODELINE==1 { - NODELINE=2; - sub("^.*Node: ","*Node: "); - sub(",.*$",""); - printf "\n\n\n%s",$0; -#print - next; - } - -NODELINE { NODELINE=NODELINE+1 } - -NODELINE==4 { printf "\t\t\t\t"; } -NODELINE==5 { printf "\t\t\t\t"; NODELINE=0} - - -/^\* Menu:$/ { KEEP=0 } - - - -KEEP==0 { next } - -{ print } diff --git a/glabels2/barcode-0.98/doc/texi2html b/glabels2/barcode-0.98/doc/texi2html deleted file mode 100755 index 2c61aa93..00000000 --- a/glabels2/barcode-0.98/doc/texi2html +++ /dev/null @@ -1,2021 +0,0 @@ -#!/usr/local/bin/perl -'di '; -'ig 00 '; -#+############################################################################## -# # -# File: texi2html # -# # -# Description: Program to transform most Texinfo documents to HTML # -# # -#-############################################################################## - -# @(#)texi2html 1.51 09/10/96 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch - -# The man page for this program is included at the end of this file and can be -# viewed using the command 'nroff -man texi2html'. -# Please read the copyright at the end of the man page. - -#+++############################################################################ -# # -# Constants # -# # -#---############################################################################ - -$DEBUG_TOC = 1; -$DEBUG_INDEX = 2; -$DEBUG_BIB = 4; -$DEBUG_GLOSS = 8; -$DEBUG_DEF = 16; -$DEBUG_HTML = 32; -$DEBUG_USER = 64; - -$BIBRE = '\[[\w\/]+\]'; # RE for a bibliography reference -$FILERE = '[\/\w.+-]+'; # RE for a file name -$VARRE = '[^\s\{\}]+'; # RE for a variable name -$NODERE = '[^@{}:\'`",]+'; # RE for a node name -$NODESRE = '[^@{}:\'`"]+'; # RE for a list of node names -$XREFRE = '[^@{}]+'; # RE for a xref (should use NODERE) - -$ERROR = "***"; # prefix for errors and warnings -$THISPROG = "texi2html 1.51"; # program name and version -$HOMEPAGE = "http://wwwcn.cern.ch/dci/texi2html/"; # program home page -$TODAY = &pretty_date; # like "20 September 1993" -$SPLITTAG = "\n"; # tag to know where to split -$PROTECTTAG = "_ThisIsProtected_"; # tag to recognize protected sections -$html2_doctype = ''; - -# -# language dependent constants -# -#$LDC_SEE = 'see'; -#$LDC_SECTION = 'section'; -#$LDC_IN = 'in'; -#$LDC_TOC = 'Table of Contents'; -#$LDC_GOTO = 'Go to the'; -#$LDC_FOOT = 'Footnotes'; -# TODO: @def* shortcuts - -# -# pre-defined indices -# -%predefined_index = ( - 'cp', 'c', - 'fn', 'f', - 'vr', 'v', - 'ky', 'k', - 'pg', 'p', - 'tp', 't', - ); - -# -# valid indices -# -%valid_index = ( - 'c', 1, - 'f', 1, - 'v', 1, - 'k', 1, - 'p', 1, - 't', 1, - ); - -# -# texinfo section names to level -# -%sec2level = ( - 'top', 0, - 'chapter', 1, - 'unnumbered', 1, - 'majorheading', 1, - 'chapheading', 1, - 'appendix', 1, - 'section', 2, - 'unnumberedsec', 2, - 'heading', 2, - 'appendixsec', 2, - 'appendixsection', 2, - 'subsection', 3, - 'unnumberedsubsec', 3, - 'subheading', 3, - 'appendixsubsec', 3, - 'subsubsection', 4, - 'unnumberedsubsubsec', 4, - 'subsubheading', 4, - 'appendixsubsubsec', 4, - ); - -# -# accent map, TeX command to ISO name -# -%accent_map = ( - '"', 'uml', - '~', 'tilde', - '^', 'circ', - '`', 'grave', - '\'', 'acute', - ); - -# -# texinfo "simple things" (@foo) to HTML ones -# -%simple_map = ( - # cf. makeinfo.c - "*", "
    ", # HTML+ - " ", " ", - "\n", "\n", - "|", "", - # spacing commands - ":", "", - "!", "!", - "?", "?", - ".", ".", - ); - -# -# texinfo "things" (@foo{}) to HTML ones -# -%things_map = ( - 'TeX', 'TeX', - 'br', '

    ', # paragraph break - 'bullet', '*', - 'copyright', '(C)', - 'dots', '...', - 'equiv', '==', - 'error', 'error-->', - 'expansion', '==>', - 'minus', '-', - 'point', '-!-', - 'print', '-|', - 'result', '=>', - 'today', $TODAY, - ); - -# -# texinfo styles (@foo{bar}) to HTML ones -# -%style_map = ( - 'asis', '', - 'b', 'B', - 'cite', 'CITE', - 'code', 'CODE', - 'ctrl', '&do_ctrl', # special case - 'dfn', 'STRONG', # DFN tag is illegal in the standard - 'dmn', '', # useless - 'emph', 'EM', - 'file', '"TT', # will put quotes, cf. &apply_style - 'i', 'I', - 'kbd', 'KBD', - 'key', 'KBD', - 'r', '', # unsupported - 'samp', '"SAMP', # will put quotes, cf. &apply_style - 'sc', '&do_sc', # special case - 'strong', 'STRONG', - 't', 'TT', - 'titlefont', '', # useless - 'var', 'VAR', - 'w', '', # unsupported - ); - -# -# texinfo format (@foo/@end foo) to HTML ones -# -%format_map = ( - 'display', 'PRE', - 'example', 'PRE', - 'format', 'PRE', - 'lisp', 'PRE', - 'quotation', 'BLOCKQUOTE', - 'smallexample', 'PRE', - 'smalllisp', 'PRE', - # lists - 'itemize', 'UL', - 'enumerate', 'OL', - # poorly supported - 'flushleft', 'PRE', - 'flushright', 'PRE', - ); - -# -# texinfo definition shortcuts to real ones -# -%def_map = ( - # basic commands - 'deffn', 0, - 'defvr', 0, - 'deftypefn', 0, - 'deftypevr', 0, - 'defcv', 0, - 'defop', 0, - 'deftp', 0, - # basic x commands - 'deffnx', 0, - 'defvrx', 0, - 'deftypefnx', 0, - 'deftypevrx', 0, - 'defcvx', 0, - 'defopx', 0, - 'deftpx', 0, - # shortcuts - 'defun', 'deffn Function', - 'defmac', 'deffn Macro', - 'defspec', 'deffn {Special Form}', - 'defvar', 'defvr Variable', - 'defopt', 'defvr {User Option}', - 'deftypefun', 'deftypefn Function', - 'deftypevar', 'deftypevr Variable', - 'defivar', 'defcv {Instance Variable}', - 'defmethod', 'defop Method', - # x shortcuts - 'defunx', 'deffnx Function', - 'defmacx', 'deffnx Macro', - 'defspecx', 'deffnx {Special Form}', - 'defvarx', 'defvrx Variable', - 'defoptx', 'defvrx {User Option}', - 'deftypefunx', 'deftypefnx Function', - 'deftypevarx', 'deftypevrx Variable', - 'defivarx', 'defcvx {Instance Variable}', - 'defmethodx', 'defopx Method', - ); - -# -# things to skip -# -%to_skip = ( - # comments - 'c', 1, - 'comment', 1, - # useless - 'contents', 1, - 'shortcontents', 1, - 'summarycontents', 1, - 'footnotestyle', 1, - 'end ifclear', 1, - 'end ifset', 1, - 'titlepage', 1, - 'end titlepage', 1, - # unsupported commands (formatting) - 'afourpaper', 1, - 'cropmarks', 1, - 'finalout', 1, - 'headings', 1, - 'need', 1, - 'page', 1, - 'setchapternewpage', 1, - 'everyheading', 1, - 'everyfooting', 1, - 'evenheading', 1, - 'evenfooting', 1, - 'oddheading', 1, - 'oddfooting', 1, - 'smallbook', 1, - 'vskip', 1, - 'filbreak', 1, - # unsupported formats - 'cartouche', 1, - 'end cartouche', 1, - 'group', 1, - 'end group', 1, - ); - -#+++############################################################################ -# # -# Argument parsing, initialisation # -# # -#---############################################################################ - -$use_bibliography = 1; -$use_acc = 0; -$debug = 0; -$doctype = ''; -$check = 0; -$expandinfo = 0; -$use_glossary = 0; -$invisible_mark = ''; -$use_iso = 0; -@include_dirs = (); -$show_menu = 0; -$number_sections = 0; -$split_node = 0; -$split_chapter = 0; -$monolithic = 0; -$verbose = 0; -$usage = <= 0 && $ARGV[0] =~ /^-/) { - $_ = shift(@ARGV); - if (/^-acc$/) { $use_acc = 1; next; } - if (/^-d(ebug)?(\d+)?$/) { $debug = $2 || shift(@ARGV); next; } - if (/^-doctype$/) { $doctype = shift(@ARGV); next; } - if (/^-c(heck)?$/) { $check = 1; next; } - if (/^-e(xpandinfo)?$/) { $expandinfo = 1; next; } - if (/^-g(lossary)?$/) { $use_glossary = 1; next; } - if (/^-i(nvisible)?$/) { $invisible_mark = shift(@ARGV); next; } - if (/^-iso$/) { $use_iso = 1; next; } - if (/^-I(.+)?$/) { push(@include_dirs, $1 || shift(@ARGV)); next; } - if (/^-m(enu)?$/) { $show_menu = 1; next; } - if (/^-mono(lithic)?$/) { $monolithic = 1; next; } - if (/^-n(umber)?$/) { $number_sections = 1; next; } - if (/^-s(plit)?_?(n(ode)?|c(hapter)?)?$/) { - if ($2 =~ /^n/) { - $split_node = 1; - } else { - $split_chapter = 1; - } - next; - } - if (/^-v(erbose)?$/) { $verbose = 1; next; } - die $usage; -} -if ($check) { - die $usage unless @ARGV > 0; - ✓ - exit; -} - -if (($split_node || $split_chapter) && $monolithic) { - warn "Can't use -monolithic with -split, -monolithic ignored.\n"; - $monolithic = 0; -} -if ($expandinfo) { - $to_skip{'ifinfo'}++; - $to_skip{'end ifinfo'}++; -} else { - $to_skip{'iftex'}++; - $to_skip{'end iftex'}++; -} -$invisible_mark = '' if $invisible_mark eq 'xbm'; -die $usage unless @ARGV == 1; -$docu = shift(@ARGV); -if ($docu =~ /.*\//) { - chop($docu_dir = $&); - $docu_name = $'; -} else { - $docu_dir = '.'; - $docu_name = $docu; -} -unshift(@include_dirs, $docu_dir); -$docu_name =~ s/\.te?x(i|info)?$//; # basename of the document - -$docu_doc = "$docu_name.html"; # document's contents -if ($monolithic) { - $docu_toc = $docu_foot = $docu_doc; -} else { - $docu_toc = "${docu_name}_toc.html"; # document's table of contents - $docu_foot = "${docu_name}_foot.html"; # document's footnotes -} - -# -# variables -# -%value = (); # hold texinfo variables -$value{'html'} = 1; # predefine html (the output format) -$value{'texi2html'} = '1.51'; # predefine texi2html (the translator) -# _foo: internal to track @foo -foreach ('_author', '_title', '_subtitle', - '_settitle', '_setfilename') { - $value{$_} = ''; # prevent -w warnings -} -%node2sec = (); # node to section name -%node2href = (); # node to HREF -%bib2href = (); # bibliography reference to HREF -%gloss2href = (); # glossary term to HREF -@sections = (); # list of sections -%tag2pro = (); # protected sections - -# -# initial indexes -# -$bib_num = 0; -$foot_num = 0; -$gloss_num = 0; -$idx_num = 0; -$sec_num = 0; -$doc_num = 0; -$html_num = 0; - -# -# can I use ISO8879 characters? (HTML+) -# -if ($use_iso) { - $things_map{'bullet'} = "•"; - $things_map{'copyright'} = "©"; - $things_map{'dots'} = "…"; - $things_map{'equiv'} = "≡"; - $things_map{'expansion'} = "→"; - $things_map{'point'} = "∗"; - $things_map{'result'} = "⇒"; -} - -# -# read texi2html extensions (if any) -# -$extensions = 'texi2html.ext'; # extensions in working directory -if (-f $extensions) { - print "# reading extensions from $extensions\n" if $verbose; - require($extensions); -} -($progdir = $0) =~ s/[^\/]+$//; -if ($progdir && ($progdir ne './')) { - $extensions = "${progdir}texi2html.ext"; # extensions in texi2html directory - if (-f $extensions) { - print "# reading extensions from $extensions\n" if $verbose; - require($extensions); - } -} - -print "# reading from $docu\n" if $verbose; - -#+++############################################################################ -# # -# Pass 1: read source, handle command, variable, simple substitution # -# # -#---############################################################################ - -@lines = (); # whole document -@toc_lines = (); # table of contents -$toplevel = 0; # top level seen in hierarchy -$curlevel = 0; # current level in TOC -$node = ''; # current node name -$in_table = 0; # am I inside a table -$table_type = ''; # type of table ('', 'f', 'v') -@tables = (); # nested table support -$in_bibliography = 0; # am I inside a bibliography -$in_glossary = 0; # am I inside a glossary -$in_top = 0; # am I inside the top node -$in_pre = 0; # am I inside a preformatted section -$in_list = 0; # am I inside a list -$in_html = 0; # am I inside an HTML section -$first_line = 1; # is it the first line -$dont_html = 0; # don't protect HTML on this line -$split_num = 0; # split index -$deferred_ref = ''; # deferred reference for indexes -@html_stack = (); # HTML elements stack -$html_element = ''; # current HTML element -&html_reset; - -# build code for simple substitutions -# the maps used (%simple_map and %things_map) MUST be aware of this -# watch out for regexps, / and escaped characters! -$subst_code = ''; -foreach (keys(%simple_map)) { - ($re = $_) =~ s/(\W)/\\$1/g; # protect regexp chars - $subst_code .= "s/\\\@$re/$simple_map{$_}/g;\n"; -} -foreach (keys(%things_map)) { - $subst_code .= "s/\\\@$_\\{\\}/$things_map{$_}/g;\n"; -} -if ($use_acc) { - # accentuated characters - foreach (keys(%accent_map)) { - if ($_ eq "`") { - $subst_code .= "s/$;3"; - } elsif ($_ eq "'") { - $subst_code .= "s/$;4"; - } else { - $subst_code .= "s/\\\@\\$_"; - } - $subst_code .= "([aeiou])/&\${1}$accent_map{$_};/gi;\n"; - } -} -eval("sub simple_substitutions { $subst_code }"); - -&init_input; -while ($_ = &next_line) { - # - # remove \input on the first lines only - # - if ($first_line) { - next if /^\\input/; - $first_line = 0; - } - # - # parse texinfo tags - # - $tag = ''; - $end_tag = ''; - if (/^\@end\s+(\w+)\b/) { - $end_tag = $1; - } elsif (/^\@(\w+)\b/) { - $tag = $1; - } - # - # handle @ifhtml / @end ifhtml - # - if ($in_html) { - if ($end_tag eq 'ifhtml') { - $in_html = 0; - } else { - $tag2pro{$in_html} .= $_; - } - next; - } elsif ($tag eq 'ifhtml') { - $in_html = $PROTECTTAG . ++$html_num; - push(@lines, $in_html); - next; - } - # - # try to skip the line - # - if ($end_tag) { - next if $to_skip{"end $end_tag"}; - } elsif ($tag) { - next if $to_skip{$tag}; - last if $tag eq 'bye'; - } - if ($in_top) { - # parsing the top node - if ($tag eq 'node' || $tag eq 'include' || $sec2level{$tag}) { - # no more in top - $in_top = 0; - } else { - # skip it - next; - } - } - # - # try to remove inlined comments - # syntax from tex-mode.el comment-start-skip - # - s/((^|[^\@])(\@\@)*)\@c(omment)? .*/$1/; - # non-@ substitutions cf. texinfmt.el - s/``/\"/g; - s/''/\"/g; - s/([\w ])---([\w ])/$1--$2/g; - # - # analyze the tag - # - if ($tag) { - # skip lines - &skip_until($tag), next if $tag eq 'ignore'; - if ($expandinfo) { - &skip_until($tag), next if $tag eq 'iftex'; - } else { - &skip_until($tag), next if $tag eq 'ifinfo'; - } - &skip_until($tag), next if $tag eq 'tex'; - # handle special tables - if ($tag eq 'table') { - $table_type = ''; - } elsif ($tag eq 'ftable') { - $tag = 'table'; - $table_type = 'f'; - } elsif ($tag eq 'vtable') { - $tag = 'table'; - $table_type = 'v'; - } - # special cases - if ($tag eq 'top' || ($tag eq 'node' && /^\@node\s+top\s*,/i)) { - $in_top = 1; - @lines = (); # ignore all lines before top (title page garbage) - next; - } elsif ($tag eq 'node') { - $in_top = 0; - warn "$ERROR Bad node line: $_" unless $_ =~ /^\@node\s$NODESRE$/o; - $_ = &protect_html($_); # if node contains '&' for instance - s/^\@node\s+//; - ($node) = split(/,/); - &normalise_node($node); - if ($split_node) { - &next_doc; - push(@lines, $SPLITTAG) if $split_num++; - push(@sections, $node); - } - next; - } elsif ($tag eq 'include') { - if (/^\@include\s+($FILERE)\s*$/o) { - $file = $1; - unless (-e $file) { - foreach $dir (@include_dirs) { - $file = "$dir/$1"; - last if -e $file; - } - } - if (-e $file) { - &open($file); - print "# including $file\n" if $verbose; - } else { - warn "$ERROR Can't find $file, skipping"; - } - } else { - warn "$ERROR Bad include line: $_"; - } - next; - } elsif ($tag eq 'ifclear') { - if (/^\@ifclear\s+($VARRE)\s*$/o) { - next unless defined($value{$1}); - &skip_until($tag); - } else { - warn "$ERROR Bad ifclear line: $_"; - } - next; - } elsif ($tag eq 'ifset') { - if (/^\@ifset\s+($VARRE)\s*$/o) { - next if defined($value{$1}); - &skip_until($tag); - } else { - warn "$ERROR Bad ifset line: $_"; - } - next; - } elsif ($tag eq 'menu') { - unless ($show_menu) { - &skip_until($tag); - next; - } - &html_push_if($tag); - push(@lines, &html_debug("\n", __LINE__)); - } elsif ($format_map{$tag}) { - $in_pre = 1 if $format_map{$tag} eq 'PRE'; - &html_push_if($format_map{$tag}); - push(@lines, &html_debug("\n", __LINE__)); - $in_list++ if $format_map{$tag} eq 'UL' || $format_map{$tag} eq 'OL' ; - push(@lines, &debug("<$format_map{$tag}>\n", __LINE__)); - next; - } elsif ($tag eq 'table') { - if (/^\@[fv]?table\s+\@(\w+)\s*$/) { - $in_table = $1; - unshift(@tables, join($;, $table_type, $in_table)); - push(@lines, &debug("

    \n", __LINE__)); - &html_push_if('DL'); - push(@lines, &html_debug("\n", __LINE__)); - } else { - warn "$ERROR Bad table line: $_"; - } - next; - } elsif ($tag eq 'synindex' || $tag eq 'syncodeindex') { - if (/^\@$tag\s+(\w)\w\s+(\w)\w\s*$/) { - eval("*${1}index = *${2}index"); - } else { - warn "$ERROR Bad syn*index line: $_"; - } - next; - } elsif ($tag eq 'sp') { - push(@lines, &debug("

    \n", __LINE__)); - next; - } elsif ($tag eq 'setref') { - &protect_html; # if setref contains '&' for instance - if (/^\@$tag\s*{($NODERE)}\s*$/) { - $setref = $1; - $setref =~ s/\s+/ /g; # normalize - $setref =~ s/ $//; - $node2sec{$setref} = $name; - $node2href{$setref} = "$docu_doc#$docid"; - } else { - warn "$ERROR Bad setref line: $_"; - } - next; - } elsif ($tag eq 'defindex' || $tag eq 'defcodeindex') { - if (/^\@$tag\s+(\w\w)\s*$/) { - $valid_index{$1} = 1; - } else { - warn "$ERROR Bad defindex line: $_"; - } - next; - } elsif (defined($def_map{$tag})) { - if ($def_map{$tag}) { - s/^\@$tag\s+//; - $tag = $def_map{$tag}; - $_ = "\@$tag $_"; - $tag =~ s/\s.*//; - } - } elsif (defined($user_sub{$tag})) { - s/^\@$tag\s+//; - $sub = $user_sub{$tag}; - print "# user $tag = $sub, arg: $_" if $debug & $DEBUG_USER; - if (defined(&$sub)) { - chop($_); - &$sub($_); - } else { - warn "$ERROR Bad user sub for $tag: $sub\n"; - } - next; - } - if (defined($def_map{$tag})) { - s/^\@$tag\s+//; - if ($tag =~ /x$/) { - # extra definition line - $tag = $`; - $is_extra = 1; - } else { - $is_extra = 0; - } - while (/\{([^\{\}]*)\}/) { - # this is a {} construct - ($before, $contents, $after) = ($`, $1, $'); - # protect spaces - $contents =~ s/\s+/$;9/g; - # restore $_ protecting {} - $_ = "$before$;7$contents$;8$after"; - } - @args = split(/\s+/, &protect_html($_)); - foreach (@args) { - s/$;9/ /g; # unprotect spaces - s/$;7/\{/g; # ... { - s/$;8/\}/g; # ... } - } - $type = shift(@args); - $type =~ s/^\{(.*)\}$/$1/; - print "# def ($tag): {$type} ", join(', ', @args), "\n" - if $debug & $DEBUG_DEF; - $type .= ':'; # it's nicer like this - $name = shift(@args); - $name =~ s/^\{(.*)\}$/$1/; - if ($is_extra) { - $_ = &debug("

    ", __LINE__); - } else { - $_ = &debug("
    \n
    ", __LINE__); - } - if ($tag eq 'deffn' || $tag eq 'defvr' || $tag eq 'deftp') { - $_ .= "$type $name"; - $_ .= " @args" if @args; - } elsif ($tag eq 'deftypefn' || $tag eq 'deftypevr' - || $tag eq 'defcv' || $tag eq 'defop') { - $ftype = $name; - $name = shift(@args); - $name =~ s/^\{(.*)\}$/$1/; - $_ .= "$type $ftype $name"; - $_ .= " @args" if @args; - } else { - warn "$ERROR Unknown definition type: $tag\n"; - $_ .= "$type $name"; - $_ .= " @args" if @args; - } - $_ .= &debug("\n
    ", __LINE__); - $name = &unprotect_html($name); - if ($tag eq 'deffn' || $tag eq 'deftypefn') { - unshift(@input_spool, "\@findex $name\n"); - } elsif ($tag eq 'defop') { - unshift(@input_spool, "\@findex $name on $ftype\n"); - } elsif ($tag eq 'defvr' || $tag eq 'deftypevr' || $tag eq 'defcv') { - unshift(@input_spool, "\@vindex $name\n"); - } else { - unshift(@input_spool, "\@tindex $name\n"); - } - $dont_html = 1; - } - } elsif ($end_tag) { - if ($format_map{$end_tag}) { - $in_pre = 0 if $format_map{$end_tag} eq 'PRE'; - $in_list-- if $format_map{$end_tag} eq 'UL' || $format_map{$end_tag} eq 'OL' ; - &html_pop_if('LI', 'P'); - &html_pop_if(); - push(@lines, &debug("\n", __LINE__)); - push(@lines, &html_debug("\n", __LINE__)); - } elsif ($end_tag eq 'table' || - $end_tag eq 'ftable' || - $end_tag eq 'vtable') { - shift(@tables); - if (@tables) { - ($table_type, $in_table) = split($;, $tables[0]); - } else { - $in_table = 0; - } - push(@lines, "
    \n"); - &html_pop_if('DD'); - &html_pop_if(); - } elsif (defined($def_map{$end_tag})) { - push(@lines, &debug("
    \n", __LINE__)); - } elsif ($end_tag eq 'menu') { - &html_pop_if(); - push(@lines, $_); # must keep it for pass 2 - } - next; - } - # - # misc things - # - # protect texi and HTML things - &protect_texi; - $_ = &protect_html($_) unless $dont_html; - $dont_html = 0; - # substitution (unsupported things) - s/^\@center\s+//g; - s/^\@exdent\s+//g; - s/\@noindent\s+//g; - s/\@refill\s+//g; - # other substitutions - &simple_substitutions; - s/\@value{($VARRE)}/$value{$1}/eg; - s/\@footnote\{/\@footnote$docu_doc\{/g; # mark footnotes, cf. pass 4 - # - # analyze the tag again - # - if ($tag) { - if (defined($sec2level{$tag}) && $sec2level{$tag} > 0) { - if (/^\@$tag\s+(.+)$/) { - $name = $1; - $name =~ s/\s+$//; - $level = $sec2level{$tag}; - $name = &update_sec_num($tag, $level) . " $name" - if $number_sections && $tag !~ /^unnumbered/; - if ($tag =~ /heading$/) { - push(@lines, &html_debug("\n", __LINE__)); - if ($html_element ne 'body') { - # We are in a nice pickle here. We are trying to get a H? heading - # even though we are not in the body level. So, we convert it to a - # nice, bold, line by itself. - $_ = &debug("\n\n

    $name

    \n\n", __LINE__); - } else { - $_ = &debug("$name\n", __LINE__); - &html_push_if('body'); - } - print "# heading, section $name, level $level\n" - if $debug & $DEBUG_TOC; - } else { - if ($split_chapter) { - unless ($toplevel) { - # first time we see a "section" - unless ($level == 1) { - warn "$ERROR The first section found is not of level 1: $_"; - warn "$ERROR I'll split on sections of level $level...\n"; - } - $toplevel = $level; - } - if ($level == $toplevel) { - &next_doc; - push(@lines, $SPLITTAG) if $split_num++; - push(@sections, $name); - } - } - $sec_num++; - $docid = "SEC$sec_num"; - $tocid = "TOC$sec_num"; - # check biblio and glossary - $in_bibliography = ($name =~ /^([A-Z]|\d+)?(\.\d+)*\s*bibliography$/i); - $in_glossary = ($name =~ /^([A-Z]|\d+)?(\.\d+)*\s*glossary$/i); - # check node - if ($node) { - if ($node2sec{$node}) { - warn "$ERROR Duplicate node found: $node\n"; - } else { - $node2sec{$node} = $name; - $node2href{$node} = "$docu_doc#$docid"; - print "# node $node, section $name, level $level\n" - if $debug & $DEBUG_TOC; - } - $node = ''; - } else { - print "# no node, section $name, level $level\n" - if $debug & $DEBUG_TOC; - } - # update TOC - while ($level > $curlevel) { - $curlevel++; - push(@toc_lines, "
      \n"); - } - while ($level < $curlevel) { - $curlevel--; - push(@toc_lines, "
    \n"); - } - $_ = "
  • " . &anchor($tocid, "$docu_doc#$docid", $name, 1); - push(@toc_lines, &substitute_style($_)); - # update DOC - push(@lines, &html_debug("\n", __LINE__)); - &html_reset; - $_ = "".&anchor($docid, "$docu_toc#$tocid", $name)."\n"; - $_ = &debug($_, __LINE__); - push(@lines, &html_debug("\n", __LINE__)); - } - # update DOC - foreach $line (split(/\n+/, $_)) { - push(@lines, "$line\n"); - } - next; - } else { - warn "$ERROR Bad section line: $_"; - } - } else { - # track variables - $value{$1} = $2, next if /^\@set\s+($VARRE)\s+(.*)$/o; - delete $value{$1}, next if /^\@clear\s+($VARRE)\s*$/o; - # store things - $value{'_setfilename'} = $1, next if /^\@setfilename\s+(.*)$/; - $value{'_settitle'} = $1, next if /^\@settitle\s+(.*)$/; - $value{'_author'} .= "$1\n", next if /^\@author\s+(.*)$/; - $value{'_subtitle'} .= "$1\n", next if /^\@subtitle\s+(.*)$/; - $value{'_title'} .= "$1\n", next if /^\@title\s+(.*)$/; - # index - if (/^\@(..?)index\s+/) { - unless ($valid_index{$1}) { - warn "$ERROR Undefined index command: $_"; - next; - } - $id = 'IDX' . ++$idx_num; - $index = $1 . 'index'; - $what = &substitute_style($'); - $what =~ s/\s+$//; - print "# found $index for '$what' id $id\n" - if $debug & $DEBUG_INDEX; - eval(<\n", __LINE__)); - push(@lines, &anchor($id, '', $invisible_mark, !$in_pre)); - &html_push('P'); - } elsif ($html_element eq 'DL' || - $html_element eq 'UL' || - $html_element eq 'OL' ) { - $deferred_ref .= &anchor($id, '', $invisible_mark, !$in_pre) . " "; - } - next; - } - # list item - if (/^\@itemx?\s+/) { - $what = $'; - $what =~ s/\s+$//; - if ($in_bibliography && $use_bibliography) { - if ($what =~ /^$BIBRE$/o) { - $id = 'BIB' . ++$bib_num; - $bib2href{$what} = "$docu_doc#$id"; - print "# found bibliography for '$what' id $id\n" - if $debug & $DEBUG_BIB; - $what = &anchor($id, '', $what); - } - } elsif ($in_glossary && $use_glossary) { - $id = 'GLOSS' . ++$gloss_num; - $entry = $what; - $entry =~ tr/A-Z/a-z/ unless $entry =~ /^[A-Z\s]+$/; - $gloss2href{$entry} = "$docu_doc#$id"; - print "# found glossary for '$entry' id $id\n" - if $debug & $DEBUG_GLOSS; - $what = &anchor($id, '', $what); - } - &html_pop_if('P'); - if ($html_element eq 'DL' || $html_element eq 'DD') { - if ($things_map{$in_table} && !$what) { - # special case to allow @table @bullet for instance - push(@lines, &debug("
    $things_map{$in_table}\n", __LINE__)); - } else { - push(@lines, &debug("
    \@$in_table\{$what\}\n", __LINE__)); - } - push(@lines, "
    "); - &html_push('DD') unless $html_element eq 'DD'; - if ($table_type) { # add also an index - unshift(@input_spool, "\@${table_type}index $what\n"); - } - } else { - push(@lines, &debug("
  • $what\n", __LINE__)); - &html_push('LI') unless $html_element eq 'LI'; - } - push(@lines, &html_debug("\n", __LINE__)); - if ($deferred_ref) { - push(@lines, &debug("$deferred_ref\n", __LINE__)); - $deferred_ref = ''; - } - next; - } - } - } - # paragraph separator - if ($_ eq "\n") { - next if $#lines >= 0 && $lines[$#lines] eq "\n"; - if ($html_element eq 'P') { - push(@lines, "\n"); - $_ = &debug("

    \n", __LINE__); - &html_pop; - } - } elsif ($html_element eq 'body' || $html_element eq 'BLOCKQUOTE') { - push(@lines, "

    \n"); - &html_push('P'); - $_ = &debug($_, __LINE__); - } - # otherwise - push(@lines, $_); -} - -# finish TOC -$level = 0; -while ($level < $curlevel) { - $curlevel--; - push(@toc_lines, "\n"); -} - -print "# end of pass 1\n" if $verbose; - -#+++############################################################################ -# # -# Pass 2/3: handle style, menu, index, cross-reference # -# # -#---############################################################################ - -@lines2 = (); # whole document (2nd pass) -@lines3 = (); # whole document (3rd pass) -$in_menu = 0; # am I inside a menu - -while (@lines) { - $_ = shift(@lines); - # - # special case (protected sections) - # - if (/^$PROTECTTAG/o) { - push(@lines2, $_); - next; - } - # - # menu - # - $in_menu = 1, push(@lines2, &debug("

      \n", __LINE__)), next if /^\@menu\b/; - $in_menu = 0, push(@lines2, &debug("
    \n", __LINE__)), next if /^\@end\s+menu\b/; - if ($in_menu) { - if (/^\*\s+($NODERE)::/o) { - $descr = $'; - chop($descr); - &menu_entry($1, $1, $descr); - } elsif (/^\*\s+(.+):\s+([^\t,\.\n]+)[\t,\.\n]/) { - $descr = $'; - chop($descr); - &menu_entry($1, $2, $descr); - } elsif (/^\*/) { - warn "$ERROR Bad menu line: $_"; - } else { # description continued? - push(@lines2, $_); - } - next; - } - # - # printindex - # - if (/^\@printindex\s+(\w\w)\b/) { - local($index, *ary, @keys, $key, $letter, $last_letter, @refs); - if ($predefined_index{$1}) { - $index = $predefined_index{$1} . 'index'; - } else { - $index = $1 . 'index'; - } - eval("*ary = *$index"); - @keys = keys(%ary); - foreach $key (@keys) { - $_ = $key; - 1 while s/<(\w+)>\`(.*)\'<\/\1>/$2/; # remove HTML tags with quotes - 1 while s/<(\w+)>(.*)<\/\1>/$2/; # remove HTML tags - $_ = &unprotect_html($_); - &unprotect_texi; - tr/A-Z/a-z/; # lowercase - $key2alpha{$key} = $_; - print "# index $key sorted as $_\n" - if $key ne $_ && $debug & $DEBUG_INDEX; - } - $last_letter = undef; - foreach $key (sort byalpha @keys) { - $letter = substr($key2alpha{$key}, 0, 1); - $letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;; - if (!defined($last_letter) || $letter ne $last_letter) { - push(@lines2, "\n") if defined($last_letter); - push(@lines2, "

    " . &protect_html($letter) . "

    \n"); - push(@lines2, "\n"); - $last_letter = $letter; - } - @refs = (); - foreach (split(/$;/, $ary{$key})) { - push(@refs, &anchor('', $_, $key, 0)); - } - push(@lines2, "
  • " . join(", ", @refs) . "\n"); - } - push(@lines2, "
  • \n") if defined($last_letter); - next; - } - # - # simple style substitutions - # - $_ = &substitute_style($_); - # - # xref - # - while (/\@(x|px|info|)ref{($XREFRE)(}?)/o) { - # note: Texinfo may accept other characters - ($type, $nodes, $full) = ($1, $2, $3); - ($before, $after) = ($`, $'); - if (! $full && $after) { - warn "$ERROR Bad xref (no ending } on line): $_"; - $_ = "$before$;0${type}ref\{$nodes$after"; - next; # while xref - } - if ($type eq 'x') { - $type = 'See '; - } elsif ($type eq 'px') { - $type = 'see '; - } elsif ($type eq 'info') { - $type = 'See Info'; - } else { - $type = ''; - } - unless ($full) { - $next = shift(@lines); - $next = &substitute_style($next); - chop($nodes); # remove final newline - if ($next =~ /\}/) { # split on 2 lines - $nodes .= " $`"; - $after = $'; - } else { - $nodes .= " $next"; - $next = shift(@lines); - $next = &substitute_style($next); - chop($nodes); - if ($next =~ /\}/) { # split on 3 lines - $nodes .= " $`"; - $after = $'; - } else { - warn "$ERROR Bad xref (no ending }): $_"; - $_ = "$before$;0xref\{$nodes$after"; - unshift(@lines, $next); - next; # while xref - } - } - } - $nodes =~ s/\s+/ /g; # remove useless spaces - @args = split(/\s*,\s*/, $nodes); - $node = $args[0]; # the node is always the first arg - &normalise_node($node); - $sec = $node2sec{$node}; - if (@args == 5) { # reference to another manual - $sec = $args[2] || $node; - $man = $args[4] || $args[3]; - $_ = "${before}${type}section `$sec' in \@cite{$man}$after"; - } elsif ($type =~ /Info/) { # inforef - warn "$ERROR Wrong number of arguments: $_" unless @args == 3; - ($nn, $_, $in) = @args; - $_ = "${before}${type} file `$in', node `$nn'$after"; - } elsif ($sec) { - $href = $node2href{$node}; - $_ = "${before}${type}section " . &anchor('', $href, $sec) . $after; - } else { - warn "$ERROR Undefined node ($node): $_"; - $_ = "$before$;0xref{$nodes}$after"; - } - } - # - # try to guess bibliography references or glossary terms - # - unless (/^
    /) { - $done .= $pre . &anchor('', $href, $what); - } else { - $done .= "$pre$what"; - } - $_ = $post; - } - $_ = $done . $_; - } - if ($use_glossary) { - $done = ''; - while (/\b\w+\b/) { - ($pre, $what, $post) = ($`, $&, $'); - $entry = $what; - $entry =~ tr/A-Z/a-z/ unless $entry =~ /^[A-Z\s]+$/; - $href = $gloss2href{$entry}; - if (defined($href) && $post !~ /^[^<]*<\/A>/) { - $done .= $pre . &anchor('', $href, $what); - } else { - $done .= "$pre$what"; - } - $_ = $post; - } - $_ = $done . $_; - } - } - # otherwise - push(@lines2, $_); -} -print "# end of pass 2\n" if $verbose; - -# -# split style substitutions -# -while (@lines2) { - $_ = shift(@lines2); - # - # special case (protected sections) - # - if (/^$PROTECTTAG/o) { - push(@lines3, $_); - next; - } - # - # split style substitutions - # - $old = ''; - while ($old ne $_) { - $old = $_; - if (/\@(\w+)\{/) { - ($before, $style, $after) = ($`, $1, $'); - if (defined($style_map{$style})) { - $_ = $after; - $text = ''; - $after = ''; - $failed = 1; - while (@lines2) { - if (/\}/) { - $text .= $`; - $after = $'; - $failed = 0; - last; - } else { - $text .= $_; - $_ = shift(@lines2); - } - } - if ($failed) { - die "* Bad syntax (\@$style) after: $before\n"; - } else { - $text = &apply_style($style, $text); - $_ = "$before$text$after"; - } - } - } - } - # otherwise - push(@lines3, $_); -} -print "# end of pass 3\n" if $verbose; - -#+++############################################################################ -# # -# Pass 4: foot notes, final cleanup # -# # -#---############################################################################ - -@foot_lines = (); # footnotes -@doc_lines = (); # final document -$end_of_para = 0; # true if last line is

    - -while (@lines3) { - $_ = shift(@lines3); - # - # special case (protected sections) - # - if (/^$PROTECTTAG/o) { - push(@doc_lines, $_); - $end_of_para = 0; - next; - } - # - # footnotes - # - while (/\@footnote([^\{\s]+)\{/) { - ($before, $d, $after) = ($`, $1, $'); - $_ = $after; - $text = ''; - $after = ''; - $failed = 1; - while (@lines3) { - if (/\}/) { - $text .= $`; - $after = $'; - $failed = 0; - last; - } else { - $text .= $_; - $_ = shift(@lines3); - } - } - if ($failed) { - die "* Bad syntax (\@footnote) after: $before\n"; - } else { - $foot_num++; - $docid = "DOCF$foot_num"; - $footid = "FOOT$foot_num"; - $foot = "($foot_num)"; - push(@foot_lines, "

    " . &anchor($footid, "$d#$docid", $foot) . "

    \n"); - $text = "

    $text" unless $text =~ /^\s*

    /; - push(@foot_lines, "$text\n"); - $_ = $before . &anchor($docid, "$docu_foot#$footid", $foot) . $after; - } - } - # - # remove unnecessary

    - # - if (/^\s*

    \s*$/) { - next if $end_of_para++; - } else { - $end_of_para = 0; - } - # otherwise - push(@doc_lines, $_); -} -print "# end of pass 4\n" if $verbose; - -#+++############################################################################ -# # -# Pass 5: print things # -# # -#---############################################################################ - -$header = < -EOT - -$full_title = $value{'_title'} || $value{'_settitle'} || "Untitled Document"; -$title = $value{'_settitle'} || $full_title; -$_ = &substitute_style($full_title); -&unprotect_texi; -s/\n$//; # rmv last \n (if any) -$full_title = "

    " . join("

    \n

    ", split(/\n/, $_)) . "

    \n"; - -# -# print ToC -# -if (!$monolithic && @toc_lines) { - if (open(FILE, "> $docu_toc")) { - print "# creating $docu_toc...\n" if $verbose; - &print_toplevel_header("$title - Table of Contents"); - &print_ruler; - &print(*toc_lines, FILE); - &print_toplevel_footer; - close(FILE); - } else { - warn "$ERROR Can't write to $docu_toc: $!\n"; - } -} - -# -# print footnotes -# -if (!$monolithic && @foot_lines) { - if (open(FILE, "> $docu_foot")) { - print "# creating $docu_foot...\n" if $verbose; - &print_toplevel_header("$title - Footnotes"); - &print_ruler; - &print(*foot_lines, FILE); - &print_toplevel_footer; - close(FILE); - } else { - warn "$ERROR Can't write to $docu_foot: $!\n"; - } -} - -# -# print document -# -if ($split_chapter || $split_node) { # split - $doc_num = 0; - $last_num = scalar(@sections); - $first_doc = &doc_name(1); - $last_doc = &doc_name($last_num); - while (@sections) { - $section = shift(@sections); - &next_doc; - if (open(FILE, "> $docu_doc")) { - print "# creating $docu_doc...\n" if $verbose; - &print_header("$title - $section"); - $prev_doc = ($doc_num == 1 ? undef : &doc_name($doc_num - 1)); - $next_doc = ($doc_num == $last_num ? undef : &doc_name($doc_num + 1)); - $navigation = "Go to the "; - $navigation .= ($prev_doc ? &anchor('', $first_doc, "first") : "first"); - $navigation .= ", "; - $navigation .= ($prev_doc ? &anchor('', $prev_doc, "previous") : "previous"); - $navigation .= ", "; - $navigation .= ($next_doc ? &anchor('', $next_doc, "next") : "next"); - $navigation .= ", "; - $navigation .= ($next_doc ? &anchor('', $last_doc, "last") : "last"); - $navigation .= " section, " . &anchor('', $docu_toc, "table of contents") . ".\n"; - print FILE $navigation; - &print_ruler; - # find corresponding lines - @tmp_lines = (); - while (@doc_lines) { - $_ = shift(@doc_lines); - last if ($_ eq $SPLITTAG); - push(@tmp_lines, $_); - } - &print(*tmp_lines, FILE); - &print_ruler; - print FILE $navigation; - &print_footer; - close(FILE); - } else { - warn "$ERROR Can't write to $docu_doc: $!\n"; - } - } -} else { # not split - if (open(FILE, "> $docu_doc")) { - print "# creating $docu_doc...\n" if $verbose; - if ($monolithic || !@toc_lines) { - &print_toplevel_header($title); - } else { - &print_header($title); - print FILE $full_title; - } - if ($monolithic && @toc_lines) { - &print_ruler; - print FILE "

    Table of Contents

    \n"; - &print(*toc_lines, FILE); - } - &print_ruler; - &print(*doc_lines, FILE); - if ($monolithic && @foot_lines) { - &print_ruler; - print FILE "

    Footnotes

    \n"; - &print(*foot_lines, FILE); - } - if ($monolithic || !@toc_lines) { - &print_toplevel_footer; - } else { - &print_footer; - } - close(FILE); - } else { - warn "$ERROR Can't write to $docu_doc: $!\n"; - } -} - -print "# that's all folks\n" if $verbose; - -#+++############################################################################ -# # -# Low level functions # -# # -#---############################################################################ - -sub update_sec_num { - local($name, $level) = @_; - - $level--; # here we start at 0 - if ($name =~ /^appendix/) { - # appendix style - if (defined(@appendix_sec_num)) { - &incr_sec_num($level, @appendix_sec_num); - } else { - @appendix_sec_num = ('A', 0, 0, 0); - } - return(join('.', @appendix_sec_num[0..$level])); - } else { - # normal style - if (defined(@normal_sec_num)) { - &incr_sec_num($level, @normal_sec_num); - } else { - @normal_sec_num = (1, 0, 0, 0); - } - return(join('.', @normal_sec_num[0..$level])); - } -} - -sub incr_sec_num { - local($level, $l); - $level = shift(@_); - $_[$level]++; - foreach $l ($level+1 .. 3) { - $_[$l] = 0; - } -} - -sub check { - local($_, %seen, %context, $before, $match, $after); - - while (<>) { - if (/\@(\*|\.|\:|\@|\{|\})/) { - $seen{$&}++; - $context{$&} .= "> $_" if $verbose; - $_ = "$`XX$'"; - redo; - } - if (/\@(\w+)/) { - ($before, $match, $after) = ($`, $&, $'); - if ($before =~ /\b[\w-]+$/ && $after =~ /^[\w-.]*\b/) { # e-mail address - $seen{'e-mail address'}++; - $context{'e-mail address'} .= "> $_" if $verbose; - } else { - $seen{$match}++; - $context{$match} .= "> $_" if $verbose; - } - $match =~ s/^\@/X/; - $_ = "$before$match$after"; - redo; - } - } - - foreach (sort(keys(%seen))) { - if ($verbose) { - print "$_\n"; - print $context{$_}; - } else { - print "$_ ($seen{$_})\n"; - } - } -} - -sub open { - local($name) = @_; - - ++$fh_name; - if (open($fh_name, $name)) { - unshift(@fhs, $fh_name); - } else { - warn "$ERROR Can't read file $name: $!\n"; - } -} - -sub init_input { - @fhs = (); # hold the file handles to read - @input_spool = (); # spooled lines to read - $fh_name = 'FH000'; - &open($docu); -} - -sub next_line { - local($fh, $line); - - if (@input_spool) { - $line = shift(@input_spool); - return($line); - } - while (@fhs) { - $fh = $fhs[0]; - $line = <$fh>; - return($line) if $line; - close($fh); - shift(@fhs); - } - return(undef); -} - -# used in pass 1, use &next_line -sub skip_until { - local($tag) = @_; - local($_); - - while ($_ = &next_line) { - return if /^\@end\s+$tag\s*$/; - } - die "* Failed to find '$tag' after: " . $lines[$#lines]; -} - -# -# HTML stacking to have a better HTML output -# - -sub html_reset { - @html_stack = ('html'); - $html_element = 'body'; -} - -sub html_push { - local($what) = @_; - push(@html_stack, $html_element); - $html_element = $what; -} - -sub html_push_if { - local($what) = @_; - push(@html_stack, $html_element) - if ($html_element && $html_element ne 'P'); - $html_element = $what; -} - -sub html_pop { - $html_element = pop(@html_stack); -} - -sub html_pop_if { - local($elt); - - if (@_) { - foreach $elt (@_) { - if ($elt eq $html_element) { - $html_element = pop(@html_stack) if @html_stack; - last; - } - } - } else { - $html_element = pop(@html_stack) if @html_stack; - } -} - -sub html_debug { - local($what, $line) = @_; - return("$what") - if $debug & $DEBUG_HTML; - return($what); -} - -# to debug the output... -sub debug { - local($what, $line) = @_; - return("$what") - if $debug & $DEBUG_HTML; - return($what); -} - -sub normalise_node { - $_[0] =~ s/\s+/ /g; - $_[0] =~ s/ $//; - $_[0] =~ s/^ //; -} - -sub menu_entry { - local($entry, $node, $descr) = @_; - local($href); - - &normalise_node($node); - $href = $node2href{$node}; - if ($href) { - $descr =~ s/^\s+//; - $descr = ": $descr" if $descr; - push(@lines2, "
  • " . &anchor('', $href, $entry) . "$descr\n"); - } else { - warn "$ERROR Undefined node ($node): $_"; - } -} - -sub do_ctrl { "^$_[0]" } - -sub do_sc { "\U$_[0]\E" } - -sub apply_style { - local($texi_style, $text) = @_; - local($style); - - $style = $style_map{$texi_style}; - if (defined($style)) { # known style - if ($style =~ /^\"/) { # add quotes - $style = $'; - $text = "\`$text\'"; - } - if ($style =~ /^\&/) { # custom - $style = $'; - $text = &$style($text); - } elsif ($style) { # good style - $text = "<$style>$text"; - } else { # no style - } - } else { # unknown style - $text = undef; - } - return($text); -} - -# remove Texinfo styles -sub remove_style { - local($_) = @_; - s/\@\w+{([^\{\}]+)}/$1/g; - return($_); -} - -sub substitute_style { - local($_) = @_; - local($changed, $done, $style, $text); - - $changed = 1; - while ($changed) { - $changed = 0; - $done = ''; - while (/\@(\w+){([^\{\}]+)}/) { - $text = &apply_style($1, $2); - if ($text) { - $_ = "$`$text$'"; - $changed = 1; - } else { - $done .= "$`\@$1"; - $_ = "{$2}$'"; - } - } - $_ = $done . $_; - } - return($_); -} - -sub anchor { - local($name, $href, $text, $newline) = @_; - local($result); - - $result = "

    \n"; -} - -sub print_header { - local($_); - - # clean the title - $_ = &remove_style($_[0]); - &unprotect_texi; - # print the header - if ($doctype eq 'html2') { - print FILE $html2_doctype; - } elsif ($doctype) { - print FILE $doctype; - } - print FILE < - -$header -$_ - - -EOT -} - -sub print_toplevel_header { - local($_); - - &print_header; # pass given arg... - print FILE $full_title; - if ($value{'_subtitle'}) { - $value{'_subtitle'} =~ s/\n+$//; - foreach (split(/\n/, $value{'_subtitle'})) { - $_ = &substitute_style($_); - &unprotect_texi; - print FILE "

    $_

    \n"; - } - } - if ($value{'_author'}) { - $value{'_author'} =~ s/\n+$//; - foreach (split(/\n/, $value{'_author'})) { - $_ = &substitute_style($_); - &unprotect_texi; - s/[\w.-]+\@[\w.-]+/
    $&<\/A>/g; - print FILE "
    $_
    \n"; - } - } - print FILE "

    \n"; -} - -sub print_footer { - print FILE < - -EOT -} - -sub print_toplevel_footer { - &print_ruler; - print FILE <texi2html -translator version 1.51.

    -EOT - &print_footer; -} - -sub protect_texi { - # protect @ { } ` ' - s/\@\@/$;0/go; - s/\@\{/$;1/go; - s/\@\}/$;2/go; - s/\@\`/$;3/go; - s/\@\'/$;4/go; -} - -sub protect_html { - local($what) = @_; - # protect & < > - $what =~ s/\&/\&\#38;/g; - $what =~ s/\/\&\#62;/g; - # but recognize some HTML things - $what =~ s/\&\#60;\/A\&\#62;/<\/A>/g; # - $what =~ s/\&\#60;A ([^\&]+)\&\#62;//g; # - $what =~ s/\&\#60;IMG ([^\&]+)\&\#62;//g; # - return($what); -} - -sub unprotect_texi { - s/$;0/\@/go; - s/$;1/\{/go; - s/$;2/\}/go; - s/$;3/\`/go; - s/$;4/\'/go; -} - -sub unprotect_html { - local($what) = @_; - $what =~ s/\&\#38;/\&/g; - $what =~ s/\&\#60;/\/g; - return($what); -} - -sub byalpha { - $key2alpha{$a} cmp $key2alpha{$b}; -} - -############################################################################## - - # These next few lines are legal in both Perl and nroff. - -.00 ; # finish .ig - -'di \" finish diversion--previous line must be blank -.nr nl 0-1 \" fake up transition to first page again -.nr % 0 \" start at page 1 -'; __END__ ############# From here on it's a standard manual page ############ -.TH TEXI2HTML 1 "09/10/96" -.AT 3 -.SH NAME -texi2html \- a Texinfo to HTML converter -.SH SYNOPSIS -.B texi2html [options] file -.PP -.B texi2html -check [-verbose] files -.SH DESCRIPTION -.I Texi2html -converts the given Texinfo file to a set of HTML files. It tries to handle -most of the Texinfo commands. It creates hypertext links for cross-references, -footnotes... -.PP -It also tries to add links from a reference to its corresponding entry in the -bibliography (if any). It may also handle a glossary (see the -.B \-glossary -option). -.PP -.I Texi2html -creates several files depending on the contents of the Texinfo file and on -the chosen options (see FILES). -.PP -The HTML files created by -.I texi2html -are closer to TeX than to Info, that's why -.I texi2html -converts @iftex sections and not @ifinfo ones by default. You can reverse -this with the \-expandinfo option. -.SH OPTIONS -.TP 12 -.B \-check -Check the given file and give the list of all things that may be Texinfo commands. -This may be used to check the output of -.I texi2html -to find the Texinfo commands that have been left in the HTML file. -.TP -.B \-expandinfo -Expand @ifinfo sections, not @iftex ones. -.TP -.B \-glossary -Use the section named 'Glossary' to build a list of terms and put links in the HTML -document from each term toward its definition. -.TP -.B \-invisible \fIname\fP -Use \fIname\fP to create invisible destination anchors for index links. This is a workaround -for a known bug of many WWW browsers, including xmosaic. -.TP -.B \-I \fIdir\fP -Look also in \fIdir\fP to find included files. -.TP -.B \-menu -Show the Texinfo menus; by default they are ignored. -.TP -.B \-monolithic -Output only one file, including the table of contents and footnotes. -.TP -.B \-number -Number the sections. -.TP -.B \-split_chapter -Split the output into several HTML files (one per main section: -chapter, appendix...). -.TP -.B \-split_node -Split the output into several HTML files (one per node). -.TP -.B \-usage -Print usage instructions, listing the current available command-line options. -.TP -.B \-verbose -Give a verbose output. Can be used with the -.B \-check -option. -.PP -.SH FILES -By default -.I texi2html -creates the following files (foo being the name of the Texinfo file): -.TP 16 -.B foo_toc.html -The table of contents. -.TP -.B foo.html -The document's contents. -.TP -.B foo_foot.html -The footnotes (if any). -.PP -When used with the -.B \-split -option, it creates several files (one per chapter or node), named -.B foo_n.html -(n being the indice of the chapter or node), instead of the single -.B foo.html -file. -.PP -When used with the -.B \-monolithic -option, it creates only one file: -.B foo.html -.SH VARIABLES -.I texi2html -predefines the following variables: \fBhtml\fP, \fBtexi2html\fP. -.SH ADDITIONAL COMMANDS -.I texi2html -implements the following non-Texinfo commands: -.TP 16 -.B @ifhtml -This indicates the start of an HTML section, this section will passed through -without any modofication. -.TP -.B @end ifhtml -This indcates the end of an HTML section. -.SH VERSION -This is \fItexi2html\fP version 1.51, 09/10/96. -.PP -The latest version of \fItexi2html\fP can be found in WWW, cf. URL -http://wwwcn.cern.ch/dci/texi2html/ -.SH AUTHOR -The main author is Lionel Cons, CERN CN/DCI/UWS, Lionel.Cons@cern.ch. -Many other people around the net contributed to this program. -.SH COPYRIGHT -This program is the intellectual property of the European -Laboratory for Particle Physics (known as CERN). No guarantee whatsoever is -provided by CERN. No liability whatsoever is accepted for any loss or damage -of any kind resulting from any defect or inaccuracy in this information or -code. -.PP -CERN, 1211 Geneva 23, Switzerland -.SH "SEE ALSO" -GNU Texinfo Documentation Format, -HyperText Markup Language (HTML), -World Wide Web (WWW). -.SH BUGS -This program does not understand all Texinfo commands (yet). -.PP -TeX specific commands (normally enclosed in @iftex) will be -passed unmodified. -.ex diff --git a/glabels2/barcode-0.98/ean.c b/glabels2/barcode-0.98/ean.c deleted file mode 100644 index 0801a0ef..00000000 --- a/glabels2/barcode-0.98/ean.c +++ /dev/null @@ -1,774 +0,0 @@ -/* - * ean.c -- encoding for ean, upc and isbn - * - * Copyright (c) 1999 Alessandro Rubini - * Copyright (c) 1999 Prosa Srl. - * Copyright (c) 2001 Boszormenyi Zoltan - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include - -#include "barcode.h" - -/* - * IMPORTANT NOTE: if you are reading this file to learn how to add a - * new encoding type, this is the wrong place as there are too many - * special cases. Please refer to code39.c instead. If you want to - * learn how UPC, EAN, ISBN work, on the other hand, I did my best to - * commend things and hope you enjoy it. - */ - -/* - * These following static arrays are used to describe the barcode. - * - * The various forms of UPC and EAN are documented as using three - * different alphabets to encode the ten digits. However, each digit - * has exactly one encoding; only, it is sometimes mirrored. Moreover, - * if you represent the width of each symbol (bar/space) instead of - * the sequence of 1's and 0's, you find that even-parity and odd-parity - * encoding are exactly the same. So, here are the digits: */ -static char *digits[] = { - "3211","2221","2122","1411","1132", - "1231","1114","1312","1213","3112"}; - -/* - * What EAN encoding does is adding a leading digit (the 13th digit). - * Such an extra digit is encoded by mirroring three of the six digits that - * appear in the left half of the UPC code. Here how mirroring works: - */ -static char *ean_mirrortab[] = { - "------","--1-11","--11-1","--111-","-1--11", - "-11--1","-111--","-1-1-1","-1-11-","-11-1-" -}; - -/* - * UPC-E (the 6-digit one), instead, encodes the check character as - * a mirroring of the symbols. This is similar, but the encoding for "0" is - * different (EAN uses no mirroring for "0" to be compatible with UPC). - * The same rule is used for UPC-5 (the supplemental digits for ISBN) - */ -static char *upc_mirrortab[] = { - "---111","--1-11","--11-1","--111-","-1--11", - "-11--1","-111--","-1-1-1","-1-11-","-11-1-" -}; - -/* - * UPC-E mirroring for encoding "1" - */ -static char *upc_mirrortab1[] = { - "111---","11-1--","11--1-","11---1","1-11--", - "1--11-","1---11","1-1-1-","1-1--1","1--1-1" -}; - -/* UPC-2 has just two digits to mirror */ -static char *upc_mirrortab2[] = { - "11","1-","-1","--" -}; - -/* - * initial, middle, final guard bars (first symbol is a a space). - * EAN-13 overwrites the first "0" with "9" to make space for the extra digit. - */ -static char *guard[] = {"0a1a","1a1a1","a1a"}; - -/* initial, final guard bars for UPC-E*/ -static char *guardE[] = {"0a1a","1a1a1a"}; - -/* initial and inter-char guard bars for supplementals (first is space) */ -static char *guardS[] = {"9112","11"}; - -/* - * These functions are shortcuts I use in the encoding engine - */ -static int ean_make_checksum(char *text, int mode) -{ - int esum = 0, osum = 0, i; - int even=1; /* last char is even */ - - if (strchr(text, ' ')) - i = strchr(text, ' ') - text; /* end of first part */ - else - i = strlen(text); /* end of all */ - - while (i-- > 0) { - if (even) esum += text[i]-'0'; - else osum += text[i]-'0'; - even = !even; - } - if (!mode) { /* standard upc/ean checksum */ - i = (3*esum + osum) % 10; - return (10-i) % 10; /* complement to 10 */ - } else { /* add-5 checksum */ - i = (3*esum + 9*osum); - return i%10; - } -} - -/* - * Check that the text can be encoded. Returns 0 or -1. - * Accept: - * 13 or 12 digits: EAN-13 w/ or w/o checksum - * or - * 8 or 7 digits: EAN-8 w/ or w/o checksum. - * For both EAN-13 and EAN-8, accept an addon of 2 or 5 digits, - * separated by ' ' - */ -int Barcode_ean_verify(unsigned char *text) -{ - int i, len0, len, addon; - unsigned char tmp[24], *spc; - - len = strlen(text); - spc = strchr(text, ' '); - if (spc) { - len0 = spc - text; - addon = len - len0 - 1; - if (addon != 2 && addon != 5) - return -1; - for (i=len0+1; i= '5' && text[10] <= '9') { - memcpy(&result[1], text+1, 5); - result[6] = text[10]; - } else { - return NULL; - } - result[7] = chksum + '0'; - - return result; -} - -/* - * UPC-A is the same as EAN, but accept - * 12 or 11 digits (UPC-A w/ or w/o checksum) - * or accept UPC-E as: - * 6 digits (w/o number system and checksum): number system '0' assumed, - * 7 digits (either w/o number system or checksum), - * 8 digits (w/ number system and checksum) - * plus the 2 or 5-digit add-on - */ -int Barcode_upc_verify(unsigned char *text) -{ - int i, len0, len, addon; - unsigned char tmp[24], *spc; - - len = strlen(text); - spc = strchr(text, ' '); - if (spc) { - len0 = spc - text; - addon = len - len0 - 1; - if (addon != 2 && addon != 5) - return -1; - for (i=len0+1; iascii) { - bc->error = EINVAL; - return -1; - } - - /* Find out whether the barcode has addon and - * the length of the barcode w/o the addon. - */ - len = strlen(bc->ascii); - spc = strchr(bc->ascii, ' '); - if (spc) { - len0 = spc - bc->ascii; - addon = strlen(spc + 1); - if (addon != 2 && addon != 5) { - bc->error = EINVAL; /* impossible, actually */ - return -1; - } - } else { - len0 = len; - addon = 0; - } - - if (!bc->encoding) { - /* ISBN already wrote what it is; if unknown, find it out */ - - /* - * Do not decide only by barcode length, it may be ambiguous. - * Anyway, either the user specified the barcode type or - * we already found a fitting one. - */ - switch(bc->flags & BARCODE_ENCODING_MASK) { - case BARCODE_EAN: - switch (len0) { - case 7: case 8: - bc->encoding = strdup("EAN-8"); - encoding = EAN8; - break; - case 12: case 13: - bc->encoding = strdup("EAN-13"); - encoding = EAN13; - break; - default: - bc->error = -EINVAL; - return -1; - } - break; - - case BARCODE_UPC: - switch (len0) { - case 6: case 7: case 8: - bc->encoding = strdup("UPC-E"); - encoding = UPCE; - break; - case 11: case 12: - bc->encoding = strdup("UPC-A"); - encoding = UPCA; - break; - default: - bc->error = -EINVAL; - return -1; - } - break; - default: - /* else, it's wrong (impossible, as the text is checked) */ - bc->error = -EINVAL; - return -1; - } - } - - /* better safe than sorry */ - if (bc->partial) free(bc->partial); bc->partial = NULL; - if (bc->textinfo) free(bc->textinfo); bc->textinfo = NULL; - - if (encoding == UPCA) { /* add the leading 0 (not printed) */ - text[0] = '0'; - strcpy(text+1, bc->ascii); - } else if (encoding == UPCE) { - strcpy(text, upc_a_to_e(upc_e_to_a(bc->ascii))); - } else { - strcpy(text, bc->ascii); - } - - /* - * build the checksum and the bars: any encoding is slightly different - */ - if (encoding == UPCA || encoding == EAN13 || encoding == ISBN) { - if (!(encoding == UPCA && len0 == 12) && - !(encoding == EAN13 && len0 == 13)) { - checksum = ean_make_checksum(text, 0); - text[12] = '0' + checksum; /* add it to the text */ - text[13] = '\0'; - } - - strcpy(partial, guard[0]); - if (encoding == EAN13 || encoding == ISBN) { /* The first digit */ - sprintf(tptr,"0:12:%c ",text[0]); - tptr += strlen(tptr); - partial[0] = '9'; /* extra space for the digit */ - } else if (encoding == UPCA) - partial[0] = '9'; /* UPC has one digit before the symbol, too */ - xpos = width_of_partial(partial); - mirror = ean_mirrortab[text[0]-'0']; - - /* left part */ - for (i=1;i<7;i++) { - ptr1 = partial + strlen(partial); /* target */ - ptr2 = digits[text[i]-'0']; /* source */ - strcpy(ptr1, ptr2); - if (mirror[i-1] == '1') { - /* mirror this */ - ptr1[0] = ptr2[3]; - ptr1[1] = ptr2[2]; - ptr1[2] = ptr2[1]; - ptr1[3] = ptr2[0]; - } - /* - * Write the ascii digit. UPC has a special case - * for the first digit, which is out of the bars - */ - if (encoding == UPCA && i==1) { - sprintf(tptr, "0:10:%c ", text[i]); - tptr += strlen(tptr); - ptr1[1] += 'a'-'1'; /* bars are long */ - ptr1[3] += 'a'-'1'; - } else { - sprintf(tptr, "%i:12:%c ", xpos, text[i]); - tptr += strlen(tptr); - } - /* count the width of the symbol */ - xpos += 7; /* width_of_partial(ptr2) */ - } - - strcat(partial, guard[1]); /* middle */ - xpos += width_of_partial(guard[1]); - - /* right part */ - for (i=7;i<13;i++) { - ptr1 = partial + strlen(partial); /* target */ - ptr2 = digits[text[i]-'0']; /* source */ - strcpy(ptr1, ptr2); - /* - * Ascii digit. Once again, UPC has a special - * case for the last digit - */ - if (encoding == UPCA && i==12) { - sprintf(tptr, "%i:10:%c ", xpos+13, text[i]); - tptr += strlen(tptr); - ptr1[0] += 'a'-'1'; /* bars are long */ - ptr1[2] += 'a'-'1'; - } else { - sprintf(tptr, "%i:12:%c ", xpos, text[i]); - tptr += strlen(tptr); - } - xpos += 7; /* width_of_partial(ptr2) */ - } - tptr[-1] = '\0'; /* overwrite last space */ - strcat(partial, guard[2]); /* end */ - xpos += width_of_partial(guard[2]); - - } else if (encoding == UPCE) { - checksum = text[7] - '0'; - - strcpy(partial, guardE[0]); - partial[0] = '9'; /* UPC-A has one digit before the symbol, too */ - xpos = width_of_partial(partial); - - /* UPC-E has the number system written before the bars. */ - sprintf(tptr, "0:10:%c ", text[0]); - tptr += strlen(tptr); - - if (text[0] == '0') - mirror = upc_mirrortab[checksum]; - else - mirror = upc_mirrortab1[checksum]; - - for (i=0;i<6;i++) { - ptr1 = partial + strlen(partial); /* target */ - ptr2 = digits[text[i+1]-'0']; /* source */ - strcpy(ptr1, ptr2); - if (mirror[i] != '1') { /* negated wrt EAN13 */ - /* mirror this */ - ptr1[0] = ptr2[3]; - ptr1[1] = ptr2[2]; - ptr1[2] = ptr2[1]; - ptr1[3] = ptr2[0]; - } - sprintf(tptr, "%i:12:%c ", xpos, text[i+1]); - tptr += strlen(tptr); - xpos += 7; /* width_of_partial(ptr2) */ - } - - sprintf(tptr, "%i:10:%c ", xpos+10, text[7]); - tptr += strlen(tptr); - ptr1[0] += 'a'-'1'; /* bars are long */ - ptr1[2] += 'a'-'1'; - - tptr[-1] = '\0'; /* overwrite last space */ - strcat(partial, guardE[1]); /* end */ - - } else { /* EAN-8 almost identical to EAN-13 but no mirroring */ - - if (len0 != 8) { - checksum = ean_make_checksum(text, 0); - text[7] = '0' + checksum; /* add it to the text */ - text[8] = '\0'; - } - - strcpy(partial, guard[0]); - xpos = width_of_partial(partial); - - /* left part */ - for (i=0;i<4;i++) { - strcpy(partial + strlen(partial), digits[text[i]-'0']); - sprintf(tptr, "%i:12:%c ", xpos, text[i]); - tptr += strlen(tptr); - xpos += 7; /* width_of_partial(digits[text[i]-'0' */ - } - strcat(partial, guard[1]); /* middle */ - xpos += width_of_partial(guard[1]); - - /* right part */ - for (i=4;i<8;i++) { - strcpy(partial + strlen(partial), digits[text[i]-'0']); - sprintf(tptr, "%i:12:%c ", xpos, text[i]); - tptr += strlen(tptr); - xpos += 7; /* width_of_partial(digits[text[i]-'0' */ - } - tptr[-1] = '\0'; /* overwrite last space */ - strcat(partial, guard[2]); /* end */ - } - - /* - * And that's it. Now, in case some add-on is specified it - * must be encoded too. Look for it. - */ - if ( (ptr1 = spc) ) { - ptr1++; - strcpy(text, ptr1); - if (strlen(ptr1)==5) { - checksum = ean_make_checksum(text, 1 /* special way */); - mirror = upc_mirrortab[checksum]+1; /* only last 5 digits */ - } else { - checksum = atoi(text)%4; - mirror = upc_mirrortab2[checksum]; - } - strcat(textinfo, " +"); strcat(partial, "+"); - tptr = textinfo + strlen(textinfo); - for (i=0; ipartial = strdup(partial); - if (!bc->partial) { - bc->error = errno; - return -1; - } - bc->textinfo = strdup(textinfo); - if (!bc->textinfo) { - bc->error = errno; - free(bc->partial); - bc->partial = NULL; - return -1; - } - if (!bc->width) - bc->width = width_of_partial(partial); - - return 0; /* success */ -} - -int Barcode_upc_encode(struct Barcode_Item *bc) -{ - return Barcode_ean_encode(bc); /* UPC is folded into EAN */ -} - -int Barcode_isbn_encode(struct Barcode_Item *bc) -{ - /* For ISBN we must normalize the string and prefix "978" */ - unsigned char *text = malloc(24); /* 13 + ' ' + 5 plus some slack */ - unsigned char *otext; - int i, j, retval; - - if (!text) { - bc->error = ENOMEM; - return -1; - } - strcpy(text, "978"); j=3; - - otext = bc->ascii; - for (i=0; otext[i]; i++) { - if (isdigit(otext[i])) - text[j++] = otext[i]; - if (j == 12) /* checksum added later */ - break; - } - text[j]='\0'; - if (strchr(otext, ' ')) - strcat(text, strchr(otext, ' ')); - bc->ascii = text; - bc->encoding = strdup("ISBN"); - retval = Barcode_ean_encode(bc); - bc->ascii = otext; /* restore ascii for the ps comments */ - free(text); - return retval; -} - diff --git a/glabels2/barcode-0.98/i25.c b/glabels2/barcode-0.98/i25.c deleted file mode 100644 index 72bd0358..00000000 --- a/glabels2/barcode-0.98/i25.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * i25.c -- "interleaved 2 of 5" - * - * Copyright (c) 1999,2000 Alessandro Rubini (rubini@gnu.org) - * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include - -#include "barcode.h" - -static char *codes[] = { - "11331", "31113", "13113", "33111", "11313", - "31311", "13311", "11133", "31131", "13131" -}; - -static char *guard[] = {"a1a1", "c1a"}; /* begin end */ - -int Barcode_i25_verify(unsigned char *text) -{ - if (!text[0]) - return -1; - while (*text && isdigit(*text)) - text++; - if (*text) - return -1; /* a non-digit char */ - return 0; /* ok */ -} - -int Barcode_i25_encode(struct Barcode_Item *bc) -{ - unsigned char *text; - unsigned char *partial; /* dynamic */ - unsigned char *textinfo; /* dynamic */ - unsigned char *textptr, *p1, *p2, *pd; - int i, len, sum[2], textpos, usesum = 0; - - if (bc->partial) - free(bc->partial); - if (bc->textinfo) - free(bc->textinfo); - bc->partial = bc->textinfo = NULL; /* safe */ - - if (!bc->encoding) - bc->encoding = strdup("interleaved 2 of 5"); - - text = bc->ascii; - if (!bc->ascii) { - bc->error = EINVAL; - return -1; - } - - if ((bc->flags & BARCODE_NO_CHECKSUM)) usesum = 0; else usesum = 1; - - /* create the real text string, padded to an even number of digits */ - text = malloc(strlen(bc->ascii) + 3); /* leading 0, checksum, term. */ - if (!text) { - bc->error = errno; - return -1; - } - /* add the leading 0 if needed */ - i = strlen(bc->ascii) + usesum; - if (i % 2) { - /* add a leading 0 */ - text[0] = '0'; - strcpy(text+1, bc->ascii); - } else { - strcpy(text, bc->ascii); - } - /* add the trailing checksum if needed, the leading 0 is ignored */ - if (usesum) { - sum[0] = sum[1] = 0; - for (i=0; text[i]; i++) - sum[i%2] += text[i]-'0'; - /* - * The "even" sum must be multiplied by three, and the * - * rightmost digit is defined as "even". The digits' position - * is already correct, whether or not we added a leading zero. - * (e.g., they are in pos. 0..4 or 1..4 of the string) - */ - i = sum[0] * 3 + sum[1]; - strcat(text, "0"); - text[strlen(text)-1] += (10 - (i%10)) % 10; - } - - /* the partial code is 5 * (text + check) + 4(head) + 3(tail) + term. */ - partial = malloc( (strlen(text) + 3) * 5 +2); /* be large... */ - if (!partial) { - bc->error = errno; - free(text); - return -1; - } - - /* the text information is at most "nnn:fff:c " * (strlen+1) +term */ - textinfo = malloc(10*(strlen(text)+1) + 2); - if (!textinfo) { - bc->error = errno; - free(partial); - free(text); - return -1; - } - - - strcpy(partial, "0"); /* the first space */ - strcat(partial, guard[0]); /* start */ - textpos = 4; /* width of initial guard */ - textptr = textinfo; - - len = strlen(text); - for (i=0; ierror = EINVAL; /* impossible if text is verified */ - free(partial); - free(textinfo); - free(text); - return -1; - } - /* interleave two digits */ - p1 = codes[text[i]-'0']; - p2 = codes[text[i+1]-'0']; - pd = partial + strlen(partial); /* destination */ - while (*p1) { - *(pd++) = *(p1++); - *(pd++) = *(p2++); - } - *pd = '\0'; - /* and print the ascii text (but don't print the checksum, if any */ - if (usesum && strlen(text+i)==2) { - /* print only one digit, discard the checksum */ - sprintf(textptr, "%i:12:%c ", textpos, text[i]); - } else { - sprintf(textptr, "%i:12:%c %i:12:%c ", textpos, text[i], - textpos+9, text[i+1]); - } - textpos += 18; /* width of two codes */ - textptr += strlen(textptr); - } - strcat(partial, guard[1]); - - bc->partial = partial; - bc->textinfo = textinfo; - free(text); - - return 0; -} - diff --git a/glabels2/barcode-0.98/install-sh b/glabels2/barcode-0.98/install-sh deleted file mode 100644 index ab74c882..00000000 --- a/glabels2/barcode-0.98/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# 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}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - 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;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - 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` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/glabels2/barcode-0.98/library.c b/glabels2/barcode-0.98/library.c deleted file mode 100644 index a8787020..00000000 --- a/glabels2/barcode-0.98/library.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - * library.c -- external functions of libbarcode - * - * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) - * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#ifdef HAVE_UNISTD_H /* sometimes (windows, for instance) it's missing */ -# include -#endif -#include - -#include "barcode.h" - -/* - * This function allocates a barcode structure and strdup()s the - * text string. It returns NULL in case of error - */ -struct Barcode_Item *Barcode_Create(char *text) -{ - struct Barcode_Item *bc; - - bc = malloc(sizeof(*bc)); - if (!bc) return NULL; - - memset(bc, 0, sizeof(*bc)); - bc->ascii = strdup(text); - bc->margin = BARCODE_DEFAULT_MARGIN; /* default margin */ - return bc; -} - - -/* - * Free a barcode structure - */ -int Barcode_Delete(struct Barcode_Item *bc) -{ - if (bc->ascii) - free(bc->ascii); - if (bc->partial) - free(bc->partial); - if (bc->textinfo) - free(bc->textinfo); - if (bc->encoding) - free(bc->encoding); - free(bc); - return 0; /* always success */ -} - - -/* - * The various supported encodings. This might be extended to support - * dynamic addition of extra encodings - */ -extern int Barcode_ean_verify(unsigned char *text); -extern int Barcode_ean_encode(struct Barcode_Item *bc); -extern int Barcode_upc_verify(unsigned char *text); -extern int Barcode_upc_encode(struct Barcode_Item *bc); -extern int Barcode_isbn_verify(unsigned char *text); -extern int Barcode_isbn_encode(struct Barcode_Item *bc); -extern int Barcode_39_verify(unsigned char *text); -extern int Barcode_39_encode(struct Barcode_Item *bc); -extern int Barcode_128b_verify(unsigned char *text); -extern int Barcode_128b_encode(struct Barcode_Item *bc); -extern int Barcode_128c_verify(unsigned char *text); -extern int Barcode_128c_encode(struct Barcode_Item *bc); -extern int Barcode_128_verify(unsigned char *text); -extern int Barcode_128_encode(struct Barcode_Item *bc); -extern int Barcode_128raw_verify(unsigned char *text); -extern int Barcode_128raw_encode(struct Barcode_Item *bc); -extern int Barcode_i25_verify(unsigned char *text); -extern int Barcode_i25_encode(struct Barcode_Item *bc); -extern int Barcode_cbr_verify(unsigned char *text); -extern int Barcode_cbr_encode(struct Barcode_Item *bc); -extern int Barcode_msi_verify(unsigned char *text); -extern int Barcode_msi_encode(struct Barcode_Item *bc); -extern int Barcode_pls_verify(unsigned char *text); -extern int Barcode_pls_encode(struct Barcode_Item *bc); -extern int Barcode_93_verify(unsigned char *text); -extern int Barcode_93_encode(struct Barcode_Item *bc); - - -struct encoding { - int type; - int (*verify)(unsigned char *text); - int (*encode)(struct Barcode_Item *bc); -}; - -struct encoding encodings[] = { - {BARCODE_EAN, Barcode_ean_verify, Barcode_ean_encode}, - {BARCODE_UPC, Barcode_upc_verify, Barcode_upc_encode}, - {BARCODE_ISBN, Barcode_isbn_verify, Barcode_isbn_encode}, - {BARCODE_128B, Barcode_128b_verify, Barcode_128b_encode}, - {BARCODE_128C, Barcode_128c_verify, Barcode_128c_encode}, - {BARCODE_128RAW, Barcode_128raw_verify, Barcode_128raw_encode}, - {BARCODE_39, Barcode_39_verify, Barcode_39_encode}, - {BARCODE_I25, Barcode_i25_verify, Barcode_i25_encode}, - {BARCODE_128, Barcode_128_verify, Barcode_128_encode}, - {BARCODE_CBR, Barcode_cbr_verify, Barcode_cbr_encode}, - {BARCODE_PLS, Barcode_pls_verify, Barcode_pls_encode}, - {BARCODE_MSI, Barcode_msi_verify, Barcode_msi_encode}, - {BARCODE_93, Barcode_93_verify, Barcode_93_encode}, - {0, NULL, NULL} -}; - -/* - * A function to encode a string into bc->partial, ready for - * postprocessing to the output file. Meaningful bits for "flags" are - * the encoding mask and the no-checksum flag. These bits - * get saved in the data structure. - */ -int Barcode_Encode(struct Barcode_Item *bc, int flags) -{ - int validbits = BARCODE_ENCODING_MASK | BARCODE_NO_CHECKSUM; - struct encoding *cptr; - - /* If any flag is cleared in "flags", inherit it from "bc->flags" */ - if (!(flags & BARCODE_ENCODING_MASK)) - flags |= bc->flags & BARCODE_ENCODING_MASK; - if (!(flags & BARCODE_NO_CHECKSUM)) - flags |= bc->flags & BARCODE_NO_CHECKSUM; - flags = bc->flags = (flags & validbits) | (bc->flags & ~validbits); - - if (!(flags & BARCODE_ENCODING_MASK)) { - /* get the first code able to handle the text */ - for (cptr = encodings; cptr->verify; cptr++) - if (cptr->verify((unsigned char *)bc->ascii)==0) - break; - if (!cptr->verify) { - bc->error = EINVAL; /* no code can handle this text */ - return -1; - } - flags |= cptr->type; /* this works */ - bc->flags |= cptr->type; - } - for (cptr = encodings; cptr->verify; cptr++) - if (cptr->type == (flags & BARCODE_ENCODING_MASK)) - break; - if (!cptr->verify) { - bc->error = EINVAL; /* invalid barcode type */ - return -1; - } - if (cptr->verify(bc->ascii) != 0) { - bc->error = EINVAL; - return -1; - } - return cptr->encode(bc); -} - - -/* - * When multiple output formats are supported, there will - * be a jumpt table like the one for the types. Now we don't need it - */ -extern int Barcode_ps_print(struct Barcode_Item *bc, FILE *f); -extern int Barcode_pcl_print(struct Barcode_Item *bc, FILE *f); - -/* - * A function to print a partially decoded string. Meaningful bits for - * "flags" are the output mask etc. These bits get saved in the data - * structure. - */ -int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags) -{ - int validbits = BARCODE_OUTPUT_MASK | BARCODE_NO_ASCII - | BARCODE_OUT_NOHEADERS; - - /* If any flag is clear in "flags", inherit it from "bc->flags" */ - if (!(flags & BARCODE_OUTPUT_MASK)) - flags |= bc->flags & BARCODE_OUTPUT_MASK; - if (!(flags & BARCODE_NO_ASCII)) - flags |= bc->flags & BARCODE_NO_ASCII; - if (!(flags & BARCODE_OUT_NOHEADERS)) - flags |= bc->flags & BARCODE_OUT_NOHEADERS; - flags = bc->flags = (flags & validbits) | (bc->flags & ~validbits); - - if (bc->flags & BARCODE_OUT_PCL) - return Barcode_pcl_print(bc, f); - return Barcode_ps_print(bc, f); -} - -/* - * Choose the position - */ -int Barcode_Position(struct Barcode_Item *bc, int wid, int hei, - int xoff, int yoff, double scalef) -{ - bc->width = wid; bc->height = hei; - bc->xoff = xoff; bc->yoff = yoff; - bc->scalef = scalef; - return 0; -} - -/* - * Do it all in one step - */ -int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei, - int xoff, int yoff, int flags) -{ - struct Barcode_Item * bc; - - if (!(bc=Barcode_Create(text))) { - errno = -ENOMEM; - return -1; - } - if ( Barcode_Position(bc, wid, hei, xoff, yoff, 0.0) < 0 - || Barcode_Encode(bc, flags) < 0 - || Barcode_Print(bc, f, flags) < 0) { - errno = bc->error; - Barcode_Delete(bc); - return -1; - } - Barcode_Delete(bc); - return 0; -} - -/* - * Return the version - */ - -int Barcode_Version(char *vptr) -{ - if (vptr) - strcpy(vptr, BARCODE_VERSION); - return BARCODE_VERSION_INT; -} diff --git a/glabels2/barcode-0.98/main.c b/glabels2/barcode-0.98/main.c deleted file mode 100644 index e07e4d3c..00000000 --- a/glabels2/barcode-0.98/main.c +++ /dev/null @@ -1,604 +0,0 @@ -/* - * main.c - a commandline frontend for the barcode library - * - * Copyright (c) 1999 Michele Comitini (mcm@glisco.it) - * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) - * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include - -#include "cmdline.h" -#include "barcode.h" - -#ifndef NO_LIBPAPER -#include -#endif - -/* - * Most of this file deals with command line options, by exploiting - * the cmdline.[ch] engine to offer defaults via environment variables - * and handling functions for complex options. - * - * In order to offer a friendly interface (for those who feel the - * cmdline *is* friendly, like me), we have to convert names to enums... - */ - -struct { - char *name; - int type; -} encode_tab[] = { - {"ean", BARCODE_EAN}, - {"ean13", BARCODE_EAN}, - {"ean-13", BARCODE_EAN}, - {"ean8", BARCODE_EAN}, - {"ean-8", BARCODE_EAN}, - {"upc", BARCODE_UPC}, - {"upc-a", BARCODE_UPC}, - {"upc-e", BARCODE_UPC}, - {"isbn", BARCODE_ISBN}, - {"39", BARCODE_39}, - {"code39", BARCODE_39}, - {"128c", BARCODE_128C}, - {"code128c", BARCODE_128C}, - {"128b", BARCODE_128B}, - {"code128b", BARCODE_128B}, - {"128", BARCODE_128}, - {"code128", BARCODE_128}, - {"128raw", BARCODE_128RAW}, - {"i25", BARCODE_I25}, - {"interleaved 2 of 5", BARCODE_I25}, - {"cbr", BARCODE_CBR}, - {"codabar", BARCODE_CBR}, - {"msi", BARCODE_MSI}, - {"pls", BARCODE_PLS}, - {"plessey", BARCODE_PLS}, - {"code93", BARCODE_93}, - {"93", BARCODE_93}, - - {NULL, 0} -}; - -/* - * Get encoding type from string rapresentation. - * Returns -1 on error. - */ -#ifndef HAVE_STRCASECMP /* some libs (windows, for example) have stricmp */ -# define strcasecmp stricmp -#endif - -int encode_id(char *encode_name) -{ - int i; - for (i = 0; encode_tab[i].name; i++) - if (!strcasecmp(encode_tab[i].name, encode_name)) - return encode_tab[i].type; - return -1; -} - -int list_encodes(FILE *f) /* used in the help message */ -{ - int prev = -1; - int i; - - fprintf(f, "Known encodings are (synonyms appear on the same line):"); - for (i = 0; encode_tab[i].name; i++) { - if (encode_tab[i].type != prev) - fprintf(f, "\n\t"); - else - fprintf(f, ", "); - fprintf(f, "\"%s\"", encode_tab[i].name); - prev = encode_tab[i].type; - } - fprintf(f, "\n"); - return 0; -} - - -/* - * Variables to hold cmdline arguments (or defaults) - */ - -char *ifilename, *ofilename; -int encoding_type; /* filled by get_encoding() */ -int code_width, code_height; /* "-g" for standalone codes */ -int lines, columns; /* "-t" for tables */ -int xmargin0, ymargin0; /* both for "-g" and "-t" */ -int xmargin1, ymargin1; /* same, but right and top */ -int ximargin, yimargin; /* "-m": internal margins */ -int eps, pcl, ps, noascii, nochecksum; /* boolean flags */ -int page_wid, page_hei; /* page size in points */ -char *page_name; /* name of the media */ -double unit = 1.0; /* unit specification */ - -char *prgname; /* used to print error msgs, initialized to argv[0] by main */ - -/* - * Functions to handle command line arguments - */ - -struct encode_item { - char *string; - struct encode_item *next; -} *list_head, *list_tail; - -/* each "-b" option adds a string to the input pool allocating its space */ -int get_input_string(void *arg) -{ - struct encode_item *item = malloc(sizeof(*item)); - if (!item) { - fprintf(stderr, "%s: malloc: %s\n", prgname, strerror(errno)); - return -2; - } - item->string = strdup(arg); - if (!list_head) { - list_head = list_tail = item; - } else { - list_tail->next = item; - list_tail = item; - } - item->next = NULL; - return 0; -} - -/* and this function extracts strings from the pool */ -unsigned char *retrieve_input_string(FILE *ifile) -{ - char *string; - static char fileline[128]; - - struct encode_item *item = list_head; - if (list_tail) { /* this means at least one "-b" was specified */ - if (!item) - return NULL; /* the list is empty */ - string = item->string; - list_head = item->next; - free(item); - return string; - } - - /* else, read from the file */ - if (!fgets(fileline, 128, ifile)) - return NULL; - if (fileline[strlen(fileline)-1]=='\n') - fileline[strlen(fileline)-1]= '\0'; - return strdup(fileline); -} - -/* accept a unit specification */ -int get_unit(void *arg) -{ - static struct { - char *str; - double unit; - } *ptr, unittab[] = { - {"pt", 1.0}, - {"in", 72.0}, - {"cm", 72.0/2.54}, - {"mm", 72.0/25.4}, - {NULL, 0.0} - }; - - for (ptr = unittab; ptr->str && strcmp((char *)arg, ptr->str); ptr++) - ; - unit = ptr->unit; - if (ptr->str) return 0; - - fprintf(stderr, "%s: incorrect unit \"%s\" (use one of", - prgname, (char *)arg); - for (ptr = unittab; ptr->str; ptr++) - fprintf(stderr, " \"%s\"", ptr->str); - fprintf(stderr, ")\n"); - return -2; -} - -/* convert an encoding name to an encoding integer code */ -int get_encoding(void *arg) -{ - encoding_type = encode_id((char *)arg); - if (encoding_type >=0) return 0; - fprintf(stderr, "%s: wrong encoding \"%s\"\n", prgname, - (char *)arg); - return -2; /* error, no help */ -} - -/* convert a geometry specification */ -int get_geometry(void *arg) -{ - double w = 0.0, h = 0.0; - double x = 0.0, y = 0.0; - int n; - - if (((char *)arg)[0]=='+') { - n = sscanf((char *)arg, "+%lf+%lf%s", &x, &y, (char *)arg); - } else { - n = sscanf((char *)arg, "%lfx%lf+%lf+%lf%s", &w, &h, &x, &y, - (char *)arg); - } - if (n!=4 && n!=2) { - fprintf(stderr, "%s: wrong geometry \"%s\"\n", prgname, (char *)arg); - return -2; - } - /* convert to points */ - code_width = w * unit; - code_height = h * unit; - xmargin0 = x * unit; - ymargin0 = y * unit; - return 0; -} - -/* convert a geometry specification */ -int get_table(void *arg) -{ - double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0; - int n; - - n = sscanf((char *)arg, "%dx%d+%lf+%lf-%lf-%lf", - &columns, &lines, &x0, &y0, &x1, &y1); - - if (n==1 || n==3) { /* error: 2, 4, 5, 6 are fine */ - fprintf(stderr, "%s: wrong table specification \"%s\"\n", prgname, - (char *)arg); - return -2; - } - if (n < 6) y1 = y0; /* symmetric by default */ - if (n < 5) x1 = x0; - - /* convert and return */ - xmargin0 = x0 * unit; - ymargin0 = y0 * unit; - xmargin1 = x1 * unit; - ymargin1 = y1 * unit; - return 0; -} - -/* convert an internal margin specification */ -int get_margin(void *arg) -{ - char separator; - double x,y; - int n; - - /* accept one number or two, separated by any char */ - n = sscanf((char *)arg, "%lf%c%lf", &x, &separator, &y); - - if (n==1) { - n=3; y = x; - } - if (n==3) { - ximargin = x * unit; - yimargin = y * unit; - return 0; - } - fprintf(stderr, "%s: wrong margin specification \"%s\"\n", prgname, - (char *)arg); - return -2; - return 0; -} - -/* convert a page geometry specification */ -int get_page_geometry(void *arg) -{ - int n; - double dpw, dph; /* page width, height in mm or inches */ - static char tmpstr[20]; - page_name = arg; /* if undecipherable, we won't run the program :) */ - /* - * try to decode a "mm" string (eg. "210mmx297mm" or "210x297mm") - */ - n = sscanf((char *)arg, "%lfmmx%lf", &dpw, &dph); - if (n != 2 && strlen(arg)<20) { - n = sscanf((char *)arg, "%lfx%lf%s", &dpw, &dph, tmpstr); - if (n == 3 && !strcmp(tmpstr, "mm")) { - /* Ok, convert to points: 1in is 25.4mm, 1in is also 72p */ - page_wid = (int)(dpw / 25.4 * 72.0 + 0.5); - page_hei = (int)(dph / 25.4 * 72.0 + 0.5); - return 0; - } - } - - /* - * try to decode an "in" string (eg. "8.5inx11in" or "8.5x11in") - */ - n = sscanf((char *)arg, "%lfinx%lf", &dpw, &dph); - if (n != 2 && strlen(arg)<20) { - n = sscanf((char *)arg, "%lfx%lf%s", &dpw, &dph, tmpstr); - if (n == 3 && !strcmp(tmpstr, "in")) { - page_wid = (int)(dpw * 72.0 + 0.5); /* round to points */ - page_hei = (int)(dph * 72.0 + 0.5); - return 0; - } - } - - /* - * try to decode a numeric specification - */ - n = sscanf((char *)arg, "%lfx%lf", &dpw, &dph); - if (n == 2) { - page_wid = dpw * unit; - page_hei = dph * unit; - if (unit != 1.0) { /* rebuild the page name */ - page_name = malloc(32); /* big, to avoid snprintf, missing on HP */ - if (page_name) - sprintf(page_name, "%dx%d\n", page_wid, page_hei); - } - return 0; - } - -#ifndef NO_LIBPAPER - /* - * try to use libpaper, since it is available - */ - { - const struct paper* paptr; - - paperinit(); - paptr = paperinfo(arg); - if (!paptr) { /* unknown name */ - paperdone(); - return -1; - } - page_wid = (int)(paperpswidth(paptr) + 0.5); - page_hei = (int)(paperpsheight(paptr) + 0.5); - paperdone(); - return 0; - } -#endif - /* If we got here, the argument is undecipherable: fail */ - fprintf(stderr, "%s: wrong page size specification \"%s\"\n", prgname, - (char *)arg); - return -2; -} - -/* - * The table of possible arguments - */ -struct commandline option_table[] = { - {'i', CMDLINE_S, &ifilename, NULL, NULL, NULL, - "input file (strings to encode), default is stdin"}, - {'o', CMDLINE_S, &ofilename, NULL, NULL, NULL, - "output file, default is stdout"}, - {'b', CMDLINE_S, NULL, get_input_string, NULL, NULL, - "string to encode (use input file if missing)"}, - {'e', CMDLINE_S, NULL, get_encoding, "BARCODE_ENCODING", NULL, - "encoding type (default is best fit for first string)"}, - {'u', CMDLINE_S, NULL, get_unit, "BARCODE_UNIT", NULL, - "unit (\"mm\", \"in\", ...) used to decode -g, -t, -p"}, - {'g', CMDLINE_S, NULL, get_geometry, "BARCODE_GEOMETRY", NULL, - "geometry on the page: [x][++]"}, - {'t', CMDLINE_S, NULL, get_table, "BARCODE_TABLE", NULL, - "table geometry: x[++]"}, - {'m', CMDLINE_S, NULL, get_margin, "BARCODE_MARGIN", "10", - "internal margin for each item in a table: [,]"}, - {'n', CMDLINE_NONE, &noascii, NULL, NULL, NULL, - "\"numeric\": avoid printing text along with the bars"}, - {'c', CMDLINE_NONE, &nochecksum, NULL, NULL, NULL, - "no Checksum character, if the chosen encoding allows it"}, - {'E', CMDLINE_NONE, &eps, NULL, NULL, NULL, - "print one code as eps file (default: multi-page ps)"}, - {'P', CMDLINE_NONE, &pcl, NULL, NULL, NULL, - "create PCL output instead of postscript"}, - {'p', CMDLINE_S, NULL, get_page_geometry, NULL, NULL, - "page size (refer to the man page)"}, - {0,} -}; - -#ifdef NO_STRERROR -/* - * A strerror replacement (thanks to Thad Floryan ) - */ -char *strerror(int error) -{ - static char msg[16]; - if (error >= 0 && error < sys_nerr) - return sys_errlist[error]; - sprintf(msg, "Error %d", error); - return msg; -} -#endif - -/* - * The main function - */ -int main(int argc, char **argv) -{ - struct Barcode_Item * bc; - FILE *ifile = stdin; - FILE *ofile = stdout; - char *line; - int flags=0; /* for the library */ - int page, retval; - - prgname = argv[0]; - - /* First of all, accept "--help" and "-h" as a special case */ - if (argc == 2 && (!strcmp(argv[1],"--help") || !strcmp(argv[1],"-h"))) { - commandline_errormsg(stderr, option_table, argv[0], "Options:\n"); - fprintf(stderr,"\n"); - list_encodes(stderr); - exit(1); - } - /* Also, accept "--version" as a special case */ - if (argc == 2 && (!strcmp(argv[1],"--version"))) { - printf("barcode frontend (GNU barcode) " BARCODE_VERSION "\n"); - exit(0); - } - - /* Otherwise, parse the commandline */ - retval = commandline(option_table, argc, argv, "Use: %s [options]\n"); - if (retval) { - if (retval == -1) /* help printed, complete it */ - list_encodes(stderr); - else /* no help printed, suggest it */ - fprintf(stderr, "%s: try \"%s --help\"\n", prgname, prgname); - exit(1); - } - - /* If no paper size has been specified, use the default, if any */ - if (!page_name) { - page_wid = 595; page_hei = 842; - page_name = "A4"; /* I live in Europe :) */ -#ifndef NO_LIBPAPER - get_page_geometry(systempapername()); /* or the system default */ -#endif - } - - /* FIXME: print warnings for incompatible options */ - - /* open the input stream if specified */ - if (ifilename) - ifile = fopen(ifilename,"r"); - if (!ifile) { - fprintf(stderr, "%s: %s: %s\n", argv[0], ifilename, - strerror(errno)); - exit(1); - } - - /* open the output stream if specified */ - if (ofilename) - ofile = fopen(ofilename,"w"); - if (!ofile) { - fprintf(stderr, "%s: %s: %s\n", argv[0], ofilename, - strerror(errno)); - exit(1); - } - - if (encoding_type < 0) { /* unknown type specified */ - fprintf(stderr,"%s: Unknown endoding. Try \"%s --help\"\n", - argv[0], argv[0]); - exit(1); - } - flags |= encoding_type; - if (pcl) { - flags |= BARCODE_OUT_PCL; - } else { - ps = !eps; /* a shortcut */ - if (eps) - flags |= BARCODE_OUT_EPS; /* print headers too */ - else - flags |= BARCODE_OUT_PS | BARCODE_OUT_NOHEADERS; - } - if (noascii) - flags |= BARCODE_NO_ASCII; - if (nochecksum) - flags |= BARCODE_NO_CHECKSUM; - - /* the table is not available in eps mode */ - if (eps && (lines>1 || columns>1)) { - fprintf(stderr, "%s: can't print tables in EPS format\n",argv[0]); - exit(1); - } - - if (ps) { /* The header is independent of single/table mode */ - /* Headers. Don't let the library do it, we may need multi-page */ - fprintf(ofile, "%%!PS-Adobe-2.0\n"); - /* It would be nice to know the bounding box. Leave it alone */ - fprintf(ofile, "%%%%Creator: \"barcode\", " - "libbarcode sample frontend\n"); - if (page_name) - fprintf(ofile, "%%%%DocumentPaperSizes: %s\n", page_name); - fprintf(ofile, "%%%%EndComments\n"); - fprintf(ofile, "%%%%EndProlog\n\n"); - } - - /* - * Here we are, ready to work. Handle the one-per-page case first, - * as it is shorter. - */ - if (!lines && !columns) { - page = 0; - while ( (line = retrieve_input_string(ifile)) ) { - page++; - if (ps) { - fprintf(ofile, "%%%%Page: %i %i\n\n",page,page); - } - if (Barcode_Encode_and_Print(line, ofile, code_width, code_height, - xmargin0, ymargin0, flags) < 0) { - fprintf(stderr, "%s: can't encode \"%s\"\n", argv[0], line); - } - if (eps) break; /* if output is eps, do it once only */ - if (ps) fprintf(ofile, "showpage\n"); - if (pcl) fprintf(ofile, "\f"); - } - /* no more lines, print footers */ - if (ps) { - fprintf(ofile, "%%%%Trailer\n\n"); - } - } else { - - /* table mode, the header has been already printed */ - - int xstep = (page_wid - xmargin0 - xmargin1)/columns; - int ystep = (page_hei - ymargin0 - ymargin1)/lines; - int x = columns, y = -1; /* position in the table, start off-page */ - - if (!ximargin) ximargin = BARCODE_DEFAULT_MARGIN; - if (!yimargin) yimargin = BARCODE_DEFAULT_MARGIN; - /* Assign default size unless -g did it (Joachim Reichelt) */ - if ( !code_width && !code_height) { - code_width = xstep - 2*ximargin; - code_height = ystep - 2*yimargin; - } - - page=0; - while ( (line = retrieve_input_string(ifile)) ) { - x++; /* fit x and y */ - if (x >= columns) { - x=0; y--; - if (y<0) { - y = lines-1; page++; - /* flush page */ - if (ps && page > 1) fprintf(ofile, "showpage\n"); - if (pcl && page > 1) fprintf(ofile, "\f"); - /* new page */ - if (ps) fprintf(ofile, "%%%%Page: %i %i\n\n",page,page); - } - } - - /* - * Create a barcode item. This allows to set the margin to 0, as - * we have [xy]imargin to use. But don't use Encode_and_Print(), - * unroll it here instead - */ - bc = Barcode_Create(line); - if (!bc) { - fprintf(stderr, "%s: Barcode_Create(): %s\n", argv[0], - strerror(errno)); - exit(1); - } - bc->margin = 0; - if ( (Barcode_Position(bc, code_width, code_height, - xmargin0 + ximargin + x * xstep, - ymargin0 + yimargin + y * ystep, 0.0) < 0) - || (Barcode_Encode(bc, flags) < 0) - || (Barcode_Print(bc, ofile, flags) < 0) ) { - fprintf(stderr, "%s: can't encode \"%s\": %s\n", argv[0], - line, strerror(bc->error)); - } - Barcode_Delete(bc); - } - if (ps) fprintf(ofile, "showpage\n\n%%%%Trailer\n\n"); - if (pcl) fprintf(ofile, "\f"); - } - return 0; -} - - - diff --git a/glabels2/barcode-0.98/missing b/glabels2/barcode-0.98/missing deleted file mode 100755 index d46f79f6..00000000 --- a/glabels2/barcode-0.98/missing +++ /dev/null @@ -1,198 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. -# Franc,ois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.in; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`$configure_ac'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`$configure_ac'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`$configure_ac'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff --git a/glabels2/barcode-0.98/mkinstalldirs b/glabels2/barcode-0.98/mkinstalldirs deleted file mode 100755 index 6b3b5fc5..00000000 --- a/glabels2/barcode-0.98/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id$ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/glabels2/barcode-0.98/msi.c b/glabels2/barcode-0.98/msi.c deleted file mode 100644 index 77a373b2..00000000 --- a/glabels2/barcode-0.98/msi.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * msi.c -- encoding for MSI-Plessey - * - * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include - -#include "barcode.h" - - -/* Patterns */ -static char *patterns[] = { "13", "31" }; - -static char *fillers[] = { "031", "131" }; - -static int width = 16 /* each character uses 4 patterns */, - startpos = 6 /* length of the first filler */; - -/* - * Check that the text can be encoded. Returns 0 or -1. - */ -int Barcode_msi_verify(unsigned char *text) -{ - int i; - - if (!strlen(text)) - return -1; - for (i=0; text[i]; i++) { - if (!isdigit(text[i])) - return -1; - } - return 0; -} - -static int add_one(char *ptr, int code) -{ - sprintf(ptr, "%s%s%s%s", - patterns[(code >> 3) & 1], - patterns[(code >> 2) & 1], - patterns[(code >> 1) & 1], - patterns[code & 1]); - return 0; -} - -/* - * The encoding functions fills the "partial" and "textinfo" fields. - * Lowercase chars are converted to uppercase - */ -int Barcode_msi_encode(struct Barcode_Item *bc) -{ - static char *text; - static char *partial; /* dynamic */ - static char *textinfo; /* dynamic */ - char *ptr, *textptr; - int i, code, textpos, usesum, checksum = 0; - - if (bc->partial) - free(bc->partial); - if (bc->textinfo) - free(bc->textinfo); - bc->partial = bc->textinfo = NULL; /* safe */ - - if (!bc->encoding) - bc->encoding = strdup("msi"); - - if ((bc->flags & BARCODE_NO_CHECKSUM)) - usesum = 0; - else - usesum = 1; - - text = bc->ascii; - - /* the partial code is head + 8 * (text + check) + tail + margin + term. */ - partial = malloc( 3 + 8 * (strlen(text) + 1) + 3 + 2 ); - if (!partial) { - bc->error = errno; - return -1; - } - - /* the text information is at most "nnn:fff:c " * strlen +term */ - textinfo = malloc(10*strlen(text) + 2); - if (!textinfo) { - bc->error = errno; - free(partial); - return -1; - } - - strcpy(partial, fillers[0]); - ptr = partial + strlen(partial); - textptr = textinfo; - textpos = startpos; - - for (i=0; ipartial = partial; - bc->textinfo = textinfo; - - return 0; -} diff --git a/glabels2/barcode-0.98/pcl.c b/glabels2/barcode-0.98/pcl.c deleted file mode 100644 index d5ec097a..00000000 --- a/glabels2/barcode-0.98/pcl.c +++ /dev/null @@ -1,200 +0,0 @@ -/* - * pcl.c -- printing the "partial" bar encoding in PCL format - * - * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) - * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) - * Copyright (c) 2001 Andrea Scopece (a.scopece@tin.it) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include - -#include "barcode.h" - -#define SHRINK_AMOUNT 0.15 /* shrink the bars to account for ink spreading */ - - -/* - * How do the "partial" and "textinfo" strings work? See file "ps.c" - */ - - -int Barcode_pcl_print(struct Barcode_Item *bc, FILE *f) -{ - int i, j, k, barlen; - double f1, f2, fsav=0; - int mode = '-'; /* text below bars */ - double scalef=1, xpos, x0, y0, yr; - unsigned char *ptr; - unsigned char c; - - char font_id[6]; /* default font, should be "scalable" */ - /* 0 Line printer, use on older LJet II, isn't scalable */ - /* 4148 Univers, use on LJet III series, and Lj 4L, 5L */ - /* 16602 Arial, default LJ family 4, 5, 6, Color, Djet */ - - if (!bc->partial || !bc->textinfo) { - bc->error = EINVAL; - return -1; - } - - /* - * Maybe this first part can be made common to several printing back-ends, - * we'll see how that works when other ouput engines are added - */ - - /* First, calculate barlen */ - barlen = bc->partial[0] - '0'; - for (ptr = bc->partial+1; *ptr; ptr++) - if (isdigit(*ptr)) - barlen += (*ptr - '0'); - else if (islower(*ptr)) - barlen += (*ptr - 'a'+1); - - /* The scale factor depends on bar length */ - if (!bc->scalef) { - if (!bc->width) bc->width = barlen; /* default */ - scalef = bc->scalef = (double)bc->width / (double)barlen; - } - - /* The width defaults to "just enough" */ - if (!bc->width) bc->width = barlen * scalef +1; - - /* But it can be too small, in this case enlarge and center the area */ - if (bc->width < barlen * scalef) { - int wid = barlen * scalef + 1; - bc->xoff -= (wid - bc->width)/2 ; - bc->width = wid; - /* Can't extend too far on the left */ - if (bc->xoff < 0) { - bc->width += -bc->xoff; - bc->xoff = 0; - } - } - - /* The height defaults to 80 points (rescaled) */ - if (!bc->height) bc->height = 80 * scalef; - -#if 0 - /* If too small (5 + text), enlarge and center */ - i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); - if (bc->height < i * scalef ) { - int hei = i * scalef; - bc->yoff -= (hei-bc->height)/2; - bc->height = hei; - if (bc->yoff < 0) { - bc->height += -bc->yoff; - bc->yoff = 0; - } - } -#else - /* If too small (5 + text), reduce the scale factor and center */ - i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); - if (bc->height < i * scalef ) { - double scaleg = ((double)bc->height) / i; - int wid = bc->width * scaleg / scalef; - bc->xoff += (bc->width - wid)/2; - bc->width = wid; - scalef = scaleg; - } -#endif - - /* - * deal with PCL output - */ - - xpos = bc->margin + (bc->partial[0]-'0') * scalef; - for (ptr = bc->partial+1, i=1; *ptr; ptr++, i++) { - /* special cases: '+' and '-' */ - if (*ptr == '+' || *ptr == '-') { - mode = *ptr; /* don't count it */ i++; continue; - } - - /* j is the width of this bar/space */ - if (isdigit (*ptr)) j = *ptr-'0'; - else j = *ptr-'a'+1; - if (i%2) { /* bar */ - x0 = bc->xoff + xpos; - y0 = bc->yoff + bc->margin; - yr = bc->height; - if (!(bc->flags & BARCODE_NO_ASCII)) { /* leave space for text */ - if (mode == '-') { - /* text below bars: 10 points or five points */ - yr -= (isdigit(*ptr) ? 10 : 5) * scalef; - } else { /* '+' */ - /* text above bars: 10 or 0 from bottom, and 10 from top */ - y0 += (isdigit(*ptr) ? 10 : 0) * scalef; - yr -= (isdigit(*ptr) ? 20 : 10) * scalef; - } - } - - fprintf(f,"%c&a%.0fH", 27, x0 * 10.0); - fprintf(f,"%c&a%.0fV", 27, y0 * 10.0); - fprintf(f,"%c*c%.0fH", 27, ((j*scalef)-SHRINK_AMOUNT) * 10.0); - fprintf(f,"%c*c%.0fV", 27, yr * 10.0); - fprintf(f,"%c*c0P\n", 27); - } - xpos += j * scalef; - } - - /* the text */ - - mode = '-'; /* reinstantiate default */ - if (!(bc->flags & BARCODE_NO_ASCII)) { - k=0; /* k is the "previous font size" */ - for (ptr = bc->textinfo; ptr; ptr = strchr(ptr, ' ')) { - while (*ptr == ' ') ptr++; - if (!*ptr) break; - if (*ptr == '+' || *ptr == '-') { - mode = *ptr; continue; - } - if (sscanf(ptr, "%lf:%lf:%c", &f1, &f2, &c) != 3) { - fprintf(stderr, "barcode: impossible data: %s\n", ptr); - continue; - } - - /* select a Scalable Font */ - - if (fsav != f2) - { - if ((bc->flags & BARCODE_OUT_PCL_III) == BARCODE_OUT_PCL_III) - { strcpy(font_id, "4148"); /* font Univers */ - } - else - { strcpy(font_id, "16602"); /* font Arial */ - } - - fprintf(f,"%c(8U%c(s1p%5.2fv0s0b%sT", 27, 27, f2 * scalef, font_id); - } - fsav = f2; - - fprintf(f,"%c&a%.0fH", 27, (bc->xoff + f1 * scalef + bc->margin) * 10.0); - fprintf(f,"%c&a%.0fV", 27, - mode != '-' - ? ((double)bc->yoff + bc->margin + 8*scalef) * 10.0 - : ((double)bc->yoff + bc->margin + bc->height ) * 10.0); - - fprintf(f, "%c", c); - } - - } - - return 0; -} diff --git a/glabels2/barcode-0.98/plessey.c b/glabels2/barcode-0.98/plessey.c deleted file mode 100644 index ec471005..00000000 --- a/glabels2/barcode-0.98/plessey.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * plessey.c -- encoding for Plessey - * - * Copyright (c) 2000 Leonid A. Broukhis (leob@mailcom.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include - -#include "barcode.h" - -static char * patterns[] = { "13", "31" }; - -/* this is ordered in decades to simplify encoding */ -static char alphabet[] = - "0123456789" "ABCDEF"; - -/* stop sequence may be 231311313 (barcodemill.com) */ -static char *fillers[] = { "031311331", "331311313" }; - -static int width = 16, startpos = 16; - -/* - * Check that the text can be encoded. Returns 0 or -1. - * If it's all lowecase convert to uppercase and accept it - */ -int Barcode_pls_verify(unsigned char *text) -{ - int i, upper = 0, lower = 0; - - if (!strlen(text)) - return -1; - for (i=0; text[i]; i++) { - if (!strchr(alphabet,toupper(text[i]))) - return -1; - if (isupper(text[i])) upper++; - if (islower(text[i])) lower++; - } - if (upper && lower) - return -1; - return 0; -} - -static int add_one(char *ptr, int code) -{ - sprintf(ptr, "%s%s%s%s", - patterns[code & 1], - patterns[(code >> 1) & 1], - patterns[(code >> 2) & 1], - patterns[(code >> 3) & 1] - ); - return 0; -} - -/* - * The encoding functions fills the "partial" and "textinfo" fields. - * Lowercase chars are converted to uppercase - */ -int Barcode_pls_encode(struct Barcode_Item *bc) -{ - static char *text; - static char *partial; /* dynamic */ - static char *textinfo; /* dynamic */ - char *c, *ptr, *textptr; - unsigned char *checkptr; - int i, code, textpos; - static char check[9] = {1,1,1,1,0,1,0,0,1}; - if (bc->partial) - free(bc->partial); - if (bc->textinfo) - free(bc->textinfo); - bc->partial = bc->textinfo = NULL; /* safe */ - - if (!bc->encoding) - bc->encoding = strdup("plessey"); - - text = bc->ascii; - if (!text) { - bc->error = EINVAL; - return -1; - } - /* the partial code is 8 * (head + text + check + tail) + margin + term. */ - partial = malloc( (strlen(text) + 4) * 8 + 3); - checkptr = calloc (1, strlen(text) * 4 + 8); - - if (!partial || !checkptr) { - if (partial) free(partial); - if (checkptr) free(checkptr); - bc->error = errno; - return -1; - } - - /* the text information is at most "nnn:fff:c " * strlen +term */ - textinfo = malloc(10*strlen(text) + 2); - if (!textinfo) { - bc->error = errno; - free(partial); - return -1; - } - - strcpy(partial, fillers[0]); - ptr = partial + strlen(partial); - textptr = textinfo; - textpos = startpos; - - for (i=0; ierror = EINVAL; /* impossible if text is verified */ - free(partial); - free(textinfo); - return -1; - } - code = c - alphabet; - add_one(ptr, code); - sprintf(textptr, "%i:12:%c ", textpos, toupper(text[i])); - - textpos += width; /* width of each code */ - textptr += strlen(textptr); - ptr += strlen(ptr); - checkptr[4*i] = code & 1; - checkptr[4*i+1] = (code >> 1) & 1; - checkptr[4*i+2] = (code >> 2) & 1; - checkptr[4*i+3] = (code >> 3) & 1; - } - /* The CRC checksum is required */ - for (i=0; i < 4*strlen(text); i++) { - int j; - if (checkptr[i]) - for (j = 0; j < 9; j++) - checkptr[i+j] ^= check[j]; - } - for (i = 0; i < 8; i++) { - sprintf(ptr, patterns[checkptr[strlen(text) * 4 + i]]); - ptr += 2; - } - fprintf(stderr, "CRC: "); - for (i = 0; i < 8; i++) { - fputc('0' + checkptr[strlen(text) * 4 + i], stderr); - } - fputc('\n', stderr); - strcpy(ptr, fillers[1]); - bc->partial = partial; - bc->textinfo = textinfo; - - return 0; -} diff --git a/glabels2/barcode-0.98/ps.c b/glabels2/barcode-0.98/ps.c deleted file mode 100644 index 35917517..00000000 --- a/glabels2/barcode-0.98/ps.c +++ /dev/null @@ -1,272 +0,0 @@ -/* - * ps.c -- printing the "partial" bar encoding - * - * Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org) - * Copyright (c) 1999 Prosa Srl. (prosa@prosa.it) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include - -#include "barcode.h" - -#define SHRINK_AMOUNT 0.15 /* shrink the bars to account for ink spreading */ - - -/* - * How do the "partial" and "textinfo" strings work? - * - * The first char in "partial" tells how much extra space to add to the - * left of the bars. For EAN-13, it is used to leave space to print the - * first digit, other codes may have '0' for no-extra-space-needed. - * - * The next characters are alternating bars and spaces, as multiples - * of the base dimension which is 1 unless the code is - * rescaled. Rescaling is calculated as the ratio from the requested - * width and the calculated width. Digits represent bar/space - * dimensions. Lower-case letters represent those bars that should - * extend lower than the others: 'a' is equivalent to '1', 'b' is '2' and - * so on. - * - * The "textinfo" string is made up of fields "%lf:%lf:%c" separated by - * blank space. The first integer is the x position of the character, - * the second is the font size (before rescaling) and the char item is - * the charcter to be printed. - * - * Both the "partial" and "textinfo" strings may include "-" or "+" as - * special characters (in "textinfo" the char should be a standalone - * word). They state where the text should be printed: below the bars - * ("-", default) or above the bars. This is used, for example, to - * print the add-5 and add-2 codes to the right of UPC or EAN codes - * (the add-5 extension is mostly used in ISBN codes. - */ - - -int Barcode_ps_print(struct Barcode_Item *bc, FILE *f) -{ - int i, j, k, barlen, printable=1; - double f1, f2, fsav=0; - int mode = '-'; /* text below bars */ - double scalef=1, xpos, x0, y0, yr; - unsigned char *ptr; - unsigned char c; - - if (!bc->partial || !bc->textinfo) { - bc->error = EINVAL; - return -1; - } - - - /* - * Maybe this first part can be made common to several printing back-ends, - * we'll see how that works when other ouput engines are added - */ - - /* First, calculate barlen */ - barlen = bc->partial[0] - '0'; - for (ptr = bc->partial+1; *ptr; ptr++) - if (isdigit(*ptr)) - barlen += (*ptr - '0'); - else if (islower(*ptr)) - barlen += (*ptr - 'a'+1); - - /* The scale factor depends on bar length */ - if (!bc->scalef) { - if (!bc->width) bc->width = barlen; /* default */ - scalef = bc->scalef = (double)bc->width / (double)barlen; - } - - /* The width defaults to "just enough" */ - if (!bc->width) bc->width = barlen * scalef +1; - - /* But it can be too small, in this case enlarge and center the area */ - if (bc->width < barlen * scalef) { - int wid = barlen * scalef + 1; - bc->xoff -= (wid - bc->width)/2 ; - bc->width = wid; - /* Can't extend too far on the left */ - if (bc->xoff < 0) { - bc->width += -bc->xoff; - bc->xoff = 0; - } - } - - /* The height defaults to 80 points (rescaled) */ - if (!bc->height) bc->height = 80 * scalef; - -#if 0 - /* If too small (5 + text), enlarge and center */ - i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); - if (bc->height < i * scalef ) { - int hei = i * scalef; - bc->yoff -= (hei-bc->height)/2; - bc->height = hei; - if (bc->yoff < 0) { - bc->height += -bc->yoff; - bc->yoff = 0; - } - } -#else - /* If too small (5 + text), reduce the scale factor and center */ - i = 5 + 10 * ((bc->flags & BARCODE_NO_ASCII)==0); - if (bc->height < i * scalef ) { - double scaleg = ((double)bc->height) / i; - int wid = bc->width * scaleg / scalef; - bc->xoff += (bc->width - wid)/2; - bc->width = wid; - scalef = scaleg; - } -#endif - - /* - * Ok, then deal with actual ps (eps) output - */ - - if (!(bc->flags & BARCODE_OUT_NOHEADERS)) { /* spit a header first */ - if (bc->flags & BARCODE_OUT_EPS) - fprintf(f, "%%!PS-Adobe-2.0 EPSF-1.2\n"); - else - fprintf(f, "%%!PS-Adobe-2.0\n"); - fprintf(f, "%%%%Creator: libbarcode\n"); - if (bc->flags & BARCODE_OUT_EPS) { - fprintf(f, "%%%%BoundingBox: %i %i %i %i\n", - bc->xoff, - bc->yoff, - bc->xoff + bc->width + 2* bc->margin, - bc->yoff + bc->height + 2* bc->margin); - } - fprintf(f, "%%%%EndComments\n"); - if (bc->flags & BARCODE_OUT_PS) { - fprintf(f, "%%%%EndProlog\n\n"); - fprintf(f, "%%%%Page: 1 1\n\n"); - } - } - - /* Print some informative comments */ - for (i=0; bc->ascii[i]; i++) - if (bc->ascii[i] < ' ') - printable = 0; - - fprintf(f,"%% Printing barcode for \"%s\", scaled %5.2f", - printable ? bc->ascii : "", scalef); - if (bc->encoding) - fprintf(f,", encoded using \"%s\"",bc->encoding); - fprintf(f, "\n"); - fprintf(f,"%% The space/bar succession is represented " - "by the following widths (space first):\n" - "%% "); - for (i=0; ipartial); i++) { - unsigned char c = bc->partial[i]; - if (isdigit(c)) putc(c, f); - if (islower(c)) putc(c-'a'+'1', f); - if (isupper(c)) putc(c-'A'+'1', f); - } - /* open array for "forall" */ - fprintf(f, "\n[\n%% height xpos ypos width" - " height xpos ypos width\n"); - - xpos = bc->margin + (bc->partial[0]-'0') * scalef; - for (ptr = bc->partial+1, i=1; *ptr; ptr++, i++) { - /* special cases: '+' and '-' */ - if (*ptr == '+' || *ptr == '-') { - mode = *ptr; /* don't count it */ i++; continue; - } - /* j is the width of this bar/space */ - if (isdigit (*ptr)) j = *ptr-'0'; - else j = *ptr-'a'+1; - if (i%2) { /* bar */ - x0 = bc->xoff + xpos + (j*scalef)/2; - y0 = bc->yoff + bc->margin; - yr = bc->height; - if (!(bc->flags & BARCODE_NO_ASCII)) { /* leave space for text */ - if (mode == '-') { - /* text below bars: 10 points or five points */ - y0 += (isdigit(*ptr) ? 10 : 5) * scalef; - yr -= (isdigit(*ptr) ? 10 : 5) * scalef; - } else { /* '+' */ - /* text above bars: 10 or 0 from bottom, and 10 from top */ - y0 += (isdigit(*ptr) ? 10 : 0) * scalef; - yr -= (isdigit(*ptr) ? 20 : 10) * scalef; - } - } - /* Define an array and then use "forall" (Hans Schou) */ - fprintf(f," [%5.2f %6.2f %6.2f %5.2f]%s", - yr, x0, y0, (j * scalef) - SHRINK_AMOUNT, - i%4 == 1 ? " " : "\n"); - } - xpos += j * scalef; - } - fprintf(f,"\n]\t{ {} forall setlinewidth moveto 0 exch rlineto stroke} " - "bind forall\n"); - - /* Then, the text */ - - mode = '-'; /* reinstantiate default */ - if (!(bc->flags & BARCODE_NO_ASCII)) { - fprintf(f, "[\n%% char xpos ypos fontsize\n"); - k=0; /* k is the "previous font size" */ - for (ptr = bc->textinfo; ptr; ptr = strchr(ptr, ' ')) { - while (*ptr == ' ') ptr++; - if (!*ptr) break; - if (*ptr == '+' || *ptr == '-') { - mode = *ptr; continue; - } - if (sscanf(ptr, "%lf:%lf:%c", &f1, &f2, &c) != 3) { - fprintf(stderr, "barcode: impossible data: %s\n", ptr); - continue; - } - - fprintf(f, " [("); - /* Both the backslash and the two parens are special */ - if (c=='\\' || c==')' || c=='(') - fprintf(f, "\\%c) ", c); - else - fprintf(f, "%c) ", c); - fprintf(f, "%6.2f %6.2f %5.2f]\n", - bc->xoff + f1 * scalef + bc->margin, - mode == '-' - ? (double)bc->yoff + bc->margin - : (double)bc->yoff + bc->margin+bc->height - 8*scalef, - fsav == f2 ? 0.0 : f2 * scalef); - fsav = f2; - } - fprintf(f,"] { {} forall dup 0.00 ne {\n\t" - "/Helvetica findfont exch scalefont setfont\n" - " } {pop} ifelse\n" - " moveto show} bind forall\n"); - - - } - - fprintf(f,"%% End barcode for \"%s\"\n\n", - printable ? bc->ascii : ""); - - if (!(bc->flags & BARCODE_OUT_NOHEADERS)) { - if (bc->flags & BARCODE_OUT_PS) { - fprintf(f,"showpage\n"); - fprintf(f, "%%%%Trailer\n\n"); - } - } - return 0; -} - - - - diff --git a/glabels2/barcode-0.98/sample.c b/glabels2/barcode-0.98/sample.c deleted file mode 100644 index 46e62058..00000000 --- a/glabels2/barcode-0.98/sample.c +++ /dev/null @@ -1,98 +0,0 @@ -#include -#include - -#include "barcode.h" - -int main(int argc, char **argv) -{ - int ps = 1, pcl = 0, oflags; - if (argc == 2 && !strcmp(argv[1],"-P")) { - ps = 0; pcl = 1; argc=1; - } - if (argc>2) { - fprintf(stderr, "%s: use \"%s\" for postscript or \"%s -P\" for PCL\n", - argv[0], argv[0], argv[0]); - exit(1); - } - if (pcl) { - oflags = BARCODE_OUT_PCL; - } else { - oflags = BARCODE_OUT_PS | BARCODE_OUT_NOHEADERS; - printf("%%!PS-Adobe-2.0\n"); - printf("%%%%Creator: barcode sample program\n"); - printf("%%%%EndComments\n"); - printf("%%%%EndProlog\n\n"); - printf("%%%%Page: 1 1\n\n"); - } - /* Print a few barcodes in several places in the page */ - - /* default size, bottom left */ - Barcode_Encode_and_Print("800894002700",stdout, 0, 0, 40, 40, - BARCODE_EAN | oflags); - - /* smaller */ - Barcode_Encode_and_Print("800894002700",stdout, 70, 50, 160, 55, - BARCODE_EAN | oflags); - - /* smallest */ - Barcode_Encode_and_Print("800894002700",stdout, 40, 30, 270, 70, - BARCODE_EAN | oflags); - - /* A bigger all-0 */ - Barcode_Encode_and_Print("000000000000",stdout, 170, 0, 40, 160, - BARCODE_EAN | oflags); - - /* Still bigger all-0 (but UPC, this time) */ - Barcode_Encode_and_Print("00000000000",stdout, 250, 0, 270, 160, - BARCODE_UPC | oflags); - - /* A few code-39 ones */ - Barcode_Encode_and_Print("silly code",stdout, 0, 0, 40, 320, - BARCODE_39 | oflags); - Barcode_Encode_and_Print("SAMPLE CODES",stdout, 100, 30, 400, 80, - BARCODE_39 | oflags); - - /* ISBN with add-5 */ - Barcode_Encode_and_Print("1-56592-292-1 90000",stdout, 0, 0, 40, 430, - BARCODE_ISBN | oflags); - - /* UPC with add-2 */ - Barcode_Encode_and_Print("07447084452 07",stdout, 0, 0, 300, 410, - BARCODE_UPC | oflags); - - /* code 128-C */ - Barcode_Encode_and_Print("12345678900123456789",stdout, 0, 0, 40, 530, - BARCODE_128C | oflags); - - /* and my data as code-128B autodetected */ - Barcode_Encode_and_Print("RBNLSN68T11E897W",stdout, 0, 60, 240, 510, - oflags); - /* same as code-39, forced */ - Barcode_Encode_and_Print("RBNLSN68T11E897W",stdout, 0, 60, 240, 590, - BARCODE_NO_CHECKSUM | BARCODE_39 | oflags); - - /* one interleaved 2 of 5 */ - Barcode_Encode_and_Print("0123456789",stdout, 0, 0, 40, 620, - BARCODE_I25 | oflags); - - /* upc-e and ean-8 (autotected based on code size) */ - Barcode_Encode_and_Print("012345",stdout, 0, 0, 50, 720, oflags); - Barcode_Encode_and_Print("0123456",stdout, 0, 0, 160, 720, oflags); - - - - if (pcl) { - printf("\f"); - } else { - printf("\nshowpage\n"); - printf("%%%%Trailer\n\n"); - } - return 0; -} - - - - - - - diff --git a/glabels2/configure.in b/glabels2/configure.in deleted file mode 100644 index 06bd811c..00000000 --- a/glabels2/configure.in +++ /dev/null @@ -1,228 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -AC_PREREQ(2.52) - -AC_INIT(glabels, 2.2.5, http://sourceforge.net/tracker/?func=add&group_id=46122&atid=445116) -AC_CONFIG_SRCDIR(src/glabels.c) -AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) - -AM_MAINTAINER_MODE -AM_CONFIG_HEADER(config.h) - -AC_PROG_INTLTOOL([0.21]) -PKG_PROG_PKG_CONFIG - -AM_PROG_LIBTOOL - -AC_ISC_POSIX -AC_PROG_CC -AM_PROG_CC_STDC -AC_HEADER_STDC - -GNOME_COMPILE_WARNINGS - -AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) - -GTK_DOC_CHECK(1.0) - -dnl --------------------------------------------------------------------------- -dnl - LIBGLABELS API versioning -dnl --------------------------------------------------------------------------- -dnl From the libtool manual: -dnl 1. Start with version information of `0:0:0' for each libtool library. -dnl 2. Update the version information only immediately before a public release. -dnl More frequent updates are unnecessary, and only guarantee that the current -dnl interface number gets larger faster. -dnl 3. If the library source code has changed at all since the last update, then increment -dnl revision (`c:r:a' becomes `c:r+1:a'). -dnl 4. If any interfaces have been added, removed, or changed since the last update, -dnl increment current, and set revision to 0. -dnl 5. If any interfaces have been added since the last public release, then increment age. -dnl 6. If any interfaces have been removed since the last public release, then set age -dnl to 0. -LIBGLABELS_C=6 -LIBGLABELS_R=1 -LIBGLABELS_A=1 - -LIBGLABELS_VERSION_INFO=${LIBGLABELS_C}:${LIBGLABELS_R}:${LIBGLABELS_A} -AC_SUBST(LIBGLABELS_VERSION_INFO) - - -dnl --------------------------------------------------------------------------- -dnl - Library dependencies -dnl --------------------------------------------------------------------------- -GLIB_REQUIRED=2.12.0 -GTK_REQUIRED=2.10.0 -LIBGNOME_REQUIRED=2.16.0 -LIBGNOMEUI_REQUIRED=2.16.0 -LIBXML_REQUIRED=2.6.0 -LIBGLADE_REQUIRED=2.6.0 -LIBEBOOK_REQUIRED=1.8.0 - -dnl Make above strings available for packaging files (e.g. rpm spec files) -AC_SUBST(GLIB_REQUIRED) -AC_SUBST(GTK_REQUIRED) -AC_SUBST(LIBGNOME_REQUIRED) -AC_SUBST(LIBGNOMEUI_REQUIRED) -AC_SUBST(LIBXML_REQUIRED) -AC_SUBST(LIBGLADE_REQUIRED) -AC_SUBST(LIBEBOOK_REQUIRED) - - -dnl --------------------------------------------------------------------------- -dnl - Check for evolution data server -dnl --------------------------------------------------------------------------- -AC_ARG_WITH(libebook, - [AC_HELP_STRING([--without-libebook], - [build without Evolution Data Server support])]) -have_libebook=no -if test "x$with_libebook" != xno; then - PKG_CHECK_MODULES(LIBEBOOK, libebook-1.2 >= $LIBEBOOK_REQUIRED, - [have_libebook=yes], [have_libebook=no]) -fi - -if test "x$have_libebook" = "xyes"; then - AC_DEFINE(HAVE_LIBEBOOK,1,[Define to 1 for EDS support]) - OPTIONAL_MODULES="$OPTIONAL_MODULES libebook-1.2 >= $LIBEBOOK_REQUIRED" -fi - - -dnl --------------------------------------------------------------------------- -dnl - GLABELS prerequisites -dnl --------------------------------------------------------------------------- -PKG_CHECK_MODULES(GLABELS, \ -glib-2.0 >= $GLIB_REQUIRED \ -gtk+-2.0 >= $GTK_REQUIRED \ -libgnome-2.0 >= $LIBGNOME_REQUIRED \ -libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED \ -libxml-2.0 >= $LIBXML_REQUIRED \ -libglade-2.0 >= $LIBGLADE_REQUIRED \ -$OPTIONAL_MODULES \ -) - -AC_SUBST(GLABELS_CFLAGS) -AC_SUBST(GLABELS_LIBS) - - -dnl --------------------------------------------------------------------------- -dnl - LIBGLABELS more modest prerequisites -dnl --------------------------------------------------------------------------- -PKG_CHECK_MODULES(LIBGLABELS, \ -glib-2.0 >= $GLIB_REQUIRED \ -libxml-2.0 >= $LIBXML_REQUIRED \ -) - -AC_SUBST(LIBGLABELS_CFLAGS) -AC_SUBST(LIBGLABELS_LIBS) - - -dnl --------------------------------------------------------------------------- -dnl - MYGAL prerequisites -dnl --------------------------------------------------------------------------- -PKG_CHECK_MODULES(MYGAL, \ -gtk+-2.0 >= $GTK_REQUIRED \ -libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED \ -) - -AC_SUBST(MYGAL_CFLAGS) -AC_SUBST(MYGAL_LIBS) - - -dnl --------------------------------------------------------------------------- -dnl - Enable deprecation testing -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(deprecations, - [AC_HELP_STRING([--enable-deprecations], - [warn about deprecated usages [default=no]])],, - [enable_deprecations=no]) - -if test "x$enable_deprecations" = "xyes"; then - DISABLE_DEPRECATED_CFLAGS="\ --DG_DISABLE_DEPRECATED \ --DGDK_DISABLE_DEPRECATED \ --DGTK_DISABLE_DEPRECATED \ --DGDK_PIXBUF_DISABLE_DEPRECATED \ --DGNOME_DISABLE_DEPRECATED \ --DLIBGLADE_DISABLE_DEPRECATED" - AC_SUBST(DISABLE_DEPRECATED_CFLAGS) -fi - - -dnl --------------------------------------------------------------------------- -dnl - Is freedesktop mime dbase available? -dnl --------------------------------------------------------------------------- -AC_PATH_PROG(UPDATE_MIME_DATABASE, update-mime-database, no) -AM_CONDITIONAL(HAVE_NEW_MIME, test x$UPDATE_MIME_DATABASE != xno) - -AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, update-desktop-database, no) -AM_CONDITIONAL(HAVE_NEWER_MIME, test x$UPDATE_DESKTOP_DATABASE != xno) - -AC_ARG_ENABLE(update-mimedb, AC_HELP_STRING([--disable-update-mimedb], - [disable the update-mime-database after install [default=no]]),, - enable_update_mimedb=yes) -AM_CONDITIONAL(ENABLE_UPDATE_MIMEDB, test x$enable_update_mimedb = xyes) - -AC_ARG_ENABLE(update-desktopdb, AC_HELP_STRING([--disable-update-desktopdb], - [disable the update-desktop-database after install [default=no]]),, - enable_update_desktopdb=yes) -AM_CONDITIONAL(ENABLE_UPDATE_DESKTOPDB, test x$enable_update_desktopdb = xyes) - - -dnl --------------------------------------------------------------------------- -dnl - Supported languages -dnl --------------------------------------------------------------------------- -GETTEXT_PACKAGE=glabels -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package]) - -dnl Add the languages here. -ALL_LINGUAS="fr de ja pt_BR es ru zh_TW.Big5 pl cs it eo ko" -AM_GLIB_GNU_GETTEXT - - -dnl --------------------------------------------------------------------------- -dnl - Makefiles, etc. -dnl --------------------------------------------------------------------------- -AC_OUTPUT([ -Makefile -barcode-0.98/Makefile -iec16022-0.2.1/Makefile -libglabels/Makefile -libglabels/libglabels.pc -src/Makefile -src/pixmaps/Makefile -src/stock-pixmaps/Makefile -src/mygal/Makefile -data/Makefile -data/templates/Makefile -data/pixmaps/Makefile -data/mime/Makefile -data/glade/Makefile -data/desktop/Makefile -data/dtd/Makefile -data/man/Makefile -po/Makefile.in -help/Makefile -help/C/Makefile -docs/Makefile -docs/libglabels/Makefile -glabels.spec -]) - - -dnl --------------------------------------------------------------------------- -dnl - Print configuration information -dnl --------------------------------------------------------------------------- -echo " -Configuration: - - Package: ${PACKAGE}-${VERSION}: - Installation prefix ${prefix} - Source code location: ${srcdir} - Compiler: ${CC} - Evolution Data Server support: ${have_libebook} - -" - -dnl cat ${srcdir}/MESSAGE-OF-DOOM - diff --git a/glabels2/data/Makefile.am b/glabels2/data/Makefile.am deleted file mode 100644 index 6b00c464..00000000 --- a/glabels2/data/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS = desktop dtd glade man mime pixmaps templates - - diff --git a/glabels2/data/desktop/Makefile.am b/glabels2/data/desktop/Makefile.am deleted file mode 100644 index ce2a21fc..00000000 --- a/glabels2/data/desktop/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -## Process this file with automake to produce Makefile.in - -@INTLTOOL_DESKTOP_RULE@ - -DESKTOP_IN_FILES = glabels.desktop.in -DESKTOP_FILES =$(DESKTOP_IN_FILES:.desktop.in=.desktop) - -desktopdir = $(datadir)/applications -desktop_DATA = $(DESKTOP_FILES) - -EXTRA_DIST = $(DESKTOP_IN_FILES) - -CLEANFILES = $(DESKTOP_FILES) diff --git a/glabels2/data/desktop/glabels.desktop.in b/glabels2/data/desktop/glabels.desktop.in deleted file mode 100644 index be70f928..00000000 --- a/glabels2/data/desktop/glabels.desktop.in +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -_Name=gLabels Label Designer -_Comment=Create labels, business cards and media covers -Exec=glabels %F -Icon=glabels.png -Terminal=false -Type=Application -Categories=GNOME;Application;Office; -StartupNotify=true -MimeType=application/x-glabels; diff --git a/glabels2/data/dtd/Makefile.am b/glabels2/data/dtd/Makefile.am deleted file mode 100644 index 0dce23d6..00000000 --- a/glabels2/data/dtd/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -## Process this file with automake to produce Makefile.in - -dtddir = $(datadir)/glabels/dtd - -dtd_DATA = \ - glabels-2.2.dtd - -EXTRA_DIST = $(dtd_DATA) - diff --git a/glabels2/data/dtd/glabels-2.2.dtd b/glabels2/data/dtd/glabels-2.2.dtd deleted file mode 100644 index b23519fc..00000000 --- a/glabels2/data/dtd/glabels-2.2.dtd +++ /dev/null @@ -1,381 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/glabels2/data/glade/Makefile.am b/glabels2/data/glade/Makefile.am deleted file mode 100644 index 4747c88f..00000000 --- a/glabels2/data/glade/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -## Process this file with automake to produce Makefile.in - -gladedir = $(datadir)/glabels/glade/ - -glade_DATA = \ - object-editor.glade \ - prefs-dialog.glade \ - template-designer.glade \ - merge-properties-dialog.glade \ - property-bar.glade \ - print-custom-widget.glade \ - wdgt-media-select.glade \ - wdgt-rotate-label.glade \ - new-label-dialog.glade - -EXTRA_DIST = $(glade_DATA) - - diff --git a/glabels2/data/glade/merge-properties-dialog.glade b/glabels2/data/glade/merge-properties-dialog.glade deleted file mode 100644 index b62dcedf..00000000 --- a/glabels2/data/glade/merge-properties-dialog.glade +++ /dev/null @@ -1,375 +0,0 @@ - - - - - - - True - dialog1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 6 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - 12 - True - 2 - 2 - False - 6 - 6 - - - - True - Format: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - False - True - - - 1 - 2 - 0 - 1 - fill - - - - - - True - False - 0 - - - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - - True - Location: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - - - - - True - <b>Source</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 6 - - - - 6 - 500 - 350 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - False - False - False - - - - - 0 - True - True - - - - - - 6 - True - False - 12 - - - - True - True - Select all - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - - True - True - Unselect all - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - 0 - False - True - - - - - - - - - - True - <b>Record selection/preview</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - diff --git a/glabels2/data/glade/new-label-dialog.glade b/glabels2/data/glade/new-label-dialog.glade deleted file mode 100644 index b282a365..00000000 --- a/glabels2/data/glade/new-label-dialog.glade +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - True - window1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 12 - True - False - 12 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - - - - - - - - - True - <b>Media type</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - - - - - - - - - True - <b>Label orientation</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - - diff --git a/glabels2/data/glade/object-editor.glade b/glabels2/data/glade/object-editor.glade deleted file mode 100644 index d4ba2fe4..00000000 --- a/glabels2/data/glade/object-editor.glade +++ /dev/null @@ -1,3471 +0,0 @@ - - - - - - - - 6 - True - dialog1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 12 - - - - True - False - 12 - - - - True - 0.5 - 0.5 - 0 - 0 - - - 0 - False - True - - - - - - True - <span weight="bold" size="larger">Xxx object properties</span> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - False - False - - - - - - True - True - True - True - GTK_POS_TOP - True - False - - - - 12 - True - False - 6 - - - - True - False - 0 - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - 232 - True - True - True - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 12 - - - - True - Key: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - True - - - 0 - True - True - - - - - - True - True - Insert merge field - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - 0 - False - False - - - - - False - False - - - - - - True - Text - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - False - 12 - - - - True - Family: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - True - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 12 - - - - True - Size: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 1 1 100 1 10 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 12 - - - - True - Style: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - True - GTK_RELIEF_NORMAL - True - False - False - - - - True - gtk-bold - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - False - False - - - - True - gtk-italic - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 12 - - - - True - Color: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.140000000596 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - False - 6 - - - - True - True - - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - False - 12 - - - - True - gl_object_editor_construct_color_combo - 2 - 0 - Sun, 16 Nov 2003 06:52:23 GMT - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - True - Key: - True - GTK_RELIEF_NORMAL - True - False - False - True - text_color_radio - - - 0 - False - False - - - - - - True - False - 12 - - - - True - False - True - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 12 - - - - True - Alignment: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - True - GTK_RELIEF_NORMAL - True - False - False - - - - True - gtk-justify-left - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - False - False - - - - True - gtk-justify-center - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - False - False - - - - True - gtk-justify-right - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 12 - - - - True - Line Spacing: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 2 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 5 0.01 0.1 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - True - Allow merge to automatically shrink text - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - False - False - - - - - - True - Style - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - False - 12 - - - - True - Width: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 2 - True - GTK_UPDATE_ALWAYS - False - False - 1 0.25 4 0.25 1 0 - - - 0 - False - False - - - - - - True - points - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 12 - - - - True - Color: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.140000000596 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - False - 6 - - - - True - True - - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - False - 12 - - - - True - gl_object_editor_construct_color_combo - 1 - 0 - Sun, 16 Nov 2003 06:52:23 GMT - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - True - Key: - True - GTK_RELIEF_NORMAL - True - False - False - True - line_color_radio - - - 0 - False - False - - - - - - True - False - 12 - - - - True - False - True - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - Line - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 0 - - - - True - False - 12 - - - - True - Color: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.140000000596 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - False - 6 - - - - True - True - - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - False - 12 - - - - True - gl_object_editor_construct_color_combo - 0 - 0 - Sun, 16 Nov 2003 06:52:23 GMT - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - True - Key: - True - GTK_RELIEF_NORMAL - True - False - False - True - fill_color_radio - - - 0 - False - False - - - - - - True - False - 12 - - - - True - False - True - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - Fill - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - False - 12 - - - - True - True - File: - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - Select A File - GTK_FILE_CHOOSER_ACTION_OPEN - True - True - False - -1 - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 12 - - - - True - False - True - Key: - True - GTK_RELIEF_NORMAL - True - False - False - True - img_file_radio - - - 0 - False - False - - - - - - True - False - True - - - 0 - True - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - Image - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - False - 12 - - - - True - True - Literal: - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - * - False - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 12 - - - - True - True - Key: - True - GTK_RELIEF_NORMAL - True - False - False - True - data_literal_radio - - - 0 - False - False - - - - - - True - False - True - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 12 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 2 - 2 - False - 6 - 6 - - - - True - format: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - 00000000000 00000 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - digits: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - False - 0 - - - - True - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 1 1 100 1 10 0 - - - 0 - False - False - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - 0 - True - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - Data - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - False - 12 - - - - True - Style: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - True - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - True - Text - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Checksum - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - False - 12 - - - - True - Color: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.140000000596 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - False - 6 - - - - True - True - - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - False - 12 - - - - True - gl_object_editor_construct_color_combo - 1 - 0 - Sun, 16 Nov 2003 06:52:23 GMT - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - True - Key: - True - GTK_RELIEF_NORMAL - True - False - False - True - bc_color_radio - - - 0 - False - False - - - - - - True - False - 12 - - - - True - False - True - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - False - False - - - - - True - True - - - - - - True - Style - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - 3 - 3 - False - 12 - 12 - - - - True - Width: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Height: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 2 - True - GTK_UPDATE_ALWAYS - True - False - 1 0 100 0.01 10 0 - - - 0 - False - True - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - - True - False - 12 - - - - True - True - Reset image size - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - 0 - 2 - 2 - 3 - fill - - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 2 - True - GTK_UPDATE_ALWAYS - True - False - 1 0 100 0.01 10 0 - - - 0 - False - True - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 1 - 2 - 0 - 1 - fill - fill - - - - - - True - gl_object_editor_construct_chain_button - 0 - 0 - Sat, 07 Feb 2004 02:56:47 GMT - - - 2 - 3 - 0 - 2 - - fill - - - - - 0 - True - True - - - - - False - True - - - - - - True - Size - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - 2 - 2 - False - 12 - 12 - - - - True - Length: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Angle: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 2 - True - GTK_UPDATE_ALWAYS - True - False - 1 0 100 0.01 10 0 - - - 0 - False - True - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 1 - 2 - 0 - 1 - fill - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 1 - True - GTK_UPDATE_ALWAYS - True - False - 0 -180 180 0.1 5 0 - - - 0 - False - True - - - - - - True - degrees - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - 0 - True - True - - - - - False - True - - - - - - True - Size - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - 2 - 3 - False - 12 - 12 - - - - 50 - True - X: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Y: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 0 - 1 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 1 - 2 - fill - - - - - - - True - True - 0.00999999977648 - 2 - True - GTK_UPDATE_ALWAYS - True - False - 0 0 100 0.01 10 0 - - - 1 - 2 - 0 - 1 - - - - - - - - True - True - 0.00999999977648 - 2 - True - GTK_UPDATE_ALWAYS - True - False - 0 0 100 0.01 10 0 - - - 1 - 2 - 1 - 2 - - - - - - - 0 - True - True - - - - - False - True - - - - - - True - Position - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - True - Enable shadow - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - False - 12 - - - - True - False - 12 - - - - True - X Offset: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 2 - True - GTK_UPDATE_ALWAYS - True - False - 0 0 100 0.00999999977648 10 0 - - - 0 - False - True - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 12 - - - - True - Y Offset: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 2 - True - GTK_UPDATE_ALWAYS - True - False - 0 0 100 0.00999999977648 10 0 - - - 0 - False - True - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 12 - - - - True - Color: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.140000000596 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - False - 6 - - - - True - True - - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - False - 12 - - - - True - gl_object_editor_construct_color_combo - 3 - 0 - Sun, 16 Nov 2003 06:52:23 GMT - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - True - Key: - True - GTK_RELIEF_NORMAL - True - False - False - True - shadow_color_radio - - - 0 - False - False - - - - - - True - False - 12 - - - - True - False - True - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - False - 12 - - - - True - Opacity: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 100 1 10 0 - - - 0 - False - True - - - - - - True - % - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - Shadow - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 0 - - - - - - - False - True - - - - - - True - label48 - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - diff --git a/glabels2/data/glade/prefs-dialog.glade b/glabels2/data/glade/prefs-dialog.glade deleted file mode 100644 index b169a381..00000000 --- a/glabels2/data/glade/prefs-dialog.glade +++ /dev/null @@ -1,1309 +0,0 @@ - - - - - - - True - gLabels Preferences - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - True - True - True - GTK_POS_TOP - False - False - - - - 12 - True - False - 12 - - - - True - Select locale specific behavior. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 6 - True - False - 6 - - - - True - True - Points - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Inches - True - GTK_RELIEF_NORMAL - True - False - False - True - units_points_radio - - - 0 - False - False - - - - - - True - True - Millimeters - True - GTK_RELIEF_NORMAL - True - False - False - True - units_points_radio - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - True - <span weight="bold">Units</span> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 6 - True - False - 6 - - - - True - True - US Letter - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - ISO A4 - True - GTK_RELIEF_NORMAL - True - False - False - True - page_size_us_letter_radio - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - True - <span weight="bold">Default page size</span> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - False - - - - - False - True - - - - - - True - Locale - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - False - 12 - - - - True - Select default properties for new objects. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 4 - 2 - False - 12 - 12 - - - - True - Font: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Color: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Alignment: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - 90 - True - Line Spacing: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - False - 12 - - - - True - False - True - - - 0 - True - True - - - - - - True - True - 1 - 0 - True - GTK_UPDATE_ALWAYS - False - False - 1 1 100 1 10 0 - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - False - False - - - - True - gtk-bold - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - False - False - - - - True - gtk-italic - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - 1 - 2 - 0 - 1 - fill - - - - - - True - False - 12 - - - - True - gl_object_editor_construct_color_combo - 2 - 0 - Sun, 23 Nov 2003 15:42:02 GMT - - - 0 - False - False - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - - True - False - 12 - - - - True - True - GTK_RELIEF_NORMAL - True - False - False - - - - True - gtk-justify-left - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - False - False - - - - True - gtk-justify-center - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - - True - True - GTK_RELIEF_NORMAL - True - False - False - - - - True - gtk-justify-right - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - - - - - 1 - 2 - 2 - 3 - fill - fill - - - - - - True - False - 40 - - - - True - True - 0.00999999977648 - 2 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 5 0.01 0.1 0 - - - 0 - False - False - - - - - 1 - 2 - 3 - 4 - fill - fill - - - - - 0 - True - True - - - - - - - - True - <span weight="bold">Text</span> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 2 - 2 - False - 12 - 12 - - - - 90 - True - Width: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Color: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 2 - True - GTK_UPDATE_ALWAYS - False - False - 1 0.25 4 0.25 1 0 - - - 0 - False - False - - - - - - True - points - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 1 - 2 - 0 - 1 - fill - - - - - - True - False - 12 - - - - True - gl_object_editor_construct_color_combo - 1 - 0 - Sun, 23 Nov 2003 15:42:41 GMT - - - 0 - False - False - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - 0 - True - True - - - - - - - - True - <span weight="bold">Line</span> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 1 - 2 - False - 12 - 12 - - - - 90 - True - Color: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - False - 12 - - - - True - gl_object_editor_construct_color_combo - 0 - 0 - Sun, 23 Nov 2003 15:43:12 GMT - - - 0 - False - False - - - - - 1 - 2 - 0 - 1 - fill - - - - - 0 - True - True - - - - - - - - True - <span weight="bold">Fill</span> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - False - - - - - False - True - - - - - - True - Object defaults - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - - - diff --git a/glabels2/data/glade/print-custom-widget.glade b/glabels2/data/glade/print-custom-widget.glade deleted file mode 100644 index f5063abc..00000000 --- a/glabels2/data/glade/print-custom-widget.glade +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - True - window1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 12 - True - False - 12 - - - - True - False - 0 - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - - - - - - - - - True - <b>Print control (Simple)</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - - - - - - - - - True - <b>Print control (Merge)</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - False - 0 - - - - True - True - print outlines (to test printer alignment) - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - print in reverse (i.e. a mirror image) - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - print crop marks - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - - - - - True - <b>Options</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - True - True - - - - - - - diff --git a/glabels2/data/glade/property-bar.glade b/glabels2/data/glade/property-bar.glade deleted file mode 100644 index f86d7730..00000000 --- a/glabels2/data/glade/property-bar.glade +++ /dev/null @@ -1,375 +0,0 @@ - - - - - - - True - window1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - - - - True - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_ICONS - True - False - - - - True - True - True - False - - - - True - Font family - True - False - - - - True - False - False - - - - - - - False - False - - - - - - True - True - True - False - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 6 - 0 - - - - True - Font size - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 1 250 1 10 0 - - - - - - - False - False - - - - - - True - True - True - True - - - False - False - - - - - - True - Bold - - True - gtk-bold - True - True - False - False - - - False - True - - - - - - True - Italic - - True - gtk-italic - True - True - False - False - - - False - True - - - - - - True - True - True - True - - - False - False - - - - - - True - Left align - - True - gtk-justify-left - True - True - False - False - - - False - True - - - - - - True - Center align - - True - gtk-justify-center - True - True - False - False - text_align_left_radio - - - False - True - - - - - - True - Right align - - True - gtk-justify-right - True - True - False - False - text_align_left_radio - - - False - True - - - - - - True - True - True - True - - - False - False - - - - - - True - True - True - False - - - - True - Text Color - True - False - - - - True - Text color - gl_ui_property_bar_construct_color_combo - 0 - 0 - Sun, 01 May 2005 15:21:11 GMT - - - - - - - False - False - - - - - - True - True - True - False - - - - True - Fill color - True - False - - - - True - Fill color - gl_ui_property_bar_construct_color_combo - 1 - 0 - Sun, 01 May 2005 15:21:18 GMT - - - - - - - False - False - - - - - - True - True - True - False - - - - True - Line color - True - False - - - - True - Line color - gl_ui_property_bar_construct_color_combo - 2 - 0 - Sun, 01 May 2005 15:21:24 GMT - - - - - - - False - False - - - - - - True - True - True - True - - - False - False - - - - - - True - True - True - False - - - - True - Line width - True - 1 - 2 - False - GTK_UPDATE_ALWAYS - False - False - 1 0.25 4 0.25 1 0 - - - - - False - False - - - - - - - diff --git a/glabels2/data/glade/template-designer.glade b/glabels2/data/glade/template-designer.glade deleted file mode 100644 index 22a0be78..00000000 --- a/glabels2/data/glade/template-designer.glade +++ /dev/null @@ -1,3445 +0,0 @@ - - - - - - - - True - window1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 6 - True - True - True - True - GTK_POS_TOP - False - False - - - - True - Welcome to the gLabels Template Designer. - -This dialog will assist you in the creation of a custom gLabels template. - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - False - True - - - - - - True - start_page - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 18 - True - False - 24 - - - - True - Please enter the following identifying information about the template stationery. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 6 - 2 - False - 12 - 12 - - - - True - Brand/Manufacturer: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Part #: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - False - 12 - - - - True - True - True - True - 0 - - True - * - False - - - 0 - False - False - - - - - - True - (e.g., 8163A) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - - True - False - 12 - - - - True - True - True - True - 0 - - True - * - False - - - 0 - False - False - - - - - - True - (e.g., Avery, Acme, ...) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 1 - 2 - 0 - 1 - fill - fill - - - - - - True - Description: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 4 - 5 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 4 - 5 - - - - - - - True - (e.g., "Mailing Labels," "Business Cards," ...) - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 5 - 6 - fill - - - - - - - True - False - 6 - - - - True - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - True - - - - - 1 - 2 - 2 - 3 - fill - - - - - - 0 - True - True - - - - - False - True - - - - - - True - name_page - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 18 - True - False - 24 - - - - True - Please select the page size of the template stationery. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 3 - 2 - False - 12 - 12 - - - - True - Page size: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Width: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Height: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - False - 0 - - - - True - False - True - - - 0 - False - False - - - - - - - - - 1 - 2 - 0 - 1 - fill - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 100 1 10 0 - - - 0 - False - False - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 1 - 2 - 1 - 2 - fill - fill - - - - - - True - False - 12 - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 0 100 1 10 0 - - - 0 - False - False - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 1 - 2 - 2 - 3 - fill - fill - - - - - 0 - False - False - - - - - False - True - - - - - - True - pg_size_page - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 18 - True - False - 24 - - - - True - Please select the basic shape of the labels or cards. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - True - Rectangular or square (can have rounded corners) - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - Round - True - GTK_RELIEF_NORMAL - True - False - False - True - shape_rect_radio - - - 0 - False - False - - - - - - True - True - CD/DVD (including credit card CDs) - True - GTK_RELIEF_NORMAL - True - False - False - True - shape_rect_radio - - - 0 - False - False - - - - - 0 - True - True - - - - - False - True - - - - - - True - shape_page - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 18 - True - False - 24 - - - - True - Please enter the following size parameters of a single label or card in your template. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - 6 - 3 - False - 12 - 12 - - - - True - 1. Width: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - 2. Height: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - 3. Round (radius of corner): - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - 4. Horiz. waste (overprint allowed): - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 0 - 1 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 1 - 2 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 2 - 3 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 3 - 4 - fill - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 0 - 1 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 1 - 2 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 2 - 3 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 3 - 4 - - - - - - - True - 6. Margin - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 5 - 6 - fill - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 5 - 6 - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 5 - 6 - fill - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 4 - 5 - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 4 - 5 - fill - - - - - - - True - 5. Vert. waste (overprint allowed): - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 4 - 5 - fill - - - - - - 0 - False - False - - - - - - True - 1 - 0 - 0 - 0 - - - 0 - True - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - rect_size_page - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 18 - True - False - 24 - - - - True - Please enter the following size parameters of a single label in your template. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - 3 - 3 - False - 12 - 12 - - - - True - 1. Radius: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - 2. Waste (overprint allowed): - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 0 - 1 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 1 - 2 - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 0 - 1 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 1 - 2 - fill - - - - - - - True - 3. Margin - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 2 - 3 - fill - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 2 - 3 - - - - - - 0 - False - False - - - - - - True - 1 - 0 - 0 - 0 - - - 0 - True - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - round_size_page - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 18 - True - False - 24 - - - - True - Please enter the following size parameters of a single label in your template. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - 6 - 3 - False - 12 - 12 - - - - True - 1. Outer radius: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - 2. Inner radius: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - 3. Clipping width: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - 4. Clipping height: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - 5. Waste (overprint allowed): - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 4 - 5 - fill - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 0 - 1 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 1 - 2 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 2 - 3 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 3 - 4 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 4 - 5 - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 0 - 1 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 1 - 2 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 2 - 3 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 3 - 4 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 4 - 5 - fill - - - - - - - True - 6. Margin - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 5 - 6 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 5 - 6 - fill - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 5 - 6 - - - - - - 0 - False - False - - - - - - True - 1 - 0 - 0 - 0 - - - 0 - True - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - cd_size_page - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 18 - True - False - 24 - - - - True - How many layouts will your template contain? - -A layout is a set of labels or cards that can be arranged in a simple grid. -Most templates only need one layout, as in the first example. -The second example illustrates when two layouts are needed. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - False - 0 - - - - True - 0.5 - 0.5 - 0 - 0 - - - 0 - True - True - - - - - - True - Templates needing only -one layout. - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - 0.5 - 0.5 - 0 - 0 - - - 0 - True - True - - - - - - True - Templates needing -two layouts. - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 12 - - - - True - Number of layouts: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - 0.10000000149 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 1 2 1 1 0 - - - 0 - False - False - - - - - 0 - False - False - - - - - False - True - - - - - - True - nlayouts_page - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 18 - True - False - 12 - - - - True - Please enter the following layout information. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 18 - - - - True - 7 - 4 - False - 6 - 12 - - - - True - Layout #1 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Layout #2 - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 2 - 3 - 0 - 1 - fill - - - - - - - True - Number across (nx): - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - Number down (ny): - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - Distance from left edge (x0): - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 3 - 4 - fill - - - - - - - True - Distance from top edge (y0): - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 4 - 5 - fill - - - - - - - True - Horizontal pitch (dx): - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 5 - 6 - fill - - - - - - - True - Vertical pitch (dy): - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 6 - 7 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 3 - 4 - 3 - 4 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 3 - 4 - 4 - 5 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 3 - 4 - 5 - 6 - fill - - - - - - - True - inches - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 3 - 4 - 6 - 7 - fill - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 1 100 1 10 0 - - - 1 - 2 - 1 - 2 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 1 100 1 10 0 - - - 1 - 2 - 2 - 3 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 1 100 1 10 0 - - - 2 - 3 - 1 - 2 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 1 1 100 1 10 0 - - - 2 - 3 - 2 - 3 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 3 - 4 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 2 - 3 - 3 - 4 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 4 - 5 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 2 - 3 - 4 - 5 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 5 - 6 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 2 - 3 - 5 - 6 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 1 - 2 - 6 - 7 - - - - - - - True - True - 0.00999999977648 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 0 0 100 1 10 0 - - - 2 - 3 - 6 - 7 - - - - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - True - True - - - - - - True - False - 6 - - - - True - gl_template_designer_construct_mini_preview - 175 - 200 - Mon, 29 Dec 2003 21:27:10 GMT - - - 0 - True - True - - - - - - 6 - True - True - Print test sheet - True - GTK_RELIEF_NORMAL - True - - - 0 - False - False - - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - layout_page - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - Congratulations! - -You have completed the gLabels Template Designer. -If you wish to accept and save your design, click "Apply." - -Otherwise, you may click "Cancel" to abandon your design -or "Back" to continue editing this design. - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - False - True - - - - - - True - finish_page - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - - diff --git a/glabels2/data/glade/wdgt-media-select.glade b/glabels2/data/glade/wdgt-media-select.glade deleted file mode 100644 index b4dc6c7c..00000000 --- a/glabels2/data/glade/wdgt-media-select.glade +++ /dev/null @@ -1,352 +0,0 @@ - - - - - - - True - window1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - 12 - True - True - True - True - GTK_POS_TOP - False - False - - - - True - False - 0 - - - - 12 - 480 - 320 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - False - True - - - - - - True - Recent templates - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - True - False - 0 - - - - 12 - True - False - 12 - - - - True - False - 6 - - - - True - Brand: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - True - - - 0 - False - True - - - - - 0 - False - False - - - - - - True - False - 6 - - - - True - Page size: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - True - - - 0 - False - True - - - - - 0 - False - True - - - - - - True - False - 6 - - - - True - Category: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - True - - - 0 - False - True - - - - - 0 - False - True - - - - - 0 - False - True - - - - - - 12 - 480 - 320 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - False - True - - - - - - True - Search all templates - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - - - diff --git a/glabels2/data/glade/wdgt-rotate-label.glade b/glabels2/data/glade/wdgt-rotate-label.glade deleted file mode 100644 index 89e24a03..00000000 --- a/glabels2/data/glade/wdgt-rotate-label.glade +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - True - window1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - 12 - True - False - 6 - - - - True - True - Rotate - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - - - 0 - True - True - - - - - - - diff --git a/glabels2/data/man/Makefile.am b/glabels2/data/man/Makefile.am deleted file mode 100644 index 34051904..00000000 --- a/glabels2/data/man/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -## Process this file with automake to produce Makefile.in - -man_MANS = glabels.1 - -EXTRA_DIST = $(man_MANS) - diff --git a/glabels2/data/man/glabels.1 b/glabels2/data/man/glabels.1 deleted file mode 100644 index 489b2a42..00000000 --- a/glabels2/data/man/glabels.1 +++ /dev/null @@ -1,67 +0,0 @@ -.TH glabels 1 "Jun 28, 2004" -.SH NAME -glabels \- Label and business card creation program for GNOME -.SH SYNOPSIS -.B glabels -.RI [OPTIONS] -.RI [label-filename...] -.sp -.B glabels-batch -.RI [OPTIONS] -.RI [label-filename...] -.SH DESCRIPTION -.B glabels -is a lightweight program for creating labels and business cards for -the GNOME desktop environment. It is designed to work with various -laser/ink-jet peel-off label and business card sheets that you'll find at most -office supply stores. -.B glabels -is pre-configured with templates for many of these products. -It also provides an interactive template designer for creating new -templates according to user specifications. -.PP -For full documentation see the \fBgLabels\fR online help. - -.PP -.B glabels-batch -is a command line utility to print labels previously prepared with -.B glabels. -.SH OPTIONS -.TP -\fB\-?\fR, \fB\-\-help\fR -Display a summary of available command-line options. -.TP -\fB\-\-usage\fR -Display a short usage summary. -.TP -\fB\-v\fR, \fB\-\-version\fR -Print program version information. -.PP -.B Options specific to glabels-batch -.TP -\fB\-o\fR \fIfilename\fR, \fB\-\-output\fR=\fIfilename\fR -Set output filename to \fIfilename\fR. (default="output.ps") -.TP -\fB\-s\fR \fIn\fR, \fB\-\-sheets\fR=\fIn\fR -Set number of sheets to \fIn\fR. (default=1) -.TP -\fB\-c\fR \fIn\fR, \fB\-\-copies\fR=\fIn\fR -Set number of copies to \fIn\fR. (default=1) -.TP -\fB\-f\fR \fIn\fR, \fB\-\-first\fR=\fIn\fR -Set label on first sheet to start printing from to \fIn\fR. (default=1) -.TP -\fB\-l\fR, \fB\-\-outline\fR -Print outlines around labels. This is useful for testing printer alignment -or printing proof sheets. -.TP -\fB\-r\fR, \fB\-\-reverse\fR -Print mirror image of labels. This is useful for clear labels intended to be -seen from the back through glass. - -.SH FILES -The $HOME/.glabels directory contains all user-defined templates. -.SH SEE ALSO -The gLabels homepage at . -.SH AUTHOR -Jim Evins diff --git a/glabels2/data/mime/Makefile.am b/glabels2/data/mime/Makefile.am deleted file mode 100644 index 027c1022..00000000 --- a/glabels2/data/mime/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -## Process this file with automake to produce Makefile.in - -keys_in_files=glabels.keys.in -keys_files = $(keys_in_files:.keys.in=.keys) -@INTLTOOL_KEYS_RULE@ - -xml_in_files=glabels.xml.in -xml_files = $(xml_in_files:.xml.in=.xml) -@INTLTOOL_XML_RULE@ - -mimedir = $(datadir)/mime-info -mime_DATA = $(keys_files) glabels.mime - -appdir = $(datadir)/application-registry -app_DATA = glabels.applications - -newmimedir = $(datadir)/mime/packages -newmime_DATA = $(xml_files) - -EXTRA_DIST = \ - $(keys_in_files) \ - $(mime_DATA) \ - $(app_DATA) \ - $(xml_in_files) \ - $(newmime_DATA) - -CLEANFILES = $(keys_files) $(xml_files) - - -install-data-hook: -if ENABLE_UPDATE_MIMEDB -if HAVE_NEW_MIME - $(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime" -endif -endif -if ENABLE_UPDATE_DESKTOPDB -if HAVE_NEWER_MIME - $(UPDATE_DESKTOP_DATABASE) -endif -endif - -uninstall-hook: -if ENABLE_UPDATE_MIMEDB -if HAVE_NEW_MIME - $(UPDATE_MIME_DATABASE) "$(DESTDIR)$(datadir)/mime" -endif -endif -if ENABLE_UPDATE_DESKTOPDB -if HAVE_NEWER_MIME - $(UPDATE_DESKTOP_DATABASE) -endif -endif - diff --git a/glabels2/data/mime/glabels.applications b/glabels2/data/mime/glabels.applications deleted file mode 100644 index 1391018e..00000000 --- a/glabels2/data/mime/glabels.applications +++ /dev/null @@ -1,9 +0,0 @@ -glabels - command=glabels - name=gLabels - can_open_multiple_files=true - expects_uris=false - requires_terminal=false - mime_types=application/x-glabels - uses_gnomevfs=false - diff --git a/glabels2/data/mime/glabels.keys.in b/glabels2/data/mime/glabels.keys.in deleted file mode 100644 index 596c96c7..00000000 --- a/glabels2/data/mime/glabels.keys.in +++ /dev/null @@ -1,9 +0,0 @@ -application/x-glabels: - open=glabels %f - _description=gLabels Project File - icon_filename=glabels-application-x-glabels.png - default_action_type=application - category=Documents - short_list_application_ids_for_novice_user_level=glabels - short_list_application_ids_for_intermediate_user_level=glabels - short_list_application_ids_for_advanced_user_level=glabels diff --git a/glabels2/data/mime/glabels.mime b/glabels2/data/mime/glabels.mime deleted file mode 100644 index ab2f8cd3..00000000 --- a/glabels2/data/mime/glabels.mime +++ /dev/null @@ -1,2 +0,0 @@ -application/x-glabels - ext: glabels diff --git a/glabels2/data/mime/glabels.xml.in b/glabels2/data/mime/glabels.xml.in deleted file mode 100644 index 70f0e2f3..00000000 --- a/glabels2/data/mime/glabels.xml.in +++ /dev/null @@ -1,8 +0,0 @@ - - - - <_comment>gLabels Project File - - - - diff --git a/glabels2/data/pixmaps/Makefile.am b/glabels2/data/pixmaps/Makefile.am deleted file mode 100644 index 4cebb802..00000000 --- a/glabels2/data/pixmaps/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -## Process this file with automake to produce Makefile.in - -glabels_pixmapsdir = $(datadir)/pixmaps/glabels - -glabels_pixmaps_DATA = \ - glabels-splash.png \ - glabels-about-logo.png \ - ex-rect-size.png \ - ex-round-size.png \ - ex-cd-size.png \ - ex-1layout.png \ - ex-2layouts.png - -glabels_app_icondir = $(datadir)/pixmaps - -glabels_app_icon_DATA = \ - glabels.png - -glabels_mime_icondir = $(datadir)/pixmaps - -glabels_mime_icon_DATA = \ - glabels-application-x-glabels.png - -EXTRA_DIST = $(glabels_pixmaps_DATA) \ - $(glabels_app_icon_DATA) \ - $(glabels_mime_icon_DATA) diff --git a/glabels2/data/pixmaps/ex-1layout.png b/glabels2/data/pixmaps/ex-1layout.png deleted file mode 100644 index 3045c5f2..00000000 Binary files a/glabels2/data/pixmaps/ex-1layout.png and /dev/null differ diff --git a/glabels2/data/pixmaps/ex-2layouts.png b/glabels2/data/pixmaps/ex-2layouts.png deleted file mode 100644 index 1bb5931a..00000000 Binary files a/glabels2/data/pixmaps/ex-2layouts.png and /dev/null differ diff --git a/glabels2/data/pixmaps/ex-cd-size.png b/glabels2/data/pixmaps/ex-cd-size.png deleted file mode 100644 index 68261f03..00000000 Binary files a/glabels2/data/pixmaps/ex-cd-size.png and /dev/null differ diff --git a/glabels2/data/pixmaps/ex-rect-size.png b/glabels2/data/pixmaps/ex-rect-size.png deleted file mode 100644 index 2710472f..00000000 Binary files a/glabels2/data/pixmaps/ex-rect-size.png and /dev/null differ diff --git a/glabels2/data/pixmaps/ex-round-size.png b/glabels2/data/pixmaps/ex-round-size.png deleted file mode 100644 index c45d6c3b..00000000 Binary files a/glabels2/data/pixmaps/ex-round-size.png and /dev/null differ diff --git a/glabels2/data/pixmaps/glabels-about-logo.png b/glabels2/data/pixmaps/glabels-about-logo.png deleted file mode 100644 index 9997c67e..00000000 Binary files a/glabels2/data/pixmaps/glabels-about-logo.png and /dev/null differ diff --git a/glabels2/data/pixmaps/glabels-application-x-glabels.png b/glabels2/data/pixmaps/glabels-application-x-glabels.png deleted file mode 100644 index 59c749f3..00000000 Binary files a/glabels2/data/pixmaps/glabels-application-x-glabels.png and /dev/null differ diff --git a/glabels2/data/pixmaps/glabels-splash.png b/glabels2/data/pixmaps/glabels-splash.png deleted file mode 100644 index 713cb8a2..00000000 Binary files a/glabels2/data/pixmaps/glabels-splash.png and /dev/null differ diff --git a/glabels2/data/pixmaps/glabels.png b/glabels2/data/pixmaps/glabels.png deleted file mode 100644 index afb7ecfb..00000000 Binary files a/glabels2/data/pixmaps/glabels.png and /dev/null differ diff --git a/glabels2/data/templates/Makefile.am b/glabels2/data/templates/Makefile.am deleted file mode 100644 index 236c93f5..00000000 --- a/glabels2/data/templates/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -## Process this file with automake to produce Makefile.in - -templatesdir = $(datadir)/glabels/templates - -templates_DATA = \ - paper-sizes.xml \ - categories.xml \ - avery-us-templates.xml \ - avery-iso-templates.xml \ - avery-other-templates.xml \ - zweckform-iso-templates.xml \ - brother-other-templates.xml \ - dymo-other-templates.xml \ - misc-us-templates.xml \ - misc-iso-templates.xml \ - misc-other-templates.xml - -EXTRA_DIST = $(templates_DATA) - diff --git a/glabels2/data/templates/avery-iso-templates.xml b/glabels2/data/templates/avery-iso-templates.xml deleted file mode 100644 index b0ca5765..00000000 --- a/glabels2/data/templates/avery-iso-templates.xml +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/glabels2/data/templates/avery-other-templates.xml b/glabels2/data/templates/avery-other-templates.xml deleted file mode 100644 index 796657cf..00000000 --- a/glabels2/data/templates/avery-other-templates.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/glabels2/data/templates/avery-us-templates.xml b/glabels2/data/templates/avery-us-templates.xml deleted file mode 100644 index 2c2bab62..00000000 --- a/glabels2/data/templates/avery-us-templates.xml +++ /dev/null @@ -1,807 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/glabels2/data/templates/brother-other-templates.xml b/glabels2/data/templates/brother-other-templates.xml deleted file mode 100644 index 6fb666bc..00000000 --- a/glabels2/data/templates/brother-other-templates.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - diff --git a/glabels2/data/templates/categories.xml b/glabels2/data/templates/categories.xml deleted file mode 100644 index cae2d4c3..00000000 --- a/glabels2/data/templates/categories.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/glabels2/data/templates/dymo-other-templates.xml b/glabels2/data/templates/dymo-other-templates.xml deleted file mode 100644 index b1518ce1..00000000 --- a/glabels2/data/templates/dymo-other-templates.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/glabels2/data/templates/misc-iso-templates.xml b/glabels2/data/templates/misc-iso-templates.xml deleted file mode 100644 index 1db04adc..00000000 --- a/glabels2/data/templates/misc-iso-templates.xml +++ /dev/null @@ -1,641 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/glabels2/data/templates/misc-other-templates.xml b/glabels2/data/templates/misc-other-templates.xml deleted file mode 100644 index 4f57e745..00000000 --- a/glabels2/data/templates/misc-other-templates.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - diff --git a/glabels2/data/templates/misc-us-templates.xml b/glabels2/data/templates/misc-us-templates.xml deleted file mode 100644 index 73bdb62f..00000000 --- a/glabels2/data/templates/misc-us-templates.xml +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/glabels2/data/templates/paper-sizes.xml b/glabels2/data/templates/paper-sizes.xml deleted file mode 100644 index 17149aeb..00000000 --- a/glabels2/data/templates/paper-sizes.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/glabels2/data/templates/zweckform-iso-templates.xml b/glabels2/data/templates/zweckform-iso-templates.xml deleted file mode 100644 index e3aecea4..00000000 --- a/glabels2/data/templates/zweckform-iso-templates.xml +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/glabels2/docs/Makefile.am b/glabels2/docs/Makefile.am deleted file mode 100644 index 0cb49459..00000000 --- a/glabels2/docs/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -## Process this file with automake to produce Makefile.in. - -SUBDIRS = libglabels diff --git a/glabels2/docs/libglabels/Makefile.am b/glabels2/docs/libglabels/Makefile.am deleted file mode 100644 index 28e56fdb..00000000 --- a/glabels2/docs/libglabels/Makefile.am +++ /dev/null @@ -1,69 +0,0 @@ -## Process this file with automake to produce Makefile.in - -# We require automake 1.6 at least. -AUTOMAKE_OPTIONS = 1.6 - -# This is a blank Makefile.am for using gtk-doc. -# Copy this to your project's API docs directory and modify the variables to -# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples -# of using the various options. - -# The name of the module, e.g. 'glib'. -DOC_MODULE=libglabels - -# The top-level SGML file. You can change this if you want to. -DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml - -# The directory containing the source code. Relative to $(srcdir). -# gtk-doc will search all .c & .h files beneath here for inline comments -# documenting the functions and macros. -# e.g. DOC_SOURCE_DIR=../../../gtk -DOC_SOURCE_DIR=../../libglabels - -# Extra options to pass to gtkdoc-scangobj. Not normally needed. -SCANGOBJ_OPTIONS= - -# Extra options to supply to gtkdoc-scan. -# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS= - -# Extra options to supply to gtkdoc-mkdb. -# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml -MKDB_OPTIONS=--sgml-mode --output-format=xml - -# Extra options to supply to gtkdoc-fixref. Not normally needed. -# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html -FIXXREF_OPTIONS= - -# Used for dependencies. The docs will be rebuilt if any of these change. -# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h -# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c -HFILE_GLOB= -CFILE_GLOB= - -# Header files to ignore when scanning. -# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h -IGNORE_HFILES=libglabels-private.h - -# Images to copy into HTML directory. -# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -HTML_IMAGES= - -# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). -# e.g. content_files=running.sgml building.sgml changes-2.0.sgml -content_files= - -# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. -# Only needed if you are using gtkdoc-scangobj to dynamically query widget -# signals and properties. -# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) -# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) -INCLUDES= -GTKDOC_LIBS= - -# This includes the standard gtk-doc make rules, copied by gtkdocize. -include $(top_srcdir)/gtk-doc.make - -# Other files to distribute -# e.g. EXTRA_DIST += version.xml.in -EXTRA_DIST += diff --git a/glabels2/docs/libglabels/libglabels-decl-list.txt b/glabels2/docs/libglabels/libglabels-decl-list.txt deleted file mode 100644 index d3e6343c..00000000 --- a/glabels2/docs/libglabels/libglabels-decl-list.txt +++ /dev/null @@ -1,166 +0,0 @@ -
    -xml-paper -lgl_xml_paper_read_papers_from_file -lgl_xml_paper_parse_papers_doc -lgl_xml_paper_parse_paper_node -
    - -
    -enums -lglUnitsType -
    - -
    -xml-category -lgl_xml_category_read_categories_from_file -lgl_xml_category_parse_categories_doc -lgl_xml_category_parse_category_node -
    - -
    -libglabels -
    - -
    -db -lglDbRegStatus -lgl_db_init -lgl_db_get_paper_id_list -lgl_db_free_paper_id_list -lgl_db_get_paper_name_list -lgl_db_free_paper_name_list -lgl_db_lookup_paper_from_name -lgl_db_lookup_paper_from_id -lgl_db_lookup_paper_id_from_name -lgl_db_lookup_paper_name_from_id -lgl_db_is_paper_id_known -lgl_db_is_paper_id_other -lgl_db_get_category_id_list -lgl_db_free_category_id_list -lgl_db_get_category_name_list -lgl_db_free_category_name_list -lgl_db_lookup_category_from_name -lgl_db_lookup_category_from_id -lgl_db_lookup_category_id_from_name -lgl_db_lookup_category_name_from_id -lgl_db_is_category_id_known -lgl_db_get_brand_list -lgl_db_free_brand_list -lgl_db_register_template -lgl_db_does_template_exist -lgl_db_does_template_name_exist -lgl_db_get_template_name_list_unique -lgl_db_get_template_name_list_all -lgl_db_free_template_name_list -lgl_db_lookup_template_from_name -lgl_db_print_known_papers -lgl_db_print_known_categories -lgl_db_print_known_templates -lgl_db_print_aliases -
    - -
    -str -lgl_str_utf8_casecmp -
    - -
    -template -lglTemplate -lglTemplateAlias -lglTemplateFrameAll -lglTemplateFrameRect -lglTemplateFrameRound -lglTemplateFrameCD -lglTemplateLayout -lglTemplateMarkupMargin -lglTemplateMarkupLine -lglTemplateMarkupCircle -lglTemplateMarkupRect -lglTemplateOrigin -lglTemplateFrameShape -lglTemplateFrame -lglTemplateMarkupType -lglTemplateMarkup -lgl_template_get_name -lgl_template_do_templates_match -lgl_template_does_brand_match -lgl_template_does_page_size_match -lgl_template_does_category_match -lgl_template_frame_get_size -lgl_template_frame_get_n_labels -lgl_template_frame_get_origins -lgl_template_new -lgl_template_add_alias -lgl_template_add_category -lgl_template_add_frame -lgl_template_frame_rect_new -lgl_template_alias_new -lgl_template_frame_round_new -lgl_template_frame_cd_new -lgl_template_frame_add_layout -lgl_template_frame_add_markup -lgl_template_layout_new -lgl_template_markup_margin_new -lgl_template_markup_line_new -lgl_template_markup_circle_new -lgl_template_markup_rect_new -lgl_template_dup -lgl_template_free -lgl_template_alias_dup -lgl_template_alias_free -lgl_template_frame_dup -lgl_template_frame_free -lgl_template_layout_dup -lgl_template_layout_free -lgl_template_markup_dup -lgl_template_markup_free -
    - -
    -category -lglCategory -lgl_category_new -lgl_category_dup -lgl_category_free -
    - -
    -xml -LGL_XML_NAME_SPACE -lgl_xml_get_prop_string -lgl_xml_get_prop_i18n_string -lgl_xml_get_prop_double -lgl_xml_get_prop_boolean -lgl_xml_get_prop_int -lgl_xml_get_prop_uint -lgl_xml_get_prop_length -lgl_xml_set_prop_string -lgl_xml_set_prop_double -lgl_xml_set_prop_boolean -lgl_xml_set_prop_int -lgl_xml_set_prop_uint_hex -lgl_xml_set_prop_length -lgl_xml_is_node -lgl_xml_get_node_content -lgl_xml_set_default_units -
    - -
    -xml-template -lgl_xml_template_read_templates_from_file -lgl_xml_template_parse_templates_doc -lgl_xml_template_parse_template_node -lgl_xml_template_write_templates_to_file -lgl_xml_template_write_template_to_file -lgl_xml_template_create_template_node -
    - -
    -paper -lglPaper -lgl_paper_new -lgl_paper_dup -lgl_paper_free -
    - diff --git a/glabels2/docs/libglabels/libglabels-docs.sgml b/glabels2/docs/libglabels/libglabels-docs.sgml deleted file mode 100644 index a4b5b381..00000000 --- a/glabels2/docs/libglabels/libglabels-docs.sgml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - LibGlabels Reference Manual - - - - Basic LibGlabels Usage - - - - - - - - Working Directly With LibGlabels XML - - - - - - - - Miscellaneous - - - - - diff --git a/glabels2/docs/libglabels/libglabels-overrides.txt b/glabels2/docs/libglabels/libglabels-overrides.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/glabels2/docs/libglabels/libglabels-sections.txt b/glabels2/docs/libglabels/libglabels-sections.txt deleted file mode 100644 index 658d109c..00000000 --- a/glabels2/docs/libglabels/libglabels-sections.txt +++ /dev/null @@ -1,194 +0,0 @@ -
    -db -libglabels/db.h -lglDbRegStatus - -lgl_db_init - -lgl_db_get_paper_id_list -lgl_db_free_paper_id_list -lgl_db_get_paper_name_list -lgl_db_free_paper_name_list -lgl_db_lookup_paper_from_id -lgl_db_lookup_paper_from_name -lgl_db_lookup_paper_id_from_name -lgl_db_lookup_paper_name_from_id -lgl_db_is_paper_id_known -lgl_db_is_paper_id_other - -lgl_db_get_category_id_list -lgl_db_free_category_id_list -lgl_db_get_category_name_list -lgl_db_free_category_name_list -lgl_db_lookup_category_from_id -lgl_db_lookup_category_from_name -lgl_db_lookup_category_id_from_name -lgl_db_lookup_category_name_from_id -lgl_db_is_category_id_known - -lgl_db_get_brand_list -lgl_db_free_brand_list - -lgl_db_register_template -lgl_db_does_template_exist -lgl_db_does_template_name_exist -lgl_db_get_template_name_list_unique -lgl_db_get_template_name_list_all -lgl_db_free_template_name_list -lgl_db_lookup_template_from_name - -lgl_db_print_known_papers -lgl_db_print_known_categories -lgl_db_print_known_templates -lgl_db_print_aliases -
    - -
    -template -libglabels/template.h -lglTemplate - -lglTemplateAlias - -lglTemplateFrameShape -lglTemplateFrame -lglTemplateFrameAll -lglTemplateFrameRect -lglTemplateFrameRound -lglTemplateFrameCD - -lglTemplateLayout - -lglTemplateMarkupType -lglTemplateMarkup -lglTemplateMarkupMargin -lglTemplateMarkupLine -lglTemplateMarkupCircle -lglTemplateMarkupRect - -lglTemplateOrigin - -lgl_template_new -lgl_template_dup -lgl_template_free -lgl_template_add_category -lgl_template_add_frame -lgl_template_add_alias - -lgl_template_get_name -lgl_template_do_templates_match -lgl_template_does_brand_match -lgl_template_does_page_size_match -lgl_template_does_category_match - -lgl_template_alias_new -lgl_template_alias_dup -lgl_template_alias_free - -lgl_template_frame_rect_new -lgl_template_frame_round_new -lgl_template_frame_cd_new -lgl_template_frame_dup -lgl_template_frame_free -lgl_template_frame_add_layout -lgl_template_frame_add_markup - -lgl_template_frame_get_size -lgl_template_frame_get_n_labels -lgl_template_frame_get_origins - -lgl_template_layout_new -lgl_template_layout_dup -lgl_template_layout_free - -lgl_template_markup_margin_new -lgl_template_markup_line_new -lgl_template_markup_circle_new -lgl_template_markup_rect_new -lgl_template_markup_dup -lgl_template_markup_free -
    - -
    -paper -libglabels/paper.h -lglPaper -lgl_paper_new -lgl_paper_dup -lgl_paper_free -
    - -
    -category -libglabels/category.h -lglCategory -lgl_category_new -lgl_category_dup -lgl_category_free -
    - -
    -xml-paper -libglabels/xml-paper.h -lgl_xml_paper_read_papers_from_file -lgl_xml_paper_parse_papers_doc -lgl_xml_paper_parse_paper_node -
    - -
    -xml-category -libglabels/xml-category.h -lgl_xml_category_read_categories_from_file -lgl_xml_category_parse_categories_doc -lgl_xml_category_parse_category_node -
    - -
    -xml-template -libglabels/xml-templates.h -lgl_xml_template_read_templates_from_file -lgl_xml_template_parse_templates_doc -lgl_xml_template_parse_template_node -lgl_xml_template_write_templates_to_file -lgl_xml_template_write_template_to_file -lgl_xml_template_create_template_node -
    - -
    -xml -libglabels/xml.h -LGL_XML_NAME_SPACE - -lgl_xml_get_prop_string -lgl_xml_get_prop_i18n_string -lgl_xml_get_prop_double -lgl_xml_get_prop_boolean -lgl_xml_get_prop_int -lgl_xml_get_prop_uint -lgl_xml_get_prop_length - -lgl_xml_set_prop_string -lgl_xml_set_prop_double -lgl_xml_set_prop_boolean -lgl_xml_set_prop_int -lgl_xml_set_prop_uint_hex -lgl_xml_set_prop_length - -lgl_xml_is_node -lgl_xml_get_node_content - -lgl_xml_set_default_units -
    - -
    -enums -libglabels/enums.h -lglUnitsType -
    - -
    -str -libglabels/str.h -lgl_str_utf8_casecmp -
    - diff --git a/glabels2/docs/libglabels/libglabels-undocumented.txt b/glabels2/docs/libglabels/libglabels-undocumented.txt deleted file mode 100644 index d4b8b2f7..00000000 --- a/glabels2/docs/libglabels/libglabels-undocumented.txt +++ /dev/null @@ -1,9 +0,0 @@ -99% symbol docs coverage. -141 symbols documented. -0 symbols incomplete. -1 not documented. - - -LGL_XML_NAME_SPACE - - diff --git a/glabels2/docs/libglabels/libglabels.types b/glabels2/docs/libglabels/libglabels.types deleted file mode 100644 index e69de29b..00000000 diff --git a/glabels2/docs/libglabels/tmpl/category.sgml b/glabels2/docs/libglabels/tmpl/category.sgml deleted file mode 100644 index 2143fd19..00000000 --- a/glabels2/docs/libglabels/tmpl/category.sgml +++ /dev/null @@ -1,55 +0,0 @@ - -The lglCategory Structure - - -Template category definitions - - - -This section describes a structure for representing a category of stationary and related -functions. - - - - - - - - - - - - -This structure defines a category. - - -@id: Category ID. -@name: Localized category name. - - - - - - -@id: -@name: -@Returns: - - - - - - - -@orig: -@Returns: - - - - - - - -@category: - - diff --git a/glabels2/docs/libglabels/tmpl/db.sgml b/glabels2/docs/libglabels/tmpl/db.sgml deleted file mode 100644 index 3d5d2de3..00000000 --- a/glabels2/docs/libglabels/tmpl/db.sgml +++ /dev/null @@ -1,314 +0,0 @@ - -Database - - -Database of pre-defined templates - - - -This section describes a set of functions to locate and add templates and related information in -the LibGlabels template database. - - - - - - - - - - - - -This enumeration defines a set of possible return values for lgl_db_register_template(). - - -@LGL_DB_REG_OK: Registration successful. -@LGL_DB_REG_BAD_PAPER_ID: Registration failed because paper id is unknown. -@LGL_DB_REG_BRAND_PART_EXISTS: Registration failed because template with same brand and part name/number already exists. -@LGL_DB_REG_FILE_WRITE_ERROR: Registration failed because an error while writing to disk. - - - - - - - - - - - - - -@Returns: - - - - - - - -@ids: - - - - - - - -@Returns: - - - - - - - -@names: - - - - - - - -@id: -@Returns: - - - - - - - -@name: -@Returns: - - - - - - - -@name: -@Returns: - - - - - - - -@id: -@Returns: - - - - - - - -@id: -@Returns: - - - - - - - -@id: -@Returns: - - - - - - - -@Returns: - - - - - - - -@ids: - - - - - - - -@Returns: - - - - - - - -@names: - - - - - - - -@id: -@Returns: - - - - - - - -@name: -@Returns: - - - - - - - -@name: -@Returns: - - - - - - - -@id: -@Returns: - - - - - - - -@id: -@Returns: - - - - - - - -@paper_id: -@category_id: -@Returns: - - - - - - - -@brands: - - - - - - - -@template: -@Returns: - - - - - - - -@brand: -@part: -@Returns: - - - - - - - -@name: -@Returns: - - - - - - - -@brand: -@paper_id: -@category_id: -@Returns: - - - - - - - -@brand: -@paper_id: -@category_id: -@Returns: - - - - - - - -@names: - - - - - - - -@name: -@Returns: - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@template: - - diff --git a/glabels2/docs/libglabels/tmpl/enums.sgml b/glabels2/docs/libglabels/tmpl/enums.sgml deleted file mode 100644 index b74f00d1..00000000 --- a/glabels2/docs/libglabels/tmpl/enums.sgml +++ /dev/null @@ -1,33 +0,0 @@ - -Enumerations - - -Common enumerations used by libglabels - - - -This section defines enumerations used to interact with libglabels. - - - - - - - - - - - - -This enumeration defines a set of units of distance supported by the libglabels XML distance -attributes. - - -@LGL_UNITS_POINT: Points. Encoded as "pt" in XML distance attributes. -@LGL_UNITS_INCH: Inches. Encoded as "in" in XML distance attributes. -@LGL_UNITS_MM: Millmeters. Encoded as "mm" in XML distance attributes. -@LGL_UNITS_CM: Centimeters. Encoded as "cm" in XML distance attributes. -@LGL_UNITS_PICA: Picas. Encoded as "pc" in XML distance attributes. -@LGL_UNITS_FIRST: First enumeration. Used for generic iteration through supported units.. -@LGL_UNITS_LAST: Last enumeration. Used for generic iteration through supported units. - diff --git a/glabels2/docs/libglabels/tmpl/libglabels-unused.sgml b/glabels2/docs/libglabels/tmpl/libglabels-unused.sgml deleted file mode 100644 index dc089b42..00000000 --- a/glabels2/docs/libglabels/tmpl/libglabels-unused.sgml +++ /dev/null @@ -1,1519 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -init - - - - - - - - - - - - - - - - - - - - - - - -libglabels - - - - -This section describes a set of functions for constructing new template structures. - - - - - - - - - - -Functions to help create new templates - - - - - - - -Construction Functions - - - - -This section describes a set of functions to locate pre-defined templates and add templates -to the LibGlabels template database. - - - - - - - - - - -Database of pre-defined templates - - - - - - - -Database - - - - -This section describes miscellaneous template functions. - - - - - - - - - - -Miscellaneous template functions - - - - - - - -Miscellaneous Functions - - - - - - - - - - - - - - - - - - - - - - - -template2 - - - - - - - - - - - - - - - - - - - - - - - -template3 - - - - - - - - - - - - - -@id: -@name: - - - - - - -@id: -@name: -@width: -@height: - - - - - - -@name: -@description: -@page_size: -@page_width: -@page_height: -@categories: -@frames: -@aliases: - - - - - - - - - - - - -@shape: -@id: -@layouts: -@markups: - - - - - - -@shape: -@id: -@layouts: -@markups: -@r1: -@r2: -@w: -@h: -@waste: - - - - - - -@shape: -@id: -@layouts: -@markups: -@w: -@h: -@r: -@x_waste: -@y_waste: - - - - - - -@shape: -@id: -@layouts: -@markups: -@r: -@waste: - - - - - - -@GL_TEMPLATE_FRAME_SHAPE_RECT: -@GL_TEMPLATE_FRAME_SHAPE_ROUND: -@GL_TEMPLATE_FRAME_SHAPE_CD: - - - - - - -@GL_TEMPLATE_SHAPE_RECT: -@GL_TEMPLATE_SHAPE_ROUND: -@GL_TEMPLATE_SHAPE_CD: - - - - - - -@id: -@layouts: -@markups: -@shape: - - - - - - -@nx: -@ny: -@x0: -@y0: -@dx: -@dy: - - - - - - - - - - - - -@type: -@x0: -@y0: -@r: - - - - - - -@type: -@x1: -@y1: -@x2: -@y2: - - - - - - -@type: -@size: - - - - - - -@type: -@x1: -@y1: -@w: -@h: -@r: - - - - - - -@GL_TEMPLATE_MARKUP_MARGIN: -@GL_TEMPLATE_MARKUP_LINE: -@GL_TEMPLATE_MARKUP_CIRCLE: -@GL_TEMPLATE_MARKUP_RECT: - - - - - - -@x: -@y: - - - -Enumerations for the units of length supported by libglabels. Internally -all lengths are in points. Externally libglabels supports points ("pt"), -inches ("in"), millimeters ("mm"), centimeters ("cm"), and picas ("pc"). -These units are identical to the absolute length units supported in -the CSS2 Specification (Section 4.3.2). - - -@GL_UNITS_POINT: -@GL_UNITS_INCH: -@GL_UNITS_MM: -@GL_UNITS_CM: -@GL_UNITS_PICA: -@GL_UNITS_FIRST: -@GL_UNITS_LAST: - - - - - - -@orig: -@Returns: - - - - - - -@category: - - - - - - -@names: - - - - - - -@id: -@Returns: - - - - - - -@name: -@Returns: - - - - - - -@Returns: - - - - - - - - - - - - -@name: -@Returns: - - - - - - -@id: -@Returns: - - - - - - -@id: -@name: -@Returns: - - - - - - -@orig: -@Returns: - - - - - - -@paper: - - - - - - -@ids: - - - - - - -@names: - - - - - - -@id: -@Returns: - - - - - - -@name: -@Returns: - - - - - - -@Returns: - - - - - - -@Returns: - - - - - - - - - - - - -@id: -@Returns: - - - - - - -@id: -@Returns: - - - - - - -@name: -@Returns: - - - - - - -@id: -@Returns: - - - - - - -@id: -@name: -@width: -@height: -@Returns: - - - - - - - - - - - - -@template: -@alias: - - - - - - -@template: -@category: - - - - - - -@template: -@frame: - - - - - - -@template: -@label_type: - - - - - - -@frame: -@layout: - - - - - - -@frame: -@markup: - - - - - - -@id: -@r1: -@r2: -@w: -@h: -@waste: -@Returns: - - - - - - -@template: -@category: -@Returns: - - - - - - -@template: -@page_size: -@Returns: - - - - - - -@orig: -@Returns: - - - - - - -@id: -@r1: -@r2: -@w: -@h: -@waste: -@Returns: - - - - - - -@orig_frame: -@Returns: - - - - - - -@frame: - - - - - - -@frame: -@Returns: - - - - - - -@frame: -@Returns: - - - - - - -@frame: -@w: -@h: - - - - - - -@id: -@w: -@h: -@r: -@x_waste: -@y_waste: -@Returns: - - - - - - -@id: -@r: -@waste: -@Returns: - - - - - - -@template: - - - - - - -@names: - - - - - - -@name: -@Returns: - - - - - - -@template: -@Returns: - - - - - - -@template: -@Returns: - - - - - - -@label_type: -@w: -@h: - - - - - - -@label_type: -@Returns: - - - - - - -@page_size: -@Returns: - - - - - - -@page_size: -@category: -@Returns: - - - - - - -@page_size: -@category: -@Returns: - - - - - - -@template: -@Returns: - - - - - - -@label_type: -@Returns: - - - - - - - - - - - - -@orig_ltype: -@Returns: - - - - - - -@ltype: - - - - - - -@orig_layout: -@Returns: - - - - - - -@layout: - - - - - - -@nx: -@ny: -@x0: -@y0: -@dx: -@dy: -@Returns: - - - - - - -@x0: -@y0: -@r: -@Returns: - - - - - - -@orig_markup: -@Returns: - - - - - - -@markup: - - - - - - -@x1: -@y1: -@x2: -@y2: -@Returns: - - - - - - -@size: -@Returns: - - - - - - -@x1: -@y1: -@w: -@h: -@r: -@Returns: - - - - - - -@name: -@description: -@page_size: -@page_width: -@page_height: -@Returns: - - - - - - -@template: - - - - - - - - - - - - -@id: -@w: -@h: -@r: -@x_waste: -@y_waste: -@Returns: - - - - - - -@template: - - - - - - -@id: -@r: -@waste: -@Returns: - - - - - - -@categories_doc: -@Returns: - - - - - - -@category_node: -@Returns: - - - - - - -@utf8_filename: -@Returns: - - - - - - -@node: -@Returns: - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - -@node: -@name: -@Returns: - - - - - - -@paper_node: -@Returns: - - - - - - -@papers_doc: -@Returns: - - - - - - -@utf8_filename: -@Returns: - - - - - - -@units: - - - - - - -@node: -@property: -@val: - - - - - - -@node: -@property: -@val: - - - - - - -@node: -@property: -@val: - - - - - - -@node: -@property: -@val: - - - - - - -@node: -@property: -@val: - - - - - - -@node: -@property: -@val: - - - - - - -@template: -@root: -@ns: - - - - - - -@templates: -@Returns: - - - - - - -@template_node: -@Returns: - - - - - - -@templates_doc: -@Returns: - - - - - - -@utf8_filename: -@Returns: - - - - - - -@template: -@utf8_filename: - - - - - - -@templates: -@utf8_filename: - - - - - - -@ids: - - - - - - -@names: - - - - - - -@id: -@Returns: - - - - - - -@name: -@Returns: - - - - - - -@Returns: - - - - - - -@Returns: - - - - - - - - - - - - -@name: -@Returns: - - - - - - -@id: -@Returns: - - - - - - - - - - - - -@ids: - - - - - - -@names: - - - - - - -@id: -@Returns: - - - - - - -@name: -@Returns: - - - - - - -@Returns: - - - - - - -@Returns: - - - - - - - - - - - - -@id: -@Returns: - - - - - - -@id: -@Returns: - - - - - - -@name: -@Returns: - - - - - - -@id: -@Returns: - - - - - - - - - - - - -@frame: -@layout: - - - - - - -@frame: -@markup: - - - - - - -@brands: - - - - - - -@names: - - - - - - -@name: -@Returns: - - - - - - -@page_size: -@category: -@Returns: - - - - - - -@template: -@Returns: - - - - - - -@brand: -@page_size: -@category: -@Returns: - - - - - - -@brand: -@page_size: -@category: -@Returns: - - - - - - - - - - - - -@template: - - - - - - - - - - - - -@template: - - - - - - -@templates: -@Returns: - diff --git a/glabels2/docs/libglabels/tmpl/libglabels.sgml b/glabels2/docs/libglabels/tmpl/libglabels.sgml deleted file mode 100644 index 0552a20b..00000000 --- a/glabels2/docs/libglabels/tmpl/libglabels.sgml +++ /dev/null @@ -1,19 +0,0 @@ - -libglabels - - - - - - - - - - - - - - - - - diff --git a/glabels2/docs/libglabels/tmpl/paper.sgml b/glabels2/docs/libglabels/tmpl/paper.sgml deleted file mode 100644 index dc69d746..00000000 --- a/glabels2/docs/libglabels/tmpl/paper.sgml +++ /dev/null @@ -1,61 +0,0 @@ - -The lglPaper Structure - - -Paper size definitions - - - -This section describes a structure for representing a paper size definition -and related functions. - - - - - - - - - - - - -This structure defines a paper (page) size. - - -@id: Paper size ID. -@name: Localized paper size name. -@width: Width of paper in points. -@height: Height of paper in points. -@pwg_size: PWG 5101.1-2002 size name. - - - - - - -@id: -@name: -@width: -@height: -@pwg_size: -@Returns: - - - - - - - -@orig: -@Returns: - - - - - - - -@paper: - - diff --git a/glabels2/docs/libglabels/tmpl/str.sgml b/glabels2/docs/libglabels/tmpl/str.sgml deleted file mode 100644 index 53cbd3b9..00000000 --- a/glabels2/docs/libglabels/tmpl/str.sgml +++ /dev/null @@ -1,30 +0,0 @@ - -String Utility Functions - - -String utility functions provided by libglabels - - - -This section defines string utility functions used by libglabels and of -possible use to a user of libglabels. - - - - - - - - - - - - - - - -@s1: -@s2: -@Returns: - - diff --git a/glabels2/docs/libglabels/tmpl/template.sgml b/glabels2/docs/libglabels/tmpl/template.sgml deleted file mode 100644 index e7a58879..00000000 --- a/glabels2/docs/libglabels/tmpl/template.sgml +++ /dev/null @@ -1,532 +0,0 @@ - -The lglTemplate Structure - - -How templates are represented in memory - - - -This section describes a set of structures that represent a template in memory. It also -describes functions to help create and interpret these structures. - - - - - - - - - - - - -This is the main structure of a libglabels template. A template represents a single sheet -of peel-off labels or cards. - - -@brand: Brand name of label or card. E.g. "Avery." -@part: Part name or number of label or card. E.g. "8160." -@description: A description of the template. E.g. "Mailing labels." -@paper_id: A paper ID. E.g. "A4" or "US-Letter." -@page_width: Page width in points. Used only if paper_id is "Other." -@page_height: Page height in points. Used only if paper_id is "Other." -@aliases: A list of alternate names for this template. Often a single template can be used for -multiple products. -@category_ids: A list of category IDs that this template belongs to. -@frames: A list of (#lglTemplateFrame *) structures. GLabels currently only supports one frame -per template -- future versions may support multiple frames per template. - - - -This structure defines an alias for the parent template structure. An alias is used for -different products that can use the same template. - - -@brand: Brand name of label or card. E.g. "Avery." -@part: Part name or number of label or card. E.g. "8160." - - - -This enumeration defines frame types that are supported by libglabels - - -@LGL_TEMPLATE_FRAME_SHAPE_RECT: A rectangular frame. (May have rounded corners.) -@LGL_TEMPLATE_FRAME_SHAPE_ROUND: A round frame. -@LGL_TEMPLATE_FRAME_SHAPE_CD: A CD or DVD frame. (Includes credit-card style CDs.) - - - -A union of all possible frame structures. The type of structure is indicated by the shape -member, which overlays the first field of all other member structures. - - - - - -This structure is composed of a set of fields common to all frame structures. All frame types -can be cast to this structure. - - -@shape: The shape of the frame. -@id: Reserved for future use. Should always be zero. -@layouts: A list of (#lglTemplateLayout *) structures. Typically a frame will have a single -layout, representing a simple grid of labels or cards. If the layout of labels or cards is -more complex, multiple (#lglTemplateLayout *) structures may be needed. -@markups: A list of (#lglTemplateMarkup *) structures, which represent non-printing markup lines. - - - -This structure defines the frame for a rectangular label or card. - - -@shape: Common field. Always #LGL_TEMPLATE_FRAME_SHAPE_RECT for #lglTemplateFrameRect. -@id: Common field. See #lglTemplateFrameAll. -@layouts: Common field. See #lglTemplateFrameAll. -@markups: Common field. See #lglTemplateFrameAll. -@w: Width of label or card in points. -@h: Height of label or card in points. -@r: Radius of corners in points. -@x_waste: Amount of horizontal over-print to allow in points. -@y_waste: Amount of vertical over-print to allow in points. - - - -This structure defines the frame for a round label or card. - - -@shape: Common field. Always #LGL_TEMPLATE_FRAME_SHAPE_ROUND for #lglTemplateFrameRound. -@id: Common field. See #lglTemplateFrameAll. -@layouts: Common field. See #lglTemplateFrameAll. -@markups: Common field. See #lglTemplateFrameAll. -@r: Radius of label or card in points. -@waste: Amount of over-print to allow in points. - - - -This structure defines the frame for a CD or DVD label. This structure also supports -credit-card CD labels. - - -@shape: Common field. Always #LGL_TEMPLATE_FRAME_SHAPE_CD for #lglTemplateFrameCD. -@id: Common field. See #lglTemplateFrameAll. -@layouts: Common field. See #lglTemplateFrameAll. -@markups: Common field. See #lglTemplateFrameAll. -@r1: Outer radius of label in points. -@r2: Radius of center hole in points. -@w: Clip width in points. Used for credit-card CD labels. This field is ignored if zero. -@h: Clip height in points. Used for credit-card CD labels. This field is ignored if zero. -@waste: Amount of over-print to allow in points. - - - -This structure defines a simple grid layout of labels or cards. - - -@nx: Number of labels or cards across in the grid (horizontal). -@ny: Number of labels or cards down in the grid (vertical). -@x0: Distance (in points) from the left edge of page to the left edge of the left column of -cards or labels in the layout. -@y0: Distance (in points) from the top edge of page to the top edge of the top row of -cards or labels in the layout. -@dx: Horizontal pitch of grid in points. This is the distance from left edge to left edge -(not the gap between labels or cards). -@dy: Vertical pitch of grid in points. This is the distance from top edge to top edge -(not the gap between labels or cards). - - - -This enumeration defines markup types that are supported by libglabels - - -@LGL_TEMPLATE_MARKUP_MARGIN: A margin line around perimeter of label or card. -@LGL_TEMPLATE_MARKUP_LINE: A simple line segment. -@LGL_TEMPLATE_MARKUP_CIRCLE: A circle. -@LGL_TEMPLATE_MARKUP_RECT: A rectangle. Possibly with rounded corners. - - - -A union of all possible markup structures. The type of structure is indicated by the type -member, which overlays the first field of all other member structures. - - - - - -This structure defines a simple margin markup around the perimeter of a label or card. - - -@type: Common field. Always #LGL_TEMPLATE_MARKUP_MARGIN for #lglTemplateMarkupMargin. -@size: Distance of margin from edge of label or card. - - - -This structure defines a simple line segment markup. - - -@type: Common field. Always #LGL_TEMPLATE_MARKUP_LINE for #lglTemplateMarkupLine. -@x1: Distance (in points) of first endpoint from left edge of label or card. -@y1: Distance (in points) of first endpoint from top edge of label or card. -@x2: Distance (in points) of second endpoint from left edge of label or card. -@y2: Distance (in points) of second endpoint from top edge of label or card. - - - -This structure defines a simple circle markup. - - -@type: Common field. Always #LGL_TEMPLATE_MARKUP_CIRCLE for #lglTemplateMarkupCircle. -@x0: Distance (in points) of vertex from left edge of label or card. -@y0: Distance (in points) of vertex from top edge of label or card. -@r: Radius of circle in points. - - - -This structure defines a simple rectangle markup. The rectangle can have rounded corners. - - -@type: Common field. Always #LGL_TEMPLATE_MARKUP_RECT for #lglTemplateMarkupRect. -@x1: Distance (in points) of left edge of markup from left edge of label or card. -@y1: Distance (in points) of top edge of markup from top edge of label or card. -@w: Width of rectangle in points. -@h: Height of rectangle in points. -@r: Radius of corners in points. Should be zero for sharp corners. - - - -This structure represents the cartesian coordinates of the origin of a label or card on the page. -The orign is the upper left corner of the extent of the label or card. These coordinates are -relative to the upper left corner of the page. - - -@x: Distance in points from top edge of page. -@y: Distance in points from left edge of page. - - - - - - -@brand: -@part: -@description: -@paper_id: -@page_width: -@page_height: -@Returns: - - - - - - - -@orig_template: -@Returns: - - - - - - - -@template: - - - - - - - -@template: -@category_id: - - - - - - - -@template: -@frame: - - - - - - - -@template: -@alias: - - - - - - - -@template: -@Returns: - - - - - - - -@template1: -@template2: -@Returns: - - - - - - - -@template: -@brand: -@Returns: - - - - - - - -@template: -@paper_id: -@Returns: - - - - - - - -@template: -@category_id: -@Returns: - - - - - - - -@brand: -@part: -@Returns: - - - - - - - -@orig_alias: -@Returns: - - - - - - - -@alias: - - - - - - - -@id: -@w: -@h: -@r: -@x_waste: -@y_waste: -@Returns: - - - - - - - -@id: -@r: -@waste: -@Returns: - - - - - - - -@id: -@r1: -@r2: -@w: -@h: -@waste: -@Returns: - - - - - - - -@orig_frame: -@Returns: - - - - - - - -@frame: - - - - - - - -@frame: -@layout: - - - - - - - -@frame: -@markup: - - - - - - - -@frame: -@w: -@h: - - - - - - - -@frame: -@Returns: - - - - - - - -@frame: -@Returns: - - - - - - - -@nx: -@ny: -@x0: -@y0: -@dx: -@dy: -@Returns: - - - - - - - -@orig_layout: -@Returns: - - - - - - - -@layout: - - - - - - - -@size: -@Returns: - - - - - - - -@x1: -@y1: -@x2: -@y2: -@Returns: - - - - - - - -@x0: -@y0: -@r: -@Returns: - - - - - - - -@x1: -@y1: -@w: -@h: -@r: -@Returns: - - - - - - - -@orig_markup: -@Returns: - - - - - - - -@markup: - - diff --git a/glabels2/docs/libglabels/tmpl/xml-category.sgml b/glabels2/docs/libglabels/tmpl/xml-category.sgml deleted file mode 100644 index f22b59ed..00000000 --- a/glabels2/docs/libglabels/tmpl/xml-category.sgml +++ /dev/null @@ -1,47 +0,0 @@ - -XML Category Functions - - -Functions to parse glabels XML category definition files - - - -This section describes a number of functions for parsing glabels -XML category definition files. - - - - - - - - - - - - - - - -@utf8_filename: -@Returns: - - - - - - - -@categories_doc: -@Returns: - - - - - - - -@category_node: -@Returns: - - diff --git a/glabels2/docs/libglabels/tmpl/xml-paper.sgml b/glabels2/docs/libglabels/tmpl/xml-paper.sgml deleted file mode 100644 index 0909d2cf..00000000 --- a/glabels2/docs/libglabels/tmpl/xml-paper.sgml +++ /dev/null @@ -1,47 +0,0 @@ - -XML Paper Functions - - -Functions to parse glabels XML paper definition files - - - -This section describes a number of functions for parsing glabels -XML paper definition files. - - - - - - - - - - - - - - - -@utf8_filename: -@Returns: - - - - - - - -@papers_doc: -@Returns: - - - - - - - -@paper_node: -@Returns: - - diff --git a/glabels2/docs/libglabels/tmpl/xml-template.sgml b/glabels2/docs/libglabels/tmpl/xml-template.sgml deleted file mode 100644 index 071a08ab..00000000 --- a/glabels2/docs/libglabels/tmpl/xml-template.sgml +++ /dev/null @@ -1,78 +0,0 @@ - -XML Template Functions - - -Functions to create and parse glabels XML template nodes and files - - - -This section describes a number of functions for creating and parsing -glabels XML template nodes and files. Template nodes are used in both -template files and document files. - - - - - - - - - - - - - - - -@utf8_filename: -@Returns: - - - - - - - -@templates_doc: -@Returns: - - - - - - - -@template_node: -@Returns: - - - - - - - -@templates: -@utf8_filename: -@Returns: - - - - - - - -@template: -@utf8_filename: -@Returns: - - - - - - - -@template: -@root: -@ns: - - diff --git a/glabels2/docs/libglabels/tmpl/xml.sgml b/glabels2/docs/libglabels/tmpl/xml.sgml deleted file mode 100644 index e0803379..00000000 --- a/glabels2/docs/libglabels/tmpl/xml.sgml +++ /dev/null @@ -1,194 +0,0 @@ - -XML Helper Functions - - -Functions to help format and parse glabels XML properties - - - -This section describes a number of "helper" functions for formatting and -parsing various types of properties for tags in glabels XML file formats. - - -These functions are basically wrappers to functions from libxml2. - - - - - - - - - - - - - - - - - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - - -@node: -@property: -@default_val: -@Returns: - - - - - - - -@node: -@property: -@val: - - - - - - - -@node: -@property: -@val: - - - - - - - -@node: -@property: -@val: - - - - - - - -@node: -@property: -@val: - - - - - - - -@node: -@property: -@val: - - - - - - - -@node: -@property: -@val: - - - - - - - -@node: -@name: -@Returns: - - - - - - - -@node: -@Returns: - - - - - - - -@units: - - diff --git a/glabels2/glabels.spec.in b/glabels2/glabels.spec.in deleted file mode 100644 index 6050b0d6..00000000 --- a/glabels2/glabels.spec.in +++ /dev/null @@ -1,106 +0,0 @@ -Summary: glabels is a GNOME program to create labels and business cards -Name: glabels -Version: @VERSION@ -Release: 1 -License: GPL -Group: Applications/Publishing -URL: http://glabels.sourceforge.net/ - -Source: %{name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/root-%{name}-%{version} -Prefix: %{_prefix} - -BuildRequires: gtk2-devel >= @GTK_REQUIRED@ -BuildRequires: libxml2-devel >= @LIBXML_REQUIRED@ -BuildRequires: libgnomeui-devel >= @LIBGNOMEUI_REQUIRED@ -BuildRequires: libglade2-devel >= @LIBGLADE_REQUIRED@ - -Requires: gtk2 >= @GTK_REQUIRED@ -Requires: libxml2 >= @LIBXML_REQUIRED@ -Requires: libgnomeui >= @LIBGNOMEUI_REQUIRED@ -Requires: libglade2 >= @LIBGLADE_REQUIRED@ - -%description -gLabels is a lightweight program for creating labels and -business cards for the GNOME desktop environment. -It is designed to work with various laser/ink-jet peel-off -label and business card sheets that you'll find at most office -supply stores. - -%prep -%setup - -%build -%configure -%{__make} %{?_smp_mflags} - -%install -%{__rm} -rf %{buildroot} -%makeinstall -%find_lang %{name} - -desktop-file-install --vendor gnome --delete-original \ - --add-category X-Red-Hat-Base \ - --dir %{buildroot}%{_datadir}/applications \ - %{buildroot}%{_datadir}/applications/%{name}.desktop - -%{__rm} -rf %{buildroot}/var/scrollkeeper -%{__rm} -f %{buildroot}%{_datadir}/mime/XMLnamespaces -%{__rm} -f %{buildroot}%{_datadir}/mime/globs -%{__rm} -f %{buildroot}%{_datadir}/mime/magic -%{__rm} -f %{buildroot}%{_datadir}/mime/mime.cache -%{__rm} -rf %{buildroot}%{_datadir}/mime/application -%{__rm} -rf %{buildroot}%{_datadir}/mime/aliases -%{__rm} -rf %{buildroot}%{_datadir}/mime/subclasses - - -%clean -%{__rm} -rf %{buildroot} - -%post -scrollkeeper-update -if (update-mime-database -v &> /dev/null); then - update-mime-database "%{_datadir}/mime" > /dev/null -fi - -%postun -scrollkeeper-update -if (update-mime-database -v &> /dev/null); then - update-mime-database "%{_datadir}/mime" > /dev/null -fi - -%files -f %{name}.lang -%defattr(-, root, root) -%doc README COPYING.README_FIRST COPYING COPYING-DOCS COPYING-LIBGLABELS ChangeLog NEWS AUTHORS INSTALL -%doc %{_datadir}/gnome/help/glabels/ -%{_bindir}/glabels -%{_bindir}/glabels-batch -%{_libdir}/libglabels.* -%{_libdir}/pkgconfig/libglabels.pc -%{_includedir}/libglabels/* -%{_datadir}/glabels/ -%{_datadir}/pixmaps/* -%{_datadir}/omf/ -%{_datadir}/applications/*.desktop -%{_datadir}/application-registry/* -%{_datadir}/mime-info/* -%{_datadir}/mime/packages/* -%{_datadir}/man/* -%{_datadir}/gtk-doc/html/libglabels/* - -%changelog -* Sun Aug 8 2004 Jim Evins -- Added support for freedesktop.org mime database registration - -* Sat Feb 21 2004 Jim Evins -- Added libglabels related files - -* Tue Dec 23 2003 Jim Evins -- Added support for scrollkeeper - -* Sat Oct 18 2003 Jim Evins -- Updated, based largely on Dag Wieers glabels.spec - -* Sat May 19 2001 Jim Evins -- Created - diff --git a/glabels2/gtk-doc.make b/glabels2/gtk-doc.make deleted file mode 100644 index 354ffb7c..00000000 --- a/glabels2/gtk-doc.make +++ /dev/null @@ -1,173 +0,0 @@ -# -*- mode: makefile -*- - -#################################### -# Everything below here is generic # -#################################### - -if GTK_DOC_USE_LIBTOOL -GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -else -GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -endif - -# We set GPATH here; this gives us semantics for GNU make -# which are more like other make's VPATH, when it comes to -# whether a source that is a target of one rule is then -# searched for in VPATH/GPATH. -# -GPATH = $(srcdir) - -TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) - -EXTRA_DIST = \ - $(content_files) \ - $(HTML_IMAGES) \ - $(DOC_MAIN_SGML_FILE) \ - $(DOC_MODULE)-sections.txt \ - $(DOC_MODULE)-overrides.txt - -DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ - $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp - -SCANOBJ_FILES = \ - $(DOC_MODULE).args \ - $(DOC_MODULE).hierarchy \ - $(DOC_MODULE).interfaces \ - $(DOC_MODULE).prerequisites \ - $(DOC_MODULE).signals - -REPORT_FILES = \ - $(DOC_MODULE)-undocumented.txt \ - $(DOC_MODULE)-undeclared.txt \ - $(DOC_MODULE)-unused.txt - -CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) - -if ENABLE_GTK_DOC -all-local: html-build.stamp -else -all-local: -endif - -docs: html-build.stamp - -#### scan #### - -scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) - @echo 'gtk-doc: Scanning header files' - @-chmod -R u+w $(srcdir) - cd $(srcdir) && \ - gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) - if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ - CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ - else \ - cd $(srcdir) ; \ - for i in $(SCANOBJ_FILES) ; do \ - test -f $$i || touch $$i ; \ - done \ - fi - touch scan-build.stamp - -$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp - @true - -#### templates #### - -tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt - @echo 'gtk-doc: Rebuilding template files' - @-chmod -R u+w $(srcdir) - cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) - touch tmpl-build.stamp - -tmpl.stamp: tmpl-build.stamp - @true - -tmpl/*.sgml: - @true - - -#### xml #### - -sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) - @echo 'gtk-doc: Building XML' - @-chmod -R u+w $(srcdir) - cd $(srcdir) && \ - gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) - touch sgml-build.stamp - -sgml.stamp: sgml-build.stamp - @true - -#### html #### - -html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) - @echo 'gtk-doc: Building HTML' - @-chmod -R u+w $(srcdir) - rm -rf $(srcdir)/html - mkdir $(srcdir)/html - cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) - test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) - @echo 'gtk-doc: Fixing cross-references' - cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) - touch html-build.stamp - -############## - -clean-local: - rm -f *~ *.bak - rm -rf .libs - -distclean-local: - cd $(srcdir) && \ - rm -rf xml $(REPORT_FILES) \ - $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt - -maintainer-clean-local: clean - cd $(srcdir) && rm -rf xml html - -install-data-local: - -installfiles=`echo $(srcdir)/html/*`; \ - if test "$$installfiles" = '$(srcdir)/html/*'; \ - then echo '-- Nothing to install' ; \ - else \ - $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ - for i in $$installfiles; do \ - echo '-- Installing '$$i ; \ - $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ - done; \ - echo '-- Installing $(srcdir)/html/index.sgml' ; \ - $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ - which gtkdoc-rebase >/dev/null && \ - gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \ - fi - - -uninstall-local: - rm -f $(DESTDIR)$(TARGET_DIR)/* - -# -# Require gtk-doc when making dist -# -if ENABLE_GTK_DOC -dist-check-gtkdoc: -else -dist-check-gtkdoc: - @echo "*** gtk-doc must be installed and enabled in order to make dist" - @false -endif - -dist-hook: dist-check-gtkdoc dist-hook-local - mkdir $(distdir)/tmpl - mkdir $(distdir)/xml - mkdir $(distdir)/html - -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl - -cp $(srcdir)/xml/*.xml $(distdir)/xml - cp $(srcdir)/html/* $(distdir)/html - -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ - -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ - cd $(distdir) && rm -f $(DISTCLEANFILES) - -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html - -.PHONY : dist-hook-local docs diff --git a/glabels2/help/C/Makefile.am b/glabels2/help/C/Makefile.am deleted file mode 100644 index 340802cd..00000000 --- a/glabels2/help/C/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -figdir = figures -docname = glabels -lang = C -omffile = glabels-C.omf -entities = legal.xml - -include $(top_srcdir)/xmldocs.make -dist-hook: app-dist-hook - diff --git a/glabels2/help/C/figures/glabels-template-cd.png b/glabels2/help/C/figures/glabels-template-cd.png deleted file mode 100644 index 0a3de3bf..00000000 Binary files a/glabels2/help/C/figures/glabels-template-cd.png and /dev/null differ diff --git a/glabels2/help/C/figures/glabels-template-label.png b/glabels2/help/C/figures/glabels-template-label.png deleted file mode 100644 index 87a724b9..00000000 Binary files a/glabels2/help/C/figures/glabels-template-label.png and /dev/null differ diff --git a/glabels2/help/C/figures/glabels-template-layout.png b/glabels2/help/C/figures/glabels-template-layout.png deleted file mode 100644 index c7127952..00000000 Binary files a/glabels2/help/C/figures/glabels-template-layout.png and /dev/null differ diff --git a/glabels2/help/C/figures/main-window-empty.png b/glabels2/help/C/figures/main-window-empty.png deleted file mode 100644 index 305bd609..00000000 Binary files a/glabels2/help/C/figures/main-window-empty.png and /dev/null differ diff --git a/glabels2/help/C/figures/merge-ex1-1.png b/glabels2/help/C/figures/merge-ex1-1.png deleted file mode 100644 index f8673c1d..00000000 Binary files a/glabels2/help/C/figures/merge-ex1-1.png and /dev/null differ diff --git a/glabels2/help/C/figures/merge-ex1-2.png b/glabels2/help/C/figures/merge-ex1-2.png deleted file mode 100644 index a87675aa..00000000 Binary files a/glabels2/help/C/figures/merge-ex1-2.png and /dev/null differ diff --git a/glabels2/help/C/figures/merge-ex1-3.png b/glabels2/help/C/figures/merge-ex1-3.png deleted file mode 100644 index f31ecafe..00000000 Binary files a/glabels2/help/C/figures/merge-ex1-3.png and /dev/null differ diff --git a/glabels2/help/C/figures/merge-ex1-4.png b/glabels2/help/C/figures/merge-ex1-4.png deleted file mode 100644 index 71e11864..00000000 Binary files a/glabels2/help/C/figures/merge-ex1-4.png and /dev/null differ diff --git a/glabels2/help/C/figures/merge-ex2-1.png b/glabels2/help/C/figures/merge-ex2-1.png deleted file mode 100644 index 1c64ed76..00000000 Binary files a/glabels2/help/C/figures/merge-ex2-1.png and /dev/null differ diff --git a/glabels2/help/C/figures/merge-ex2-2.png b/glabels2/help/C/figures/merge-ex2-2.png deleted file mode 100644 index e1d8f2af..00000000 Binary files a/glabels2/help/C/figures/merge-ex2-2.png and /dev/null differ diff --git a/glabels2/help/C/figures/merge-ex2-3.png b/glabels2/help/C/figures/merge-ex2-3.png deleted file mode 100644 index baac803a..00000000 Binary files a/glabels2/help/C/figures/merge-ex2-3.png and /dev/null differ diff --git a/glabels2/help/C/figures/merge-ex2-4.png b/glabels2/help/C/figures/merge-ex2-4.png deleted file mode 100644 index 62d750c6..00000000 Binary files a/glabels2/help/C/figures/merge-ex2-4.png and /dev/null differ diff --git a/glabels2/help/C/figures/object-editor-sidebar.png b/glabels2/help/C/figures/object-editor-sidebar.png deleted file mode 100644 index f0624a26..00000000 Binary files a/glabels2/help/C/figures/object-editor-sidebar.png and /dev/null differ diff --git a/glabels2/help/C/figures/print-copies.png b/glabels2/help/C/figures/print-copies.png deleted file mode 100644 index d34d03c9..00000000 Binary files a/glabels2/help/C/figures/print-copies.png and /dev/null differ diff --git a/glabels2/help/C/figures/print-merge.png b/glabels2/help/C/figures/print-merge.png deleted file mode 100644 index de654d09..00000000 Binary files a/glabels2/help/C/figures/print-merge.png and /dev/null differ diff --git a/glabels2/help/C/glabels-C.omf b/glabels2/help/C/glabels-C.omf deleted file mode 100644 index ad12113a..00000000 --- a/glabels2/help/C/glabels-C.omf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Jim Evins (evins@snaught.com) - - - gLabels - - 2004-08-09 - - - User manual for the gLabels label and business card creation program - - - user's guide - - - - - - diff --git a/glabels2/help/C/glabels.xml b/glabels2/help/C/glabels.xml deleted file mode 100644 index 3c36199b..00000000 --- a/glabels2/help/C/glabels.xml +++ /dev/null @@ -1,2136 +0,0 @@ - - - - - - gLabels"> - -]> - - - - - -
    - - - - &app; Manual V&manrevision; - - - 2003-2007 - Jim Evins - - - - - - - Jim Evins - - - &legal; - - - - - Jim - Evins - - - - - - - - - - - - - - - - - - - - - gLabels Manual V&manrevision; - &date; - - Jim Evins - evins@snaught.com - - Jim Evins - - - - - This manual describes version &appversion; of gLabels. - - - Feedback - To report a bug or make a suggestion regarding the &app; application or - this manual, follow the directions in the gLabels Contact Page. - - - - - - - gLabels - - - glabels - - - - - - - - - - Introduction - - The &app; application is a lightweight program for creating labels - and business cards for the GNOME desktop - environment. It is designed to work with various laser/ink-jet - peel-off label and business card sheets that you'll find at most - office supply stores. - - - - - - - - - - - Getting Started - - - To Start &app; - You can start &app; in the following ways: - - - - Applications menu - - Choose - - Office - gLabels - . - - - - Command line - - Type glabels, - then press Return: - - - - - - - When You Start &app; - When you start &app;, the following window is displayed. - - -
    - &app; Start Up Window - - - - - - -
    - - - - - - The &app; window contains the following elements: - - - - Menubar. - - The menus on the menubar contain all of the commands you - need to create and edit labels and business cards in - &app;. - - - - Main toolbar. - - The main toolbar contains a subset of common File and Edit - commands that you can access from the menubar. - - - - Drawing toolbar. - - The drawing toolbar contains a subset of commands for - editing the current glabels document. - - - - Display area. - - The display area is the main drawing interface to - &app;. - - - - Object sidebar. - - The object sidebar provides an interface for viewing and - editing all properties of an individual object. - - - - Properties toolbar. - - The properties toolbar contains a set of tools to - manipulate the properties of selected objects and set default - properties for new objects. - - - - Statusbar. - - The statusbar displays information about current - &app; activity and contextual - information about the menu items. - - - -
    -
    - - - - - - - - Usage - - - - To Create a New Label or Card - - To create a new label or business card, choose - File New - - to display the New Label or Card dialog. Select - the media type and orientation for the new document, - then click OK. A new document is - displayed in the display area of the &app; - window. - - If your particular media type is missing from this dialog, - see - - - - - - To Open a File - - To open a file, choose - File Open - to display the Open File dialog. - Select the file that you want to open, then click - OK. The file is displayed in the display area - of the &app; window. - - You can also open multiple files in - &app;. The application creates a separate - application window for each open file. - - The application records the paths and filenames of the - most recent files that you have edited and displays the files as menu - items on the - FileRecent Files - menu. - - - - - - To Open Multiple Files from a Command Line - - You can run &app; from a command line - and open a single file or multiple files. To open multiple files from - a command line, type the following command, then press - Return: - - glabels - file1.glabels file2.glabels file3.glabels - - - When the application starts, the files that you specify are - displayed in separate &app; windows. - - - - - - To Save a File - - You can save files in the following ways: - - - - - To save changes to an existing file, choose - File - Save . - - - - - To save a new file or to save an existing file under a new - filename, choose File - Save As . Enter a name - for the file in the Save As dialog box, - then click OK. - - - - - - - - - To Change Label Properties - - To change the media type and/or orientation of a label, choose - File - Properties to display the - Label properties dialog. Select the - new media type and orientation for the document, then click - OK. - - - - - - To Create a Custom Template - - To create a new custom template, choose - File - Template Designer ... - to display the Template Designer dialog. - This dialog will assist you in creating a custom template for - most types of label or card stationery that you may encounter. - - If you prefer, you can create your templates manually. - For this option see - - - - - - - To Close a File - - To close the current document, choose - File - Close to close the application - window. If the current document is modified, a confirmation dialog - will be presented, allowing you to save the document or cancel - the command. If the window being closed is the only open window, - &app; will exit. - - - - - - To Quit <application>&app;</application> - - To quit &app;, choose - File - Quit . This is equivalent - to closing all open windows. See - . - - - - - - To Print Labels or Cards - - To print labels or cards, choose - File Print - to display the Print dialog. - Once print options have been selected, click Print - to print the labels or cards. To simply preview the results, - click Print Preview instead. - - The Print dialog allows you to specify the - following print options: - - - The Labels Tab of the Print Dialog - - - - - Print control (Simple) - - - For simple labels or cards (no document merge), the job - tabbed section contains the following copy controls. - - - - - - The number of copies of the label can be selected by - choosing the number of full sheets to print, or a specific - subset of labels on a single sheet. - - The mini-preview can also be used to graphically select - the subset of labels by clicking the first label on the - mini-preview and dragging to the last label. - - - - - - Print control (Merge) - - - For labels or cards using the document merge (also known - as "mail merge") capability, the job tabbed section contains - the following merge controls instead of copy controls. - - - - - - The total number of labels or cards printed is the - product of the number of records in the merge source and - the number of copies selected. If multiple copies are - selected, these can be either collated (copies of the - same record grouped together) or un-collated (one copy - each record is printed before next copy). - - Printing can begin on any label on the first sheet. - This can be selected with the Start on - label spinbutton. - - The mini-preview can also be used to graphically select - this first label, by clicking on the desired label in the - mini-preview. - - - - - Options - - The following options can also be selected. - - - print outlines - Print outlines of labels. This option is useful for - dry-runs, to test printer alignment. - - - print in reverse - Prints the labels as mirror images. This option is - useful for printing on clear labels that will be viewed - from the reverse side (e.g. in a car window). - - - print crop marks - Prints crop marks along the edge of the sheet. - This option is useful for printing on blank stock, to - be cut after printing. This option does not work well - with all templates. - - - - - - - - - - - - To Create New Objects - - Objects are created by choosing the appropriate selection under - the Objects - Create Object submenu or - the Drawing Toolbar. This will place the - display area into object creation mode as indicated by its cursor. - To return to the default object selection mode without creating - an object, choose Objects - Select Mode . This will - return the display area's cursor to the default selection arrow. - - The following describes the object creation mode for each object - type: - - - - - Text - - Click the desired location of the upper left corner of the - text object. New text objects are initialized with the - string "Text." To change this text, or other properties, see - . - - - - - Box - - Click the desired location of the upper left corner of the - box object and drag to the desired location of the lower right - corner. If you simply click in a single location, a square - box will be created. To change properties of the box object, see - . - - - - - Line - - Click the desired location of one end of the - line object and drag to the desired location of the other end. - If you simply click in a single location, a diagonal line - will be created. To change properties of the line object, see - . - - - - - Ellipse - - Click the desired location of the upper left corner of the - ellipse object and drag to the desired location of the lower - right corner. If you simply click in a single location, a circle - will be created. To change properties of the ellipse object, see - . - - - - - Image - - Click the desired location of the upper left corner of the - image object and drag to the desired location of the lower - right corner. If you simply click in a single location, a square - will be created. New image objects are initialized with a - simple checkerboard image. To change this image, or other - properties of the image object, see - . - - - - - Barcode - - Click the desired location of the upper left corner of the - barcode object. New barcode objects are initialized to a - POSTNET barcode with representative data. To change data - and properties of the barcode object, see - . - - - - - - - - - - - To Select Objects - - A prerequisite for performing operations on objects is the - selection of individual objects or groups of objects. The - display area must be in the object selection mode to create new - selections, as indicated by an arrow cursor. The object - selection mode is selected by the - Objects - Select Mode menu item, - or the corresponding command on the Drawing - Toolbar. - - - - - Selecting a single object - - A single object can be selected simply by clicking - on the desired object in the display area. - Once selected the object will be highlighted with a set of - resizing handles. - - - - - Aggregate object selections - - Multiple objects can be selected by first selecting the first - object as above and then by holding the Ctrl - key while selecting additional objects. - Individual objects can be added to an existing selection - at any time by holding the Ctrl key while - selecting the desired objects. All objects can also be - selected by using the Edit - Select All - menu item. All objects in an aggregate object selection will be - highlighted. - - - - - Area selections - - Multiple objects can also be selected by clicking an empty - area and dragging to form a rectangular area. When released, - all objects contained in the area will form an aggregate - selection. An area selection can be used to add to an existing - selection by holding the Ctrl key while - performing the selection. - - - - - Unselecting objects - - Individual objects can be removed from an existing - selection by holding the Ctrl key while - clicking on a previously selected object. An entire selection - can be dismissed by using the - Edit Un-select All - menu item - or by simply clicking any empty space in the display area. - Once an object is unselected its highlight is removed. - - - - - - - - - - Clipboard Commands - - Object selections can be manipulated using the standard clipboard - operations Cut, - Copy, Paste, - and Delete. - - - - - - - - CtrlX - - Cut - - - - Moves selected objects to the clipboard. The objects are - then available for pasting back into the current document or - another document. - - - - - - - - CtrlC - - Copy - - - - Copies selected objects to the clipboard without deleting - them. The objects are then available for pasting back into - the current document or another document. - - - - - - - - CtrlV - - Paste - - - - Pastes objects from the clipboard into the current document. - &app; can only paste objects from - another &app; document. - - - - - - - - Delete - - Delete - - - - Deletes selected objects without placing them on the - clipboard. - - - - - - - - - - To Edit Object Properties - - Most object properties can be modified through the object - editor sidebar, illustrated below. To use the object editor, - a single object must first be selected. See - . - - -
    - Object Editor Sidebar - - - - - - -
    - - - The object editor will contain a subset of the following - tabbed sections, depending on object type: - - - Text Tabbed Section (Text objects) - - This section contains a small editor for changing the content - of a text object. It also contains a dropdown menu of available - document merge keys, that can be inserted into text. - - - - - Image Tabbed Section (Image objecs) - - This section contains a file entry with preview to select - image files. The browse button can be used to easily locate - image files. Alternatively, a document merge key can be used - instead to provide a filename at print time. - - - - - Data Tabbed Section (Barcode objecs) - - This section contains a text entry to enter literal barcode - data. Alternatively, a document merge key can be used to - provide this data at print time. - - - - - Style Tabbed Section (Text objects) - - This section contains controls to select text properties, - including font family, font size, font weight, color, and - text justification. - - - - - Style Tabbed Section (Barcode objecs) - - This section contains controls to select barcode properties, - including barcode style, color, whether to print text, and whether - to include a checksum digit. - - - - - Line Tabbed Section - - This section contains controls to select properties of lines - and outlines. These properties include line width and color. - - - - - Fill Tabbed Section - - This section contains controls to select fill properties of box - and ellipse objects. Currently the only fill property is fill - color. - - - - - Size Tabbed Section (All except line objects) - - This section contains controls to select the width and height - of an object. A checkbox is provided, so that the current aspect - ratio can be locked while manipulating the width and height controls. - Image objects also provide a button to reset the size to the - image's natural size (Assumes 72DPI). - - - - - Size Tabbed Section (Line objects) - - This section contains controls to select the length and angle - of a line object. - - - - - Position Tabbed Section - - This section contains controls to change the position of an - object. - - - - - - Shadow Tabbed Section (All except image and barcode objects) - - This section contains controls to add a shadow to an object. - - - - -
    - - - - Other Manipulations of Objects - - Objects can also be manipulated in the following ways. - - - Moving and Resizing Objects - - Objects can be moved by simply clicking on a selected - object and dragging the object to its new location. If the object - is part of an aggregate selection, all objects in the selection - will move with the object being dragged, maintaining their relative - positions to one another. If no object is selected, clicking on - an object will create a new selection containing that object. - See . - - A selected object can be resized by clicking one of its resize - handle and dragging it to obtain the new size. - - - - - Changing Stacking Order - - Stacking order refers to relative position in the z-axis of - objects. That is when objects overlap, which object will appear - on top of the other. By default, newer objects will appear above - older objects. To change this order, select one or more objects - and choose Objects - Order - Bring to Front - to raise the selection to the top of the stacking - order, or choose Objects - Order - Send to Back - to lower the selection to the bottom of the - stacking order. These menuitems are also available by right-clicking - the display area when there is a non-empty selection. - - - - - Rotating and Flipping Objects - - Objects can be rotated 90 degrees in either direction, or flipped - horizontally or vertically, by choosing the appropriate menuitem - in the Objects - Rotate/Flip sub-menu. These - menuitems are also available by right-clicking - the display area when there is a non-empty selection. - - - - - Aligning Objects - - Objects can be aligned horizontally or vertically, relative to - one another, or relative to the center line of the label, by - choosing the appropriate menuitem from the - Objects - Align Horizontal - or Objects - Align Horizontal sub-menus. - These menuitems are also available by right-clicking - the display area when there is a non-empty selection. - - - - - Using the Property Bar - - The property bar can be used to change some common properties - of objects en-masse. These properties include font family, font - size, font weight, text alignment, text color, fill color, line - or outline color, and line width. The property bar also controls - the defaults for these properties for any newly created objects. - - - - - - - - - - - Performing a Document Merge - - Document Merge (sometimes called "Mail Merge") is a powerful - feature that allows a unique label or card to be printed for each - record in an external data source. - - The first step to performing a document merge is to prepare - a source document that contains your merge data. This data could - be mailing addresses or any other data that you wish to create - unique labels or cards for. Currently back-ends only exist for - text files and the evolution data server -- others are planned. The currently - supported text-file format is very simple: each line is a record; - fields are delimited by commas (CSV), tabs, or colons; and newlines - can be embedded into fields by using the "\n" entity. This file - could be created using any text editor or could be created by - another program or script. A common way of creating CSV files is - to export them from a spreadsheet program. - - A label must then be configured to "point at" this data file. - To configure the merge properties of a document, choose - Objects - Merge Properties menu item - to display the merge properties dialog. This - dialog is used to select the exact data file format and file - name (location) of the merge data. - - Finally, once the label has been configured for a data file, - field keys can be inserted into text objects and used as source - or data for barcode objects and image filenames for image objects. - See for more information - on using merge data for these object types. - - Now that your label is configured, gLabels will print a unique - label for each record in your source document -- substituting fields - from each record for field keys in the all text, barcode, and - image objects. - - See for a detailed - tutorial on the document merge feature. - - - - - -
    - - - - - - - - Settings - To configure &app;, choose - - Settings - Preferences - . The - Preferences dialog contains the following tabbed - sections: - - - - - - - - - - - - - - Locale - - - - Units - - Use this radio button group to specify your prefered units. - Select one of the following options: - - - - Points - Use points (1 point = 1/72 in = 0.352778 mm). - - - - Inches - Use inches. - - - - Millimeters - Use millimeters. - - - Default: - Inches. - - - - - Default page size - - Use this radio button group to specify your prefered page size. - This will make it quicker for you to locate media types when creating a new - label or card. - - - - US Letter - Most of your media will be of the US Letter page size (8.5 x 11 inches). - - - - ISO A4 - Most of your media will be of the ISO A4 page size (210 x 297 mm). - - - Default: - US Letter. - - - - - - - - Object defaults - - - - Text - - Use these controls to set the default properties of new text objects. - These properties are - - - - Font - These controls are used to select font family and font size, and - whether the font should bold or in italics. - - - - Color - This control selects the default text color. - - - - Alignment - These controls are used to select the default text alignment (left, center or right). - - - - - - - Line - - Use these controls to set the default properties of lines and outlines of - new objects. These properties are - - - - Width - This control selects the default line width. - - - - Color - This control selects the default line color. - - - - - - - Fill - - Use these controls to set the default fill properties of - new objects. These properties are - - - - Color - This control selects the default fill color. - - - - - - - - - - - - - - Document Merge Tutorial - - Document Merge (sometimes called "Mail Merge") is a powerful - feature that allows a unique label or card to be printed for each - record in an external data source. It is however, the most mis-understood - feature of glabels. The following examples - will step through a couple of common tasks using the document merge - feature. - - - Example 1: Name Tags - - In this example we are organizing an orientation party for the new - crew members of our ship. We have a list of freshman crew members that we - created in gnumeric and exported as the following - CSV file. We could have created this file by using a text editor, but heck it - is the 23rd century. - - -Name,Department,SN -"Jim Kirk",Management,"SC937-0176 CEC" -"Mr. Spock",Sciences,S179-276SP -"Leonard McCoy",Medicine,unknown -"Montgomery Scott",Engineering,SE-197-54T - - - In glabels we have created a new glabels - document using the Avery 5395 "Name Badge Labels" template. Next we use the - Objects - Merge Properties menu item to display - the merge properties dialog. We use this dialog to - select the source type (in our case CSV) and the merge source (filename) as - shown. - - -
    - Merge properties dialog - - - - - - -
    - - - Before applying the merge source, we uncheck the first record since it is only - column headers from our original gnumeric spreadsheet - and would simply waste our first label. We could also unselect any other records - that we didn't want to print a label for. - - We can also view each record in more detail by clicking on the appropriate - expander (the little triangles) as shown. Once we are satisfied with the - selections in this dialog we click OK to accept the - changes. - - Now we start adding objects to our glabels document as shown. - - -
    - Adding objects - - - - - - -
    - - - In this example we have added three text objects and a barcode object. The - first text object contains only simple literal text ("Hello, my name is"). The - second text object contains a single merge field ("${1}") corresponding to the - first field of a record (first column of a line) which contains the new crew - member's full name. The third text field contains both literal text - ("Department: ") followed by a single merge field ("${2}") corresponding to - the second field or the crew member's department. The barcode object is - configured to use field (or key) "3" which contains our crew member's - starfleet serial number. - - Now we can print our name tags by selecting the - File - Print menu item. This will display - print dialog as shown below. - - -
    - Printing name tags - - - - - - -
    - - - Just to make sure our labels are going to look okay, we select the - Print outlines option and click - Print Preview. This will display a print preview dialog - as shown below. - - -
    - Name tags preview - - - - - - -
    - - - Everything looks good, so we can now load up our printer with - the appropriate label stock, print our name tags and start beaming our guests - aboard. - -
    - - - Example 2: Address Labels - - In this example we are going to throw a party and need to print mailing - address labels for our invitations. We have a list of our closest friends - that we created in gnumeric and exported as the - following CSV file. It should be noted that not everyone has a middle initial or - a two line address. - - -LAST,FIRST,MI,ADDR1,ADDR2,CITY,STATE,ZIP -,,,,,,, -Critter,Ess,S,"123 Faux St.",,Alexandria,VA,22310 -Doe,John,,"Apt 1X","451 Mystery St.",Trenton,NJ,08601 -Summers,Joyce,,"1630 Revello Dr",,Sunnydale,CA,95037 -McGarret,Steve,O,"404 Piikoi Street",,Honolulu,HI,96813 -Kramer,Cosmo,,"Apt 5B","129 W. 81 St.","New York",NY,10024-7207 - - - In glabels we have created a new glabels - document using the Avery 5512 "Address Labels" template. Next we use the - Objects - Merge Properties menu item to display - the merge properties dialog. We use this dialog to - select the source type (in our case CSV) and the merge source (filename) as - shown. - - -
    - Merge properties dialog - - - - - - -
    - - - Before applying the merge source, we uncheck the first record since it is only - column headers from our original gnumeric spreadsheet - and would simply waste our first label. We also unselect the second record - which is empty (an artifact of our original spreadsheet). We could also unselect - any other records that we didn't want to print a label for. - - We can also view each record in more detail by clicking on the appropriate - expander (the little triangles) as shown. Once we are satisfied with the - selections in this dialog we click OK to accept the - changes. - - Now we start adding objects to our glabels document as shown. - - -
    - Adding objects - - - - - - -
    - - - In this example we have a single text object. This text object contains - all of our merge fields organized on multiple lines as a mailing address. - Notice that fields ${4} and ${5} (corresponding to ADDR1 and ADDR2) are each - located with no other text on their own lines. When - glabels encounters a field as the only text on - a line, it will not expand the line if the field is empty. - - Now we can print our address labels by selecting the - File - Print menu item. This will display - print dialog as shown below. - - -
    - Printing address labels - - - - - - -
    - - - Just to make sure our labels are going to look okay, we select the - Print outlines option and click - Print Preview. This will display a print preview dialog - as shown below. - - -
    - Address labels preview - - - - - - -
    - - - Everything looks good, so we can now load up our printer with - the appropriate label stock, print our address labels and start mailing - our party invitations. - -
    - -
    - - - - - - - Manually Creating New Templates - - Predefined templates are defined by XML files located in - ${prefix}/share/glabels/, - where ${prefix} is usually something like - /usr/local or /usr depending - on the configuration option prefix. gLabels will - use all files of the form *-templates.xml - or *.template, that it finds in - ${prefix}/share/glabels/ and - ${HOME}/.glabels/. - Additional templates can be added by creating additional - *.template files in either of these directories. - - - The format for these files is defined in the DTD: - glabels-2.2.dtd. (This DTD also describes other - XML formats used by glabels.) - - - Assumptions/caveats - - - A sheet contains only one size of label or card (if a sheet - contains more than one size of item, it can be split into - multiple templates for multiple pass printing) - - - Distances can be expressed in units of pt, - in, mm, - cm, or pc. For example: - "1.0in" or "2.54cm". If no - units are specified, computer points (pt) will - be assumed (1 pt = - 1/72 in = 0.352778 mm). - - - - - - - Template Files - - -<?xml version="1.0"?> -<Glabels-templates> - - ...templates... - -</Glabels-templates> - - - - - - Example Template - - <Template brand="Avery" part="8160" size="US-Letter" description="Mailing Labels"> - <Label-rectangle id="0" width="189pt" height="72pt" round="5pt"> - <Markup-margin size="5pt"/> - <Layout nx="3" ny="10" x0="11.25pt" y0="36pt" dx="200pt" dy="72pt"/> - </Label-rectangle> - <Alias brand="Avery" part="5160"/> - <Alias brand="Avery" part="6233"/> - </Template> - - - - - Template Node - - A Template node describes a single stationary - product. It must contain one instance of any type of Label node - (Label-rectangle, - Label-round, or Label-cd). - This node can be followed by zero or more - Alias nodes. - - - - - - - - - Property - - - Description - - - - - - brand - - Brand or manufacturer of stationary product. - E.g. "Avery" - - - - part - - Part number or name of stationary product. - E.g. "8160" - - - - size - - Size of sheet. E.g., "US-Letter," "A4", ... - - - - description - - Description of stationary product. E.g, - "Mailing Labels." - - - - _description - - Translatable description of stationary product. - E.g, "Mailing Labels." (Only useful for predefined - templates) - - - - width - - Page width. Only valid if size="Other" - - - - height - - Page height. Only valid if size="Other" - - - - - - - - - - Label-rectangle Node - - A Label-rectangle node describes the - dimensions of a single label or business card that is rectangular - in shape (may have rounded edges). - - - - - - - - - Property - - - Description - - - - - - id - - Reserved for future use. Should always be 0. - - - - width - Width of label/card - - - height - Height of label/card - - - round - - Radius of corners. For items with square edges - (business cards), the radius should be 0. - - - - x_waste - - Amount of horizontal waste (over-print) to allow. This is useful - for minimizing alignment problems when using non-white - backgrounds (e.g. images). - - - - y_waste - - Amount of vertical waste (over-print) to allow. This is useful - for minimizing alignment problems when using non-white - backgrounds (e.g. images). - - - - - - - -
    - Label-rectangle Parameters - - - - - - -
    - - -
    - - - Label-round Node - - A Label-round node describes the dimensions - of a simple round label (not a CD). - - - - - - - - - Property - - - Description - - - - - - id - - Reserved for future use. Should always be 0. - - - - radius - Radius (1/2 diameter) of label - - - waste - - Amount of waste (over-print) to allow. This is useful - for minimizing alignment problems when using non-white - backgrounds (e.g. images). - - - - - - - - - - Label-cd Node - - A Label-cd node describes the dimensions - of a CD, DVD, or business card CD. - - - - - - - - - Property - - - Description - - - - - - id - - Reserved for future use. Should always be 0. - - - - radius - Outer radius of label - - - hole - Radius of concentric hole - - - width - - If present, the label is clipped to the given width. - (Useful for "business card CDs"). - - - - height - - If present, the label is clipped to the given height. - (Useful for "business card CDs"). - - - - waste - - Amount of waste (over-print) to allow. This is useful - for minimizing alignment problems when using non-white - backgrounds (e.g. images). - - - - - - - -
    - CD Label Parameters - - - - - - -
    - - -
    - - - Markup-margin Node - - A Markup-margin describes a margin along - all edges of a label. - - - - - - - - - Property - - - Description - - - - - - size - - Size of the margin. I.e. the distance of the margin - line from the edge of the card/label. - - - - - - - - - - Markup-line Node - - A Markup-line describes a markup line. - - - - - - - - - Property - - - Description - - - - - - x1 - - x coordinate of 1st endpoint of the line segment. - - - - y1 - - y coordinate of 1st endpoint of the line segment. - - - - x2 - - x coordinate of 2nd endpoint of the line segment. - - - - y2 - - y coordinate of 2nd endpoint of the line segment. - - - - - - - - - - Markup-circle Node - - A Markup-circle describes a markup circle. - - - - - - - - - - Property - - - Description - - - - - - x0 - - x coordinate of circle origin (center). - - - - y0 - - y coordinate of circle origin (center). - - - - radius - Radius of circle. - - - - - - - - - Markup-rect Node - - A Markup-rect describes a markup rectangle. - - - - - - - - - - Property - - - Description - - - - - - x1 - - x coordinate of upper left corner of rectangle. - - - - y1 - - y coordinate of upper left corner of rectangle. - - - - w - - Width of rectangle. - - - - h - - Height of rectangle. - - - - r - Radius of rounded corners of rectangle. - - - - - - - - - Layout Node - - A label node may contain multiple Layout - children. If labels are arranged in a simple grid pattern, only - one layout is needed. However, if labels are arranged in multiple - grids, such as a running bond pattern, multiple - layout tags can be used. Note: a single label - can always be treated as a grid of one. - - - - - - - - - Property - - - Description - - - - - - nx - - Number of labels/cards across in the grid - (horizontal) - - - - ny - - Number of labels/cards up and down in the grid - (vertical) - - - - x0 - - Distance from left edge of sheet to the left edge of - the left column of cards/labels in the layout. - - - - y0 - - Distance from the top edge of sheet to the top edge of - the top row of labels/cards in the layout. - - - - dx - Horizontal pitch of grid. - - - dy - Vertical pitch of grid. - - - - - - -
    - Layout Parameters - - - - - - -
    - - -
    - - - Alias Node - - An Alias node provides the name of a - product with the same size and layout characteristics as the - parent template. - - - - - - - - - Property - - - Description - - - - - - brand - - The brand or manufacturer of the equivalent product. - - - - part - - The part number or name of the equivalent product. - - - - - - - - -
    - - - - - - - - - - - - - - About &app; - &app; was written by Jim Evins - (evins@snaught.com). To find more information about - &app;, please visit the - gLabels Web - page. - - To report a bug or make a suggestion regarding this application or - this manual, follow the directions at the - gLabels Contact Page. - - - This program is distributed under the terms of the GNU - General Public license as published by the Free Software - Foundation; either version 2 of the License, or (at your option) - any later version. A copy of this license can be found at this - link, or in the file - COPYING included with the source code of this program. - - - - - - - -
    diff --git a/glabels2/help/C/legal.xml b/glabels2/help/C/legal.xml deleted file mode 100644 index ac97e1de..00000000 --- a/glabels2/help/C/legal.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - Permission is granted to copy, distribute and/or modify this - document under the terms of the GNU Free Documentation - License (GFDL), Version 1.1 or any later version published - by the Free Software Foundation with no Invariant Sections, - no Front-Cover Texts, and no Back-Cover Texts. You can find - a copy of the GFDL at this link or in the file COPYING-DOCS - distributed with this manual. - - This manual is part of a collection of GNOME manuals - distributed under the GFDL. If you want to distribute this - manual separately from the collection, you can do so by - adding a copy of the license to the manual, as described in - section 6 of the license. - - - - Many of the names used by companies to distinguish their - products and services are claimed as trademarks. Where those - names appear in any GNOME documentation, and the members of - the GNOME Documentation Project are made aware of those - trademarks, then the names are in capital letters or initial - capital letters. - - - - DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED - UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE - WITH THE FURTHER UNDERSTANDING THAT: - - - - DOCUMENT IS PROVIDED ON AN "AS IS" BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR - IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - THAT THE DOCUMENT OR MODIFIED VERSION OF THE - DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR - A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE - RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE - OF THE DOCUMENT OR MODIFIED VERSION OF THE - DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR - MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, - YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY - CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY - SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER - OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS - LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED - VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER - EXCEPT UNDER THIS DISCLAIMER; AND - - - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL - THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), - CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, - INITIAL WRITER, ANY CONTRIBUTOR, OR ANY - DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION - OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH - PARTIES, BE LIABLE TO ANY PERSON FOR ANY - DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER - INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS - OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR - MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR - LOSSES ARISING OUT OF OR RELATING TO USE OF THE - DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, - EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF - THE POSSIBILITY OF SUCH DAMAGES. - - - - - - diff --git a/glabels2/help/Makefile.am b/glabels2/help/Makefile.am deleted file mode 100644 index a68e4e50..00000000 --- a/glabels2/help/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -## Process this file with automake to produce Makefile.in. - -SUBDIRS = C diff --git a/glabels2/iec16022-0.2.1/BUGS b/glabels2/iec16022-0.2.1/BUGS deleted file mode 100644 index 9de2b176..00000000 --- a/glabels2/iec16022-0.2.1/BUGS +++ /dev/null @@ -1,6 +0,0 @@ -iec16022 -f i -c aaaaabbbbbccccc -Barcode too long for 32x8 -No barcode produced - -We should find a suit barcode and not error here. - diff --git a/glabels2/iec16022-0.2.1/CHANGELOG b/glabels2/iec16022-0.2.1/CHANGELOG deleted file mode 100644 index 7c02bce3..00000000 --- a/glabels2/iec16022-0.2.1/CHANGELOG +++ /dev/null @@ -1,26 +0,0 @@ -0.2.1 - - Fix 'Barcode too long' bug. Thanks to Alessandro Zummo. - - Use Lindent to start cleaning up the code mess. - -2006-11-11 Stefan Schmidt - -0.2 - - Rewrite Makefile. - - Documentation update. - - Exclude double include of header files. - - Layout cahnges. Place return value in front of function name. - - 80 character per line. - - Print version number before usage. - - Tests - -2006-02-06 Stefan Schmidt - - -0.1 - - Initial release. - - INSTALL, README, TODO, CREDITS, Makefile, LICENSE and CHANGELOG files - added. - - Fix some include issues. - - Fix some signed/unsigned issues. - -2006-01-08 Stefan Schmidt diff --git a/glabels2/iec16022-0.2.1/CREDITS b/glabels2/iec16022-0.2.1/CREDITS deleted file mode 100644 index 37e2bcc8..00000000 --- a/glabels2/iec16022-0.2.1/CREDITS +++ /dev/null @@ -1,10 +0,0 @@ -Adrian Kennard, Andrews & Arnold Ltd for the original source code. You can -find it at http://aa.gg/free/ - -Cliff Hones for the RS coding. - -Jan Luebbe for writing the manual page and maintaining -the debian package. - -Daniel Willman for maintaining the gentoo -ebuild. diff --git a/glabels2/iec16022-0.2.1/INSTALL b/glabels2/iec16022-0.2.1/INSTALL deleted file mode 100644 index 102a61e1..00000000 --- a/glabels2/iec16022-0.2.1/INSTALL +++ /dev/null @@ -1,8 +0,0 @@ -To install this software you need the following libraries installed: -- libpopt -- zlib - -Installing iec16022 is really simple. Just do a 'make' and 'make install'. - -In standard configuration the binary will be installed in /usr/local/bin. You -can change the prefix and DESTDIR in the Makefile. diff --git a/glabels2/iec16022-0.2.1/LICENSE b/glabels2/iec16022-0.2.1/LICENSE deleted file mode 100644 index 3912109b..00000000 --- a/glabels2/iec16022-0.2.1/LICENSE +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - 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 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/glabels2/iec16022-0.2.1/Makefile.am b/glabels2/iec16022-0.2.1/Makefile.am deleted file mode 100644 index 566bdc09..00000000 --- a/glabels2/iec16022-0.2.1/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -INCLUDES = \ - -DLIB \ - $(GLABELS_CFLAGS) - - -IEC_FILES = \ - iec16022ecc200.c \ - reedsol.c - -noinst_LTLIBRARIES = libiec16022.la - -libiec16022_la_SOURCES = $(IEC_FILES) - -EXTRA_DIST = \ - BUGS \ - CHANGELOG \ - CREDITS \ - iec16022.1 \ - iec16022.c \ - iec16022ecc200.h \ - image.c \ - image.h \ - INSTALL \ - LICENSE \ - Makefile.dist \ - README \ - README.glabels \ - reedsol.h \ - TODO \ - test/testsuite-example.bin \ - test/testsuite-example.eps \ - test/testsuite-example.hex \ - test/testsuite-example.png \ - test/testsuite-example.text \ - test/testsuite.sh diff --git a/glabels2/iec16022-0.2.1/Makefile.dist b/glabels2/iec16022-0.2.1/Makefile.dist deleted file mode 100644 index 4929afdb..00000000 --- a/glabels2/iec16022-0.2.1/Makefile.dist +++ /dev/null @@ -1,40 +0,0 @@ -CC=/usr/bin/cc -INSTALL=/usr/bin/install -GZIP=/bin/gzip - -prefix=/usr/local -bindir=$(prefix)/bin -mandir=$(prefix)/share/man - -CFLAGS=-Wall - -.PHONY: test clean - -all: iec16022 manpage - -iec16022: iec16022ecc200.o image.o iec16022.c - $(CC) -c iec16022.c - $(CC) -o iec16022 $(CFLAGS) reedsol.o iec16022.o image.o iec16022ecc200.o -lz -lpopt - -manpage: iec16022.1 - $(GZIP) -f --best < iec16022.1 > iec16022.1.gz - -install: all - $(INSTALL) -d -m 755 $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 - $(INSTALL) -m 755 iec16022 $(DESTDIR)$(bindir) - $(INSTALL) -m 644 iec16022.1.gz $(DESTDIR)$(mandir)/man1 - -test: iec16022 - cd test; ./testsuite.sh - -iec16022ecc200.o: iec16022ecc200.c iec16022ecc200.h reedsol.o - $(CC) -c iec16022ecc200.c - -image.o: image.c image.h - $(CC) -c image.c - -reedsol.o: reedsol.c reedsol.h - $(CC) -DLIB -c reedsol.c - -clean: - rm -f iec16022 iec16022.1.gz *.o diff --git a/glabels2/iec16022-0.2.1/README b/glabels2/iec16022-0.2.1/README deleted file mode 100644 index 072c0aef..00000000 --- a/glabels2/iec16022-0.2.1/README +++ /dev/null @@ -1,13 +0,0 @@ -With iec16022 you can produce 2d barcodes. Also known as Data Matrix. These -barcodes are defined in ISO/IEC 16022. - -The code was originally written by Andrews & Arnold Ltd. You can download this -code from http://aa.gg/free/. -The current maintainer of the code is Stefan Schmidt. - -Website: http://www.datenfreihafen.org/projects/iec16022.html -Maillinglist: https://sirius.lasnet.de/mailman/listinfo/iec16022 -SVN repository: https://svn.datenfreihafen.org/iec16022/ - - -Stefan Schmidt diff --git a/glabels2/iec16022-0.2.1/README.glabels b/glabels2/iec16022-0.2.1/README.glabels deleted file mode 100644 index ad1dced7..00000000 --- a/glabels2/iec16022-0.2.1/README.glabels +++ /dev/null @@ -1,6 +0,0 @@ -The following changes have been made to the stock iec16022 0.2.1 distribution -to facilitate compilation with glabels: - - Makefile renamed to Makefile.dist - added Makefile.am, which is configured from ../configure.in - diff --git a/glabels2/iec16022-0.2.1/TODO b/glabels2/iec16022-0.2.1/TODO deleted file mode 100644 index 6c0a97bc..00000000 --- a/glabels2/iec16022-0.2.1/TODO +++ /dev/null @@ -1,9 +0,0 @@ -- Fix compiler warnings. -- Test on 64bit, powerpc, arm, etc. Anyone? -- Test stamp feature. Anyone? -- Use autotools - -Some things to think about: ---------------------------- -- Use libpng? -- Merge iec16022 in barcode? diff --git a/glabels2/iec16022-0.2.1/iec16022.1 b/glabels2/iec16022-0.2.1/iec16022.1 deleted file mode 100644 index 681c3a7f..00000000 --- a/glabels2/iec16022-0.2.1/iec16022.1 +++ /dev/null @@ -1,52 +0,0 @@ -.TH iec16022 1 2006-01-14 "iec16022 0.1" -.SH NAME -iec16022 \- program to generate 2d barcodes -.SH SYNOPSIS -.B iec16022 -.RI [ options ] -.SH DESCRIPTION -This manual page documents briefly the -.B iec16022 -command. -.PP -.B iec16022 -generates 2d barcodes conforming to the ISO/IEC 16022 standard (which is -also known as Data Matrix and Semacode). -.SH OPTIONS -These programs follow the usual GNU command line syntax, with long -options starting with two dashes (`-'). -A summary of options is included below. -.TP -.B \-s, \-\-size WxH -Sets the size of the generated barcode. -.TP -.B \-c, \-\-barcode text -Specifies the text to be encoded. -.TP -.B \-\-ecc 000|050|080|100|140|200 -Sets the type of ecc to be used. -.TP -.B \-i, \-\-infile filename -Read input data from file. -.TP -.B \-o, \-\-outfile filenmae -Save output to file (instead of standard output). -.TP -.B \-f, \-\-format Text|EPS|Bin|Hex|Stamp|PNG -Set the output type. -.TP -.B \-?, \-\-help -Show summary of options. -.TP -.B \-\-usage -Show short overview of options. -.SH EXAMPLE -To produce a datamatrix barcode for foobar in PNG format you need the following -arguments: -.TP -.B iec16022 -f PNG -c foobar -o foobar.png -.SH AUTHOR -iec16022 was written by Adrian Kennard, Andrews & Arnold Ltd. -.PP -This manual page was written by Jan Luebbe , -for the Debian project (but may be used by others). diff --git a/glabels2/iec16022-0.2.1/iec16022.c b/glabels2/iec16022-0.2.1/iec16022.c deleted file mode 100644 index 6fb7c30a..00000000 --- a/glabels2/iec16022-0.2.1/iec16022.c +++ /dev/null @@ -1,462 +0,0 @@ -/** - * - * IEC16022 bar code generation - * Adrian Kennard, Andrews & Arnold Ltd - * with help from Cliff Hones on the RS coding - * - * (c) 2004 Adrian Kennard, Andrews & Arnold Ltd - * (c) 2006 Stefan Schmidt - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#define IEC16022_VERSION "0.2" - -#include -#include -#include -#include -#include -#include -#include -#include "image.h" -#include "iec16022ecc200.h" - - // simple checked response malloc -void *safemalloc(int n) -{ - void *p = malloc(n); - if (!p) { - fprintf(stderr, "Malloc(%d) failed\n", n); - exit(1); - } - return p; -} - -// hex dump - bottom left pixel first -void dumphex(unsigned char *grid, int W, int H, unsigned char p) -{ - int c = 0, y; - for (y = 0; y < H; y++) { - int v = 0, x, b = 128; - for (x = 0; x < W; x++) { - if (grid[y * W + x]) - v |= b; - b >>= 1; - if (!b) { - printf("%02X", v ^ p); - v = 0; - b = 128; - c++; - } - } - if (b != 128) { - printf("%02X", v ^ p); - c++; - } - printf(" "); - c++; - if (c >= 80) { - printf("\n"); - c = 0; - } - } - if (c) - printf("\n"); -} - -int main(int argc, const char *argv[]) -{ - char c; - int W = 0, H = 0; - int ecc = 0; - int barcodelen = 0; - char *encoding = 0; - char *outfile = 0; - char *infile = 0; - char *barcode = 0; - char *format = "Text"; - char *size = 0; - char *eccstr = 0; - int len = 0, maxlen = 0, ecclen = 0; - unsigned char *grid = 0; - poptContext optCon; // context for parsing command-line options - const struct poptOption optionsTable[] = { - { - "size", 's', POPT_ARG_STRING, &size, 0, "Size", "WxH"}, - { - "barcode", 'c', POPT_ARG_STRING, &barcode, 0, "Barcode", - "text"}, - { - "ecc", 0, POPT_ARG_STRING, &eccstr, 0, "ECC", - "000/050/080/100/140/200"}, - { - "infile", 'i', POPT_ARG_STRING, &infile, 0, "Barcode file", - "filename"}, - { - "outfile", 'o', POPT_ARG_STRING, &outfile, 0, - "Output filename", - "filename"}, - { - "encoding", 'e', POPT_ARG_STRING, &encoding, 0, - "Encoding template", - "[CTXEAB]* for ecc200 or 11/27/41/37/128/256"}, - { - "format", 'f', POPT_ARGFLAG_SHOW_DEFAULT | POPT_ARG_STRING, - &format, 0, - "Output format", "Text/EPS/PNG/Bin/Hex/Stamp"}, - POPT_AUTOHELP { - NULL, 0, 0, NULL, 0} - }; - optCon = poptGetContext(NULL, argc, argv, optionsTable, 0); - poptSetOtherOptionHelp(optCon, "[barcode]"); - if ((c = poptGetNextOpt(optCon)) < -1) { - /* an error occurred during option processing */ - fprintf(stderr, "%s: %s\n", poptBadOption(optCon, - POPT_BADOPTION_NOALIAS), - poptStrerror(c)); - return 1; - } - - if (poptPeekArg(optCon) && !barcode && !infile) - barcode = (char *)poptGetArg(optCon); - if (poptPeekArg(optCon) || !barcode && !infile || barcode && infile) { - fprintf(stderr, "Version: %s\n", IEC16022_VERSION); - poptPrintUsage(optCon, stderr, 0); - return -1; - } - if (outfile && !freopen(outfile, "w", stdout)) { - perror(outfile); - return 1; - } - - if (infile) { // read from file - FILE *f = fopen(infile, "rb"); - barcode = safemalloc(4001); - if (!f) { - perror(infile); - return 1; - } - barcodelen = fread(barcode, 1, 4000, f); - if (barcodelen < 0) { - perror(infile); - return 1; - } - barcode[barcodelen] = 0; // null terminate anyway - close(f); - } else - barcodelen = strlen(barcode); - // check parameters - if (size) { - char *x = strchr(size, 'x'); - W = atoi(size); - if (x) - H = atoi(x + 1); - if (!H) - W = H; - } - if (eccstr) - ecc = atoi(eccstr); - if (W & 1) { // odd size - if (W != H || W < 9 || W > 49) { - fprintf(stderr, "Invalid size %dx%d\n", W, H); - return 1; - } - if (!eccstr) { - if (W >= 17) - ecc = 140; - else if (W >= 13) - ecc = 100; - else if (W >= 11) - ecc = 80; - else - ecc = 0; - } - if (ecc && ecc != 50 && ecc != 80 && ecc != 100 && ecc != 140 || - ecc == 50 && W < 11 || ecc == 80 && W < 13 || ecc == 100 - && W < 13 || ecc == 140 && W < 17) { - fprintf(stderr, "ECC%03d invalid for %dx%d\n", ecc, W, - H); - return 1; - } - - } else if (W) { // even size - if (W < H) { - int t = W; - W = H; - H = t; - } - if (!eccstr) - ecc = 200; - if (ecc != 200) { - fprintf(stderr, "ECC%03d invalid for %dx%d\n", ecc, W, - H); - return 1; - } - } - - else { // auto size - if (!eccstr) - // default is even sizes only unless explicit ecc set to force odd - // sizes - ecc = 200; - } - - if (tolower(*format) == 's') { // special stamp format checks & defaults - if (!W) - W = H = 32; - if (ecc != 200 || W != 32 || H != 32) - fprintf(stderr, "Stamps must be 32x32\n"); - if (encoding) - fprintf(stderr, "Stamps should use auto encoding\n"); - else { - int n; - for (n = 0; n < barcodelen && (barcode[n] == ' ' || - isdigit(barcode[n]) - || isupper(barcode[n])); - n++) ; - if (n < barcodelen) - fprintf(stderr, - "Has invalid characters for a stamp\n"); - else { - // Generate simplistic encoding rules as used by the windows app - // TBA - does not always match the windows app... - n = 0; - encoding = safemalloc(barcodelen + 1); - while (n < barcodelen) { - // ASCII - while (1) { - if (n == barcodelen - || n + 3 <= barcodelen - && (!isdigit(barcode[n]) - || - !isdigit(barcode - [n + 1]))) - break; - encoding[n++] = 'A'; - if (n < barcodelen - && isdigit(barcode[n - 1]) - && isdigit(barcode[n])) - encoding[n++] = 'A'; - } - // C40 - while (1) { - int r = 0; - while (n + r < barcodelen - && - isdigit(barcode[n + r])) - r++; - if (n + 3 > barcodelen - || r >= 6) - break; - encoding[n++] = 'C'; - encoding[n++] = 'C'; - encoding[n++] = 'C'; - } - } - encoding[n] = 0; - //fprintf (stderr, "%s\n%s\n", barcode, encoding); - } - } - } - // processing stamps - if ((W & 1) || ecc < 200) { // odd sizes - fprintf(stderr, "Not done odd sizes yet, sorry\n"); - } else { // even sizes - grid = - iec16022ecc200(&W, &H, &encoding, barcodelen, barcode, &len, - &maxlen, &ecclen); - } - - // output - if (!grid || !W) { - fprintf(stderr, "No barcode produced\n"); - return 1; - } - switch (tolower(*format)) { - case 'i': // info - printf("Size : %dx%d\n", W, H); - printf("Encoded : %d of %d bytes with %d bytes of ecc\n", len, - maxlen, ecclen); - printf("Barcode : %s\n", barcode); - printf("Encoding: %s\n", encoding); - break; - case 'h': // hex - dumphex(grid, W, H, 0); - break; - case 'b': // bin - { - int y; - for (y = 0; y < H; y++) { - int v = 0, x, b = 128; - for (x = 0; x < W; x++) { - if (grid[y * W + x]) - v |= b; - b >>= 1; - if (!b) { - putchar(v); - v = 0; - b = 128; - } - } - if (b != 128) - putchar(v); - } - } - break; - case 't': // text - { - int y; - for (y = H - 1; y >= 0; y--) { - int x; - for (x = 0; x < W; x++) - printf("%c", - grid[W * y + x] ? '*' : ' '); - printf("\n"); - } - } - break; - case 'e': // EPS - printf("%%!PS-Adobe-3.0 EPSF-3.0\n" - "%%%%Creator: IEC16022 barcode/stamp generator\n" - "%%%%BarcodeData: %s\n" "%%%%BarcodeSize: %dx%d\n" - "%%%%BarcodeFormat: ECC200\n" - "%%%%DocumentData: Clean7Bit\n" "%%%%LanguageLevel: 1\n" - "%%%%Pages: 1\n" "%%%%BoundingBox: 0 0 %d %d\n" - "%%%%EndComments\n" "%%%%Page: 1 1\n" - "%d %d 1[1 0 0 1 -1 -1]{<\n", barcode, W, H, W + 2, - H + 2, W, H); - dumphex(grid, W, H, 0xFF); - printf(">}image\n"); - break; - case 's': // Stamp - { - char temp[74], c; - time_t now; - struct tm t = { - 0 - }; - int v; - if (barcodelen < 74) { - fprintf(stderr, - "Does not look like a stamp barcode\n"); - return 1; - } - memcpy(temp, barcode, 74); - c = temp[5]; - temp[56] = 0; - t.tm_year = atoi(temp + 54) + 100; - t.tm_mday = 1; - now = mktime(&t); - temp[54] = 0; - now += 86400 * (atoi(temp + 51) - 1); - t = *gmtime(&now); - temp[46] = 0; - v = atoi(temp + 36); - printf("%%!PS-Adobe-3.0 EPSF-3.0\n" - "%%%%Creator: IEC16022 barcode/stamp generator\n" - "%%%%BarcodeData: %s\n" "%%%%BarcodeSize: %dx%d\n" "%%%%DocumentData: Clean7Bit\n" "%%%%LanguageLevel: 1\n" "%%%%Pages: 1\n" "%%%%BoundingBox: 0 0 190 80\n" "%%%%EndComments\n" "%%%%Page: 1 1\n" "10 dict begin/f{findfont exch scalefont \ - setfont}bind def/rm/rmoveto load def/m/moveto load \ - def/rl/rlineto load def\n" "/l/lineto load def/cp/closepath load def/c{dup stringwidth \ - pop -2 div 0 rmoveto show}bind def\n" "gsave 72 25.4 div dup scale 0 0 m 67 0 rl 0 28 rl -67 0 rl \ - cp clip 1 setgray fill 0 setgray 0.5 0 translate 0.3 \ - setlinewidth\n" "32 32 1[2 0 0 2 0 -11]{<\n", barcode, W, H); - dumphex(grid, W, H, 0xFF); - printf(">}image\n" - "3.25/Helvetica-Bold f 8 25.3 m(\\243%d.%02d)c\n" - "2.6/Helvetica f 8 22.3 m(%.4s %.4s)c\n" - "1.5/Helvetica f 8 3.3 m(POST BY)c\n" - "3.3/Helvetica f 8 0.25 m(%02d.%02d.%02d)c\n", - v / 100, v % 100, temp + 6, temp + 10, t.tm_mday, - t.tm_mon + 1, t.tm_year % 100); - if (c == '1' || c == '2' || c == 'A' || c == 'S') { - if (c == '2') - printf - ("42 0 m 10 0 rl 0 28 rl -10 0 rl cp 57 0 m 5 0 rl 0 \ - 28 rl -5 0 rl cp"); - else - printf - ("42 0 m 5 0 rl 0 28 rl -5 0 rl cp 52 0 m 10 0 rl 0 \ - 28 rl -10 0 rl cp"); - printf - (" 21 0 m 16 0 rl 0 28 rl -16 0 rl cp fill\n" - "21.3 0.3 m 15.4 0 rl 0 13 rl -15.4 0 rl cp 1 setgray \ - fill gsave 21.3 0.3 15.4 27.4 rectclip newpath\n"); - switch (c) { - case '1': - printf - ("27/Helvetica-Bold f 27 8.7 m(1)show grestore 0 setgray \ - 1.5/Helvetica-Bold f 22 3.3 m(POSTAGE PAID GB)show \ - 1.7/Helvetica f 29 1.5 m(DumbStamp.co.uk)c\n"); - break; - case '2': - printf - ("21/Helvetica-Bold f 23.5 13 m(2)1.25 1 scale show grestore \ - 0 setgray 1.5/Helvetica-Bold f 22 3.3 \ - m(POSTAGE PAID GB)show 1.7/Helvetica f 29 1.5 \ - m(DumbStamp.co.uk)c\n"); - break; - case 'A': - printf - ("16/Helvetica-Bold f 29 14.75 m 1.1 1 scale(A)c grestore 0 \ - setgray 1.5/Helvetica-Bold f 22 3.3 m(POSTAGE PAID GB)show \ - 1.7/Helvetica f 22 1.5 m(Par Avion)show\n"); - break; - case 'S': - printf - ("10/Helvetica-Bold f 29 17 m(SU)c grestore 0 setgray \ - 1.5/Helvetica-Bold f 22 1.5 m(POSTAGE PAID GB)show\n"); - break; - } - printf - ("2.3/Helvetica-Bold f 29 10 m(LOYAL MAIL)c\n"); - } else if (c == 'P') { // Standard Parcels - printf("21 0 m 41 0 rl 0 28 rl -41 0 rl cp fill\n" "37.7 0.3 m 24 0 rl 0 27.4 rl -24 0 rl cp 1 setgray fill \ - gsave 21.3 0.3 16.4 27.4 rectclip newpath\n" "22.5/Helvetica-Bold f 37.75 -1.25 m 90 rotate(SP)show \ - grestore 0 setgray\n" - "3.5/Helvetica-Bold f 49.7 21.5 m(LOYAL MAIL)c\n" "2.3/Helvetica-Bold f 49.7 7 m(POSTAGE PAID GB)c\n" "2.6/Helveica f 49.7 4.25 m(DumbStamp.co.uk)c\n"); - } else if (c == '3') - printf("21.15 0.15 40.7 27.7 rectstroke\n" - "21 0 m 41 0 rl 0 5 rl -41 0 rl cp fill\n" - "0 1 2{0 1 18{dup 1.525 mul 22.9 add 24 3 index 1.525 mul \ - add 3 -1 roll 9 add 29 div 0 360 arc fill}for pop}for\n" "50.5 23.07 m 11.5 0 rl 0 5 rl -11.5 0 rl cp fill\n" - "5.85/Helvetica f 23.7 15.6 m(Loyal Mail)show\n" "4.75/Helvetica-Bold f 24 11 m(special)show 4.9/Helvetica \ - f(delivery)show\n" "gsave 1 setgray 3.2/Helvetica-Bold f 24 1.6 \ - m(next day)show 26 10.15 m 2 0 rl stroke grestore\n" "21.15 9.9 m 53.8 9.9 l stroke 53.8 9.9 0.4 0 360 \ - arc fill\n"); - printf("end grestore\n"); - } - break; - case 'p': // png - { - int x, y; - Image *i = ImageNew(W + 2, H + 2, 2); - i->Colour[0] = 0xFFFFFF; - i->Colour[1] = 0; - for (y = 0; y < H; y++) - for (x = 0; x < W; x++) - if (grid[y * W + x]) - ImagePixel(i, x + 1, H - y) = 1; - ImageWritePNG(i, fileno(stdout), 0, -1, barcode); - ImageFree(i); - } - break; - default: - fprintf(stderr, "Unknown output format %s\n", format); - break; - } - return 0; -} diff --git a/glabels2/iec16022-0.2.1/iec16022ecc200.c b/glabels2/iec16022-0.2.1/iec16022ecc200.c deleted file mode 100644 index 0b28db70..00000000 --- a/glabels2/iec16022-0.2.1/iec16022ecc200.c +++ /dev/null @@ -1,963 +0,0 @@ -/** - * - * IEC16022 bar code generation - * Adrian Kennard, Andrews & Arnold Ltd - * with help from Cliff Hones on the RS coding - * - * (c) 2004 Adrian Kennard, Andrews & Arnold Ltd - * (c) 2006 Stefan Schmidt - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include "reedsol.h" -#include "iec16022ecc200.h" - -static struct ecc200matrix_s { - int H, W; - int FH, FW; - int bytes; - int datablock, rsblock; -} ecc200matrix[] = { - 10, 10, 10, 10, 3, 3, 5, // - 12, 12, 12, 12, 5, 5, 7, // - 8, 18, 8, 18, 5, 5, 7, // - 14, 14, 14, 14, 8, 8, 10, // - 8, 32, 8, 16, 10, 10, 11, // - 16, 16, 16, 16, 12, 12, 12, // - 12, 26, 12, 26, 16, 16, 14, // - 18, 18, 18, 18, 18, 18, 14, // - 20, 20, 20, 20, 22, 22, 18, // - 12, 36, 12, 18, 22, 22, 18, // - 22, 22, 22, 22, 30, 30, 20, // - 16, 36, 16, 18, 32, 32, 24, // - 24, 24, 24, 24, 36, 36, 24, // - 26, 26, 26, 26, 44, 44, 28, // - 16, 48, 16, 24, 49, 49, 28, // - 32, 32, 16, 16, 62, 62, 36, // - 36, 36, 18, 18, 86, 86, 42, // - 40, 40, 20, 20, 114, 114, 48, // - 44, 44, 22, 22, 144, 144, 56, // - 48, 48, 24, 24, 174, 174, 68, // - 52, 52, 26, 26, 204, 102, 42, // - 64, 64, 16, 16, 280, 140, 56, // - 72, 72, 18, 18, 368, 92, 36, // - 80, 80, 20, 20, 456, 114, 48, // - 88, 88, 22, 22, 576, 144, 56, // - 96, 96, 24, 24, 696, 174, 68, // - 104, 104, 26, 26, 816, 136, 56, // - 120, 120, 20, 20, 1050, 175, 68, // - 132, 132, 22, 22, 1304, 163, 62, // - 144, 144, 24, 24, 1558, 156, 62, // 156*4+155*2 - 0 // terminate -}; - - // simple checked response malloc -static void *safemalloc(int n) -{ - void *p = malloc(n); - if (!p) { - fprintf(stderr, "Malloc(%d) failed\n", n); - exit(1); - } - return p; -} - -// Annex M placement alorithm low level -static void ecc200placementbit(int *array, int NR, int NC, int r, int c, - int p, char b) -{ - if (r < 0) { - r += NR; - c += 4 - ((NR + 4) % 8); - } - if (c < 0) { - c += NC; - r += 4 - ((NC + 4) % 8); - } - array[r * NC + c] = (p << 3) + b; -} - -static void ecc200placementblock(int *array, int NR, int NC, int r, - int c, int p) -{ - ecc200placementbit(array, NR, NC, r - 2, c - 2, p, 7); - ecc200placementbit(array, NR, NC, r - 2, c - 1, p, 6); - ecc200placementbit(array, NR, NC, r - 1, c - 2, p, 5); - ecc200placementbit(array, NR, NC, r - 1, c - 1, p, 4); - ecc200placementbit(array, NR, NC, r - 1, c - 0, p, 3); - ecc200placementbit(array, NR, NC, r - 0, c - 2, p, 2); - ecc200placementbit(array, NR, NC, r - 0, c - 1, p, 1); - ecc200placementbit(array, NR, NC, r - 0, c - 0, p, 0); -} - -static void ecc200placementcornerA(int *array, int NR, int NC, int p) -{ - ecc200placementbit(array, NR, NC, NR - 1, 0, p, 7); - ecc200placementbit(array, NR, NC, NR - 1, 1, p, 6); - ecc200placementbit(array, NR, NC, NR - 1, 2, p, 5); - ecc200placementbit(array, NR, NC, 0, NC - 2, p, 4); - ecc200placementbit(array, NR, NC, 0, NC - 1, p, 3); - ecc200placementbit(array, NR, NC, 1, NC - 1, p, 2); - ecc200placementbit(array, NR, NC, 2, NC - 1, p, 1); - ecc200placementbit(array, NR, NC, 3, NC - 1, p, 0); -} - -static void ecc200placementcornerB(int *array, int NR, int NC, int p) -{ - ecc200placementbit(array, NR, NC, NR - 3, 0, p, 7); - ecc200placementbit(array, NR, NC, NR - 2, 0, p, 6); - ecc200placementbit(array, NR, NC, NR - 1, 0, p, 5); - ecc200placementbit(array, NR, NC, 0, NC - 4, p, 4); - ecc200placementbit(array, NR, NC, 0, NC - 3, p, 3); - ecc200placementbit(array, NR, NC, 0, NC - 2, p, 2); - ecc200placementbit(array, NR, NC, 0, NC - 1, p, 1); - ecc200placementbit(array, NR, NC, 1, NC - 1, p, 0); -} - -static void ecc200placementcornerC(int *array, int NR, int NC, int p) -{ - ecc200placementbit(array, NR, NC, NR - 3, 0, p, 7); - ecc200placementbit(array, NR, NC, NR - 2, 0, p, 6); - ecc200placementbit(array, NR, NC, NR - 1, 0, p, 5); - ecc200placementbit(array, NR, NC, 0, NC - 2, p, 4); - ecc200placementbit(array, NR, NC, 0, NC - 1, p, 3); - ecc200placementbit(array, NR, NC, 1, NC - 1, p, 2); - ecc200placementbit(array, NR, NC, 2, NC - 1, p, 1); - ecc200placementbit(array, NR, NC, 3, NC - 1, p, 0); -} - -static void ecc200placementcornerD(int *array, int NR, int NC, int p) -{ - ecc200placementbit(array, NR, NC, NR - 1, 0, p, 7); - ecc200placementbit(array, NR, NC, NR - 1, NC - 1, p, 6); - ecc200placementbit(array, NR, NC, 0, NC - 3, p, 5); - ecc200placementbit(array, NR, NC, 0, NC - 2, p, 4); - ecc200placementbit(array, NR, NC, 0, NC - 1, p, 3); - ecc200placementbit(array, NR, NC, 1, NC - 3, p, 2); - ecc200placementbit(array, NR, NC, 1, NC - 2, p, 1); - ecc200placementbit(array, NR, NC, 1, NC - 1, p, 0); -} - -// Annex M placement alorithm main function -static void ecc200placement(int *array, int NR, int NC) -{ - int r, c, p; - // invalidate - for (r = 0; r < NR; r++) - for (c = 0; c < NC; c++) - array[r * NC + c] = 0; - // start - p = 1; - r = 4; - c = 0; - do { - // check corner - if (r == NR && !c) - ecc200placementcornerA(array, NR, NC, p++); - if (r == NR - 2 && !c && NC % 4) - ecc200placementcornerB(array, NR, NC, p++); - if (r == NR - 2 && !c && (NC % 8) == 4) - ecc200placementcornerC(array, NR, NC, p++); - if (r == NR + 4 && c == 2 && !(NC % 8)) - ecc200placementcornerD(array, NR, NC, p++); - // up/right - do { - if (r < NR && c >= 0 && !array[r * NC + c]) - ecc200placementblock(array, NR, NC, r, c, p++); - r -= 2; - c += 2; - } - while (r >= 0 && c < NC); - r++; - c += 3; - // down/left - do { - if (r >= 0 && c < NC && !array[r * NC + c]) - ecc200placementblock(array, NR, NC, r, c, p++); - r += 2; - c -= 2; - } - while (r < NR && c >= 0); - r += 3; - c++; - } - while (r < NR || c < NC); - // unfilled corner - if (!array[NR * NC - 1]) - array[NR * NC - 1] = array[NR * NC - NC - 2] = 1; -} - -// calculate and append ecc code, and if necessary interleave -static void ecc200(unsigned char *binary, int bytes, int datablock, int rsblock) -{ - int blocks = (bytes + 2) / datablock, b; - rs_init_gf(0x12d); - rs_init_code(rsblock, 1); - for (b = 0; b < blocks; b++) { - unsigned char buf[256], ecc[256]; - int n, p = 0; - for (n = b; n < bytes; n += blocks) - buf[p++] = binary[n]; - rs_encode(p, buf, ecc); - p = rsblock - 1; // comes back reversed - for (n = b; n < rsblock * blocks; n += blocks) - binary[bytes + n] = ecc[p--]; - } -} - -/* - * perform encoding for ecc200, source s len sl, to target t len tl, using - * optional encoding control string e return 1 if OK, 0 if failed. Does all - * necessary padding to tl - */ - -char ecc200encode(unsigned char *t, int tl, unsigned char *s, int sl, - char *encoding, int *lenp) -{ - char enc = 'a'; // start in ASCII encoding mode - int tp = 0, sp = 0; - if (strlen(encoding) < sl) { - fprintf(stderr, "Encoding string too short\n"); - return 0; - } - // do the encoding - while (sp < sl && tp < tl) { - char newenc = enc; // suggest new encoding - if (tl - tp <= 1 && (enc == 'c' || enc == 't') || tl - tp <= 2 - && enc == 'x') - enc = 'a'; // auto revert to ASCII - newenc = tolower(encoding[sp]); - switch (newenc) { // encode character - case 'c': // C40 - case 't': // Text - case 'x': // X12 - { - char out[6], p = 0; - const char *e, - *s2 = "!\"#$%&'()*+,-./:;<=>?@[\\]_", - *s3 = 0; - if (newenc == 'c') { - e = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - s3 = "`abcdefghijklmnopqrstuvwxyz{|}~\177"; - } - if (newenc == 't') { - e = " 0123456789abcdefghijklmnopqrstuvwxyz"; - s3 = "`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\177"; - } - if (newenc == 'x') - e = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\r*>"; - do { - unsigned char c = s[sp++]; - char *w; - if (c & 0x80) { - if (newenc == 'x') { - fprintf(stderr, - "Cannot encode char 0x%02X in X12\n", - c); - return 0; - } - c &= 0x7f; - out[p++] = 1; - out[p++] = 30; - } - w = strchr(e, c); - if (w) - out[p++] = ((w - e) + 3) % 40; - else { - if (newenc == 'x') { - fprintf(stderr, - "Cannot encode char 0x%02X in X12\n", - c); - return 0; - } - if (c < 32) { // shift 1 - out[p++] = 0; - out[p++] = c; - } else { - w = strchr(s2, c); - if (w) { // shift 2 - out[p++] = 1; - out[p++] = - (w - s2); - } else { - w = strchr(s3, - c); - if (w) { - out[p++] - = 2; - out[p++] - = - (w - - s3); - } else { - fprintf - (stderr, - "Could not encode 0x%02X, should \ - not happen\n", c); - return - 0; - } - } - } - } - if (p == 2 && tp + 2 == tl && sp == sl) - out[p++] = 0; // shift 1 pad at end - while (p >= 3) { - int v = - out[0] * 1600 + - out[1] * 40 + out[2] + 1; - if (enc != newenc) { - if (enc == 'c' - || enc == 't' - || enc == 'x') - t[tp++] = 254; // escape C40/text/X12 - else if (enc == 'x') - t[tp++] = 0x7C; // escape EDIFACT - if (newenc == 'c') - t[tp++] = 230; - if (newenc == 't') - t[tp++] = 239; - if (newenc == 'x') - t[tp++] = 238; - enc = newenc; - } - t[tp++] = (v >> 8); - t[tp++] = (v & 0xFF); - p -= 3; - out[0] = out[3]; - out[1] = out[4]; - out[2] = out[5]; - } - } - while (p && sp < sl); - } - break; - case 'e': // EDIFACT - { - unsigned char out[4], p = 0; - if (enc != newenc) { // can only be from C40/Text/X12 - t[tp++] = 254; - enc = 'a'; - } - while (sp < sl && tolower(encoding[sp]) == 'e' - && p < 4) - out[p++] = s[sp++]; - if (p < 4) { - out[p++] = 0x1F; - enc = 'a'; - } // termination - t[tp] = ((s[0] & 0x3F) << 2); - t[tp++] |= ((s[1] & 0x30) >> 4); - t[tp] = ((s[1] & 0x0F) << 4); - if (p == 2) - tp++; - else { - t[tp++] |= ((s[2] & 0x3C) >> 2); - t[tp] = ((s[2] & 0x03) << 6); - t[tp++] |= (s[3] & 0x3F); - } - } - break; - case 'a': // ASCII - if (enc != newenc) { - if (enc == 'c' || enc == 't' || enc == 'x') - t[tp++] = 254; // escape C40/text/X12 - else - t[tp++] = 0x7C; // escape EDIFACT - } - enc = 'a'; - if (sl - sp >= 2 && isdigit(s[sp]) - && isdigit(s[sp + 1])) { - t[tp++] = - (s[sp] - '0') * 10 + s[sp + 1] - '0' + 130; - sp += 2; - } else if (s[sp] > 127) { - t[tp++] = 235; - t[tp++] = s[sp++] - 127; - } else - t[tp++] = s[sp++] + 1; - break; - case 'b': // Binary - { - int l = 0; // how much to encode - if (encoding) { - int p; - for (p = sp; - p < sl - && tolower(encoding[p]) == 'b'; - p++) - l++; - } - t[tp++] = 231; // base256 - if (l < 250) - t[tp++] = l; - else { - t[tp++] = 249 + (l / 250); - t[tp++] = (l % 250); - } - while (l-- && tp < tl) { - t[tp] = s[sp++] + (((tp + 1) * 149) % 255) + 1; // see annex H - tp++; - } - enc = 'a'; // reverse to ASCII at end - } - break; - default: - fprintf(stderr, "Unknown encoding %c\n", newenc); - return 0; // failed - } - } - if (lenp) - *lenp = tp; - if (tp < tl && enc != 'a') { - if (enc == 'c' || enc == 'x' || enc == 't') - t[tp++] = 254; // escape X12/C40/Text - else - t[tp++] = 0x7C; // escape EDIFACT - } - if (tp < tl) - t[tp++] = 129; // pad - while (tp < tl) { // more padding - int v = 129 + (((tp + 1) * 149) % 253) + 1; // see Annex H - if (v > 254) - v -= 254; - t[tp++] = v; - } - if (tp > tl || sp < sl) - return 0; // did not fit - /* - * for (tp = 0; tp < tl; tp++) fprintf (stderr, "%02X ", t[tp]); \ - * fprintf (stderr, "\n"); - */ - return 1; // OK -} - -// Auto encoding format functions -static char encchr[] = "ACTXEB"; - -enum { - E_ASCII, - E_C40, - E_TEXT, - E_X12, - E_EDIFACT, - E_BINARY, - E_MAX -}; - -unsigned char switchcost[E_MAX][E_MAX] = { - 0, 1, 1, 1, 1, 2, // From E_ASCII - 1, 0, 2, 2, 2, 3, // From E_C40 - 1, 2, 0, 2, 2, 3, // From E_TEXT - 1, 2, 2, 0, 2, 3, // From E_X12 - 1, 2, 2, 2, 0, 3, // From E_EDIFACT - 0, 1, 1, 1, 1, 0, // From E_BINARY -}; - -/* - * Creates a encoding list (malloc) - * returns encoding string - * if lenp not null, target len stored - * if error, null returned - * if exact specified, then assumes shortcuts applicable for exact fit - * in target - * 1. No unlatch to return to ASCII for last encoded byte after C40 or - * Text or X12 - * 2. No unlatch to return to ASCII for last 1 or 2 encoded bytes after - * EDIFACT - * 3. Final C40 or text encoding exactly in last 2 bytes can have a shift - * 0 to pad to make a tripple - * Only use the encoding from an exact request if the len matches the target, - * otherwise free the result and try again with exact=0 - */ - -static char *encmake(int l, unsigned char *s, int *lenp, char exact) -{ - char *encoding = 0; - int p = l; - char e; - struct { - // number of bytes of source that can be encoded in a row at this point - // using this encoding mode - short s; - // number of bytes of target generated encoding from this point to end if - // already in this encoding mode - short t; - } enc[MAXBARCODE][E_MAX]; - memset(&enc, 0, sizeof(enc)); - if (!l) - return ""; // no length - if (l > MAXBARCODE) - return 0; // not valid - while (p--) { - char b = 0, sub; - int sl, tl, bl, t; - // consider each encoding from this point - // ASCII - sl = tl = 1; - if (isdigit(s[p]) && p + 1 < l && isdigit(s[p + 1])) - sl = 2; // double digit - else if (s[p] & 0x80) - tl = 2; // high shifted - bl = 0; - if (p + sl < l) - for (e = 0; e < E_MAX; e++) - if (enc[p + sl][e].t && ((t = enc[p + sl][e].t + - switchcost[E_ASCII] - [e]) < bl || !bl)) { - bl = t; - b = e; - } - enc[p][E_ASCII].t = tl + bl; - enc[p][E_ASCII].s = sl; - if (bl && b == E_ASCII) - enc[p][b].s += enc[p + sl][b].s; - // C40 - sub = tl = sl = 0; - do { - unsigned char c = s[p + sl++]; - if (c & 0x80) { // shift + upper - sub += 2; - c &= 0x7F; - } - if (c != ' ' && !isdigit(c) && !isupper(c)) - sub++; // shift - sub++; - while (sub >= 3) { - sub -= 3; - tl += 2; - } - } while (sub && p + sl < l); - if (exact && sub == 2 && p + sl == l) { - // special case, can encode last block with shift 0 at end (Is this - // valid when not end of target buffer?) - sub = 0; - tl += 2; - } - if (!sub) { // can encode C40 - bl = 0; - if (p + sl < l) - for (e = 0; e < E_MAX; e++) - if (enc[p + sl][e].t - && - ((t = - enc[p + sl][e].t + - switchcost[E_C40][e]) < bl - || !bl)) { - bl = t; - b = e; - } - if (exact && enc[p + sl][E_ASCII].t == 1 && 1 < bl) { - // special case, switch to ASCII for last bytes - bl = 1; - b = E_ASCII; - } - enc[p][E_C40].t = tl + bl; - enc[p][E_C40].s = sl; - if (bl && b == E_C40) - enc[p][b].s += enc[p + sl][b].s; - } - // Text - sub = tl = sl = 0; - do { - unsigned char c = s[p + sl++]; - if (c & 0x80) { // shift + upper - sub += 2; - c &= 0x7F; - } - if (c != ' ' && !isdigit(c) && !islower(c)) - sub++; // shift - sub++; - while (sub >= 3) { - sub -= 3; - tl += 2; - } - } while (sub && p + sl < l); - if (exact && sub == 2 && p + sl == l) { - // special case, can encode last block with shift 0 at end (Is this - // valid when not end of target buffer?) - sub = 0; - tl += 2; - } - if (!sub && sl) { // can encode Text - bl = 0; - if (p + sl < l) - for (e = 0; e < E_MAX; e++) - if (enc[p + sl][e].t - && - ((t = - enc[p + sl][e].t + - switchcost[E_TEXT][e]) < bl - || !bl)) { - bl = t; - b = e; - } - if (exact && enc[p + sl][E_ASCII].t == 1 && 1 < bl) { // special case, switch to ASCII for last bytes - bl = 1; - b = E_ASCII; - } - enc[p][E_TEXT].t = tl + bl; - enc[p][E_TEXT].s = sl; - if (bl && b == E_TEXT) - enc[p][b].s += enc[p + sl][b].s; - } - // X12 - sub = tl = sl = 0; - do { - unsigned char c = s[p + sl++]; - if (c != 13 && c != '*' && c != '>' && c != ' ' - && !isdigit(c) && !isupper(c)) { - sl = 0; - break; - } - sub++; - while (sub >= 3) { - sub -= 3; - tl += 2; - } - } while (sub && p + sl < l); - if (!sub && sl) { // can encode X12 - bl = 0; - if (p + sl < l) - for (e = 0; e < E_MAX; e++) - if (enc[p + sl][e].t - && - ((t = - enc[p + sl][e].t + - switchcost[E_X12][e]) < bl - || !bl)) { - bl = t; - b = e; - } - if (exact && enc[p + sl][E_ASCII].t == 1 && 1 < bl) { - // special case, switch to ASCII for last bytes - bl = 1; - b = E_ASCII; - } - enc[p][E_X12].t = tl + bl; - enc[p][E_X12].s = sl; - if (bl && b == E_X12) - enc[p][b].s += enc[p + sl][b].s; - } - // EDIFACT - sl = bl = 0; - if (s[p + 0] >= 32 && s[p + 0] <= 94) { // can encode 1 - char bs = 0; - if (p + 1 == l && (!bl || bl < 2)) { - bl = 2; - bs = 1; - } else - for (e = 0; e < E_MAX; e++) - if (e != E_EDIFACT && enc[p + 1][e].t - && - ((t = - 2 + enc[p + 1][e].t + - switchcost[E_ASCII][e]) - < bl || !bl)) // E_ASCII as allowed for unlatch - { - bs = 1; - bl = t; - b = e; - } - if (p + 1 < l && s[p + 1] >= 32 && s[p + 1] <= 94) { // can encode 2 - if (p + 2 == l && (!bl || bl < 2)) { - bl = 3; - bs = 2; - } else - for (e = 0; e < E_MAX; e++) - if (e != E_EDIFACT - && enc[p + 2][e].t - && - ((t = - 3 + enc[p + 2][e].t + - switchcost[E_ASCII][e]) - < bl || !bl)) // E_ASCII as allowed for unlatch - { - bs = 2; - bl = t; - b = e; - } - if (p + 2 < l && s[p + 2] >= 32 && s[p + 2] <= 94) { // can encode 3 - if (p + 3 == l && (!bl || bl < 3)) { - bl = 3; - bs = 3; - } else - for (e = 0; e < E_MAX; e++) - if (e != E_EDIFACT - && enc[p + 3][e].t - && - ((t = - 3 + enc[p + - 3][e].t + - switchcost - [E_ASCII][e]) - < bl || !bl)) // E_ASCII as allowed for unlatch - { - bs = 3; - bl = t; - b = e; - } - if (p + 4 < l && s[p + 3] >= 32 && s[p + 3] <= 94) { // can encode 4 - if (p + 4 == l - && (!bl || bl < 3)) { - bl = 3; - bs = 4; - } else { - for (e = 0; e < E_MAX; - e++) - if (enc[p + 4] - [e].t - && - ((t = - 3 + - enc[p + - 4][e]. - t + - switchcost - [E_EDIFACT] - [e]) < bl - || !bl)) { - bs = 4; - bl = t; - b = e; - } - if (exact - && enc[p + - 4][E_ASCII].t - && enc[p + - 4][E_ASCII]. - t <= 2 - && (t = - 3 + enc[p + - 4] - [E_ASCII].t) < - bl) { - // special case, switch to ASCII for last 1 ot two bytes - bs = 4; - bl = t; - b = E_ASCII; - } - } - } - } - } - enc[p][E_EDIFACT].t = bl; - enc[p][E_EDIFACT].s = bs; - if (bl && b == E_EDIFACT) - enc[p][b].s += enc[p + bs][b].s; - } - // Binary - bl = 0; - for (e = 0; e < E_MAX; e++) - if (enc[p + 1][e].t - && - ((t = - enc[p + 1][e].t + switchcost[E_BINARY][e] + - ((e == E_BINARY - && enc[p + 1][e].t == 249) ? 1 : 0)) - < bl || !bl)) { - bl = t; - b = e; - } - enc[p][E_BINARY].t = 1 + bl; - enc[p][E_BINARY].s = 1; - if (bl && b == E_BINARY) - enc[p][b].s += enc[p + 1][b].s; - /* - * fprintf (stderr, "%d:", p); for (e = 0; e < E_MAX; e++) fprintf \ - * (stderr, " %c*%d/%d", encchr[e], enc[p][e].s, enc[p][e].t); \ - * fprintf (stderr, "\n"); - */ - } - encoding = safemalloc(l + 1); - p = 0; - { - char cur = E_ASCII; // starts ASCII - while (p < l) { - int t, m = 0; - char b = 0; - for (e = 0; e < E_MAX; e++) - if (enc[p][e].t - && ((t = enc[p][e].t + switchcost[cur][e]) < - m || t == m && e == cur || !m)) { - b = e; - m = t; - } - cur = b; - m = enc[p][b].s; - if (!p && lenp) - *lenp = enc[p][b].t; - while (p < l && m--) - encoding[p++] = encchr[b]; - } - } - encoding[p] = 0; - return encoding; -} - -/* - * Main encoding function - * Returns the grid (malloced) containing the matrix. L corner at 0,0. - * Takes suggested size in *Wptr, *Hptr, or 0,0. Fills in actual size. - * Takes barcodelen and barcode to be encoded - * Note, if *encodingptr is null, then fills with auto picked (malloced) - * encoding - * If lenp not null, then the length of encoded data before any final - * unlatch or pad is stored - * If maxp not null, then the max storage of this size code is stored - * If eccp not null, then the number of ecc bytes used in this size is - * stored - * Returns 0 on error (writes to stderr with details). - */ - -unsigned char *iec16022ecc200(int *Wptr, int *Hptr, char **encodingptr, - int barcodelen, unsigned char *barcode, - int *lenp, int *maxp, int *eccp) -{ - unsigned char binary[3000]; // encoded raw data and ecc to place in barcode - int W = 0, H = 0; - char *encoding = 0; - unsigned char *grid = 0; - struct ecc200matrix_s *matrix; - memset(binary, 0, sizeof(binary)); - if (encodingptr) - encoding = *encodingptr; - if (Wptr) - W = *Wptr; - if (Hptr) - H = *Hptr; - - // encoding - if (W) { // known size - for (matrix = ecc200matrix; matrix->W && (matrix->W != W || - matrix->H != H); - matrix++) ; - if (!matrix->W) { - fprintf(stderr, "Invalid size %dx%d\n", W, H); - return 0; - } - if (!encoding) { - int len; - char *e = encmake(barcodelen, barcode, &len, 1); - if (e && len != matrix->bytes) { // try not an exact fit - free(e); - e = encmake(barcodelen, barcode, &len, 0); - if (len > matrix->bytes) { - fprintf(stderr, - "Cannot make barcode fit %dx%d\n", - W, H); - return 0; - } - } - encoding = e; - } - } else { - // find a suitable encoding - if (encoding == NULL) - encoding = encmake(barcodelen, barcode, NULL, 1); - - if (encoding) { // find one that fits chosen encoding - for (matrix = ecc200matrix; matrix->W; matrix++) - if (ecc200encode - (binary, matrix->bytes, barcode, barcodelen, - encoding, 0)) - break; - } else { - int len; - char *e; - e = encmake(barcodelen, barcode, &len, 1); - for (matrix = ecc200matrix; - matrix->W && matrix->bytes != len; matrix++) ; - if (e && !matrix->W) { // try for non exact fit - free(e); - e = encmake(barcodelen, barcode, &len, 0); - for (matrix = ecc200matrix; - matrix->W && matrix->bytes < len; - matrix++) ; - } - encoding = e; - } - if (!matrix->W) { - fprintf(stderr, - "Cannot find suitable size, barcode too long\n"); - return 0; - } - W = matrix->W; - H = matrix->H; - } - if (!ecc200encode(binary, matrix->bytes, barcode, barcodelen, - encoding, lenp)) { - fprintf(stderr, "Barcode too long for %dx%d\n", W, H); - return 0; - } - // ecc code - ecc200(binary, matrix->bytes, matrix->datablock, matrix->rsblock); - { // placement - int x, y, NC, NR, *places; - NC = W - 2 * (W / matrix->FW); - NR = H - 2 * (H / matrix->FH); - places = safemalloc(NC * NR * sizeof(int)); - ecc200placement(places, NR, NC); - grid = safemalloc(W * H); - memset(grid, 0, W * H); - for (y = 0; y < H; y += matrix->FH) { - for (x = 0; x < W; x++) - grid[y * W + x] = 1; - for (x = 0; x < W; x += 2) - grid[(y + matrix->FH - 1) * W + x] = 1; - } - for (x = 0; x < W; x += matrix->FW) { - for (y = 0; y < H; y++) - grid[y * W + x] = 1; - for (y = 0; y < H; y += 2) - grid[y * W + x + matrix->FW - 1] = 1; - } - for (y = 0; y < NR; y++) { - for (x = 0; x < NC; x++) { - int v = places[(NR - y - 1) * NC + x]; - //fprintf (stderr, "%4d", v); - if (v == 1 || v > 7 - && (binary[(v >> 3) - 1] & (1 << (v & 7)))) - grid[(1 + y + - 2 * (y / (matrix->FH - 2))) * W + - 1 + x + - 2 * (x / (matrix->FW - 2))] = 1; - } - //fprintf (stderr, "\n"); - } - free(places); - } - if (Wptr) - *Wptr = W; - if (Hptr) - *Hptr = H; - if (encodingptr) - *encodingptr = encoding; - if (maxp) - *maxp = matrix->bytes; - if (eccp) - *eccp = - (matrix->bytes + 2) / matrix->datablock * matrix->rsblock; - return grid; -} diff --git a/glabels2/iec16022-0.2.1/iec16022ecc200.h b/glabels2/iec16022-0.2.1/iec16022ecc200.h deleted file mode 100644 index 08678f08..00000000 --- a/glabels2/iec16022-0.2.1/iec16022ecc200.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * IEC16022 bar code generation - * Adrian Kennard, Andrews & Arnold Ltd - * with help from Cliff Hones on the RS coding - * - * (c) 2004 Adrian Kennard, Andrews & Arnold Ltd - * (c) 2006 Stefan Schmidt - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * - * Main encoding function - * Returns the grid (malloced) containing the matrix. L corner at 0,0. - * Takes suggested size in *Wptr, *Hptr, or 0,0. Fills in actual size. - * Takes barcodelen and barcode to be encoded - * Note, if *encodingptr is null, then fills with auto picked (malloced) - * encoding. - * If lenp not null, then the length of encoded data before any final unlatch - * or pad is stored. - * If maxp not null, then the max storage of this size code is stored - * If eccp not null, then the number of ecc bytes used in this size is stored - * Returns 0 on error (writes to stderr with details). - * - */ - -#ifndef __IEC16022ECC200_H -#define __IEC16022ECC200_H - -unsigned char *iec16022ecc200(int *Wptr, int *Hptr, char **encodingptr, - int barcodelen, unsigned char *barcode, - int *lenp, int *maxp, int *eccp); -#define MAXBARCODE 3116 - -#endif /* __IEC16022ECC200_H */ diff --git a/glabels2/iec16022-0.2.1/image.c b/glabels2/iec16022-0.2.1/image.c deleted file mode 100644 index f7dc3056..00000000 --- a/glabels2/iec16022-0.2.1/image.c +++ /dev/null @@ -1,668 +0,0 @@ -/** - * - * Image handling tools, (c) AJK 2001-2005 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include -#include -#include -#include -#include "image.h" - -#define INTERLACE -#define CLEAR -#define USEZLIB - -#ifdef USEZLIB -#include -#endif - -unsigned char const bbc[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // - 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x00, // ! - 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // " - 0x36, 0x36, 0x7F, 0x36, 0x7F, 0x36, 0x36, 0x00, // # - 0x0C, 0x3F, 0x68, 0x3E, 0x0B, 0x7E, 0x18, 0x00, // $ - 0x60, 0x66, 0x0C, 0x18, 0x30, 0x66, 0x06, 0x00, // % - 0x38, 0x6C, 0x6C, 0x38, 0x6D, 0x66, 0x3B, 0x00, // & - 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, // ' - 0x0C, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00, // ( - 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, // ) - 0x00, 0x18, 0x7E, 0x3C, 0x7E, 0x18, 0x00, 0x00, // * - 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, // + - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, // , - 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, // - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, // . - 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00, // / - 0x18, 0x24, 0x66, 0x66, 0x66, 0x24, 0x18, 0x00, // 0 (non crossed) - 0x18, 0x38, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, // 1 - 0x3C, 0x66, 0x06, 0x0C, 0x18, 0x30, 0x7E, 0x00, // 2 - 0x3C, 0x66, 0x06, 0x1C, 0x06, 0x66, 0x3C, 0x00, // 3 - 0x0C, 0x1C, 0x3C, 0x6C, 0x7E, 0x0C, 0x0C, 0x00, // 4 - 0x7E, 0x60, 0x7C, 0x06, 0x06, 0x66, 0x3C, 0x00, // 5 - 0x1C, 0x30, 0x60, 0x7C, 0x66, 0x66, 0x3C, 0x00, // 6 - 0x7E, 0x06, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00, // 7 - 0x3C, 0x66, 0x66, 0x3C, 0x66, 0x66, 0x3C, 0x00, // 8 - 0x3C, 0x66, 0x66, 0x3E, 0x06, 0x0C, 0x38, 0x00, // 9 - 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, // : - 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x30, // ; - 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x00, // < - 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00, // = - 0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x00, // > - 0x3C, 0x66, 0x0C, 0x18, 0x18, 0x00, 0x18, 0x00, // ? - 0x3C, 0x66, 0x6E, 0x6A, 0x6E, 0x60, 0x3C, 0x00, // @ - 0x3C, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00, // A - 0x7C, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x7C, 0x00, // B - 0x3C, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3C, 0x00, // C - 0x78, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0x78, 0x00, // D - 0x7E, 0x60, 0x60, 0x7C, 0x60, 0x60, 0x7E, 0x00, // E - 0x7E, 0x60, 0x60, 0x7C, 0x60, 0x60, 0x60, 0x00, // F - 0x3C, 0x66, 0x60, 0x6E, 0x66, 0x66, 0x3C, 0x00, // G - 0x66, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00, // H - 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, // I - 0x3E, 0x0C, 0x0C, 0x0C, 0x0C, 0x6C, 0x38, 0x00, // J - 0x66, 0x6C, 0x78, 0x70, 0x78, 0x6C, 0x66, 0x00, // K - 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7E, 0x00, // L - 0x63, 0x77, 0x7F, 0x6B, 0x6B, 0x63, 0x63, 0x00, // M - 0x66, 0x66, 0x76, 0x7E, 0x6E, 0x66, 0x66, 0x00, // N - 0x3C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, // O - 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x60, 0x60, 0x00, // P - 0x3C, 0x66, 0x66, 0x66, 0x6A, 0x6C, 0x36, 0x00, // Q - 0x7C, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0x66, 0x00, // R - 0x3C, 0x66, 0x60, 0x3C, 0x06, 0x66, 0x3C, 0x00, // S - 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, // T - 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, // U - 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00, // V - 0x63, 0x63, 0x6B, 0x6B, 0x7F, 0x77, 0x63, 0x00, // W - 0x66, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x66, 0x00, // X - 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x00, // Y - 0x7E, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x7E, 0x00, // Z - 0x7C, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7C, 0x00, // [ - 0x00, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x00, // - 0x3E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x3E, 0x00, // ] - 0x18, 0x3C, 0x66, 0x42, 0x00, 0x00, 0x00, 0x00, // ^ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, // _ - 0x1C, 0x36, 0x30, 0x7C, 0x30, 0x30, 0x7E, 0x00, // ` - 0x00, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, // a - 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x7C, 0x00, // b - 0x00, 0x00, 0x3C, 0x66, 0x60, 0x66, 0x3C, 0x00, // c - 0x06, 0x06, 0x3E, 0x66, 0x66, 0x66, 0x3E, 0x00, // d - 0x00, 0x00, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, // e - 0x1C, 0x30, 0x30, 0x7C, 0x30, 0x30, 0x30, 0x00, // f - 0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x3C, // g - 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x66, 0x00, // h - 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, // i - 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x70, // j - 0x60, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0x00, // k - 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, // l - 0x00, 0x00, 0x36, 0x7F, 0x6B, 0x6B, 0x63, 0x00, // m - 0x00, 0x00, 0x7C, 0x66, 0x66, 0x66, 0x66, 0x00, // n - 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, // o - 0x00, 0x00, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x60, // p - 0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x07, // q - 0x00, 0x00, 0x6C, 0x76, 0x60, 0x60, 0x60, 0x00, // r - 0x00, 0x00, 0x3E, 0x60, 0x3C, 0x06, 0x7C, 0x00, // s - 0x30, 0x30, 0x7C, 0x30, 0x30, 0x30, 0x1C, 0x00, // t - 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, // u - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00, // v - 0x00, 0x00, 0x63, 0x6B, 0x6B, 0x7F, 0x36, 0x00, // w - 0x00, 0x00, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x00, // x - 0x00, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x06, 0x3C, // y - 0x00, 0x00, 0x7E, 0x0C, 0x18, 0x30, 0x7E, 0x00, // z - 0x0C, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0C, 0x00, // { - 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, // | - 0x30, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x30, 0x00, // } - 0x31, 0x6B, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, // ~ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // -}; - -const char smallc[] = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-+&()/[];%"; -unsigned char const small[] = { - 0x00, 0x00, 0x00, // - 0x1F, 0x11, 0x1F, //0 - 0x11, 0x1F, 0x10, //1 - 0x1D, 0x15, 0x17, //2 - 0x11, 0x15, 0x1F, //3 - 0x07, 0x04, 0x1F, //4 - 0x17, 0x15, 0x1D, //5 - 0x1F, 0x15, 0x1D, //6 - 0x01, 0x01, 0x1F, //7 - 0x1F, 0x15, 0x1F, //8 - 0x17, 0x15, 0x1F, //9 - 0x1E, 0x05, 0x1E, //A - 0x1F, 0x15, 0x0A, //B - 0x0E, 0x11, 0x11, //C - 0x1F, 0x11, 0x0E, //D - 0x1F, 0x15, 0x11, //E - 0x1F, 0x05, 0x01, //F - 0x0E, 0x11, 0x19, //G - 0x1F, 0x04, 0x1F, //H - 0x11, 0x1F, 0x11, //I - 0x11, 0x0F, 0x01, //J - 0x1F, 0x04, 0x1B, //K - 0x1F, 0x10, 0x10, //L - 0x1F, 0x03, 0x1F, //M - 0x1F, 0x01, 0x1F, //N - 0x0E, 0x11, 0x0E, //O - 0x1F, 0x05, 0x02, //P - 0x0E, 0x19, 0x1E, //Q - 0x1F, 0x05, 0x1A, //R - 0x12, 0x15, 0x09, //S - 0x01, 0x1F, 0x01, //T - 0x1F, 0x10, 0x1F, //U - 0x0F, 0x10, 0x0F, //V - 0x1F, 0x18, 0x1F, //W - 0x1B, 0x04, 0x1B, //X - 0x03, 0x1C, 0x03, //Y - 0x19, 0x15, 0x13, //Z - 0x04, 0x04, 0x04, //- - 0x04, 0x0E, 0x04, //+ - 0x04, 0x0E, 0x04, //& (+) - 0x00, 0x0E, 0x11, //( - 0x11, 0x0E, 0x00, //) - 0x08, 0x04, 0x02, /// - 0x00, 0x1F, 0x11, //[ - 0x11, 0x1F, 0x00, //] - 0x10, 0x0A, 0x00, //; - 0x09, 0x04, 0x12, //% -}; - -Image *ImageNew(int w, int h, int c) -{ // create a new blank image - Image *i; - if (!w || !h) - return 0; - i = malloc(sizeof(*i)); - if (!i) - return 0; - memset(i, 0, sizeof(*i)); - i->W = w; - i->L = w + 1; - i->H = h; - i->C = c; - i->Image = malloc((w + 1) * h); - if (!i->Image) { - free(i); - return 0; - } - memset(i->Image, 0, (w + 1) * h); - if (c) { - i->Colour = malloc(sizeof(Colour) * c); - if (!i->Colour) { - free(i->Image); - free(i); - return 0; - } - memset(i->Colour, 0, sizeof(Colour) * c); - } - return i; -} - -void ImageFree(Image * i) -{ // free an image - if (i) { - if (i->Image) - free(i->Image); - if (i->Colour) - free(i->Colour); - free(i); - } -} - -#define MAXLZW 4096 -typedef short LZW[256]; -typedef LZW LZWTree[MAXLZW]; -typedef struct strPrivate { - int cols; // number of colours, power of 2 - unsigned char colbits; // number of bits for colours - int fh; // file handle - int lzwnext; // next code - int lzwlast; // last code in current bit size - int lzwbits; // current bit size - LZWTree lzw; // encode tree - unsigned char block[256]; // block so far, with count at start - int blockv; // pending value - int blockb; // bits used in pending value - short lzwcode; // which code we are on now -} Private; - -static LZWFlush(Private * p) -{ // flush this block - write(p->fh, p->block, *p->block + 1); - *p->block = 0; -} - -static LZWOut(Private * p, short v) -{ // output a value - p->blockv |= (v << p->blockb); - p->blockb += p->lzwbits; - while (p->blockb >= 8) { - p->block[++*p->block] = p->blockv; // last partial byte - p->blockv >>= 8; - p->blockb -= 8; - if (*p->block == 255) - LZWFlush(p); - } -} - -static LZWClear(Private * p) -{ - int c; - p->lzwbits = p->colbits + 1; - p->lzwnext = p->cols + 2; - p->lzwlast = (1 << p->lzwbits) - 1; - p->lzwcode = p->cols; // starting point - for (c = 0; c < p->cols; c++) { - p->lzw[p->cols][c] = c; // links to literal entries - // links from literals, dead ends initially - memset(&p->lzw[c], -1, p->cols * 2); - } -} - -static ImageStart(Private * p) -{ - unsigned char b = p->colbits; - write(p->fh, &b, 1); - *p->block = 0; - p->blockb = 0; - p->blockv = 0; - LZWClear(p); - LZWOut(p, p->cols); // clear code -} - -static ImageEnd(Private * p) -{ - LZWOut(p, p->lzwcode); // last prefix - LZWOut(p, p->cols + 1); // end code - if (p->blockb) - p->block[++*p->block] = p->blockv; // last partial byte - LZWFlush(p); -} - -static ImageOut(Private * p, unsigned char c) -{ - short next = p->lzw[p->lzwcode][c]; - if (next == -1) { // dead end - LZWOut(p, p->lzwcode); // prefix -#ifdef CLEAR - if (p->lzwnext + 1 == MAXLZW) { - LZWOut(p, p->cols); // clear code - LZWClear(p); - } else -#endif - if (p->lzwnext < MAXLZW) { - memset(p->lzw[p->lzwnext], -1, p->cols * 2); // init dead ends - p->lzw[p->lzwcode][c] = p->lzwnext; - if (p->lzwnext > p->lzwlast) { // bigger code - p->lzwbits++; - p->lzwlast = (1 << p->lzwbits) - 1; - } - p->lzwnext++; - } - p->lzwcode = c; - } else - p->lzwcode = next; // not a dead end -} - -// write GIF image -void ImageWriteGif(Image * i, int fh, int back, int trans, char *comment) -{ - struct strPrivate p; - p.fh = fh; - // count colours, min 4 - for (p.colbits = 2, p.cols = 4; p.cols < i->C; - p.cols *= 2, p.colbits++) ; - { // headers - char buf[1500]; - int n = 0; - strcpy(buf, "GIF87a"); -#ifndef INTERLACE - if (comment || trans >= 0) -#endif - buf[4] = '9'; // needs gif89 format - n = 6; - buf[n++] = (i->W & 255); - buf[n++] = (i->W >> 8); - buf[n++] = (i->H & 255); - buf[n++] = (i->H >> 8); - buf[n++] = (i->Colour ? 0x80 : 0) + 0x70 + (p.colbits - 1); - buf[n++] = back; // background - buf[n++] = 0; // aspect - if (i->Colour) { - int c; - for (c = 0; c < p.cols; c++) { - if (c < i->C) { - buf[n++] = (i->Colour[c] >> 16 & 255); - buf[n++] = (i->Colour[c] >> 8 & 255); - buf[n++] = (i->Colour[c] & 255); - } else { // extra, unused, colour - buf[n++] = 0; - buf[n++] = 0; - buf[n++] = 0; - } - } - } - // comment - if (comment && strlen(comment) < 256) { // comment - buf[n++] = 0x21; //extension - buf[n++] = 0xFE; //comment - buf[n++] = strlen(comment); - strcpy(buf + n, comment); - n += buf[n - 1]; - buf[n++] = 0; // end of block - } - if (trans >= 0) { // transparrent - buf[n++] = 0x21; // extension - buf[n++] = 0xF9; // graphic control - buf[n++] = 4; // len - buf[n++] = 1; // transparrent - buf[n++] = 0; // delay - buf[n++] = 0; - buf[n++] = trans; - buf[n++] = 0; // terminator - } - // image - buf[n++] = 0x2C; - buf[n++] = 0; // offset X - buf[n++] = 0; - buf[n++] = 0; // offset Y - buf[n++] = 0; - buf[n++] = (i->W & 255); - buf[n++] = (i->W >> 8); - buf[n++] = (i->H & 255); - buf[n++] = (i->H >> 8); -#ifdef INTERLACE - buf[n++] = 0x40; // interlaced, no local colour table -#else - buf[n++] = 0x00; // non interlaced, no local colour table -#endif - write(fh, buf, n); - } - // image data - { - unsigned char *b; - int x, y; - ImageStart(&p); -#ifdef INTERLACE - for (y = 0; y < i->H; y += 8) - for (b = &ImagePixel(i, 0, y), x = 0; x < i->W; x++) - ImageOut(&p, *b++); - for (y = 4; y < i->H; y += 8) - for (b = &ImagePixel(i, 0, y), x = 0; x < i->W; x++) - ImageOut(&p, *b++); - for (y = 2; y < i->H; y += 4) - for (b = &ImagePixel(i, 0, y), x = 0; x < i->W; x++) - ImageOut(&p, *b++); - for (y = 1; y < i->H; y += 2) - for (b = &ImagePixel(i, 0, y), x = 0; x < i->W; x++) - ImageOut(&p, *b++); -#else - for (y = 0; y < i->H; y++) - for (b = &ImagePixel(i, 0, y), x = 0; x < i->W; x++) - ImageOut(&p, *b++); -#endif - ImageEnd(&p); - } - write(fh, "\0", 1); // end of image data - write(fh, "\x3B", 1); // trailer -} - -void ImageText(Image * i, int x, int y, int col, char *text) -{ // writes 8x8 text - if (i && text) - while (*text) { - if (*text >= ' ' && *text) { - int r; - unsigned const char *b = - bbc + (*text - ' ') * 8; - for (r = 0; r < 8; r++) { - unsigned char v = *b++; - unsigned char *p = - &ImagePixel(i, x, y + r); - unsigned char m; - for (m = 0x80; m; m >>= 1, p++) - if (v & m) - *p = col; - } - } - x += 8; - text++; - } -} - -void ImageSmall(Image * i, int x, int y, int col, char *text) -{ // writes 4x6 digits - if (i && text) - while (*text) { - char *p = strchr(smallc, toupper(*text)); - if (p) { - int r; - char m = 1; - unsigned const char *b = - small + (p - smallc) * 3; - for (r = 0; r < 5; r++) { - int c; - for (c = 0; c < 3; c++) - if (b[c] & m) - ImagePixel(i, x + c, - y + r) = col; - m <<= 1; - } - x += 4; - } else if (*text == '.') { - ImagePixel(i, x, y + 4) = col; - x += 2; - } else if (*text == ':') { - ImagePixel(i, x, y + 1) = col; - ImagePixel(i, x, y + 3) = col; - x += 2; - } - text++; - } -} - -void ImageRect(Image * i, int x, int y, int w, int h, int c) -{ // fill a box - if (i && w && h) { - while (h--) { - unsigned char *p = &ImagePixel(i, x, y); - int n = w; - while (n--) - *p++ = c; - y++; - } - } -} - -// PNG code - - /* Table of CRCs of all 8-bit messages. */ -static unsigned int crc_table[256]; - - /* Make the table for a fast CRC. */ -void make_crc_table(void) -{ - unsigned int c; - int n, k; - for (n = 0; n < 256; n++) { - c = (unsigned int)n; - for (k = 0; k < 8; k++) { - if (c & 1) - c = 0xedb88320L ^ (c >> 1); - else - c = c >> 1; - } - crc_table[n] = c; - } -} - - /* Update a running CRC with the bytes buf[0..len-1]--the CRC - should be initialized to all 1's, and the transmitted value - is the 1's complement of the final running CRC (see the - crc() routine below)). */ - -unsigned int update_crc(unsigned int crc, unsigned char *buf, int len) -{ - unsigned int c = crc; - int n; - - for (n = 0; n < len; n++) - c = crc_table[(c ^ buf[n]) & 0xff] ^ (c >> 8); - - return c; -} - - /* Return the CRC of the bytes buf[0..len-1]. */ -unsigned int crc(unsigned char *buf, int len) -{ - return update_crc(0xffffffffL, buf, len) ^ 0xffffffffL; -} - -unsigned int writecrc(int fh, char *ptr, int len, unsigned int c) -{ - write(fh, ptr, len); - while (len--) - c = crc_table[(c ^ *ptr++) & 0xff] ^ (c >> 8); - return c; -} - -void writechunk(int fh, char *typ, void *ptr, int len) -{ - unsigned int v = htonl(len), crc; - write(fh, &v, 4); - crc = writecrc(fh, typ, 4, ~0); - if (len) - crc = writecrc(fh, ptr, len, crc); - v = htonl(~crc); - write(fh, &v, 4); -} - -#ifndef USEZLIB -unsigned int adlersum(unsigned char *p, int l, unsigned int adler) -{ - unsigned int s1 = (adler & 65535), s2 = (adler >> 16); - while (l--) { - s1 += *p++; - s2 += s1; - } - s1 %= 65521; // can be delayed due to sensible "l" values... - s2 %= 65521; - return (s2 << 16) + s1; -} -#endif - -// write PNG image -void ImageWritePNG(Image * i, int fh, int back, int trans, char *comment) -{ - make_crc_table(); - write(fh, "\211PNG\r\n\032\n", 8); // PNG header - { // IHDR - struct { - unsigned int width; - unsigned int height; - unsigned char depth; - unsigned char colour; - unsigned char compress; - unsigned char filter; - unsigned char interlace; - } ihdr = { - 0, 0, 8, 3, 0, 0}; - ihdr.width = htonl(i->W); - ihdr.height = htonl(i->H); - writechunk(fh, "IHDR", &ihdr, 13); - } - { // PLTE - unsigned int v = htonl(i->C * 3), crc, n; - write(fh, &v, 4); - crc = writecrc(fh, "PLTE", 4, ~0); - for (n = 0; n < i->C; n++) { - v = htonl(i->Colour[n] << 8); - crc = writecrc(fh, (void *)&v, 3, crc); - } - v = htonl(~crc); - write(fh, &v, 4); - } - if (back >= 0) { // bKGD - unsigned char b = back; - writechunk(fh, "bKGD", &b, 1); - } - if (*comment) { // tEXt - char c[] = "Comment"; - unsigned int v = htonl(strlen(c) + strlen(comment) + 1), crc; - write(fh, &v, 4); - crc = writecrc(fh, "tEXt", 4, ~0); - crc = writecrc(fh, c, strlen(c) + 1, crc); - crc = writecrc(fh, comment, strlen(comment), crc); - v = htonl(~crc); - write(fh, &v, 4); - } - { // tRNS - unsigned char alpha[256]; - int n; - for (n = 0; n < i->C; n++) - // 4th palette byte treated as 0=opaque, 255-transparren - alpha[n] = 255 - (i->Colour[n] >> 24); - if (trans >= 0 && trans < i->C) - // manual set of specific transparrent colour - alpha[trans] = 0; - writechunk(fh, "tRNS", alpha, i->C); - } -#ifndef USEZLIB - { // IDAT - unsigned int v = htonl(i->H * (i->L + 5) + 6), - crc, adler = 1, n; - unsigned char *p = i->Image; - write(fh, &v, 4); - crc = writecrc(fh, "IDAT", 4, ~0); - crc = writecrc(fh, "\170\001", 2, crc); // zlib header for deflate - n = i->H; - while (n--) { - unsigned char h[5]; - h[0] = (n ? 0 : 1); // last chunk in deflate, un compressed - h[1] = (i->L & 255); // Len, LSB first as per deflate spec - h[2] = (i->L / 256); - h[3] = ~(i->L & 255); // Inverse of Len - h[4] = ~(i->L / 256); - *p = 0; // filter 0 (NONE) - crc = writecrc(fh, h, 5, crc); - crc = writecrc(fh, p, i->L, crc); - adler = adlersum(p, i->L, adler); - p += i->L; - } - v = htonl(adler); - crc = writecrc(fh, (void *)&v, 4, crc); - v = htonl(~crc); - write(fh, &v, 4); - } -#else - { // IDAT - unsigned char *temp; - unsigned long n; - for (n = 0; n < i->H; n++) - i->Image[n * i->L] = 0; // filter 0 - n = i->H * i->L * 1001 / 1000 + 12; - temp = malloc(n); - if (compress2(temp, &n, i->Image, i->L * i->H, 9) != Z_OK) - fprintf(stderr, "Deflate error\n"); - else - writechunk(fh, "IDAT", temp, n); - free(temp); - } -#endif - writechunk(fh, "IEND", 0, 0); // IEND -} diff --git a/glabels2/iec16022-0.2.1/image.h b/glabels2/iec16022-0.2.1/image.h deleted file mode 100644 index 92d6d06e..00000000 --- a/glabels2/iec16022-0.2.1/image.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - * Image handling tools, (c) AJK 2001-2005 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef __IMAGE_H -#define __IMAGE_H - -typedef unsigned int Colour; // RGB value - -// Image object -typedef struct { - int W, // width - L, // Line length in Image (W+1) - H; // height - unsigned char *Image; // image array, one byte per pixel - int C; // colours (can be non power of 2, max 256) - Colour *Colour; // colour map (must have entry for each colour) -} Image; - -// macros and functions - -#define ImagePixel(i,x,y) ((i)->Image[1+(i)->L*(y)+(x)]) - -Image *ImageNew(int w, int h, int c); // create a new blank image -void ImageFree(Image * i); // free an image -void ImageWriteGif(Image * i, int fh, int back, int trans, char *comment); -void ImageWritePNG(Image * i, int fh, int back, int trans, char *comment); -void ImageText(Image * i, int x, int y, int c, char *text); // write 8x8 text -void ImageSmall(Image * i, int x, int y, int c, char *text); // write 4x6 text -void ImageRect(Image * i, int x, int y, int w, int h, int c); // fill a box -#define ImageWrite ImageWritePNG // default - -#endif /* __IMAGE_H */ diff --git a/glabels2/iec16022-0.2.1/reedsol.c b/glabels2/iec16022-0.2.1/reedsol.c deleted file mode 100644 index a9502412..00000000 --- a/glabels2/iec16022-0.2.1/reedsol.c +++ /dev/null @@ -1,172 +0,0 @@ -/** - * - * This is a simple Reed-Solomon encoder - * (C) Cliff Hones 2004 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -// It is not written with high efficiency in mind, so is probably -// not suitable for real-time encoding. The aim was to keep it -// simple, general and clear. -// -// - -// Usage: -// First call rs_init_gf(poly) to set up the Galois Field parameters. -// Then call rs_init_code(size, index) to set the encoding size -// Then call rs_encode(datasize, data, out) to encode the data. -// -// These can be called repeatedly as required - but note that -// rs_init_code must be called following any rs_init_gf call. -// -// If the parameters are fixed, some of the statics below can be -// replaced with constants in the obvious way, and additionally -// malloc/free can be avoided by using static arrays of a suitable -// size. - -#include // only needed for debug (main) -#include // only needed for malloc/free - -static int gfpoly; -static int symsize; // in bits -static int logmod; // 2**symsize - 1 -static int rlen; - -static int *log = NULL, *alog = NULL, *rspoly = NULL; - -// rs_init_gf(poly) initialises the parameters for the Galois Field. -// The symbol size is determined from the highest bit set in poly -// This implementation will support sizes up to 30 bits (though that -// will result in very large log/antilog tables) - bit sizes of -// 8 or 4 are typical -// -// The poly is the bit pattern representing the GF characteristic -// polynomial. e.g. for ECC200 (8-bit symbols) the polynomial is -// a**8 + a**5 + a**3 + a**2 + 1, which translates to 0x12d. - -void rs_init_gf(int poly) -{ - int m, b, p, v; - - // Return storage from previous setup - if (log) { - free(log); - free(alog); - free(rspoly); - rspoly = NULL; - } - // Find the top bit, and hence the symbol size - for (b = 1, m = 0; b <= poly; b <<= 1) - m++; - b >>= 1; - m--; - gfpoly = poly; - symsize = m; - - // Calculate the log/alog tables - logmod = (1 << m) - 1; - log = (int *)malloc(sizeof(int) * (logmod + 1)); - alog = (int *)malloc(sizeof(int) * logmod); - - for (p = 1, v = 0; v < logmod; v++) { - alog[v] = p; - log[p] = v; - p <<= 1; - if (p & b) - p ^= poly; - } -} - -// rs_init_code(nsym, index) initialises the Reed-Solomon encoder -// nsym is the number of symbols to be generated (to be appended -// to the input data). index is usually 1 - it is the index of -// the constant in the first term (i) of the RS generator polynomial: -// (x + 2**i)*(x + 2**(i+1))*... [nsym terms] -// For ECC200, index is 1. - -void rs_init_code(int nsym, int index) -{ - int i, k; - - if (rspoly) - free(rspoly); - rspoly = (int *)malloc(sizeof(int) * (nsym + 1)); - - rlen = nsym; - - rspoly[0] = 1; - for (i = 1; i <= nsym; i++) { - rspoly[i] = 1; - for (k = i - 1; k > 0; k--) { - if (rspoly[k]) - rspoly[k] = - alog[(log[rspoly[k]] + index) % logmod]; - rspoly[k] ^= rspoly[k - 1]; - } - rspoly[0] = alog[(log[rspoly[0]] + index) % logmod]; - index++; - } -} - -// Note that the following uses byte arrays, so is only suitable for -// symbol sizes up to 8 bits. Just change the data type of data and res -// to unsigned int * for larger symbols. - -void rs_encode(int len, unsigned char *data, unsigned char *res) -{ - int i, k, m; - for (i = 0; i < rlen; i++) - res[i] = 0; - for (i = 0; i < len; i++) { - m = res[rlen - 1] ^ data[i]; - for (k = rlen - 1; k > 0; k--) { - if (m && rspoly[k]) - res[k] = - res[k - - 1] ^ alog[(log[m] + - log[rspoly[k]]) % logmod]; - else - res[k] = res[k - 1]; - } - if (m && rspoly[0]) - res[0] = alog[(log[m] + log[rspoly[0]]) % logmod]; - else - res[0] = 0; - } -} - -#ifndef LIB -// The following tests the routines with the ISO/IEC 16022 Annexe R data -int main(void) -{ - register int i; - - unsigned char data[9] = { 142, 164, 186 }; - unsigned char out[5]; - - rs_init_gf(0x12d); - rs_init_code(5, 1); - - rs_encode(3, data, out); - - printf("Result of Annexe R encoding:\n"); - for (i = 4; i >= 0; i--) - printf(" %d\n", out[i]); - - return 0; -} -#endif diff --git a/glabels2/iec16022-0.2.1/reedsol.h b/glabels2/iec16022-0.2.1/reedsol.h deleted file mode 100644 index 0181a8df..00000000 --- a/glabels2/iec16022-0.2.1/reedsol.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * - * This is a simple Reed-Solomon encoder - * (C) Cliff Hones 2004 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef __REEDSOL_H -#define __REEDSOL_H - -void rs_init_gf(int poly); -void rs_init_code(int nsym, int index); -void rs_encode(int len, unsigned char *data, unsigned char *res); - -#endif /* __REEDSOL_H */ diff --git a/glabels2/iec16022-0.2.1/test/testsuite-example.bin b/glabels2/iec16022-0.2.1/test/testsuite-example.bin deleted file mode 100644 index 02a4436d..00000000 --- a/glabels2/iec16022-0.2.1/test/testsuite-example.bin +++ /dev/null @@ -1 +0,0 @@ -ÿÿÿÿ¿`ïÁ϶mÜ>ýÜÏÃðŠ¼N¯·«9š‚±¤Ë»¾ƒÐ@¨ÄÌEÙù£,Æ<°Ü-öb°:Çw×ɪªªªÿÿÿÿŸÀŽöÊÕï—¦‘¸%kûhŽÔ«-¨Û£0ËQ³kâÛ€Éôå£ÂÍ~„ögëTåགྷ絪ªªª \ No newline at end of file diff --git a/glabels2/iec16022-0.2.1/test/testsuite-example.eps b/glabels2/iec16022-0.2.1/test/testsuite-example.eps deleted file mode 100644 index 9f97c228..00000000 --- a/glabels2/iec16022-0.2.1/test/testsuite-example.eps +++ /dev/null @@ -1,15 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Creator: IEC16022 barcode/stamp generator -%%BarcodeData: Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o -%%BarcodeSize: 32x32 -%%BarcodeFormat: ECC200 -%%DocumentData: Clean7Bit -%%LanguageLevel: 1 -%%Pages: 1 -%%BoundingBox: 0 0 34 34 -%%EndComments -%%Page: 1 1 -32 32 1[1 0 0 1 -1 -1]{< -00000000 409F10E5 3E304992 23C102F9 23E0303C 0F7543B1 504854C6 657D4E5B 3444417C 2FBF573B 33BA2606 5CD339C3 4FE823D2 099D4FC5 38882836 55555555 -00000000 603F7109 352A10F0 68596EFB 47DA7094 0497712B 54D257E4 24ED5CCF 34AE4C94 1DE524E1 7F360B1A 5C3D3281 7BE60998 14AB1A1F 427C184A 55555555 ->}image diff --git a/glabels2/iec16022-0.2.1/test/testsuite-example.hex b/glabels2/iec16022-0.2.1/test/testsuite-example.hex deleted file mode 100644 index 874101c1..00000000 --- a/glabels2/iec16022-0.2.1/test/testsuite-example.hex +++ /dev/null @@ -1,2 +0,0 @@ -FFFFFFFF BF60EF1A C1CFB66D DC3EFD06 DC1FCFC3 F08ABC4E AFB7AB39 9A82B1A4 CBBBBE83 D040A8C4 CC45D9F9 A32CC63C B017DC2D F662B03A C777D7C9 AAAAAAAA -FFFFFFFF 9FC08EF6 CAD5EF0F 97A69104 B8258F6B FB688ED4 AB2DA81B DB12A330 CB51B36B E21ADB1E 80C9F4E5 A3C2CD7E 8419F667 EB54E5E0 BD83E7B5 AAAAAAAA diff --git a/glabels2/iec16022-0.2.1/test/testsuite-example.png b/glabels2/iec16022-0.2.1/test/testsuite-example.png deleted file mode 100644 index 050d1f0e..00000000 Binary files a/glabels2/iec16022-0.2.1/test/testsuite-example.png and /dev/null differ diff --git a/glabels2/iec16022-0.2.1/test/testsuite-example.text b/glabels2/iec16022-0.2.1/test/testsuite-example.text deleted file mode 100644 index 097a7d1c..00000000 --- a/glabels2/iec16022-0.2.1/test/testsuite-example.text +++ /dev/null @@ -1,32 +0,0 @@ -* * * * * * * * * * * * * * * * -* **** ** ***** **** ** * * -*** * ** * * * *** * **** -* * ** ***** ** ** *** -* * **** * ** ** * ****** -* ** * ***** * *** * * -*** * ** * ** ** ** **** -** * ** * * ** ** ** ** * ** -** ** ** * * * * ** ** -* * * ** * ** ** * * ** ** -***** ** ** * * *** ** * * -* *** * * ** **** ** * ** -* * **** * ** * * * * -** * * ** * * **** **** **** -* ******* * *** **** ** -******************************** -* * * * * * * * * * * * * * * * -** *** *** ***** * ***** * * -**** ** ** * * ** *** * -* ** * ***** *** * ** * -* * ** * ** ** ** **** -** ** * * *** ** ****** * -** * * * * * ** * -** * *** *** *** ***** * ** -* ** * * * * ** ** * * -* * ***** ** **** * * ** *** * -**** * * * * **** * *** -** *** ******* ****** ** -** *** ***** ****** * ** -** *** ***** ** ** ** ** * -* ****** ** *** **** ** * -******************************** diff --git a/glabels2/iec16022-0.2.1/test/testsuite.sh b/glabels2/iec16022-0.2.1/test/testsuite.sh deleted file mode 100755 index 82a100af..00000000 --- a/glabels2/iec16022-0.2.1/test/testsuite.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -FAILED=0 - -../iec16022 -o testsuite-test.text -f Text -c "Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o" -../iec16022 -o testsuite-test.eps -f EPS -c "Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o" -../iec16022 -o testsuite-test.png -f PNG -c "Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o" -../iec16022 -o testsuite-test.bin -f Bin -c "Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o" -../iec16022 -o testsuite-test.hex -f Hex -c "Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o" - -diff -b testsuite-test.text testsuite-example.text && echo "Text test passed" || echo "Text test FAILED" || FAILED=1 -diff -b testsuite-test.eps testsuite-example.eps && echo "EPS test passed" || echo "EPS test FAILED" || FAILED=1 -diff -b testsuite-test.png testsuite-example.png && echo "PNG test passed" || echo "PNG test FAILED" || FAILED=1 -diff -b testsuite-test.bin testsuite-example.bin && echo "Bin test passed" || echo "Bin test FAILED" || FAILED=1 -diff -b testsuite-test.hex testsuite-example.hex && echo "Hex test passed" || echo "Hex test FAILED" || FAILED=1 - -rm testsuite-test.* - -exit $FAILED diff --git a/glabels2/libglabels/Makefile.am b/glabels2/libglabels/Makefile.am deleted file mode 100644 index 2d1228ab..00000000 --- a/glabels2/libglabels/Makefile.am +++ /dev/null @@ -1,58 +0,0 @@ -templatesdir = $(datadir)/glabels/templates - -INCLUDES = \ - $(LIBGLABELS_CFLAGS) \ - -DDATADIR=\""$(datadir)"\" \ - -DLIBGLABELS_TEMPLATE_DIR=\""$(templatesdir)"\" \ - $(DISABLE_DEPRECATED_CFLAGS) - -libglabels_la_LDFLAGS=\ - -version-info $(LIBGLABELS_VERSION_INFO) \ - $(LIBGLABELS_LIBS) \ - -no-undefined - -lib_LTLIBRARIES = libglabels.la - -libglabelsincludedir=$(includedir)/libglabels - -libglabels_la_SOURCES = \ - libglabels-private.h \ - db.h \ - db.c \ - enums.h \ - paper.h \ - paper.c \ - category.h \ - category.c \ - template.h \ - template.c \ - xml-paper.h \ - xml-paper.c \ - xml-category.h \ - xml-category.c \ - xml-template.h \ - xml-template.c \ - xml.h \ - xml.c \ - str.h \ - str.c - -libglabelsinclude_HEADERS = \ - libglabels.h \ - db.h \ - enums.h \ - paper.h \ - category.h \ - template.h \ - xml-paper.h \ - xml-category.h \ - xml-template.h \ - xml.h \ - str.h - -EXTRA_DIST = \ - libglabels.pc.in - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libglabels.pc - diff --git a/glabels2/libglabels/category.c b/glabels2/libglabels/category.c deleted file mode 100644 index e82e0849..00000000 --- a/glabels2/libglabels/category.c +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (LIBGLABELS) Template library for GLABELS - * - * category.c: template category module - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ -#include - -#include "category.h" - -#include -#include -#include -#include -#include - -#include "libglabels-private.h" - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - - -/*===========================================*/ -/* Functions. */ -/*===========================================*/ -/** - * lgl_category_new: - * @id: Id of category definition. (E.g. label, card, etc.) Should be - * unique. - * @name: Localized name of category. - * - * Allocates and constructs a new #lglCategory structure. - * - * Returns: a pointer to a newly allocated #lglCategory structure. - * - */ -lglCategory * -lgl_category_new (gchar *id, - gchar *name) -{ - lglCategory *category; - - category = g_new0 (lglCategory,1); - category->id = g_strdup (id); - category->name = g_strdup (name); - - return category; -} - - -/** - * lgl_category_dup: - * @orig: #lglCategory structure to be duplicated. - * - * Duplicates an existing #lglCategory structure. - * - * Returns: a pointer to a newly allocated #lglCategory structure. - * - */ -lglCategory *lgl_category_dup (const lglCategory *orig) -{ - lglCategory *category; - - g_return_val_if_fail (orig, NULL); - - category = g_new0 (lglCategory,1); - - category->id = g_strdup (orig->id); - category->name = g_strdup (orig->name); - - return category; -} - - -/** - * lgl_category_free: - * @category: pointer to #lglCategory structure to be freed. - * - * Free all memory associated with an existing #lglCategory structure. - * - */ -void lgl_category_free (lglCategory *category) -{ - - if ( category != NULL ) { - - g_free (category->id); - category->id = NULL; - - g_free (category->name); - category->name = NULL; - - g_free (category); - } - -} - - diff --git a/glabels2/libglabels/category.h b/glabels2/libglabels/category.h deleted file mode 100644 index 3727d47d..00000000 --- a/glabels2/libglabels/category.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (LIBGLABELS) Template library for GLABELS - * - * category.h: template category module header file - * - * Copyright (C) 2006 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __CATEGORY_H__ -#define __CATEGORY_H__ - -#include -#include - -G_BEGIN_DECLS - -/* - * Template class - */ -typedef struct _lglCategory lglCategory; - -struct _lglCategory { - gchar *id; /* Unique ID of category */ - gchar *name; /* Localized name of category */ -}; - - -/* - * Category construction - */ -lglCategory *lgl_category_new (gchar *id, - gchar *name); - -lglCategory *lgl_category_dup (const lglCategory *orig); -void lgl_category_free (lglCategory *category); - - -G_END_DECLS - -#endif diff --git a/glabels2/libglabels/db.c b/glabels2/libglabels/db.c deleted file mode 100644 index a7279047..00000000 --- a/glabels2/libglabels/db.c +++ /dev/null @@ -1,1615 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (LIBGLABELS) Template library for GLABELS - * - * db.c: template db module - * - * Copyright (C) 2003-2007 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ -#include - -#include "db.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "libglabels-private.h" - -#include "xml-paper.h" -#include "xml-category.h" -#include "xml-template.h" - - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -static GList *papers = NULL; -static GList *categories = NULL; -static GList *templates = NULL; - -static GHashTable *template_cache = NULL; - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void init_template_cache (void); -static void add_to_template_cache (lglTemplate *template); - -static GList *read_papers (void); -static GList *read_paper_files_from_dir (GList *papers, - const gchar *dirname); - -static GList *read_categories (void); -static GList *read_category_files_from_dir (GList *categories, - const gchar *dirname); - -static GList *read_templates (void); -static GList *read_template_files_from_dir (GList *templates, - const gchar *dirname); - -static lglTemplate *template_full_page (const gchar *page_size); - - - -/*===========================================*/ -/* Module initialization */ -/*===========================================*/ - -/** - * lgl_db_init: - * - * Initialize all libglabels subsystems. It is not necessary for an application to call - * lgl_db_init(), because libglabels will initialize on demand. An application programmer may - * choose to call lgl_db_init() at startup to minimize the impact of the first libglabels call - * on GUI response time. - * - * This function initializes its paper definitions, category definitions, and its template - * database.. It will search both system and user template directories to locate - * this data. - */ -void -lgl_db_init (void) -{ - lglPaper *paper_other; - lglCategory *category_user_defined; - GList *page_sizes; - GList *p; - - /* - * Paper definitions - */ - if (!papers) - { - - papers = read_papers (); - - /* Create and append an "Other" entry. */ - paper_other = lgl_paper_new ("Other", _("Other"), 0.0, 0.0, NULL); - papers = g_list_append (papers, paper_other); - - } - - /* - * Categories - */ - if (!categories) - { - categories = read_categories (); - - /* Create and append a "User defined" entry. */ - category_user_defined = lgl_category_new ("user-defined", _("User defined")); - categories = g_list_append (categories, category_user_defined); - } - - /* - * Templates - */ - if (!templates) - { - - templates = read_templates (); - - /* Create and append generic full page templates. */ - page_sizes = lgl_db_get_paper_id_list (); - for ( p=page_sizes; p != NULL; p=p->next ) - { - if ( !lgl_db_is_paper_id_other (p->data) ) - { - templates = g_list_append (templates, - template_full_page (p->data)); - } - } - lgl_db_free_paper_id_list (page_sizes); - - init_template_cache (); - } -} - - - -/*===========================================*/ -/* Paper db functions. */ -/*===========================================*/ - -/** - * lgl_db_get_paper_id_list: - * - * Get a list of all paper ids known to libglabels. - * - * Returns: a list of paper ids. - * - */ -GList * -lgl_db_get_paper_id_list (void) -{ - GList *ids = NULL; - GList *p; - lglPaper *paper; - - if (!papers) - { - lgl_db_init (); - } - - for ( p=papers; p != NULL; p=p->next ) - { - paper = (lglPaper *)p->data; - ids = g_list_append (ids, g_strdup (paper->id)); - } - - return ids; -} - - -/** - * lgl_db_free_paper_id_list: - * @ids: List of id strings to be freed. - * - * Free up all storage associated with an id list obtained with - * lgl_db_get_paper_id_list(). - * - */ -void -lgl_db_free_paper_id_list (GList *ids) -{ - GList *p; - - for (p = ids; p != NULL; p = p->next) - { - g_free (p->data); - p->data = NULL; - } - - g_list_free (ids); -} - - -/** - * lgl_db_get_paper_name_list: - * - * Get a list of all localized paper names known to libglabels. - * - * Returns: a list of localized paper names. - * - */ -GList * -lgl_db_get_paper_name_list (void) -{ - GList *names = NULL; - GList *p; - lglPaper *paper; - - if (!papers) - { - lgl_db_init (); - } - - for ( p=papers; p != NULL; p=p->next ) - { - paper = (lglPaper *)p->data; - names = g_list_append (names, g_strdup (paper->name)); - } - - return names; -} - - -/** - * lgl_db_free_paper_name_list: - * @names: List of localized paper name strings to be freed. - * - * Free up all storage associated with a name list obtained with - * lgl_db_get_paper_name_list(). - * - */ -void -lgl_db_free_paper_name_list (GList *names) -{ - GList *p; - - for (p = names; p != NULL; p = p->next) - { - g_free (p->data); - p->data = NULL; - } - - g_list_free (names); -} - - -/** - * lgl_db_lookup_paper_from_name: - * @name: localized paper name string - * - * Lookup paper definition from localized paper name string. - * - * Returns: pointer to a newly allocated #lglPaper structure. - * - */ -lglPaper * -lgl_db_lookup_paper_from_name (const gchar *name) -{ - GList *p; - lglPaper *paper; - - if (!papers) - { - lgl_db_init (); - } - - if (name == NULL) - { - /* If no name, return first paper as a default */ - return lgl_paper_dup ((lglPaper *) papers->data); - } - - for (p = papers; p != NULL; p = p->next) - { - paper = (lglPaper *) p->data; - if (UTF8_EQUAL (paper->name, name)) - { - return lgl_paper_dup (paper); - } - } - - return NULL; -} - - -/** - * lgl_db_lookup_paper_from_id: - * @id: paper id string - * - * Lookup paper definition from id string. - * - * Returns: pointer to a newly allocated #lglPaper structure. - * - */ -lglPaper * -lgl_db_lookup_paper_from_id (const gchar *id) -{ - GList *p; - lglPaper *paper; - - if (!papers) - { - lgl_db_init (); - } - - if (id == NULL) - { - /* If no id, return first paper as a default */ - return lgl_paper_dup ((lglPaper *) papers->data); - } - - for (p = papers; p != NULL; p = p->next) - { - paper = (lglPaper *) p->data; - if (ASCII_EQUAL (paper->id, id)) - { - return lgl_paper_dup (paper); - } - } - - return NULL; -} - - -/** - * lgl_db_lookup_paper_id_from_name: - * @name: localized paper name stringp - * - * Lookup paper name string from localized paper name string. - * - * Returns: pointer to a newly allocated id string. - * - */ -gchar * -lgl_db_lookup_paper_id_from_name (const gchar *name) -{ - lglPaper *paper = NULL; - gchar *id = NULL; - - if (name != NULL) - { - paper = lgl_db_lookup_paper_from_name (name); - if ( paper != NULL ) - { - id = g_strdup (paper->id); - lgl_paper_free (paper); - paper = NULL; - } - } - - return id; -} - - -/** - * lgl_db_lookup_paper_name_from_id: - * @id: paper id string - * - * Lookup localized paper name string from paper id string. - * - * Returns: pointer to a newly allocated localized paper name string. - * - */ -gchar * -lgl_db_lookup_paper_name_from_id (const gchar *id) -{ - lglPaper *paper = NULL; - gchar *name = NULL; - - if (id != NULL) - { - paper = lgl_db_lookup_paper_from_id (id); - if ( paper != NULL ) - { - name = g_strdup (paper->name); - lgl_paper_free (paper); - paper = NULL; - } - } - - return name; -} - - -/** - * lgl_db_is_paper_id_known: - * @id: paper id to test - * - * Determine if given paper id is known to libglabels. - * - * Returns: TRUE if id is known, otherwise FALSE. - * - */ -gboolean -lgl_db_is_paper_id_known (const gchar *id) -{ - GList *p; - lglPaper *paper; - - if (!papers) - { - lgl_db_init (); - } - - if (id == NULL) - { - return FALSE; - } - - for (p = papers; p != NULL; p = p->next) - { - paper = (lglPaper *) p->data; - if (ASCII_EQUAL (paper->id, id)) - { - return TRUE; - } - } - - return FALSE; -} - -/** - * lgl_db_is_paper_id_other: - * @id: paper id to test - * - * Determine if given paper id is the special id "Other." - * - * Returns: TRUE if id is "Other", otherwise FALSE. - * - */ -gboolean -lgl_db_is_paper_id_other (const gchar *id) -{ - if (id == NULL) - { - return FALSE; - } - - return (ASCII_EQUAL (id, "Other")); -} - - -static GList * -read_papers (void) -{ - gchar *data_dir; - GList *papers = NULL; - - data_dir = LGL_SYSTEM_DATA_DIR; - papers = read_paper_files_from_dir (papers, data_dir); - g_free (data_dir); - - data_dir = LGL_USER_DATA_DIR; - papers = read_paper_files_from_dir (papers, data_dir); - g_free (data_dir); - - if (papers == NULL) { - g_critical (_("Unable to locate paper size definitions. Libglabels may not be installed correctly!")); - } - - return papers; -} - - -static GList * -read_paper_files_from_dir (GList *papers, - const gchar *dirname) -{ - GDir *dp; - const gchar *filename, *extension; - gchar *full_filename = NULL; - GError *gerror = NULL; - GList *new_papers = NULL; - - if (dirname == NULL) { - return papers; - } - - if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) { - return papers; - } - - dp = g_dir_open (dirname, 0, &gerror); - if (gerror != NULL) { - g_message ("cannot open data directory: %s", gerror->message ); - return papers; - } - - while ((filename = g_dir_read_name (dp)) != NULL) { - - extension = strrchr (filename, '.'); - - if (extension != NULL) { - - if ( ASCII_EQUAL (extension, ".paper") || - ASCII_EQUAL (filename, "paper-sizes.xml") ) - { - - full_filename = - g_build_filename (dirname, filename, NULL); - new_papers = - lgl_xml_paper_read_papers_from_file (full_filename); - g_free (full_filename); - - papers = g_list_concat (papers, new_papers); - new_papers = NULL; - - } - - } - - } - - g_dir_close (dp); - - return papers; -} - - -/** - * lgl_db_print_known_papers: - * - * For debugging purposes: print a list of all paper definitions known to - * libglabels. - * - */ -void -lgl_db_print_known_papers (void) -{ - GList *p; - lglPaper *paper; - - if (!papers) { - lgl_db_init (); - } - - g_print ("%s():\n", __FUNCTION__); - for (p = papers; p != NULL; p = p->next) { - paper = (lglPaper *) p->data; - - g_print ("PAPER id=\"%s\", name=\"%s\", width=%gpts, height=%gpts\n", - paper->id, paper->name, paper->width, paper->height); - - } - g_print ("\n"); - -} - - -/*===========================================*/ -/* Category db functions. */ -/*===========================================*/ - -/** - * lgl_db_get_category_id_list: - * - * Get a list of all category ids known to libglabels. - * - * Returns: a list of category ids. - * - */ -GList * -lgl_db_get_category_id_list (void) -{ - GList *ids = NULL; - GList *p; - lglCategory *category; - - if (!categories) - { - lgl_db_init (); - } - - for ( p=categories; p != NULL; p=p->next ) - { - category = (lglCategory *)p->data; - ids = g_list_append (ids, g_strdup (category->id)); - } - - return ids; -} - - -/** - * lgl_db_free_category_id_list: - * @ids: List of id strings to be freed. - * - * Free up all storage associated with an id list obtained with - * lgl_db_get_category_id_list(). - * - */ -void -lgl_db_free_category_id_list (GList *ids) -{ - GList *p; - - for (p = ids; p != NULL; p = p->next) - { - g_free (p->data); - p->data = NULL; - } - - g_list_free (ids); -} - - -/** - * lgl_db_get_category_name_list: - * - * Get a list of all localized category names known to libglabels. - * - * Returns: a list of localized category names. - * - */ -GList * -lgl_db_get_category_name_list (void) -{ - GList *names = NULL; - GList *p; - lglCategory *category; - - if (!categories) - { - lgl_db_init (); - } - - for ( p=categories; p != NULL; p=p->next ) - { - category = (lglCategory *)p->data; - names = g_list_append (names, g_strdup (category->name)); - } - - return names; -} - - -/** - * lgl_db_free_category_name_list: - * @names: List of localized category name strings to be freed. - * - * Free up all storage associated with a name list obtained with - * lgl_db_get_category_name_list(). - * - */ -void -lgl_db_free_category_name_list (GList *names) -{ - GList *p; - - for (p = names; p != NULL; p = p->next) - { - g_free (p->data); - p->data = NULL; - } - - g_list_free (names); -} - - -/** - * lgl_db_lookup_category_from_name: - * @name: localized category name string - * - * Lookup category definition from localized category name string. - * - * Returns: pointer to a newly allocated #lglCategory structure. - * - */ -lglCategory * -lgl_db_lookup_category_from_name (const gchar *name) -{ - GList *p; - lglCategory *category; - - if (!categories) - { - lgl_db_init (); - } - - if (name == NULL) - { - /* If no name, return first category as a default */ - return lgl_category_dup ((lglCategory *) categories->data); - } - - for (p = categories; p != NULL; p = p->next) - { - category = (lglCategory *) p->data; - if (UTF8_EQUAL (category->name, name)) - { - return lgl_category_dup (category); - } - } - - return NULL; -} - - -/** - * lgl_db_lookup_category_from_id: - * @id: category id string - * - * Lookup category definition from id string. - * - * Returns: pointer to a newly allocated #lglCategory structure. - * - */ -lglCategory * -lgl_db_lookup_category_from_id (const gchar *id) -{ - GList *p; - lglCategory *category; - - if (!categories) - { - lgl_db_init (); - } - - if (id == NULL) - { - /* If no id, return first category as a default */ - return lgl_category_dup ((lglCategory *) categories->data); - } - - for (p = categories; p != NULL; p = p->next) - { - category = (lglCategory *) p->data; - if (ASCII_EQUAL (category->id, id)) - { - return lgl_category_dup (category); - } - } - - return NULL; -} - - -/** - * lgl_db_lookup_category_id_from_name: - * @name: localized category name stringp - * - * Lookup category name string from localized category name string. - * - * Returns: pointer to a newly allocated id string. - * - */ -gchar * -lgl_db_lookup_category_id_from_name (const gchar *name) -{ - lglCategory *category = NULL; - gchar *id = NULL; - - if (name != NULL) - { - category = lgl_db_lookup_category_from_name (name); - if ( category != NULL ) - { - id = g_strdup (category->id); - lgl_category_free (category); - category = NULL; - } - } - - return id; -} - - -/** - * lgl_db_lookup_category_name_from_id: - * @id: category id string - * - * Lookup localized category name string from category id string. - * - * Returns: pointer to a newly allocated localized category name string. - * - */ -gchar * -lgl_db_lookup_category_name_from_id (const gchar *id) -{ - lglCategory *category = NULL; - gchar *name = NULL; - - if (id != NULL) - { - category = lgl_db_lookup_category_from_id (id); - if ( category != NULL ) - { - name = g_strdup (category->name); - lgl_category_free (category); - category = NULL; - } - } - - return name; -} - - -/** - * lgl_db_is_category_id_known: - * @id: category id to test - * - * Determine if given category id is known to libglabels. - * - * Returns: TRUE if id is known, otherwise FALSE. - * - */ -gboolean -lgl_db_is_category_id_known (const gchar *id) -{ - GList *p; - lglCategory *category; - - if (!categories) - { - lgl_db_init (); - } - - if (id == NULL) - { - return FALSE; - } - - for (p = categories; p != NULL; p = p->next) - { - category = (lglCategory *) p->data; - if (ASCII_EQUAL (category->id, id)) - { - return TRUE; - } - } - - return FALSE; -} - - -static GList * -read_categories (void) -{ - gchar *data_dir; - GList *categories = NULL; - - data_dir = LGL_SYSTEM_DATA_DIR; - categories = read_category_files_from_dir (categories, data_dir); - g_free (data_dir); - - data_dir = LGL_USER_DATA_DIR; - categories = read_category_files_from_dir (categories, data_dir); - g_free (data_dir); - - if (categories == NULL) { - g_critical (_("Unable to locate category definitions. Libglabels may not be installed correctly!")); - } - - return categories; -} - - -static GList * -read_category_files_from_dir (GList *categories, - const gchar *dirname) -{ - GDir *dp; - const gchar *filename, *extension; - gchar *full_filename = NULL; - GError *gerror = NULL; - GList *new_categories = NULL; - - if (dirname == NULL) { - return categories; - } - - if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) { - return categories; - } - - dp = g_dir_open (dirname, 0, &gerror); - if (gerror != NULL) { - g_message ("cannot open data directory: %s", gerror->message ); - return categories; - } - - while ((filename = g_dir_read_name (dp)) != NULL) { - - extension = strrchr (filename, '.'); - - if (extension != NULL) { - - if ( ASCII_EQUAL (extension, ".category") || - ASCII_EQUAL (filename, "categories.xml") ) - { - - full_filename = - g_build_filename (dirname, filename, NULL); - new_categories = - lgl_xml_category_read_categories_from_file (full_filename); - g_free (full_filename); - - categories = g_list_concat (categories, new_categories); - new_categories = NULL; - - } - - } - - } - - g_dir_close (dp); - - return categories; -} - - -/** - * lgl_db_print_known_categories: - * - * For debugging purposes: print a list of all category definitions known to - * libglabels. - * - */ -void -lgl_db_print_known_categories (void) -{ - GList *p; - lglCategory *category; - - if (!categories) { - lgl_db_init (); - } - - g_print ("%s():\n", __FUNCTION__); - for (p = categories; p != NULL; p = p->next) { - category = (lglCategory *) p->data; - - g_print ("CATEGORY id=\"%s\", name=\"%s\"\n", category->id, category->name); - - } - g_print ("\n"); - -} - - - -/*===========================================*/ -/* Brand db functions. */ -/*===========================================*/ - -/** - * lgl_db_get_brand_list: - * @paper_id: If non NULL, limit results to given page size. - * @category_id: If non NULL, limit results to given template category. - * - * Get a list of all valid brands of templates in the template database. - * Results can be filtered by page size and/or template category. A list of valid page - * sizes can be obtained using lgl_db_get_paper_id_list(). A list of valid template - * categories can be obtained using lgl_db_get_category_id_list(). - * - * Returns: a list of brands - */ -GList * -lgl_db_get_brand_list (const gchar *paper_id, - const gchar *category_id) -{ - GList *p_tmplt, *p_alias; - lglTemplate *template; - lglTemplateAlias *alias; - GList *brands = NULL; - - if (!templates) - { - lgl_db_init (); - } - - for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) - { - template = (lglTemplate *) p_tmplt->data; - if (lgl_template_does_page_size_match (template, paper_id) && - lgl_template_does_category_match (template, category_id)) - { - for (p_alias = template->aliases; p_alias != NULL; - p_alias = p_alias->next) - { - alias = (lglTemplateAlias *)p_alias->data; - - if ( !g_list_find_custom (brands, alias->brand, - (GCompareFunc)lgl_str_utf8_casecmp) ) - { - brands = g_list_insert_sorted (brands, - g_strdup (alias->brand), - (GCompareFunc)lgl_str_utf8_casecmp); - } - } - } - } - - return brands; -} - - -/** - * lgl_db_free_brand_list: - * @brands: List of template brand strings to be freed. - * - * Free up all storage associated with a list of template names obtained with - * lgl_db_get_brand_list(). - * - */ -void -lgl_db_free_brand_list (GList *brands) -{ - GList *p_brand; - - for (p_brand = brands; p_brand != NULL; p_brand = p_brand->next) - { - g_free (p_brand->data); - p_brand->data = NULL; - } - - g_list_free (brands); -} - - - -/*===========================================*/ -/* Template db functions. */ -/*===========================================*/ - -/** - * lgl_db_register_template: - * @template: Pointer to a template structure to add to database. - * - * Register a template. This function adds a template to the template database. - * The template will be stored in an individual XML file in the user template directory. - * - * Returns: Status of registration attempt (#lglDbRegStatus) - */ -lglDbRegStatus -lgl_db_register_template (const lglTemplate *template) -{ - lglTemplate *template_copy; - gchar *dir, *filename, *abs_filename; - gint bytes_written; - - if (!templates) - { - lgl_db_init (); - } - - if (lgl_db_does_template_exist (template->brand, template->part)) - { - return LGL_DB_REG_BRAND_PART_EXISTS; - } - - if (lgl_db_is_paper_id_known (template->paper_id)) - { - dir = LGL_USER_DATA_DIR; - mkdir (dir, 0775); /* Try to make sure directory exists. */ - filename = g_strdup_printf ("%s_%s.template", template->brand, template->part); - abs_filename = g_build_filename (dir, filename, NULL); - bytes_written = lgl_xml_template_write_template_to_file (template, abs_filename); - g_free (dir); - g_free (filename); - g_free (abs_filename); - - if (bytes_written > 0) - { - template_copy = lgl_template_dup (template); - lgl_template_add_category (template_copy, "user-defined"); - templates = g_list_append (templates, template_copy); - add_to_template_cache (template_copy); - return LGL_DB_REG_OK; - } - else - { - return LGL_DB_REG_FILE_WRITE_ERROR; - } - } - else - { - g_message ("Cannot register new template with unknown page size."); - return LGL_DB_REG_BAD_PAPER_ID; - } - -} - - -/** - * lgl_db_does_template_exist: - * @brand: Brand name. - * @part: Part name/number. - * - * This function tests whether a template with the given brand and part name/number exists. - * - * Returns: TRUE if such a template exists in the database. - */ -gboolean -lgl_db_does_template_exist (const gchar *brand, - const gchar *part) -{ - GList *p_tmplt, *p_alias; - lglTemplate *template; - lglTemplateAlias *alias; - - if (!templates) - { - lgl_db_init (); - } - - if ((brand == NULL) || (part == NULL)) - { - return FALSE; - } - - for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) - { - template = (lglTemplate *) p_tmplt->data; - for (p_alias = template->aliases; p_alias != NULL; p_alias = p_alias->next) - { - alias = (lglTemplateAlias *)p_alias->data; - - if ( UTF8_EQUAL (brand, alias->brand) && - UTF8_EQUAL (part, alias->part) ) - { - return TRUE; - } - } - } - - return FALSE; -} - - -/** - * lgl_db_does_template_name_exist: - * @name: name string - * - * This function test whether a template with the given name exists. - * - * Returns: TRUE if such a template exists in the database. - * - */ -gboolean -lgl_db_does_template_name_exist (const gchar *name) -{ - GList *p_tmplt, *p_alias; - lglTemplate *template; - lglTemplateAlias *alias; - gchar *candidate_name; - - if (!templates) - { - lgl_db_init (); - } - - if (name == NULL) - { - return FALSE; - } - - for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) - { - template = (lglTemplate *) p_tmplt->data; - for (p_alias = template->aliases; p_alias != NULL; p_alias = p_alias->next) - { - alias = (lglTemplateAlias *)p_alias->data; - candidate_name = g_strdup_printf ("%s %s", alias->brand, alias->part); - - if ( UTF8_EQUAL (candidate_name, name) ) { - g_free (candidate_name); - return TRUE; - } - g_free (candidate_name); - } - } - - return FALSE; -} - - -/** - * lgl_db_get_template_name_list_unique: - * @brand: If non NULL, limit results to given brand - * @paper_id: If non NULL, limit results to given page size. - * @category_id: If non NULL, limit results to given template category. - * - * Get a list of valid names of unique templates in the template database. Results - * can be filtered by page size and/or template category. A list of valid page sizes - * can be obtained using lgl_db_get_paper_id_list(). A list of valid template categories - * can be obtained using lgl_db_get_category_id_list(). - * - * This function differs from lgl_db_get_template_name_list_all(), because it does not - * return multiple names for the same template. - * - * Returns: a list of template names. - */ -GList * -lgl_db_get_template_name_list_unique (const gchar *brand, - const gchar *paper_id, - const gchar *category_id) -{ - GList *p_tmplt; - lglTemplate *template; - gchar *name; - GList *names = NULL; - - if (!templates) - { - lgl_db_init (); - } - - for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) - { - template = (lglTemplate *) p_tmplt->data; - - if (lgl_template_does_brand_match (template, brand) && - lgl_template_does_page_size_match (template, paper_id) && - lgl_template_does_category_match (template, category_id)) - { - name = g_strdup_printf ("%s %s", template->brand, template->part); - names = g_list_insert_sorted (names, name, - (GCompareFunc)g_utf8_collate); - } - } - - return names; -} - - -/** - * lgl_db_get_template_name_list_all: - * @brand: If non NULL, limit results to given brand - * @paper_id: If non NULL, limit results to given page size. - * @category_id: If non NULL, limit results to given template category. - * - * Get a list of all valid names and aliases of templates in the template database. - * Results can be filtered by page size and/or template category. A list of valid page - * sizes can be obtained using lgl_db_get_paper_id_list(). A list of valid template - * categories can be obtained using lgl_db_get_category_id_list(). - * - * This function differs from lgl_db_get_template_name_list_unique(), because it will - * return multiple names for the same template. - * - * Returns: a list of template names and aliases. - */ -GList * -lgl_db_get_template_name_list_all (const gchar *brand, - const gchar *paper_id, - const gchar *category_id) -{ - GList *p_tmplt, *p_alias; - lglTemplate *template; - lglTemplateAlias *alias; - gchar *name; - GList *names = NULL; - - if (!templates) - { - lgl_db_init (); - } - - for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) - { - template = (lglTemplate *) p_tmplt->data; - if (lgl_template_does_page_size_match (template, paper_id) && - lgl_template_does_category_match (template, category_id)) - { - for (p_alias = template->aliases; p_alias != NULL; - p_alias = p_alias->next) - { - alias = (lglTemplateAlias *)p_alias->data; - - if ( !brand || UTF8_EQUAL( alias->brand, brand) ) - { - name = g_strdup_printf ("%s %s", alias->brand, alias->part); - names = g_list_insert_sorted (names, name, - (GCompareFunc)g_utf8_collate); - } - } - } - } - - return names; -} - - -/** - * lgl_db_free_template_name_list: - * @names: List of template name strings to be freed. - * - * Free up all storage associated with a list of template names obtained with - * lgl_db_get_template_name_list_all() or lgl_db_get_template_name_list_unique(). - * - */ -void -lgl_db_free_template_name_list (GList *names) -{ - GList *p_name; - - for (p_name = names; p_name != NULL; p_name = p_name->next) - { - g_free (p_name->data); - p_name->data = NULL; - } - - g_list_free (names); -} - - -/** - * lgl_db_lookup_template_from_name: - * @name: name string - * - * Lookup template in template database from name string. - * - * Returns: pointer to a newly allocated #lglTemplate structure. - * - */ -lglTemplate * -lgl_db_lookup_template_from_name (const gchar *name) -{ - GList *p_alias; - lglTemplate *template; - lglTemplateAlias *alias; - gchar *candidate_name; - lglTemplate *new_template; - - if (!templates) - { - lgl_db_init (); - } - - if (name == NULL) - { - /* If no name, return first template as a default */ - return lgl_template_dup ((lglTemplate *) templates->data); - } - - template = g_hash_table_lookup (template_cache, name); - - if (template) - { - for (p_alias = template->aliases; p_alias != NULL; p_alias = p_alias->next) - { - alias = (lglTemplateAlias *)p_alias->data; - candidate_name = g_strdup_printf ("%s %s", alias->brand, alias->part); - - if ( UTF8_EQUAL (candidate_name, name) ) - { - g_free (candidate_name); - new_template = lgl_template_dup (template); - g_free (new_template->brand); - new_template->brand = g_strdup (alias->brand); - g_free (new_template->part); - new_template->part = g_strdup (alias->part); - return new_template; - } - - g_free (candidate_name); - } - } - - /* No matching template has been found so return the first template */ - return lgl_template_dup ((lglTemplate *) templates->data); -} - - -static void -init_template_cache (void) -{ - GList *p_tmplt, *p_alias; - lglTemplate *template; - lglTemplateAlias *alias; - gchar *name; - - template_cache = g_hash_table_new (g_str_hash, g_str_equal); - - for ( p_tmplt=templates; p_tmplt != NULL; p_tmplt=p_tmplt->next ) - { - template = (lglTemplate *) p_tmplt->data; - - for ( p_alias=template->aliases; p_alias != NULL; p_alias=p_alias->next ) - { - alias = (lglTemplateAlias *)p_alias->data; - name = g_strdup_printf ("%s %s", alias->brand, alias->part); - - g_hash_table_insert (template_cache, name, template); - } - } -} - - -static void -add_to_template_cache (lglTemplate *template) -{ - GList *p_alias; - lglTemplateAlias *alias; - gchar *name; - - for ( p_alias=template->aliases; p_alias != NULL; p_alias=p_alias->next ) - { - alias = (lglTemplateAlias *)p_alias->data; - name = g_strdup_printf ("%s %s", alias->brand, alias->part); - - g_hash_table_insert (template_cache, name, template); - } -} - - -static GList * -read_templates (void) -{ - gchar *data_dir; - GList *templates = NULL; - GList *p; - lglTemplate *template; - - /* - * User defined templates. Add to user-defined category. - */ - data_dir = LGL_USER_DATA_DIR; - templates = read_template_files_from_dir (templates, data_dir); - g_free (data_dir); - for ( p=templates; p != NULL; p=p->next ) - { - template = (lglTemplate *)p->data; - lgl_template_add_category (template, "user-defined"); - } - - /* - * System templates. - */ - data_dir = LGL_SYSTEM_DATA_DIR; - templates = read_template_files_from_dir (templates, data_dir); - g_free (data_dir); - - if (templates == NULL) - { - g_critical (_("Unable to locate any template files. Libglabels may not be installed correctly!")); - } - - return templates; -} - - -static GList * -read_template_files_from_dir (GList *templates, - const gchar *dirname) -{ - GDir *dp; - const gchar *filename, *extension, *extension2; - gchar *full_filename = NULL; - GError *gerror = NULL; - GList *new_templates = NULL; - - if (dirname == NULL) - return templates; - - if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) - { - return templates; - } - - dp = g_dir_open (dirname, 0, &gerror); - if (gerror != NULL) - { - g_message ("cannot open data directory: %s", gerror->message ); - return templates; - } - - while ((filename = g_dir_read_name (dp)) != NULL) - { - - extension = strrchr (filename, '.'); - extension2 = strrchr (filename, '-'); - - if ( (extension && ASCII_EQUAL (extension, ".template")) || - (extension2 && ASCII_EQUAL (extension2, "-templates.xml")) ) - { - - full_filename = g_build_filename (dirname, filename, NULL); - new_templates = - lgl_xml_template_read_templates_from_file (full_filename); - g_free (full_filename); - - templates = g_list_concat (templates, new_templates); - new_templates = NULL; - } - - } - - g_dir_close (dp); - - return templates; -} - - -static lglTemplate * -template_full_page (const gchar *paper_id) -{ - lglPaper *paper = NULL; - lglTemplate *template = NULL; - lglTemplateFrame *frame = NULL; - gchar *part; - gchar *desc; - - g_return_val_if_fail (paper_id, NULL); - - paper = lgl_db_lookup_paper_from_id (paper_id); - if ( paper == NULL ) - { - return NULL; - } - - part = g_strdup_printf ("%s-Full-Page", paper->id); - desc = g_strdup_printf (_("Generic %s full page template"), paper->name); - - template = lgl_template_new ("Generic", part, desc, - paper_id, paper->width, paper->height); - - - frame = lgl_template_frame_rect_new ("0", - paper->width, - paper->height, - 0.0, - 0.0, - 0.0); - lgl_template_add_frame (template, frame); - - lgl_template_frame_add_layout (frame, lgl_template_layout_new (1, 1, 0., 0., 0., 0.)); - - lgl_template_frame_add_markup (frame, lgl_template_markup_margin_new (9.0)); - - g_free (desc); - desc = NULL; - lgl_paper_free (paper); - paper = NULL; - - return template; -} - - -/** - * lgl_db_print_known_templates: - * - * Print all known templates (for debugging purposes). - * - */ -void -lgl_db_print_known_templates (void) -{ - GList *p; - lglTemplate *template; - - g_print ("%s():\n", __FUNCTION__); - for (p=templates; p!=NULL; p=p->next) - { - template = (lglTemplate *)p->data; - - g_print("TEMPLATE brand=\"%s\", part=\"%s\", description=\"%s\"\n", - template->brand, template->part, template->description); - - } - g_print ("\n"); - -} - -/** - * lgl_db_print_aliases: - * @template: template - * - * Print all aliases of a template (for debugging purposes). - * - */ -void -lgl_db_print_aliases (const lglTemplate *template) -{ - GList *p; - lglTemplateAlias *alias; - - g_print ("%s():\n", __FUNCTION__); - for (p=template->aliases; p!=NULL; p=p->next) - { - alias = (lglTemplateAlias *)p->data; - - g_print("Alias: brand=\"%s\", part=\"%s\"\n", alias->brand, alias->part); - - } - g_print ("\n"); - -} - - diff --git a/glabels2/libglabels/db.h b/glabels2/libglabels/db.h deleted file mode 100644 index c6b6f7ef..00000000 --- a/glabels2/libglabels/db.h +++ /dev/null @@ -1,148 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (LIBGLABELS) Template library for GLABELS - * - * db.h: template db module header file - * - * Copyright (C) 2006-2007 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __DB_H__ -#define __DB_H__ - -#include -#include - -#include "paper.h" -#include "category.h" -#include "template.h" - -G_BEGIN_DECLS - -typedef enum -{ - LGL_DB_REG_OK = 0, - LGL_DB_REG_BAD_PAPER_ID = -1, - LGL_DB_REG_BRAND_PART_EXISTS = -2, - LGL_DB_REG_FILE_WRITE_ERROR = -3 -} lglDbRegStatus; - -/* - * Module initialization - */ -void lgl_db_init (void); - - -/* - * Paper - */ -GList *lgl_db_get_paper_id_list (void); - -void lgl_db_free_paper_id_list (GList *ids); - -GList *lgl_db_get_paper_name_list (void); - -void lgl_db_free_paper_name_list (GList *names); - -lglPaper *lgl_db_lookup_paper_from_name (const gchar *name); - -lglPaper *lgl_db_lookup_paper_from_id (const gchar *id); - -gchar *lgl_db_lookup_paper_id_from_name (const gchar *name); - -gchar *lgl_db_lookup_paper_name_from_id (const gchar *id); - -gboolean lgl_db_is_paper_id_known (const gchar *id); - -gboolean lgl_db_is_paper_id_other (const gchar *id); - - - -/* - * Template categories - */ -GList *lgl_db_get_category_id_list (void); - -void lgl_db_free_category_id_list (GList *ids); - -GList *lgl_db_get_category_name_list (void); - -void lgl_db_free_category_name_list (GList *names); - -lglCategory *lgl_db_lookup_category_from_name (const gchar *name); - -lglCategory *lgl_db_lookup_category_from_id (const gchar *id); - -gchar *lgl_db_lookup_category_id_from_name (const gchar *name); - -gchar *lgl_db_lookup_category_name_from_id (const gchar *id); - -gboolean lgl_db_is_category_id_known (const gchar *id); - - -/* - * Template brands - */ -GList *lgl_db_get_brand_list (const gchar *paper_id, - const gchar *category_id); - -void lgl_db_free_brand_list (GList *brands); - - -/* - * Templates - */ -lglDbRegStatus lgl_db_register_template (const lglTemplate *template); - -gboolean lgl_db_does_template_exist (const gchar *brand, - const gchar *part); - -gboolean lgl_db_does_template_name_exist (const gchar *name); - -GList *lgl_db_get_template_name_list_unique (const gchar *brand, - const gchar *paper_id, - const gchar *category_id); - -GList *lgl_db_get_template_name_list_all (const gchar *brand, - const gchar *paper_id, - const gchar *category_id); - -void lgl_db_free_template_name_list (GList *names); - -lglTemplate *lgl_db_lookup_template_from_name (const gchar *name); - - -/* - * Debugging functions - */ -void lgl_db_print_known_papers (void); - -void lgl_db_print_known_categories (void); - -void lgl_db_print_known_templates (void); - -void lgl_db_print_aliases (const lglTemplate *template); - - - -G_END_DECLS - -#endif diff --git a/glabels2/libglabels/enums.h b/glabels2/libglabels/enums.h deleted file mode 100644 index d139dc25..00000000 --- a/glabels2/libglabels/enums.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * enums.h: common libGLabels enumerations header file - * - * Copyright (C) 2003, 2004 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __ENUMS_H__ -#define __ENUMS_H__ - -#include - -G_BEGIN_DECLS - -/* Units of distance */ -typedef enum { - LGL_UNITS_POINT, /* encoded as "pt" */ - LGL_UNITS_INCH, /* encoded as "in" */ - LGL_UNITS_MM, /* encoded as "mm" */ - LGL_UNITS_CM, /* encoded as "cm" */ - LGL_UNITS_PICA, /* encoded as "pc" */ - - LGL_UNITS_FIRST = LGL_UNITS_POINT, - LGL_UNITS_LAST = LGL_UNITS_PICA, -} lglUnitsType; - - -G_END_DECLS - - -#endif /* __ENUMS_H__ */ diff --git a/glabels2/libglabels/libglabels-private.h b/glabels2/libglabels/libglabels-private.h deleted file mode 100644 index dd8bda83..00000000 --- a/glabels2/libglabels/libglabels-private.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * libglabels-private.h: libglabels private header file - * - * Copyright (C) 2004 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __LIBGLABELS_PRIVATE_H__ -#define __LIBGLABELS_PRIVATE_H__ - -#include -#include -#include - -#include "str.h" - -/* Data system and user data directories. (must free w/ g_free()) */ -#define LGL_SYSTEM_DATA_DIR g_build_filename (LIBGLABELS_TEMPLATE_DIR, NULL) -#define LGL_USER_DATA_DIR g_build_filename (g_get_home_dir (), ".glabels", NULL) - -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN "LibGlabels" - -#define UTF8_EQUAL(s1,s2) (!lgl_str_utf8_casecmp (s1, s2)) -#define ASCII_EQUAL(s1,s2) (!g_ascii_strcasecmp (s1, s2)) - - -#endif /* __LIBGLABELS_PRIVATE_H__ */ diff --git a/glabels2/libglabels/libglabels.h b/glabels2/libglabels/libglabels.h deleted file mode 100644 index c74fbe01..00000000 --- a/glabels2/libglabels/libglabels.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * libglabels.h: libglabels master header file - * - * Copyright (C) 2004 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __LIBGLABELS_H__ -#define __LIBGLABELS_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif /* __LIBGLABELS_H__ */ diff --git a/glabels2/libglabels/libglabels.pc.in b/glabels2/libglabels/libglabels.pc.in deleted file mode 100644 index c16e8f47..00000000 --- a/glabels2/libglabels/libglabels.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libglabels -Description: GLabels Template Library -Requires: glib-2.0 libxml-2.0 -Version: @VERSION@ -Libs: -L${libdir} -lglabels -Cflags: -I${includedir} - diff --git a/glabels2/libglabels/paper.c b/glabels2/libglabels/paper.c deleted file mode 100644 index 98826c9b..00000000 --- a/glabels2/libglabels/paper.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * paper.c: paper module - * - * Copyright (C) 2003, 2004 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ -#include - -#include "paper.h" - -#include -#include -#include -#include -#include - -#include "libglabels-private.h" - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - - -/*===========================================*/ -/* Functions. */ -/*===========================================*/ - -/** - * lgl_paper_new: - * @id: Id of paper definition. (E.g. US-Letter, A4, etc.) Should be - * unique. - * @name: Localized name of paper. - * @width: Width of paper in points. - * @height: Height of paper in points. - * @pwg_size: PWG 5101.1-2002 size name. - * - * Allocates and constructs a new #lglPaper structure. - * - * Returns: a pointer to a newly allocated #lglPaper structure. - * - */ -lglPaper * -lgl_paper_new (gchar *id, - gchar *name, - gdouble width, - gdouble height, - gchar *pwg_size) -{ - lglPaper *paper; - - paper = g_new0 (lglPaper,1); - - paper->id = g_strdup (id); - paper->name = g_strdup (name); - paper->width = width; - paper->height = height; - paper->pwg_size = g_strdup (pwg_size); - - return paper; -} - - -/** - * lgl_paper_dup: - * @orig: #lglPaper structure to be duplicated. - * - * Duplicates an existing #lglPaper structure. - * - * Returns: a pointer to a newly allocated #lglPaper structure. - * - */ -lglPaper *lgl_paper_dup (const lglPaper *orig) -{ - lglPaper *paper; - - g_return_val_if_fail (orig, NULL); - - paper = g_new0 (lglPaper,1); - - paper->id = g_strdup (orig->id); - paper->name = g_strdup (orig->name); - paper->width = orig->width; - paper->height = orig->height; - paper->pwg_size = g_strdup (orig->pwg_size); - - return paper; -} - - -/** - * lgl_paper_free: - * @paper: pointer to #lglPaper structure to be freed. - * - * Free all memory associated with an existing #lglPaper structure. - * - */ -void lgl_paper_free (lglPaper *paper) -{ - - if ( paper != NULL ) { - - g_free (paper->id); - paper->id = NULL; - - g_free (paper->name); - paper->name = NULL; - - g_free (paper->pwg_size); - paper->pwg_size = NULL; - - g_free (paper); - } - -} - - diff --git a/glabels2/libglabels/paper.h b/glabels2/libglabels/paper.h deleted file mode 100644 index 0fb42388..00000000 --- a/glabels2/libglabels/paper.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * paper.h: paper module header file - * - * Copyright (C) 2003, 2004 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __PAPER_H__ -#define __PAPER_H__ - -#include -#include - -G_BEGIN_DECLS - - -/* - * lglPaper structure - */ -typedef struct _lglPaper lglPaper; - -struct _lglPaper { - gchar *id; /* Unique ID of paper definition */ - gchar *name; /* Localized name of paper */ - gdouble width; /* Width (in points) */ - gdouble height; /* Height (in points) */ - gchar *pwg_size; /* PWG 5101.1-2002 size name */ -}; - - -/* - * Paper construction - */ -lglPaper *lgl_paper_new (gchar *id, - gchar *name, - gdouble width, - gdouble height, - gchar *pwg_size); - -lglPaper *lgl_paper_dup (const lglPaper *orig); - -void lgl_paper_free (lglPaper *paper); - - -G_END_DECLS - -#endif diff --git a/glabels2/libglabels/str.c b/glabels2/libglabels/str.c deleted file mode 100644 index 7c1f59a6..00000000 --- a/glabels2/libglabels/str.c +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (LIBGLABELS) Template library for GLABELS - * - * str.c: libGLabels string utilities - * - * Copyright (C) 2007 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ -#include - -#include "str.h" - - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - - -/*===========================================*/ -/* Functions. */ -/*===========================================*/ - -/** - * lgl_str_utf8_casecmp: - * @s1: string to compare with s2. - * @s2: string to compare with s1. - * - * Compare two UTF-8 strings, ignoring the case of characters. - * - * This function should be used only on strings that are known to be encoded - * in UTF-8 or a compatible UTF-8 subset. - * - * Returns: 0 if the strings match, a negative value if s1 < s2, - * or a positive value if s1 > s2. - * - */ -gint -lgl_str_utf8_casecmp (const gchar *s1, - const gchar *s2) -{ - gchar *folded_s1; - gchar *folded_s2; - gint result; - - folded_s1 = g_utf8_casefold (s1, -1); - folded_s2 = g_utf8_casefold (s2, -1); - - result = g_utf8_collate (folded_s1, folded_s2); - - g_free (folded_s1); - g_free (folded_s2); - - return result; -} - - diff --git a/glabels2/libglabels/str.h b/glabels2/libglabels/str.h deleted file mode 100644 index bc6312f7..00000000 --- a/glabels2/libglabels/str.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (LIBGLABELS) Template library for GLABELS - * - * str.h: libGLabels string utilities header file - * - * Copyright (C) 2007 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __STR_H__ -#define __STR_H__ - -#include - -G_BEGIN_DECLS - -gint lgl_str_utf8_casecmp (const gchar *s1, - const gchar *s2); - -G_END_DECLS - - -#endif /* __STR_H__ */ diff --git a/glabels2/libglabels/template.c b/glabels2/libglabels/template.c deleted file mode 100644 index f6d6d212..00000000 --- a/glabels2/libglabels/template.c +++ /dev/null @@ -1,1121 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (LIBGLABELS) Template library for GLABELS - * - * template.c: template module - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ -#include - -#include "template.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "libglabels-private.h" - -#include "paper.h" - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static gint compare_origins (gconstpointer a, - gconstpointer b, - gpointer user_data); - -/*===========================================*/ -/* Functions. */ -/*===========================================*/ - -/** - * lgl_template_new: - * @brand: Template brand - * @part: Template part name/number - * @description: Template descriptions - * @paper_id: Page size id - * @page_width: Page width in points, set to zero unless paper_id="Other" - * @page_height: Page height in points, set to zero unless paper_id="Other" - * - * Create a new template structure, with the given top-level attributes. The - * created template will have no initial aliases, categories, or frames - * associated with it. See lgl_template_add_alias(), lgl_template_add_category(), - * and lgl_template_add_frame() to add these. - * - * Returns: pointer to a newly allocated #lglTemplate structure. - * - */ -lglTemplate * -lgl_template_new (const gchar *brand, - const gchar *part, - const gchar *description, - const gchar *paper_id, - gdouble page_width, - gdouble page_height) -{ - lglTemplate *template; - lglTemplateAlias *alias; - - template = g_new0 (lglTemplate,1); - - template->brand = g_strdup (brand); - template->part = g_strdup (part); - template->description = g_strdup (description); - template->paper_id = g_strdup (paper_id); - template->page_width = page_width; - template->page_height = page_height; - - /* Always include primary name in alias list. */ - template->aliases = NULL; - alias = lgl_template_alias_new (brand, part); - lgl_template_add_alias (template, alias); - - return template; -} - - -/** - * lgl_template_get_name: - * @template: Pointer to template structure to test - * - * This function returns the name of the given template. The name is the concetenation - * of the brand and part name/number. - * - * Returns: A pointer to a newly allocated name string. Should be freed with g_free(). - * - */ -gchar * -lgl_template_get_name (const lglTemplate *template) -{ - g_return_val_if_fail (template, NULL); - - return g_strdup_printf ("%s %s", template->brand, template->part); -} - - -/** - * lgl_template_do_templates_match: - * @template1: Pointer to 1st template structure to test - * @template2: Pointer to 2nd template structure to test - * - * This function tests if the given templates match. This is a simple test that only tests - * the brand and part name/number. It does not test if they are actually identical. - * - * Returns: TRUE if the two template matche. - * - */ -gboolean -lgl_template_do_templates_match (const lglTemplate *template1, - const lglTemplate *template2) -{ - g_return_val_if_fail (template1, FALSE); - g_return_val_if_fail (template2, FALSE); - - return (UTF8_EQUAL (template1->brand, template2->brand) && - UTF8_EQUAL (template1->part, template2->part)); -} - - -/** - * lgl_template_does_brand_match: - * @template: Pointer to template structure to test - * @brand: Brand string - * - * This function tests if the brand of the template matches the given brand. - * - * Returns: TRUE if the template matches the given brand. - * - */ -gboolean -lgl_template_does_brand_match (const lglTemplate *template, - const gchar *brand) -{ - g_return_val_if_fail (template, FALSE); - - /* NULL matches everything. */ - if (brand == NULL) - { - return TRUE; - } - - return UTF8_EQUAL (template->brand, brand); -} - - -/** - * lgl_template_does_page_size_match: - * @template: Pointer to template structure to test - * @paper_id: Page size ID string - * - * This function tests if the page size of the template matches the given ID. - * - * Returns: TRUE if the template matches the given page size ID. - * - */ -gboolean -lgl_template_does_page_size_match (const lglTemplate *template, - const gchar *paper_id) -{ - g_return_val_if_fail (template, FALSE); - - /* NULL matches everything. */ - if (paper_id == NULL) - { - return TRUE; - } - - return ASCII_EQUAL(paper_id, template->paper_id); -} - - -/** - * lgl_template_does_category_match: - * @template: Pointer to template structure to test - * @category_id: Category ID string - * - * This function tests if the given template belongs to the given category ID. - * - * Returns: TRUE if the template matches the given category ID. - * - */ -gboolean -lgl_template_does_category_match (const lglTemplate *template, - const gchar *category_id) -{ - GList *p; - - g_return_val_if_fail (template, FALSE); - - /* NULL matches everything. */ - if (category_id == NULL) - { - return TRUE; - } - - for ( p=template->category_ids; p != NULL; p=p->next ) - { - if (ASCII_EQUAL(category_id, p->data)) - { - return TRUE; - } - } - - return FALSE; -} - - -/** - * lgl_template_alias_new: - * @brand: Alias brand - * @part: Alias part name/number - * - * Create a new template alias structure, with the given brand and part number. - * - * Returns: pointer to a newly allocated #lglTemplateAlias structure. - * - */ -lglTemplateAlias * -lgl_template_alias_new (const gchar *brand, - const gchar *part) -{ - lglTemplateAlias *alias; - - alias = g_new0 (lglTemplateAlias,1); - - alias->brand = g_strdup (brand); - alias->part = g_strdup (part); - - return alias; -} - - -/** - * lgl_template_add_alias: - * @template: Pointer to template structure - * @alias: Alias string - * - * This function adds the given alias to a templates list of aliases. - * - */ -void -lgl_template_add_alias (lglTemplate *template, - lglTemplateAlias *alias) -{ - g_return_if_fail (template); - g_return_if_fail (alias); - - template->aliases = g_list_append (template->aliases, alias); -} - - -/** - * lgl_template_add_frame: - * @template: Pointer to template structure - * @frame: Pointer to frame structure - * - * This function adds the given frame structure to the template. Once added, - * the frame structure belongs to the given template; do not attempt to free - * it. - * - * Note: Currently glabels only supports a single frame per template. - * - */ -void -lgl_template_add_frame (lglTemplate *template, - lglTemplateFrame *frame) -{ - g_return_if_fail (template); - g_return_if_fail (frame); - - template->frames = g_list_append (template->frames, frame); -} - - -/** - * lgl_template_add_category: - * @template: Pointer to template structure - * @category_id: Category ID string - * - * This function adds the given category ID to a templates category list. - * - */ -void -lgl_template_add_category (lglTemplate *template, - const gchar *category_id) -{ - g_return_if_fail (template); - g_return_if_fail (category_id); - - template->category_ids = g_list_append (template->category_ids, - g_strdup (category_id)); -} - - -/** - * lgl_template_frame_rect_new: - * @id: ID of frame. (This should currently always be "0"). - * @w: width of frame in points. - * @h: height of frame in points. - * @r: radius of rounded corners in points. (Should be 0 for square corners.) - * @x_waste: Amount of overprint to allow in the horizontal direction. - * @y_waste: Amount of overprint to allow in the vertical direction. - * - * This function creates a new template frame for a rectangular label or card. - * - * Returns: Pointer to newly allocated #lglTemplateFrame structure. - * - */ -lglTemplateFrame * -lgl_template_frame_rect_new (const gchar *id, - gdouble w, - gdouble h, - gdouble r, - gdouble x_waste, - gdouble y_waste) -{ - lglTemplateFrame *frame; - - frame = g_new0 (lglTemplateFrame, 1); - - frame->shape = LGL_TEMPLATE_FRAME_SHAPE_RECT; - frame->rect.id = g_strdup (id); - - frame->rect.w = w; - frame->rect.h = h; - frame->rect.r = r; - frame->rect.x_waste = x_waste; - frame->rect.y_waste = y_waste; - - return frame; -} - - -/** - * lgl_template_frame_round_new: - * @id: ID of frame. (This should currently always be "0"). - * @r: radius of label in points. - * @waste: Amount of overprint to allow. - * - * This function creates a new template frame for a round label. - * - * Returns: Pointer to newly allocated #lglTemplateFrame structure. - * - */ -lglTemplateFrame * -lgl_template_frame_round_new (const gchar *id, - gdouble r, - gdouble waste) -{ - lglTemplateFrame *frame; - - frame = g_new0 (lglTemplateFrame, 1); - - frame->shape = LGL_TEMPLATE_FRAME_SHAPE_ROUND; - frame->round.id = g_strdup (id); - - frame->round.r = r; - frame->round.waste = waste; - - return frame; -} - - -/** - * lgl_template_frame_cd_new: - * @id: ID of frame. (This should currently always be "0"). - * @r1: outer radius of label in points. - * @r2: radius of center hole in points. - * @w: clip width of frame in points for business card CDs. Should be 0 for no clipping. - * @h: clip height of frame in points for business card CDs. Should be 0 for no clipping. - * @waste: Amount of overprint to allow. - * - * This function creates a new template frame for a CD/DVD label. - * - * Returns: Pointer to newly allocated #lglTemplateFrame structure. - * - */ -lglTemplateFrame * -lgl_template_frame_cd_new (const gchar *id, - gdouble r1, - gdouble r2, - gdouble w, - gdouble h, - gdouble waste) -{ - lglTemplateFrame *frame; - - frame = g_new0 (lglTemplateFrame, 1); - - frame->shape = LGL_TEMPLATE_FRAME_SHAPE_CD; - frame->cd.id = g_strdup (id); - - frame->cd.r1 = r1; - frame->cd.r2 = r2; - frame->cd.w = w; - frame->cd.h = h; - frame->cd.waste = waste; - - return frame; -} - - -/** - * lgl_template_frame_get_size: - * @frame: #lglTemplateFrame structure to query - * @w: pointer to location to receive width of frame - * @h: pointer to location to receive height of frame - * - * Get size (width and height) of given #lglTemplateFrame in points. - * - */ -void -lgl_template_frame_get_size (const lglTemplateFrame *frame, - gdouble *w, - gdouble *h) -{ - g_return_if_fail (frame); - - switch (frame->shape) { - case LGL_TEMPLATE_FRAME_SHAPE_RECT: - *w = frame->rect.w; - *h = frame->rect.h; - break; - case LGL_TEMPLATE_FRAME_SHAPE_ROUND: - *w = 2.0 * frame->round.r; - *h = 2.0 * frame->round.r; - break; - case LGL_TEMPLATE_FRAME_SHAPE_CD: - if (frame->cd.w == 0.0) { - *w = 2.0 * frame->cd.r1; - } else { - *w = frame->cd.w; - } - if (frame->cd.h == 0.0) { - *h = 2.0 * frame->cd.r1; - } else { - *h = frame->cd.h; - } - break; - default: - *w = 0.0; - *h = 0.0; - break; - } -} - - -/** - * lgl_template_frame_get_n_labels: - * @frame: #lglTemplateFrame structure to query - * - * Get total number of labels per sheet corresponding to the given frame. - * - * Returns: number of labels per sheet. - * - */ -gint -lgl_template_frame_get_n_labels (const lglTemplateFrame *frame) -{ - gint n_labels = 0; - GList *p; - lglTemplateLayout *layout; - - g_return_val_if_fail (frame, 0); - - for ( p=frame->all.layouts; p != NULL; p=p->next ) { - layout = (lglTemplateLayout *)p->data; - - n_labels += layout->nx * layout->ny; - } - - return n_labels; -} - - -/** - * lgl_template_frame_get_origins: - * @frame: #lglTemplateFrame structure to query - * - * Get an array of label origins for the given frame. These origins represent the - * upper left hand corner of each label on a page corresponding to the given frame. - * The origins will be ordered geometrically left to right and then top to bottom. - * The array should be freed using g_free(). - * - * Returns: A newly allocated array of #lglTemplateOrigin structures. - * - */ -lglTemplateOrigin * -lgl_template_frame_get_origins (const lglTemplateFrame *frame) -{ - gint i_label, n_labels, ix, iy; - lglTemplateOrigin *origins; - GList *p; - lglTemplateLayout *layout; - - g_return_val_if_fail (frame, NULL); - - n_labels = lgl_template_frame_get_n_labels (frame); - origins = g_new0 (lglTemplateOrigin, n_labels); - - i_label = 0; - for ( p=frame->all.layouts; p != NULL; p=p->next ) { - layout = (lglTemplateLayout *)p->data; - - for (iy = 0; iy < layout->ny; iy++) { - for (ix = 0; ix < layout->nx; ix++, i_label++) { - origins[i_label].x = ix*layout->dx + layout->x0; - origins[i_label].y = iy*layout->dy + layout->y0; - } - } - } - - g_qsort_with_data (origins, n_labels, sizeof(lglTemplateOrigin), - compare_origins, NULL); - - return origins; -} - - -/** - * lgl_template_frame_add_layout: - * @frame: Pointer to template frame to add layout to. - * @layout: Pointer to layout structure to add to frame. - * - * This function adds a layout structure to the given template frame. - * - */ -void -lgl_template_frame_add_layout (lglTemplateFrame *frame, - lglTemplateLayout *layout) -{ - g_return_if_fail (frame); - g_return_if_fail (layout); - - frame->all.layouts = g_list_append (frame->all.layouts, layout); -} - - -/** - * lgl_template_frame_add_markup: - * @frame: Pointer to template frame to add markup to. - * @markup: Pointer to markup structure to add to frame. - * - * This function adds a markup structure to the given template frame. - * - */ -void -lgl_template_frame_add_markup (lglTemplateFrame *frame, - lglTemplateMarkup *markup) -{ - g_return_if_fail (frame); - g_return_if_fail (markup); - - frame->all.markups = g_list_append (frame->all.markups, markup); -} - - -/** - * lgl_template_layout_new: - * @nx: Number of labels across. - * @ny: Number of labels down. - * @x0: X coordinate of the top-left corner of the top-left label in the layout in points. - * @y0: Y coordinate of the top-left corner of the top-left label in the layout in points. - * @dx: Horizontal pitch in points. This is the distance from left-edge to left-edge. - * @dy: Vertical pitch in points. This is the distance from top-edge to top-edge. - * - * This function creates a new layout structure with the given parameters. - * - * Returns: a newly allocated #lglTemplateLayout structure. - * - */ -lglTemplateLayout * -lgl_template_layout_new (gint nx, - gint ny, - gdouble x0, - gdouble y0, - gdouble dx, - gdouble dy) -{ - lglTemplateLayout *layout; - - layout = g_new0 (lglTemplateLayout, 1); - - layout->nx = nx; - layout->ny = ny; - layout->x0 = x0; - layout->y0 = y0; - layout->dx = dx; - layout->dy = dy; - - return layout; -} - - -/** - * lgl_template_markup_margin_new: - * @size: margin size in points. - * - * This function creates a new margin markup structure. - * - * Returns: a newly allocated #lglTemplateMarkup structure. - * - */ -lglTemplateMarkup * -lgl_template_markup_margin_new (gdouble size) -{ - lglTemplateMarkup *markup; - - markup = g_new0 (lglTemplateMarkup, 1); - - markup->type = LGL_TEMPLATE_MARKUP_MARGIN; - markup->margin.size = size; - - return markup; -} - - -/** - * lgl_template_markup_line_new: - * @x1: x coordinate of first endpoint. - * @y1: y coordinate of first endpoint. - * @x2: x coordinate of second endpoint. - * @y2: y coordinate of second endpoint. - * - * This function creates a new line markup structure. - * - * Returns: a newly allocated #lglTemplateMarkup structure. - * - */ -lglTemplateMarkup * -lgl_template_markup_line_new (gdouble x1, - gdouble y1, - gdouble x2, - gdouble y2) -{ - lglTemplateMarkup *markup; - - markup = g_new0 (lglTemplateMarkup, 1); - - markup->type = LGL_TEMPLATE_MARKUP_LINE; - markup->line.x1 = x1; - markup->line.y1 = y1; - markup->line.x2 = x2; - markup->line.y2 = y2; - - return markup; -} - - -/** - * lgl_template_markup_circle_new: - * @x0: x coordinate of center of circle. - * @y0: y coordinate of center of circle. - * @r: radius of circle. - * - * This function creates a new circle markup structure. - * - * Returns: a newly allocated #lglTemplateMarkup structure. - * - */ -lglTemplateMarkup * -lgl_template_markup_circle_new (gdouble x0, - gdouble y0, - gdouble r) -{ - lglTemplateMarkup *markup; - - markup = g_new0 (lglTemplateMarkup, 1); - - markup->type = LGL_TEMPLATE_MARKUP_CIRCLE; - markup->circle.x0 = x0; - markup->circle.y0 = y0; - markup->circle.r = r; - - return markup; -} - - -/** - * lgl_template_markup_rect_new: - * @x1: x coordinate of top-left corner of rectangle. - * @y1: y coordinate of top-left corner of rectangle. - * @w: width of rectangle. - * @h: height of rectangle. - * @r: radius of rounded corner. - * - * This function creates a new rectangle markup structure. - * - * Returns: a newly allocated #lglTemplateMarkup structure. - * - */ -lglTemplateMarkup * -lgl_template_markup_rect_new (gdouble x1, - gdouble y1, - gdouble w, - gdouble h, - gdouble r) -{ - lglTemplateMarkup *markup; - - markup = g_new0 (lglTemplateMarkup, 1); - - markup->type = LGL_TEMPLATE_MARKUP_RECT; - markup->rect.x1 = x1; - markup->rect.y1 = y1; - markup->rect.w = w; - markup->rect.h = h; - markup->rect.r = r; - - return markup; -} - - -/** - * lgl_template_dup: - * @orig_template: Template to duplicate. - * - * This function duplicates a template structure. - * - * Returns: a newly allocated #lglTemplate structure. - * - */ -lglTemplate * -lgl_template_dup (const lglTemplate *orig_template) -{ - lglTemplate *template; - lglTemplateAlias *alias; - GList *p; - lglTemplateFrame *frame; - - g_return_val_if_fail (orig_template, NULL); - - template = lgl_template_new (orig_template->brand, - orig_template->part, - orig_template->description, - orig_template->paper_id, - orig_template->page_width, - orig_template->page_height); - - for ( p=orig_template->aliases; p != NULL; p=p->next ) - { - alias = (lglTemplateAlias *)p->data; - - if ( !(UTF8_EQUAL (template->brand, alias->brand) && - UTF8_EQUAL (template->part, alias->part)) ) - { - lgl_template_add_alias (template, lgl_template_alias_dup (alias)); - } - - } - - for ( p=orig_template->category_ids; p != NULL; p=p->next ) - { - lgl_template_add_category (template, p->data); - } - - for ( p=orig_template->frames; p != NULL; p=p->next ) - { - frame = (lglTemplateFrame *)p->data; - - lgl_template_add_frame (template, lgl_template_frame_dup (frame)); - } - - return template; -} - - -/** - * lgl_template_free: - * @template: Template to free. - * - * This function frees all memory associated with given template structure. - * - */ -void -lgl_template_free (lglTemplate *template) -{ - GList *p; - lglTemplateFrame *frame; - - if ( template != NULL ) { - - g_free (template->brand); - template->brand = NULL; - - g_free (template->part); - template->part = NULL; - - g_free (template->description); - template->description = NULL; - - g_free (template->paper_id); - template->paper_id = NULL; - - for ( p=template->aliases; p != NULL; p=p->next ) { - - lgl_template_alias_free (p->data); - p->data = NULL; - - } - g_list_free (template->aliases); - template->aliases = NULL; - - for ( p=template->category_ids; p != NULL; p=p->next ) { - - g_free (p->data); - p->data = NULL; - - } - g_list_free (template->category_ids); - template->category_ids = NULL; - - for ( p=template->frames; p != NULL; p=p->next ) { - - frame = (lglTemplateFrame *)p->data; - - lgl_template_frame_free (frame); - p->data = NULL; - } - g_list_free (template->frames); - template->frames = NULL; - - g_free (template); - - } - -} - - -/** - * lgl_template_alias_dup: - * @orig_alias: Alias to duplicate. - * - * This function duplicates a template alias structure. - * - * Returns: a newly allocated #lglTemplateAlias structure. - * - */ -lglTemplateAlias * -lgl_template_alias_dup (const lglTemplateAlias *orig_alias) -{ - g_return_val_if_fail (orig_alias, NULL); - - return lgl_template_alias_new (orig_alias->brand, orig_alias->part); -} - - -/** - * lgl_template_alias_free: - * @alias: Alias to free. - * - * This function frees all memory associated with given template alias structure. - * - */ -void -lgl_template_alias_free (lglTemplateAlias *alias) -{ - - if ( alias != NULL ) - { - g_free (alias->brand); - alias->brand = NULL; - - g_free (alias->part); - alias->part = NULL; - - g_free (alias); - } -} - - -/** - * lgl_template_frame_dup: - * @orig_frame: Frame to duplicate. - * - * This function duplicates a template frame structure. - * - * Returns: a newly allocated #lglTemplateFrame structure. - * - */ -lglTemplateFrame * -lgl_template_frame_dup (const lglTemplateFrame *orig_frame) -{ - lglTemplateFrame *frame; - GList *p; - lglTemplateLayout *layout; - lglTemplateMarkup *markup; - - g_return_val_if_fail (orig_frame, NULL); - - switch (orig_frame->shape) { - - case LGL_TEMPLATE_FRAME_SHAPE_RECT: - frame = - lgl_template_frame_rect_new (orig_frame->all.id, - orig_frame->rect.w, - orig_frame->rect.h, - orig_frame->rect.r, - orig_frame->rect.x_waste, - orig_frame->rect.y_waste); - break; - - case LGL_TEMPLATE_FRAME_SHAPE_ROUND: - frame = - lgl_template_frame_round_new (orig_frame->all.id, - orig_frame->round.r, - orig_frame->round.waste); - break; - - case LGL_TEMPLATE_FRAME_SHAPE_CD: - frame = - lgl_template_frame_cd_new (orig_frame->all.id, - orig_frame->cd.r1, - orig_frame->cd.r2, - orig_frame->cd.w, - orig_frame->cd.h, - orig_frame->cd.waste); - break; - - default: - return NULL; - break; - } - - for ( p=orig_frame->all.layouts; p != NULL; p=p->next ) { - - layout = (lglTemplateLayout *)p->data; - - lgl_template_frame_add_layout (frame, lgl_template_layout_dup (layout)); - } - - for ( p=orig_frame->all.markups; p != NULL; p=p->next ) { - - markup = (lglTemplateMarkup *)p->data; - - lgl_template_frame_add_markup (frame, lgl_template_markup_dup (markup)); - } - - return frame; -} - - -/** - * lgl_template_frame_free: - * @frame: Frame to free. - * - * This function frees all memory associated with given template frame structure. - * - */ -void -lgl_template_frame_free (lglTemplateFrame *frame) -{ - GList *p; - lglTemplateLayout *layout; - lglTemplateMarkup *markup; - - if ( frame != NULL ) { - - g_free (frame->all.id); - frame->all.id = NULL; - - for ( p=frame->all.layouts; p != NULL; p=p->next ) { - - layout = (lglTemplateLayout *)p->data; - - lgl_template_layout_free (layout); - p->data = NULL; - } - g_list_free (frame->all.layouts); - frame->all.layouts = NULL; - - for ( p=frame->all.markups; p != NULL; p=p->next ) { - - markup = (lglTemplateMarkup *)p->data; - - lgl_template_markup_free (markup); - p->data = NULL; - } - g_list_free (frame->all.markups); - frame->all.markups = NULL; - - g_free (frame); - - } - -} - - -/** - * lgl_template_layout_dup: - * @orig_layout: Layout to duplicate. - * - * This function duplicates a template layout structure. - * - * Returns: a newly allocated #lglTemplateLayout structure. - * - */ -lglTemplateLayout * -lgl_template_layout_dup (const lglTemplateLayout *orig_layout) -{ - lglTemplateLayout *layout; - - g_return_val_if_fail (orig_layout, NULL); - - layout = g_new0 (lglTemplateLayout, 1); - - /* copy contents */ - *layout = *orig_layout; - - return layout; -} - - -/** - * lgl_template_layout_free: - * @layout: Layout to free. - * - * This function frees all memory associated with given template layout structure. - * - */ -void -lgl_template_layout_free (lglTemplateLayout *layout) -{ - g_free (layout); -} - - -/** - * lgl_template_markup_dup: - * @orig_markup: Markup to duplicate. - * - * This function duplicates a template markup structure. - * - * Returns: a newly allocated #lglTemplateMarkup structure. - * - */ -lglTemplateMarkup * -lgl_template_markup_dup (const lglTemplateMarkup *orig_markup) -{ - lglTemplateMarkup *markup; - - g_return_val_if_fail (orig_markup, NULL); - - markup = g_new0 (lglTemplateMarkup, 1); - - *markup = *orig_markup; - - return markup; -} - - -/** - * lgl_template_markup_free: - * @markup: Markup to free. - * - * This function frees all memory associated with given template markup structure. - * - */ -void -lgl_template_markup_free (lglTemplateMarkup *markup) -{ - g_free (markup); -} - - -static gint -compare_origins (gconstpointer a, - gconstpointer b, - gpointer user_data) -{ - const lglTemplateOrigin *a_origin = a, *b_origin = b; - - if ( a_origin->y < b_origin->y ) { - return -1; - } else if ( a_origin->y > b_origin->y ) { - return +1; - } else { - if ( a_origin->x < b_origin->x ) { - return -1; - } else if ( a_origin->x > b_origin->x ) { - return +1; - } else { - return 0; /* hopefully 2 labels won't have the same origin */ - } - } -} - diff --git a/glabels2/libglabels/template.h b/glabels2/libglabels/template.h deleted file mode 100644 index cbcbccf2..00000000 --- a/glabels2/libglabels/template.h +++ /dev/null @@ -1,380 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (LIBGLABELS) Template library for GLABELS - * - * template.h: template module header file - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __TEMPLATE_H__ -#define __TEMPLATE_H__ - -#include -#include - -G_BEGIN_DECLS - -typedef struct _lglTemplate lglTemplate; - -typedef struct _lglTemplateAlias lglTemplateAlias; - -typedef union _lglTemplateFrame lglTemplateFrame; -typedef struct _lglTemplateFrameAll lglTemplateFrameAll; -typedef struct _lglTemplateFrameRect lglTemplateFrameRect; -typedef struct _lglTemplateFrameRound lglTemplateFrameRound; -typedef struct _lglTemplateFrameCD lglTemplateFrameCD; - -typedef struct _lglTemplateLayout lglTemplateLayout; - -typedef union _lglTemplateMarkup lglTemplateMarkup; -typedef struct _lglTemplateMarkupMargin lglTemplateMarkupMargin; -typedef struct _lglTemplateMarkupLine lglTemplateMarkupLine; -typedef struct _lglTemplateMarkupCircle lglTemplateMarkupCircle; -typedef struct _lglTemplateMarkupRect lglTemplateMarkupRect; - -typedef struct _lglTemplateOrigin lglTemplateOrigin; - -/* - * Top-level Template Structure - */ -struct _lglTemplate { - - gchar *brand; - gchar *part; - gchar *description; - gchar *paper_id; - gdouble page_width; - gdouble page_height; - - /* List of (lglTemplateAlias *) aliase structures. */ - GList *aliases; - - /* List of (gchar *) category ids. */ - GList *category_ids; - - /* List of (lglTemplateFrame *) label frame structures. - * Currently glabels only supports a single label frame per - * template. */ - GList *frames; - -}; - - -/* - * Top-level Template Structure - */ -struct _lglTemplateAlias { - - gchar *brand; - gchar *part; - -}; - -/* - * Possible Frame Shapes - */ -typedef enum { - LGL_TEMPLATE_FRAME_SHAPE_RECT, - LGL_TEMPLATE_FRAME_SHAPE_ROUND, - LGL_TEMPLATE_FRAME_SHAPE_CD, -} lglTemplateFrameShape; - - -/* - * Frame Structure - */ -struct _lglTemplateFrameAll { - - /* Begin Common Fields */ - lglTemplateFrameShape shape; - - gchar *id; /* Id, currently always "0" */ - GList *layouts; /* List of lglTemplateLayouts */ - GList *markups; /* List of lglTemplateMarkups */ - /* End Common Fields */ -}; - -struct _lglTemplateFrameRect { - - /* Begin Common Fields */ - lglTemplateFrameShape shape; /* Always LGL_TEMPLATE_FRAME_SHAPE_RECT. */ - - gchar *id; /* Id, currently always "0" */ - GList *layouts; /* List of lglTemplateLayouts */ - GList *markups; /* List of lglTemplateMarkups */ - /* End Common Fields */ - - gdouble w; /* Width */ - gdouble h; /* Height */ - gdouble r; /* Corner radius */ - gdouble x_waste; /* Amount of horiz overprint allowed. */ - gdouble y_waste; /* Amount of vert overprint allowed. */ -}; - -struct _lglTemplateFrameRound { - - /* Begin Common Fields */ - lglTemplateFrameShape shape; /* Always LGL_TEMPLATE_FRAME_SHAPE_ROUND. */ - - gchar *id; /* Id, currently always "0" */ - GList *layouts; /* List of lglTemplateLayouts */ - GList *markups; /* List of lglTemplateMarkups */ - /* End Common Fields */ - - gdouble r; /* Radius */ - gdouble waste; /* Amount of overprint allowed. */ -}; - -struct _lglTemplateFrameCD { - - /* Begin Common Fields */ - lglTemplateFrameShape shape; /* Always LGL_TEMPLATE_FRAME_SHAPE_CD. */ - - gchar *id; /* Id, currently always "0" */ - GList *layouts; /* List of lglTemplateLayouts */ - GList *markups; /* List of lglTemplateMarkups */ - /* End Common Fields */ - - gdouble r1; /* Outer radius */ - gdouble r2; /* Inner radius (hole) */ - gdouble w; /* Clip width, business card CDs */ - gdouble h; /* Clip height, business card CDs */ - gdouble waste; /* Amount of overprint allowed. */ -}; - -union _lglTemplateFrame{ - - lglTemplateFrameShape shape; - - lglTemplateFrameAll all; - lglTemplateFrameRect rect; - lglTemplateFrameRound round; - lglTemplateFrameCD cd; -}; - - -/* - * Label Layout Structure - */ -struct _lglTemplateLayout { - - gint nx; /* Number of labels across */ - gint ny; /* Number of labels up and down */ - - gdouble x0; /* Left of grid from left edge of paper */ - gdouble y0; /* Top of grid from top edge of paper */ - - gdouble dx; /* Horizontal pitch of grid */ - gdouble dy; /* Vertical pitch of grid */ - -}; - - -/* - * Possible Markup Types - */ -typedef enum { - LGL_TEMPLATE_MARKUP_MARGIN, - LGL_TEMPLATE_MARKUP_LINE, - LGL_TEMPLATE_MARKUP_CIRCLE, - LGL_TEMPLATE_MARKUP_RECT, -} lglTemplateMarkupType; - - -/* - * Label Markup Structure (Helpful lines drawn in glabels to help locate objects) - */ -struct _lglTemplateMarkupMargin { - - lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_MARGIN */ - - gdouble size; /* Margin size */ -}; - -struct _lglTemplateMarkupLine { - - lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_LINE */ - - gdouble x1, y1; /* 1st endpoint */ - gdouble x2, y2; /* 2nd endpoint */ -}; - -struct _lglTemplateMarkupCircle { - - lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_CIRCLE */ - - gdouble x0, y0; /* Center of circle */ - gdouble r; /* Radius of circle */ -}; - -struct _lglTemplateMarkupRect { - - lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_RECT */ - - gdouble x1, y1; /* Upper left corner */ - gdouble w, h; /* Width and height. */ - gdouble r; /* Radius of corners. */ -}; - -union _lglTemplateMarkup { - - lglTemplateMarkupType type; - - lglTemplateMarkupMargin margin; - lglTemplateMarkupLine line; - lglTemplateMarkupCircle circle; - lglTemplateMarkupRect rect; -}; - - -/* - * Origin coordinates - */ -struct _lglTemplateOrigin { - - gdouble x, y; /* Label origin relative to upper - * upper left hand corner of paper */ - -}; - - - -/* - * Template query functions - */ -gchar *lgl_template_get_name (const lglTemplate *template); - -gboolean lgl_template_do_templates_match (const lglTemplate *template1, - const lglTemplate *template2); - -gboolean lgl_template_does_brand_match (const lglTemplate *template, - const gchar *brand); - -gboolean lgl_template_does_page_size_match (const lglTemplate *template, - const gchar *paper_id); - -gboolean lgl_template_does_category_match (const lglTemplate *template, - const gchar *category_id); - - -/* - * Frame query functions - */ -void lgl_template_frame_get_size (const lglTemplateFrame *frame, - gdouble *w, - gdouble *h); - -gint lgl_template_frame_get_n_labels (const lglTemplateFrame *frame); - -lglTemplateOrigin *lgl_template_frame_get_origins (const lglTemplateFrame *frame); - - -/* - * Template Construction - */ -lglTemplate *lgl_template_new (const gchar *brand, - const gchar *part, - const gchar *description, - const gchar *paper_id, - gdouble page_width, - gdouble page_height); - -void lgl_template_add_alias (lglTemplate *template, - lglTemplateAlias *alias); - -void lgl_template_add_category (lglTemplate *template, - const gchar *category_id); - -void lgl_template_add_frame (lglTemplate *template, - lglTemplateFrame *frame); - -lglTemplateFrame *lgl_template_frame_rect_new (const gchar *id, - gdouble w, - gdouble h, - gdouble r, - gdouble x_waste, - gdouble y_waste); - -lglTemplateAlias *lgl_template_alias_new (const gchar *brand, - const gchar *part); - -lglTemplateFrame *lgl_template_frame_round_new (const gchar *id, - gdouble r, - gdouble waste); - -lglTemplateFrame *lgl_template_frame_cd_new (const gchar *id, - gdouble r1, - gdouble r2, - gdouble w, - gdouble h, - gdouble waste); - -void lgl_template_frame_add_layout (lglTemplateFrame *frame, - lglTemplateLayout *layout); - -void lgl_template_frame_add_markup (lglTemplateFrame *frame, - lglTemplateMarkup *markup); - -lglTemplateLayout *lgl_template_layout_new (gint nx, - gint ny, - gdouble x0, - gdouble y0, - gdouble dx, - gdouble dy); - -lglTemplateMarkup *lgl_template_markup_margin_new (gdouble size); - -lglTemplateMarkup *lgl_template_markup_line_new (gdouble x1, - gdouble y1, - gdouble x2, - gdouble y2); - -lglTemplateMarkup *lgl_template_markup_circle_new (gdouble x0, - gdouble y0, - gdouble r); - -lglTemplateMarkup *lgl_template_markup_rect_new (gdouble x1, - gdouble y1, - gdouble w, - gdouble h, - gdouble r); - -lglTemplate *lgl_template_dup (const lglTemplate *orig_template); - -void lgl_template_free (lglTemplate *template); - -lglTemplateAlias *lgl_template_alias_dup (const lglTemplateAlias *orig_alias); -void lgl_template_alias_free (lglTemplateAlias *alias); - -lglTemplateFrame *lgl_template_frame_dup (const lglTemplateFrame *orig_frame); -void lgl_template_frame_free (lglTemplateFrame *frame); - -lglTemplateLayout *lgl_template_layout_dup (const lglTemplateLayout *orig_layout); -void lgl_template_layout_free (lglTemplateLayout *layout); - -lglTemplateMarkup *lgl_template_markup_dup (const lglTemplateMarkup *orig_markup); -void lgl_template_markup_free (lglTemplateMarkup *markup); - - -G_END_DECLS - -#endif diff --git a/glabels2/libglabels/xml-category.c b/glabels2/libglabels/xml-category.c deleted file mode 100644 index 0e759c9a..00000000 --- a/glabels2/libglabels/xml-category.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * xml-category.c: category xml module - * - * Copyright (C) 2006 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ -#include - -#include "xml-category.h" - -#include -#include -#include -#include - -#include "libglabels-private.h" - -#include "xml.h" - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - - -/** - * lgl_xml_category_read_categories_from_file: - * @utf8_filename: Filename of categories file (name encoded as UTF-8) - * - * Read category definitions from a file. - * - * Returns: a list of #lglCategory structures. - * - */ -GList * -lgl_xml_category_read_categories_from_file (gchar *utf8_filename) -{ - gchar *filename; - GList *categories; - xmlDocPtr categories_doc; - - LIBXML_TEST_VERSION; - - filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); - if (!filename) { - g_message ("Utf8 filename conversion error"); - return NULL; - } - - categories_doc = xmlParseFile (filename); - if (!categories_doc) { - g_message ("\"%s\" is not a glabels category file (not XML)", - filename); - return NULL; - } - - categories = lgl_xml_category_parse_categories_doc (categories_doc); - - g_free (filename); - xmlFreeDoc (categories_doc); - - return categories; -} - - -/** - * lgl_xml_category_parse_categories_doc: - * @categories_doc: libxml #xmlDocPtr tree, representing a categories - * definition file. - * - * Read category definitions from a libxml #xmlDocPtr tree. - * - * Returns: a list of #lglCategory structures. - * - */ -GList * -lgl_xml_category_parse_categories_doc (xmlDocPtr categories_doc) -{ - GList *categories = NULL; - xmlNodePtr root, node; - lglCategory *category; - - LIBXML_TEST_VERSION; - - root = xmlDocGetRootElement (categories_doc); - if (!root || !root->name) { - g_message ("\"%s\" is not a glabels category file (no root node)", - categories_doc->name); - xmlFreeDoc (categories_doc); - return categories; - } - if (!lgl_xml_is_node (root, "Glabels-categories")) { - g_message ("\"%s\" is not a glabels category file (wrong root node)", - categories_doc->name); - xmlFreeDoc (categories_doc); - return categories; - } - - for (node = root->xmlChildrenNode; node != NULL; node = node->next) { - - if (lgl_xml_is_node (node, "Category")) { - category = lgl_xml_category_parse_category_node (node); - categories = g_list_append (categories, category); - } else { - if ( !xmlNodeIsText(node) ) { - if (!lgl_xml_is_node (node, "comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - } - - return categories; -} - - -/** - * lgl_xml_category_parse_category_node: - * @category_node: libxml #xmlNodePtr category node from a #xmlDocPtr tree. - * - * Read a single category definition from a libxml #xmlNodePtr node. - * - * Returns: a pointer to a newly created #lglCategory structure. - * - */ -lglCategory * -lgl_xml_category_parse_category_node (xmlNodePtr category_node) -{ - lglCategory *category; - gchar *id, *name; - - LIBXML_TEST_VERSION; - - id = lgl_xml_get_prop_string (category_node, "id", NULL); - name = lgl_xml_get_prop_i18n_string (category_node, "name", NULL); - - category = lgl_category_new (id, name); - - g_free (id); - g_free (name); - - return category; -} - diff --git a/glabels2/libglabels/xml-category.h b/glabels2/libglabels/xml-category.h deleted file mode 100644 index ef01d9fb..00000000 --- a/glabels2/libglabels/xml-category.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * xml-category.h: category xml module header file - * - * Copyright (C) 2006 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __XML_CATEGORY_H__ -#define __XML_CATEGORY_H__ - -#include -#include -#include - -#include "category.h" - -G_BEGIN_DECLS - -GList *lgl_xml_category_read_categories_from_file (gchar *utf8_filename); - -GList *lgl_xml_category_parse_categories_doc (xmlDocPtr categories_doc); - -lglCategory *lgl_xml_category_parse_category_node (xmlNodePtr category_node); - - -G_END_DECLS - -#endif /* __XML_CATEGORY_H__ */ diff --git a/glabels2/libglabels/xml-paper.c b/glabels2/libglabels/xml-paper.c deleted file mode 100644 index fc6f07fa..00000000 --- a/glabels2/libglabels/xml-paper.c +++ /dev/null @@ -1,176 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * xml-paper.c: paper xml module - * - * Copyright (C) 2003, 2004 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ -#include - -#include "xml-paper.h" - -#include -#include -#include -#include - -#include "libglabels-private.h" - -#include "xml.h" - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - - -/** - * lgl_xml_paper_read_papers_from_file: - * @utf8_filename: Filename of papers file (name encoded as UTF-8) - * - * Read paper definitions from a file. - * - * Returns: a list of #lglPaper structures. - * - */ -GList * -lgl_xml_paper_read_papers_from_file (gchar *utf8_filename) -{ - gchar *filename; - GList *papers; - xmlDocPtr papers_doc; - - LIBXML_TEST_VERSION; - - filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); - if (!filename) { - g_message ("Utf8 filename conversion error"); - return NULL; - } - - papers_doc = xmlParseFile (filename); - if (!papers_doc) { - g_message ("\"%s\" is not a glabels paper file (not XML)", - filename); - return NULL; - } - - papers = lgl_xml_paper_parse_papers_doc (papers_doc); - - g_free (filename); - xmlFreeDoc (papers_doc); - - return papers; -} - - -/** - * lgl_xml_paper_parse_papers_doc: - * @papers_doc: libxml #xmlDocPtr tree, representing a papers definition file. - * - * Read paper definitions from a libxml #xmlDocPtr tree. - * - * Returns: a list of #lglPaper structures. - * - */ -GList * -lgl_xml_paper_parse_papers_doc (xmlDocPtr papers_doc) -{ - GList *papers = NULL; - xmlNodePtr root, node; - lglPaper *paper; - - LIBXML_TEST_VERSION; - - root = xmlDocGetRootElement (papers_doc); - if (!root || !root->name) { - g_message ("\"%s\" is not a glabels paper file (no root node)", - papers_doc->name); - xmlFreeDoc (papers_doc); - return papers; - } - if (!lgl_xml_is_node (root, "Glabels-paper-sizes")) { - g_message ("\"%s\" is not a glabels paper file (wrong root node)", - papers_doc->name); - xmlFreeDoc (papers_doc); - return papers; - } - - for (node = root->xmlChildrenNode; node != NULL; node = node->next) { - - if (lgl_xml_is_node (node, "Paper-size")) { - paper = lgl_xml_paper_parse_paper_node (node); - papers = g_list_append (papers, paper); - } else { - if ( !xmlNodeIsText(node) ) { - if (!lgl_xml_is_node (node, "comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - } - - return papers; -} - - -/** - * lgl_xml_paper_parse_paper_node: - * @paper_node: libxml #xmlNodePtr paper node from a #xmlDocPtr tree. - * - * Read a single paper definition from a libxml #xmlNodePtr node. - * - * Returns: a pointer to a newly created #lglPaper structure. - * - */ -lglPaper * -lgl_xml_paper_parse_paper_node (xmlNodePtr paper_node) -{ - lglPaper *paper; - gchar *id, *name, *pwg_size; - gdouble width, height; - - LIBXML_TEST_VERSION; - - id = lgl_xml_get_prop_string (paper_node, "id", NULL); - - name = lgl_xml_get_prop_i18n_string (paper_node, "name", NULL); - - width = lgl_xml_get_prop_length (paper_node, "width", 0); - height = lgl_xml_get_prop_length (paper_node, "height", 0); - - pwg_size = lgl_xml_get_prop_string (paper_node, "pwg_size", NULL); - - paper = lgl_paper_new (id, name, width, height, pwg_size); - - g_free (id); - g_free (name); - g_free (pwg_size); - - return paper; -} - diff --git a/glabels2/libglabels/xml-paper.h b/glabels2/libglabels/xml-paper.h deleted file mode 100644 index df90bcff..00000000 --- a/glabels2/libglabels/xml-paper.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * xml-paper.h: paper xml module header file - * - * Copyright (C) 2003, 2004 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __XML_PAPER_H__ -#define __XML_PAPER_H__ - -#include -#include -#include - -#include "paper.h" - -G_BEGIN_DECLS - -GList *lgl_xml_paper_read_papers_from_file (gchar *utf8_filename); - -GList *lgl_xml_paper_parse_papers_doc (xmlDocPtr papers_doc); - -lglPaper *lgl_xml_paper_parse_paper_node (xmlNodePtr paper_node); - - -G_END_DECLS - -#endif /* __XML_PAPER_H__ */ diff --git a/glabels2/libglabels/xml-template.c b/glabels2/libglabels/xml-template.c deleted file mode 100644 index 6f1ae4b8..00000000 --- a/glabels2/libglabels/xml-template.c +++ /dev/null @@ -1,972 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (LIBGLABELS) Template library for GLABELS - * - * xml-template.c: template xml module - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ -#include - -#include "xml-template.h" - -#include -#include -#include -#include - -#include "libglabels-private.h" - -#include "db.h" -#include "xml.h" - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ -static void xml_parse_meta_node (xmlNodePtr label_node, - lglTemplate *template); -static void xml_parse_label_rectangle_node (xmlNodePtr label_node, - lglTemplate *template); -static void xml_parse_label_round_node (xmlNodePtr label_node, - lglTemplate *template); -static void xml_parse_label_cd_node (xmlNodePtr label_node, - lglTemplate *template); -static void xml_parse_layout_node (xmlNodePtr layout_node, - lglTemplateFrame *frame); -static void xml_parse_markup_margin_node (xmlNodePtr markup_node, - lglTemplateFrame *frame); -static void xml_parse_markup_line_node (xmlNodePtr markup_node, - lglTemplateFrame *frame); -static void xml_parse_markup_circle_node (xmlNodePtr markup_node, - lglTemplateFrame *frame); -static void xml_parse_markup_rect_node (xmlNodePtr markup_node, - lglTemplateFrame *frame); -static void xml_parse_alias_node (xmlNodePtr alias_node, - lglTemplate *template); - -static void xml_create_meta_node (const gchar *category, - xmlNodePtr root, - const xmlNsPtr ns); -static void xml_create_label_node (const lglTemplateFrame *frame, - xmlNodePtr root, - const xmlNsPtr ns); -static void xml_create_layout_node (const lglTemplateLayout *layout, - xmlNodePtr root, - const xmlNsPtr ns); -static void xml_create_markup_margin_node (const lglTemplateMarkup *margin, - xmlNodePtr root, - const xmlNsPtr ns); -static void xml_create_markup_line_node (const lglTemplateMarkup *line, - xmlNodePtr root, - const xmlNsPtr ns); -static void xml_create_markup_circle_node (const lglTemplateMarkup *circle, - xmlNodePtr root, - const xmlNsPtr ns); -static void xml_create_markup_rect_node (const lglTemplateMarkup *circle, - xmlNodePtr root, - const xmlNsPtr ns); -static void xml_create_alias_node (const lglTemplateAlias *alias, - xmlNodePtr root, - const xmlNsPtr ns); - - -/** - * lgl_xml_template_read_templates_from_file: - * @utf8_filename: Filename of papers file (name encoded as UTF-8) - * - * Read glabels templates from template file. - * - * Returns: a list of #lglTemplate structures. - * - */ -GList * -lgl_xml_template_read_templates_from_file (const gchar *utf8_filename) -{ - gchar *filename; - xmlDocPtr templates_doc; - GList *templates = NULL; - - LIBXML_TEST_VERSION; - - filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); - if (!filename) { - g_message ("Utf8 filename conversion error"); - return NULL; - } - - templates_doc = xmlParseFile (filename); - if (!templates_doc) { - g_message ("\"%s\" is not a glabels template file (not XML)", - filename); - return templates; - } - - templates = lgl_xml_template_parse_templates_doc (templates_doc); - - g_free (filename); - xmlFreeDoc (templates_doc); - - return templates; -} - - -/** - * lgl_xml_template_parse_templates_doc: - * @templates_doc: libxml #xmlDocPtr tree, representing template file. - * - * Read glabels templates from a libxml #xmlDocPtr tree. - * - * Returns: a list of #lglTemplate structures. - * - */ -GList * -lgl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc) -{ - - GList *templates = NULL; - xmlNodePtr root, node; - lglTemplate *template; - - LIBXML_TEST_VERSION; - - root = xmlDocGetRootElement (templates_doc); - if (!root || !root->name) { - g_message ("\"%s\" is not a glabels template file (no root node)", - templates_doc->URL); - return templates; - } - if (!lgl_xml_is_node (root, "Glabels-templates")) { - g_message ("\"%s\" is not a glabels template file (wrong root node)", - templates_doc->URL); - return templates; - } - - for (node = root->xmlChildrenNode; node != NULL; node = node->next) { - - if (lgl_xml_is_node (node, "Template")) { - template = lgl_xml_template_parse_template_node (node); - templates = g_list_append (templates, template); - } else { - if ( !xmlNodeIsText(node) ) { - if (!lgl_xml_is_node (node,"comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - } - - return templates; -} - - -/** - * lgl_xml_template_parse_template_node: - * @template_node: libxml #xmlNodePtr template node from a #xmlDocPtr tree. - * - * Read a single glabels template from a libxml #xmlNodePtr node. - * - * Returns: a pointer to a newly created #lglTemplate structure. - * - */ -lglTemplate * -lgl_xml_template_parse_template_node (const xmlNodePtr template_node) -{ - gchar *brand; - gchar *part; - gchar *name; - gchar *description; - gchar *paper_id; - gdouble page_width, page_height; - lglPaper *paper = NULL; - lglTemplate *template; - xmlNodePtr node; - gchar **v; - - brand = lgl_xml_get_prop_string (template_node, "brand", NULL); - part = lgl_xml_get_prop_string (template_node, "part", NULL); - if (!brand || !part) - { - name = lgl_xml_get_prop_string (template_node, "name", NULL); - if (name) - { - v = g_strsplit (name, " ", 2); - brand = g_strdup (v[0]); - part = g_strchug (g_strdup (v[1])); - g_free (name); - g_strfreev (v); - - } - else - { - g_message (_("Missing name or brand/part attributes.")); - } - } - - description = lgl_xml_get_prop_i18n_string (template_node, "description", NULL); - paper_id = lgl_xml_get_prop_string (template_node, "size", NULL); - - if (lgl_db_is_paper_id_other (paper_id)) { - - page_width = lgl_xml_get_prop_length (template_node, "width", 0); - page_height = lgl_xml_get_prop_length (template_node, "height", 0); - - } else { - paper = lgl_db_lookup_paper_from_id (paper_id); - if (paper == NULL) { - /* This should always be an id, but just in case a name - slips by! */ - g_message (_("Unknown page size id \"%s\", trying as name"), - paper_id); - paper = lgl_db_lookup_paper_from_name (paper_id); - g_free (paper_id); - paper_id = g_strdup (paper->id); - } - if (paper != NULL) { - page_width = paper->width; - page_height = paper->height; - } else { - page_width = 612; - page_height = 792; - g_message (_("Unknown page size id or name \"%s\""), - paper_id); - } - lgl_paper_free (paper); - paper = NULL; - } - - template = lgl_template_new (brand, part, description, - paper_id, page_width, page_height); - - for (node = template_node->xmlChildrenNode; node != NULL; - node = node->next) { - if (lgl_xml_is_node (node, "Meta")) { - xml_parse_meta_node (node, template); - } else if (lgl_xml_is_node (node, "Label-rectangle")) { - xml_parse_label_rectangle_node (node, template); - } else if (lgl_xml_is_node (node, "Label-round")) { - xml_parse_label_round_node (node, template); - } else if (lgl_xml_is_node (node, "Label-cd")) { - xml_parse_label_cd_node (node, template); - } else if (lgl_xml_is_node (node, "Alias")) { - xml_parse_alias_node (node, template); - } else { - if (!xmlNodeIsText (node)) { - if (!lgl_xml_is_node (node,"comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - } - - g_free (brand); - g_free (part); - g_free (description); - g_free (paper_id); - - return template; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Template->Meta Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_meta_node (xmlNodePtr meta_node, - lglTemplate *template) -{ - gchar *category; - - category = lgl_xml_get_prop_string (meta_node, "category", NULL); - - if (category != NULL) - { - lgl_template_add_category (template, category); - g_free (category); - } -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Template->Label-rectangle Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_label_rectangle_node (xmlNodePtr label_node, - lglTemplate *template) -{ - gchar *id; - gchar *tmp; - gdouble x_waste, y_waste; - gdouble w, h, r; - lglTemplateFrame *frame; - xmlNodePtr node; - - id = lgl_xml_get_prop_string (label_node, "id", NULL); - - if ((tmp = lgl_xml_get_prop_string (label_node, "waste", NULL))) { - /* Handle single "waste" property. */ - x_waste = y_waste = lgl_xml_get_prop_length (label_node, "waste", 0); - g_free (tmp); - } else { - x_waste = lgl_xml_get_prop_length (label_node, "x_waste", 0); - y_waste = lgl_xml_get_prop_length (label_node, "y_waste", 0); - } - - w = lgl_xml_get_prop_length (label_node, "width", 0); - h = lgl_xml_get_prop_length (label_node, "height", 0); - r = lgl_xml_get_prop_length (label_node, "round", 0); - - frame = lgl_template_frame_rect_new ((gchar *)id, w, h, r, x_waste, y_waste); - lgl_template_add_frame (template, frame); - - for (node = label_node->xmlChildrenNode; node != NULL; - node = node->next) { - if (lgl_xml_is_node (node, "Layout")) { - xml_parse_layout_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-margin")) { - xml_parse_markup_margin_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-line")) { - xml_parse_markup_line_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-circle")) { - xml_parse_markup_circle_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-rect")) { - xml_parse_markup_rect_node (node, frame); - } else if (!xmlNodeIsText (node)) { - if (!lgl_xml_is_node (node, "comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - - g_free (id); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Template->Label-round Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_label_round_node (xmlNodePtr label_node, - lglTemplate *template) -{ - gchar *id; - gdouble waste; - gdouble r; - lglTemplateFrame *frame; - xmlNodePtr node; - - id = lgl_xml_get_prop_string (label_node, "id", NULL); - waste = lgl_xml_get_prop_length (label_node, "waste", 0); - r = lgl_xml_get_prop_length (label_node, "radius", 0); - - frame = lgl_template_frame_round_new ((gchar *)id, r, waste); - lgl_template_add_frame (template, frame); - - for (node = label_node->xmlChildrenNode; node != NULL; - node = node->next) { - if (lgl_xml_is_node (node, "Layout")) { - xml_parse_layout_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-margin")) { - xml_parse_markup_margin_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-line")) { - xml_parse_markup_line_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-circle")) { - xml_parse_markup_circle_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-rect")) { - xml_parse_markup_rect_node (node, frame); - } else if (!xmlNodeIsText (node)) { - if (!lgl_xml_is_node (node, "comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - - g_free (id); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Template->Label-cd Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_label_cd_node (xmlNodePtr label_node, - lglTemplate *template) -{ - gchar *id; - gdouble waste; - gdouble r1, r2, w, h; - lglTemplateFrame *frame; - xmlNodePtr node; - - id = lgl_xml_get_prop_string (label_node, "id", NULL); - waste = lgl_xml_get_prop_length (label_node, "waste", 0); - r1 = lgl_xml_get_prop_length (label_node, "radius", 0); - r2 = lgl_xml_get_prop_length (label_node, "hole", 0); - w = lgl_xml_get_prop_length (label_node, "width", 0); - h = lgl_xml_get_prop_length (label_node, "height", 0); - - frame = lgl_template_frame_cd_new ((gchar *)id, r1, r2, w, h, waste); - lgl_template_add_frame (template, frame); - - for (node = label_node->xmlChildrenNode; node != NULL; - node = node->next) { - if (lgl_xml_is_node (node, "Layout")) { - xml_parse_layout_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-margin")) { - xml_parse_markup_margin_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-line")) { - xml_parse_markup_line_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-circle")) { - xml_parse_markup_circle_node (node, frame); - } else if (lgl_xml_is_node (node, "Markup-rect")) { - xml_parse_markup_rect_node (node, frame); - } else if (!xmlNodeIsText (node)) { - if (!lgl_xml_is_node (node, "comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - - g_free (id); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Template->Label->Layout Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_layout_node (xmlNodePtr layout_node, - lglTemplateFrame *frame) -{ - gint nx, ny; - gdouble x0, y0, dx, dy; - xmlNodePtr node; - - nx = lgl_xml_get_prop_int (layout_node, "nx", 1); - ny = lgl_xml_get_prop_int (layout_node, "ny", 1); - - x0 = lgl_xml_get_prop_length (layout_node, "x0", 0); - y0 = lgl_xml_get_prop_length (layout_node, "y0", 0); - - dx = lgl_xml_get_prop_length (layout_node, "dx", 0); - dy = lgl_xml_get_prop_length (layout_node, "dy", 0); - - lgl_template_frame_add_layout (frame, lgl_template_layout_new (nx, ny, x0, y0, dx, dy)); - - for (node = layout_node->xmlChildrenNode; node != NULL; - node = node->next) { - if (!xmlNodeIsText (node)) { - if (!lgl_xml_is_node (node, "comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Template->Label->Markup-margin Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_markup_margin_node (xmlNodePtr markup_node, - lglTemplateFrame *frame) -{ - gdouble size; - xmlNodePtr node; - - size = lgl_xml_get_prop_length (markup_node, "size", 0); - - lgl_template_frame_add_markup (frame, lgl_template_markup_margin_new (size)); - - for (node = markup_node->xmlChildrenNode; node != NULL; - node = node->next) { - if (!xmlNodeIsText (node)) { - if (!lgl_xml_is_node (node, "comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Template->Label->Markup-line Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_markup_line_node (xmlNodePtr markup_node, - lglTemplateFrame *frame) -{ - gdouble x1, y1, x2, y2; - xmlNodePtr node; - - x1 = lgl_xml_get_prop_length (markup_node, "x1", 0); - y1 = lgl_xml_get_prop_length (markup_node, "y1", 0); - x2 = lgl_xml_get_prop_length (markup_node, "x2", 0); - y2 = lgl_xml_get_prop_length (markup_node, "y2", 0); - - lgl_template_frame_add_markup (frame, lgl_template_markup_line_new (x1, y1, x2, y2)); - - for (node = markup_node->xmlChildrenNode; node != NULL; - node = node->next) { - if (!xmlNodeIsText (node)) { - if (!lgl_xml_is_node (node, "comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Template->Label->Markup-circle Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_markup_circle_node (xmlNodePtr markup_node, - lglTemplateFrame *frame) -{ - gdouble x0, y0, r; - xmlNodePtr node; - - x0 = lgl_xml_get_prop_length (markup_node, "x0", 0); - y0 = lgl_xml_get_prop_length (markup_node, "y0", 0); - r = lgl_xml_get_prop_length (markup_node, "radius", 0); - - lgl_template_frame_add_markup (frame, lgl_template_markup_circle_new (x0, y0, r)); - - for (node = markup_node->xmlChildrenNode; node != NULL; - node = node->next) { - if (!xmlNodeIsText (node)) { - if (!lgl_xml_is_node (node, "comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Template->Label->Markup-rect Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_markup_rect_node (xmlNodePtr markup_node, - lglTemplateFrame *frame) -{ - gdouble x1, y1, w, h, r; - xmlNodePtr node; - - x1 = lgl_xml_get_prop_length (markup_node, "x1", 0); - y1 = lgl_xml_get_prop_length (markup_node, "y1", 0); - w = lgl_xml_get_prop_length (markup_node, "w", 0); - h = lgl_xml_get_prop_length (markup_node, "h", 0); - r = lgl_xml_get_prop_length (markup_node, "r", 0); - - lgl_template_frame_add_markup (frame, lgl_template_markup_rect_new (x1, y1, w, h, r)); - - for (node = markup_node->xmlChildrenNode; node != NULL; - node = node->next) { - if (!xmlNodeIsText (node)) { - if (!lgl_xml_is_node (node, "comment")) { - g_message ("bad node = \"%s\"",node->name); - } - } - } - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Template->Alias Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_alias_node (xmlNodePtr alias_node, - lglTemplate *template) -{ - gchar *brand; - gchar *part; - gchar *name; - gchar **v; - - brand = lgl_xml_get_prop_string (alias_node, "brand", NULL); - part = lgl_xml_get_prop_string (alias_node, "part", NULL); - if (!brand || !part) - { - name = lgl_xml_get_prop_string (alias_node, "name", NULL); - if (name) - { - g_message (_("Missing required \"brand\" or \"part\" attribute, trying deprecated name.")); - v = g_strsplit (name, " ", 2); - brand = g_strdup (v[0]); - part = g_strdup (v[1]); - g_free (name); - g_strfreev (v); - - } - else - { - g_message (_("Name attribute also missing.")); - } - } - - lgl_template_add_alias (template, lgl_template_alias_new (brand, part)); - - g_free (brand); - g_free (part); -} - -/** - * lgl_xml_template_write_templates_to_file: - * @templates: List of #lglTemplate structures - * @utf8_filename: Filename of templates file (name encoded as UTF-8) - * - * Write a list of #lglTemplate structures to a glabels XML template file. - * - * Returns: the number of bytes written or -1 in case of failure - * - */ -gint -lgl_xml_template_write_templates_to_file (GList *templates, - const gchar *utf8_filename) -{ - xmlDocPtr doc; - xmlNsPtr ns; - gint bytes_written; - GList *p; - lglTemplate *template; - gchar *filename; - - doc = xmlNewDoc ((xmlChar *)"1.0"); - doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *)"Glabels-templates", NULL); - - ns = xmlNewNs (doc->xmlRootNode, (xmlChar *)LGL_XML_NAME_SPACE, NULL); - xmlSetNs (doc->xmlRootNode, ns); - - for (p=templates; p!=NULL; p=p->next) { - template = (lglTemplate *)p->data; - lgl_xml_template_create_template_node (template, doc->xmlRootNode, ns); - } - - filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); - if (!filename) - { - g_message (_("Utf8 conversion error.")); - return -1; - } - else - { - xmlSetDocCompressMode (doc, 0); - bytes_written = xmlSaveFormatFile (filename, doc, TRUE); - xmlFreeDoc (doc); - g_free (filename); - return bytes_written; - } - -} - - -/** - * lgl_xml_template_write_template_to_file: - * @template: #lglTemplate structure to be written - * @utf8_filename: Filename of templates file (name encoded as UTF-8) - * - * Write a single #lglTemplate structures to a glabels XML template file. - * - * Returns: the number of bytes written or -1 in case of failure - * - */ -gint -lgl_xml_template_write_template_to_file (const lglTemplate *template, - const gchar *utf8_filename) -{ - GList *templates = NULL; - gint bytes_written; - - templates = g_list_append (templates, (gpointer)template); - - bytes_written = lgl_xml_template_write_templates_to_file (templates, utf8_filename); - - g_list_free (templates); - - return bytes_written; -} - - -/** - * lgl_xml_template_create_template_node: - * @template: #lglTemplate structure to be written - * @root: parent node to receive new child node - * @ns: a libxml #xmlNsPtr - * - * Add a single #lglTemplate child node to given #xmlNodePtr. - * - */ -void -lgl_xml_template_create_template_node (const lglTemplate *template, - xmlNodePtr root, - const xmlNsPtr ns) -{ - xmlNodePtr node; - GList *p; - lglTemplateAlias *alias; - lglTemplateFrame *frame; - - node = xmlNewChild (root, ns, (xmlChar *)"Template", NULL); - - lgl_xml_set_prop_string (node, "brand", template->brand); - lgl_xml_set_prop_string (node, "part", template->part); - - lgl_xml_set_prop_string (node, "size", template->paper_id); - if (xmlStrEqual ((xmlChar *)template->paper_id, (xmlChar *)"Other")) - { - - lgl_xml_set_prop_length (node, "width", template->page_width); - lgl_xml_set_prop_length (node, "height", template->page_height); - - } - - lgl_xml_set_prop_string (node, "description", template->description); - - for ( p=template->aliases; p != NULL; p=p->next ) { - alias = (lglTemplateAlias *)p->data; - if ( !(xmlStrEqual ((xmlChar *)template->brand, (xmlChar *)alias->brand) && - xmlStrEqual ((xmlChar *)template->part, (xmlChar *)alias->part)) ) - { - xml_create_alias_node ( alias, node, ns ); - } - } - for ( p=template->category_ids; p != NULL; p=p->next ) - { - xml_create_meta_node ( p->data, node, ns ); - } - for ( p=template->frames; p != NULL; p=p->next ) - { - frame = (lglTemplateFrame *)p->data; - xml_create_label_node (frame, node, ns); - } - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Template->Meta Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_meta_node (const gchar *category, - xmlNodePtr root, - const xmlNsPtr ns) -{ - xmlNodePtr node; - - node = xmlNewChild (root, ns, (xmlChar *)"Meta", NULL); - lgl_xml_set_prop_string (node, "category", category); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Template->Label Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_label_node (const lglTemplateFrame *frame, - xmlNodePtr root, - const xmlNsPtr ns) -{ - xmlNodePtr node; - GList *p; - lglTemplateMarkup *markup; - lglTemplateLayout *layout; - - switch (frame->shape) { - - case LGL_TEMPLATE_FRAME_SHAPE_RECT: - node = xmlNewChild(root, ns, (xmlChar *)"Label-rectangle", NULL); - lgl_xml_set_prop_string (node, "id", frame->all.id); - lgl_xml_set_prop_length (node, "width", frame->rect.w); - lgl_xml_set_prop_length (node, "height", frame->rect.h); - lgl_xml_set_prop_length (node, "round", frame->rect.r); - lgl_xml_set_prop_length (node, "x_waste", frame->rect.x_waste); - lgl_xml_set_prop_length (node, "y_waste", frame->rect.y_waste); - break; - - case LGL_TEMPLATE_FRAME_SHAPE_ROUND: - node = xmlNewChild(root, ns, (xmlChar *)"Label-round", NULL); - lgl_xml_set_prop_string (node, "id", frame->all.id); - lgl_xml_set_prop_length (node, "radius", frame->round.r); - lgl_xml_set_prop_length (node, "waste", frame->round.waste); - break; - - case LGL_TEMPLATE_FRAME_SHAPE_CD: - node = xmlNewChild(root, ns, (xmlChar *)"Label-cd", NULL); - lgl_xml_set_prop_string (node, "id", frame->all.id); - lgl_xml_set_prop_length (node, "radius", frame->cd.r1); - lgl_xml_set_prop_length (node, "hole", frame->cd.r2); - if (frame->cd.w != 0.0) { - lgl_xml_set_prop_length (node, "width", frame->cd.w); - } - if (frame->cd.h != 0.0) { - lgl_xml_set_prop_length (node, "height", frame->cd.h); - } - lgl_xml_set_prop_length (node, "waste", frame->cd.waste); - break; - - default: - g_message ("Unknown label style"); - return; - break; - - } - - for ( p=frame->all.markups; p != NULL; p=p->next ) { - markup = (lglTemplateMarkup *)p->data; - switch (markup->type) { - case LGL_TEMPLATE_MARKUP_MARGIN: - xml_create_markup_margin_node (markup, node, ns); - break; - case LGL_TEMPLATE_MARKUP_LINE: - xml_create_markup_line_node (markup, node, ns); - break; - case LGL_TEMPLATE_MARKUP_CIRCLE: - xml_create_markup_circle_node (markup, node, ns); - break; - case LGL_TEMPLATE_MARKUP_RECT: - xml_create_markup_rect_node (markup, node, ns); - break; - default: - g_message ("Unknown markup type"); - break; - } - } - - for ( p=frame->all.layouts; p != NULL; p=p->next ) { - layout = (lglTemplateLayout *)p->data; - xml_create_layout_node (layout, node, ns); - } - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Template->Label->Layout Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_layout_node (const lglTemplateLayout *layout, - xmlNodePtr root, - const xmlNsPtr ns) -{ - xmlNodePtr node; - - node = xmlNewChild(root, ns, (xmlChar *)"Layout", NULL); - lgl_xml_set_prop_int (node, "nx", layout->nx); - lgl_xml_set_prop_int (node, "ny", layout->ny); - lgl_xml_set_prop_length (node, "x0", layout->x0); - lgl_xml_set_prop_length (node, "y0", layout->y0); - lgl_xml_set_prop_length (node, "dx", layout->dx); - lgl_xml_set_prop_length (node, "dy", layout->dy); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Template->Label->Markup-margin Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_markup_margin_node (const lglTemplateMarkup *markup, - xmlNodePtr root, - const xmlNsPtr ns) -{ - xmlNodePtr node; - - node = xmlNewChild(root, ns, (xmlChar *)"Markup-margin", NULL); - - lgl_xml_set_prop_length (node, "size", markup->margin.size); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Template->Label->Markup-line Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_markup_line_node (const lglTemplateMarkup *markup, - xmlNodePtr root, - const xmlNsPtr ns) -{ - xmlNodePtr node; - - node = xmlNewChild(root, ns, (xmlChar *)"Markup-line", NULL); - - lgl_xml_set_prop_length (node, "x1", markup->line.x1); - lgl_xml_set_prop_length (node, "y1", markup->line.y1); - lgl_xml_set_prop_length (node, "x2", markup->line.x2); - lgl_xml_set_prop_length (node, "y2", markup->line.y2); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Template->Label->Markup-circle Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_markup_circle_node (const lglTemplateMarkup *markup, - xmlNodePtr root, - const xmlNsPtr ns) -{ - xmlNodePtr node; - - node = xmlNewChild(root, ns, (xmlChar *)"Markup-circle", NULL); - - lgl_xml_set_prop_length (node, "x0", markup->circle.x0); - lgl_xml_set_prop_length (node, "y0", markup->circle.y0); - lgl_xml_set_prop_length (node, "radius", markup->circle.r); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Template->Label->Markup-rect Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_markup_rect_node (const lglTemplateMarkup *markup, - xmlNodePtr root, - const xmlNsPtr ns) -{ - xmlNodePtr node; - - node = xmlNewChild(root, ns, (xmlChar *)"Markup-rect", NULL); - - lgl_xml_set_prop_length (node, "x1", markup->rect.x1); - lgl_xml_set_prop_length (node, "y1", markup->rect.y1); - lgl_xml_set_prop_length (node, "w", markup->rect.w); - lgl_xml_set_prop_length (node, "h", markup->rect.h); - lgl_xml_set_prop_length (node, "r", markup->rect.r); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Template->Alias Node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_alias_node (const lglTemplateAlias *alias, - xmlNodePtr root, - const xmlNsPtr ns) -{ - xmlNodePtr node; - - node = xmlNewChild (root, ns, (xmlChar *)"Alias", NULL); - - lgl_xml_set_prop_string (node, "brand", alias->brand); - lgl_xml_set_prop_string (node, "part", alias->part); - -} - diff --git a/glabels2/libglabels/xml-template.h b/glabels2/libglabels/xml-template.h deleted file mode 100644 index b940db32..00000000 --- a/glabels2/libglabels/xml-template.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * xml-template.h: template xml module header file - * - * Copyright (C) 2001-2004 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __XML_TEMPLATE_H__ -#define __XML_TEMPLATE_H__ - -#include -#include - -#include "template.h" - -G_BEGIN_DECLS - -GList *lgl_xml_template_read_templates_from_file (const gchar *utf8_filename); - -GList *lgl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc); - -lglTemplate *lgl_xml_template_parse_template_node (const xmlNodePtr template_node); - - -gint lgl_xml_template_write_templates_to_file (GList *templates, - const gchar *utf8_filename); - -gint lgl_xml_template_write_template_to_file (const lglTemplate *template, - const gchar *utf8_filename); - -void lgl_xml_template_create_template_node (const lglTemplate *template, - xmlNodePtr root, - const xmlNsPtr ns); - -G_END_DECLS - -#endif /* __XML_TEMPLATE_H__ */ diff --git a/glabels2/libglabels/xml.c b/glabels2/libglabels/xml.c deleted file mode 100644 index 0943d908..00000000 --- a/glabels2/libglabels/xml.c +++ /dev/null @@ -1,539 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * xml.c: GLabels xml utilities module - * - * Copyright (C) 2003, 2004 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ -#include - -#include "xml.h" - -#include -#include -#include -#include - -#include "libglabels-private.h" - - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -#define POINTS_PER_POINT 1.0 /* internal units are points. */ -#define POINTS_PER_INCH 72.0 -#define POINTS_PER_MM 2.83464566929 -#define POINTS_PER_CM (10.0*POINTS_PER_MM) -#define POINTS_PER_PICA (1.0/12.0) - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -typedef struct { - xmlChar *name; - gdouble points_per_unit; -} UnitTableEntry; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -static UnitTableEntry unit_table[] = { - - /* These names are identical to the absolute length units supported in - the CSS2 Specification (Section 4.3.2) */ - - /* This table must be sorted exactly as the enumerations in lglUnitsType */ - - /* [LGL_UNITS_POINT] */ {(xmlChar *)"pt", POINTS_PER_POINT}, - /* [LGL_UNITS_INCH] */ {(xmlChar *)"in", POINTS_PER_INCH}, - /* [LGL_UNITS_MM] */ {(xmlChar *)"mm", POINTS_PER_MM}, - /* [LGL_UNITS_CM] */ {(xmlChar *)"cm", POINTS_PER_CM}, - /* [LGL_UNITS_PICA] */ {(xmlChar *)"pc", POINTS_PER_PICA}, - -}; - -static lglUnitsType default_units = LGL_UNITS_POINT; - - -/****************************************************************************/ - -/** - * lgl_xml_get_prop_string: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @default_val: a default value to return if property not found - * - * Return value of property as a string. - * - * Returns: the property as a pointer to a gchar string. This string should - * be freed with g_free(). - * - */ -gchar * -lgl_xml_get_prop_string (xmlNodePtr node, - const gchar *property, - const gchar *default_val) -{ - gchar *val; - xmlChar *string; - - string = xmlGetProp (node, (xmlChar *)property); - if ( string != NULL ) { - val = g_strdup ((gchar *)string); - xmlFree (string); - return val; - } - - if (default_val) { - return g_strdup (default_val); - } - - return NULL; -} - - -/** - * lgl_xml_get_prop_i18n_string: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @default_val: a default value to return if property not found - * - * Return value of a translatable property as a string. - * - * Returns: the property as a pointer to a gchar string. This string should - * be freed with g_free(). - * - */ -gchar * -lgl_xml_get_prop_i18n_string (xmlNodePtr node, - const gchar *property, - const gchar *default_val) -{ - gchar *_property; - gchar *val; - xmlChar *string; - - _property = g_strdup_printf ("_%s", property); - string = xmlGetProp (node, (xmlChar *)_property); - g_free (_property); - - if ( string != NULL ) { - - val = g_strdup (gettext ((char *)string)); - xmlFree (string); - return val; - - } - - string = xmlGetProp (node, (xmlChar *)property); - if ( string != NULL ) { - val = g_strdup ((gchar *)string); - xmlFree (string); - return val; - } - - if (default_val) { - return g_strdup (default_val); - } - - return NULL; -} - - -/** - * lgl_xml_get_prop_double: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @default_val: a default value to return if property not found - * - * Return value of property as a double. - * - * Returns: the property as a double. - * - */ -gdouble -lgl_xml_get_prop_double (xmlNodePtr node, - const gchar *property, - gdouble default_val) -{ - gdouble val; - xmlChar *string; - - string = xmlGetProp (node, (xmlChar *)property); - if ( string != NULL ) { - val = g_strtod ((gchar *)string, NULL); - xmlFree (string); - return val; - } - - return default_val; -} - - -/** - * lgl_xml_get_prop_boolean: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @default_val: a default value to return if property not found - * - * Return value of property as a boolean. - * - * Returns: the property as a boolean. - * - */ -gboolean -lgl_xml_get_prop_boolean (xmlNodePtr node, - const gchar *property, - gboolean default_val) -{ - gboolean val; - xmlChar *string; - - string = xmlGetProp (node, (xmlChar *)property); - if ( string != NULL ) { - val = !((xmlStrcasecmp (string, (xmlChar *)"false") == 0) || - xmlStrEqual (string, (xmlChar *)"0"));; - xmlFree (string); - return val; - } - - return default_val; -} - - -/** - * lgl_xml_get_prop_int: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @default_val: a default value to return if property not found - * - * Return value of property as an integer. - * - * Returns: the property as an integer. - * - */ -gint -lgl_xml_get_prop_int (xmlNodePtr node, - const gchar *property, - gint default_val) -{ - gint val; - xmlChar *string; - - string = xmlGetProp (node, (xmlChar *)property); - if ( string != NULL ) { - val = strtol ((char *)string, NULL, 0); - xmlFree (string); - return val; - } - - return default_val; -} - - -/** - * lgl_xml_get_prop_uint: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @default_val: a default value to return if property not found - * - * Return value of property (usually formatted in hex) as an unsigned integer. - * - * Returns: the property as an unsigned integer. - * - */ -guint -lgl_xml_get_prop_uint (xmlNodePtr node, - const gchar *property, - guint default_val) -{ - guint val; - xmlChar *string; - - string = xmlGetProp (node, (xmlChar *)property); - if ( string != NULL ) { - val = strtoul ((char *)string, NULL, 0); - xmlFree (string); - return val; - } - - return default_val; -} - - -/** - * lgl_xml_get_prop_length: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @default_val: a default value to return if property not found - * - * Return value of a length property as a double, converting to internal - * units (points). The property is expected to be formatted as a number - * followed by a units string. If there is no units string, the length - * is assumed to be in points. Valid units strings are "pt" for points, - * "in" for inches, "mm" for millimeters, "cm" for centimeters, and - * "pc" for picas. - * - * Returns: the length in points. - * - */ -gdouble -lgl_xml_get_prop_length (xmlNodePtr node, - const gchar *property, - gdouble default_val) -{ - gdouble val; - xmlChar *string; - xmlChar *unit; - gint i; - - string = xmlGetProp (node, (xmlChar *)property); - if ( string != NULL ) { - - val = g_strtod ((gchar *)string, (gchar **)&unit); - - if (unit != string) { - unit = (xmlChar *)g_strchug ((gchar *)unit); - if (strlen ((char *)unit) > 0 ) { - for (i=LGL_UNITS_FIRST; i<=LGL_UNITS_LAST; i++) { - if (xmlStrcasecmp (unit, unit_table[i].name) == 0) { - val *= unit_table[i].points_per_unit; - break; - } - } - if (i>LGL_UNITS_LAST) { - g_message ("Line %ld, Node \"%s\", Property \"%s\": Unknown unit \"%s\", assuming points", - xmlGetLineNo (node), node->name, property, - unit); - } - } - } - else { - val = 0.0; - } - - xmlFree (string); - return val; - } - - return default_val; -} - - -/** - * lgl_xml_set_prop_string: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @val: the value to set - * - * Set a property from a string. - * - */ -void -lgl_xml_set_prop_string (xmlNodePtr node, - const gchar *property, - const gchar *val) -{ - if (val != NULL) { - xmlSetProp (node, (xmlChar *)property, (xmlChar *)val); - } -} - - -/** - * lgl_xml_set_prop_double: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @val: the value to set - * - * Set a property from a double. - * - */ -void -lgl_xml_set_prop_double (xmlNodePtr node, - const gchar *property, - gdouble val) -{ - gchar *string, buffer[G_ASCII_DTOSTR_BUF_SIZE]; - - /* Guarantee "C" locale by use of g_ascii_formatd */ - string = g_ascii_formatd (buffer, G_ASCII_DTOSTR_BUF_SIZE, "%g", val); - - xmlSetProp (node, (xmlChar *)property, (xmlChar *)string); -} - - -/** - * lgl_xml_set_prop_boolean: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @val: the value to set - * - * Set a property from a boolean. - * - */ -void -lgl_xml_set_prop_boolean (xmlNodePtr node, - const gchar *property, - gboolean val) -{ - xmlSetProp (node, (xmlChar *)property, (xmlChar *)(val ? "True" : "False")); -} - -/** - * lgl_xml_set_prop_int: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @val: the value to set - * - * Set a property from an integer. - * - */ -void -lgl_xml_set_prop_int (xmlNodePtr node, - const gchar *property, - gint val) -{ - gchar *string; - - string = g_strdup_printf ("%d", val); - xmlSetProp (node, (xmlChar *)property, (xmlChar *)string); - g_free (string); -} - -/** - * lgl_xml_set_prop_uint_hex: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @val: the value to set - * - * Set a property from an unsigned integer and format in hex. - * - */ -void -lgl_xml_set_prop_uint_hex (xmlNodePtr node, - const gchar *property, - guint val) -{ - gchar *string; - - string = g_strdup_printf ("0x%08x", val); - xmlSetProp (node, (xmlChar *)property, (xmlChar *)string); - g_free (string); -} - -/** - * lgl_xml_set_prop_length: - * @node: the libxml2 #xmlNodePtr of the node - * @property: the property name - * @val: the length to set in internal units (points) - * - * Set a property from a length, performing any necessary conversion. - * Length properties are formatted as a number followed by a units string. - * The units of the formatted property is determined by the most recent call to - * lgl_xml_set_default_units(). - * - */ -void -lgl_xml_set_prop_length (xmlNodePtr node, - const gchar *property, - gdouble val) -{ - gchar *string, buffer[G_ASCII_DTOSTR_BUF_SIZE]; - gchar *string_unit; - - /* Convert to default units */ - val /= unit_table[default_units].points_per_unit; - - /* Guarantee "C" locale by use of g_ascii_formatd */ - string = g_ascii_formatd (buffer, G_ASCII_DTOSTR_BUF_SIZE, "%g", val); - - string_unit = g_strdup_printf ("%s%s", string, unit_table[default_units].name); - xmlSetProp (node, (xmlChar *)property, (xmlChar *)string_unit); - g_free (string_unit); -} - -/** - * lgl_xml_is_node - * @node: the libxml2 #xmlNodePtr of the node - * @name : the node name - * - * Test if a node name matches given name. - * - * Returns: TRUE if the name of the node matches. Otherwise FALSE. - * - */ -gboolean -lgl_xml_is_node (xmlNodePtr node, - const gchar *name) -{ - return xmlStrEqual (node->name, (xmlChar *)name); -} - - -/** - * lgl_xml_get_node_content - * @node: the libxml2 #xmlNodePtr of the node - * - * Get the content of a node. - * - * Returns: the property as a pointer to a gchar string. This string should - * be freed with g_free(). - */ -gchar * -lgl_xml_get_node_content (xmlNodePtr node) -{ - xmlChar *xml_content; - gchar *g_content; - - xml_content = xmlNodeGetContent (node); - - if (xml_content != NULL) { - - g_content = g_strdup ((gchar *)xml_content); - xmlFree (xml_content); - return g_content; - - } - - return NULL; -} - - -/** - * lgl_xml_set_default_units: - * @units: default units selection (#lglUnitsType) - * - * Set the default units when formatting lengths. See - * lgl_xml_set_prop_length(). - * - */ -void -lgl_xml_set_default_units (lglUnitsType units) -{ - g_return_if_fail ((units >= LGL_UNITS_FIRST) && (units <= LGL_UNITS_LAST)); - - default_units = units; -} - - diff --git a/glabels2/libglabels/xml.h b/glabels2/libglabels/xml.h deleted file mode 100644 index 3ef2e495..00000000 --- a/glabels2/libglabels/xml.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * (LIBGLABELS) Template library for GLABELS - * - * xml.h: GLabels xml utilities header file - * - * Copyright (C) 2003, 2004 Jim Evins . - * - * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA - */ - -#ifndef __XML_H__ -#define __XML_H__ - -#include -#include - -#include "enums.h" - -#define LGL_XML_NAME_SPACE "http://snaught.com/glabels/2.2/" - -G_BEGIN_DECLS - -/* - * Get property functions - */ -gchar * lgl_xml_get_prop_string (xmlNodePtr node, - const gchar *property, - const gchar *default_val); - -gchar * lgl_xml_get_prop_i18n_string (xmlNodePtr node, - const gchar *property, - const gchar *default_val); - -gdouble lgl_xml_get_prop_double (xmlNodePtr node, - const gchar *property, - gdouble default_val); - -gboolean lgl_xml_get_prop_boolean (xmlNodePtr node, - const gchar *property, - gboolean default_val); - -gint lgl_xml_get_prop_int (xmlNodePtr node, - const gchar *property, - gint default_val); - -guint lgl_xml_get_prop_uint (xmlNodePtr node, - const gchar *property, - guint default_val); - -gdouble lgl_xml_get_prop_length (xmlNodePtr node, - const gchar *property, - gdouble default_val); - - -/* - * Set property functions - */ -void lgl_xml_set_prop_string (xmlNodePtr node, - const gchar *property, - const gchar *val); - -void lgl_xml_set_prop_double (xmlNodePtr node, - const gchar *property, - gdouble val); - -void lgl_xml_set_prop_boolean (xmlNodePtr node, - const gchar *property, - gboolean val); - -void lgl_xml_set_prop_int (xmlNodePtr node, - const gchar *property, - gint val); - -void lgl_xml_set_prop_uint_hex (xmlNodePtr node, - const gchar *property, - guint val); - -void lgl_xml_set_prop_length (xmlNodePtr node, - const gchar *property, - gdouble val); - -/* - * Other node functions - */ -gboolean lgl_xml_is_node (xmlNodePtr node, - const gchar *name); - -gchar * lgl_xml_get_node_content (xmlNodePtr node); - -/* - * Misc functions - */ -void lgl_xml_set_default_units (lglUnitsType units); - -G_END_DECLS - - -#endif /* __XML_H__ */ diff --git a/glabels2/po/POTFILES.in b/glabels2/po/POTFILES.in deleted file mode 100644 index 65db50a5..00000000 --- a/glabels2/po/POTFILES.in +++ /dev/null @@ -1,186 +0,0 @@ -# List of source files containing translatable strings. - -src/glabels.c -src/glabels-batch.c -src/window.c -src/window.h -src/stock.c -src/stock.h -src/ui.h -src/ui.c -src/ui-property-bar.h -src/ui-property-bar.c -src/ui-sidebar.h -src/ui-sidebar.c -src/ui-util.h -src/ui-util.c -src/ui-commands.h -src/ui-commands.c -src/file.h -src/file.c -src/recent.h -src/recent.c -src/prefs.c -src/prefs.h -src/prefs-model.c -src/prefs-model.h -src/prefs-dialog.c -src/prefs-dialog.h -src/hig.h -src/view.c -src/view.h -src/view-object.c -src/view-object.h -src/view-box.c -src/view-box.h -src/view-ellipse.c -src/view-ellipse.h -src/view-line.c -src/view-line.h -src/view-image.c -src/view-image.h -src/view-text.c -src/view-text.h -src/view-barcode.c -src/view-barcode.h -src/object-editor.c -src/object-editor.h -src/object-editor-private.h -src/object-editor-bc-page.c -src/object-editor-data-page.c -src/object-editor-edit-page.c -src/object-editor-fill-page.c -src/object-editor-image-page.c -src/object-editor-line-page.c -src/object-editor-lsize-page.c -src/object-editor-position-page.c -src/object-editor-size-page.c -src/object-editor-text-page.c -src/merge-properties-dialog.c -src/merge-properties-dialog.h -src/print.c -src/print.h -src/print-op.c -src/template-designer.c -src/template-designer.h -src/bc.c -src/bc.h -src/bc-gnubarcode.c -src/bc-gnubarcode.h -src/bc-postnet.c -src/bc-postnet.h -src/label.c -src/label.h -src/label-object.c -src/label-object.h -src/label-text.c -src/label-text.h -src/label-box.c -src/label-box.h -src/label-line.c -src/label-line.h -src/label-ellipse.c -src/label-ellipse.h -src/label-image.c -src/label-image.h -src/label-barcode.c -src/label-barcode.h -src/xml-label.c -src/xml-label.h -src/xml-label-04.c -src/xml-label-04.h -src/pixbuf-cache.c -src/pixbuf-cache.h -src/base64.c -src/base64.h -src/merge.c -src/merge.h -src/merge-init.c -src/merge-init.h -src/merge-text.c -src/merge-text.h -src/merge-evolution.c -src/text-node.c -src/text-node.h -src/wdgt-print-copies.c -src/wdgt-print-copies.h -src/wdgt-print-merge.c -src/wdgt-print-merge.h -src/wdgt-media-select.c -src/wdgt-media-select.h -src/wdgt-mini-preview.c -src/wdgt-mini-preview.h -src/wdgt-rotate-label.c -src/wdgt-rotate-label.h -src/wdgt-chain-button.c -src/wdgt-chain-button.h -src/util.c -src/util.h -src/color.c -src/color.h -src/debug.c -src/debug.h -src/mygal/color-group.c -src/mygal/color-group.h -src/mygal/color-palette.c -src/mygal/color-palette.h -src/mygal/e-colors.c -src/mygal/e-colors.h -src/mygal/e-util.h -src/mygal/mygal-combo-box.c -src/mygal/mygal-combo-box.h -src/mygal/widget-color-combo.c -src/mygal/widget-color-combo.h -src/critical-error-handler.c -src/warning-handler.c - -libglabels/category.c -libglabels/category.h -libglabels/db.c -libglabels/db.h -libglabels/enums.h -libglabels/libglabels.h -libglabels/libglabels-private.h -libglabels/paper.c -libglabels/paper.h -libglabels/str.c -libglabels/str.h -libglabels/template.c -libglabels/template.h -libglabels/xml.c -libglabels/xml.h -libglabels/xml-category.c -libglabels/xml-category.h -libglabels/xml-paper.c -libglabels/xml-paper.h -libglabels/xml-template.c -libglabels/xml-template.h - -data/glade/merge-properties-dialog.glade -data/glade/new-label-dialog.glade -data/glade/object-editor.glade -data/glade/prefs-dialog.glade -data/glade/print-custom-widget.glade -data/glade/property-bar.glade -data/glade/template-designer.glade -data/glade/wdgt-media-select.glade -data/glade/wdgt-rotate-label.glade - -data/templates/paper-sizes.xml -data/templates/categories.xml -data/templates/avery-iso-templates.xml -data/templates/avery-other-templates.xml -data/templates/avery-us-templates.xml -data/templates/brother-other-templates.xml -data/templates/dymo-other-templates.xml -data/templates/misc-iso-templates.xml -data/templates/misc-other-templates.xml -data/templates/misc-us-templates.xml -data/templates/zweckform-iso-templates.xml - -data/desktop/glabels.desktop.in - -data/mime/glabels.keys.in -data/mime/glabels.xml.in - -barcode-0.98/compat/getopt.c diff --git a/glabels2/po/cs.po b/glabels2/po/cs.po deleted file mode 100644 index 83b65caa..00000000 --- a/glabels2/po/cs.po +++ /dev/null @@ -1,2484 +0,0 @@ -# cs translation of Glabels. -# Copyright (C) 2005 THE Glabels'S COPYRIGHT HOLDER -# This file is distributed under the same license as the Glabels package. -# David Makovský (Yakeen) , 2005 -# Zbynek Mrkvicka , 2005 -# -msgid "" -msgstr "" -"Project-Id-Version: Glabels 2.0.2\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-22 11:49-0500\n" -"PO-Revision-Date: 2005-02-02 21:35+0100\n" -"Last-Translator: David Makovský (Yakeen) \n" -"Language-Team: cs \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit" - -#: src/glabels.c:116 -msgid "Could not initialize Bonobo!\n" -msgstr "Nepodařila se inicializace Bonobo serveru!\n" - -#: src/glabels-batch.c:52 -msgid "print this message" -msgstr "tisk této zprávy" - -#: src/glabels-batch.c:54 -msgid "print the version of glabels-batch being used" -msgstr "vypíše verzi glabels-batch, která je používána" - -#: src/glabels-batch.c:56 -msgid "set output filename (default=\"output.ps\")" -msgstr "nastavte jméno souboru výstupu (standartně=\"output.ps\")" - -#: src/glabels-batch.c:56 src/glabels-batch.c:70 -msgid "filename" -msgstr "název souboru" - -#: src/glabels-batch.c:58 -msgid "number of sheets (default=1)" -msgstr "počet stránek (standartně=1)" - -#: src/glabels-batch.c:58 -msgid "sheets" -msgstr "seÅ¡ity" - -#: src/glabels-batch.c:60 -msgid "number of copies (default=1)" -msgstr "počet kopií (standartní nastavení = 1)" - -#: src/glabels-batch.c:60 -msgid "copies" -msgstr "kopie" - -#: src/glabels-batch.c:62 -msgid "first label on first sheet (default=1)" -msgstr "první etiketa na prvním listu (standartně=1)" - -#: src/glabels-batch.c:62 -msgid "first" -msgstr "první" - -#: src/glabels-batch.c:64 src/print-dialog.c:336 -msgid "print outlines (to test printer alignment)" -msgstr "tisk obrysů (test zarovnávání tiskárny)" - -#: src/glabels-batch.c:66 src/print-dialog.c:344 -msgid "print in reverse (i.e. a mirror image)" -msgstr "obrácený tisk (např. převrácený obrázek)" - -#: src/glabels-batch.c:68 src/print-dialog.c:351 -msgid "print crop marks" -msgstr "tisknout značky pro ořez" - -#: src/glabels-batch.c:70 -msgid "input file for merging" -msgstr "vstupní soubor pro sloučení" - -#: src/glabels-batch.c:107 -msgid "[OPTION...] GLABELS_FILE..." -msgstr "" - -#: src/glabels-batch.c:127 -#, c-format -msgid "missing glabels file\n" -msgstr "chybí soubor programu glabels\n" - -#: src/glabels-batch.c:158 -#, c-format -msgid "cannot perform document merge with glabels file %s\n" -msgstr "" - -#: src/glabels-batch.c:182 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "nepodařilo se otevřít soubor programu glabels %s\n" - -#: src/window.c:244 -msgid "(none) - gLabels" -msgstr "(žádný) - gLabels" - -#: src/window.c:414 -msgid "(modified)" -msgstr "(modifikováno)" - -#: src/stock.c:65 data/ui/glabels-ui.xml.h:162 -msgid "_Select Mode" -msgstr "Mód výběru" - -#: src/stock.c:66 data/ui/glabels-ui.xml.h:163 -msgid "_Text" -msgstr "_Text" - -#: src/stock.c:67 data/ui/glabels-ui.xml.h:148 -msgid "_Line" -msgstr "Čár_a" - -#: src/stock.c:68 data/ui/glabels-ui.xml.h:130 -msgid "_Box" -msgstr "O_bdélník" - -#: src/stock.c:69 data/ui/glabels-ui.xml.h:141 -msgid "_Ellipse" -msgstr "_Elipsa" - -#: src/stock.c:70 data/ui/glabels-ui.xml.h:146 -msgid "_Image" -msgstr "Obrá_zek" - -#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 -msgid "Bar_code" -msgstr "Čárový _kód" - -#: src/stock.c:72 -msgid "_Merge Properties" -msgstr "Vlastnosti sloučení" - -#: src/stock.c:73 -msgid "Object _Properties" -msgstr "Nastavení objektu" - -#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 -msgid "Bring to _Front" -msgstr "Vynést dopředu" - -#: src/stock.c:75 data/ui/glabels-ui.xml.h:109 -msgid "Send to _Back" -msgstr "Poslat _dozadu" - -#: src/stock.c:76 data/ui/glabels-ui.xml.h:96 -msgid "Rotate _Left" -msgstr "Otočit do_leva" - -#: src/stock.c:77 data/ui/glabels-ui.xml.h:97 -msgid "Rotate _Right" -msgstr "Otočit do_prava" - -#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 -msgid "Flip _Horizontally" -msgstr "Převrátit _vodorovně" - -#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 -msgid "Flip _Vertically" -msgstr "Převrátit _svisle" - -#: src/stock.c:80 data/ui/glabels-ui.xml.h:147 -msgid "_Lefts" -msgstr "Nalevo" - -#: src/stock.c:81 data/ui/glabels-ui.xml.h:159 -msgid "_Rights" -msgstr "Napravo" - -#: src/stock.c:82 data/ui/glabels-ui.xml.h:131 -msgid "_Centers" -msgstr "_Nastřed" - -#: src/stock.c:83 data/ui/glabels-ui.xml.h:164 -msgid "_Tops" -msgstr "Nahoru" - -#: src/stock.c:84 -msgid "Bottoms" -msgstr "Naspod" - -#: src/stock.c:85 -msgid "Centers" -msgstr "Nastřed" - -#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 -msgid "Label Ce_nter" -msgstr "Střed etikety" - -#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 -msgid "Fill color" -msgstr "Barva výplně" - -#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 -msgid "Line color" -msgstr "Barva čáry" - -#: src/stock.c:90 src/stock.c:92 -msgid "Linked" -msgstr "Spojeno" - -#: src/stock.c:91 src/stock.c:93 -msgid "Not Linked" -msgstr "Nespojeno" - -#: src/ui-property-bar.c:345 src/object-editor.c:499 -msgid "Default" -msgstr "Výchozí" - -#: src/ui-property-bar.c:360 src/object-editor.c:512 -msgid "No fill" -msgstr "Bez výplně" - -#: src/ui-property-bar.c:375 src/object-editor.c:505 -msgid "No line" -msgstr "" - -#: src/ui-sidebar.c:180 -msgid "Object properties" -msgstr "Vlastnosti objektu" - -#: src/commands.c:385 -msgid "" -"A label and business card creation program for GNOME.\n" -" \n" -"Glabels is free software; you can redistribute it and/or modify it under the " -"terms of the GNU General Public License as published by the Free Software " -"Foundation; either version 2 of the License, or (at your option) any later " -"version.\n" -" \n" -"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.\n" -msgstr "" -"Program pro tvorbu etiket a vizitek v prostředí GNOME.\n" -" \n" -"Glabels je svobodný software, můžete s ním nakládat podle GPL licence verze " -"2, nebo jakoukoliv pozdější.\n" -" \n" -"Program je distribuován s nadějí, že bude nápomocen, ale je distribuován bez " -"ručení záruky, tak jak je uvedeno v GPL Licenci verze 2. Pro další detaily " -"si přečtěte tuto licenci.\n" - -#: src/commands.c:399 -msgid "See the file AUTHORS for additional credits," -msgstr "Prohlédněte si soubor AUTHORS pro dodatečné informace," - -#: src/commands.c:400 -msgid "or visit http://glabels.sourceforge.net/" -msgstr "nebo navÅ¡tivte http://glabels.sourceforge.net/" - -#: src/commands.c:409 -msgid " " -msgstr "" - -#: src/commands.c:424 -msgid "glabels" -msgstr "glabels" - -#: src/file.c:100 -msgid "New Label or Card" -msgstr "Nová etiketa či vizitka" - -#: src/file.c:132 src/file.c:304 -msgid "Media Type" -msgstr "Typ média" - -#: src/file.c:138 src/file.c:310 -msgid "Label orientation" -msgstr "Orientace etikety" - -#: src/file.c:269 -msgid "Label properties" -msgstr "Vlastnosti etikety" - -#: src/file.c:452 src/file.c:870 -msgid "All files" -msgstr "VÅ¡echny soubory" - -#: src/file.c:457 src/file.c:875 -msgid "gLabels documents" -msgstr "Dokumenty gLabels" - -#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 -msgid "Empty file name selection" -msgstr "Prázdné pole jména souboru" - -#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 -msgid "Please select a file or supply a valid file name" -msgstr "Vyberte, prosím, soubor, nebo vypiÅ¡te platné jméno souboru" - -#: src/file.c:519 src/file.c:631 -msgid "File does not exist" -msgstr "Soubor neexistuje" - -#: src/file.c:563 data/ui/glabels-ui.xml.h:74 -msgid "Open" -msgstr "Otevřít" - -#: src/file.c:565 -msgid "Open label" -msgstr "Otevřít etiketu" - -#: src/file.c:707 -#, c-format -msgid "Could not open file \"%s\"" -msgstr "nepodařilo se otevřít soubor \"%s\"" - -#: src/file.c:715 -msgid "Not a supported file format" -msgstr "Formát tohoto souboru není podporován" - -#: src/file.c:797 src/file.c:979 src/file.c:1174 -#, c-format -msgid "Could not save file \"%s\"" -msgstr "Nepodařilo se uložit soubor \"%s\"" - -#: src/file.c:805 src/file.c:987 src/file.c:1182 -msgid "Error encountered during save. The file is still not saved." -msgstr "Při ukládání se vyskytla chyba. Soubor nebyl uložen." - -#: src/file.c:848 src/file.c:1048 -#, c-format -msgid "Save \"%s\" as" -msgstr "Uložit \"%s\" jako" - -#: src/file.c:935 src/file.c:1131 -msgid "Please supply a valid file name" -msgstr "Prosím vepiÅ¡te platné jméno souboru" - -#: src/file.c:952 src/file.c:1147 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "Přepsat soubor \"%s\"?" - -#: src/file.c:960 src/file.c:1155 -msgid "File already exists." -msgstr "Soubor již existuje." - -#: src/file.c:1271 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "Uložit před zavřením změny v dokumentu \"%s\"?" - -#: src/file.c:1279 -msgid "Your changes will be lost if you don't save them." -msgstr "VaÅ¡e změny budou ztraceny pokud je neuložíte." - -#: src/file.c:1282 -msgid "Close without saving" -msgstr "Zavřít bez uložení" - -#. Should not happen -#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 -#: data/glade/object-editor.glade.h:37 -msgid "points" -msgstr "bodů" - -#: src/prefs.c:158 data/glade/object-editor.glade.h:36 -#: data/glade/template-designer.glade.h:74 -msgid "inches" -msgstr "palce" - -#: src/prefs.c:160 -msgid "mm" -msgstr "mm" - -#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 -msgid "gLabels Preferences" -msgstr "Nastavení programu gLabels" - -#. -#. * Submenu: Order -#. -#: src/view.c:3574 data/ui/glabels-ui.xml.h:154 -msgid "_Order" -msgstr "_Pořadí" - -#. -#. * Submenu: Rotate/Flip -#. -#: src/view.c:3595 data/ui/glabels-ui.xml.h:160 -msgid "_Rotate/Flip" -msgstr "_Rotace/Převrácení" - -#. -#. * Submenu: Align Horizontally -#. -#: src/view.c:3628 -msgid "Align _Horizontally" -msgstr "Zarovnat _vodorovně" - -#. -#. * Submenu: Align Vertically -#. -#: src/view.c:3667 -msgid "Align _Vertically" -msgstr "Zarovnat _svisle" - -#: src/view.c:3728 data/ui/glabels-ui.xml.h:137 -msgid "_Delete" -msgstr "_Smazat" - -#. Build editor. -#: src/view-box.c:224 -msgid "Box object properties" -msgstr "Vlastnosti obdélníku/čtverce" - -#. Build editor. -#: src/view-ellipse.c:224 -msgid "Ellipse object properties" -msgstr "Vlastnosti elipsy" - -#. Build editor. -#: src/view-line.c:224 -msgid "Line object properties" -msgstr "Vlastnosti čáry" - -#. Build editor. -#: src/view-image.c:223 -msgid "Image object properties" -msgstr "Vlastnosti obrázku" - -#. Build editor. -#: src/view-text.c:251 -msgid "Text object properties" -msgstr "Vlastnosti textu" - -#: src/view-text.c:563 data/glade/object-editor.glade.h:28 -msgid "Text" -msgstr "Text" - -#. Build editor. -#: src/view-barcode.c:210 -msgid "Barcode object properties" -msgstr "Vlastnosti čárového kódu" - -#: src/view-barcode.c:580 src/print.c:1089 -msgid "Invalid barcode data" -msgstr "Neplatná data čárového kódu" - -#: src/merge-properties-dialog.c:231 -msgid "Merge Properties" -msgstr "Nastavení sloučení" - -#. ---- Source section ---- -#: src/merge-properties-dialog.c:237 -msgid "Source" -msgstr "Zdroj" - -#: src/merge-properties-dialog.c:245 -msgid "Format:" -msgstr "Formát:" - -#. Location line -#: src/merge-properties-dialog.c:273 -msgid "Location:" -msgstr "Umístění:" - -#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 -msgid "Select merge-database source" -msgstr "Výběr databázového zdroje pro sloučení" - -#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 -msgid "N/A" -msgstr "Není k dispozici" - -#. ---- Sample Fields section ---- -#: src/merge-properties-dialog.c:300 -msgid "Record selection/preview:" -msgstr "Náhled na záznam výběru" - -#: src/merge-properties-dialog.c:326 -msgid "Select" -msgstr "Výběr" - -#: src/merge-properties-dialog.c:334 -msgid "Record/Field" -msgstr "Záznam/Pole" - -#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 -msgid "Data" -msgstr "Data" - -#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:81 -msgid "Print" -msgstr "Tisk" - -#: src/print-dialog.c:281 -msgid "_Job" -msgstr "Úloha" - -#: src/print-dialog.c:286 -msgid "P_rinter" -msgstr "_Tiskárna" - -#. ----------- Add simple-copies widget ------------ -#: src/print-dialog.c:314 -msgid "Copies" -msgstr "Kopie" - -#. ------- Add merge control widget ------------ -#: src/print-dialog.c:322 -msgid "Document merge control" -msgstr "Kontrola sloučení dokumentu" - -#. ----------- Add custom print options area ------------ -#: src/print-dialog.c:330 -msgid "Options" -msgstr "Možnosti" - -#: src/print-dialog.c:553 src/print-dialog.c:592 -msgid "Print preview" -msgstr "Náhled tisku" - -#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 -msgid "gLabels Template Designer" -msgstr "Návrhář Å¡ablon gLabels" - -#: src/bc.c:60 -msgid "POSTNET (any)" -msgstr "POSTNET (jakýkoli)" - -#: src/bc.c:63 -msgid "POSTNET-5 (ZIP only)" -msgstr "POSTNET-5 (pouze ZIP)" - -#: src/bc.c:66 -msgid "POSTNET-9 (ZIP+4)" -msgstr "" - -#: src/bc.c:69 -msgid "POSTNET-11 (DPBC)" -msgstr "" - -#: src/bc.c:72 -msgid "EAN (any)" -msgstr "EAN (jakýkoli)" - -#: src/bc.c:75 -msgid "EAN-8" -msgstr "" - -#: src/bc.c:78 -msgid "EAN-8 +2" -msgstr "" - -#: src/bc.c:81 -msgid "EAN-8 +5" -msgstr "" - -#: src/bc.c:84 -msgid "EAN-13" -msgstr "" - -#: src/bc.c:87 -msgid "EAN-13 +2" -msgstr "" - -#: src/bc.c:90 -msgid "EAN-13 +5" -msgstr "" - -#: src/bc.c:93 -msgid "UPC (UPC-A or UPC-E)" -msgstr "UPC (UPC-A nebo UPC-E)" - -#: src/bc.c:96 -msgid "UPC-A" -msgstr "" - -#: src/bc.c:99 -msgid "UPC-A +2" -msgstr "" - -#: src/bc.c:102 -msgid "UPC-A +5" -msgstr "" - -#: src/bc.c:105 -msgid "UPC-E" -msgstr "" - -#: src/bc.c:108 -msgid "UPC-E +2" -msgstr "" - -#: src/bc.c:111 -msgid "UPC-E +5" -msgstr "" - -#: src/bc.c:114 -msgid "ISBN" -msgstr "" - -#: src/bc.c:117 -msgid "ISBN +5" -msgstr "" - -#: src/bc.c:120 -msgid "Code 39" -msgstr "" - -#: src/bc.c:123 -msgid "Code 128" -msgstr "" - -#: src/bc.c:126 -msgid "Code 128C" -msgstr "" - -#: src/bc.c:129 -msgid "Code 128B" -msgstr "" - -#: src/bc.c:132 -msgid "Interleaved 2 of 5" -msgstr "" - -#: src/bc.c:135 -msgid "Codabar" -msgstr "" - -#: src/bc.c:138 -msgid "MSI" -msgstr "" - -#: src/bc.c:141 -msgid "Plessey" -msgstr "" - -#: src/label.c:569 -msgid "Untitled" -msgstr "Nepojmenovaný" - -#: src/xml-label.c:176 src/xml-label.c:213 -msgid "xmlParseFile error" -msgstr "chyba (xmlParseFile)" - -#: src/xml-label.c:250 -msgid "No document root" -msgstr "" - -#: src/xml-label.c:264 -msgid "Importing from glabels 0.1 format" -msgstr "Importuji formát glabels verze 0.1" - -#: src/xml-label.c:272 -msgid "Importing from glabels 0.4 format" -msgstr "Importuji formát glabels verze 0.4" - -#: src/xml-label.c:279 -msgid "Importing from glabels 1.91 format" -msgstr "Importuji formát glabels verze 1.91" - -#: src/xml-label.c:282 -msgid "bad document, unknown glabels Namespace" -msgstr "" - -#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "" - -#: src/xml-label.c:348 src/xml-label-191.c:165 -#, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "" - -#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 -#, c-format -msgid "bad node = \"%s\"" -msgstr "" - -#: src/xml-label.c:796 src/xml-label-191.c:605 -#, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "" - -#: src/xml-label.c:962 libglabels/xml-template.c:535 -msgid "Utf8 conversion error." -msgstr "Chyba při konverzi UTF-8" - -#: src/xml-label.c:969 libglabels/xml-template.c:542 -msgid "Problem saving xml file." -msgstr "Problém s ukládáním dat do xml." - -#. This should always be an id, but just in case a name -#. slips by! -#: src/xml-label-191.c:680 libglabels/xml-template.c:199 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "" - -#: src/xml-label-191.c:690 libglabels/xml-template.c:209 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "" - -#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 -msgid "None" -msgstr "Žádný" - -#: src/merge-init.c:53 -msgid "Text file with comma delimeters (CSV)" -msgstr "Text se středníky jako oddělovači sloupců (CSV)" - -#: src/merge-init.c:60 -msgid "Text file with colon delimeters" -msgstr "Text s dvojtečkami jako oddělovači sloupců" - -#: src/merge-init.c:67 -msgid "Text file with tab delimeters" -msgstr "Text s tabulátory jako oddělovači sloupců" - -#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 -msgid "File:" -msgstr "Soubor:" - -#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 -msgid "Key:" -msgstr "Klíč:" - -#: src/wdgt-print-copies.c:179 -msgid "Sheets:" -msgstr "Stránky:" - -#: src/wdgt-print-copies.c:197 -msgid "Labels" -msgstr "Etikety" - -#: src/wdgt-print-copies.c:200 -msgid "from:" -msgstr "od:" - -#: src/wdgt-print-copies.c:207 -msgid "to:" -msgstr "komu:" - -#: src/wdgt-print-merge.c:178 -msgid "Start on label" -msgstr "Začít na etiketě" - -#: src/wdgt-print-merge.c:186 -msgid "on 1st sheet" -msgstr "na první stránce" - -#: src/wdgt-print-merge.c:195 -msgid "Copies:" -msgstr "Kopie:" - -#: src/wdgt-print-merge.c:201 -msgid "Collate" -msgstr "Shromáždit" - -#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 -msgid "Description:" -msgstr "Popis:" - -#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 -msgid "Page size:" -msgstr "Velikost stránky:" - -#: src/wdgt-media-select.c:290 -msgid "Label size:" -msgstr "Velikost etikety:" - -#: src/wdgt-media-select.c:301 -msgid "Layout:" -msgstr "Rozvržení:" - -#: src/wdgt-media-select.c:578 -#, c-format -msgid "%d x %d (%d per sheet)" -msgstr "%d x %d (%d na stránku)" - -#: src/wdgt-media-select.c:582 -#, c-format -msgid "%d per sheet" -msgstr "%d na stránku" - -#: src/wdgt-media-select.c:614 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -#: src/wdgt-media-select.c:619 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 -#, c-format -msgid "%s %s diameter" -msgstr "%s %s průměr" - -#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 -#, c-format -msgid "%.5g %s diameter" -msgstr "%.5g %s průměr" - -#: src/wdgt-rotate-label.c:193 -msgid "Rotate" -msgstr "Rotovat" - -#. This is the default custom color -#: src/mygal/color-palette.c:396 -msgid "custom" -msgstr "vlastní" - -#. "Custom" color - we'll pop up a GnomeColorPicker -#: src/mygal/color-palette.c:438 -msgid "Custom Color:" -msgstr "Vlastní barva" - -#: src/mygal/color-palette.c:446 -msgid "Choose Custom Color" -msgstr "Vyberte vlastní barvu" - -#: src/mygal/color-palette.c:579 -msgid "black" -msgstr "černá" - -#: src/mygal/color-palette.c:580 -msgid "light brown" -msgstr "světle hnědá" - -#: src/mygal/color-palette.c:581 -msgid "brown gold" -msgstr "zlatohnědá" - -#: src/mygal/color-palette.c:582 -msgid "dark green #2" -msgstr "tmavě zelená #2" - -#: src/mygal/color-palette.c:583 -msgid "navy" -msgstr "námořnická modř" - -#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 -msgid "dark blue" -msgstr "tmavě modrá" - -#: src/mygal/color-palette.c:585 -msgid "purple #2" -msgstr "purpurová #2" - -#: src/mygal/color-palette.c:586 -msgid "very dark gray" -msgstr "velmi tmavě Å¡edá" - -#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 -msgid "dark red" -msgstr "tmavě červená" - -#: src/mygal/color-palette.c:590 -msgid "red-orange" -msgstr "červenooranžová" - -#: src/mygal/color-palette.c:591 -msgid "gold" -msgstr "zlatá" - -#: src/mygal/color-palette.c:592 -msgid "dark green" -msgstr "tmavě zelená" - -#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 -msgid "dull blue" -msgstr "mdlá modř" - -#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 -msgid "blue" -msgstr "modrá" - -#: src/mygal/color-palette.c:595 -msgid "dull purple" -msgstr "mdlý purpur" - -#: src/mygal/color-palette.c:596 -msgid "dark grey" -msgstr "tmavě Å¡edá" - -#: src/mygal/color-palette.c:599 -msgid "red" -msgstr "červená" - -#: src/mygal/color-palette.c:600 -msgid "orange" -msgstr "oranžová" - -#: src/mygal/color-palette.c:601 -msgid "lime" -msgstr "citrónová" - -#: src/mygal/color-palette.c:602 -msgid "dull green" -msgstr "mdlá zeleň" - -#: src/mygal/color-palette.c:603 -msgid "dull blue #2" -msgstr "mdlá modř #2" - -#: src/mygal/color-palette.c:604 -msgid "sky blue #2" -msgstr "nebeská modř #2" - -#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 -msgid "purple" -msgstr "purpurová" - -#: src/mygal/color-palette.c:606 -msgid "gray" -msgstr "Å¡edá" - -#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 -msgid "magenta" -msgstr "fialová" - -#: src/mygal/color-palette.c:610 -msgid "bright orange" -msgstr "jasně oranžová" - -#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 -msgid "yellow" -msgstr "žludá" - -#: src/mygal/color-palette.c:612 -msgid "green" -msgstr "zelená" - -#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 -msgid "cyan" -msgstr "azurová" - -#: src/mygal/color-palette.c:614 -msgid "bright blue" -msgstr "jasně modrá" - -#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 -msgid "red purple" -msgstr "červenofialová" - -#: src/mygal/color-palette.c:616 -msgid "light grey" -msgstr "světle Å¡edá" - -#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 -msgid "pink" -msgstr "růžová" - -#: src/mygal/color-palette.c:620 -msgid "light orange" -msgstr "světle oranžová" - -#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 -msgid "light yellow" -msgstr "světle žlutá" - -#: src/mygal/color-palette.c:622 -msgid "light green" -msgstr "světle zelená" - -#: src/mygal/color-palette.c:623 -msgid "light cyan" -msgstr "světle azurová" - -#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 -msgid "light blue" -msgstr "světle modrá" - -#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 -msgid "light purple" -msgstr "světle purpurová" - -#: src/mygal/color-palette.c:626 -msgid "white" -msgstr "bílá" - -#: src/mygal/color-palette.c:631 -msgid "purplish blue" -msgstr "fialovomodrá" - -#: src/mygal/color-palette.c:635 -msgid "dark purple" -msgstr "tmavě purpurová" - -#: src/mygal/color-palette.c:637 -msgid "sky blue" -msgstr "nebeská modř" - -#: libglabels/template.c:848 -#, c-format -msgid "Generic %s full page" -msgstr "" - -#: libglabels/template.c:897 -msgid "No template files found!" -msgstr "Nenalezeny Å¡ablony!" - -#. Create and append an "Other" entry. -#: libglabels/paper.c:67 -msgid "Other" -msgstr "Jiné" - -#: libglabels/paper.c:361 -msgid "No paper files found!" -msgstr "" - -#: data/ui/glabels-ui.xml.h:1 -msgid "About glabels" -msgstr "O programu glabels" - -#: data/ui/glabels-ui.xml.h:2 -msgid "About..." -msgstr "O programu" - -#: data/ui/glabels-ui.xml.h:3 -msgid "Align _Horizontal" -msgstr "Zarovnat _vodorovně" - -#: data/ui/glabels-ui.xml.h:4 -msgid "Align _Vertical" -msgstr "Zarovnat _svisle" - -#: data/ui/glabels-ui.xml.h:5 -msgid "Align objects to bottoms" -msgstr "Zarovnat objekty dolů" - -#: data/ui/glabels-ui.xml.h:6 -msgid "Align objects to horizontal centers" -msgstr "Zarovnat objekty vodorovně na střed" - -#: data/ui/glabels-ui.xml.h:7 -msgid "Align objects to left edges" -msgstr "Zarovnat objekty dle levého kraje" - -#: data/ui/glabels-ui.xml.h:8 -msgid "Align objects to right edges" -msgstr "Zarovnat objekty dle pravého kraje" - -#: data/ui/glabels-ui.xml.h:9 -msgid "Align objects to tops" -msgstr "Zarovnat objekty nahoru" - -#: data/ui/glabels-ui.xml.h:10 -msgid "Align objects to vertical centers" -msgstr "Zarovnat objekty svisle na střed" - -#: data/ui/glabels-ui.xml.h:12 -msgid "Bold" -msgstr "Tučně" - -#: data/ui/glabels-ui.xml.h:14 -msgid "Center align" -msgstr "Na střed" - -#: data/ui/glabels-ui.xml.h:15 -msgid "Center objects to horizontal label center" -msgstr "Vycentrovat objekty vodorovně na střed etikety" - -#: data/ui/glabels-ui.xml.h:16 -msgid "Center objects to vertical label center" -msgstr "Vycentrovat objekty svisle na střed etikety" - -#: data/ui/glabels-ui.xml.h:17 -msgid "Change the visibility of markup lines in the current window" -msgstr "Změnit viditelnost hraničních čar v okně" - -#: data/ui/glabels-ui.xml.h:18 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "Změnit viditelnost panelu kreslení v okně" - -#: data/ui/glabels-ui.xml.h:19 -msgid "Change the visibility of the grid in the current window" -msgstr "Změnit viditelnost mřížky v okně" - -#: data/ui/glabels-ui.xml.h:20 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "Změnit viditelnost hlavního panelu nástrojů v okně" - -#: data/ui/glabels-ui.xml.h:21 -msgid "Change the visibility of the property toolbar in the current window" -msgstr "Změnit viditelnost panelu vlastností v okně" - -#: data/ui/glabels-ui.xml.h:22 -msgid "Close" -msgstr "Zavřít" - -#: data/ui/glabels-ui.xml.h:23 -msgid "Close the current file" -msgstr "Zavřít tento soubor" - -#: data/ui/glabels-ui.xml.h:24 -msgid "Configure the application" -msgstr "Konfigurovat aplikaci" - -#: data/ui/glabels-ui.xml.h:25 -msgid "Contents" -msgstr "Obsah" - -#: data/ui/glabels-ui.xml.h:26 -msgid "Copy" -msgstr "Kopírovat" - -#: data/ui/glabels-ui.xml.h:27 -msgid "Copy the selection" -msgstr "Kopírovat výběr" - -#: data/ui/glabels-ui.xml.h:28 -msgid "Create a custom template" -msgstr "Vytvořit vlastní Å¡ablonu" - -#: data/ui/glabels-ui.xml.h:29 -msgid "Create a new document" -msgstr "Vytvořit nový dokument" - -#: data/ui/glabels-ui.xml.h:30 -msgid "Create barcode object" -msgstr "Vložit čárový kód" - -#: data/ui/glabels-ui.xml.h:31 -msgid "Create box/rectangle object" -msgstr "Vytvořit čtverec/obdélník" - -#: data/ui/glabels-ui.xml.h:32 -msgid "Create ellipse/circle object" -msgstr "Vytvořit elipsu/kruh" - -#: data/ui/glabels-ui.xml.h:33 -msgid "Create image object" -msgstr "Vložit obrázek" - -#: data/ui/glabels-ui.xml.h:34 -msgid "Create line object" -msgstr "Vložit čáru" - -#: data/ui/glabels-ui.xml.h:35 -msgid "Create text object" -msgstr "Vložit text" - -#: data/ui/glabels-ui.xml.h:36 -msgid "Cu_t" -msgstr "_Vyjmout" - -#: data/ui/glabels-ui.xml.h:37 -msgid "Customize" -msgstr "Přizpůsobit" - -#: data/ui/glabels-ui.xml.h:38 -msgid "Customize Drawing Toolbar" -msgstr "Přizpůsobit panel kreslení" - -#: data/ui/glabels-ui.xml.h:39 -msgid "Customize Main Toolbar" -msgstr "Přizpůsobit hlavní panel" - -#: data/ui/glabels-ui.xml.h:40 -msgid "Customize Property Toolbar" -msgstr "Přizpůsobit panel vlastností" - -#: data/ui/glabels-ui.xml.h:41 -msgid "Customize toolbars" -msgstr "Přizpůsobit panely" - -#: data/ui/glabels-ui.xml.h:42 -msgid "Cut" -msgstr "Vyjmout" - -#: data/ui/glabels-ui.xml.h:43 -msgid "Cut the selection" -msgstr "Vyjmout výběr" - -#: data/ui/glabels-ui.xml.h:44 -msgid "Decrease magnification" -msgstr "ZmenÅ¡it" - -#: data/ui/glabels-ui.xml.h:45 -msgid "Delete" -msgstr "Smazat" - -#: data/ui/glabels-ui.xml.h:46 -msgid "Delete the selected objects" -msgstr "Smazat vybrané objekty" - -#: data/ui/glabels-ui.xml.h:47 -msgid "Drawing toolbar" -msgstr "Panl kreslení" - -#: data/ui/glabels-ui.xml.h:48 -msgid "Dump XML" -msgstr "Vypsat XML" - -#: data/ui/glabels-ui.xml.h:49 -msgid "Dump the UI Xml description" -msgstr "Vypsat popis UI v XML" - -#: data/ui/glabels-ui.xml.h:50 -msgid "Edit merge properties" -msgstr "Upravit vlastnosti sloučení" - -#: data/ui/glabels-ui.xml.h:54 -msgid "Flip object horizontally" -msgstr "Převrátit objekt vodorovně" - -#: data/ui/glabels-ui.xml.h:55 -msgid "Flip object vertically" -msgstr "Převrátit objekt svisle" - -#: data/ui/glabels-ui.xml.h:56 -msgid "Font name" -msgstr "Název fontu" - -#: data/ui/glabels-ui.xml.h:57 -msgid "Font selector" -msgstr "Výběr fontu" - -#: data/ui/glabels-ui.xml.h:58 -msgid "Font size" -msgstr "Velikost fontu" - -#: data/ui/glabels-ui.xml.h:59 -msgid "Icon and _Text" -msgstr "Ikony a text" - -#: data/ui/glabels-ui.xml.h:60 -msgid "Increase magnification" -msgstr "ZvětÅ¡it" - -#: data/ui/glabels-ui.xml.h:61 -msgid "Italic" -msgstr "Kurzíva" - -#: data/ui/glabels-ui.xml.h:63 -msgid "Left align" -msgstr "Nalevo" - -#: data/ui/glabels-ui.xml.h:65 -msgid "Line width" -msgstr "Šířka čáry" - -#: data/ui/glabels-ui.xml.h:66 -msgid "Lower object to bottom" -msgstr "Poslat objekt dozadu" - -#: data/ui/glabels-ui.xml.h:67 -msgid "M_arkup" -msgstr "Ohraničení" - -#: data/ui/glabels-ui.xml.h:68 -msgid "Main toolbar" -msgstr "Hlavní panel" - -#: data/ui/glabels-ui.xml.h:69 -msgid "Markup" -msgstr "Ohraničení" - -#: data/ui/glabels-ui.xml.h:70 -msgid "Modify document properties" -msgstr "Upravit vlastnosti dokumentu" - -#: data/ui/glabels-ui.xml.h:71 -msgid "New" -msgstr "Nový" - -#: data/ui/glabels-ui.xml.h:72 -msgid "Object property editor" -msgstr "Editor vlastností objektu" - -#: data/ui/glabels-ui.xml.h:73 -msgid "Only show icons in the main toolbar" -msgstr "Zobraz v hlavním panelu jen ikony" - -#: data/ui/glabels-ui.xml.h:75 -msgid "Open a file" -msgstr "Otevřít soubor" - -#: data/ui/glabels-ui.xml.h:76 -msgid "Open the glabels manual" -msgstr "Otevřít mauál programu" - -#: data/ui/glabels-ui.xml.h:77 -msgid "Paste" -msgstr "Vložit" - -#: data/ui/glabels-ui.xml.h:78 -msgid "Paste the clipboard" -msgstr "Vložit ze schránky" - -#: data/ui/glabels-ui.xml.h:79 -msgid "Pr_eferences..." -msgstr "_Nastavení" - -#: data/ui/glabels-ui.xml.h:80 -msgid "Preferences" -msgstr "Nastavení" - -#: data/ui/glabels-ui.xml.h:82 -msgid "Print the current file" -msgstr "Tisk tohoto souboru" - -#: data/ui/glabels-ui.xml.h:83 -msgid "Proper_ties..." -msgstr "Nas_tavení..." - -#: data/ui/glabels-ui.xml.h:84 -msgid "Properties" -msgstr "Nastavení" - -#: data/ui/glabels-ui.xml.h:85 -msgid "Property toolbar" -msgstr "Panel vlastností" - -#: data/ui/glabels-ui.xml.h:86 -msgid "Quit" -msgstr "Konec" - -#: data/ui/glabels-ui.xml.h:87 -msgid "Quit the program" -msgstr "Ukončit program" - -#: data/ui/glabels-ui.xml.h:88 -msgid "Raise object to top" -msgstr "Vynést objekt dopředu" - -#: data/ui/glabels-ui.xml.h:89 -msgid "Recent _Files" -msgstr "Otevřít nedávné" - -#: data/ui/glabels-ui.xml.h:90 -msgid "Redo" -msgstr "Znovu" - -#: data/ui/glabels-ui.xml.h:91 -msgid "Redo the undone action" -msgstr "Provést znovu vrácenou akci" - -#: data/ui/glabels-ui.xml.h:92 -msgid "Remove all selections" -msgstr "Odstranit vÅ¡echna označení" - -#: data/ui/glabels-ui.xml.h:94 -#, no-c-format -msgid "Restore scale to 100%" -msgstr "Vrátit měřítko na 100%" - -#: data/ui/glabels-ui.xml.h:95 -msgid "Right align" -msgstr "Napravo" - -#: data/ui/glabels-ui.xml.h:98 -msgid "Rotate object 90 clockwise" -msgstr "Otočit objekt o 90° po směru hodinových ručiček" - -#: data/ui/glabels-ui.xml.h:99 -msgid "Rotate object 90 counter-clockwise" -msgstr "Otočit objekt o 90° proti směru hodinových ručiček" - -#: data/ui/glabels-ui.xml.h:100 -msgid "Save" -msgstr "Uložit" - -#: data/ui/glabels-ui.xml.h:101 -msgid "Save As" -msgstr "Uložit jako" - -#: data/ui/glabels-ui.xml.h:102 -msgid "Save _As..." -msgstr "Uložit _jako..." - -#: data/ui/glabels-ui.xml.h:103 -msgid "Save the current file" -msgstr "Uložit tento soubor" - -#: data/ui/glabels-ui.xml.h:104 -msgid "Save the current file with a different name" -msgstr "Uložit tento soubor s jiným jménem" - -#: data/ui/glabels-ui.xml.h:105 -msgid "Select All" -msgstr "Vybrat vÅ¡e" - -#: data/ui/glabels-ui.xml.h:106 -msgid "Select _All" -msgstr "Vybr_at vÅ¡e" - -#: data/ui/glabels-ui.xml.h:107 -msgid "Select all objects" -msgstr "Vybrat vÅ¡echny objekty" - -#: data/ui/glabels-ui.xml.h:108 -msgid "Select, move and modify objects" -msgstr "Označení, posun a změna objektů" - -#: data/ui/glabels-ui.xml.h:110 -msgid "Set main toolbar button style according to desktop default" -msgstr "" -"Nastavit tlačítka na hlavním panelu stejně jako je základní nastavení " -"prostředí" - -#: data/ui/glabels-ui.xml.h:111 -msgid "Show _Tooltips" -msgstr "Ukazovat tipy" - -#: data/ui/glabels-ui.xml.h:112 -msgid "Show both icons and texts in the main toolbar" -msgstr "Zobrazit ikony a popisy v hlavní nástrojové liÅ¡tě" - -#: data/ui/glabels-ui.xml.h:113 -msgid "Show tooltips in the drawing toolbar" -msgstr "Ukazovat tipy v panelu kreslení" - -#: data/ui/glabels-ui.xml.h:114 -msgid "Show tooltips in the main toolbar" -msgstr "Ukazovat tipy v hlavním panelu" - -#: data/ui/glabels-ui.xml.h:115 -msgid "Show tooltips in the property toolbar" -msgstr "Ukazovat tipy v panelu vlastností" - -#: data/ui/glabels-ui.xml.h:116 -msgid "Template Designer" -msgstr "Návrhář Å¡ablon" - -#: data/ui/glabels-ui.xml.h:117 -msgid "Template _Designer..." -msgstr "Návrhář Å¡_ablon..." - -#: data/ui/glabels-ui.xml.h:118 -msgid "Text color" -msgstr "Barva textu" - -#: data/ui/glabels-ui.xml.h:119 -msgid "U_n-select All" -msgstr "Odz_načit vÅ¡e" - -#: data/ui/glabels-ui.xml.h:120 -msgid "Un-select All" -msgstr "Odznačit vÅ¡e" - -#: data/ui/glabels-ui.xml.h:121 -msgid "Undo" -msgstr "Zpět" - -#: data/ui/glabels-ui.xml.h:122 -msgid "Undo the last action" -msgstr "Vrátit o akci zpět" - -#: data/ui/glabels-ui.xml.h:123 -msgid "Zoom _1:1" -msgstr "ZvětÅ¡ení 1:1" - -#: data/ui/glabels-ui.xml.h:124 -msgid "Zoom _In" -msgstr "ZvětÅ¡it" - -#: data/ui/glabels-ui.xml.h:125 -msgid "Zoom _Out" -msgstr "ZmenÅ¡it" - -#: data/ui/glabels-ui.xml.h:126 -msgid "Zoom to _fit" -msgstr "Přizpůsobit velikosti" - -#: data/ui/glabels-ui.xml.h:127 -msgid "Zoom to fit window" -msgstr "Přizpůsobit velikosti okna" - -#: data/ui/glabels-ui.xml.h:128 -msgid "_About..." -msgstr "_O programu..." - -#: data/ui/glabels-ui.xml.h:129 -msgid "_Bottoms" -msgstr "Naspod" - -#: data/ui/glabels-ui.xml.h:132 -msgid "_Close" -msgstr "_Zavřít" - -#: data/ui/glabels-ui.xml.h:133 -msgid "_Contents" -msgstr "_Obsah" - -#: data/ui/glabels-ui.xml.h:134 -msgid "_Copy" -msgstr "_Kopírovat" - -#: data/ui/glabels-ui.xml.h:135 -msgid "_Create Object" -msgstr "_Vytvořit objekt" - -#: data/ui/glabels-ui.xml.h:136 -msgid "_Debug" -msgstr "_Debugování" - -#: data/ui/glabels-ui.xml.h:138 -msgid "_Desktop Default" -msgstr "Přednastavení prostředí" - -#: data/ui/glabels-ui.xml.h:139 -msgid "_Drawing Toolbar" -msgstr "Panel _kreslení" - -#: data/ui/glabels-ui.xml.h:140 -msgid "_Edit" -msgstr "_Upravit" - -#: data/ui/glabels-ui.xml.h:142 -msgid "_File" -msgstr "_Soubor" - -#: data/ui/glabels-ui.xml.h:143 -msgid "_Grid" -msgstr "_Mřížka" - -#: data/ui/glabels-ui.xml.h:144 -msgid "_Help" -msgstr "_Nápověda" - -#: data/ui/glabels-ui.xml.h:145 -msgid "_Icon" -msgstr "_Ikona" - -#: data/ui/glabels-ui.xml.h:149 -msgid "_Main Toolbar" -msgstr "_Hlavní panel" - -#: data/ui/glabels-ui.xml.h:150 -msgid "_Merge Properties..." -msgstr "Nastavení sloučení" - -#: data/ui/glabels-ui.xml.h:151 -msgid "_New" -msgstr "_Nový" - -#: data/ui/glabels-ui.xml.h:152 -msgid "_Objects" -msgstr "_Objekty" - -#: data/ui/glabels-ui.xml.h:153 -msgid "_Open..." -msgstr "_Otevřít" - -#: data/ui/glabels-ui.xml.h:155 -msgid "_Paste" -msgstr "Vl_ožit" - -#: data/ui/glabels-ui.xml.h:156 -msgid "_Print..." -msgstr "_Tisk..." - -#: data/ui/glabels-ui.xml.h:157 -msgid "_Property Toolbar" -msgstr "Panel _vlastností" - -#: data/ui/glabels-ui.xml.h:158 -msgid "_Quit" -msgstr "_Konec" - -#: data/ui/glabels-ui.xml.h:161 -msgid "_Save" -msgstr "_Uložit" - -#: data/ui/glabels-ui.xml.h:165 -msgid "_View" -msgstr "_Zobrazit" - -#: data/glade/prefs-dialog.glade.h:1 -msgid " " -msgstr "" - -#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 -#: data/glade/template-designer.glade.h:5 -msgid "*" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:3 -msgid "Default page size" -msgstr "Výchozí velikost stránky" - -#: data/glade/prefs-dialog.glade.h:4 -msgid "Fill" -msgstr "Výplň" - -#: data/glade/prefs-dialog.glade.h:5 -msgid "Line" -msgstr "Čára" - -#: data/glade/prefs-dialog.glade.h:6 -msgid "Text" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:7 -msgid "Units" -msgstr "Jednotky" - -#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 -msgid "Alignment:" -msgstr "Zarovnání:" - -#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 -msgid "Color:" -msgstr "Barva:" - -#: data/glade/prefs-dialog.glade.h:10 -msgid "Font:" -msgstr "Font:" - -#: data/glade/prefs-dialog.glade.h:11 -msgid "ISO A4" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:12 -msgid "Inches" -msgstr "Palce" - -#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 -msgid "Line Spacing:" -msgstr "Řádkování:" - -#: data/glade/prefs-dialog.glade.h:14 -msgid "Locale" -msgstr "Místní zvyklosti" - -#: data/glade/prefs-dialog.glade.h:15 -msgid "Millimeters" -msgstr "Milimetry" - -#: data/glade/prefs-dialog.glade.h:16 -msgid "Object defaults" -msgstr "Výchozí hodnoty objektu" - -#: data/glade/prefs-dialog.glade.h:17 -msgid "Points" -msgstr "Body" - -#: data/glade/prefs-dialog.glade.h:18 -msgid "Select default properties for new objects." -msgstr "Vyberte výchozí nastavení pro nové objekty" - -#: data/glade/prefs-dialog.glade.h:19 -msgid "Select locale specific behavior." -msgstr "Zvolte specifické chování pro místní zvyklosti." - -#. Most popular (at top of list) -#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:29 -msgid "US Letter" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 -#: data/glade/template-designer.glade.h:72 -msgid "Width:" -msgstr "Šířka:" - -#: data/glade/object-editor.glade.h:2 -msgid "00000000000 00000" -msgstr "" - -#: data/glade/object-editor.glade.h:3 -msgid "Xxx object properties" -msgstr "Vlastnosti objektu xxx" - -#: data/glade/object-editor.glade.h:5 -msgid "Allow merge to automatically shrink text" -msgstr "Při sloučení povolit automatické smrÅ¡tění textu" - -#: data/glade/object-editor.glade.h:6 -msgid "Angle:" -msgstr "Úhel:" - -#: data/glade/object-editor.glade.h:7 -msgid "Checksum" -msgstr "Kontrolní součet" - -#: data/glade/object-editor.glade.h:10 -msgid "Family:" -msgstr "Rodina:" - -#: data/glade/object-editor.glade.h:12 -msgid "Fill" -msgstr "Výplň" - -#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 -msgid "Height:" -msgstr "Výška:" - -#: data/glade/object-editor.glade.h:14 -msgid "Image" -msgstr "Obrázek" - -#: data/glade/object-editor.glade.h:15 -msgid "Insert merge field" -msgstr "Vložit pole pro sloučení" - -#: data/glade/object-editor.glade.h:17 -msgid "Length:" -msgstr "Délka:" - -#: data/glade/object-editor.glade.h:18 -msgid "Line" -msgstr "Čára" - -#: data/glade/object-editor.glade.h:20 -msgid "Literal:" -msgstr "Písmena:" - -#: data/glade/object-editor.glade.h:21 -msgid "Load image" -msgstr "Načíst obrázek" - -#: data/glade/object-editor.glade.h:22 -msgid "Position" -msgstr "Pozice" - -#: data/glade/object-editor.glade.h:23 -msgid "Reset image size" -msgstr "Resetovat velikost obrázku" - -#: data/glade/object-editor.glade.h:24 -msgid "Size" -msgstr "Velikost" - -#: data/glade/object-editor.glade.h:25 -msgid "Size:" -msgstr "Velikost:" - -#: data/glade/object-editor.glade.h:26 -msgid "Style" -msgstr "Styl" - -#: data/glade/object-editor.glade.h:27 -msgid "Style:" -msgstr "Styl:" - -#: data/glade/object-editor.glade.h:30 -msgid "X:" -msgstr "X:" - -#: data/glade/object-editor.glade.h:31 -msgid "Y:" -msgstr "Y:" - -#: data/glade/object-editor.glade.h:32 -msgid "degrees" -msgstr "stupně" - -#: data/glade/object-editor.glade.h:33 -msgid "dialog1" -msgstr "" - -#: data/glade/object-editor.glade.h:34 -msgid "digits:" -msgstr "číslic:" - -#: data/glade/object-editor.glade.h:35 -msgid "format:" -msgstr "formát:" - -#: data/glade/template-designer.glade.h:1 -msgid " " -msgstr "" - -#: data/glade/template-designer.glade.h:2 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "(např. \"Adresní Å¡títky,\" \"Vizitky,\" ...)" - -#: data/glade/template-designer.glade.h:3 -msgid "(e.g., 8163A)" -msgstr "(např. 8163A)" - -#: data/glade/template-designer.glade.h:4 -msgid "(e.g., Avery, Acme, ...)" -msgstr "(např. Avery, Acme, ...)" - -#: data/glade/template-designer.glade.h:6 -msgid "1. Outer radius:" -msgstr "1. Vnější poloměr:" - -#: data/glade/template-designer.glade.h:7 -msgid "1. Radius:" -msgstr "1. Poloměr:" - -#: data/glade/template-designer.glade.h:8 -msgid "1. Width:" -msgstr "1. Šířka:" - -#: data/glade/template-designer.glade.h:9 -msgid "2. Height:" -msgstr "2. Výška:" - -#: data/glade/template-designer.glade.h:10 -msgid "2. Inner radius:" -msgstr "2. Vnitřní poloměr:" - -#: data/glade/template-designer.glade.h:11 -msgid "2. Waste (overprint allowed):" -msgstr "2. Odsazení (povolený přetisk):" - -#: data/glade/template-designer.glade.h:12 -msgid "3. Clipping width:" -msgstr "3. Šířka výstřižku:" - -#: data/glade/template-designer.glade.h:13 -msgid "3. Margin" -msgstr "3. Okraj" - -#: data/glade/template-designer.glade.h:14 -msgid "3. Round (radius of corner):" -msgstr "3. Zaoblení (poloměr rohu):" - -#: data/glade/template-designer.glade.h:15 -msgid "4. Clipping height:" -msgstr "4. Výška výstřižku:" - -#: data/glade/template-designer.glade.h:16 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "4. Horizontální odsazení (povolený přetisk):" - -#: data/glade/template-designer.glade.h:17 -msgid "5. Vert. waste (overprint allowed):" -msgstr "5. Vert. odsazení (povolený přetisk):" - -#: data/glade/template-designer.glade.h:18 -msgid "5. Waste (overprint allowed):" -msgstr "5. Odsazení (povolený přetisk):" - -#: data/glade/template-designer.glade.h:19 -msgid "6. Margin" -msgstr "6. Okraj" - -#: data/glade/template-designer.glade.h:20 -msgid "Brand/Manufacturer:" -msgstr "Značka/Výrobce:" - -#: data/glade/template-designer.glade.h:21 -msgid "CD/DVD (including credit card CDs)" -msgstr "CD/DVD (včetně vizitkových CD)" - -#: data/glade/template-designer.glade.h:22 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "" -"Gratulujeme!\n" -"\n" -"Dokončili jste návrh Å¡ablony gLabels.\n" -"Pokud si přejete návrh přijmout a uložit, klikněte na \"Použít\".\n" -"\n" -"Jinak klikněte na \"ZruÅ¡it\" pro zahození návrhu či na\n" -"\"Zpět\" pro další úpravy tohoto návrhu." - -#: data/glade/template-designer.glade.h:30 -msgid "Design Completed" -msgstr "Návrh byl dokončen" - -#: data/glade/template-designer.glade.h:31 -msgid "Distance from left edge (x0):" -msgstr "Vzdálenost od levého okraje (x0):" - -#: data/glade/template-designer.glade.h:32 -msgid "Distance from top edge (y0):" -msgstr "Vzdálenost od horního okraje (y0):" - -#: data/glade/template-designer.glade.h:34 -msgid "Horizontal pitch (dx):" -msgstr "Vodorovná rozteč (dx):" - -#: data/glade/template-designer.glade.h:35 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" -"Kolik rozvržení obsahuje vaÅ¡e Å¡ablona? \n" -"\n" -"Rozvržení je sada etiket nebo vizitek, které mohou být uspořádány na\n" -"jednoduché mřížce. VětÅ¡ina Å¡ablon potřebuje jedno rozvržení jako v\n" -"prvním příkladu. Druhý příklad ilustruje dvě rozvržení." - -#: data/glade/template-designer.glade.h:40 -msgid "Label Size (CD/DVD)" -msgstr "Velikost etikety (CD/DVD)" - -#: data/glade/template-designer.glade.h:41 -msgid "Label Size (Round)" -msgstr "Velikost etikety (oválná)" - -#: data/glade/template-designer.glade.h:42 -msgid "Label or Card Shape" -msgstr "Tvar etikety či vizitky" - -#: data/glade/template-designer.glade.h:43 -msgid "Label or Card Size (Rectangular)" -msgstr "Velikost etikety či vizitky (obdélníková)" - -#: data/glade/template-designer.glade.h:44 -msgid "Layout #1" -msgstr "Rozvržení #1" - -#: data/glade/template-designer.glade.h:45 -msgid "Layout #2" -msgstr "Rozvržení #2" - -#: data/glade/template-designer.glade.h:46 -msgid "Layout(s)" -msgstr "Rozvržení" - -#: data/glade/template-designer.glade.h:47 -msgid "Name and Description" -msgstr "Název a popis" - -#: data/glade/template-designer.glade.h:48 -msgid "Number across (nx):" -msgstr "Počet napříč (nx):" - -#: data/glade/template-designer.glade.h:49 -msgid "Number down (ny):" -msgstr "Počet dolů (ny):" - -#: data/glade/template-designer.glade.h:50 -msgid "Number of Layouts" -msgstr "Počet rozvržení" - -#: data/glade/template-designer.glade.h:51 -msgid "Number of layouts:" -msgstr "Počet rozvržení:" - -#: data/glade/template-designer.glade.h:52 -msgid "Page Size" -msgstr "Velikost stránky" - -#: data/glade/template-designer.glade.h:54 -msgid "Part #:" -msgstr "Část #:" - -#: data/glade/template-designer.glade.h:55 -msgid "" -"Please enter the following identifying information about the template " -"stationery." -msgstr "" -"Vyplňte, prosím, následující informace o Å¡abloně." - -#: data/glade/template-designer.glade.h:56 -msgid "Please enter the following layout information." -msgstr "Vyplňte, prosím, následující informaci o rozvržení." - -#: data/glade/template-designer.glade.h:57 -msgid "" -"Please enter the following size parameters of a single label in your " -"template." -msgstr "" -"Vyplňte, prosím, následující parametry velikosti jedné etikety ve " -"vaší Å¡abloně." - -#: data/glade/template-designer.glade.h:58 -msgid "" -"Please enter the following size parameters of a single label or card in your " -"template." -msgstr "" -"Vyplňte, prosím, následující parametry velikosti jedné etikety nebo vizitky ve " -"vaší Å¡abloně." - -#: data/glade/template-designer.glade.h:59 -msgid "Please select the basic shape of the labels or cards." -msgstr "Vyberte, prosím, základní tvar etiket nebo vizitek." - -#: data/glade/template-designer.glade.h:60 -msgid "Please select the page size of the template stationery." -msgstr "Vyberte, prosím, velikost stránky Å¡ablony." - -#: data/glade/template-designer.glade.h:61 -msgid "Print test sheet" -msgstr "Vytisknout testovací stránku" - -#: data/glade/template-designer.glade.h:62 -msgid "Rectangular or square (can have rounded corners)" -msgstr "Obdélníkový nebo čtvercový (může mít zaoblené rohy)" - -#: data/glade/template-designer.glade.h:63 -msgid "Round" -msgstr "Oválný" - -#: data/glade/template-designer.glade.h:64 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" -"Å ablony, které potřebují\n" -"dvě rozvržení." - -#: data/glade/template-designer.glade.h:66 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" -"Å ablony, které potřebují\n" -"jedno rozvržení." - -#: data/glade/template-designer.glade.h:68 -msgid "Vertical pitch (dy):" -msgstr "Svislá rozteč (dy):" - -#: data/glade/template-designer.glade.h:69 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" -"Vítejte v Návrháři Å¡ablon programu gLabels.\n" -"\n" -"Tento dialog vám pomůže při vytváření vlastní Å¡ablony gLabels." - -#. Other ISO A series sizes -#: data/templates/paper-sizes.xml.h:2 -msgid "A0" -msgstr "" - -#: data/templates/paper-sizes.xml.h:3 -msgid "A1" -msgstr "" - -#: data/templates/paper-sizes.xml.h:4 -msgid "A10" -msgstr "" - -#: data/templates/paper-sizes.xml.h:5 -msgid "A2" -msgstr "" - -#: data/templates/paper-sizes.xml.h:6 -msgid "A3" -msgstr "" - -#: data/templates/paper-sizes.xml.h:7 -msgid "A4" -msgstr "" - -#: data/templates/paper-sizes.xml.h:8 -msgid "A5" -msgstr "" - -#: data/templates/paper-sizes.xml.h:9 -msgid "A6" -msgstr "" - -#: data/templates/paper-sizes.xml.h:10 -msgid "A7" -msgstr "" - -#: data/templates/paper-sizes.xml.h:11 -msgid "A8" -msgstr "" - -#: data/templates/paper-sizes.xml.h:12 -msgid "A9" -msgstr "" - -#. ISO B series sizes -#: data/templates/paper-sizes.xml.h:14 -msgid "B0" -msgstr "" - -#: data/templates/paper-sizes.xml.h:15 -msgid "B1" -msgstr "" - -#: data/templates/paper-sizes.xml.h:16 -msgid "B10" -msgstr "" - -#: data/templates/paper-sizes.xml.h:17 -msgid "B2" -msgstr "" - -#: data/templates/paper-sizes.xml.h:18 -msgid "B3" -msgstr "" - -#: data/templates/paper-sizes.xml.h:19 -msgid "B4" -msgstr "" - -#: data/templates/paper-sizes.xml.h:20 -msgid "B5" -msgstr "" - -#: data/templates/paper-sizes.xml.h:21 -msgid "B6" -msgstr "" - -#: data/templates/paper-sizes.xml.h:22 -msgid "B7" -msgstr "" - -#: data/templates/paper-sizes.xml.h:23 -msgid "B8" -msgstr "" - -#: data/templates/paper-sizes.xml.h:24 -msgid "B9" -msgstr "" - -#: data/templates/paper-sizes.xml.h:25 -msgid "US Executive" -msgstr "" - -#. Other US paper sizes -#: data/templates/paper-sizes.xml.h:27 -msgid "US Legal" -msgstr "" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:2 -#: data/templates/zweckform-iso-templates.xml.h:2 -msgid "Address Labels" -msgstr "Adresní etikety" - -#. =================================================================== -#. ============================================================ -#. =================================================================== -#. ====================================================== -#: data/templates/avery-us-templates.xml.h:4 -#: data/templates/avery-iso-templates.xml.h:4 -#: data/templates/zweckform-iso-templates.xml.h:6 -#: data/templates/misc-us-templates.xml.h:3 -#: data/templates/misc-iso-templates.xml.h:17 -msgid "Business Cards" -msgstr "Vizitky" - -#: data/templates/avery-us-templates.xml.h:5 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:7 -msgid "Diskette Labels" -msgstr "Disketové etikety" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:9 -msgid "Filing Labels" -msgstr "" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:11 -msgid "Full Sheet Labels" -msgstr "" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:13 -msgid "Large Round Labels" -msgstr "Velké oválné etikety" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:15 -msgid "Name Badge Labels" -msgstr "" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:17 -msgid "Return Address Labels" -msgstr "Zpáteční adresa" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:19 -msgid "Shipping Labels" -msgstr "Dopravní etikety" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:21 -msgid "Small Round Labels" -msgstr "Malé oválné etikety" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:23 -msgid "Square Labels" -msgstr "Čtvercové etikety" - -#: data/templates/avery-us-templates.xml.h:24 -msgid "Video Tape Face Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:25 -msgid "Video Tape Spine Labels" -msgstr "" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:2 -msgid "Address labels" -msgstr "Adresní etikety" - -#. =============================================================== -#: data/templates/avery-iso-templates.xml.h:6 -msgid "CD Booklet" -msgstr "" - -#. =============================================================== -#: data/templates/avery-iso-templates.xml.h:8 -msgid "CD Inlet" -msgstr "" - -#. =============================================================== -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:10 -#: data/templates/zweckform-iso-templates.xml.h:8 -#: data/templates/misc-us-templates.xml.h:5 -#: data/templates/misc-iso-templates.xml.h:21 -msgid "CD/DVD Labels" -msgstr "CD/DVD etikety" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:12 -msgid "Diskette labels" -msgstr "Disketové etikety" - -#. =============================================================== -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:14 -#: data/templates/zweckform-iso-templates.xml.h:14 -#: data/templates/misc-iso-templates.xml.h:35 -msgid "Mailing Labels" -msgstr "PoÅ¡tovní etikety" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:16 -msgid "Mailing labels" -msgstr "PoÅ¡tovní etikety" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:18 -msgid "Mini Address Labels" -msgstr "" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:20 -msgid "Shipping labels" -msgstr "Dopravní etikety" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:4 -msgid "Allround Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:10 -msgid "Correction and Cover-up Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:12 -msgid "Lever Arch File Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:16 -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:18 -msgid "Rectangular Copier Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:20 -#: data/templates/misc-iso-templates.xml.h:44 -msgid "Rectangular Labels" -msgstr "Obdélníkové etikety" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:22 -msgid "Video Labels (back)" -msgstr "Video etikety (zadní strana)" - -#: data/templates/misc-us-templates.xml.h:1 -msgid "Business Card CD" -msgstr "Vizitkové CD" - -#: data/templates/misc-us-templates.xml.h:4 -msgid "CD Template Rectangles" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:6 -msgid "CD/DVD Labels (Face Only)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:7 -#: data/templates/misc-iso-templates.xml.h:23 -msgid "CD/DVD Labels (face only)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:9 -msgid "Cassette Labels" -msgstr "Kazetové etikety" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:11 -msgid "DLT Labels" -msgstr "DLT etikety" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:13 -msgid "Microtube labels" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:14 -msgid "Mini-CD Labels" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:15 -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:16 -msgid "PRO CD Labels 2-up (Face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:17 -#: data/templates/misc-iso-templates.xml.h:42 -msgid "PRO CD Labels 2-up (face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:18 -msgid "Slimline CD Case (rightside up)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:19 -msgid "Slimline CD Case (upside down)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:1 -msgid "Agipa 119488: Business Cards" -msgstr "Agipa 119488: Vizitky" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:3 -msgid "Allround Labels --24" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:5 -msgid "Allround Labels --44" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:7 -msgid "Allround Labels --64" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:9 -msgid "Allround Labels --65" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:11 -msgid "Arch File Labels" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:13 -msgid "Arch File Labels (large)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:15 -msgid "Arch File Labels (small)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:19 -msgid "CD Labels" -msgstr "CD etikety" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:25 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:27 -msgid "Diskette Labels (face only)" -msgstr "Disketové etikety (pouze předek)" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:29 -msgid "EPSON Photo Stickers 16" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:31 -msgid "Etiketten" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:33 -msgid "Fridge Magnet Stickers" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:37 -msgid "Mailing Labels --14" -msgstr "PoÅ¡tovní etikety --14" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:39 -msgid "Mailing Labels-2 columns" -msgstr "PoÅ¡tovní etikety-2 sloupce" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:41 -msgid "Mailing Labels-3 columns" -msgstr "PoÅ¡tovní etikety-3 sloupce" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:46 -msgid "Video Labels (face only)" -msgstr "Video etikety (pouze předek)" - -#: data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers" -msgstr "Vytvářejte etikety, vizitky a obaly médií" - -#: data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "Návrhář etiket gLabels" - -#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 -msgid "gLabels Project File" -msgstr "" - -#~ msgid "Only show icons in the drawing toolbar" -#~ msgstr "Zobrazv panelu kreslení jen ikony " - -#~ msgid "Set drawing toolbar button style according to desktop default" -#~ msgstr "" -#~ "Nastavit tlačítka na panelu kreslení stejně jako je základní nastavení " -#~ "prostředí" - -#, fuzzy -#~ msgid "Show both icons and texts in the drawing toolbar" -#~ msgstr "Ukazovat tipy v panelu kreslení" - -#~ msgid "Object _Properties..." -#~ msgstr "Možnosti objektu" - -#~ msgid "Display units" -#~ msgstr "Jednotky zobrazení" - -#~ msgid "Default page size" -#~ msgstr "Standartní velikost stránky" - -#~ msgid "Outline" -#~ msgstr "Obrys" - -#~ msgid "Edit line object properties" -#~ msgstr "Editace nastavení objektu řádky" - -#~ msgid "Edit text object properties" -#~ msgstr "Editace nastavení objektu text" - -#~ msgid "Edit text:" -#~ msgstr "Editace textu:" - -#~ msgid "Maintain current aspect ratio" -#~ msgstr "Udržet současný poměr stran" - -#~ msgid "Open %s" -#~ msgstr "Otevřít %s" diff --git a/glabels2/po/de.po b/glabels2/po/de.po deleted file mode 100644 index 6d2d9125..00000000 --- a/glabels2/po/de.po +++ /dev/null @@ -1,2707 +0,0 @@ -# German translation of glabels. -# Copyright (C) 2001-2008 Jim Evins -# Marcus Bauer , 2001. -# Christian Neumair , 2002. -# Mario Blättermann , 2008, 2009. -# -msgid "" -msgstr "" -"Project-Id-Version: glabels HEAD\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-29 12:35+0200\n" -"PO-Revision-Date: 2009-04-29 12:45+0100\n" -"Last-Translator: Mario Blättermann \n" -"Language-Team: German \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../src/glabels.c:66 ../src/glabels-batch.c:69 -msgid "[FILE...]" -msgstr "[DATEI...]" - -#: ../src/glabels.c:83 -msgid "Launch gLabels label and business card designer." -msgstr "Starten des gLabels Etiketten- und Visitenkarten-Designers." - -#: ../src/glabels.c:91 ../src/glabels-batch.c:105 -#, c-format -msgid "" -"%s\n" -"Run '%s --help' to see a full list of available command line options.\n" -msgstr "" -"%s\n" -"Rufen Sie »%s --help« auf, um eine vollständige Liste der " -"Befehlszeilenoptionen zu erhalten.\n" - -#: ../src/glabels-batch.c:53 -msgid "set output filename (default=\"output.pdf\")" -msgstr "Ausgabe-Dateiname festlegen (Vorgabe: »output.pdf«)" - -#: ../src/glabels-batch.c:53 ../src/glabels-batch.c:67 -msgid "filename" -msgstr "Dateiname" - -#: ../src/glabels-batch.c:55 -msgid "number of sheets (default=1)" -msgstr "Anzahl der Blätter (Vorgabe: 1)" - -#: ../src/glabels-batch.c:55 -msgid "sheets" -msgstr "Blätter" - -#: ../src/glabels-batch.c:57 -msgid "number of copies (default=1)" -msgstr "Anzahl der Kopien (Vorgabe: 1)" - -#: ../src/glabels-batch.c:57 -msgid "copies" -msgstr "Kopien" - -#: ../src/glabels-batch.c:59 -msgid "first label on first sheet (default=1)" -msgstr "Erstes Etikett auf dem ersten Blatt (Vorgabe: 1)" - -#: ../src/glabels-batch.c:59 -msgid "first" -msgstr "Erste" - -#: ../src/glabels-batch.c:61 ../data/builder/print-custom-widget.glade.h:6 -msgid "print outlines (to test printer alignment)" -msgstr "Begrenzungen drucken (um Druckausrichtung zu testen)" - -#: ../src/glabels-batch.c:63 ../data/builder/print-custom-widget.glade.h:5 -msgid "print in reverse (i.e. a mirror image)" -msgstr "Spiegelbildlich drucken" - -#: ../src/glabels-batch.c:65 ../data/builder/print-custom-widget.glade.h:4 -msgid "print crop marks" -msgstr "Schnittmarken drucken" - -#: ../src/glabels-batch.c:67 -msgid "input file for merging" -msgstr "Eingabedatei zum Mischen" - -#: ../src/glabels-batch.c:97 -msgid "Print files created with gLabels." -msgstr "Mit gLabels erstellte Dateien drucken." - -#: ../src/glabels-batch.c:147 -#, c-format -msgid "cannot perform document merge with glabels file %s\n" -msgstr "" -"Dokumentverarbeitung kann mit gLabels-Datei %s nicht ausgeführt werden\n" - -#: ../src/glabels-batch.c:169 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "glabels-Datei %s kann nicht geöffnet werden\n" - -#: ../src/window.c:259 -msgid "(none) - gLabels" -msgstr "(Unbenannt) - gLabels" - -#: ../src/window.c:432 -msgid "(modified)" -msgstr "(geändert)" - -#: ../src/stock.c:72 -msgid "_Select Mode" -msgstr "Modus au_swählen" - -#: ../src/stock.c:73 -msgid "_Text" -msgstr "_Text" - -#: ../src/stock.c:74 -msgid "_Line" -msgstr "_Linie" - -#: ../src/stock.c:75 -msgid "_Box" -msgstr "_Rechteck" - -#: ../src/stock.c:76 -msgid "_Ellipse" -msgstr "_Ellipse" - -#: ../src/stock.c:77 -msgid "_Image" -msgstr "B_ild" - -#: ../src/stock.c:78 -msgid "Bar_code" -msgstr "Strich_code" - -#: ../src/stock.c:79 -msgid "_Merge Properties" -msgstr "_Mischeinstellungen" - -#: ../src/stock.c:80 -msgid "Object _Properties" -msgstr "Objektei_genschaften" - -#: ../src/stock.c:81 -msgid "Bring to _Front" -msgstr "Ganz nach _vorn" - -#: ../src/stock.c:82 -msgid "Send to _Back" -msgstr "Ganz nach _hinten" - -#: ../src/stock.c:83 -msgid "Rotate _Left" -msgstr "_Links drehen" - -#: ../src/stock.c:84 -msgid "Rotate _Right" -msgstr "_Rechts drehen" - -#: ../src/stock.c:85 -msgid "Flip _Horizontally" -msgstr "_Horizontal spiegeln" - -#: ../src/stock.c:86 -msgid "Flip _Vertically" -msgstr "_Vertikal spiegeln" - -#: ../src/stock.c:87 -msgid "_Lefts" -msgstr "_Links" - -#: ../src/stock.c:88 -msgid "_Rights" -msgstr "_Rechts" - -#: ../src/stock.c:89 -msgid "_Centers" -msgstr "_Mitte" - -#: ../src/stock.c:90 -msgid "_Tops" -msgstr "_Oben" - -#: ../src/stock.c:91 -msgid "Bottoms" -msgstr "Unten" - -#: ../src/stock.c:92 -msgid "Centers" -msgstr "Mitte" - -#: ../src/stock.c:93 ../src/stock.c:94 -msgid "Label Ce_nter" -msgstr "Etikett ze_ntrieren" - -#: ../src/stock.c:95 ../data/builder/property-bar.glade.h:3 -msgid "Fill color" -msgstr "Füllfarbe" - -#: ../src/stock.c:96 ../data/builder/property-bar.glade.h:8 -msgid "Line color" -msgstr "Linienfarbe" - -#: ../src/stock.c:97 ../src/stock.c:99 -msgid "Linked" -msgstr "Verknüpft" - -#: ../src/stock.c:98 ../src/stock.c:100 -msgid "Not Linked" -msgstr "Nicht verknüpft" - -#. Menu entries. -#: ../src/ui.c:93 -msgid "_File" -msgstr "_Datei" - -#: ../src/ui.c:94 -msgid "Open Recent _Files" -msgstr "_Zuletzt geöffnete Dateien" - -#: ../src/ui.c:95 -msgid "_Edit" -msgstr "_Bearbeiten" - -#: ../src/ui.c:96 -msgid "_View" -msgstr "_Ansicht" - -#: ../src/ui.c:97 -msgid "Customize Main Toolbar" -msgstr "Werkzeugleiste anpassen" - -#: ../src/ui.c:98 -msgid "Customize Drawing Toolbar" -msgstr "Zeichenwerkzeugleiste anpassen" - -#: ../src/ui.c:99 -msgid "Customize Properties Toolbar" -msgstr "Eigenschaften-Werkzeugleiste anpassen" - -#: ../src/ui.c:100 -msgid "_Objects" -msgstr "_Objekte" - -#: ../src/ui.c:101 -msgid "_Create" -msgstr "_Erzeugen" - -#: ../src/ui.c:102 -msgid "_Order" -msgstr "_Anordnung" - -#: ../src/ui.c:103 -msgid "_Rotate/Flip" -msgstr "D_rehen/Spiegeln" - -#: ../src/ui.c:104 -msgid "Align _Horizontal" -msgstr "_Horizontal" - -#: ../src/ui.c:105 -msgid "Align _Vertical" -msgstr "_Vertikal" - -#: ../src/ui.c:106 -msgid "_Help" -msgstr "_Hilfe" - -#. Popup entries. -#: ../src/ui.c:109 ../src/ui.c:110 -msgid "Context Menu" -msgstr "Kontextmenü" - -#: ../src/ui.c:115 -msgid "_New" -msgstr "_Neu" - -#: ../src/ui.c:117 -msgid "Create a new file" -msgstr "Eine neue Datei erstellen" - -#: ../src/ui.c:122 -msgid "_Open..." -msgstr "Ö_ffnen …" - -#: ../src/ui.c:124 -msgid "Open a file" -msgstr "Eine Datei öffnen" - -#: ../src/ui.c:129 -msgid "_Save" -msgstr "_Speichern" - -#: ../src/ui.c:131 -msgid "Save current file" -msgstr "Die aktuelle Datei speichern" - -#: ../src/ui.c:136 -msgid "Save _As..." -msgstr "Speichern _unter …" - -#: ../src/ui.c:138 -msgid "Save the current file to a different name" -msgstr "Die aktuelle Datei unter einem anderen Dateinamen speichern" - -#: ../src/ui.c:143 -msgid "_Print..." -msgstr "_Drucken …" - -#: ../src/ui.c:145 -msgid "Print the current file" -msgstr "Die aktuelle Datei drucken" - -#: ../src/ui.c:150 -msgid "Properties..." -msgstr "Einstellungen …" - -#: ../src/ui.c:152 -msgid "Modify document properties" -msgstr "Dokumenteigenschaften ändern" - -#: ../src/ui.c:157 -msgid "Template _Designer..." -msgstr "Vorlagen-_Designer …" - -#: ../src/ui.c:159 -msgid "Create a custom template" -msgstr "Eine neue benutzerdefinierte Vorlage erstellen" - -#: ../src/ui.c:164 -msgid "_Close" -msgstr "S_chließen" - -#: ../src/ui.c:166 -msgid "Close the current file" -msgstr "Die aktuelle Datei schließen" - -#: ../src/ui.c:171 -msgid "_Quit" -msgstr "_Beenden" - -#: ../src/ui.c:173 -msgid "Quit the program" -msgstr "Das Programm beenden" - -#: ../src/ui.c:180 -msgid "Cut" -msgstr "Ausschneiden" - -#: ../src/ui.c:182 -msgid "Cut the selection" -msgstr "Die Markierung ausschneiden" - -#: ../src/ui.c:187 -msgid "Copy" -msgstr "Kopieren" - -#: ../src/ui.c:189 -msgid "Copy the selection" -msgstr "Die Markierung kopieren" - -#: ../src/ui.c:194 -msgid "Paste" -msgstr "Einfügen" - -#: ../src/ui.c:196 -msgid "Paste the clipboard" -msgstr "Inhalt der Zwischenablage einfügen" - -#: ../src/ui.c:201 -msgid "Delete" -msgstr "Löschen" - -#: ../src/ui.c:203 -msgid "Delete the selected objects" -msgstr "Die markierten Objekte löschen" - -#: ../src/ui.c:208 -msgid "Select All" -msgstr "Alles markieren" - -#: ../src/ui.c:210 -msgid "Select all objects" -msgstr "Alle Objekte markieren" - -#: ../src/ui.c:215 -msgid "Un-select All" -msgstr "Alle Markierungen löschen" - -#: ../src/ui.c:217 -msgid "Remove all selections" -msgstr "Alle Auswahlen aufheben" - -#: ../src/ui.c:222 -msgid "Preferences" -msgstr "Einstellungen" - -#: ../src/ui.c:224 -msgid "Configure the application" -msgstr "Die Anwendung konfigurieren" - -#: ../src/ui.c:231 -msgid "Zoom in" -msgstr "Vergrößern" - -#: ../src/ui.c:233 -msgid "Increase magnification" -msgstr "Vergrößern" - -#: ../src/ui.c:238 -msgid "Zoom out" -msgstr "Verkleinern" - -#: ../src/ui.c:240 -msgid "Decrease magnification" -msgstr "Verkleinern" - -#: ../src/ui.c:245 -msgid "Zoom 1 to 1" -msgstr "Vergrößerung 1:1" - -#: ../src/ui.c:247 -msgid "Restore scale to 100%" -msgstr "Maßstab auf 100% wiederherstellen" - -#: ../src/ui.c:252 -msgid "Zoom to fit" -msgstr "Einpassen" - -#: ../src/ui.c:254 -msgid "Set scale to fit window" -msgstr "In Fenster einpassen" - -#: ../src/ui.c:261 -msgid "Select Mode" -msgstr "Modus auswählen" - -#: ../src/ui.c:263 -msgid "Select, move and modify objects" -msgstr "Objekte auswählen, bewegen, ändern" - -#: ../src/ui.c:268 ../src/view-text.c:494 -#: ../data/builder/object-editor.glade.h:32 -msgid "Text" -msgstr "Text" - -#: ../src/ui.c:270 -msgid "Create text object" -msgstr "Textobjekt erzeugen" - -#: ../src/ui.c:275 -msgid "Box" -msgstr "Rechteck" - -#: ../src/ui.c:277 -msgid "Create box/rectangle object" -msgstr "Rechteck-Objekt erzeugen" - -#: ../src/ui.c:282 ../data/builder/object-editor.glade.h:20 -msgid "Line" -msgstr "Linie" - -#: ../src/ui.c:284 -msgid "Create line object" -msgstr "Linienobjekt erzeugen" - -#: ../src/ui.c:289 -msgid "Ellipse" -msgstr "Ellipse" - -#: ../src/ui.c:291 -msgid "Create ellipse/circle object" -msgstr "Ellipsen- oder Kreisobjekt erzeugen" - -#: ../src/ui.c:296 ../data/builder/object-editor.glade.h:16 -msgid "Image" -msgstr "Bild" - -#: ../src/ui.c:298 -msgid "Create image object" -msgstr "Bildobjekt erzeugen" - -#: ../src/ui.c:303 -msgid "Barcode" -msgstr "Strichcode" - -#: ../src/ui.c:305 -msgid "Create barcode object" -msgstr "Strichcodeobjekt erzeugen" - -#: ../src/ui.c:310 -msgid "Bring to front" -msgstr "Ganz nach vorn" - -#: ../src/ui.c:312 -msgid "Raise object to top" -msgstr "Objekt im Ebenenstapel nach oben verschieben" - -#: ../src/ui.c:317 -msgid "Send to back" -msgstr "Ganz nach hinten" - -#: ../src/ui.c:319 -msgid "Lower object to bottom" -msgstr "Objekt im Ebenenstapel nach unten verschieben" - -#: ../src/ui.c:324 -msgid "Rotate left" -msgstr "Links drehen" - -#: ../src/ui.c:326 -msgid "Rotate object 90 degrees counter-clockwise" -msgstr "Objekt um 90 Grad gegen den Uhrzeigersinn drehen" - -#: ../src/ui.c:331 -msgid "Rotate right" -msgstr "Rechts drehen" - -#: ../src/ui.c:333 -msgid "Rotate object 90 degrees clockwise" -msgstr "Objekt um 90 Grad im Uhrzeigersinn drehen" - -#: ../src/ui.c:338 -msgid "Flip horizontally" -msgstr "Horizontal spiegeln" - -#: ../src/ui.c:340 -msgid "Flip object horizontally" -msgstr "Objekt horizontal spiegeln" - -#: ../src/ui.c:345 -msgid "Flip vertically" -msgstr "Vertikal spiegeln" - -#: ../src/ui.c:347 -msgid "Flip object vertically" -msgstr "Objekt vertikal spiegeln" - -#: ../src/ui.c:352 -msgid "Align left" -msgstr "Linksbündig" - -#: ../src/ui.c:354 -msgid "Align objects to left edges" -msgstr "Objekte am linken Rand anordnen" - -#: ../src/ui.c:359 -msgid "Align right" -msgstr "Rechtsbündig" - -#: ../src/ui.c:361 -msgid "Align objects to right edges" -msgstr "Objekte am rechten Rand anordnen" - -#: ../src/ui.c:366 -msgid "Align horizontal center" -msgstr "Horizontal mittig anordnen" - -#: ../src/ui.c:368 -msgid "Align objects to horizontal centers" -msgstr "Objekte an der horizontalen Mitte anordnen" - -#: ../src/ui.c:373 -msgid "Align tops" -msgstr "Oben bündig" - -#: ../src/ui.c:375 -msgid "Align objects to top edges" -msgstr "Objekte am oberen Rand anordnen" - -#: ../src/ui.c:380 -msgid "Align bottoms" -msgstr "Unten bündig" - -#: ../src/ui.c:382 -msgid "Align objects to bottom edges" -msgstr "Objekte am unteren Rand anordnen" - -#: ../src/ui.c:387 -msgid "Align vertical center" -msgstr "Vertikal mittig anordnen" - -#: ../src/ui.c:389 -msgid "Align objects to vertical centers" -msgstr "Objekte an der vertikalen Mitte anordnen" - -#: ../src/ui.c:394 -msgid "Center horizontally" -msgstr "Horizontal zentrieren" - -#: ../src/ui.c:396 -msgid "Center objects to horizontal label center" -msgstr "Objekte zur horizontalen Mitte des Etiketts zentrieren" - -#: ../src/ui.c:401 -msgid "Center vertically" -msgstr "Vertikal zentrieren" - -#: ../src/ui.c:403 -msgid "Center objects to vertical label center" -msgstr "Objekte zur vertikalen Mitte des Etiketts zentrieren" - -#: ../src/ui.c:408 -msgid "Merge properties" -msgstr "Mischeinstellungen" - -#: ../src/ui.c:410 -msgid "Edit merge properties" -msgstr "Mischeinstellungen bearbeiten" - -#: ../src/ui.c:417 -msgid "Contents" -msgstr "Inhalte" - -#: ../src/ui.c:419 -msgid "Open glabels manual" -msgstr "Das gLabels-Handbuch öffnen" - -#: ../src/ui.c:424 -msgid "About..." -msgstr "Info …" - -#: ../src/ui.c:426 -msgid "About glabels" -msgstr "Info zu gLabels" - -# CHECK -#: ../src/ui.c:436 -msgid "Property toolbar" -msgstr "Eigenschaften-Werkzeugleiste" - -#: ../src/ui.c:438 -msgid "Change the visibility of the property toolbar in the current window" -msgstr "" -"Die Sichtbarkeit der Werkzeugleiste im aktuellen Fenster ein- oder ausschalten" - -#: ../src/ui.c:444 -msgid "Grid" -msgstr "Raster" - -#: ../src/ui.c:446 -msgid "Change the visibility of the grid in the current window" -msgstr "Die Sichtbarkeit des Rasters im aktuellen Fenster ein- oder ausschalten" - -#: ../src/ui.c:452 -msgid "Markup" -msgstr "Markierungen" - -#: ../src/ui.c:454 -msgid "Change the visibility of markup lines in the current window" -msgstr "Die Sichtbarkeit von Markierungslinien im aktuellen Fenster ändern" - -#: ../src/ui.c:465 -msgid "Main toolbar" -msgstr "Haupt-Werkzeugleiste" - -#: ../src/ui.c:467 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "" -"Die Sichtbarkeit der Haupt-Werkzeugleiste im aktuellen Fenster einschalten/" -"ausschalten" - -#: ../src/ui.c:473 -msgid "Drawing toolbar" -msgstr "Zeichenwerkzeugleiste" - -#: ../src/ui.c:475 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "" -"Die Sichtbarkeit der Zeichenwerkzeugleiste im aktuellen Fenster einschalten/" -"ausschalten" - -#: ../src/ui-property-bar.c:279 ../src/prefs-dialog.c:328 -#: ../src/object-editor-bc-page.c:93 ../src/object-editor-text-page.c:93 -#: ../src/object-editor-shadow-page.c:93 -msgid "Default" -msgstr "Standard" - -#: ../src/ui-property-bar.c:291 ../src/prefs-dialog.c:334 -#: ../src/object-editor-fill-page.c:79 -msgid "No Fill" -msgstr "Keine Füllung" - -#: ../src/ui-property-bar.c:303 ../src/prefs-dialog.c:331 -#: ../src/object-editor-line-page.c:81 -msgid "No Line" -msgstr "Keine Linie" - -#: ../src/ui-sidebar.c:152 -msgid "Object properties" -msgstr "Objekteigenschaften" - -#: ../src/ui-commands.c:1064 -msgid "Glabels includes contributions from:" -msgstr "Glabels entstand unter Mitwirkung von:" - -#: ../src/ui-commands.c:1070 -msgid "See the file AUTHORS for additional credits," -msgstr "Lesen die Datei AUTHORS für zusätzliche Danksagungen," - -#: ../src/ui-commands.c:1071 -msgid "or visit http://glabels.sourceforge.net/" -msgstr "oder besuchen Sie http://glabels.sourceforge.net/" - -#: ../src/ui-commands.c:1083 -msgid "A label and business card creation program.\n" -msgstr "Eine Anwendung zum Erstellen von Etiketten und Visitenkarten.\n" - -#: ../src/ui-commands.c:1087 -msgid "translator-credits" -msgstr "" -"Marcus Bauer \n" -"Christian Neumair \n" -"Mario Blättermann " - -#: ../src/ui-commands.c:1090 -msgid "" -"Glabels is free software; you can redistribute it and/or modify it\n" -"under the terms of the GNU General Public License as published by\n" -"the Free Software Foundation; either version 2 of the License, or\n" -"(at your option) any later version.\n" -"\n" -"This program is distributed in the hope that it will be useful, but\n" -"WITHOUT ANY WARRANTY; without even the implied warranty of\n" -"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See\n" -"the GNU General Public License for more details.\n" -msgstr "" -"Glabels ist freie Software; Sie können sie weiterverteilen und/oder ändern\n" -"unter den Bedingungen der GNU General Public License, veröffentlicht von\n" -"der Free Software Foundation, entweder Version 2 der Lizenz oder (optional)\n" -"jeder späteren Version.\n" -" \n" -"Dieses Programm wird verteilt in der Hoffnung, dass es nützlich ist, aber\n" -"OHNE JEDE GARANTIE; Weitere Details in der GNU General Public License.\n" - -#: ../src/ui-commands.c:1116 -msgid "glabels" -msgstr "glabels" - -#: ../src/file.c:91 -msgid "New Label or Card" -msgstr "Neues Etikett oder neue Karte" - -#: ../src/file.c:191 -msgid "Label properties" -msgstr "Etiketten-Eigenschaften" - -#: ../src/file.c:292 ../src/file.c:578 -msgid "All files" -msgstr "Alle Dateien" - -#: ../src/file.c:297 ../src/file.c:583 -msgid "gLabels documents" -msgstr "gLabels-Dokumente" - -#: ../src/file.c:343 ../src/file.c:640 -msgid "Empty file name selection" -msgstr "Auswahl des Dateinamens ist leer" - -#: ../src/file.c:346 ../src/file.c:362 -msgid "Please select a file or supply a valid file name" -msgstr "Bitte wählen Sie eine Datei oder geben Sie einen gültigen Dateinamen an" - -#: ../src/file.c:359 -msgid "File does not exist" -msgstr "Datei existiert nicht" - -#: ../src/file.c:433 -#, c-format -msgid "Could not open file \"%s\"" -msgstr "Datei »%s« konnte nicht geöffnet werden" - -#: ../src/file.c:436 -msgid "Not a supported file format" -msgstr "Kein unterstütztes Dateiformat" - -#: ../src/file.c:513 ../src/file.c:690 -#, c-format -msgid "Could not save file \"%s\"" -msgstr "Datei »%s« konnte nicht gespeichert werden" - -#: ../src/file.c:517 ../src/file.c:694 -msgid "Error encountered during save. The file is still not saved." -msgstr "Fehler während des Speicherns. Datei wurde noch nicht gespeichert." - -#: ../src/file.c:556 -#, c-format -msgid "Save \"%s\" as" -msgstr "»%s« speichern unter" - -#: ../src/file.c:643 -msgid "Please supply a valid file name" -msgstr "Bitte geben Sie einen gültigen Dateinamen an" - -#: ../src/file.c:664 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "Datei »%s« überschreiben?" - -#: ../src/file.c:668 -msgid "File already exists." -msgstr "Datei existiert bereits." - -#: ../src/file.c:764 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "Änderungen am Dokument »%s« vor dem Schließen speichern?" - -#: ../src/file.c:768 -msgid "Your changes will be lost if you don't save them." -msgstr "Nicht gespeicherte Änderungen gehen verloren, wenn Sie nicht speichern." - -#: ../src/file.c:771 -msgid "Close without saving" -msgstr "Schließen, ohne zu speichern" - -#. Should not happen -#: ../src/prefs.c:159 ../src/prefs.c:166 -#: ../data/builder/object-editor.glade.h:43 -#: ../data/builder/prefs-dialog.glade.h:22 -msgid "points" -msgstr "Punkte" - -#: ../src/prefs.c:161 ../data/builder/object-editor.glade.h:42 -#: ../data/builder/template-designer.glade.h:64 -msgid "inches" -msgstr "Zoll" - -#: ../src/prefs.c:163 -msgid "mm" -msgstr "mm" - -#: ../src/prefs-dialog.c:167 ../data/builder/prefs-dialog.glade.h:21 -msgid "gLabels Preferences" -msgstr "gLabels-Einstellungen" - -#. Build editor. -#: ../src/view-box.c:175 -msgid "Box object properties" -msgstr "Eigenschaften des Rechteck-Objekts" - -#. Build editor. -#: ../src/view-ellipse.c:175 -msgid "Ellipse object properties" -msgstr "Eigenschaften des Ellipsen-Objekts" - -#. Build editor. -#: ../src/view-line.c:174 -msgid "Line object properties" -msgstr "Eigenschaften des Linien-Objekts" - -#. Build editor. -#: ../src/view-image.c:174 -msgid "Image object properties" -msgstr "Eigenschaften des Bild-Objekts" - -#. Build editor. -#: ../src/view-text.c:178 -msgid "Text object properties" -msgstr "Eigenschaften des Text-Objekts" - -#. Build editor. -#: ../src/view-barcode.c:174 -msgid "Barcode object properties" -msgstr "Eigenschaften des Strichcode-Objekts" - -#: ../src/object-editor-image-page.c:267 -msgid "All Files" -msgstr "Alle Dateien" - -#: ../src/object-editor-image-page.c:272 -msgid "All Images" -msgstr "Alle Bilder" - -#: ../src/object-editor-image-page.c:287 -#, c-format -msgid "%s (*.%s)" -msgstr "%s (*.%s)" - -#: ../src/merge-properties-dialog.c:271 -msgid "Merge Properties" -msgstr "Mischeinstellungen" - -#: ../src/merge-properties-dialog.c:297 ../src/merge-properties-dialog.c:405 -msgid "Select merge-database source" -msgstr "Wählen Sie die einzumischende Datenquelle" - -#: ../src/merge-properties-dialog.c:306 ../src/merge-properties-dialog.c:425 -msgid "N/A" -msgstr "Nicht verfügbar" - -#: ../src/merge-properties-dialog.c:332 -msgid "Select" -msgstr "Markieren" - -#: ../src/merge-properties-dialog.c:340 -msgid "Record/Field" -msgstr "Feld" - -#: ../src/merge-properties-dialog.c:348 -#: ../data/builder/object-editor.glade.h:10 -msgid "Data" -msgstr "Wert" - -#: ../src/merge-properties-dialog.c:418 -msgid "Fixed" -msgstr "Fixiert" - -#. =================================================================== -#: ../src/print-op.c:242 ../src/wdgt-print-copies.c:171 -#: ../data/templates/misc-iso-templates.xml.h:34 -msgid "Labels" -msgstr "Labels" - -#: ../src/template-designer.c:411 -msgid "gLabels Template Designer" -msgstr "gLabels Vorlagen-Designer" - -#: ../src/template-designer.c:481 -msgid "Welcome" -msgstr "Willkommen" - -#: ../src/template-designer.c:534 -msgid "Name and Description" -msgstr "Name und Beschreibung" - -#: ../src/template-designer.c:595 -msgid "Page Size" -msgstr "Seitenformat" - -#: ../src/template-designer.c:675 -msgid "Label or Card Shape" -msgstr "Form des neuen Etiketts oder der neuen Karte" - -#: ../src/template-designer.c:735 -msgid "Label or Card Size" -msgstr "Größe des neuen Etiketts oder der neuen Karte" - -#: ../src/template-designer.c:844 -msgid "Label Size (round)" -msgstr "Etikettengröße (rund)" - -#: ../src/template-designer.c:935 -msgid "Label Size (CD/DVD)" -msgstr "Etikettengröße (CD/DVD)" - -#: ../src/template-designer.c:1036 -msgid "Number of Layouts" -msgstr "Anzahl der Layouts" - -#: ../src/template-designer.c:1110 -msgid "Layout(s)" -msgstr "Layout(s)" - -#: ../src/template-designer.c:1229 -msgid "Design Completed" -msgstr "Design ist komplett" - -#: ../src/template-designer.c:1396 -msgid "" -"Brand and part# match an existing " -"template!" -msgstr "" -"Für diese Marke und Nummer wurde eine " -"Vorlage gefunden!" - -#: ../src/bc.c:67 -msgid "POSTNET (any)" -msgstr "POSTNET (allgemein)" - -#: ../src/bc.c:70 -msgid "POSTNET-5 (ZIP only)" -msgstr "POSTNET-5 (nur ZIP)" - -#: ../src/bc.c:73 -msgid "POSTNET-9 (ZIP+4)" -msgstr "POSTNET-9 (ZIP+4)" - -#: ../src/bc.c:76 -msgid "POSTNET-11 (DPBC)" -msgstr "POSTNET-11 (DPBC)" - -#: ../src/bc.c:79 -msgid "CEPNET" -msgstr "CEPNET" - -#: ../src/bc.c:82 -msgid "EAN (any)" -msgstr "EAN (any)" - -#: ../src/bc.c:85 -msgid "EAN-8" -msgstr "EAN-8" - -#: ../src/bc.c:88 -msgid "EAN-8 +2" -msgstr "EAN-8 +2" - -#: ../src/bc.c:91 -msgid "EAN-8 +5" -msgstr "EAN-8 +5" - -#: ../src/bc.c:94 -msgid "EAN-13" -msgstr "EAN-13" - -#: ../src/bc.c:97 -msgid "EAN-13 +2" -msgstr "EAN-13 +2" - -#: ../src/bc.c:100 -msgid "EAN-13 +5" -msgstr "EAN-13 +5" - -#: ../src/bc.c:103 -msgid "UPC (UPC-A or UPC-E)" -msgstr "UPC (UPC-A oder UPC-E)" - -#: ../src/bc.c:106 -msgid "UPC-A" -msgstr "UPC-A" - -#: ../src/bc.c:109 -msgid "UPC-A +2" -msgstr "UPC-A +2" - -#: ../src/bc.c:112 -msgid "UPC-A +5" -msgstr "UPC-A +5" - -#: ../src/bc.c:115 -msgid "UPC-E" -msgstr "UPC-E" - -#: ../src/bc.c:118 -msgid "UPC-E +2" -msgstr "UPC-E +2" - -#: ../src/bc.c:121 -msgid "UPC-E +5" -msgstr "UPC-E +5" - -#: ../src/bc.c:124 -msgid "ISBN" -msgstr "ISBN" - -#: ../src/bc.c:127 -msgid "ISBN +5" -msgstr "ISBN +5" - -#: ../src/bc.c:130 -msgid "Code 39" -msgstr "Code 39" - -#: ../src/bc.c:133 -msgid "Code 128" -msgstr "Code 128" - -#: ../src/bc.c:136 -msgid "Code 128C" -msgstr "Code 128C" - -#: ../src/bc.c:139 -msgid "Code 128B" -msgstr "Code 128B" - -#: ../src/bc.c:142 -msgid "Interleaved 2 of 5" -msgstr "Interleaved 2 of 5" - -#: ../src/bc.c:145 -msgid "Codabar" -msgstr "Codabar" - -#: ../src/bc.c:148 -msgid "MSI" -msgstr "MSI" - -#: ../src/bc.c:151 -msgid "Plessey" -msgstr "Plessey" - -#: ../src/bc.c:154 -msgid "IEC16022 (DataMatrix)" -msgstr "IEC16022 (DataMatrix)" - -#: ../src/label.c:531 -msgid "Untitled" -msgstr "Unbenannt" - -#: ../src/label-barcode.c:426 -msgid "Barcode data empty" -msgstr "Strichcode-Daten sind leer" - -#: ../src/label-barcode.c:430 -msgid "Invalid barcode data" -msgstr "Ungültige Strichcode-Daten" - -#: ../src/xml-label.c:189 ../src/xml-label.c:226 -msgid "xmlParseFile error" -msgstr "Fehler: xmlParseFile error" - -#: ../src/xml-label.c:262 -msgid "No document root" -msgstr "Kein document root" - -#: ../src/xml-label.c:270 -msgid "Importing from glabels 0.1 format" -msgstr "Aus dem glabels 0.1-Format wird importiert" - -#: ../src/xml-label.c:279 -msgid "Importing from glabels 0.4 format" -msgstr "Aus dem glabels 0.4-Format wird importiert" - -#: ../src/xml-label.c:288 -#, c-format -msgid "Unknown glabels Namespace -- Using %s" -msgstr "Unbekannter glabels-Namensraum -- %s wird verwendet" - -#: ../src/xml-label.c:319 ../src/xml-label-04.c:79 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "Fehlerhafter root node = »%s«" - -#: ../src/xml-label.c:356 -#, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "Ungültiger Node im Dokument-Node = »%s«" - -#: ../src/xml-label.c:401 ../src/xml-label-04.c:127 -#, c-format -msgid "bad node = \"%s\"" -msgstr "fehlerhafter node = »%s«" - -#: ../src/xml-label.c:840 -#, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "Ungültiger Node im Daten-Node = »%s«" - -#: ../src/xml-label.c:1077 ../libglabels/xml-template.c:670 -msgid "Utf8 conversion error." -msgstr "Fehler in der UTF8-Umwandlung." - -#: ../src/xml-label.c:1084 -msgid "Problem saving xml file." -msgstr "Problem beim Speichern der xml-Datei." - -#: ../src/merge.c:170 ../src/merge.c:211 ../src/merge.c:375 ../src/merge.c:378 -msgid "None" -msgstr "Keine" - -#: ../src/merge-init.c:59 -msgid "Text file with comma delimeters (CSV)" -msgstr "Textdatei mit Kommata als Trennern (CSV)" - -#: ../src/merge-init.c:66 -msgid "Text file with colon delimeters" -msgstr "Textdatei mit Semikola als Trennern" - -#: ../src/merge-init.c:73 -msgid "Text file with tab delimeters" -msgstr "Textdatei mit Tabulatoren als Trennern" - -#: ../src/merge-init.c:82 -msgid "Data from default Evolution Addressbook" -msgstr "Daten aus dem vorgegebenen Evolution-Adressbuch" - -#: ../src/merge-init.c:88 -msgid "Data from a file containing VCards" -msgstr "Daten aus einer Datei, die VCards enthält" - -#: ../src/merge-evolution.c:309 -msgid "Couldn't construct query" -msgstr "Abfrage konnte nicht erstellt werden" - -#: ../src/merge-evolution.c:315 ../src/merge-evolution.c:326 -msgid "Couldn't open addressbook." -msgstr "Adressbuch konnte nicht geöffnet werden" - -#: ../src/merge-evolution.c:341 -msgid "Couldn't list available fields." -msgstr "Verfügbare Felder konnten nicht aufgelistet werden." - -#: ../src/merge-evolution.c:377 -msgid "Couldn't get contacts." -msgstr "Kontakte konnten nicht geholt werden." - -#: ../src/color-combo.c:210 -msgid "Default Color" -msgstr "Standardfarbe" - -#: ../src/color-combo-menu.c:86 -msgid "Dark Red" -msgstr "Dunkelrot" - -#: ../src/color-combo-menu.c:87 -msgid "Brown" -msgstr "Braun" - -#: ../src/color-combo-menu.c:88 -msgid "Dark Goldenrod" -msgstr "Dunkle Goldrute" - -#: ../src/color-combo-menu.c:89 -msgid "Dark Green" -msgstr "Dunkles Grün" - -#: ../src/color-combo-menu.c:90 -msgid "Dark Cyan" -msgstr "Dunkles Cyan-Blau" - -#: ../src/color-combo-menu.c:91 -msgid "Navy Blue" -msgstr "Marineblau" - -#: ../src/color-combo-menu.c:92 -msgid "Dark Violet" -msgstr "Dunkles Violett" - -#: ../src/color-combo-menu.c:94 -msgid "Red" -msgstr "Rot" - -#: ../src/color-combo-menu.c:95 -msgid "Orange" -msgstr "Orange" - -#: ../src/color-combo-menu.c:96 -msgid "Dark Yellow" -msgstr "Dunkles Gelb" - -#: ../src/color-combo-menu.c:97 -msgid "Medium green" -msgstr "Mittelgrün" - -#: ../src/color-combo-menu.c:98 -msgid "Turquoise" -msgstr "Türkis" - -#: ../src/color-combo-menu.c:99 -msgid "Blue" -msgstr "Blau" - -#: ../src/color-combo-menu.c:100 -msgid "Purple" -msgstr "Purpur" - -#: ../src/color-combo-menu.c:102 -msgid "Salmon" -msgstr "Lachs" - -#: ../src/color-combo-menu.c:103 -msgid "Gold" -msgstr "Gold" - -#: ../src/color-combo-menu.c:104 -msgid "Yellow" -msgstr "Gelb" - -#: ../src/color-combo-menu.c:105 -msgid "Green" -msgstr "Grün" - -#: ../src/color-combo-menu.c:106 -msgid "Cyan" -msgstr "Cyan-Blau" - -#: ../src/color-combo-menu.c:107 -msgid "SkyBlue" -msgstr "Himmelblau" - -#: ../src/color-combo-menu.c:108 -msgid "Violet" -msgstr "Violett" - -#: ../src/color-combo-menu.c:110 -msgid "Pink" -msgstr "Pink" - -#: ../src/color-combo-menu.c:111 -msgid "Khaki" -msgstr "Khaki" - -#: ../src/color-combo-menu.c:112 -msgid "Light Yellow" -msgstr "Helles Gelb" - -#: ../src/color-combo-menu.c:113 -msgid "Light Green" -msgstr "Helles Grün" - -#: ../src/color-combo-menu.c:114 -msgid "Light Cyan" -msgstr "Helles Cyan-Blau" - -#: ../src/color-combo-menu.c:115 -msgid "Slate Gray" -msgstr "Schiefergrau" - -#: ../src/color-combo-menu.c:116 -msgid "Thistle" -msgstr "Distle" - -#: ../src/color-combo-menu.c:118 -msgid "White" -msgstr "Weiß" - -#: ../src/color-combo-menu.c:119 -#, c-format -msgid "10% Gray" -msgstr "10% Grau" - -#: ../src/color-combo-menu.c:120 -#, c-format -msgid "25% Gray" -msgstr "25% Grau" - -#: ../src/color-combo-menu.c:121 -#, c-format -msgid "40% Gray" -msgstr "40% Grau" - -#: ../src/color-combo-menu.c:122 -#, c-format -msgid "50% Gray" -msgstr "50% Grau" - -#: ../src/color-combo-menu.c:123 -#, c-format -msgid "60% Gray" -msgstr "60% Grau" - -#: ../src/color-combo-menu.c:124 -msgid "Black" -msgstr "Schwarz" - -#: ../src/color-combo-menu.c:252 ../src/color-combo-menu.c:369 -msgid "Custom Color" -msgstr "Benutzerdefinierte Farbe" - -#: ../src/color-combo-menu.c:317 -#, c-format -msgid "Custom Color #%u" -msgstr "Benutzerdefinierte Farbe #%u" - -#: ../src/wdgt-print-copies.c:153 -msgid "Sheets:" -msgstr "Seiten:" - -#: ../src/wdgt-print-copies.c:173 -msgid "from:" -msgstr "von:" - -#: ../src/wdgt-print-copies.c:179 -msgid "to:" -msgstr "bis:" - -#: ../src/wdgt-print-merge.c:154 -msgid "Start on label" -msgstr "Start bei Etikett" - -#: ../src/wdgt-print-merge.c:161 -msgid "on 1st sheet" -msgstr "auf erster Seite" - -#: ../src/wdgt-print-merge.c:170 -msgid "Copies:" -msgstr "Kopien:" - -#: ../src/wdgt-print-merge.c:176 -msgid "Collate" -msgstr "Zuordnen" - -#: ../src/wdgt-media-select.c:290 ../src/wdgt-media-select.c:294 -#: ../src/wdgt-media-select.c:299 ../src/wdgt-media-select.c:308 -#: ../src/wdgt-media-select.c:311 ../src/wdgt-media-select.c:404 -#: ../src/wdgt-media-select.c:611 ../src/wdgt-media-select.c:620 -msgid "Any" -msgstr "Beliebig" - -#: ../src/wdgt-media-select.c:645 -#, c-format -msgid "%d per sheet" -msgstr "%d pro Seite" - -#: ../src/wdgt-media-select.c:675 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -#: ../src/wdgt-media-select.c:680 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: ../src/wdgt-media-select.c:691 ../src/wdgt-media-select.c:705 -#, c-format -msgid "%s %s diameter" -msgstr "%s %s Durchmesser" - -#: ../src/wdgt-media-select.c:695 ../src/wdgt-media-select.c:709 -#, c-format -msgid "%.5g %s diameter" -msgstr "%.5g %s Durchmesser" - -#: ../src/wdgt-media-select.c:783 -msgid "No recent templates found." -msgstr "Keine zuletzt benutzten Vorlagen gefunden." - -#: ../src/wdgt-media-select.c:784 -msgid "Try selecting a template from the \"Search all templates\" page." -msgstr "" -"Bitte versuchen Sie, eine Vorlage in »Alle Vorlagen durchsuchen« auszuwählen." - -#: ../src/wdgt-media-select.c:863 -msgid "No match." -msgstr "Keine Treffer." - -#: ../src/wdgt-media-select.c:864 -msgid "Try selecting a different brand, page size or category." -msgstr "" -"Versuchen Sie eine andere Marke, Seitengröße oder Kategorie auszuwählen." - -#: ../src/wdgt-rotate-label.c:129 -msgid "Normal" -msgstr "Normal" - -#: ../src/wdgt-rotate-label.c:130 -msgid "Rotated" -msgstr "Gedreht" - -#: ../src/critical-error-handler.c:73 -msgid "gLabels Fatal Error!" -msgstr "Schwerwiegender Fehler in gLabels!" - -#: ../src/warning-handler.c:73 -msgid "gLabels Error!" -msgstr "gLabels-Fehler!" - -#. Create and append an "Other" entry. -#: ../libglabels/db.c:118 -msgid "Other" -msgstr "Andere" - -#. Create and append a "User defined" entry. -#: ../libglabels/db.c:131 -msgid "User defined" -msgstr "Benutzerdefiniert" - -#: ../libglabels/db.c:482 -msgid "" -"Unable to locate paper size definitions. Libglabels may not be installed " -"correctly!" -msgstr "" -"Die Definitionen der Papiergrößen konnten nicht gefunden werden. Libglabels " -"ist möglicherweise nicht korrekt installiert!" - -#: ../libglabels/db.c:875 -msgid "" -"Unable to locate category definitions. Libglabels may not be installed " -"correctly!" -msgstr "" -"Es war nicht möglich, Kategorie-Definitionen zu finden. Libglabels könnte " -"möglicherweise nicht korrekt installiert sein!" - -#: ../libglabels/db.c:1461 -msgid "" -"Unable to locate any template files. Libglabels may not be installed " -"correctly!" -msgstr "" -"Es konnten keine Vorlagendateien gefunden werden. Möglicherweise ist " -"libglabels nicht korrekt installiert!" - -#: ../libglabels/db.c:1538 -#, c-format -msgid "Generic %s full page template" -msgstr "Allgemeine Ganzseitenvorlage %s" - -#: ../libglabels/xml-template.c:227 -msgid "Missing name or brand/part attributes." -msgstr "Name oder Attribute für Marke/Nummer fehlen." - -#. This should always be an id, but just in case a name -#. slips by! -#: ../libglabels/xml-template.c:244 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "Unbekannte Kennung der Seitengröße »%s«, wird als Name versucht" - -#: ../libglabels/xml-template.c:256 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "Unbekannte Kennung der Seitengröße oder Name »%s«" - -#: ../libglabels/xml-template.c:615 -msgid "" -"Missing required \"brand\" or \"part\" attribute, trying deprecated name." -msgstr "" -"Benötigte Attribute »brand« oder »part« fehlt, missbilligter Name wird " -"versucht. " - -#: ../libglabels/xml-template.c:625 -msgid "Name attribute also missing." -msgstr "Name des Attributs fehlt ebenfalls." - -#: ../data/builder/merge-properties-dialog.glade.h:1 -msgid "Record selection/preview" -msgstr "Feldauswahl/Vorschau" - -#: ../data/builder/merge-properties-dialog.glade.h:2 -msgid "Source" -msgstr "Quelle" - -#: ../data/builder/merge-properties-dialog.glade.h:3 -msgid "Format:" -msgstr "Format:" - -#: ../data/builder/merge-properties-dialog.glade.h:4 -msgid "Location:" -msgstr "Ort:" - -#: ../data/builder/merge-properties-dialog.glade.h:5 -msgid "Select all" -msgstr "Alles markieren" - -#: ../data/builder/merge-properties-dialog.glade.h:6 -msgid "Unselect all" -msgstr "Markierung aufheben" - -#: ../data/builder/merge-properties-dialog.glade.h:7 -#: ../data/builder/object-editor.glade.h:39 -msgid "dialog1" -msgstr "dialog1" - -#: ../data/builder/new-label-dialog.glade.h:1 -msgid "Label orientation" -msgstr "Ausrichtung des Etiketts" - -#: ../data/builder/new-label-dialog.glade.h:2 -msgid "Media type" -msgstr "Medientyp" - -#: ../data/builder/object-editor.glade.h:2 -#, no-c-format -msgid "%" -msgstr "%" - -#: ../data/builder/object-editor.glade.h:3 -msgid "00000000000 00000" -msgstr "00000000000 00000" - -#: ../data/builder/object-editor.glade.h:4 -msgid "Xxx object properties" -msgstr "Xxx-Objekteigenschaften" - -#: ../data/builder/object-editor.glade.h:5 -#: ../data/builder/prefs-dialog.glade.h:7 -msgid "Alignment:" -msgstr "Ausrichtung:" - -#: ../data/builder/object-editor.glade.h:6 -msgid "Allow merge to automatically shrink text" -msgstr "Automatisches Anpassen der Textgröße erlauben" - -#: ../data/builder/object-editor.glade.h:7 -msgid "Angle:" -msgstr "Winkel:" - -#: ../data/builder/object-editor.glade.h:8 -msgid "Checksum" -msgstr "Prüfsumme" - -#: ../data/builder/object-editor.glade.h:9 -#: ../data/builder/prefs-dialog.glade.h:8 -msgid "Color:" -msgstr "Farbe:" - -#: ../data/builder/object-editor.glade.h:11 -msgid "Enable shadow" -msgstr "Schattierung aktivieren" - -#: ../data/builder/object-editor.glade.h:12 -msgid "Family:" -msgstr "Familie:" - -#: ../data/builder/object-editor.glade.h:13 -msgid "File:" -msgstr "Datei:" - -#: ../data/builder/object-editor.glade.h:14 -msgid "Fill" -msgstr "Füllen" - -#: ../data/builder/object-editor.glade.h:15 -#: ../data/builder/template-designer.glade.h:30 -msgid "Height:" -msgstr "Höhe" - -#: ../data/builder/object-editor.glade.h:17 -msgid "Insert merge field" -msgstr "Datenfeld einfügen" - -#: ../data/builder/object-editor.glade.h:18 -msgid "Key:" -msgstr "Schlüssel:" - -#: ../data/builder/object-editor.glade.h:19 -msgid "Length:" -msgstr "Länge:" - -#: ../data/builder/object-editor.glade.h:21 -#: ../data/builder/prefs-dialog.glade.h:12 -msgid "Line Spacing:" -msgstr "Zeilenabstand:" - -#: ../data/builder/object-editor.glade.h:22 -msgid "Literal:" -msgstr "Literale:" - -#: ../data/builder/object-editor.glade.h:23 -msgid "Opacity:" -msgstr "Transparenz:" - -#: ../data/builder/object-editor.glade.h:24 -msgid "Position" -msgstr "Position" - -#: ../data/builder/object-editor.glade.h:25 -msgid "Reset image size" -msgstr "Bildgröße zurücksetzen" - -#: ../data/builder/object-editor.glade.h:26 -msgid "Select A File" -msgstr "Datei auswählen" - -#: ../data/builder/object-editor.glade.h:27 -msgid "Shadow" -msgstr "Schattierung" - -#: ../data/builder/object-editor.glade.h:28 -msgid "Size" -msgstr "Breite" - -#: ../data/builder/object-editor.glade.h:29 -msgid "Size:" -msgstr "Größe:" - -#: ../data/builder/object-editor.glade.h:30 -msgid "Style" -msgstr "Stil" - -#: ../data/builder/object-editor.glade.h:31 -msgid "Style:" -msgstr "Stil:" - -#: ../data/builder/object-editor.glade.h:33 -#: ../data/builder/prefs-dialog.glade.h:20 -#: ../data/builder/template-designer.glade.h:61 -msgid "Width:" -msgstr "Breite:" - -#: ../data/builder/object-editor.glade.h:34 -msgid "X Offset:" -msgstr "X-Versatz:" - -#: ../data/builder/object-editor.glade.h:35 -msgid "X:" -msgstr "X:" - -#: ../data/builder/object-editor.glade.h:36 -msgid "Y Offset:" -msgstr "Y-Versatz:" - -#: ../data/builder/object-editor.glade.h:37 -msgid "Y:" -msgstr "Y:" - -#: ../data/builder/object-editor.glade.h:38 -msgid "degrees" -msgstr "Grad" - -#: ../data/builder/object-editor.glade.h:40 -msgid "digits:" -msgstr "Zeichen:" - -#: ../data/builder/object-editor.glade.h:41 -msgid "format:" -msgstr "Format:" - -#: ../data/builder/prefs-dialog.glade.h:1 -msgid " " -msgstr " " - -#: ../data/builder/prefs-dialog.glade.h:2 -msgid "Default page size" -msgstr "Vorgegebene Seitengröße" - -#: ../data/builder/prefs-dialog.glade.h:3 -msgid "Fill" -msgstr "Füllung" - -#: ../data/builder/prefs-dialog.glade.h:4 -msgid "Line" -msgstr "Linie" - -#: ../data/builder/prefs-dialog.glade.h:5 -msgid "Text" -msgstr "Text" - -#: ../data/builder/prefs-dialog.glade.h:6 -msgid "Units" -msgstr "Einheiten" - -#: ../data/builder/prefs-dialog.glade.h:9 -msgid "Font:" -msgstr "Schrift:" - -#: ../data/builder/prefs-dialog.glade.h:10 -msgid "ISO A4" -msgstr "A4" - -#: ../data/builder/prefs-dialog.glade.h:11 -msgid "Inches" -msgstr "Zoll" - -#: ../data/builder/prefs-dialog.glade.h:13 -msgid "Locale" -msgstr "Spracheinstellung" - -#: ../data/builder/prefs-dialog.glade.h:14 -msgid "Millimeters" -msgstr "Millimeter" - -#: ../data/builder/prefs-dialog.glade.h:15 -msgid "Object defaults" -msgstr "Objekt-Vorgaben" - -#: ../data/builder/prefs-dialog.glade.h:16 -msgid "Points" -msgstr "Punkte" - -#: ../data/builder/prefs-dialog.glade.h:17 -msgid "Select default properties for new objects." -msgstr "Wählen Sie die vorgegebenen Eigenschaften für neue Objekte." - -#: ../data/builder/prefs-dialog.glade.h:18 -msgid "Select locale specific behavior." -msgstr "Wählen Sie hier Einstellungen gemäß Ihrer Sprache/Ihres Landes." - -#. Most popular (at top of list) -#: ../data/builder/prefs-dialog.glade.h:19 -#: ../data/templates/paper-sizes.xml.h:29 -msgid "US Letter" -msgstr "US-Letter" - -#: ../data/builder/print-custom-widget.glade.h:1 -msgid "Options" -msgstr "Optionen" - -#: ../data/builder/print-custom-widget.glade.h:2 -msgid "Print control (Merge)" -msgstr "Drucksteuerung (Mischen)" - -#: ../data/builder/print-custom-widget.glade.h:3 -msgid "Print control (Simple)" -msgstr "Drucksteuerung (Einfach)" - -#: ../data/builder/property-bar.glade.h:1 -msgid "Bold" -msgstr "Fett" - -#: ../data/builder/property-bar.glade.h:2 -msgid "Center align" -msgstr "Zentrieren" - -#: ../data/builder/property-bar.glade.h:4 -msgid "Font family" -msgstr "Schriftfamilie" - -#: ../data/builder/property-bar.glade.h:5 -msgid "Font size" -msgstr "Schriftgröße" - -#: ../data/builder/property-bar.glade.h:6 -msgid "Italic" -msgstr "Kursiv" - -#: ../data/builder/property-bar.glade.h:7 -msgid "Left align" -msgstr "Linksbündig" - -#: ../data/builder/property-bar.glade.h:9 -msgid "Line width" -msgstr "Linienbreite" - -#: ../data/builder/property-bar.glade.h:10 -msgid "Right align" -msgstr "Rechtsbündig" - -#: ../data/builder/property-bar.glade.h:11 -msgid "Text Color" -msgstr "Textfarbe" - -#: ../data/builder/template-designer.glade.h:1 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "(z.B. »Adressaufkleber«, »Visitenkarten« …)" - -#: ../data/builder/template-designer.glade.h:2 -msgid "(e.g., 8163A)" -msgstr "(z.B., 8163A)" - -#: ../data/builder/template-designer.glade.h:3 -msgid "(e.g., Avery, Acme, ...)" -msgstr "(z.B., Avery, Acme, ...)" - -#: ../data/builder/template-designer.glade.h:4 -msgid "1. Outer radius:" -msgstr "1. Äußerer Radius:" - -#: ../data/builder/template-designer.glade.h:5 -msgid "1. Radius:" -msgstr "1. Radius:" - -#: ../data/builder/template-designer.glade.h:6 -msgid "1. Width:" -msgstr "1. Breite:" - -#: ../data/builder/template-designer.glade.h:7 -msgid "2. Height:" -msgstr "2. Höhe:" - -#: ../data/builder/template-designer.glade.h:8 -msgid "2. Inner radius:" -msgstr "2. Innerer Radius:" - -#: ../data/builder/template-designer.glade.h:9 -msgid "2. Waste (overprint allowed):" -msgstr "2. Überstand (Bedrucken erlaubt):" - -#: ../data/builder/template-designer.glade.h:10 -msgid "3. Clipping width:" -msgstr "3. Innere Breite:" - -#: ../data/builder/template-designer.glade.h:11 -msgid "3. Margin" -msgstr "3. Ränder" - -#: ../data/builder/template-designer.glade.h:12 -msgid "3. Round (radius of corner):" -msgstr "3. Rundung (Radius der Ecken):" - -#: ../data/builder/template-designer.glade.h:13 -msgid "4. Clipping height:" -msgstr "4. Innere Höhe:" - -#: ../data/builder/template-designer.glade.h:14 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "4. Horiz. Überstand (Bedrucken erlaubt):" - -#: ../data/builder/template-designer.glade.h:15 -msgid "5. Vert. waste (overprint allowed):" -msgstr "3. Vert. Überstand (Bedrucken erlaubt):" - -#: ../data/builder/template-designer.glade.h:16 -msgid "5. Waste (overprint allowed):" -msgstr "5. Überstand (Bedrucken erlaubt):" - -#: ../data/builder/template-designer.glade.h:17 -msgid "6. Margin" -msgstr "6. Rand" - -#: ../data/builder/template-designer.glade.h:18 -msgid "Brand/Manufacturer:" -msgstr "Marke/Hersteller:" - -#: ../data/builder/template-designer.glade.h:19 -msgid "CD/DVD (including credit card CDs)" -msgstr "CD/DVD (einschließlich Kreditkarten-CDs)" - -#: ../data/builder/template-designer.glade.h:20 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "" -"Herzlichen Glückwunsch!\n" -"\n" -"Das Erzeugen der Vorlage ist abgeschlossen.\n" -"Falls Sie diese Vorlage akzeptieren und speichern wollen,\n" -"klicken Sie auf »Akzeptieren«.\n" -"\n" -"Anderenfalls klicken Sie auf »Abbrechen«, um die\n" -"Vorlage zu verwerfen, oder auf »Zurück«,\n" -"um die Vorlage erneut zu bearbeiten." - -#: ../data/builder/template-designer.glade.h:27 -msgid "Description:" -msgstr "Beschreibung:" - -#: ../data/builder/template-designer.glade.h:28 -msgid "Distance from left edge (x0):" -msgstr "Abstand vom linken Rand (x0):" - -#: ../data/builder/template-designer.glade.h:29 -msgid "Distance from top edge (y0):" -msgstr "Abstand vom oberen Rand (x0):" - -#: ../data/builder/template-designer.glade.h:31 -msgid "Horizontal pitch (dx):" -msgstr "Horizontaler Abstand (dx):" - -#: ../data/builder/template-designer.glade.h:32 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" -"Wie viele Layouts wird Ihre Vorlage enthalten?\n" -"\n" -"Ein Layout ist ein Satz von Etiketten oder Karten, die in einem einfachen " -"Raster\n" -"angeordnet sind. Die meisten Vorlagen verwenden nur ein Layout, wie im\n" -"ersten Beispiel. Das zweite Beispiel zeigt die Verwendung zweier Layouts." - -#: ../data/builder/template-designer.glade.h:37 -msgid "Layout #1" -msgstr "Layout #1" - -#: ../data/builder/template-designer.glade.h:38 -msgid "Layout #2" -msgstr "Layout #2" - -#: ../data/builder/template-designer.glade.h:39 -msgid "Number across (nx):" -msgstr "Anzahl horizontal (nx):" - -#: ../data/builder/template-designer.glade.h:40 -msgid "Number down (ny):" -msgstr "Anzahl vertikal (ny):" - -#: ../data/builder/template-designer.glade.h:41 -msgid "Number of layouts:" -msgstr "Anzahl der Layouts:" - -#: ../data/builder/template-designer.glade.h:42 -#: ../data/builder/wdgt-media-select.glade.h:3 -msgid "Page size:" -msgstr "Seitenformat:" - -#: ../data/builder/template-designer.glade.h:43 -msgid "Part #:" -msgstr "Nummer:" - -#: ../data/builder/template-designer.glade.h:44 -msgid "" -"Please enter the following identifying information about the template " -"stationery." -msgstr "" -"Bitte geben Sie die folgenden Identifizierungsinformationen über die Vorlage " -"an." - -#: ../data/builder/template-designer.glade.h:45 -msgid "Please enter the following layout information." -msgstr "Bitte geben Sie die folgenden Layout-Informationen ein." - -#: ../data/builder/template-designer.glade.h:46 -msgid "" -"Please enter the following size parameters of a single label in your template." -msgstr "" -"Bitte geben Sie die folgenden Größenwerte des einzelnen Etiketts in Ihrer " -"Vorlage an." - -#: ../data/builder/template-designer.glade.h:47 -msgid "" -"Please enter the following size parameters of a single label or card in your " -"template." -msgstr "" -"Bitte geben Sie die folgenden Größenwerte des einzelnen Etiketts oder der " -"einzelnen Karte in Ihrer Vorlage an." - -#: ../data/builder/template-designer.glade.h:48 -msgid "Please select the basic shape of the labels or cards." -msgstr "Bitte wählen Sie die Grundform der Etiketten oder Karten aus." - -#: ../data/builder/template-designer.glade.h:49 -msgid "Please select the page size of the template stationery." -msgstr "Bitte wählen Si das Papierformat der Vorlage aus." - -#: ../data/builder/template-designer.glade.h:50 -msgid "Print test sheet" -msgstr "Textseite drucken" - -#: ../data/builder/template-designer.glade.h:51 -msgid "Rectangular or square (can have rounded corners)" -msgstr "Rechteckig oder quadratisch (auch mit abgerundeten Ecken)" - -#: ../data/builder/template-designer.glade.h:52 -msgid "Round" -msgstr "Rund" - -#: ../data/builder/template-designer.glade.h:53 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" -"Vorlagen benötigen\n" -"zwei Layouts." - -#: ../data/builder/template-designer.glade.h:55 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" -"Vorlagen benötigen nur\n" -"ein Layout." - -#: ../data/builder/template-designer.glade.h:57 -msgid "Vertical pitch (dy):" -msgstr "Vertikaler Abstand (dy):" - -#: ../data/builder/template-designer.glade.h:58 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" -"Willkommen zum gLabels Vorlagen-Designer.\n" -"\n" -"Dieser Dialog wird Sie beim Erstellen einer benutzerdefinierten\n" -"gLabels-Vorlage unterstützen." - -#: ../data/builder/template-designer.glade.h:62 -msgid "cd_size_page" -msgstr "cd_size_page" - -#: ../data/builder/template-designer.glade.h:63 -msgid "finish_page" -msgstr "finish_page" - -#: ../data/builder/template-designer.glade.h:65 -msgid "layout_page" -msgstr "layout_page" - -#: ../data/builder/template-designer.glade.h:66 -msgid "name_page" -msgstr "name_page" - -#: ../data/builder/template-designer.glade.h:67 -msgid "nlayouts_page" -msgstr "nlayouts_page" - -#: ../data/builder/template-designer.glade.h:68 -msgid "pg_size_page" -msgstr "pg_size_page" - -#: ../data/builder/template-designer.glade.h:69 -msgid "rect_size_page" -msgstr "rect_size_page" - -#: ../data/builder/template-designer.glade.h:70 -msgid "round_size_page" -msgstr "round_size_page" - -#: ../data/builder/template-designer.glade.h:71 -msgid "shape_page" -msgstr "shape_page" - -#: ../data/builder/template-designer.glade.h:72 -msgid "start_page" -msgstr "start_page" - -#: ../data/builder/wdgt-media-select.glade.h:1 -msgid "Brand:" -msgstr "Marke:" - -#: ../data/builder/wdgt-media-select.glade.h:2 -msgid "Category:" -msgstr "Kategorie:" - -#: ../data/builder/wdgt-media-select.glade.h:4 -msgid "Recent templates" -msgstr "Zuletzt benutzte Vorlagen" - -#: ../data/builder/wdgt-media-select.glade.h:5 -msgid "Search all templates" -msgstr "Alle Vorlagen durchsuchen" - -#. Other ISO A series sizes -#: ../data/templates/paper-sizes.xml.h:2 -msgid "A0" -msgstr "A0" - -#: ../data/templates/paper-sizes.xml.h:3 -msgid "A1" -msgstr "A1" - -#: ../data/templates/paper-sizes.xml.h:4 -msgid "A10" -msgstr "A10" - -#: ../data/templates/paper-sizes.xml.h:5 -msgid "A2" -msgstr "A2" - -#: ../data/templates/paper-sizes.xml.h:6 -msgid "A3" -msgstr "A3" - -#: ../data/templates/paper-sizes.xml.h:7 -msgid "A4" -msgstr "A4" - -#: ../data/templates/paper-sizes.xml.h:8 -msgid "A5" -msgstr "A5" - -#: ../data/templates/paper-sizes.xml.h:9 -msgid "A6" -msgstr "A6" - -#: ../data/templates/paper-sizes.xml.h:10 -msgid "A7" -msgstr "A7" - -#: ../data/templates/paper-sizes.xml.h:11 -msgid "A8" -msgstr "A8" - -#: ../data/templates/paper-sizes.xml.h:12 -msgid "A9" -msgstr "A9" - -#. ISO B series sizes -#: ../data/templates/paper-sizes.xml.h:14 -msgid "B0" -msgstr "B0" - -#: ../data/templates/paper-sizes.xml.h:15 -msgid "B1" -msgstr "B1" - -#: ../data/templates/paper-sizes.xml.h:16 -msgid "B10" -msgstr "B10" - -#: ../data/templates/paper-sizes.xml.h:17 -msgid "B2" -msgstr "B2" - -#: ../data/templates/paper-sizes.xml.h:18 -msgid "B3" -msgstr "B3" - -#: ../data/templates/paper-sizes.xml.h:19 -msgid "B4" -msgstr "B4" - -#: ../data/templates/paper-sizes.xml.h:20 -msgid "B5" -msgstr "B5" - -#: ../data/templates/paper-sizes.xml.h:21 -msgid "B6" -msgstr "B6" - -#: ../data/templates/paper-sizes.xml.h:22 -msgid "B7" -msgstr "B7" - -#: ../data/templates/paper-sizes.xml.h:23 -msgid "B8" -msgstr "B8" - -#: ../data/templates/paper-sizes.xml.h:24 -msgid "B9" -msgstr "B9" - -#: ../data/templates/paper-sizes.xml.h:25 -msgid "US Executive" -msgstr "US Executive" - -#. Other US paper sizes -#: ../data/templates/paper-sizes.xml.h:27 -msgid "US Legal" -msgstr "US Legal" - -#: ../data/templates/categories.xml.h:1 -msgid "Any card" -msgstr "Beliebige Karte" - -#: ../data/templates/categories.xml.h:2 -msgid "Any label" -msgstr "All Etiketten" - -#: ../data/templates/categories.xml.h:3 -msgid "Business cards" -msgstr "Visitenkarten" - -#: ../data/templates/categories.xml.h:4 -msgid "CD/DVD or other media" -msgstr "CD/DVD oder andere Medien" - -#: ../data/templates/categories.xml.h:5 -msgid "Mailing/shipping products" -msgstr "Post- und Versandprodukte" - -#: ../data/templates/categories.xml.h:6 -msgid "Rectangular labels" -msgstr "Rechteckige Etiketten" - -#: ../data/templates/categories.xml.h:7 -msgid "Round labels" -msgstr "Runde Etiketten" - -#: ../data/templates/categories.xml.h:8 -msgid "Square labels" -msgstr "Quadratische Etiketten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:2 -#: ../data/templates/avery-iso-templates.xml.h:2 -#: ../data/templates/dymo-other-templates.xml.h:4 -#: ../data/templates/misc-iso-templates.xml.h:2 -#: ../data/templates/zweckform-iso-templates.xml.h:2 -msgid "Address Labels" -msgstr "Adressaufkleber" - -#. =================================================================== -#. ============================================================ -#. =================================================================== -#. ******************************************************************** -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:4 -#: ../data/templates/avery-iso-templates.xml.h:8 -#: ../data/templates/misc-us-templates.xml.h:4 -#: ../data/templates/misc-iso-templates.xml.h:12 -#: ../data/templates/zweckform-iso-templates.xml.h:6 -msgid "Business Cards" -msgstr "Visitenkarten" - -#. =================================================================== -#. =============================================================== -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:6 -#: ../data/templates/avery-iso-templates.xml.h:14 -#: ../data/templates/misc-us-templates.xml.h:8 -#: ../data/templates/misc-iso-templates.xml.h:16 -#: ../data/templates/zweckform-iso-templates.xml.h:8 -msgid "CD/DVD Labels" -msgstr "CD/DVD-Etiketten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:8 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "CD/DVD-Etiketten (Medienaufkleber)" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:10 -msgid "CD/DVD Labels (Spine Labels)" -msgstr "CD/DVD-Etiketten (Spine Labels)" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:12 -#: ../data/templates/avery-iso-templates.xml.h:16 -msgid "Diskette Labels" -msgstr "Diskettenaufkleber" - -#. the LSK labels can be torn in half down the center -#: ../data/templates/avery-us-templates.xml.h:14 -msgid "Divider Labels" -msgstr "Etiketten für Trennblätter" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:16 -msgid "Filing Labels" -msgstr "Ordneretiketten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:18 -msgid "Full Sheet Labels" -msgstr "Ganzseitige Etiketten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:20 -msgid "ID Labels" -msgstr "Etiketten für Archivierungsordner" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:22 -msgid "Index Cards" -msgstr "Indexkarten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:24 -msgid "Large Round Labels" -msgstr "Große runde Etiketten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:26 -msgid "Name Badge Labels" -msgstr "Namensschid-Etiketten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:28 -msgid "Post cards" -msgstr "Postkarten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:30 -#: ../data/templates/dymo-other-templates.xml.h:12 -msgid "Return Address Labels" -msgstr "Rückantwort-Adressaufkleber" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:32 -msgid "Round Labels" -msgstr "Runde Etiketten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:34 -msgid "Shipping Labels" -msgstr "Versandetiketten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:36 -msgid "Small Round Labels" -msgstr "Kleine runde Etiketten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:38 -msgid "Square Labels" -msgstr "Quadratische Etiketten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:40 -msgid "Tent Cards" -msgstr "Klappkarten" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:42 -msgid "Video Tape Face Labels" -msgstr "Etiketten für Videokassetten (Vorderseite)" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:44 -msgid "Video Tape Spine Labels" -msgstr "Etiketten für Videokassetten (Rückseite)" - -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:4 -msgid "Address labels" -msgstr "Adressaufkleber" - -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:6 -msgid "Allround labels" -msgstr "Universal-Etiketten" - -#. =============================================================== -#: ../data/templates/avery-iso-templates.xml.h:10 -msgid "CD Booklet" -msgstr "CD-Einlegeheft" - -#. =============================================================== -#: ../data/templates/avery-iso-templates.xml.h:12 -msgid "CD Inlet" -msgstr "CD-Einleger" - -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:18 -msgid "Diskette labels" -msgstr "Diskettenaufkleber" - -#. =============================================================== -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:20 -#: ../data/templates/misc-us-templates.xml.h:18 -#: ../data/templates/misc-iso-templates.xml.h:36 -#: ../data/templates/zweckform-iso-templates.xml.h:16 -msgid "Mailing Labels" -msgstr "Adressaufkleber" - -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:22 -msgid "Mailing labels" -msgstr "Adressaufkleber" - -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:24 -msgid "Mini Address Labels" -msgstr "Mini-Adressaufkleber" - -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:26 -msgid "Shipping labels" -msgstr "Versandaufkleber" - -#. =================================================================== -#: ../data/templates/avery-other-templates.xml.h:2 -msgid "File Folder Labels" -msgstr "Aktenordner-Etiketten" - -#: ../data/templates/brother-other-templates.xml.h:1 -msgid "Multi Purpose Labels 17mm x 54mm" -msgstr "Mehrzwecketiketten 17mm x 54mm" - -#: ../data/templates/brother-other-templates.xml.h:2 -msgid "Shipping Labels 62mm x 100mm" -msgstr "Versandetiketten 62mm x 100mm" - -#. -#. ********************************************************************* -#. ********************************************************************* -#. Labels for the Brother QL-500/550/650 PC Label Printers -#. -#. These templates work with the Brother Linux Printer CUPS Driver. It -#. is unknown if these work correctly with the foomatic print driver for -#. these printers. -#. -#. One difference from typical templates is that the template size is -#. not the actual media size - it is the size of the printable area, -#. which is smaller than the media size. This is because (at least with -#. the Brother driver) coordinates are relative the corner of this area. -#. -#. ********************************************************************* -#. ********************************************************************* -#. -#: ../data/templates/brother-other-templates.xml.h:20 -msgid "Standard Address Labels 29mm x 90mm" -msgstr "Standard-Adressaufkleber 29mm x 90mm" - -#. =================================================================== -#: ../data/templates/dymo-other-templates.xml.h:2 -msgid "3.5in Diskette" -msgstr "3.5-Zoll- Diskette" - -#. =================================================================== -#: ../data/templates/dymo-other-templates.xml.h:6 -msgid "File Folder" -msgstr "Aktenordner" - -#. =================================================================== -#: ../data/templates/dymo-other-templates.xml.h:8 -msgid "Hanging Folder" -msgstr "Hängemappe" - -#. =================================================================== -#: ../data/templates/dymo-other-templates.xml.h:10 -msgid "Large Address Labels" -msgstr "Große Adressaufkleber" - -#. =================================================================== -#: ../data/templates/dymo-other-templates.xml.h:14 -msgid "Shipping Address Labels" -msgstr "Versand-Adressaufkleber" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:2 -msgid "Business Card CD" -msgstr "Visitenkarten-CD" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:6 -msgid "CD Template Rectangles" -msgstr "CD-Vorlagen (rechteckig)" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:10 -msgid "CD/DVD Labels (Face Only)" -msgstr "CD/DVD-Etiketten (nur Vorderseite)" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:12 -#: ../data/templates/misc-iso-templates.xml.h:18 -msgid "CD/DVD Labels (face only)" -msgstr "CD/DVD-Etiketten (nur Vorderseite)" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:14 -msgid "Cassette Labels" -msgstr "Kassettenaufkleber" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:16 -msgid "DLT Labels" -msgstr "DLT-Etiketten" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:20 -msgid "Microtube labels" -msgstr "Microtube-Etiketten" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:22 -msgid "Mini-CD Labels" -msgstr "Mini-CD-Etiketten" - -#: ../data/templates/misc-us-templates.xml.h:23 -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "PRO-CD-Etiketten 2-up (nur CD-Spine)" - -#: ../data/templates/misc-us-templates.xml.h:24 -msgid "PRO CD Labels 2-up (Face only)" -msgstr "PRO-CD-Etiketten 2-up (nur Vorderseite)" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:26 -#: ../data/templates/misc-iso-templates.xml.h:42 -msgid "PRO CD Labels 2-up (face only)" -msgstr "PRO-CD-Etiketten 2-up (nur Vorderseite)" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:28 -msgid "Slimline CD Case (rightside up)" -msgstr "Slimline CD Case (normal)" - -#: ../data/templates/misc-us-templates.xml.h:29 -msgid "Slimline CD Case (upside down)" -msgstr "Slimline CD Case (umgekehrt)" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:4 -#: ../data/templates/zweckform-iso-templates.xml.h:4 -msgid "Allround Labels" -msgstr "Universal-Etiketten" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:6 -msgid "Arch File Labels" -msgstr "Etiketten für Archivierungsordner" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:8 -msgid "Arch File Labels (large)" -msgstr "Etiketten für Archivierungsordner (groß)" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:10 -msgid "Arch File Labels (small)" -msgstr "Etiketten für Archivierungsordner (klein)" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:14 -msgid "CD Labels" -msgstr "CD-Aufkleber" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:20 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "CD/DVD-Etiketten im Standardformat (nur Vorderseite)" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:22 -msgid "Diskette Labels (face only)" -msgstr "Diskettenaufkleber (nur Vorderseite)" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:24 -msgid "EPSON Photo Stickers 16" -msgstr "EPSON Photo Stickers 16" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:26 -msgid "Etiketten" -msgstr "Etiketten" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:28 -msgid "Fridge Magnet Stickers" -msgstr "Aufkleber für Kühlschrankmagnete" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:30 -msgid "General Labels" -msgstr "Allgemeine Etiketten" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:32 -msgid "Inkjet/Laser Labels 70x37mm" -msgstr "Inkjet/Laseretiketten 70x37mm" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:38 -msgid "Mailing Labels-2 columns" -msgstr "Adressaufkleber 2-spaltig" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:40 -msgid "Mailing Labels-3 columns" -msgstr "Adressaufkleber 3-spaltig" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:44 -#: ../data/templates/zweckform-iso-templates.xml.h:24 -msgid "Rectangular Labels" -msgstr "Rechteckige Etiketten" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:46 -msgid "Video Labels (face only)" -msgstr "Video-Etiketten (nur Vorderseite)" - -#. =================================================================== -#: ../data/templates/misc-other-templates.xml.h:2 -msgid "Multi-Purpose Labels" -msgstr "Mehrzweck-Etiketten" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:10 -msgid "Correction and Cover-up Labels" -msgstr "Korrektur- und Abdeckaufkleber" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:12 -msgid "File Back Labels" -msgstr "Ordnerrücken" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:14 -msgid "Lever Arch File Labels" -msgstr "Lever Etiketten für Archivierungsordner" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:18 -msgid "Multi-purpose Stick+Lift Labels" -msgstr "Mehrzweck-Stick+Lift-Aufkleber" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:20 -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "QSL-Karten Etiketten 70mm x 50,8mm" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:22 -msgid "Rectangular Copier Labels" -msgstr "Rechteckige Kopieretiketten" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:26 -msgid "Video Labels (back)" -msgstr "Video-Etiketten (Rückseite)" - -#: ../data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers" -msgstr "Erstellen von Etiketten, Visitenkarten und Medien-Covern" - -#: ../data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "gLabels Etiketten-Designer" - -#: ../data/mime/glabels.keys.in.h:1 ../data/mime/glabels.xml.in.h:1 -msgid "gLabels Project File" -msgstr "gLabels-Projektdatei" - -#: ../barcode-0.98/compat/getopt.c:583 -#, c-format -msgid "%s: option `%s' is ambiguous\n" -msgstr "%s: Option `%s' ist nicht eindeutig\n" - -#: ../barcode-0.98/compat/getopt.c:607 -#, c-format -msgid "%s: option `--%s' doesn't allow an argument\n" -msgstr "%s: Option `--%s' erlaubt kein Argument\n" - -#: ../barcode-0.98/compat/getopt.c:612 -#, c-format -msgid "%s: option `%c%s' doesn't allow an argument\n" -msgstr "%s: Option `%c%s' erlaubt kein Argument\n" - -#: ../barcode-0.98/compat/getopt.c:629 -#, c-format -msgid "%s: option `%s' requires an argument\n" -msgstr "%s: Option `%s' benötigt ein Argument\n" - -#. --option -#: ../barcode-0.98/compat/getopt.c:658 -#, c-format -msgid "%s: unrecognized option `--%s'\n" -msgstr "%s: Nicht erkannte Option `--%s'\n" - -#. +option or -option -#: ../barcode-0.98/compat/getopt.c:662 -#, c-format -msgid "%s: unrecognized option `%c%s'\n" -msgstr "%s: Nicht erkannte Option `%c%s'\n" - -#. 1003.2 specifies the format of this message. -#: ../barcode-0.98/compat/getopt.c:688 -#, c-format -msgid "%s: illegal option -- %c\n" -msgstr "%s: Unerlaubte Option -- %c\n" - -#: ../barcode-0.98/compat/getopt.c:691 -#, c-format -msgid "%s: invalid option -- %c\n" -msgstr "%s: Ungültige Option -- %c\n" - -#: ../barcode-0.98/compat/getopt.c:727 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s: Option benötigt ein Argument -- %c\n" diff --git a/glabels2/po/eo.po b/glabels2/po/eo.po deleted file mode 100644 index cda51cea..00000000 --- a/glabels2/po/eo.po +++ /dev/null @@ -1,2438 +0,0 @@ -# translation of eo.po to -# Italian translation of glabels. -# Copyright (C) 2003 THE glabels'S COPYRIGHT HOLDER -# This file is distributed under the same license as the glabels package. -# -# Esperanto special letters: ĉŝĝĥĵŭ -- 2244 -# Antonio C. Codazzi "la Filozofo" , 2007. -# -# -msgid "" -msgstr "" -"Project-Id-Version: eo\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-06-19 20:43-0400\n" -"PO-Revision-Date: 2007-06-06 16:48+0200\n" -"Last-Translator: Antonio C. Codazzi \n" -"Language-Team: Esperanto \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.0.2\n" - -#: src/glabels.c:116 -msgid "Could not initialize Bonobo!\n" -msgstr "Estas neeble prepari Bonobon!\n" - -#: src/glabels-batch.c:52 -msgid "print this message" -msgstr "presu tiun ĉi mesaĝon" - -#: src/glabels-batch.c:54 -msgid "print the version of glabels-batch being used" -msgstr "presu version de uzata staplo de glabels" - -#: src/glabels-batch.c:56 -msgid "set output filename (default=\"output.ps\")" -msgstr "agordu dosiernomon de eligo (defaÅ­lte \"output.ps\")" - -#: src/glabels-batch.c:56 src/glabels-batch.c:70 -msgid "filename" -msgstr "dosiernomo" - -#: src/glabels-batch.c:58 -msgid "number of sheets (default=1)" -msgstr "nombro da folioj (defaÅ­lte 1)" - -#: src/glabels-batch.c:58 -msgid "sheets" -msgstr "folioj" - -#: src/glabels-batch.c:60 -msgid "number of copies (default=1)" -msgstr "nombro da ekzempleroj (defaÅ­lte 1)" - -#: src/glabels-batch.c:60 -msgid "copies" -msgstr "ekzempleroj" - -#: src/glabels-batch.c:62 -msgid "first label on first sheet (default=1)" -msgstr "unua etikedo de unua folio (defaÅ­lte 1)" - -#: src/glabels-batch.c:62 -msgid "first" -msgstr "unua" - -#: src/glabels-batch.c:64 src/print-dialog.c:336 -msgid "print outlines (to test printer alignment)" -msgstr "presu konturojn (por testi alliniĝon de la printilo)" - -#: src/glabels-batch.c:66 src/print-dialog.c:344 -msgid "print in reverse (i.e. a mirror image)" -msgstr "presu inverse (ekz. iun spegulitan bildon)" - -#: src/glabels-batch.c:68 src/print-dialog.c:351 -msgid "print crop marks" -msgstr "presu liniojn de tranĉo" - -#: src/glabels-batch.c:70 -msgid "input file for merging" -msgstr "eniga dosiero por kunfandi" - -#: src/glabels-batch.c:107 -msgid "[OPTION...] GLABELS_FILE..." -msgstr "[OPTION...] GLABELS_FILE..." - -#: src/glabels-batch.c:127 -#, c-format -msgid "missing glabels file\n" -msgstr "mankanta dosero de glabels\n" - -#: src/glabels-batch.c:158 -#, c-format -msgid "cannot perform document merge with glabels file %s\n" -msgstr "estas neeble kunfandi dokumentojn kun dosiero de glabels %s\n" - -#: src/glabels-batch.c:182 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "estas neeble malfermi dosieron de glabels %s\n" - -#: src/window.c:244 -msgid "(none) - gLabels" -msgstr "(nenio) - gLabels" - -#: src/window.c:414 -msgid "(modified)" -msgstr "(modifita)" - -#: src/stock.c:65 data/ui/glabels-ui.xml.h:162 -msgid "_Select Mode" -msgstr "Modu_so de Elektado" - -#: src/stock.c:66 data/ui/glabels-ui.xml.h:163 -msgid "_Text" -msgstr "_Teksto" - -#: src/stock.c:67 data/ui/glabels-ui.xml.h:148 -msgid "_Line" -msgstr "_Linio" - -#: src/stock.c:68 data/ui/glabels-ui.xml.h:130 -msgid "_Box" -msgstr "_Fako" - -#: src/stock.c:69 data/ui/glabels-ui.xml.h:141 -msgid "_Ellipse" -msgstr "_Elipso" - -#: src/stock.c:70 data/ui/glabels-ui.xml.h:146 -msgid "_Image" -msgstr "_Bildo" - -#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 -msgid "Bar_code" -msgstr "Strek_kodo" - -#: src/stock.c:72 -msgid "_Merge Properties" -msgstr "Ecoj de Ku_nfando" - -#: src/stock.c:73 -msgid "Object _Properties" -msgstr "Ecoj de _Objekto" - -#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 -msgid "Bring to _Front" -msgstr "Portu _Fronten" - -#: src/stock.c:75 data/ui/glabels-ui.xml.h:109 -msgid "Send to _Back" -msgstr "_Sendu MalantaÅ­en" - -#: src/stock.c:76 data/ui/glabels-ui.xml.h:96 -msgid "Rotate _Left" -msgstr "Turnu _Maldekstren" - -#: src/stock.c:77 data/ui/glabels-ui.xml.h:97 -msgid "Rotate _Right" -msgstr "Turnu _Dekstren" - -#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 -msgid "Flip _Horizontally" -msgstr "Renversu _Horizontale" - -#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 -msgid "Flip _Vertically" -msgstr "Renversu _Vertikale" - -#: src/stock.c:80 data/ui/glabels-ui.xml.h:147 -msgid "_Lefts" -msgstr "_Maldekstre" - -#: src/stock.c:81 data/ui/glabels-ui.xml.h:159 -msgid "_Rights" -msgstr "_Dekstre" - -#: src/stock.c:82 data/ui/glabels-ui.xml.h:131 -msgid "_Centers" -msgstr "_Centre" - -#: src/stock.c:83 data/ui/glabels-ui.xml.h:164 -msgid "_Tops" -msgstr "_Supre" - -#: src/stock.c:84 -msgid "Bottoms" -msgstr "Sube" - -#: src/stock.c:85 -msgid "Centers" -msgstr "Centre" - -#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 -msgid "Label Ce_nter" -msgstr "Ce_ntrita Etikedo" - -#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 -msgid "Fill color" -msgstr "Koloro de plenigo" - -#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 -msgid "Line color" -msgstr "Koloro de linio" - -#: src/stock.c:90 src/stock.c:92 -msgid "Linked" -msgstr "Kunligita" - -#: src/stock.c:91 src/stock.c:93 -msgid "Not Linked" -msgstr "Neniu Kunligo" - -#: src/ui-property-bar.c:345 src/object-editor.c:499 -msgid "Default" -msgstr "DefaÅ­lto" - -#: src/ui-property-bar.c:360 src/object-editor.c:512 -msgid "No fill" -msgstr "Neniu Plenigo" - -#: src/ui-property-bar.c:375 src/object-editor.c:505 -msgid "No line" -msgstr "Neniu Linio" - -#: src/ui-sidebar.c:180 -msgid "Object properties" -msgstr "Ecoj de objekto" - -#: src/commands.c:385 -msgid "" -"A label and business card creation program for GNOME.\n" -" \n" -"Glabels is free software; you can redistribute it and/or modify it under the " -"terms of the GNU General Public License as published by the Free Software " -"Foundation; either version 2 of the License, or (at your option) any later " -"version.\n" -" \n" -"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.\n" -msgstr "" - -#: src/commands.c:399 -msgid "See the file AUTHORS for additional credits," -msgstr "Vidigu la dosieron nomitan AUTHORS por pluaj informoj," - -#: src/commands.c:400 -msgid "or visit http://glabels.sourceforge.net/" -msgstr "aÅ­ vizitu http://glabels.sourceforge.net/" - -#: src/commands.c:409 -msgid " " -msgstr " " - -#: src/commands.c:424 -msgid "glabels" -msgstr "glabels" - -#: src/file.c:100 -msgid "New Label or Card" -msgstr "Nova Etikedo aÅ­ Karto" - -#: src/file.c:132 src/file.c:304 -msgid "Media Type" -msgstr "Speco de plurmedio" - -#: src/file.c:138 src/file.c:310 -msgid "Label orientation" -msgstr "Orientado de etikedo" - -#: src/file.c:269 -msgid "Label properties" -msgstr "Ecoj de etikedo" - -#: src/file.c:452 src/file.c:870 -msgid "All files" -msgstr "Ĉiuj dosieroj" - -#: src/file.c:457 src/file.c:875 -msgid "gLabels documents" -msgstr "Dokumentoj de gLabels" - -#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 -msgid "Empty file name selection" -msgstr "Elektado de nomon de vakua dosiero" - -#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 -msgid "Please select a file or supply a valid file name" -msgstr "Bonvolu indiki dosieron aÅ­ validan dosiernomon" - -#: src/file.c:519 src/file.c:631 -msgid "File does not exist" -msgstr "la dosiero ne ekzistas" - -#: src/file.c:563 data/ui/glabels-ui.xml.h:74 -msgid "Open" -msgstr "Malfermu" - -#: src/file.c:565 -msgid "Open label" -msgstr "Malfermu etikedon" - -#: src/file.c:707 -#, c-format -msgid "Could not open file \"%s\"" -msgstr "Estas neeble malfermi dosieron \"%s\"" - -#: src/file.c:715 -msgid "Not a supported file format" -msgstr "La formato de dosiero ne estas subtenita" - -#: src/file.c:797 src/file.c:979 src/file.c:1174 -#, c-format -msgid "Could not save file \"%s\"" -msgstr "estas neeble konservi dosieron \"%s\"" - -#: src/file.c:805 src/file.c:987 src/file.c:1182 -msgid "Error encountered during save. The file is still not saved." -msgstr "Eraro dum konservado. la dosiero ankoraÅ­ ne estas konservita." - -#: src/file.c:848 src/file.c:1048 -#, c-format -msgid "Save \"%s\" as" -msgstr "Konservu \"%s\" kiel" - -#: src/file.c:935 src/file.c:1131 -msgid "Please supply a valid file name" -msgstr "Bonvolu indiki validan dosiernomon" - -#: src/file.c:952 src/file.c:1147 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "Ĉu mi devas anstataÅ­igi dosieron \"%s\"?" - -#: src/file.c:960 src/file.c:1155 -msgid "File already exists." -msgstr "La dosiero jam ekzistas." - -#: src/file.c:1271 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "Ĉu mi devas konservi la modifojn de la dokumento \"%s\" antaÅ­ ol fermi?" - -#: src/file.c:1279 -msgid "Your changes will be lost if you don't save them." -msgstr "La modifoj estos perditaj se oni ne konservas ilin." - -#: src/file.c:1282 -msgid "Close without saving" -msgstr "fermu sen konservi" - -#. Should not happen -#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 -#: data/glade/object-editor.glade.h:37 -msgid "points" -msgstr "punktoj" - -#: src/prefs.c:158 data/glade/object-editor.glade.h:36 -#: data/glade/template-designer.glade.h:74 -msgid "inches" -msgstr "coloj" - -#: src/prefs.c:160 -msgid "mm" -msgstr "mm" - -#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 -msgid "gLabels Preferences" -msgstr "Agordoj de gLabels" - -#. -#. * Submenu: Order -#. -#: src/view.c:3574 data/ui/glabels-ui.xml.h:154 -msgid "_Order" -msgstr "_Ordo" - -#. -#. * Submenu: Rotate/Flip -#. -#: src/view.c:3595 data/ui/glabels-ui.xml.h:160 -msgid "_Rotate/Flip" -msgstr "_Rotacio/Renverso" - -#. -#. * Submenu: Align Horizontally -#. -#: src/view.c:3628 -msgid "Align _Horizontally" -msgstr "LaÅ­linnigu _Horizontale" - -#. -#. * Submenu: Align Vertically -#. -#: src/view.c:3667 -msgid "Align _Vertically" -msgstr "LaÅ­linnigu _Verticale" - -#: src/view.c:3728 data/ui/glabels-ui.xml.h:137 -msgid "_Delete" -msgstr "_Forigu" - -#. Build editor. -#: src/view-box.c:224 -msgid "Box object properties" -msgstr "Ecoj de Fako" - -#. Build editor. -#: src/view-ellipse.c:224 -msgid "Ellipse object properties" -msgstr "Ecoj de Elipso" - -#. Build editor. -#: src/view-line.c:224 -msgid "Line object properties" -msgstr "Ecoj de Linio" - -#. Build editor. -#: src/view-image.c:223 -msgid "Image object properties" -msgstr "Ecoj de Bildo" - -#. Build editor. -#: src/view-text.c:251 -msgid "Text object properties" -msgstr "Ecoj de Teksto" - -#: src/view-text.c:563 data/glade/object-editor.glade.h:28 -msgid "Text" -msgstr "Teksto" - -#. Build editor. -#: src/view-barcode.c:210 -msgid "Barcode object properties" -msgstr "Ecoj de Strekkodo" - -#: src/view-barcode.c:580 src/print.c:1089 -msgid "Invalid barcode data" -msgstr "Nevalida strekkodo" - -#: src/merge-properties-dialog.c:231 -msgid "Merge Properties" -msgstr "Ecoj de Kunfando" - -#. ---- Source section ---- -#: src/merge-properties-dialog.c:237 -msgid "Source" -msgstr "Fonto" - -#: src/merge-properties-dialog.c:245 -msgid "Format:" -msgstr "Formato:" - -#. Location line -#: src/merge-properties-dialog.c:273 -msgid "Location:" -msgstr "Lokiĝo:" - -#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 -msgid "Select merge-database source" -msgstr "Elektu fonton de kunfand-datumbazo" - -#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 -msgid "N/A" -msgstr "N/A" - -#. ---- Sample Fields section ---- -#: src/merge-properties-dialog.c:300 -msgid "Record selection/preview:" -msgstr "Elektado/AntaÅ­montro de rikordo:" - -#: src/merge-properties-dialog.c:326 -msgid "Select" -msgstr "Elektu" - -#: src/merge-properties-dialog.c:334 -msgid "Record/Field" -msgstr "Rikordo/Kampo" - -#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 -msgid "Data" -msgstr "Datumoj" - -#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:81 -msgid "Print" -msgstr "Presu" - -#: src/print-dialog.c:281 -msgid "_Job" -msgstr "_Laboro" - -#: src/print-dialog.c:286 -msgid "P_rinter" -msgstr "P_rintilo" - -#. ----------- Add simple-copies widget ------------ -#: src/print-dialog.c:314 -msgid "Copies" -msgstr "Ekzempleroj" - -#. ------- Add merge control widget ------------ -#: src/print-dialog.c:322 -msgid "Document merge control" -msgstr "Kontrolo de kunfando de dokumento" - -#. ----------- Add custom print options area ------------ -#: src/print-dialog.c:330 -msgid "Options" -msgstr "Opcioj" - -#: src/print-dialog.c:553 src/print-dialog.c:592 -msgid "Print preview" -msgstr "AntaÅ­montro de presado" - -#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 -msgid "gLabels Template Designer" -msgstr "Desegnilo de modeloj por gLabels" - -#: src/bc.c:60 -msgid "POSTNET (any)" -msgstr "POSTNET (iu ajn)" - -#: src/bc.c:63 -msgid "POSTNET-5 (ZIP only)" -msgstr "POSTNET-5 (nur ZIP/CAP)" - -#: src/bc.c:66 -msgid "POSTNET-9 (ZIP+4)" -msgstr "POSTNET-9 (ZIP/CAP+4)" - -#: src/bc.c:69 -msgid "POSTNET-11 (DPBC)" -msgstr "POSTNET-11 (DPBC)" - -#: src/bc.c:72 -msgid "EAN (any)" -msgstr "EAN (iu ajn)" - -#: src/bc.c:75 -msgid "EAN-8" -msgstr "EAN-8" - -#: src/bc.c:78 -msgid "EAN-8 +2" -msgstr "EAN-8 +2" - -#: src/bc.c:81 -msgid "EAN-8 +5" -msgstr "EAN-8 +5" - -#: src/bc.c:84 -msgid "EAN-13" -msgstr "EAN-13" - -#: src/bc.c:87 -msgid "EAN-13 +2" -msgstr "EAN-13 +2" - -#: src/bc.c:90 -msgid "EAN-13 +5" -msgstr "EAN-13 +5" - -#: src/bc.c:93 -msgid "UPC (UPC-A or UPC-E)" -msgstr "UPC (UPC-A aÅ­ UPC-E)" - -#: src/bc.c:96 -msgid "UPC-A" -msgstr "UPC-A" - -#: src/bc.c:99 -msgid "UPC-A +2" -msgstr "UPC-A +2" - -#: src/bc.c:102 -msgid "UPC-A +5" -msgstr "UPC-A +5" - -#: src/bc.c:105 -msgid "UPC-E" -msgstr "UPC-E" - -#: src/bc.c:108 -msgid "UPC-E +2" -msgstr "UPC-E +2" - -#: src/bc.c:111 -msgid "UPC-E +5" -msgstr "UPC-E +5" - -#: src/bc.c:114 -msgid "ISBN" -msgstr "ISBN" - -#: src/bc.c:117 -msgid "ISBN +5" -msgstr "ISBN +5" - -#: src/bc.c:120 -msgid "Code 39" -msgstr "Kodo 39" - -#: src/bc.c:123 -msgid "Code 128" -msgstr "Kodo 128" - -#: src/bc.c:126 -msgid "Code 128C" -msgstr "Kodo 128C" - -#: src/bc.c:129 -msgid "Code 128B" -msgstr "Kodo 128B" - -#: src/bc.c:132 -msgid "Interleaved 2 of 5" -msgstr "Interleaved 2 of 5" - -#: src/bc.c:135 -msgid "Codabar" -msgstr "Codabar" - -#: src/bc.c:138 -msgid "MSI" -msgstr "MSI" - -#: src/bc.c:141 -msgid "Plessey" -msgstr "Plessey" - -#: src/label.c:569 -msgid "Untitled" -msgstr "Sen nomo" - -#: src/xml-label.c:176 src/xml-label.c:213 -msgid "xmlParseFile error" -msgstr "Eraro de xml-dosiero de sintaksa analizo" - -#: src/xml-label.c:250 -msgid "No document root" -msgstr "Neniu radika dokumento" - -#: src/xml-label.c:264 -msgid "Importing from glabels 0.1 format" -msgstr "Importante el formato de glabels 0.1" - -#: src/xml-label.c:272 -msgid "Importing from glabels 0.4 format" -msgstr "Importante el formato de glabels 0.4" - -#: src/xml-label.c:279 -msgid "Importing from glabels 1.91 format" -msgstr "Importante el formato de glabels 1.91" - -#: src/xml-label.c:282 -msgid "bad document, unknown glabels Namespace" -msgstr "Nekorekta dokumento, nekonata Nomospaco de glabels" - -#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "Nekorekta radika nodo = \"%s\"" - -#: src/xml-label.c:348 src/xml-label-191.c:165 -#, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "nekorekta nodo en nodo de Dokumeto = \"%s\"" - -#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 -#, c-format -msgid "bad node = \"%s\"" -msgstr "nekorekta nodo = \"%s\"" - -#: src/xml-label.c:796 src/xml-label-191.c:605 -#, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "nekorekta nodo en nodo de Datumoj = \"%s\"" - -#: src/xml-label.c:962 libglabels/xml-template.c:535 -msgid "Utf8 conversion error." -msgstr "eraro de konvertado en Utf8." - -#: src/xml-label.c:969 libglabels/xml-template.c:542 -msgid "Problem saving xml file." -msgstr "Problemo laÅ­ konservo de xml-dosiero" - -#. This should always be an id, but just in case a name -#. slips by! -#: src/xml-label-191.c:680 libglabels/xml-template.c:199 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "Nekonata id \"%s\" de grando de paĝo, provante kiel nomo" - -#: src/xml-label-191.c:690 libglabels/xml-template.c:209 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "Nekonata id de (paĝo)grando aÅ­ de nomo \"%s\"" - -#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 -msgid "None" -msgstr "Nenio" - -#: src/merge-init.c:53 -msgid "Text file with comma delimeters (CSV)" -msgstr "Teksta dosiero kun komo kiel disigilo (CSV)" - -#: src/merge-init.c:60 -msgid "Text file with colon delimeters" -msgstr "Teksta dosiero kun komo kiel disigilo" - -#: src/merge-init.c:67 -msgid "Text file with tab delimeters" -msgstr "Teksta dosiero kun TAB kiel disigilo" - -#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 -msgid "File:" -msgstr "Dosiero:" - -#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 -msgid "Key:" -msgstr "Ŝlosilo:" - -#: src/wdgt-print-copies.c:179 -msgid "Sheets:" -msgstr "Folioj:" - -#: src/wdgt-print-copies.c:197 -msgid "Labels" -msgstr "Etikedoj" - -#: src/wdgt-print-copies.c:200 -msgid "from:" -msgstr "de:" - -#: src/wdgt-print-copies.c:207 -msgid "to:" -msgstr "ĝis:" - -#: src/wdgt-print-merge.c:178 -msgid "Start on label" -msgstr "Starto en etikedo" - -#: src/wdgt-print-merge.c:186 -msgid "on 1st sheet" -msgstr "en 1a folio" - -#: src/wdgt-print-merge.c:195 -msgid "Copies:" -msgstr "Ekzempleroj:" - -#: src/wdgt-print-merge.c:201 -msgid "Collate" -msgstr "LaÅ­kajere" - -#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 -msgid "Description:" -msgstr "Priskribo:" - -#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 -msgid "Page size:" -msgstr "Grando de paĝo:" - -#: src/wdgt-media-select.c:290 -msgid "Label size:" -msgstr "Grando de etikedo:" - -#: src/wdgt-media-select.c:301 -msgid "Layout:" -msgstr "Aspekto:" - -#: src/wdgt-media-select.c:578 -#, c-format -msgid "%d x %d (%d per sheet)" -msgstr "%d x %d (%d por folio)" - -#: src/wdgt-media-select.c:582 -#, c-format -msgid "%d per sheet" -msgstr "%d por folio" - -#: src/wdgt-media-select.c:614 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -#: src/wdgt-media-select.c:619 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 -#, c-format -msgid "%s %s diameter" -msgstr "%s %s diametro" - -#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 -#, c-format -msgid "%.5g %s diameter" -msgstr "%.5g %s diametro" - -#: src/wdgt-rotate-label.c:193 -msgid "Rotate" -msgstr "Rotacio" - -#. This is the default custom color -#: src/mygal/color-palette.c:396 -msgid "custom" -msgstr "personigita" - -#. "Custom" color - we'll pop up a GnomeColorPicker -#: src/mygal/color-palette.c:438 -msgid "Custom Color:" -msgstr "Personigita Koloro:" - -#: src/mygal/color-palette.c:446 -msgid "Choose Custom Color" -msgstr "Elektu personigitan koloron" - -#: src/mygal/color-palette.c:579 -msgid "black" -msgstr "nigro" - -#: src/mygal/color-palette.c:580 -msgid "light brown" -msgstr "hela bruna koloro" - -#: src/mygal/color-palette.c:581 -msgid "brown gold" -msgstr "malhela oro" - -#: src/mygal/color-palette.c:582 -msgid "dark green #2" -msgstr "malhela verdo #2" - -#: src/mygal/color-palette.c:583 -msgid "navy" -msgstr "mararmea bluo" - -#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 -msgid "dark blue" -msgstr "malhela bluo" - -#: src/mygal/color-palette.c:585 -msgid "purple #2" -msgstr "viola koloro #2" - -#: src/mygal/color-palette.c:586 -msgid "very dark gray" -msgstr "tre malhela grizo" - -#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 -msgid "dark red" -msgstr "malhela ruĝo" - -#: src/mygal/color-palette.c:590 -msgid "red-orange" -msgstr "ruĝ-oranĝo" - -#: src/mygal/color-palette.c:591 -msgid "gold" -msgstr "oro" - -#: src/mygal/color-palette.c:592 -msgid "dark green" -msgstr "malhela verdo" - -#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 -msgid "dull blue" -msgstr "nebrila bluo" - -#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 -msgid "blue" -msgstr "bluo" - -#: src/mygal/color-palette.c:595 -msgid "dull purple" -msgstr "nebrila violo" - -#: src/mygal/color-palette.c:596 -msgid "dark grey" -msgstr "malhela grizo" - -#: src/mygal/color-palette.c:599 -msgid "red" -msgstr "ruĝo" - -#: src/mygal/color-palette.c:600 -msgid "orange" -msgstr "oranĝa koloro" - -#: src/mygal/color-palette.c:601 -msgid "lime" -msgstr "limeta koloro" - -#: src/mygal/color-palette.c:602 -msgid "dull green" -msgstr "nebrila verdo" - -#: src/mygal/color-palette.c:603 -msgid "dull blue #2" -msgstr "nebrila bluo #2" - -#: src/mygal/color-palette.c:604 -msgid "sky blue #2" -msgstr "ĉielbluo #2" - -#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 -msgid "purple" -msgstr "violo" - -#: src/mygal/color-palette.c:606 -msgid "gray" -msgstr "grizo" - -#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 -msgid "magenta" -msgstr "intense karmezina" - -#: src/mygal/color-palette.c:610 -msgid "bright orange" -msgstr "brila oranĝo" - -#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 -msgid "yellow" -msgstr "flavo" - -#: src/mygal/color-palette.c:612 -msgid "green" -msgstr "verdo" - -#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 -msgid "cyan" -msgstr "cejano" - -#: src/mygal/color-palette.c:614 -msgid "bright blue" -msgstr "brila bluo" - -#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 -msgid "red purple" -msgstr "ruĝ-violo" - -#: src/mygal/color-palette.c:616 -msgid "light grey" -msgstr "hela grizo" - -#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 -msgid "pink" -msgstr "rozkoloro" - -#: src/mygal/color-palette.c:620 -msgid "light orange" -msgstr "hela oranĝo" - -#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 -msgid "light yellow" -msgstr "hela flavo" - -#: src/mygal/color-palette.c:622 -msgid "light green" -msgstr "hela verdo" - -#: src/mygal/color-palette.c:623 -msgid "light cyan" -msgstr "hela cejano" - -#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 -msgid "light blue" -msgstr "hela bluo" - -#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 -msgid "light purple" -msgstr "hela violo" - -#: src/mygal/color-palette.c:626 -msgid "white" -msgstr "blanko" - -#: src/mygal/color-palette.c:631 -msgid "purplish blue" -msgstr "viol-bluo" - -#: src/mygal/color-palette.c:635 -msgid "dark purple" -msgstr "malhela violo" - -#: src/mygal/color-palette.c:637 -msgid "sky blue" -msgstr "ĉielbluo" - -#: libglabels/template.c:848 -#, c-format -msgid "Generic %s full page" -msgstr "Ĝenerala %s plena paĝo" - -#: libglabels/template.c:897 -msgid "No template files found!" -msgstr "Neniu modelo estis trovita!" - -#. Create and append an "Other" entry. -#: libglabels/paper.c:67 -msgid "Other" -msgstr "Aliaĵoj" - -#: libglabels/paper.c:361 -msgid "No paper files found!" -msgstr "Neniu papera dosiero estis trovita!!" - -#: data/ui/glabels-ui.xml.h:1 -msgid "About glabels" -msgstr "Pri glabels" - -#: data/ui/glabels-ui.xml.h:2 -msgid "About..." -msgstr "Pri..." - -#: data/ui/glabels-ui.xml.h:3 -msgid "Align _Horizontal" -msgstr "LaÅ­linnigu _Horizontale" - -#: data/ui/glabels-ui.xml.h:4 -msgid "Align _Vertical" -msgstr "LaÅ­linnigu _Verticale" - -#: data/ui/glabels-ui.xml.h:5 -msgid "Align objects to bottoms" -msgstr "LaÅ­linnigu objektojn sube" - -#: data/ui/glabels-ui.xml.h:6 -msgid "Align objects to horizontal centers" -msgstr "LaÅ­linnigu objektojn laÅ­ horizontala centro" - -#: data/ui/glabels-ui.xml.h:7 -msgid "Align objects to left edges" -msgstr "LaÅ­linnigu objektojn laÅ­ maldekstra rando" - -#: data/ui/glabels-ui.xml.h:8 -msgid "Align objects to right edges" -msgstr "LaÅ­linnigu objektojn laÅ­ dekstra rando" - -#: data/ui/glabels-ui.xml.h:9 -msgid "Align objects to tops" -msgstr "LaÅ­linnigu objektojn supre" - -#: data/ui/glabels-ui.xml.h:10 -msgid "Align objects to vertical centers" -msgstr "LaÅ­liniigu objektojn laÅ­ verticala centro" - -#: data/ui/glabels-ui.xml.h:12 -msgid "Bold" -msgstr "Dika" - -#: data/ui/glabels-ui.xml.h:14 -msgid "Center align" -msgstr "LaÅ­liniiĝu centre" - -#: data/ui/glabels-ui.xml.h:15 -msgid "Center objects to horizontal label center" -msgstr "Centrigu objektojn laÅ­ horizontala centro de etikedo" - -#: data/ui/glabels-ui.xml.h:16 -msgid "Center objects to vertical label center" -msgstr "Centrigu objektojn laÅ­ vertikala centro de etikedo" - -#: data/ui/glabels-ui.xml.h:17 -msgid "Change the visibility of markup lines in the current window" -msgstr "Ŝangu videblecon de linioj de demarkacio en nuna fenestro" - -#: data/ui/glabels-ui.xml.h:18 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "Ŝangu videblecon de la ilarstango de desegno en nuna fenestro" - -#: data/ui/glabels-ui.xml.h:19 -msgid "Change the visibility of the grid in the current window" -msgstr "Ŝangu videblecon de la krado en nuna fenestro" - -#: data/ui/glabels-ui.xml.h:20 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "Ŝangu videblecon de la ĉefa ilarstango en nuna fenestro" - -#: data/ui/glabels-ui.xml.h:21 -msgid "Change the visibility of the property toolbar in the current window" -msgstr "Ŝangu videblecon de ilarstango de ecoj en nuna fenestro" - -#: data/ui/glabels-ui.xml.h:22 -msgid "Close" -msgstr "Fermu" - -#: data/ui/glabels-ui.xml.h:23 -msgid "Close the current file" -msgstr "Fermu la nunan dosieron" - -#: data/ui/glabels-ui.xml.h:24 -msgid "Configure the application" -msgstr "Agordu la programon" - -#: data/ui/glabels-ui.xml.h:25 -msgid "Contents" -msgstr "Entenoj" - -#: data/ui/glabels-ui.xml.h:26 -msgid "Copy" -msgstr "Kopiu" - -#: data/ui/glabels-ui.xml.h:27 -msgid "Copy the selection" -msgstr "Kopiu la elektaĵon" - -#: data/ui/glabels-ui.xml.h:28 -msgid "Create a custom template" -msgstr "Kreu personigitan modelon" - -#: data/ui/glabels-ui.xml.h:29 -msgid "Create a new document" -msgstr "Kreu novan dokumenton" - -#: data/ui/glabels-ui.xml.h:30 -msgid "Create barcode object" -msgstr "Keu strekkodan objekton" - -#: data/ui/glabels-ui.xml.h:31 -msgid "Create box/rectangle object" -msgstr "Kreu objekton de areo/rektangulo" - -#: data/ui/glabels-ui.xml.h:32 -msgid "Create ellipse/circle object" -msgstr "Kreu objekton de elipse/circlo" - -#: data/ui/glabels-ui.xml.h:33 -msgid "Create image object" -msgstr "Kreu bildan objekton" - -#: data/ui/glabels-ui.xml.h:34 -msgid "Create line object" -msgstr "Kreu linian objekton" - -#: data/ui/glabels-ui.xml.h:35 -msgid "Create text object" -msgstr "Kreu tekstan objekton" - -#: data/ui/glabels-ui.xml.h:36 -msgid "Cu_t" -msgstr "El_tondu" - -#: data/ui/glabels-ui.xml.h:37 -msgid "Customize" -msgstr "Personigu" - -#: data/ui/glabels-ui.xml.h:38 -msgid "Customize Drawing Toolbar" -msgstr "Personigu ilarstangon de desegno" - -#: data/ui/glabels-ui.xml.h:39 -msgid "Customize Main Toolbar" -msgstr "Personigu ĉefan ilarstangon" - -#: data/ui/glabels-ui.xml.h:40 -msgid "Customize Property Toolbar" -msgstr "Personigu ilarstangon de ecoj" - -#: data/ui/glabels-ui.xml.h:41 -msgid "Customize toolbars" -msgstr "Personigu ilarstangojn" - -#: data/ui/glabels-ui.xml.h:42 -msgid "Cut" -msgstr "Eltondu" - -#: data/ui/glabels-ui.xml.h:43 -msgid "Cut the selection" -msgstr "Eltondu elektaĵon" - -#: data/ui/glabels-ui.xml.h:44 -msgid "Decrease magnification" -msgstr "Malpliigu zomon" - -#: data/ui/glabels-ui.xml.h:45 -msgid "Delete" -msgstr "Forigu" - -#: data/ui/glabels-ui.xml.h:46 -msgid "Delete the selected objects" -msgstr "Forigu elektitajn objektojn" - -#: data/ui/glabels-ui.xml.h:47 -msgid "Drawing toolbar" -msgstr "Ilarstango de desegno" - -#: data/ui/glabels-ui.xml.h:48 -msgid "Dump XML" -msgstr "Ŝutu XML" - -#: data/ui/glabels-ui.xml.h:49 -msgid "Dump the UI Xml description" -msgstr "Ŝutu priskribon de UI xml" - -#: data/ui/glabels-ui.xml.h:50 -msgid "Edit merge properties" -msgstr "Redaktu ecojn de kunfando" - -#: data/ui/glabels-ui.xml.h:54 -msgid "Flip object horizontally" -msgstr "Renversu objekton horizontale" - -#: data/ui/glabels-ui.xml.h:55 -msgid "Flip object vertically" -msgstr "Renversu objekton vertikale" - -#: data/ui/glabels-ui.xml.h:56 -msgid "Font name" -msgstr "Nomo de tiparo" - -#: data/ui/glabels-ui.xml.h:57 -msgid "Font selector" -msgstr "Elektilo de tiparo" - -#: data/ui/glabels-ui.xml.h:58 -msgid "Font size" -msgstr "Tipargrando" - -#: data/ui/glabels-ui.xml.h:59 -msgid "Icon and _Text" -msgstr "Ikono kaj _Teksto" - -#: data/ui/glabels-ui.xml.h:60 -msgid "Increase magnification" -msgstr "Pliigu zomon" - -#: data/ui/glabels-ui.xml.h:61 -msgid "Italic" -msgstr "Kursivo" - -#: data/ui/glabels-ui.xml.h:63 -msgid "Left align" -msgstr "LaÅ­liniigu maldekstren" - -#: data/ui/glabels-ui.xml.h:65 -msgid "Line width" -msgstr "Larĝo de linio" - -#: data/ui/glabels-ui.xml.h:66 -msgid "Lower object to bottom" -msgstr "Subentiru objekton ĝis la fundo" - -#: data/ui/glabels-ui.xml.h:67 -msgid "M_arkup" -msgstr "M_arkado" - -#: data/ui/glabels-ui.xml.h:68 -msgid "Main toolbar" -msgstr "Ĉefa ilarstango" - -#: data/ui/glabels-ui.xml.h:69 -msgid "Markup" -msgstr "Markaĵoj" - -#: data/ui/glabels-ui.xml.h:70 -msgid "Modify document properties" -msgstr "Radaktu ecojn de dokumento" - -#: data/ui/glabels-ui.xml.h:71 -msgid "New" -msgstr "Nova" - -#: data/ui/glabels-ui.xml.h:72 -msgid "Object property editor" -msgstr "Redaktilo de ecoj por objekto" - -#: data/ui/glabels-ui.xml.h:73 -msgid "Only show icons in the main toolbar" -msgstr "Videbligu nur ikonojn en ĉefa ilarstango" - -#: data/ui/glabels-ui.xml.h:75 -msgid "Open a file" -msgstr "Malfermu iun dosieron" - -#: data/ui/glabels-ui.xml.h:76 -msgid "Open the glabels manual" -msgstr "Malfermu manlibron de glabels" - -#: data/ui/glabels-ui.xml.h:77 -msgid "Paste" -msgstr "Enmetu" - -#: data/ui/glabels-ui.xml.h:78 -msgid "Paste the clipboard" -msgstr "Enmetu la poŝon" - -#: data/ui/glabels-ui.xml.h:79 -msgid "Pr_eferences..." -msgstr "A_gordoj..." - -#: data/ui/glabels-ui.xml.h:80 -msgid "Preferences" -msgstr "Agordoj" - -#: data/ui/glabels-ui.xml.h:82 -msgid "Print the current file" -msgstr "Presu la nunan dosieron" - -#: data/ui/glabels-ui.xml.h:83 -msgid "Proper_ties..." -msgstr "E_coj..." - -#: data/ui/glabels-ui.xml.h:84 -msgid "Properties" -msgstr "Ecoj" - -#: data/ui/glabels-ui.xml.h:85 -msgid "Property toolbar" -msgstr "Ilarstango de ecoj" - -#: data/ui/glabels-ui.xml.h:86 -msgid "Quit" -msgstr "Eliro" - -#: data/ui/glabels-ui.xml.h:87 -msgid "Quit the program" -msgstr "Eliru el programo" - -#: data/ui/glabels-ui.xml.h:88 -msgid "Raise object to top" -msgstr "Suprentiru objekton ĝis la pinto" - -#: data/ui/glabels-ui.xml.h:89 -msgid "Recent _Files" -msgstr "Fre_ŝaj Dosieroj" - -#: data/ui/glabels-ui.xml.h:90 -msgid "Redo" -msgstr "Refaru" - -#: data/ui/glabels-ui.xml.h:91 -msgid "Redo the undone action" -msgstr "Refaru la lastan malfaritan agon" - -#: data/ui/glabels-ui.xml.h:92 -msgid "Remove all selections" -msgstr "Formovu ĉiujn elektaĵojn" - -#: data/ui/glabels-ui.xml.h:94 -#, no-c-format -msgid "Restore scale to 100%" -msgstr "Reen 100%" - -#: data/ui/glabels-ui.xml.h:95 -msgid "Right align" -msgstr "laÅ­liniigu dekstren" - -#: data/ui/glabels-ui.xml.h:98 -msgid "Rotate object 90 clockwise" -msgstr "Turnu la objekton je 90° dekstroĝire" - -#: data/ui/glabels-ui.xml.h:99 -msgid "Rotate object 90 counter-clockwise" -msgstr "Turnu la objekton je 90° kontraÅ­montrile" - -#: data/ui/glabels-ui.xml.h:100 -msgid "Save" -msgstr "Konservu" - -#: data/ui/glabels-ui.xml.h:101 -msgid "Save As" -msgstr "Konservu kiel" - -#: data/ui/glabels-ui.xml.h:102 -msgid "Save _As..." -msgstr "Konservu kiel..." - -#: data/ui/glabels-ui.xml.h:103 -msgid "Save the current file" -msgstr "Konservu la nunan dosieron" - -#: data/ui/glabels-ui.xml.h:104 -msgid "Save the current file with a different name" -msgstr "Konservu la nunan dosieron per alia nomo" - -#: data/ui/glabels-ui.xml.h:105 -msgid "Select All" -msgstr "Elektu Ĉion" - -#: data/ui/glabels-ui.xml.h:106 -msgid "Select _All" -msgstr "Elektu _Ĉion" - -#: data/ui/glabels-ui.xml.h:107 -msgid "Select all objects" -msgstr "Elektu ĉiujn objektojn" - -#: data/ui/glabels-ui.xml.h:108 -msgid "Select, move and modify objects" -msgstr "Elektu, movu kaj redaktu objektojn" - -#: data/ui/glabels-ui.xml.h:110 -msgid "Set main toolbar button style according to desktop default" -msgstr "Agordu butonstilon de ĉefa ilarstango laÅ­ defaÅ­lto de labortablo" - -#: data/ui/glabels-ui.xml.h:111 -msgid "Show _Tooltips" -msgstr "Mon_tru Sugestojn" - -#: data/ui/glabels-ui.xml.h:112 -msgid "Show both icons and texts in the main toolbar" -msgstr "Vidigu kaj ikonojn kaj tekstojn en la ĉefa ilarstango" - -#: data/ui/glabels-ui.xml.h:113 -msgid "Show tooltips in the drawing toolbar" -msgstr "Vidigu sugestojn en la ilarstango de desegno" - -#: data/ui/glabels-ui.xml.h:114 -msgid "Show tooltips in the main toolbar" -msgstr "Vidigu sugestojn en la ĉefa ilarstango" - -#: data/ui/glabels-ui.xml.h:115 -msgid "Show tooltips in the property toolbar" -msgstr "Vidigu sugestojn en la ilarstango de ecoj" - -#: data/ui/glabels-ui.xml.h:116 -msgid "Template Designer" -msgstr "Desegnilo de Modeloj" - -#: data/ui/glabels-ui.xml.h:117 -msgid "Template _Designer..." -msgstr "_Desegnilo de Modeloj..." - -#: data/ui/glabels-ui.xml.h:118 -msgid "Text color" -msgstr "Koloro de teksto" - -#: data/ui/glabels-ui.xml.h:119 -msgid "U_n-select All" -msgstr "Malelektu Ĉio_n" - -#: data/ui/glabels-ui.xml.h:120 -msgid "Un-select All" -msgstr "Malelektu Ĉion" - -#: data/ui/glabels-ui.xml.h:121 -msgid "Undo" -msgstr "Malfaru" - -#: data/ui/glabels-ui.xml.h:122 -msgid "Undo the last action" -msgstr "Nuligu lastan agon" - -#: data/ui/glabels-ui.xml.h:123 -msgid "Zoom _1:1" -msgstr "Zomo je _1:1" - -#: data/ui/glabels-ui.xml.h:124 -msgid "Zoom _In" -msgstr "_Zomo" - -#: data/ui/glabels-ui.xml.h:125 -msgid "Zoom _Out" -msgstr "_Malzomo" - -#: data/ui/glabels-ui.xml.h:126 -msgid "Zoom to _fit" -msgstr "Alĝustigu" - -#: data/ui/glabels-ui.xml.h:127 -msgid "Zoom to fit window" -msgstr "Alĝustigu al la fenestro" - -#: data/ui/glabels-ui.xml.h:128 -msgid "_About..." -msgstr "_Pri..." - -#: data/ui/glabels-ui.xml.h:129 -msgid "_Bottoms" -msgstr "Su_be" - -#: data/ui/glabels-ui.xml.h:132 -msgid "_Close" -msgstr "_Fermu" - -#: data/ui/glabels-ui.xml.h:133 -msgid "_Contents" -msgstr "_Entenoj" - -#: data/ui/glabels-ui.xml.h:134 -msgid "_Copy" -msgstr "_Kopiu" - -#: data/ui/glabels-ui.xml.h:135 -msgid "_Create Object" -msgstr "_Kreu Objekton" - -#: data/ui/glabels-ui.xml.h:136 -msgid "_Debug" -msgstr "_Sencimigo" - -#: data/ui/glabels-ui.xml.h:138 -msgid "_Desktop Default" -msgstr "DefaÅ­lto por Labortabulo" - -#: data/ui/glabels-ui.xml.h:139 -msgid "_Drawing Toolbar" -msgstr "Ilarstango de _Desegno" - -#: data/ui/glabels-ui.xml.h:140 -msgid "_Edit" -msgstr "R_edaktu" - -#: data/ui/glabels-ui.xml.h:142 -msgid "_File" -msgstr "_Dosiero" - -#: data/ui/glabels-ui.xml.h:143 -msgid "_Grid" -msgstr "_Krado" - -#: data/ui/glabels-ui.xml.h:144 -msgid "_Help" -msgstr "_Helpilo" - -#: data/ui/glabels-ui.xml.h:145 -msgid "_Icon" -msgstr "_Ikono" - -#: data/ui/glabels-ui.xml.h:149 -msgid "_Main Toolbar" -msgstr "_Ĉefa Ilarstango" - -#: data/ui/glabels-ui.xml.h:150 -msgid "_Merge Properties..." -msgstr "_Kunfandu Ecojn..." - -#: data/ui/glabels-ui.xml.h:151 -msgid "_New" -msgstr "_Nova" - -#: data/ui/glabels-ui.xml.h:152 -msgid "_Objects" -msgstr "_Objektoj" - -#: data/ui/glabels-ui.xml.h:153 -msgid "_Open..." -msgstr "M_alfermu..." - -#: data/ui/glabels-ui.xml.h:155 -msgid "_Paste" -msgstr "_Enmetu" - -#: data/ui/glabels-ui.xml.h:156 -msgid "_Print..." -msgstr "_Presu..." - -#: data/ui/glabels-ui.xml.h:157 -msgid "_Property Toolbar" -msgstr "Ilarstango de Eco_j" - -#: data/ui/glabels-ui.xml.h:158 -msgid "_Quit" -msgstr "_Eliro" - -#: data/ui/glabels-ui.xml.h:161 -msgid "_Save" -msgstr "_Konservu" - -#: data/ui/glabels-ui.xml.h:165 -msgid "_View" -msgstr "_Videbligo" - -#: data/glade/prefs-dialog.glade.h:1 -msgid " " -msgstr " " - -#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 -#: data/glade/template-designer.glade.h:5 -msgid "*" -msgstr "*" - -#: data/glade/prefs-dialog.glade.h:3 -msgid "Default page size" -msgstr "DefaÅ­lta grando de paĝo" - -#: data/glade/prefs-dialog.glade.h:4 -msgid "Fill" -msgstr "Plenigo" - -#: data/glade/prefs-dialog.glade.h:5 -msgid "Line" -msgstr "Linio" - -#: data/glade/prefs-dialog.glade.h:6 -msgid "Text" -msgstr "Teksto" - -#: data/glade/prefs-dialog.glade.h:7 -msgid "Units" -msgstr "Unitoj" - -#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 -msgid "Alignment:" -msgstr "Alliniĝo:" - -#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 -msgid "Color:" -msgstr "Koloro:" - -#: data/glade/prefs-dialog.glade.h:10 -msgid "Font:" -msgstr "Tiparo:" - -#: data/glade/prefs-dialog.glade.h:11 -msgid "ISO A4" -msgstr "ISO A4" - -#: data/glade/prefs-dialog.glade.h:12 -msgid "Inches" -msgstr "Coloj" - -#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 -msgid "Line Spacing:" -msgstr "Interspaco:" - -#: data/glade/prefs-dialog.glade.h:14 -msgid "Locale" -msgstr "Nacia" - -#: data/glade/prefs-dialog.glade.h:15 -msgid "Millimeters" -msgstr "Milimetroj" - -#: data/glade/prefs-dialog.glade.h:16 -msgid "Object defaults" -msgstr "DefaÅ­ltoj de objekto" - -#: data/glade/prefs-dialog.glade.h:17 -msgid "Points" -msgstr "Punktoj" - -#: data/glade/prefs-dialog.glade.h:18 -msgid "Select default properties for new objects." -msgstr "Elektu defaÅ­ltajn ecojn por novaj objektoj." - -#: data/glade/prefs-dialog.glade.h:19 -msgid "Select locale specific behavior." -msgstr "Elektu nacian specifan agmanieron." - -#. Most popular (at top of list) -#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:29 -msgid "US Letter" -msgstr "US·Letero" - -#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 -#: data/glade/template-designer.glade.h:72 -msgid "Width:" -msgstr "Larĝo:" - -#: data/glade/object-editor.glade.h:2 -msgid "00000000000 00000" -msgstr "00000000000 00000" - -#: data/glade/object-editor.glade.h:3 -msgid "Xxx object properties" -msgstr "Xxx ecoj de objekto" - -#: data/glade/object-editor.glade.h:5 -msgid "Allow merge to automatically shrink text" -msgstr "" - -#: data/glade/object-editor.glade.h:6 -msgid "Angle:" -msgstr "Angulo:" - -#: data/glade/object-editor.glade.h:7 -msgid "Checksum" -msgstr "Kontrolsumo" - -#: data/glade/object-editor.glade.h:10 -msgid "Family:" -msgstr "Familio:" - -#: data/glade/object-editor.glade.h:12 -msgid "Fill" -msgstr "Plenigo" - -#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 -msgid "Height:" -msgstr "Alto:" - -#: data/glade/object-editor.glade.h:14 -msgid "Image" -msgstr "Bildo" - -#: data/glade/object-editor.glade.h:15 -msgid "Insert merge field" -msgstr "Enigu campon de kunfando" - -#: data/glade/object-editor.glade.h:17 -msgid "Length:" -msgstr "Longo:" - -#: data/glade/object-editor.glade.h:18 -msgid "Line" -msgstr "Linio" - -#: data/glade/object-editor.glade.h:20 -msgid "Literal:" -msgstr "Literalo:" - -#: data/glade/object-editor.glade.h:21 -msgid "Load image" -msgstr "Ŝargu bildon" - -#: data/glade/object-editor.glade.h:22 -msgid "Position" -msgstr "Lokiĝo" - -#: data/glade/object-editor.glade.h:23 -msgid "Reset image size" -msgstr "Restarigu grandon de bildo" - -#: data/glade/object-editor.glade.h:24 -msgid "Size" -msgstr "Grando" - -#: data/glade/object-editor.glade.h:25 -msgid "Size:" -msgstr "Grando:" - -#: data/glade/object-editor.glade.h:26 -msgid "Style" -msgstr "Stilo" - -#: data/glade/object-editor.glade.h:27 -msgid "Style:" -msgstr "Stilo:" - -#: data/glade/object-editor.glade.h:30 -msgid "X:" -msgstr "X:" - -#: data/glade/object-editor.glade.h:31 -msgid "Y:" -msgstr "Y:" - -#: data/glade/object-editor.glade.h:32 -msgid "degrees" -msgstr "gradoj" - -#: data/glade/object-editor.glade.h:33 -msgid "dialog1" -msgstr "fenestr1" - -#: data/glade/object-editor.glade.h:34 -msgid "digits:" -msgstr "ciferoj:" - -#: data/glade/object-editor.glade.h:35 -msgid "format:" -msgstr "formato:" - -#: data/glade/template-designer.glade.h:1 -msgid " " -msgstr " " - -#: data/glade/template-designer.glade.h:2 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "(es., \"Etichette di spedizione,\" \"Vizitkartoj,\" ...)" - -#: data/glade/template-designer.glade.h:3 -msgid "(e.g., 8163A)" -msgstr "(es. 8163A)" - -#: data/glade/template-designer.glade.h:4 -msgid "(e.g., Avery, Acme, ...)" -msgstr "(es. Avery, Acme, ...)" - -#: data/glade/template-designer.glade.h:6 -msgid "1. Outer radius:" -msgstr "1. Ekstera radiuso:" - -#: data/glade/template-designer.glade.h:7 -msgid "1. Radius:" -msgstr "1. Radiuso:" - -#: data/glade/template-designer.glade.h:8 -msgid "1. Width:" -msgstr "1. Larĝo:" - -#: data/glade/template-designer.glade.h:9 -msgid "2. Height:" -msgstr "2. Alto:" - -#: data/glade/template-designer.glade.h:10 -msgid "2. Inner radius:" -msgstr "2. Interna radiuso:" - -#: data/glade/template-designer.glade.h:11 -msgid "2. Waste (overprint allowed):" -msgstr "2. Forĵetaĵo (surskrivebla):" - -#: data/glade/template-designer.glade.h:12 -msgid "3. Clipping width:" -msgstr "" - -#: data/glade/template-designer.glade.h:13 -msgid "3. Margin" -msgstr "3. Marĝeno" - -#: data/glade/template-designer.glade.h:14 -msgid "3. Round (radius of corner):" -msgstr "3. Rondo (radiuso de angulo):" - -#: data/glade/template-designer.glade.h:15 -msgid "4. Clipping height:" -msgstr "" - -#: data/glade/template-designer.glade.h:16 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "4. Horiz. forĵetaĵo (surskrivebla):" - -#: data/glade/template-designer.glade.h:17 -msgid "5. Vert. waste (overprint allowed):" -msgstr "5. Vert. forĵetaĵo (surskrivebla):" - -#: data/glade/template-designer.glade.h:18 -msgid "5. Waste (overprint allowed):" -msgstr "5. Forĵetaĵo (surskrivebla):" - -#: data/glade/template-designer.glade.h:19 -msgid "6. Margin" -msgstr "6. Marĝeno" - -#: data/glade/template-designer.glade.h:20 -msgid "Brand/Manufacturer:" -msgstr "Marca/Produttore:" - -#: data/glade/template-designer.glade.h:21 -msgid "CD/DVD (including credit card CDs)" -msgstr "KD/DVD" - -#: data/glade/template-designer.glade.h:22 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "" -"Gratulojn!\n" -"\n" -"Vi finis Desegnilon de Modelojn por gLabels.\n" -"Se vi volas konservi tiun ĉi projekton, alklaku sur \"Apliku\".\n" -"\n" -"Male, alklaku sur \"Nuligu\" por nuligi\n" -"vian projekton tutan aÅ­ \"Retroen\" por ankoraÅ­ redakti tiun ĉi desegnon." - -#: data/glade/template-designer.glade.h:30 -msgid "Design Completed" -msgstr "Fino de Projektado" - -#: data/glade/template-designer.glade.h:31 -msgid "Distance from left edge (x0):" -msgstr "Distanco el maldekstra rando (x0):" - -#: data/glade/template-designer.glade.h:32 -msgid "Distance from top edge (y0):" -msgstr "Distanco el supra rando (y0):" - -#: data/glade/template-designer.glade.h:34 -msgid "Horizontal pitch (dx):" -msgstr "Horizontala kvanto (dx):" - -#: data/glade/template-designer.glade.h:35 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" - -#: data/glade/template-designer.glade.h:40 -msgid "Label Size (CD/DVD)" -msgstr "Grando de etikedo (KD/DVD)" - -#: data/glade/template-designer.glade.h:41 -msgid "Label Size (Round)" -msgstr "Grando de etikedo (Ronda)" - -#: data/glade/template-designer.glade.h:42 -msgid "Label or Card Shape" -msgstr "Formo de etikedo aÅ­ de karto" - -#: data/glade/template-designer.glade.h:43 -msgid "Label or Card Size (Rectangular)" -msgstr "Formo de etikedo aÅ­ de karto (Rektangula)" - -#: data/glade/template-designer.glade.h:44 -msgid "Layout #1" -msgstr "Aspekto #1" - -#: data/glade/template-designer.glade.h:45 -msgid "Layout #2" -msgstr "Aspekto #2" - -#: data/glade/template-designer.glade.h:46 -msgid "Layout(s)" -msgstr "Aspekto(j)" - -#: data/glade/template-designer.glade.h:47 -msgid "Name and Description" -msgstr "Nomo kaj Priskribo" - -#: data/glade/template-designer.glade.h:48 -msgid "Number across (nx):" -msgstr "Numero transverse (nx):" - -#: data/glade/template-designer.glade.h:49 -msgid "Number down (ny):" -msgstr "Numero sube (ny):" - -#: data/glade/template-designer.glade.h:50 -msgid "Number of Layouts" -msgstr "Nombro da Aspektoj" - -#: data/glade/template-designer.glade.h:51 -msgid "Number of layouts:" -msgstr "Nombro da aspektoj:" - -#: data/glade/template-designer.glade.h:52 -msgid "Page Size" -msgstr "Grando de paĝo" - -#: data/glade/template-designer.glade.h:54 -msgid "Part #:" -msgstr "Parto #:" - -#: data/glade/template-designer.glade.h:55 -msgid "" -"Please enter the following identifying information about the template " -"stationery." -msgstr "" - -#: data/glade/template-designer.glade.h:56 -msgid "Please enter the following layout information." -msgstr "Bonvolu enmeti menditajn informojn." - -#: data/glade/template-designer.glade.h:57 -msgid "" -"Please enter the following size parameters of a single label in your " -"template." -msgstr "" -"Bonvolu enmeti menditajn parametrojn de grando por unu etikedo en " -"la modelo." - -#: data/glade/template-designer.glade.h:58 -msgid "" -"Please enter the following size parameters of a single label or card in your " -"template." -msgstr "" -"Bonvolu enmeti menditajn parametrojn de grando por unu etikedo aÅ­ karto en " -"la modelo." - -#: data/glade/template-designer.glade.h:59 -msgid "Please select the basic shape of the labels or cards." -msgstr "" - -#: data/glade/template-designer.glade.h:60 -msgid "Please select the page size of the template stationery." -msgstr "Bonvolu elekti grandon de paĝo por modelo de skribvaroj." - -#: data/glade/template-designer.glade.h:61 -msgid "Print test sheet" -msgstr "Presu paĝon de elprovo" - -#: data/glade/template-designer.glade.h:62 -msgid "Rectangular or square (can have rounded corners)" -msgstr "Rektangula aÅ­ kvadra (ankaÅ­ kun rondaj anguloj)" - -#: data/glade/template-designer.glade.h:63 -msgid "Round" -msgstr "Ronda" - -#: data/glade/template-designer.glade.h:64 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" -"Modeloj necesas\n" -"du aspektojn." - -#: data/glade/template-designer.glade.h:66 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" -"Modeloj necesas nur \n" -"unu aspekton." - -#: data/glade/template-designer.glade.h:68 -msgid "Vertical pitch (dy):" -msgstr "Vertikala kvanto (dy):" - -#: data/glade/template-designer.glade.h:69 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" -"Bonvenon! Tiu ĉi estas Desegnilo de Modeloj por gLabels.\n" -"\n" -"Tio helpos vin por krei personigitan modelon por gLabels." - -#. Other ISO A series sizes -#: data/templates/paper-sizes.xml.h:2 -msgid "A0" -msgstr "A0" - -#: data/templates/paper-sizes.xml.h:3 -msgid "A1" -msgstr "A1" - -#: data/templates/paper-sizes.xml.h:4 -msgid "A10" -msgstr "A10" - -#: data/templates/paper-sizes.xml.h:5 -msgid "A2" -msgstr "A2" - -#: data/templates/paper-sizes.xml.h:6 -msgid "A3" -msgstr "A3" - -#: data/templates/paper-sizes.xml.h:7 -msgid "A4" -msgstr "A4" - -#: data/templates/paper-sizes.xml.h:8 -msgid "A5" -msgstr "A5" - -#: data/templates/paper-sizes.xml.h:9 -msgid "A6" -msgstr "A6" - -#: data/templates/paper-sizes.xml.h:10 -msgid "A7" -msgstr "A7" - -#: data/templates/paper-sizes.xml.h:11 -msgid "A8" -msgstr "A8" - -#: data/templates/paper-sizes.xml.h:12 -msgid "A9" -msgstr "A9" - -#. ISO B series sizes -#: data/templates/paper-sizes.xml.h:14 -msgid "B0" -msgstr "B0" - -#: data/templates/paper-sizes.xml.h:15 -msgid "B1" -msgstr "B1" - -#: data/templates/paper-sizes.xml.h:16 -msgid "B10" -msgstr "B10" - -#: data/templates/paper-sizes.xml.h:17 -msgid "B2" -msgstr "B2" - -#: data/templates/paper-sizes.xml.h:18 -msgid "B3" -msgstr "B3" - -#: data/templates/paper-sizes.xml.h:19 -msgid "B4" -msgstr "B4" - -#: data/templates/paper-sizes.xml.h:20 -msgid "B5" -msgstr "B5" - -#: data/templates/paper-sizes.xml.h:21 -msgid "B6" -msgstr "B6" - -#: data/templates/paper-sizes.xml.h:22 -msgid "B7" -msgstr "B7" - -#: data/templates/paper-sizes.xml.h:23 -msgid "B8" -msgstr "B8" - -#: data/templates/paper-sizes.xml.h:24 -msgid "B9" -msgstr "B9" - -#: data/templates/paper-sizes.xml.h:25 -msgid "US Executive" -msgstr "US Executive" - -#. Other US paper sizes -#: data/templates/paper-sizes.xml.h:27 -msgid "US Legal" -msgstr "US Legal" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:2 -#: data/templates/zweckform-iso-templates.xml.h:2 -msgid "Address Labels" -msgstr "Etikedo por adreso" - -#. =================================================================== -#. ============================================================ -#. =================================================================== -#. ====================================================== -#: data/templates/avery-us-templates.xml.h:4 -#: data/templates/avery-iso-templates.xml.h:4 -#: data/templates/zweckform-iso-templates.xml.h:6 -#: data/templates/misc-us-templates.xml.h:3 -#: data/templates/misc-iso-templates.xml.h:17 -msgid "Business Cards" -msgstr "Vizitkartoj" - -#: data/templates/avery-us-templates.xml.h:5 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "Etikedoj por KD/DVD (Etikedoj por diskoj)" - -#: data/templates/avery-us-templates.xml.h:6 -msgid "CD/DVD Labels (Spine Labels)" -msgstr "Etikedoj por KD/DVD (Etikedoj por diskoj)" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:8 -msgid "Diskette Labels" -msgstr "Etikedoj por disketoj" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:10 -msgid "Filing Labels" -msgstr "" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:12 -msgid "Full Sheet Labels" -msgstr "Paĝo plena da ekikedoj" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:14 -msgid "Large Round Labels" -msgstr "Grandaj rondigitaj etikedoj" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:16 -msgid "Name Badge Labels" -msgstr "Nomŝildetoj" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:18 -msgid "Return Address Labels" -msgstr "Etikedoj por adreso de sendinto" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:20 -msgid "Shipping Labels" -msgstr "Etikedoj por ekspedo" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:22 -msgid "Small Round Labels" -msgstr "Malgrandaj rondigitaj etikedoj" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:24 -msgid "Square Labels" -msgstr "Kvardaj etikedoj" - -#: data/templates/avery-us-templates.xml.h:25 -msgid "Video Tape Face Labels" -msgstr "Etikedoj por videokasedo (faco)" - -#: data/templates/avery-us-templates.xml.h:26 -msgid "Video Tape Spine Labels" -msgstr "Etikedoj por videokasedo (dorso)" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:2 -msgid "Address labels" -msgstr "Etikedoj por adreso" - -#. =============================================================== -#: data/templates/avery-iso-templates.xml.h:6 -msgid "CD Booklet" -msgstr "CD Booklet" - -#. =============================================================== -#: data/templates/avery-iso-templates.xml.h:8 -msgid "CD Inlet" -msgstr "CD Inlet" - -#. =============================================================== -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:10 -#: data/templates/zweckform-iso-templates.xml.h:8 -#: data/templates/misc-us-templates.xml.h:5 -#: data/templates/misc-iso-templates.xml.h:21 -msgid "CD/DVD Labels" -msgstr "Etikedoj por KD/DVD" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:12 -msgid "Diskette labels" -msgstr "Etikedoj por disketoj" - -#. =============================================================== -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:14 -#: data/templates/zweckform-iso-templates.xml.h:14 -#: data/templates/misc-iso-templates.xml.h:35 -msgid "Mailing Labels" -msgstr "Etikedoj por poŝto" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:16 -msgid "Mailing labels" -msgstr "Etikedoj por poŝto" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:18 -msgid "Mini Address Labels" -msgstr "Eta etikedoj por adreso" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:20 -msgid "Shipping labels" -msgstr "Etikedo por ekspedo" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:4 -msgid "Allround Labels" -msgstr "Plenrondaj etikedoj" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:10 -msgid "Correction and Cover-up Labels" -msgstr "Etikedoj por korektado kaj kovrado" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:12 -msgid "Lever Arch File Labels" -msgstr "Levilaj arkaj etikedoj por dosieroj" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:16 -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "QSL-Karten Etiketten 70mm x 50,8mm" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:18 -msgid "Rectangular Copier Labels" -msgstr "Rektangulaj etikedoj por kopiado" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:20 -#: data/templates/misc-iso-templates.xml.h:44 -msgid "Rectangular Labels" -msgstr "Rektangulaj Etikedoj" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:22 -msgid "Video Labels (back)" -msgstr "Etikedo por Video (retro)" - -#: data/templates/misc-us-templates.xml.h:1 -msgid "Business Card CD" -msgstr "Vizitkarto KD" - -#: data/templates/misc-us-templates.xml.h:4 -msgid "CD Template Rectangles" -msgstr "Modelaj Rektanguloj por KD" - -#: data/templates/misc-us-templates.xml.h:6 -msgid "CD/DVD Labels (Face Only)" -msgstr "Etikedoj por KD/DVD (nur faco)" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:7 -#: data/templates/misc-iso-templates.xml.h:23 -msgid "CD/DVD Labels (face only)" -msgstr "Etikedoj por KD/DVD (nur faco)" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:9 -msgid "Cassette Labels" -msgstr "Etikedoj por kasedoj" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:11 -msgid "DLT Labels" -msgstr "Etikedoj DLT" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:13 -msgid "Microtube labels" -msgstr "Mikrotubaj etikedoj" - -#: data/templates/misc-us-templates.xml.h:14 -msgid "Mini-CD Labels" -msgstr "Etikedoj por Mini-KD" - -#: data/templates/misc-us-templates.xml.h:15 -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "Etikedoj por PRO CD (nur KD-dorso)" - -#: data/templates/misc-us-templates.xml.h:16 -msgid "PRO CD Labels 2-up (Face only)" -msgstr "Etikedoj por PRO CD (nur faco)" - -#: data/templates/misc-us-templates.xml.h:17 -#: data/templates/misc-iso-templates.xml.h:42 -msgid "PRO CD Labels 2-up (face only)" -msgstr "Etikedoj por PRO CD (nur faco)" - -#: data/templates/misc-us-templates.xml.h:18 -msgid "Slimline CD Case (rightside up)" -msgstr "Subtila KD-ujo (dekstrosupra)" - -#: data/templates/misc-us-templates.xml.h:19 -msgid "Slimline CD Case (upside down)" -msgstr "Subtila KD-ujo (kaposuba)" - -#: data/templates/misc-iso-templates.xml.h:1 -msgid "Agipa 119488: Business Cards" -msgstr "Agipa 119488: Vizitkartoj" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:3 -msgid "Allround Labels --24" -msgstr "Plenrondaj etikedoj --24" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:5 -msgid "Allround Labels --44" -msgstr "Plenrondaj etikedoj --44" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:7 -msgid "Allround Labels --64" -msgstr "Plenrondaj etikedoj --64" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:9 -msgid "Allround Labels --65" -msgstr "Plenrondaj etikedoj --65" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:11 -msgid "Arch File Labels" -msgstr "Arkaj etikedoj por dosieroj" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:13 -msgid "Arch File Labels (large)" -msgstr "Arkaj etikedoj por dosieroj (grandaj)" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:15 -msgid "Arch File Labels (small)" -msgstr "Arkaj etikedoj por dosieroj (etaj)" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:19 -msgid "CD Labels" -msgstr "Etikedoj por KD" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:25 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "Etikedoj kun standarta formato por KD/DVD (nur faco)" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:27 -msgid "Diskette Labels (face only)" -msgstr "Etikedoj por disketoj (nur faco)" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:29 -msgid "EPSON Photo Stickers 16" -msgstr "EPSON Photo Stickers 16" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:31 -msgid "Etiketten" -msgstr "Etiketten" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:33 -msgid "Fridge Magnet Stickers" -msgstr "Magnetaĵoj por fridujo" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:37 -msgid "Mailing Labels --14" -msgstr "Etikedo por poŝto --14" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:39 -msgid "Mailing Labels-2 columns" -msgstr "Etikedo por poŝto kun 2 kolumnoj" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:41 -msgid "Mailing Labels-3 columns" -msgstr "Etikedo por poŝto kun 3 kolumnoj" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:46 -msgid "Video Labels (face only)" -msgstr "Etikedoj por video (nur frontispico)" - -#: data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers" -msgstr "Kreu etikedojn, vizitkartojn kaj kovrilojn de plurmediaĵoj" - -#: data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "gLabels Designer di etichetta" - -#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 -msgid "gLabels Project File" -msgstr "Dosiero de Projekto de gLabels" - diff --git a/glabels2/po/es.po b/glabels2/po/es.po deleted file mode 100644 index 9dc7ad40..00000000 --- a/glabels2/po/es.po +++ /dev/null @@ -1,2565 +0,0 @@ -# Spanish translation of glabels. -# sergio rivadero , 2005. -# -msgid "" -msgstr "" -"Project-Id-Version: glabels 2.1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-22 14:03-0500\n" -"PO-Revision-Date: 2005-02-12 12:19-0300\n" -"Last-Translator: sergio rivadero \n" -"Language-Team: Spanish/Spain \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: src/glabels.c:116 -msgid "Could not initialize Bonobo!\n" -msgstr "No se puede inicializar Bonobo!\n" - -#: src/glabels-batch.c:52 -msgid "print this message" -msgstr "imprimir este mensaje" - -#: src/glabels-batch.c:54 -msgid "print the version of glabels-batch being used" -msgstr "imprimir la versión utilizada de glabels-batch" - -#: src/glabels-batch.c:56 -msgid "set output filename (default=\"output.ps\")" -msgstr "establecer nombre de archivo (predeterminado=\"output.ps\")" - -#: src/glabels-batch.c:56 src/glabels-batch.c:70 -msgid "filename" -msgstr "nombre de archivo" - -#: src/glabels-batch.c:58 -msgid "number of sheets (default=1)" -msgstr "número de hojas (predeterminado=1)" - -#: src/glabels-batch.c:58 -msgid "sheets" -msgstr "hojas" - -#: src/glabels-batch.c:60 -msgid "number of copies (default=1)" -msgstr "número de copias (predeterminado=1)" - -#: src/glabels-batch.c:60 -msgid "copies" -msgstr "copias" - -#: src/glabels-batch.c:62 -msgid "first label on first sheet (default=1)" -msgstr "primera etiqueta en primera hoja (predeterminado=1)" - -#: src/glabels-batch.c:62 -msgid "first" -msgstr "primero" - -#: src/glabels-batch.c:64 src/print-dialog.c:336 -msgid "print outlines (to test printer alignment)" -msgstr "imprimir un esbozo (para verificar la alineación de la impresora)" - -#: src/glabels-batch.c:66 src/print-dialog.c:344 -msgid "print in reverse (i.e. a mirror image)" -msgstr "impresión invertida (imagen espejo)" - -#: src/glabels-batch.c:68 src/print-dialog.c:351 -msgid "print crop marks" -msgstr "imprimir marcas de corte" - -#: src/glabels-batch.c:70 -msgid "input file for merging" -msgstr "archivo de entrada para combinar" - -#: src/glabels-batch.c:107 -msgid "[OPTION...] GLABELS_FILE..." -msgstr "[OPCION...] archivo-glabels..." - -#: src/glabels-batch.c:127 -#, c-format -msgid "missing glabels file\n" -msgstr "archivo glabels perdido\n" - -#: src/glabels-batch.c:158 -#, c-format -msgid "cannot perform document merge with glabels file %s\n" -msgstr "No se puede combinar el archivo %s\n" - -#: src/glabels-batch.c:182 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "No se puede abrir el archivo %s\n" - -#: src/window.c:244 -msgid "(none) - gLabels" -msgstr "(sin nombre) - gLabels" - -#: src/window.c:414 -msgid "(modified)" -msgstr "(modificado)" - -#: src/stock.c:65 data/ui/glabels-ui.xml.h:162 -msgid "_Select Mode" -msgstr "_Modo selección" - -#: src/stock.c:66 data/ui/glabels-ui.xml.h:163 -msgid "_Text" -msgstr "_Texto" - -#: src/stock.c:67 data/ui/glabels-ui.xml.h:148 -msgid "_Line" -msgstr "_Línea" - -#: src/stock.c:68 data/ui/glabels-ui.xml.h:130 -msgid "_Box" -msgstr "_Rectangulo" - -#: src/stock.c:69 data/ui/glabels-ui.xml.h:141 -msgid "_Ellipse" -msgstr "_Elipse" - -#: src/stock.c:70 data/ui/glabels-ui.xml.h:146 -msgid "_Image" -msgstr "_Imagen" - -#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 -msgid "Bar_code" -msgstr "_Código de barras" - -#: src/stock.c:72 -msgid "_Merge Properties" -msgstr "Propiedades de _fusión de datos" - -#: src/stock.c:73 -msgid "Object _Properties" -msgstr "Propiedades del objeto" - -#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 -msgid "Bring to _Front" -msgstr "Traer al _frente" - -#: src/stock.c:75 data/ui/glabels-ui.xml.h:109 -msgid "Send to _Back" -msgstr "Enviar al f_ondo" - -#: src/stock.c:76 data/ui/glabels-ui.xml.h:96 -msgid "Rotate _Left" -msgstr "Rotar a la _izquierda" - -#: src/stock.c:77 data/ui/glabels-ui.xml.h:97 -msgid "Rotate _Right" -msgstr "Rotar a la _derecha" - -#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 -msgid "Flip _Horizontally" -msgstr "Reflejar _horizontalmente" - -#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 -msgid "Flip _Vertically" -msgstr "Reflejar _verticalmente" - -#: src/stock.c:80 data/ui/glabels-ui.xml.h:147 -msgid "_Lefts" -msgstr "A la _izquierda" - -#: src/stock.c:81 data/ui/glabels-ui.xml.h:159 -msgid "_Rights" -msgstr "A la _derecha" - -#: src/stock.c:82 data/ui/glabels-ui.xml.h:131 -msgid "_Centers" -msgstr "_Centrado" - -#: src/stock.c:83 data/ui/glabels-ui.xml.h:164 -msgid "_Tops" -msgstr "_Superior" - -#: src/stock.c:84 -msgid "Bottoms" -msgstr "_Inferior" - -#: src/stock.c:85 -msgid "Centers" -msgstr "_Centrado" - -#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 -msgid "Label Ce_nter" -msgstr "Centro de la _etiqueta" - -#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 -msgid "Fill color" -msgstr "Color de relleno" - -#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 -msgid "Line color" -msgstr "Color de línea" - -#: src/stock.c:90 src/stock.c:92 -msgid "Linked" -msgstr "Enlazado" - -#: src/stock.c:91 src/stock.c:93 -msgid "Not Linked" -msgstr "No enlazado" - -#: src/ui-property-bar.c:345 src/object-editor.c:587 -msgid "Default" -msgstr "Predeterminado" - -#: src/ui-property-bar.c:360 src/object-editor.c:600 -msgid "No fill" -msgstr "Sin relleno" - -#: src/ui-property-bar.c:375 src/object-editor.c:593 -msgid "No line" -msgstr "Sin línea" - -#: src/ui-sidebar.c:180 -msgid "Object properties" -msgstr "Propiedades del objeto" - -#: src/commands.c:385 -msgid "" -"A label and business card creation program for GNOME.\n" -" \n" -"Glabels is free software; you can redistribute it and/or modify it under the " -"terms of the GNU General Public License as published by the Free Software " -"Foundation; either version 2 of the License, or (at your option) any later " -"version.\n" -" \n" -"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.\n" -msgstr "" -"Un programa de creación de etiquetas y tarjetas para GNOME.\n" -" \n" -"Glabels es software libre; Puede modificarlo y redistribuirlo bajo los " -"términos de la Licencia Pública General de GNU tal como es publicada por la " -"Free Software Foundation; ya sea la versión 2 de dicha licencia, o (a su " -"opción) cualquier otra versión posterior.\n" -" \n" -"Este programa se distribuye con la esperanza que le será útil, pero SIN " -"NINGUNA GARANTÍA; Para más detalles vea la Licencia Pública General de GNU.\n" - -#: src/commands.c:399 -msgid "See the file AUTHORS for additional credits," -msgstr "Vea el archivo AUTHORS, " - -#: src/commands.c:400 -msgid "or visit http://glabels.sourceforge.net/" -msgstr "o visite http://glabels.sourceforge.net/" - -#: src/commands.c:409 -msgid " " -msgstr " " - -#: src/commands.c:424 -msgid "glabels" -msgstr "glabels" - -#: src/file.c:100 -msgid "New Label or Card" -msgstr "Nueva etiqueta o tarjeta" - -#: src/file.c:132 src/file.c:304 -msgid "Media Type" -msgstr "Tipo de papel" - -#: src/file.c:138 src/file.c:310 -msgid "Label orientation" -msgstr "Orientación de la etiqueta" - -#: src/file.c:269 -msgid "Label properties" -msgstr "Propiedades de la etiqueta" - -#: src/file.c:452 src/file.c:870 -msgid "All files" -msgstr "Todos los archivos" - -#: src/file.c:457 src/file.c:875 -msgid "gLabels documents" -msgstr "Documentos glabels" - -#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 -msgid "Empty file name selection" -msgstr "Vaciar selección de nombre de archivo" - -#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 -msgid "Please select a file or supply a valid file name" -msgstr "Por favor seleccione un archivo o escriba un nombre de archivo válido" - -#: src/file.c:519 src/file.c:631 -msgid "File does not exist" -msgstr "Archivo no existe" - -#: src/file.c:563 data/ui/glabels-ui.xml.h:74 -msgid "Open" -msgstr "Abrir" - -#: src/file.c:565 -msgid "Open label" -msgstr "Abrir etiqueta" - -#: src/file.c:707 -#, c-format -msgid "Could not open file \"%s\"" -msgstr "No se puede abrir el archivo \"%s\"" - -#: src/file.c:715 -msgid "Not a supported file format" -msgstr "Formato de archivo no soportado" - -#: src/file.c:797 src/file.c:979 src/file.c:1174 -#, c-format -msgid "Could not save file \"%s\"" -msgstr "No se puede guardar el archivo \"%s\"" - -#: src/file.c:805 src/file.c:987 src/file.c:1182 -msgid "Error encountered during save. The file is still not saved." -msgstr "Se encontró un error al guardar. El archivo aún no está guardado." - -#: src/file.c:848 src/file.c:1048 -#, c-format -msgid "Save \"%s\" as" -msgstr "Guardar como \"%s\"" - -#: src/file.c:935 src/file.c:1131 -msgid "Please supply a valid file name" -msgstr "Debe proporcionar un nombre de archivo válido" - -#: src/file.c:952 src/file.c:1147 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "Sobreescribir el archivo \"%s\"?" - -#: src/file.c:960 src/file.c:1155 -msgid "File already exists." -msgstr "El archivo ya existe." - -#: src/file.c:1271 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "Guardar cambios del documento \"%s\" antes de cerrar?" - -#: src/file.c:1279 -msgid "Your changes will be lost if you don't save them." -msgstr "Sus cambios se perderán si no los guarda." - -#: src/file.c:1282 -msgid "Close without saving" -msgstr "Cerrar sin guardar" - -#. Should not happen -#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 -#: data/glade/object-editor.glade.h:37 -msgid "points" -msgstr "puntos" - -#: src/prefs.c:158 data/glade/object-editor.glade.h:36 -#: data/glade/template-designer.glade.h:74 -msgid "inches" -msgstr "pulgadas" - -#: src/prefs.c:160 -msgid "mm" -msgstr "mm" - -#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 -msgid "gLabels Preferences" -msgstr "Preferencias de gLabels" - -#. -#. * Submenu: Order -#. -#: src/view.c:3574 data/ui/glabels-ui.xml.h:154 -msgid "_Order" -msgstr "Or_den" - -#. -#. * Submenu: Rotate/Flip -#. -#: src/view.c:3595 data/ui/glabels-ui.xml.h:160 -msgid "_Rotate/Flip" -msgstr "_Rotar/Reflejar" - -#. -#. * Submenu: Align Horizontally -#. -#: src/view.c:3628 -msgid "Align _Horizontally" -msgstr "Alinear _horizontalmente" - -#. -#. * Submenu: Align Vertically -#. -#: src/view.c:3667 -msgid "Align _Vertically" -msgstr "Alinear _verticalmente" - -#: src/view.c:3728 data/ui/glabels-ui.xml.h:137 -msgid "_Delete" -msgstr "_Borrar" - -#. Build editor. -#: src/view-box.c:236 -msgid "Box object properties" -msgstr "Propiedades del rectángulo" - -#. Build editor. -#: src/view-ellipse.c:236 -msgid "Ellipse object properties" -msgstr "Propiedades del elipse" - -#. Build editor. -#: src/view-line.c:229 -msgid "Line object properties" -msgstr "Propiedades de la línea" - -#. Build editor. -#: src/view-image.c:223 -msgid "Image object properties" -msgstr "Propiedades de la imagen" - -#. Build editor. -#: src/view-text.c:251 -msgid "Text object properties" -msgstr "Propiedades del texto" - -#: src/view-text.c:571 data/glade/object-editor.glade.h:28 -msgid "Text" -msgstr "Texto" - -#. Build editor. -#: src/view-barcode.c:210 -msgid "Barcode object properties" -msgstr "Propiedades del código de barras" - -#: src/view-barcode.c:594 src/print.c:1125 -msgid "Invalid barcode data" -msgstr "Datos de código de barras no válidos" - -#: src/merge-properties-dialog.c:231 -msgid "Merge Properties" -msgstr "Propiedades de combinación de datos" - -#. ---- Source section ---- -#: src/merge-properties-dialog.c:237 -msgid "Source" -msgstr "Fuente" - -#: src/merge-properties-dialog.c:245 -msgid "Format:" -msgstr "Formato:" - -#. Location line -#: src/merge-properties-dialog.c:273 -msgid "Location:" -msgstr "Ubicación:" - -#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 -msgid "Select merge-database source" -msgstr "Seleccione la fuente de datos para combinar" - -#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 -msgid "N/A" -msgstr "N/D" - -#. ---- Sample Fields section ---- -#: src/merge-properties-dialog.c:300 -msgid "Record selection/preview:" -msgstr "Selección de registros/Vista previa" - -#: src/merge-properties-dialog.c:326 -msgid "Select" -msgstr "Seleccionar" - -#: src/merge-properties-dialog.c:334 -msgid "Record/Field" -msgstr "Registro/Campo" - -#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 -msgid "Data" -msgstr "Datos" - -#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:81 -msgid "Print" -msgstr "Imprimir" - -#: src/print-dialog.c:281 -msgid "_Job" -msgstr "_Trabajo" - -#: src/print-dialog.c:286 -msgid "P_rinter" -msgstr "_Impresora" - -#. ----------- Add simple-copies widget ------------ -#: src/print-dialog.c:314 -msgid "Copies" -msgstr "Copias" - -#. ------- Add merge control widget ------------ -#: src/print-dialog.c:322 -msgid "Document merge control" -msgstr "Control de combinación de documentos" - -#. ----------- Add custom print options area ------------ -#: src/print-dialog.c:330 -msgid "Options" -msgstr "Opciones" - -#: src/print-dialog.c:553 src/print-dialog.c:592 -msgid "Print preview" -msgstr "Previsualizar la impresión" - -#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 -msgid "gLabels Template Designer" -msgstr "Diseñador de plantillas gLabels" - -#: src/bc.c:60 -msgid "POSTNET (any)" -msgstr "POSTNET (cualquiera)" - -#: src/bc.c:63 -msgid "POSTNET-5 (ZIP only)" -msgstr "POSTNET-5 (solo código postal)" - -#: src/bc.c:66 -msgid "POSTNET-9 (ZIP+4)" -msgstr "POSTNET-9 (código postal+4)" - -#: src/bc.c:69 -msgid "POSTNET-11 (DPBC)" -msgstr "POSTNET-11 (DPBC)" - -#: src/bc.c:72 -msgid "EAN (any)" -msgstr "EAN (cualquiera)" - -#: src/bc.c:75 -msgid "EAN-8" -msgstr "EAN-8" - -#: src/bc.c:78 -msgid "EAN-8 +2" -msgstr "EAN-8 +2" - -#: src/bc.c:81 -msgid "EAN-8 +5" -msgstr "EAN-8 +5" - -#: src/bc.c:84 -msgid "EAN-13" -msgstr "EAN-13" - -#: src/bc.c:87 -msgid "EAN-13 +2" -msgstr "EAN-13 2" - -#: src/bc.c:90 -msgid "EAN-13 +5" -msgstr "EAN-13 +5" - -#: src/bc.c:93 -msgid "UPC (UPC-A or UPC-E)" -msgstr "UPC (UPC-A o UPC-E)" - -#: src/bc.c:96 -msgid "UPC-A" -msgstr "UPC-A" - -#: src/bc.c:99 -msgid "UPC-A +2" -msgstr "UPC-A +2" - -#: src/bc.c:102 -msgid "UPC-A +5" -msgstr "UPC-A +5" - -#: src/bc.c:105 -msgid "UPC-E" -msgstr "UPC-E" - -#: src/bc.c:108 -msgid "UPC-E +2" -msgstr "UPC-E +2" - -#: src/bc.c:111 -msgid "UPC-E +5" -msgstr "UPC-E +5" - -#: src/bc.c:114 -msgid "ISBN" -msgstr "ISBN" - -#: src/bc.c:117 -msgid "ISBN +5" -msgstr "ISBN +5" - -#: src/bc.c:120 -msgid "Code 39" -msgstr "Code 39" - -#: src/bc.c:123 -msgid "Code 128" -msgstr "Code 128" - -#: src/bc.c:126 -msgid "Code 128C" -msgstr "Code 128C" - -#: src/bc.c:129 -msgid "Code 128B" -msgstr "Code 128B" - -#: src/bc.c:132 -msgid "Interleaved 2 of 5" -msgstr "Intercalado 2 de 5" - -#: src/bc.c:135 -msgid "Codabar" -msgstr "Codabar" - -#: src/bc.c:138 -msgid "MSI" -msgstr "MSI" - -#: src/bc.c:141 -msgid "Plessey" -msgstr "Plessey" - -#: src/label.c:569 -msgid "Untitled" -msgstr "Sin título" - -#: src/xml-label.c:176 src/xml-label.c:213 -msgid "xmlParseFile error" -msgstr "error xmlParseFile" - -#: src/xml-label.c:250 -msgid "No document root" -msgstr "No hay documento raíz" - -#: src/xml-label.c:264 -msgid "Importing from glabels 0.1 format" -msgstr "Importando desde formato glabels 0.1" - -#: src/xml-label.c:272 -msgid "Importing from glabels 0.4 format" -msgstr "Importando desde formato glabels 0.4" - -#: src/xml-label.c:279 -msgid "Importing from glabels 1.91 format" -msgstr "Importando desde formato glabels 1.91" - -#: src/xml-label.c:282 -msgid "bad document, unknown glabels Namespace" -msgstr "documento de tipo erróneo, etiquetas glabels no encontradas" - -#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "Nodo raíz erróneo = \"%s\"" - -#: src/xml-label.c:348 src/xml-label-191.c:165 -#, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "Nodo erróneo en sección Document = \"%s\"" - -#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 -#, c-format -msgid "bad node = \"%s\"" -msgstr "Nodo erróneo = \"%s\"" - -#: src/xml-label.c:855 src/xml-label-191.c:624 -#, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "Nodo erróneo en sección Data = \"%s\"" - -#: src/xml-label.c:1030 libglabels/xml-template.c:535 -msgid "Utf8 conversion error." -msgstr "Conversión UTF-8 errónea" - -#: src/xml-label.c:1037 libglabels/xml-template.c:542 -msgid "Problem saving xml file." -msgstr "Problemas al guardar archivo xml" - -#. This should always be an id, but just in case a name -#. slips by! -#: src/xml-label-191.c:699 libglabels/xml-template.c:199 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "Código \"%s\" de tamaño de página desconocido, intentando como nombre." - -#: src/xml-label-191.c:709 libglabels/xml-template.c:209 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "Código \"%s\" o nombre de página desconocido" - -#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 -msgid "None" -msgstr "Ninguno" - -#: src/merge-init.c:53 -msgid "Text file with comma delimeters (CSV)" -msgstr "Texto separado con comas" - -#: src/merge-init.c:60 -msgid "Text file with colon delimeters" -msgstr "Texto separado con dos puntos" - -#: src/merge-init.c:67 -msgid "Text file with tab delimeters" -msgstr "Texto separado con tabuladores" - -#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 -msgid "File:" -msgstr "Archivo:" - -#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 -msgid "Key:" -msgstr "Clave:" - -#: src/wdgt-print-copies.c:179 -msgid "Sheets:" -msgstr "Hojas:" - -#: src/wdgt-print-copies.c:197 -msgid "Labels" -msgstr "Etiquetas" - -#: src/wdgt-print-copies.c:200 -msgid "from:" -msgstr "desde:" - -#: src/wdgt-print-copies.c:207 -msgid "to:" -msgstr "hasta:" - -#: src/wdgt-print-merge.c:178 -msgid "Start on label" -msgstr "Comenzar en la etiqueta" - -#: src/wdgt-print-merge.c:186 -msgid "on 1st sheet" -msgstr "en la primera hoja" - -#: src/wdgt-print-merge.c:195 -msgid "Copies:" -msgstr "Copias:" - -#: src/wdgt-print-merge.c:201 -msgid "Collate" -msgstr "Intercalar" - -#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 -msgid "Description:" -msgstr "Descripción:" - -#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 -msgid "Page size:" -msgstr "Tamaño de la página:" - -#: src/wdgt-media-select.c:290 -msgid "Label size:" -msgstr "Tamaño de la etiqueta:" - -#: src/wdgt-media-select.c:301 -msgid "Layout:" -msgstr "Disposición:" - -#: src/wdgt-media-select.c:578 -#, c-format -msgid "%d x %d (%d per sheet)" -msgstr "%d x %d (%d por hoja)" - -#: src/wdgt-media-select.c:582 -#, c-format -msgid "%d per sheet" -msgstr "%d por hoja" - -#: src/wdgt-media-select.c:614 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -#: src/wdgt-media-select.c:619 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 -#, c-format -msgid "%s %s diameter" -msgstr "Diámetro %s %s" - -#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 -#, c-format -msgid "%.5g %s diameter" -msgstr "Diámetro %.5g %s" - -#: src/wdgt-rotate-label.c:193 -msgid "Rotate" -msgstr "Rotar" - -#. This is the default custom color -#: src/mygal/color-palette.c:396 -msgid "custom" -msgstr "personalizado" - -#. "Custom" color - we'll pop up a GnomeColorPicker -#: src/mygal/color-palette.c:438 -msgid "Custom Color:" -msgstr "Color personalizado:" - -#: src/mygal/color-palette.c:446 -msgid "Choose Custom Color" -msgstr "Elegir color:" - -#: src/mygal/color-palette.c:579 -msgid "black" -msgstr "negro" - -#: src/mygal/color-palette.c:580 -msgid "light brown" -msgstr "marrón" - -#: src/mygal/color-palette.c:581 -msgid "brown gold" -msgstr "marrón oscuro" - -#: src/mygal/color-palette.c:582 -msgid "dark green #2" -msgstr "verde oscuro #2" - -#: src/mygal/color-palette.c:583 -msgid "navy" -msgstr "azul metalizado" - -#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 -msgid "dark blue" -msgstr "azul muy oscuro" - -#: src/mygal/color-palette.c:585 -msgid "purple #2" -msgstr "azul oscuro" - -#: src/mygal/color-palette.c:586 -msgid "very dark gray" -msgstr "verde muy oscuro" - -#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 -msgid "dark red" -msgstr "rojo oscuro" - -#: src/mygal/color-palette.c:590 -msgid "red-orange" -msgstr "anaranjado" - -#: src/mygal/color-palette.c:591 -msgid "gold" -msgstr "marrón claro" - -#: src/mygal/color-palette.c:592 -msgid "dark green" -msgstr "verde oscuro" - -#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 -msgid "dull blue" -msgstr "verde azulado" - -#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 -msgid "blue" -msgstr "azul" - -#: src/mygal/color-palette.c:595 -msgid "dull purple" -msgstr "violeta azulado" - -#: src/mygal/color-palette.c:596 -msgid "dark grey" -msgstr "gris oscuro" - -#: src/mygal/color-palette.c:599 -msgid "red" -msgstr "rojo" - -#: src/mygal/color-palette.c:600 -msgid "orange" -msgstr "naranja" - -#: src/mygal/color-palette.c:601 -msgid "lime" -msgstr "lima" - -#: src/mygal/color-palette.c:602 -msgid "dull green" -msgstr "verde opaco" - -#: src/mygal/color-palette.c:603 -msgid "dull blue #2" -msgstr "cyan" - -#: src/mygal/color-palette.c:604 -msgid "sky blue #2" -msgstr "celeste" - -#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 -msgid "purple" -msgstr "violeta" - -#: src/mygal/color-palette.c:606 -msgid "gray" -msgstr "gris" - -#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 -msgid "magenta" -msgstr "fucsia" - -#: src/mygal/color-palette.c:610 -msgid "bright orange" -msgstr "naranja claro" - -#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 -msgid "yellow" -msgstr "amarillo" - -#: src/mygal/color-palette.c:612 -msgid "green" -msgstr "verde" - -#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 -msgid "cyan" -msgstr "turquesa" - -#: src/mygal/color-palette.c:614 -msgid "bright blue" -msgstr "azul claro" - -#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 -msgid "red purple" -msgstr "borravino" - -#: src/mygal/color-palette.c:616 -msgid "light grey" -msgstr "gris claro" - -#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 -msgid "pink" -msgstr "rosa" - -#: src/mygal/color-palette.c:620 -msgid "light orange" -msgstr "naranja claro" - -#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 -msgid "light yellow" -msgstr "amarillo claro" - -#: src/mygal/color-palette.c:622 -msgid "light green" -msgstr "verde claro" - -#: src/mygal/color-palette.c:623 -msgid "light cyan" -msgstr "turquesa claro" - -#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 -msgid "light blue" -msgstr "celeste claro" - -#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 -msgid "light purple" -msgstr "violeta claro" - -#: src/mygal/color-palette.c:626 -msgid "white" -msgstr "blanco" - -#: src/mygal/color-palette.c:631 -msgid "purplish blue" -msgstr "azul purpurado" - -#: src/mygal/color-palette.c:635 -msgid "dark purple" -msgstr "violeta oscuro" - -#: src/mygal/color-palette.c:637 -msgid "sky blue" -msgstr "celeste" - -#: libglabels/template.c:848 -#, c-format -msgid "Generic %s full page" -msgstr "Página completa genérica %s" - -#: libglabels/template.c:897 -msgid "No template files found!" -msgstr "No se encontraron archivos de plantilla!" - -#. Create and append an "Other" entry. -#: libglabels/paper.c:67 -msgid "Other" -msgstr "Otros" - -#: libglabels/paper.c:361 -msgid "No paper files found!" -msgstr "No se encontró tipo de papel!" - -#: data/ui/glabels-ui.xml.h:1 -msgid "About glabels" -msgstr "Acerca de glabels" - -#: data/ui/glabels-ui.xml.h:2 -msgid "About..." -msgstr "Acerca de..." - -#: data/ui/glabels-ui.xml.h:3 -msgid "Align _Horizontal" -msgstr "Alineado _horizontal" - -#: data/ui/glabels-ui.xml.h:4 -msgid "Align _Vertical" -msgstr "Alineado _vertical" - -#: data/ui/glabels-ui.xml.h:5 -msgid "Align objects to bottoms" -msgstr "Alinear objetos por su parte inferior" - -#: data/ui/glabels-ui.xml.h:6 -msgid "Align objects to horizontal centers" -msgstr "Alinear objetos por su centro" - -#: data/ui/glabels-ui.xml.h:7 -msgid "Align objects to left edges" -msgstr "Alinear objetos por su lado izquierdo" - -#: data/ui/glabels-ui.xml.h:8 -msgid "Align objects to right edges" -msgstr "Alinear objetos por su lado derecho" - -#: data/ui/glabels-ui.xml.h:9 -msgid "Align objects to tops" -msgstr "Alinear objetos por su parte superior" - -#: data/ui/glabels-ui.xml.h:10 -msgid "Align objects to vertical centers" -msgstr "Alinear objetos por su centro" - -#: data/ui/glabels-ui.xml.h:12 -msgid "Bold" -msgstr "Negrita" - -#: data/ui/glabels-ui.xml.h:14 -msgid "Center align" -msgstr "Centrado" - -#: data/ui/glabels-ui.xml.h:15 -msgid "Center objects to horizontal label center" -msgstr "Centrar objetos con el centro horizontal de la etiqueta" - -#: data/ui/glabels-ui.xml.h:16 -msgid "Center objects to vertical label center" -msgstr "Centrar objetos con el centro vertical de la etiqueta" - -#: data/ui/glabels-ui.xml.h:17 -msgid "Change the visibility of markup lines in the current window" -msgstr "Cambiar la visibilidad de los márgenes" - -#: data/ui/glabels-ui.xml.h:18 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "Cambiar la visibilidad de la barra de dibujo" - -#: data/ui/glabels-ui.xml.h:19 -msgid "Change the visibility of the grid in the current window" -msgstr "Cambiar la visibilidad de la grilla" - -#: data/ui/glabels-ui.xml.h:20 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "Cambiar la visibilidad de la barra principal" - -#: data/ui/glabels-ui.xml.h:21 -msgid "Change the visibility of the property toolbar in the current window" -msgstr "Cambiar la visibilidad de la barra de propiedades" - -#: data/ui/glabels-ui.xml.h:22 -msgid "Close" -msgstr "Cerrar" - -#: data/ui/glabels-ui.xml.h:23 -msgid "Close the current file" -msgstr "Guardar el archivo en uso" - -#: data/ui/glabels-ui.xml.h:24 -msgid "Configure the application" -msgstr "Configurar aplicación" - -#: data/ui/glabels-ui.xml.h:25 -msgid "Contents" -msgstr "Contenido" - -#: data/ui/glabels-ui.xml.h:26 -msgid "Copy" -msgstr "Copiar" - -#: data/ui/glabels-ui.xml.h:27 -msgid "Copy the selection" -msgstr "Copiar la selección" - -#: data/ui/glabels-ui.xml.h:28 -msgid "Create a custom template" -msgstr "Crear una plantilla personalizada" - -#: data/ui/glabels-ui.xml.h:29 -msgid "Create a new document" -msgstr "Crear un nuevo documento" - -#: data/ui/glabels-ui.xml.h:30 -msgid "Create barcode object" -msgstr "Crear un objeto código de barras" - -#: data/ui/glabels-ui.xml.h:31 -msgid "Create box/rectangle object" -msgstr "Crear un cuadrado o rectángulo" - -#: data/ui/glabels-ui.xml.h:32 -msgid "Create ellipse/circle object" -msgstr "Crear un círculo o elipse" - -#: data/ui/glabels-ui.xml.h:33 -msgid "Create image object" -msgstr "Crear una imagen" - -#: data/ui/glabels-ui.xml.h:34 -msgid "Create line object" -msgstr "Crear una línea" - -#: data/ui/glabels-ui.xml.h:35 -msgid "Create text object" -msgstr "Crear un cuadro de texto" - -#: data/ui/glabels-ui.xml.h:36 -msgid "Cu_t" -msgstr "Cor_tar" - -#: data/ui/glabels-ui.xml.h:37 -msgid "Customize" -msgstr "Personalizar" - -#: data/ui/glabels-ui.xml.h:38 -msgid "Customize Drawing Toolbar" -msgstr "Personalizar barra de dibujo" - -#: data/ui/glabels-ui.xml.h:39 -msgid "Customize Main Toolbar" -msgstr "Personalizar barra principal" - -#: data/ui/glabels-ui.xml.h:40 -msgid "Customize Property Toolbar" -msgstr "Personalizar barra de propiedades" - -#: data/ui/glabels-ui.xml.h:41 -msgid "Customize toolbars" -msgstr "Personalizar barras de herramientas" - -#: data/ui/glabels-ui.xml.h:42 -msgid "Cut" -msgstr "Cortar" - -#: data/ui/glabels-ui.xml.h:43 -msgid "Cut the selection" -msgstr "Cortar la selección" - -#: data/ui/glabels-ui.xml.h:44 -msgid "Decrease magnification" -msgstr "Reducir escala" - -#: data/ui/glabels-ui.xml.h:45 -msgid "Delete" -msgstr "Borrar" - -#: data/ui/glabels-ui.xml.h:46 -msgid "Delete the selected objects" -msgstr "Borrar los objetos seleccionados" - -#: data/ui/glabels-ui.xml.h:47 -msgid "Drawing toolbar" -msgstr "Barra de dibujo" - -#: data/ui/glabels-ui.xml.h:48 -msgid "Dump XML" -msgstr "Volcar XML" - -#: data/ui/glabels-ui.xml.h:49 -msgid "Dump the UI Xml description" -msgstr "Volcar la descripción UI XML" - -#: data/ui/glabels-ui.xml.h:50 -msgid "Edit merge properties" -msgstr "Editar propiedades de combinación de datos" - -#: data/ui/glabels-ui.xml.h:54 -msgid "Flip object horizontally" -msgstr "Reflejar objeto horizontalmente" - -#: data/ui/glabels-ui.xml.h:55 -msgid "Flip object vertically" -msgstr "Reflejar objeto verticalmente" - -#: data/ui/glabels-ui.xml.h:56 -msgid "Font name" -msgstr "Fuente" - -#: data/ui/glabels-ui.xml.h:57 -msgid "Font selector" -msgstr "Selección de fuentes" - -#: data/ui/glabels-ui.xml.h:58 -msgid "Font size" -msgstr "Tamaño de fuente" - -#: data/ui/glabels-ui.xml.h:59 -msgid "Icon and _Text" -msgstr "Icono y _texto" - -#: data/ui/glabels-ui.xml.h:60 -msgid "Increase magnification" -msgstr "Aumentar escala" - -#: data/ui/glabels-ui.xml.h:61 -msgid "Italic" -msgstr "Itálica" - -#: data/ui/glabels-ui.xml.h:63 -msgid "Left align" -msgstr "Alineación izquierda" - -#: data/ui/glabels-ui.xml.h:65 -msgid "Line width" -msgstr "Ancho de línea" - -#: data/ui/glabels-ui.xml.h:66 -msgid "Lower object to bottom" -msgstr "Llevar objeto al fondo" - -#: data/ui/glabels-ui.xml.h:67 -msgid "M_arkup" -msgstr "_Margen" - -#: data/ui/glabels-ui.xml.h:68 -msgid "Main toolbar" -msgstr "Barra principal" - -#: data/ui/glabels-ui.xml.h:69 -msgid "Markup" -msgstr "Margen" - -#: data/ui/glabels-ui.xml.h:70 -msgid "Modify document properties" -msgstr "Modificar las propiedades del documento" - -#: data/ui/glabels-ui.xml.h:71 -msgid "New" -msgstr "Nuevo" - -#: data/ui/glabels-ui.xml.h:72 -msgid "Object property editor" -msgstr "Editor de propiedades de objeto" - -#: data/ui/glabels-ui.xml.h:73 -msgid "Only show icons in the main toolbar" -msgstr "Sólo mostrar iconos en la barra principal" - -#: data/ui/glabels-ui.xml.h:75 -msgid "Open a file" -msgstr "Abrir un archivo" - -#: data/ui/glabels-ui.xml.h:76 -msgid "Open the glabels manual" -msgstr "Abrir el manual de glabels" - -#: data/ui/glabels-ui.xml.h:77 -msgid "Paste" -msgstr "Pegar" - -#: data/ui/glabels-ui.xml.h:78 -msgid "Paste the clipboard" -msgstr "Pegar desde portapapeles" - -#: data/ui/glabels-ui.xml.h:79 -msgid "Pr_eferences..." -msgstr "Pre_ferencias..." - -#: data/ui/glabels-ui.xml.h:80 -msgid "Preferences" -msgstr "Preferencias" - -#: data/ui/glabels-ui.xml.h:82 -msgid "Print the current file" -msgstr "Imprimir el archivo en uso" - -#: data/ui/glabels-ui.xml.h:83 -msgid "Proper_ties..." -msgstr "_Propiedades..." - -#: data/ui/glabels-ui.xml.h:84 -msgid "Properties" -msgstr "Propiedades" - -#: data/ui/glabels-ui.xml.h:85 -msgid "Property toolbar" -msgstr "Barra de propiedades" - -#: data/ui/glabels-ui.xml.h:86 -msgid "Quit" -msgstr "Salir" - -#: data/ui/glabels-ui.xml.h:87 -msgid "Quit the program" -msgstr "Salir del programa" - -#: data/ui/glabels-ui.xml.h:88 -msgid "Raise object to top" -msgstr "Traer al frente" - -#: data/ui/glabels-ui.xml.h:89 -msgid "Recent _Files" -msgstr "Archivos _recientes" - -#: data/ui/glabels-ui.xml.h:90 -msgid "Redo" -msgstr "Rehacer" - -#: data/ui/glabels-ui.xml.h:91 -msgid "Redo the undone action" -msgstr "Repetir la última acción" - -#: data/ui/glabels-ui.xml.h:92 -msgid "Remove all selections" -msgstr "Eliminar todas las selecciones" - -#: data/ui/glabels-ui.xml.h:94 -#, no-c-format -msgid "Restore scale to 100%" -msgstr "Restablecer escala al 100%" - -#: data/ui/glabels-ui.xml.h:95 -msgid "Right align" -msgstr "Alineación derecha" - -#: data/ui/glabels-ui.xml.h:98 -msgid "Rotate object 90 clockwise" -msgstr "Rotar 90 grados a la derecha" - -#: data/ui/glabels-ui.xml.h:99 -msgid "Rotate object 90 counter-clockwise" -msgstr "Rotar 90 grados a la izquierda" - -#: data/ui/glabels-ui.xml.h:100 -msgid "Save" -msgstr "Guardar" - -#: data/ui/glabels-ui.xml.h:101 -msgid "Save As" -msgstr "Guardar como" - -#: data/ui/glabels-ui.xml.h:102 -msgid "Save _As..." -msgstr "Guardar _como..." - -#: data/ui/glabels-ui.xml.h:103 -msgid "Save the current file" -msgstr "Guardar el archivo en uso" - -#: data/ui/glabels-ui.xml.h:104 -msgid "Save the current file with a different name" -msgstr "Guardar archivo con otro nombre" - -#: data/ui/glabels-ui.xml.h:105 -msgid "Select All" -msgstr "_Deseleccionar todo" - -#: data/ui/glabels-ui.xml.h:106 -msgid "Select _All" -msgstr "Seleccionar t_odo" - -#: data/ui/glabels-ui.xml.h:107 -msgid "Select all objects" -msgstr "Seleccionar todos los objetos" - -#: data/ui/glabels-ui.xml.h:108 -msgid "Select, move and modify objects" -msgstr "Seleccionar, mover y modificar objetos" - -#: data/ui/glabels-ui.xml.h:110 -msgid "Set main toolbar button style according to desktop default" -msgstr "" -"Establecer apariencia de la barra principal según estilo predeterminado del " -"escitorio" - -#: data/ui/glabels-ui.xml.h:111 -msgid "Show _Tooltips" -msgstr "Mostrar indicadores" - -#: data/ui/glabels-ui.xml.h:112 -msgid "Show both icons and texts in the main toolbar" -msgstr "Mostrar iconos y texto en la barra principal" - -#: data/ui/glabels-ui.xml.h:113 -msgid "Show tooltips in the drawing toolbar" -msgstr "Mostrar indicadores en la barra de dibujo" - -#: data/ui/glabels-ui.xml.h:114 -msgid "Show tooltips in the main toolbar" -msgstr "Mostrar indicadores en la barra principal" - -#: data/ui/glabels-ui.xml.h:115 -msgid "Show tooltips in the property toolbar" -msgstr "Mostrar indicadores en la barra de propiedades" - -#: data/ui/glabels-ui.xml.h:116 -msgid "Template Designer" -msgstr "Diseñador de plantillas" - -#: data/ui/glabels-ui.xml.h:117 -msgid "Template _Designer..." -msgstr "_Diseñador de plantillas" - -#: data/ui/glabels-ui.xml.h:118 -msgid "Text color" -msgstr "Color de texto" - -#: data/ui/glabels-ui.xml.h:119 -msgid "U_n-select All" -msgstr "_Deseleccionar todo" - -#: data/ui/glabels-ui.xml.h:120 -msgid "Un-select All" -msgstr "Deseleccionar todo" - -#: data/ui/glabels-ui.xml.h:121 -msgid "Undo" -msgstr "Deshacer" - -#: data/ui/glabels-ui.xml.h:122 -msgid "Undo the last action" -msgstr "Deshcar la última acción" - -#: data/ui/glabels-ui.xml.h:123 -msgid "Zoom _1:1" -msgstr "Escala _1:1" - -#: data/ui/glabels-ui.xml.h:124 -msgid "Zoom _In" -msgstr "_Ampliar" - -#: data/ui/glabels-ui.xml.h:125 -msgid "Zoom _Out" -msgstr "_Reducir" - -#: data/ui/glabels-ui.xml.h:126 -msgid "Zoom to _fit" -msgstr "A_justar" - -#: data/ui/glabels-ui.xml.h:127 -msgid "Zoom to fit window" -msgstr "Ampliar hasta ajustar" - -#: data/ui/glabels-ui.xml.h:128 -msgid "_About..." -msgstr "_Acerca de..." - -# REVISAR -#: data/ui/glabels-ui.xml.h:129 -msgid "_Bottoms" -msgstr "" - -#: data/ui/glabels-ui.xml.h:132 -msgid "_Close" -msgstr "_Cerrar" - -#: data/ui/glabels-ui.xml.h:133 -msgid "_Contents" -msgstr "_Contenido" - -#: data/ui/glabels-ui.xml.h:134 -msgid "_Copy" -msgstr "_Copiar" - -#: data/ui/glabels-ui.xml.h:135 -msgid "_Create Object" -msgstr "Crear _objeto" - -#: data/ui/glabels-ui.xml.h:136 -msgid "_Debug" -msgstr "_Depurar" - -#: data/ui/glabels-ui.xml.h:138 -msgid "_Desktop Default" -msgstr "_Predeterminado del escritorio" - -#: data/ui/glabels-ui.xml.h:139 -msgid "_Drawing Toolbar" -msgstr "Barra de dibujo" - -#: data/ui/glabels-ui.xml.h:140 -msgid "_Edit" -msgstr "_Editar" - -#: data/ui/glabels-ui.xml.h:142 -msgid "_File" -msgstr "_Archivo" - -#: data/ui/glabels-ui.xml.h:143 -msgid "_Grid" -msgstr "_Grilla" - -#: data/ui/glabels-ui.xml.h:144 -msgid "_Help" -msgstr "A_yuda" - -#: data/ui/glabels-ui.xml.h:145 -msgid "_Icon" -msgstr "_Icono" - -#: data/ui/glabels-ui.xml.h:149 -msgid "_Main Toolbar" -msgstr "Barra principal" - -#: data/ui/glabels-ui.xml.h:150 -msgid "_Merge Properties..." -msgstr "Propiedades de _combinación de datos" - -#: data/ui/glabels-ui.xml.h:151 -msgid "_New" -msgstr "_Nuevo" - -#: data/ui/glabels-ui.xml.h:152 -msgid "_Objects" -msgstr "_Objetos" - -#: data/ui/glabels-ui.xml.h:153 -msgid "_Open..." -msgstr "_Abrir..." - -#: data/ui/glabels-ui.xml.h:155 -msgid "_Paste" -msgstr "_Pegar" - -#: data/ui/glabels-ui.xml.h:156 -msgid "_Print..." -msgstr "_Imprimir" - -#: data/ui/glabels-ui.xml.h:157 -msgid "_Property Toolbar" -msgstr "Barra de propedades" - -#: data/ui/glabels-ui.xml.h:158 -msgid "_Quit" -msgstr "_Salir" - -#: data/ui/glabels-ui.xml.h:161 -msgid "_Save" -msgstr "_Guardar" - -#: data/ui/glabels-ui.xml.h:165 -msgid "_View" -msgstr "_Ver" - -#: data/glade/prefs-dialog.glade.h:1 -msgid " " -msgstr " " - -#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 -#: data/glade/template-designer.glade.h:5 -msgid "*" -msgstr "*" - -#: data/glade/prefs-dialog.glade.h:3 -msgid "Default page size" -msgstr "Tamaño de página predeterminado" - -#: data/glade/prefs-dialog.glade.h:4 -msgid "Fill" -msgstr "Relleno" - -#: data/glade/prefs-dialog.glade.h:5 -msgid "Line" -msgstr "Línea" - -#: data/glade/prefs-dialog.glade.h:6 -msgid "Text" -msgstr "Texto" - -#: data/glade/prefs-dialog.glade.h:7 -msgid "Units" -msgstr "Medidas" - -#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 -msgid "Alignment:" -msgstr "Alineación:" - -#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 -msgid "Color:" -msgstr "Color:" - -#: data/glade/prefs-dialog.glade.h:10 -msgid "Font:" -msgstr "Fuente:" - -#: data/glade/prefs-dialog.glade.h:11 -msgid "ISO A4" -msgstr "ISO A4" - -#: data/glade/prefs-dialog.glade.h:12 -msgid "Inches" -msgstr "Pulgadas" - -#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 -msgid "Line Spacing:" -msgstr "Espaciado:" - -#: data/glade/prefs-dialog.glade.h:14 -msgid "Locale" -msgstr "Documento" - -#: data/glade/prefs-dialog.glade.h:15 -msgid "Millimeters" -msgstr "Milímetros" - -#: data/glade/prefs-dialog.glade.h:16 -msgid "Object defaults" -msgstr "Objetos" - -#: data/glade/prefs-dialog.glade.h:17 -msgid "Points" -msgstr "Puntos" - -#: data/glade/prefs-dialog.glade.h:18 -msgid "Select default properties for new objects." -msgstr "Seleccione las propiedades predeterminadoas para los nuevos objetos." - -#: data/glade/prefs-dialog.glade.h:19 -msgid "Select locale specific behavior." -msgstr "Seleccione las propiedades del documento." - -#. Most popular (at top of list) -#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:29 -msgid "US Letter" -msgstr "Carta" - -#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 -#: data/glade/template-designer.glade.h:72 -msgid "Width:" -msgstr "Ancho:" - -#: data/glade/object-editor.glade.h:2 -msgid "00000000000 00000" -msgstr "00000000000 00000" - -#: data/glade/object-editor.glade.h:3 -msgid "Xxx object properties" -msgstr "" -"Propiedades de objecto xxx" - -#: data/glade/object-editor.glade.h:5 -msgid "Allow merge to automatically shrink text" -msgstr "Permitir ampliar texto automáticamente" - -#: data/glade/object-editor.glade.h:6 -msgid "Angle:" -msgstr "Ángulo:" - -#: data/glade/object-editor.glade.h:7 -msgid "Checksum" -msgstr "Verificación" - -#: data/glade/object-editor.glade.h:10 -msgid "Family:" -msgstr "Familia:" - -#: data/glade/object-editor.glade.h:12 -msgid "Fill" -msgstr "Relleno" - -#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 -msgid "Height:" -msgstr "Alto:" - -#: data/glade/object-editor.glade.h:14 -msgid "Image" -msgstr "Imagen" - -#: data/glade/object-editor.glade.h:15 -msgid "Insert merge field" -msgstr "Insertar campo para combinar" - -#: data/glade/object-editor.glade.h:17 -msgid "Length:" -msgstr "Longitud:" - -#: data/glade/object-editor.glade.h:18 -msgid "Line" -msgstr "Línea" - -#: data/glade/object-editor.glade.h:20 -msgid "Literal:" -msgstr "Literal:" - -#: data/glade/object-editor.glade.h:21 -msgid "Load image" -msgstr "Cargar imagen" - -#: data/glade/object-editor.glade.h:22 -msgid "Position" -msgstr "Posición" - -#: data/glade/object-editor.glade.h:23 -msgid "Reset image size" -msgstr "Restablecer el tamaño de la imagen" - -#: data/glade/object-editor.glade.h:24 -msgid "Size" -msgstr "Tamaño" - -#: data/glade/object-editor.glade.h:25 -msgid "Size:" -msgstr "Tamaño:" - -#: data/glade/object-editor.glade.h:26 -msgid "Style" -msgstr "Estilo" - -#: data/glade/object-editor.glade.h:27 -msgid "Style:" -msgstr "Estilo:" - -#: data/glade/object-editor.glade.h:30 -msgid "X:" -msgstr "X:" - -#: data/glade/object-editor.glade.h:31 -msgid "Y:" -msgstr "Y:" - -#: data/glade/object-editor.glade.h:32 -msgid "degrees" -msgstr "grados" - -#: data/glade/object-editor.glade.h:33 -msgid "dialog1" -msgstr "dialogo1" - -#: data/glade/object-editor.glade.h:34 -msgid "digits:" -msgstr "dígitos:" - -#: data/glade/object-editor.glade.h:35 -msgid "format:" -msgstr "Formato:" - -#: data/glade/template-designer.glade.h:1 -msgid " " -msgstr " " - -#: data/glade/template-designer.glade.h:2 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "(por ej., \"Etiquetas para correo,\" \"Tarjetas de negocio,\" ...)" - -#: data/glade/template-designer.glade.h:3 -msgid "(e.g., 8163A)" -msgstr "(por ej., 8163A)" - -#: data/glade/template-designer.glade.h:4 -msgid "(e.g., Avery, Acme, ...)" -msgstr "(por ej., Avery, Acme, ...)" - -#: data/glade/template-designer.glade.h:6 -msgid "1. Outer radius:" -msgstr "1. Radio externo:" - -#: data/glade/template-designer.glade.h:7 -msgid "1. Radius:" -msgstr "1. Radio:" - -#: data/glade/template-designer.glade.h:8 -msgid "1. Width:" -msgstr "1. Ancho:" - -#: data/glade/template-designer.glade.h:9 -msgid "2. Height:" -msgstr "2. Alto:" - -#: data/glade/template-designer.glade.h:10 -msgid "2. Inner radius:" -msgstr "2. Radio interno:" - -#: data/glade/template-designer.glade.h:11 -msgid "2. Waste (overprint allowed):" -msgstr "2. Sobrante (sobreimpresión permitida):" - -#: data/glade/template-designer.glade.h:12 -msgid "3. Clipping width:" -msgstr "3. Ancho de recorte:" - -#: data/glade/template-designer.glade.h:13 -msgid "3. Margin" -msgstr "3. Márgen" - -#: data/glade/template-designer.glade.h:14 -msgid "3. Round (radius of corner):" -msgstr "3. Redondez (radio de las esquinas)" - -#: data/glade/template-designer.glade.h:15 -msgid "4. Clipping height:" -msgstr "4. Alto de recorte:" - -#: data/glade/template-designer.glade.h:16 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "4. Sobrante horizontal (sobreimpresión permitida):" - -#: data/glade/template-designer.glade.h:17 -msgid "5. Vert. waste (overprint allowed):" -msgstr "5. Sobrante vertical (sobreimpresión permitida):" - -#: data/glade/template-designer.glade.h:18 -msgid "5. Waste (overprint allowed):" -msgstr "5. Sobrante (sobreimpresión permitida):" - -#: data/glade/template-designer.glade.h:19 -msgid "6. Margin" -msgstr "6. Margen" - -#: data/glade/template-designer.glade.h:20 -msgid "Brand/Manufacturer:" -msgstr "Marca/Fabricante:" - -#: data/glade/template-designer.glade.h:21 -msgid "CD/DVD (including credit card CDs)" -msgstr "CD/DVD (incluyendo CD-tarjeta)" - -#: data/glade/template-designer.glade.h:22 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "" -"Fecilitaciones!\n" -" \n" -"Ha completado la plantilla.\n" -"Si desea guardar su diseño pulse en \"Aplicar\".\n" -" \n" -"Puede pulsar \"Cancelar\" para abandonar su diseño\n" -"o \"Atrás\" para volver a editarlo." - -#: data/glade/template-designer.glade.h:30 -msgid "Design Completed" -msgstr "Diseño completo" - -#: data/glade/template-designer.glade.h:31 -msgid "Distance from left edge (x0):" -msgstr "Distancia desde el borde izquierdo (x0):" - -#: data/glade/template-designer.glade.h:32 -msgid "Distance from top edge (y0):" -msgstr "Distancia desde el borde superior (y0):" - -#: data/glade/template-designer.glade.h:34 -msgid "Horizontal pitch (dx):" -msgstr "Desplazamiento horizontal (dx):" - -#: data/glade/template-designer.glade.h:35 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" -"¿Cuantas disposiciones tendrá su plantilla?\n" -"\n" -"Una disposición es un conjunto de etiquetas o tarjetas que se pueden ordenar " -"en una hoja.\n" -"La mayoría de las plantillas necesitan solo una disposición, como en el " -"primer ejemplo.\n" -"El segundo ejemplo muestra dos disposiciones." - -#: data/glade/template-designer.glade.h:40 -msgid "Label Size (CD/DVD)" -msgstr "Tamaño de etiqueta (CD/DVD)" - -#: data/glade/template-designer.glade.h:41 -msgid "Label Size (Round)" -msgstr "Tamaño de etiqueta (Redondeada):" - -#: data/glade/template-designer.glade.h:42 -msgid "Label or Card Shape" -msgstr "Forma de etiqueta o tarjeta" - -#: data/glade/template-designer.glade.h:43 -msgid "Label or Card Size (Rectangular)" -msgstr "Tamaño de etiqueta o tarjeta (rectangular)" - -#: data/glade/template-designer.glade.h:44 -msgid "Layout #1" -msgstr "Disposición 1:" - -#: data/glade/template-designer.glade.h:45 -msgid "Layout #2" -msgstr "Disposición 2:" - -#: data/glade/template-designer.glade.h:46 -msgid "Layout(s)" -msgstr "Disposicion(es):" - -#: data/glade/template-designer.glade.h:47 -msgid "Name and Description" -msgstr "Nombre y descripción:" - -#: data/glade/template-designer.glade.h:48 -msgid "Number across (nx):" -msgstr "Cantidad horizontal (nx):" - -#: data/glade/template-designer.glade.h:49 -msgid "Number down (ny):" -msgstr "Cantidad vertical (ny):" - -#: data/glade/template-designer.glade.h:50 -msgid "Number of Layouts" -msgstr "Cantidad de disposiciones" - -#: data/glade/template-designer.glade.h:51 -msgid "Number of layouts:" -msgstr "Cantidad de disposiciones:" - -#: data/glade/template-designer.glade.h:52 -msgid "Page Size" -msgstr "Tamaño de la página" - -#: data/glade/template-designer.glade.h:54 -msgid "Part #:" -msgstr "Número de parte:" - -#: data/glade/template-designer.glade.h:55 -msgid "" -"Please enter the following identifying information about the template " -"stationery." -msgstr "" -"Por favor ingrese la siguiente información que identifique la plantilla." - -#: data/glade/template-designer.glade.h:56 -msgid "Please enter the following layout information." -msgstr "Por favor ingrese la siguiente información sobre la disposición." - -#: data/glade/template-designer.glade.h:57 -msgid "" -"Please enter the following size parameters of a single label in your " -"template." -msgstr "Por favor ingrese las medidas de cada etiqueta de su plantilla." - -#: data/glade/template-designer.glade.h:58 -msgid "" -"Please enter the following size parameters of a single label or card in your " -"template." -msgstr "" -"Por favor ingrese los siguientes parámetros de tamaño para cada etiqueta en " -"su plantilla." - -#: data/glade/template-designer.glade.h:59 -msgid "Please select the basic shape of the labels or cards." -msgstr "Por favor seleccione la forma básica de las etiquetas o tarjetas." - -#: data/glade/template-designer.glade.h:60 -msgid "Please select the page size of the template stationery." -msgstr "Por favor seleccione el tamaño de la página para la plantilla." - -#: data/glade/template-designer.glade.h:61 -msgid "Print test sheet" -msgstr "Imprimir página de prueba" - -#: data/glade/template-designer.glade.h:62 -msgid "Rectangular or square (can have rounded corners)" -msgstr "Rectangular o cuadrada (puede tener bordes redondeados)" - -#: data/glade/template-designer.glade.h:63 -msgid "Round" -msgstr "Redonda" - -#: data/glade/template-designer.glade.h:64 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" -"Plantillas que necesitan\n" -"dos disposiciones." - -#: data/glade/template-designer.glade.h:66 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" -"Plantillas que necesitan\n" -"una disposición." - -#: data/glade/template-designer.glade.h:68 -msgid "Vertical pitch (dy):" -msgstr "Desplazamiento vertical (dy):" - -#: data/glade/template-designer.glade.h:69 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" -"Bienvenido al diseñador de plantillas de gLabels.\n" -"\n" -"Este diálogo le asistirá en la creación de una plantilla personalizada." - -#. Other ISO A series sizes -#: data/templates/paper-sizes.xml.h:2 -msgid "A0" -msgstr "A0" - -#: data/templates/paper-sizes.xml.h:3 -msgid "A1" -msgstr "A1" - -#: data/templates/paper-sizes.xml.h:4 -msgid "A10" -msgstr "A10" - -#: data/templates/paper-sizes.xml.h:5 -msgid "A2" -msgstr "A2" - -#: data/templates/paper-sizes.xml.h:6 -msgid "A3" -msgstr "A3" - -#: data/templates/paper-sizes.xml.h:7 -msgid "A4" -msgstr "A4" - -#: data/templates/paper-sizes.xml.h:8 -msgid "A5" -msgstr "A5" - -#: data/templates/paper-sizes.xml.h:9 -msgid "A6" -msgstr "A6" - -#: data/templates/paper-sizes.xml.h:10 -msgid "A7" -msgstr "A7" - -#: data/templates/paper-sizes.xml.h:11 -msgid "A8" -msgstr "A8" - -#: data/templates/paper-sizes.xml.h:12 -msgid "A9" -msgstr "A9" - -#. ISO B series sizes -#: data/templates/paper-sizes.xml.h:14 -msgid "B0" -msgstr "B0" - -#: data/templates/paper-sizes.xml.h:15 -msgid "B1" -msgstr "B1" - -#: data/templates/paper-sizes.xml.h:16 -msgid "B10" -msgstr "B10" - -#: data/templates/paper-sizes.xml.h:17 -msgid "B2" -msgstr "B2" - -#: data/templates/paper-sizes.xml.h:18 -msgid "B3" -msgstr "B3" - -#: data/templates/paper-sizes.xml.h:19 -msgid "B4" -msgstr "B4" - -#: data/templates/paper-sizes.xml.h:20 -msgid "B5" -msgstr "B5" - -#: data/templates/paper-sizes.xml.h:21 -msgid "B6" -msgstr "B6" - -#: data/templates/paper-sizes.xml.h:22 -msgid "B7" -msgstr "B7" - -#: data/templates/paper-sizes.xml.h:23 -msgid "B8" -msgstr "B8" - -#: data/templates/paper-sizes.xml.h:24 -msgid "B9" -msgstr "B9" - -#: data/templates/paper-sizes.xml.h:25 -msgid "US Executive" -msgstr "Ejecutivo" - -#. Other US paper sizes -#: data/templates/paper-sizes.xml.h:27 -msgid "US Legal" -msgstr "Legal" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:2 -#: data/templates/zweckform-iso-templates.xml.h:2 -msgid "Address Labels" -msgstr "Etiquetas de dirección" - -#. =================================================================== -#. ============================================================ -#. =================================================================== -#. ====================================================== -#: data/templates/avery-us-templates.xml.h:4 -#: data/templates/avery-iso-templates.xml.h:4 -#: data/templates/zweckform-iso-templates.xml.h:6 -#: data/templates/misc-us-templates.xml.h:3 -#: data/templates/misc-iso-templates.xml.h:17 -msgid "Business Cards" -msgstr "Tarjetas de negocio" - -#: data/templates/avery-us-templates.xml.h:5 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "Etiquetas de CD/DVD" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:7 -msgid "Diskette Labels" -msgstr "Etiquetas de diskettes" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:9 -msgid "Filing Labels" -msgstr "Etiquetas para archivado" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:11 -msgid "Full Sheet Labels" -msgstr "Etiquetas de página completa" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:13 -msgid "Large Round Labels" -msgstr "Etiquetas redondeadas grandes" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:15 -msgid "Name Badge Labels" -msgstr "Etiquetas de distintivos" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:17 -msgid "Return Address Labels" -msgstr "Etiquetas de dirección de remitente" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:19 -msgid "Shipping Labels" -msgstr "Etiquetas de envío" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:21 -msgid "Small Round Labels" -msgstr "Etiquetas redondeadas pequeñas" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:23 -msgid "Square Labels" -msgstr "Etiquetas cuadradas" - -#: data/templates/avery-us-templates.xml.h:24 -msgid "Video Tape Face Labels" -msgstr "Etiquetas de video (frente)" - -#: data/templates/avery-us-templates.xml.h:25 -msgid "Video Tape Spine Labels" -msgstr "Etiquetas de video (lateral)" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:2 -msgid "Address labels" -msgstr "Etiquetas de dirección" - -#. =============================================================== -#: data/templates/avery-iso-templates.xml.h:6 -msgid "CD Booklet" -msgstr "Tapa de CD" - -#. =============================================================== -#: data/templates/avery-iso-templates.xml.h:8 -msgid "CD Inlet" -msgstr "Interior de CD" - -#. =============================================================== -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:10 -#: data/templates/zweckform-iso-templates.xml.h:8 -#: data/templates/misc-us-templates.xml.h:5 -#: data/templates/misc-iso-templates.xml.h:21 -msgid "CD/DVD Labels" -msgstr "Etiquetas de CD/DVD" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:12 -msgid "Diskette labels" -msgstr "Etiquetas de disquette" - -#. =============================================================== -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:14 -#: data/templates/zweckform-iso-templates.xml.h:14 -#: data/templates/misc-iso-templates.xml.h:35 -msgid "Mailing Labels" -msgstr "Etiquetas de correo" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:16 -msgid "Mailing labels" -msgstr "Etiquetas de correo" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:18 -msgid "Mini Address Labels" -msgstr "Etiquetas de dirección pequeñas" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:20 -msgid "Shipping labels" -msgstr "Etiquetas de envío" - -# REVISAR -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:4 -msgid "Allround Labels" -msgstr "" - -# REVISAR -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:10 -msgid "Correction and Cover-up Labels" -msgstr "" - -# REVISAR -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:12 -msgid "Lever Arch File Labels" -msgstr "" - -# REVISAR -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:16 -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "" - -# REVISAR -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:18 -msgid "Rectangular Copier Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:20 -#: data/templates/misc-iso-templates.xml.h:44 -msgid "Rectangular Labels" -msgstr "Etiquetas rectangulares" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:22 -msgid "Video Labels (back)" -msgstr "Etiquetas de video (dorso)" - -#: data/templates/misc-us-templates.xml.h:1 -msgid "Business Card CD" -msgstr "CD-tarjeta" - -# REVISAR -#: data/templates/misc-us-templates.xml.h:4 -msgid "CD Template Rectangles" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:6 -msgid "CD/DVD Labels (Face Only)" -msgstr "Etiquetas CD/DVD (Sólo frente)" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:7 -#: data/templates/misc-iso-templates.xml.h:23 -msgid "CD/DVD Labels (face only)" -msgstr "Etiquetas CD/DVD (sólo frente)" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:9 -msgid "Cassette Labels" -msgstr "Etiquetas de casette" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:11 -msgid "DLT Labels" -msgstr "Etiquetas DLT" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:13 -msgid "Microtube labels" -msgstr "Etiquetas microtubo" - -#: data/templates/misc-us-templates.xml.h:14 -msgid "Mini-CD Labels" -msgstr "Etiquetas Mini-CD" - -# REVISAR -#: data/templates/misc-us-templates.xml.h:15 -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "" - -# REVISAR -#: data/templates/misc-us-templates.xml.h:16 -msgid "PRO CD Labels 2-up (Face only)" -msgstr "" - -# REVISAR -#: data/templates/misc-us-templates.xml.h:17 -#: data/templates/misc-iso-templates.xml.h:42 -msgid "PRO CD Labels 2-up (face only)" -msgstr "" - -# REVISAR -#: data/templates/misc-us-templates.xml.h:18 -msgid "Slimline CD Case (rightside up)" -msgstr "" - -# REVISAR -#: data/templates/misc-us-templates.xml.h:19 -msgid "Slimline CD Case (upside down)" -msgstr "" - -# REVISAR -#: data/templates/misc-iso-templates.xml.h:1 -msgid "Agipa 119488: Business Cards" -msgstr "" - -# REVISAR -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:3 -msgid "Allround Labels --24" -msgstr "" - -# REVISAR -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:5 -msgid "Allround Labels --44" -msgstr "" - -# REVISAR -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:7 -msgid "Allround Labels --64" -msgstr "" - -# REVISAR -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:9 -msgid "Allround Labels --65" -msgstr "" - -# REVISAR -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:11 -msgid "Arch File Labels" -msgstr "" - -# REVISAR -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:13 -msgid "Arch File Labels (large)" -msgstr "" - -# REVISAR -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:15 -msgid "Arch File Labels (small)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:19 -msgid "CD Labels" -msgstr "Etiquetas para CD" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:25 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "Etieuats CD/DVD Formato estándar (sólo frente)" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:27 -msgid "Diskette Labels (face only)" -msgstr "Etiquetas para disquette (sólo cara)" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:29 -msgid "EPSON Photo Stickers 16" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:31 -msgid "Etiketten" -msgstr "Etiketten" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:33 -msgid "Fridge Magnet Stickers" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:37 -msgid "Mailing Labels --14" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:39 -msgid "Mailing Labels-2 columns" -msgstr "Etiquetas de correo - 2 columnas" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:41 -msgid "Mailing Labels-3 columns" -msgstr "Etiquetas de correo - 3 columnas" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:46 -msgid "Video Labels (face only)" -msgstr "Etiqeutas de video (solo frente)" - -#: data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers" -msgstr "Crear etiquetas, tarjetas de negocios y portadas" - -#: data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "Diseñador de etiquetas gLabels" - -#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 -msgid "gLabels Project File" -msgstr "Archivo de projecto gLabels" - -#, fuzzy -#~ msgid "Object _Properties..." -#~ msgstr "Propiedades del texto" - -#~ msgid "Display units" -#~ msgstr "Mostrar unidades de medida" - -#~ msgid "Default page size" -#~ msgstr "Tamaño de página por omisión" - -#~ msgid "Outline" -#~ msgstr "Contorno" - -#~ msgid "Edit line object properties" -#~ msgstr "Modificar las propiedades del objeto línea" - -#~ msgid "Edit text object properties" -#~ msgstr "Modificar las propiedades del objeto texto" - -#~ msgid "Maintain current aspect ratio" -#~ msgstr "Mantener la proporción actual del aspecto" - -#, fuzzy -#~ msgid "Open %s" -#~ msgstr "Abrir" - -#~ msgid "Revert to saved copy of %s?" -#~ msgstr "¿ Recuperar la copia salvada de %s ?" - -#~ msgid "Unknown media type. Using default." -#~ msgstr "Tipo de papel desconocido. Utilizando el tipo por omisión." - -#~ msgid "" -#~ "``%s'' has been modified.\n" -#~ "\n" -#~ "Do you wish to save it?" -#~ msgstr "" -#~ "\"%s\" ha sido modificado.\n" -#~ "\n" -#~ "¿ Desea salvarlo ?" - -#~ msgid "Close / Save label as" -#~ msgstr "Cerrar / Salvar etiqueta como" - -#~ msgid "Label no longer valid!" -#~ msgstr "¡ La etiqueta ya no es válida !" - -#~ msgid "Error writing file" -#~ msgstr "Error salvando el archivo" - -#~ msgid "Edit properties..." -#~ msgstr "Modificar propiedades" - -#~ msgid "Appearance" -#~ msgstr "Apariencia" - -#~ msgid "Position/Size" -#~ msgstr "Posición/Tamaño" - -#~ msgid "Image format not currently supported" -#~ msgstr "Formato de imagen no soportado actualmente" - -#~ msgid "Barcode data" -#~ msgstr "Datos del código de barras" - -#~ msgid "%" -#~ msgstr "%" - -#~ msgid "Show text with barcode" -#~ msgstr "Mostrar texto con código de barras" - -#~ msgid "Fields" -#~ msgstr "Campos" - -#~ msgid "Column" -#~ msgstr "Columna" - -#~ msgid "Sample data" -#~ msgstr "Datos de ejemplo" - -#~ msgid "Make a new, empty label" -#~ msgstr "Crear una etiqueta vacía nueva" - -#~ msgid " New " -#~ msgstr "Nuevo" - -#~ msgid "New Label/Card" -#~ msgstr "Nueva tarjeta/etiqueta" - -#~ msgid " Open " -#~ msgstr " Abrir " - -#~ msgid " Save " -#~ msgstr " Guardar " - -#~ msgid " Print " -#~ msgstr " Imprimir " - -#~ msgid "Function is not implemented!" -#~ msgstr "¡ La funcionalidad no está aún implementada !" diff --git a/glabels2/po/fr.po b/glabels2/po/fr.po deleted file mode 100644 index c7476e04..00000000 --- a/glabels2/po/fr.po +++ /dev/null @@ -1,3311 +0,0 @@ -# French translation of glabels. -# Copyright (C) 2001 Jim Evins -# Olivier Berger -# Florent Morel , 2001, 2004 -# -msgid "" -msgstr "" -"Project-Id-Version: glabels 2.0.1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-06-14 15:22+0200\n" -"PO-Revision-Date: 2007-06-14 16:59+0200\n" -"Last-Translator: Claude Paroz \n" -"Language-Team: French \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.11.4\n" - -#: ../src/glabels.c:76 ../src/glabels-batch.c:70 -msgid "[FILE...]" -msgstr "[FICHIER...]" - -#: ../src/glabels.c:92 -msgid "- gLabels label designer" -msgstr "- créateur de patrons gLabels" - -#: ../src/glabels-batch.c:54 -msgid "set output filename (default=\"output.pdf\")" -msgstr "définit le fichier de sortie (défaut=\"output.pdf\")" - -#: ../src/glabels-batch.c:54 ../src/glabels-batch.c:68 -msgid "filename" -msgstr "nom de fichier" - -#: ../src/glabels-batch.c:56 -msgid "number of sheets (default=1)" -msgstr "nombre de pages (défaut=1)" - -# src/print_copies.c:193 -# src/print_copies.c:193 -# src/print_copies.c:171 -# src/print_copies.c:170 -#: ../src/glabels-batch.c:56 -msgid "sheets" -msgstr "feuilles" - -#: ../src/glabels-batch.c:58 -msgid "number of copies (default=1)" -msgstr "nombre de copies (défaut=1)" - -# src/print.c:153 -# src/print.c:153 -# src/print.c:146 -# src/print_dialog.c:104 -#: ../src/glabels-batch.c:58 -msgid "copies" -msgstr "copies" - -#: ../src/glabels-batch.c:60 -msgid "first label on first sheet (default=1)" -msgstr "première étiquette sur la première page (défaut=1)" - -#: ../src/glabels-batch.c:60 -msgid "first" -msgstr "première" - -# src/print.c:180 -# src/print.c:180 -# src/print.c:196 -# src/print_dialog.c:152 -#: ../src/glabels-batch.c:62 ../data/glade/print-custom-widget.glade.h:6 -msgid "print outlines (to test printer alignment)" -msgstr "imprimer des bordures (pour tester l'alignement de l'imprimante)" - -# src/print_dialog.c:160 -#: ../src/glabels-batch.c:64 ../data/glade/print-custom-widget.glade.h:5 -msgid "print in reverse (i.e. a mirror image)" -msgstr "imprimer à l'envers (i.e. une image miroir)" - -#: ../src/glabels-batch.c:66 ../data/glade/print-custom-widget.glade.h:4 -msgid "print crop marks" -msgstr "imprimer les guides de coupe" - -#: ../src/glabels-batch.c:68 -msgid "input file for merging" -msgstr "fichier d'entrée pour la fusion" - -#: ../src/glabels-batch.c:96 -msgid "- batch process gLabels label files" -msgstr "- traitement par lots de fichiers d'étiquettes gLabels" - -# src/file.c:214 -# src/file.c:214 -# src/file.c:249 -# src/file.c:249 -#: ../src/glabels-batch.c:142 -#, c-format -msgid "cannot perform document merge with glabels file %s\n" -msgstr "impossible d'effectuer une fusion de document avec le fichier glabels %s\n" - -# src/file.c:214 -# src/file.c:214 -# src/file.c:249 -# src/file.c:249 -#: ../src/glabels-batch.c:164 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "impossible d'ouvrir le fichier glabels %s\n" - -#: ../src/window.c:259 -msgid "(none) - gLabels" -msgstr "(vide) - gLabels" - -#: ../src/window.c:432 -msgid "(modified)" -msgstr "(modifié)" - -# src/display.c:1157 src/display.c:1205 -# src/display.c:1160 src/display.c:1208 -# src/menu.c:94 -# src/menu.c:94 -#: ../src/stock.c:72 -msgid "_Select Mode" -msgstr "Mode _sélection" - -# src/item_text.c:442 src/item_text.c:627 -# src/item_text.c:442 src/item_text.c:627 -# src/item_text.c:460 src/item_text.c:464 src/item_text.c:637 src/menu.c:100 -# src/item_text.c:460 src/item_text.c:464 src/item_text.c:637 src/menu.c:100 -#: ../src/stock.c:73 -msgid "_Text" -msgstr "_Texte" - -# src/item_line.c:271 -# src/item_line.c:271 -# src/item_line.c:256 src/menu.c:106 -# src/item_line.c:256 src/menu.c:106 -#: ../src/stock.c:74 -msgid "_Line" -msgstr "_Ligne" - -# src/menu.c:103 -# src/menu.c:103 -#: ../src/stock.c:75 -msgid "_Box" -msgstr "_Boîte" - -# src/menu.c:109 -# src/menu.c:109 -#: ../src/stock.c:76 -msgid "_Ellipse" -msgstr "_Ellipse" - -# src/item_image.c:283 -# src/item_image.c:283 -# src/item_image.c:268 src/menu.c:113 -# src/item_image.c:268 src/menu.c:113 -#: ../src/stock.c:77 -msgid "_Image" -msgstr "_Image" - -# src/item_barcode.c:316 -# src/item_barcode.c:317 -# src/menu.c:116 -# src/menu.c:116 -#: ../src/stock.c:78 -msgid "Bar_code" -msgstr "_Code-barre" - -# src/item_text.c:467 -# src/item_text.c:467 -# src/menu.c:132 src/menu.c:223 -# src/menu.c:132 src/menu.c:223 -#: ../src/stock.c:79 -msgid "_Merge Properties" -msgstr "Propriétés de _fusion" - -# src/item_text.c:467 -# src/item_text.c:467 -# src/item_text.c:482 -# src/item_text.c:482 -#: ../src/stock.c:80 -msgid "Object _Properties" -msgstr "_Propriétés de l'objet" - -# src/display.c:1167 src/display.c:1215 -# src/display.c:1170 src/display.c:1218 -# src/display.c:1181 src/display.c:1229 -# src/display.c:1196 src/display.c:1244 -#: ../src/stock.c:81 -msgid "Bring to _Front" -msgstr "_Avancer au premier plan" - -# src/display.c:1173 src/display.c:1221 -# src/display.c:1176 src/display.c:1224 -# src/display.c:1187 src/display.c:1235 -# src/display.c:1202 src/display.c:1250 -#: ../src/stock.c:82 -msgid "Send to _Back" -msgstr "_Reculer à l'arrière-plan" - -# src/rotate_select.c:187 -# src/rotate_select.c:187 -# src/rotate_select.c:167 -# src/rotate_select.c:169 -#: ../src/stock.c:83 -msgid "Rotate _Left" -msgstr "Rotation _gauche" - -# src/rotate_select.c:187 -# src/rotate_select.c:187 -# src/rotate_select.c:167 -# src/rotate_select.c:169 -#: ../src/stock.c:84 -msgid "Rotate _Right" -msgstr "Rotation _droite" - -#: ../src/stock.c:85 -msgid "Flip _Horizontally" -msgstr "Retourner _horizontalement" - -#: ../src/stock.c:86 -msgid "Flip _Vertically" -msgstr "Retourner _verticalement" - -#: ../src/stock.c:87 -msgid "_Lefts" -msgstr "_Gauches" - -#: ../src/stock.c:88 -msgid "_Rights" -msgstr "_Droites" - -#: ../src/stock.c:89 -msgid "_Centers" -msgstr "_Centres" - -# src/menu.c:157 -# src/menu.c:157 -#: ../src/stock.c:90 -msgid "_Tops" -msgstr "En _haut" - -#: ../src/stock.c:91 -msgid "Bottoms" -msgstr "En _bas" - -#: ../src/stock.c:92 -msgid "Centers" -msgstr "_Centré" - -#: ../src/stock.c:93 ../src/stock.c:94 -msgid "Label Ce_nter" -msgstr "Centre de l'étiquette" - -#: ../src/stock.c:95 ../data/glade/property-bar.glade.h:3 -msgid "Fill color" -msgstr "Couleur de remplissage" - -#: ../src/stock.c:96 ../data/glade/property-bar.glade.h:8 -msgid "Line color" -msgstr "Couleur de ligne" - -# src/item_line.c:271 -# src/item_line.c:271 -# src/item_line.c:256 src/menu.c:106 -# src/item_line.c:256 src/menu.c:106 -#: ../src/stock.c:97 ../src/stock.c:99 -msgid "Linked" -msgstr "Lié" - -# src/merge.c:80 -# src/merge.c:78 -#: ../src/stock.c:98 ../src/stock.c:100 -msgid "Not Linked" -msgstr "Non lié" - -# src/item_box.c:274 src/item_ellipse.c:279 -# src/item_box.c:274 src/item_ellipse.c:279 -# src/item_box.c:258 src/item_ellipse.c:260 -# src/item_box.c:258 src/item_ellipse.c:260 -#. Menu entries. -#: ../src/ui.c:93 -msgid "_File" -msgstr "_Fichier" - -#: ../src/ui.c:94 -msgid "Open Recent _Files" -msgstr "_Fichiers récents" - -#: ../src/ui.c:95 -msgid "_Edit" -msgstr "É_dition" - -# src/menu.c:50 -# src/menu.c:50 -# src/menu.c:50 -# src/menu.c:50 -#: ../src/ui.c:96 -msgid "_View" -msgstr "_Affichage" - -#: ../src/ui.c:97 -msgid "Customize Main Toolbar" -msgstr "Personnaliser le barre d'outils principale" - -#: ../src/ui.c:98 -msgid "Customize Drawing Toolbar" -msgstr "Personnaliser la barre d'outils dessin" - -#: ../src/ui.c:99 -msgid "Customize Properties Toolbar" -msgstr "Personnaliser la barre d'outils de propriétés" - -#: ../src/ui.c:100 -msgid "_Objects" -msgstr "_Objets" - -#: ../src/ui.c:101 -msgid "_Create" -msgstr "_Créer" - -#: ../src/ui.c:102 -msgid "_Order" -msgstr "_Ordre" - -# src/rotate_select.c:187 -# src/rotate_select.c:187 -# src/rotate_select.c:167 -# src/rotate_select.c:169 -#: ../src/ui.c:103 -msgid "_Rotate/Flip" -msgstr "_Rotation/Renversement" - -#: ../src/ui.c:104 -msgid "Align _Horizontal" -msgstr "Aligner _horizontalement" - -#: ../src/ui.c:105 -msgid "Align _Vertical" -msgstr "Aligner _verticalement" - -#: ../src/ui.c:106 -msgid "_Help" -msgstr "Aid_e" - -#. Popup entries. -#: ../src/ui.c:109 ../src/ui.c:110 -msgid "Context Menu" -msgstr "Menu contextuel" - -# src/menu.c:50 -# src/menu.c:50 -# src/menu.c:50 -# src/menu.c:50 -#: ../src/ui.c:115 -msgid "_New" -msgstr "_Nouveau" - -# src/tools.c:70 -# src/tools.c:70 -# src/menu.c:106 src/menu.c:197 -# src/menu.c:106 src/menu.c:197 -#: ../src/ui.c:117 -msgid "Create a new file" -msgstr "Crée un nouveau document" - -# src/file.c:178 -# src/file.c:178 -# src/file.c:211 -# src/file.c:211 -#: ../src/ui.c:122 -msgid "_Open..." -msgstr "_Ouvrir..." - -# src/menu.c:140 -# src/menu.c:140 -# src/menu.c:170 -# src/menu.c:170 -#: ../src/ui.c:124 -msgid "Open a file" -msgstr "Ouvre un fichier" - -# src/file.c:271 src/mdi.c:660 -# src/file.c:271 src/mdi.c:666 -# src/file.c:311 src/mdi.c:623 -# src/file.c:311 src/mdi.c:623 -#: ../src/ui.c:129 -msgid "_Save" -msgstr "_Enregistrer" - -# src/menu.c:142 -# src/menu.c:142 -# src/menu.c:172 -# src/menu.c:172 -#: ../src/ui.c:131 -msgid "Save current file" -msgstr "Enregistrer le fichier en cours" - -# src/file.c:271 src/mdi.c:660 -# src/file.c:271 src/mdi.c:666 -# src/file.c:311 src/mdi.c:623 -# src/file.c:311 src/mdi.c:623 -#: ../src/ui.c:136 -msgid "Save _As..." -msgstr "Enregistrer _sous..." - -#: ../src/ui.c:138 -msgid "Save the current file to a different name" -msgstr "Enregistre le fichier en cours avec un nom différent" - -# src/print.c:149 -# src/print.c:149 -# src/print.c:141 -# src/print_dialog.c:99 -#: ../src/ui.c:143 -msgid "_Print..." -msgstr "Im_primer..." - -# src/menu.c:145 -# src/menu.c:145 -# src/menu.c:175 -# src/menu.c:175 -#: ../src/ui.c:145 -msgid "Print the current file" -msgstr "Imprime le fichier en cours" - -# src/item_text.c:467 -# src/item_text.c:467 -# src/item_text.c:482 -# src/item_text.c:482 -#: ../src/ui.c:150 -msgid "Properties..." -msgstr "Propriétés..." - -# src/item_box.c:251 -# src/item_box.c:251 -# src/merge_properties.c:82 -# src/merge_properties.c:82 -#: ../src/ui.c:152 -msgid "Modify document properties" -msgstr "Modifier les propriétés du document" - -#: ../src/ui.c:157 -msgid "Template _Designer..." -msgstr "_Créateur de patrons..." - -# src/tools.c:70 -# src/tools.c:70 -# src/menu.c:106 src/menu.c:197 -# src/menu.c:106 src/menu.c:197 -#: ../src/ui.c:159 -msgid "Create a custom template" -msgstr "Créer un patron personnalisé" - -#: ../src/ui.c:164 -msgid "_Close" -msgstr "_Fermer" - -# src/menu.c:142 -# src/menu.c:142 -# src/menu.c:172 -# src/menu.c:172 -#: ../src/ui.c:166 -msgid "Close the current file" -msgstr "Ferme le fichier en cours" - -#: ../src/ui.c:171 -msgid "_Quit" -msgstr "_Quitter" - -#: ../src/ui.c:173 -msgid "Quit the program" -msgstr "Quitte le programme" - -#: ../src/ui.c:180 -msgid "Cut" -msgstr "Couper" - -#: ../src/ui.c:182 -msgid "Cut the selection" -msgstr "Coupe la sélection" - -#: ../src/ui.c:187 -msgid "Copy" -msgstr "Copier" - -# src/menu.c:86 -# src/menu.c:86 -# src/menu.c:86 -# src/menu.c:86 -#: ../src/ui.c:189 -msgid "Copy the selection" -msgstr "Copie la sélection" - -#: ../src/ui.c:194 -msgid "Paste" -msgstr "Coller" - -#: ../src/ui.c:196 -msgid "Paste the clipboard" -msgstr "Colle le presse-papiers" - -# src/display.c:1157 src/display.c:1205 -# src/display.c:1160 src/display.c:1208 -# src/display.c:1171 src/display.c:1219 -# src/display.c:1186 src/display.c:1234 -#: ../src/ui.c:201 -msgid "Delete" -msgstr "Supprimer" - -# src/tools.c:64 -# src/tools.c:64 -# src/menu.c:100 src/menu.c:191 -# src/menu.c:100 src/menu.c:191 -#: ../src/ui.c:203 -msgid "Delete the selected objects" -msgstr "Supprime les objets sélectionnés" - -# src/menu.c:86 -# src/menu.c:86 -# src/menu.c:85 -# src/menu.c:85 -#: ../src/ui.c:208 -msgid "Select All" -msgstr "Tout sélectionner" - -# src/tools.c:59 -# src/tools.c:59 -# src/menu.c:95 src/menu.c:186 -# src/menu.c:95 src/menu.c:186 -#: ../src/ui.c:210 -msgid "Select all objects" -msgstr "Sélectionne tous les objets" - -# src/menu.c:86 -# src/menu.c:86 -# src/menu.c:85 -# src/menu.c:85 -#: ../src/ui.c:215 -msgid "Un-select All" -msgstr "Désélectionner tout" - -# src/menu.c:86 -# src/menu.c:86 -# src/menu.c:86 -# src/menu.c:86 -#: ../src/ui.c:217 -msgid "Remove all selections" -msgstr "Annule toutes les sélections" - -# src/preferences.c:92 -# src/prefs.c:101 -# src/prefs.c:92 -# src/prefs.c:86 -#: ../src/ui.c:222 -msgid "Preferences" -msgstr "Préférences" - -#: ../src/ui.c:224 -msgid "Configure the application" -msgstr "Configure le logiciel" - -# src/tools.c:84 -# src/tools.c:84 -# src/menu.c:121 src/menu.c:211 -# src/menu.c:121 src/menu.c:211 -#: ../src/ui.c:231 -msgid "Zoom in" -msgstr "Zoom avant" - -#: ../src/ui.c:233 -msgid "Increase magnification" -msgstr "Augmente l'agrandissement" - -# src/tools.c:87 -# src/tools.c:87 -# src/menu.c:124 src/menu.c:214 -# src/menu.c:124 src/menu.c:214 -#: ../src/ui.c:238 -msgid "Zoom out" -msgstr "Zoom arrière" - -#: ../src/ui.c:240 -msgid "Decrease magnification" -msgstr "Réduit l'agrandissement" - -# src/tools.c:90 -# src/tools.c:90 -# src/menu.c:127 -# src/menu.c:127 -#: ../src/ui.c:245 -msgid "Zoom 1 to 1" -msgstr "Zoom 1:1" - -#: ../src/ui.c:247 -msgid "Restore scale to 100%" -msgstr "Remet l'échelle à 100%" - -# src/tools.c:90 -# src/tools.c:90 -# src/menu.c:127 src/menu.c:217 -# src/menu.c:127 src/menu.c:217 -#: ../src/ui.c:252 -msgid "Zoom to fit" -msgstr "Adapter le zoom à la taille de la fenêtre" - -#: ../src/ui.c:254 -msgid "Set scale to fit window" -msgstr "Adapte l'échelle à la taille de la fenêtre" - -# src/display.c:1157 src/display.c:1205 -# src/display.c:1160 src/display.c:1208 -# src/menu.c:94 -# src/menu.c:94 -#: ../src/ui.c:261 -msgid "Select Mode" -msgstr "Mode sélection" - -# src/tools.c:59 -# src/tools.c:59 -# src/menu.c:95 src/menu.c:186 -# src/menu.c:95 src/menu.c:186 -#: ../src/ui.c:263 -msgid "Select, move and modify objects" -msgstr "Sélectionne, déplace et modifie les objets" - -# src/item_text.c:442 src/item_text.c:627 -# src/item_text.c:442 src/item_text.c:627 -# src/item_text.c:460 src/item_text.c:464 src/item_text.c:637 src/menu.c:100 -# src/item_text.c:460 src/item_text.c:464 src/item_text.c:637 src/menu.c:100 -#: ../src/ui.c:268 ../src/view-text.c:525 -#: ../data/glade/object-editor.glade.h:32 -msgid "Text" -msgstr "Texte" - -# src/tools.c:64 -# src/tools.c:64 -# src/menu.c:100 src/menu.c:191 -# src/menu.c:100 src/menu.c:191 -#: ../src/ui.c:270 -msgid "Create text object" -msgstr "Crée un objet texte" - -# src/menu.c:103 -# src/menu.c:103 -#: ../src/ui.c:275 -msgid "Box" -msgstr "Boîte" - -# src/tools.c:67 -# src/tools.c:67 -# src/menu.c:103 src/menu.c:194 -# src/menu.c:103 src/menu.c:194 -#: ../src/ui.c:277 -msgid "Create box/rectangle object" -msgstr "Crée un objet boîte/rectangle" - -# src/item_line.c:271 -# src/item_line.c:271 -# src/item_line.c:256 src/menu.c:106 -# src/item_line.c:256 src/menu.c:106 -#: ../src/ui.c:282 ../data/glade/object-editor.glade.h:20 -msgid "Line" -msgstr "Ligne" - -# src/tools.c:70 -# src/tools.c:70 -# src/menu.c:106 src/menu.c:197 -# src/menu.c:106 src/menu.c:197 -#: ../src/ui.c:284 -msgid "Create line object" -msgstr "Crée un objet ligne" - -# src/menu.c:109 -# src/menu.c:109 -#: ../src/ui.c:289 -msgid "Ellipse" -msgstr "Ellipse" - -# src/tools.c:73 -# src/tools.c:73 -# src/menu.c:110 src/menu.c:200 -# src/menu.c:110 src/menu.c:200 -#: ../src/ui.c:291 -msgid "Create ellipse/circle object" -msgstr "Crée un objet ellipse/cercle" - -# src/item_image.c:283 -# src/item_image.c:283 -# src/item_image.c:268 src/menu.c:113 -# src/item_image.c:268 src/menu.c:113 -#: ../src/ui.c:296 ../data/glade/object-editor.glade.h:16 -msgid "Image" -msgstr "Image" - -# src/tools.c:76 -# src/tools.c:76 -# src/menu.c:113 src/menu.c:203 -# src/menu.c:113 src/menu.c:203 -#: ../src/ui.c:298 -msgid "Create image object" -msgstr "Crée un objet image" - -# src/item_barcode.c:316 -# src/item_barcode.c:317 -# src/menu.c:116 -# src/menu.c:116 -#: ../src/ui.c:303 -msgid "Barcode" -msgstr "Code-barre" - -# src/tools.c:79 -# src/tools.c:79 -# src/menu.c:116 src/menu.c:206 -# src/menu.c:116 src/menu.c:206 -#: ../src/ui.c:305 -msgid "Create barcode object" -msgstr "Crée un objet code-barre" - -# src/display.c:1167 src/display.c:1215 -# src/display.c:1170 src/display.c:1218 -# src/display.c:1181 src/display.c:1229 -# src/display.c:1196 src/display.c:1244 -#: ../src/ui.c:310 -msgid "Bring to front" -msgstr "Avancer au premier plan" - -#: ../src/ui.c:312 -msgid "Raise object to top" -msgstr "Remonte l'objet au plus haut niveau" - -# src/display.c:1173 src/display.c:1221 -# src/display.c:1176 src/display.c:1224 -# src/display.c:1187 src/display.c:1235 -# src/display.c:1202 src/display.c:1250 -#: ../src/ui.c:317 -msgid "Send to back" -msgstr "Reculer à l'arrière-plan" - -#: ../src/ui.c:319 -msgid "Lower object to bottom" -msgstr "Descend l'objet à l'arrière-plan" - -# src/rotate_select.c:187 -# src/rotate_select.c:187 -# src/rotate_select.c:167 -# src/rotate_select.c:169 -#: ../src/ui.c:324 -msgid "Rotate left" -msgstr "Rotation gauche" - -#: ../src/ui.c:326 -msgid "Rotate object 90 degrees counter-clockwise" -msgstr "Tourne l'objet de 90 degrés dans le sens inverse des aiguilles d'une montre" - -# src/rotate_select.c:187 -# src/rotate_select.c:187 -# src/rotate_select.c:167 -# src/rotate_select.c:169 -#: ../src/ui.c:331 -msgid "Rotate right" -msgstr "Rotation droite" - -#: ../src/ui.c:333 -msgid "Rotate object 90 degrees clockwise" -msgstr "Tourne l'objet de 90 degrés dans le sens des aiguilles d'une montre" - -#: ../src/ui.c:338 -msgid "Flip horizontally" -msgstr "Retourner horizontalement" - -#: ../src/ui.c:340 -msgid "Flip object horizontally" -msgstr "Retourne l'objet horizontalement" - -#: ../src/ui.c:345 -msgid "Flip vertically" -msgstr "Retourner verticalement" - -#: ../src/ui.c:347 -msgid "Flip object vertically" -msgstr "Retourne l'objet verticalement" - -# src/prop_text.c:277 -# src/prop_text.c:264 -# src/prop_text.c:248 -# src/prop_text.c:248 -#: ../src/ui.c:352 -msgid "Align left" -msgstr "Aligner à gauche" - -#: ../src/ui.c:354 -msgid "Align objects to left edges" -msgstr "Aligne les objets sur leur bordure gauche" - -#: ../src/ui.c:359 -msgid "Align right" -msgstr "Aligner à droite" - -#: ../src/ui.c:361 -msgid "Align objects to right edges" -msgstr "Aligne les objets sur leur bordure droite" - -#: ../src/ui.c:366 -msgid "Align horizontal center" -msgstr "Aligner centré horizontalement" - -#: ../src/ui.c:368 -msgid "Align objects to horizontal centers" -msgstr "Aligne horizontalement le centre des objets" - -#: ../src/ui.c:373 -msgid "Align tops" -msgstr "Aligner au sommet" - -#: ../src/ui.c:375 -msgid "Align objects to top edges" -msgstr "Aligne les objets d'après leur sommet" - -#: ../src/ui.c:380 -msgid "Align bottoms" -msgstr "Aligner à la base" - -#: ../src/ui.c:382 -msgid "Align objects to bottom edges" -msgstr "Aligne les objets d'après leur base" - -#: ../src/ui.c:387 -msgid "Align vertical center" -msgstr "Aligner centré verticalement" - -#: ../src/ui.c:389 -msgid "Align objects to vertical centers" -msgstr "Aligne verticalement le centre des objets" - -#: ../src/ui.c:394 -msgid "Center horizontally" -msgstr "Centrer horizontalement" - -#: ../src/ui.c:396 -msgid "Center objects to horizontal label center" -msgstr "Aligne les objets horizontalement au centre de l'étiquette" - -#: ../src/ui.c:401 -msgid "Center vertically" -msgstr "Centrer verticalement" - -#: ../src/ui.c:403 -msgid "Center objects to vertical label center" -msgstr "Aligne les objets verticalement au centre de l'étiquette" - -# src/item_text.c:467 -# src/item_text.c:467 -# src/menu.c:132 src/menu.c:223 -# src/menu.c:132 src/menu.c:223 -#: ../src/ui.c:408 -msgid "Merge properties" -msgstr "Propriétés de fusion" - -# src/item_image.c:272 -# src/item_image.c:272 -# src/menu.c:133 -# src/menu.c:133 -#: ../src/ui.c:410 -msgid "Edit merge properties" -msgstr "Édite les propriétés de fusion" - -#: ../src/ui.c:417 -msgid "Contents" -msgstr "Sommaire" - -# src/file.c:183 -# src/file.c:183 -# src/file.c:213 -# src/file.c:213 -#: ../src/ui.c:419 -msgid "Open glabels manual" -msgstr "Ouvre le manuel de glabels" - -#: ../src/ui.c:424 -msgid "About..." -msgstr "À propos..." - -#: ../src/ui.c:426 -msgid "About glabels" -msgstr "À propos de glabels" - -#: ../src/ui.c:436 -msgid "Property toolbar" -msgstr "Barre d'outils de propriétés" - -#: ../src/ui.c:438 -msgid "Change the visibility of the property toolbar in the current window" -msgstr "Afficher ou non la barre d'outils de propriétés dans la fenêtre actuelle" - -#: ../src/ui.c:444 ../src/ui.c:489 ../src/ui.c:497 -msgid "Show tooltips" -msgstr "Afficher les infos-bulles" - -#: ../src/ui.c:446 -msgid "Show tooltips for property toolbar" -msgstr "Afficher les info-bulles dans la barre d'outils de propriétés" - -#: ../src/ui.c:452 -msgid "Grid" -msgstr "Grille" - -#: ../src/ui.c:454 -msgid "Change the visibility of the grid in the current window" -msgstr "Afficher ou non la grille dans la fenêtre actuelle" - -# src/preferences.c:213 -#: ../src/ui.c:460 -msgid "Markup" -msgstr "Marges" - -#: ../src/ui.c:462 -msgid "Change the visibility of markup lines in the current window" -msgstr "Afficher ou non les lignes de marges dans la fenêtre actuelle" - -#: ../src/ui.c:473 -msgid "Main toolbar" -msgstr "Barre d'outils principale" - -#: ../src/ui.c:475 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "Afficher ou non la barre d'outils principale dans la fenêtre actuelle" - -#: ../src/ui.c:481 -msgid "Drawing toolbar" -msgstr "Barre d'outils dessin" - -#: ../src/ui.c:483 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "Afficher ou non la barre d'outils dessin dans la fenêtre actuelle" - -#: ../src/ui.c:491 -msgid "Show tooltips for main toolbar" -msgstr "Afficher les info-bulles dans la barre d'outils principale" - -#: ../src/ui.c:499 -msgid "Show tooltips for drawing toolbar" -msgstr "Afficher les info-bulles dans la barre d'outils de dessin" - -# src/display.c:1157 src/display.c:1205 -# src/display.c:1160 src/display.c:1208 -# src/display.c:1171 src/display.c:1219 -# src/display.c:1186 src/display.c:1234 -#: ../src/ui-property-bar.c:1235 ../src/object-editor.c:571 -#: ../src/object-editor.c:577 -msgid "Default" -msgstr "Par défaut" - -# src/merge.c:80 -# src/merge.c:78 -#: ../src/ui-property-bar.c:1242 ../src/object-editor.c:583 -msgid "No line" -msgstr "Pas de ligne" - -#: ../src/ui-property-bar.c:1250 ../src/object-editor.c:590 -msgid "No fill" -msgstr "Pas de remplissage" - -# src/item_text.c:467 -# src/item_text.c:467 -# src/item_text.c:482 -# src/item_text.c:482 -#: ../src/ui-sidebar.c:152 -msgid "Object properties" -msgstr "Propriétés de l'objet" - -#: ../src/ui-commands.c:1084 -msgid "Glabels includes contributions from:" -msgstr "Glabels contient des contributions de :" - -#: ../src/ui-commands.c:1090 -msgid "See the file AUTHORS for additional credits," -msgstr "Voir le fichier AUTHORS pour des remerciements supplémentaires," - -#: ../src/ui-commands.c:1091 -msgid "or visit http://glabels.sourceforge.net/" -msgstr "ou visitez http://glabels.sourceforge.net/" - -#: ../src/ui-commands.c:1103 -msgid "A label and business card creation program.\n" -msgstr "Un logiciel de création de cartes de visite et d'étiquettes.\n" - -#: ../src/ui-commands.c:1107 -msgid "translator-credits" -msgstr "" -"Olivier Berger \n" -"Florent Morel , 2001, 2004\n" -"Claude Paroz , 2007" - -# src/menu.c:185 -# src/menu.c:185 -# src/menu.c:290 -# src/menu.c:290 -#: ../src/ui-commands.c:1110 -msgid "" -"Glabels is free software; you can redistribute it and/or modify it\n" -"under the terms of the GNU General Public License as published by\n" -"the Free Software Foundation; either version 2 of the License, or\n" -"(at your option) any later version.\n" -"\n" -"This program is distributed in the hope that it will be useful, but\n" -"WITHOUT ANY WARRANTY; without even the implied warranty of\n" -"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See\n" -"the GNU General Public License for more details.\n" -msgstr "" -"Glabels est un logiciel libre ; vous pouvez le redistribuer et/ou le " -"modifier conformément aux dispositions de la Licence Publique Générale GNU, " -"telle que publiée par la Free Software Foundation ; version 2 de la licence, " -"ou encore (à votre choix) toute version ultérieure.\n" -" \n" -"Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE " -"GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou " -"D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de détails, voir la Licence " -"Publique Générale GNU.\n" - -# src/print_copies.c:210 -# src/print_copies.c:210 -# src/print_copies.c:188 -# src/print_copies.c:187 -#: ../src/ui-commands.c:1136 -msgid "glabels" -msgstr "glabels" - -# src/file.c:59 -# src/file.c:59 -# src/file.c:72 -# src/file.c:72 -#: ../src/file.c:90 -msgid "New Label or Card" -msgstr "Nouvelle étiquette ou carte" - -# src/item_text.c:467 -# src/item_text.c:467 -# src/item_text.c:482 -# src/item_text.c:482 -#: ../src/file.c:189 -msgid "Label properties" -msgstr "Propriétés de l'étiquette" - -#: ../src/file.c:288 ../src/file.c:574 -msgid "All files" -msgstr "Tous les fichiers" - -# src/preferences.c:92 -# src/prefs.c:101 -# src/prefs.c:92 -# src/prefs.c:86 -#: ../src/file.c:293 ../src/file.c:579 -msgid "gLabels documents" -msgstr "Documents gLabels" - -# src/menu.c:86 -# src/menu.c:86 -# src/menu.c:86 -# src/menu.c:86 -#: ../src/file.c:339 ../src/file.c:636 -msgid "Empty file name selection" -msgstr "Nom de fichier sélectionné vide" - -#: ../src/file.c:342 ../src/file.c:358 -msgid "Please select a file or supply a valid file name" -msgstr "Sélectionnez un fichier ou donnez un nom de fichier valide" - -#: ../src/file.c:355 -msgid "File does not exist" -msgstr "Ce fichier n'existe pas" - -# src/file.c:214 -# src/file.c:214 -# src/file.c:249 -# src/file.c:249 -# c-format -#: ../src/file.c:429 -#, c-format -msgid "Could not open file \"%s\"" -msgstr "Impossible d'ouvrir le fichier « %s »" - -#: ../src/file.c:432 -msgid "Not a supported file format" -msgstr "Format de fichier non pris en charge" - -# src/file.c:248 src/mdi.c:635 -# src/file.c:248 src/mdi.c:641 -# src/file.c:288 src/mdi.c:601 -# src/file.c:288 src/mdi.c:601 -#: ../src/file.c:509 ../src/file.c:686 -#, c-format -msgid "Could not save file \"%s\"" -msgstr "Impossible d'enregistrer « %s »" - -#: ../src/file.c:513 ../src/file.c:690 -msgid "Error encountered during save. The file is still not saved." -msgstr "" -"Erreur rencontrée durant l'enregistrement. Le fichier n'est toujours pas " -"enregistré. " - -# src/file.c:278 -# src/file.c:278 -# src/file.c:316 -# src/file.c:316 -#: ../src/file.c:552 -#, c-format -msgid "Save \"%s\" as" -msgstr "Enregistrer « %s » sous" - -# src/file.c:319 src/mdi.c:729 -# src/file.c:319 src/mdi.c:735 -# src/file.c:362 src/mdi.c:693 -# src/file.c:362 src/mdi.c:693 -#: ../src/file.c:639 -msgid "Please supply a valid file name" -msgstr "Donnez un nom de fichier valide" - -#: ../src/file.c:660 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "Écraser le fichier « %s » ?" - -#: ../src/file.c:664 -msgid "File already exists." -msgstr "Ce fichier existe déjà." - -#: ../src/file.c:760 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "Enregistrer les changements du document « %s » avant de fermer ?" - -#: ../src/file.c:764 -msgid "Your changes will be lost if you don't save them." -msgstr "Vos changements seront perdus si vous ne les enregistrez pas." - -#: ../src/file.c:767 -msgid "Close without saving" -msgstr "Fermer sans enregistrer" - -# src/print.c:171 -# src/prefs.c:463 src/prefs.c:470 src/prop_line.c:202 -# src/prefs.c:445 src/prefs.c:452 src/prop_line.c:183 -# src/prefs.c:448 src/prefs.c:455 src/prop_line.c:183 -#. Should not happen -#: ../src/prefs.c:158 ../src/prefs.c:165 -#: ../data/glade/object-editor.glade.h:43 -#: ../data/glade/prefs-dialog.glade.h:22 -msgid "points" -msgstr "points" - -# src/item_line.c:271 -# src/prefs.c:465 -# src/prefs.c:447 -# src/prefs.c:450 -#: ../src/prefs.c:160 ../data/glade/object-editor.glade.h:42 -#: ../data/glade/template-designer.glade.h:65 -msgid "inches" -msgstr "pouces" - -# src/prefs.c:467 -# src/prefs.c:449 -# src/prefs.c:452 -#: ../src/prefs.c:162 -msgid "mm" -msgstr "mm" - -# src/preferences.c:92 -# src/prefs.c:101 -# src/prefs.c:92 -# src/prefs.c:86 -#: ../src/prefs-dialog.c:162 ../data/glade/prefs-dialog.glade.h:21 -msgid "gLabels Preferences" -msgstr "Préférences de gLabels" - -# src/item_box.c:251 -# src/item_box.c:251 -# src/item_box.c:235 -# src/item_box.c:235 -#. Build editor. -#: ../src/view-box.c:178 -msgid "Box object properties" -msgstr "Propriétés de l'objet boîte" - -# src/item_ellipse.c:256 -# src/item_ellipse.c:256 -# src/item_ellipse.c:237 -# src/item_ellipse.c:237 -#. Build editor. -#: ../src/view-ellipse.c:178 -msgid "Ellipse object properties" -msgstr "Propriétés de l'objet ellipse" - -# src/item_box.c:251 -# src/item_box.c:251 -# src/item_box.c:235 -# src/item_box.c:235 -#. Build editor. -#: ../src/view-line.c:177 -msgid "Line object properties" -msgstr "Propriétés de l'objet ligne" - -# src/item_image.c:272 -# src/item_image.c:272 -# src/item_image.c:257 -# src/item_image.c:257 -#. Build editor. -#: ../src/view-image.c:177 -msgid "Image object properties" -msgstr "Propriétés de l'objet image" - -# src/item_box.c:251 -# src/item_box.c:251 -# src/item_box.c:235 -# src/item_box.c:235 -#. Build editor. -#: ../src/view-text.c:181 -msgid "Text object properties" -msgstr "Propriétés de l'objet texte" - -# src/item_barcode.c:299 -# src/item_barcode.c:299 -# src/item_barcode.c:287 -# src/item_barcode.c:287 -#. Build editor. -#: ../src/view-barcode.c:177 -msgid "Barcode object properties" -msgstr "Propriétés de l'objet code-barre" - -#: ../src/object-editor-image-page.c:270 -msgid "All Files" -msgstr "Tous les fichiers" - -# src/item_image.c:283 -# src/item_image.c:283 -# src/item_image.c:268 src/menu.c:113 -# src/item_image.c:268 src/menu.c:113 -#: ../src/object-editor-image-page.c:275 -msgid "All Images" -msgstr "Toutes les images" - -#: ../src/object-editor-image-page.c:290 -#, c-format -msgid "%s (*.%s)" -msgstr "%s (*.%s)" - -# src/item_text.c:467 -# src/item_text.c:467 -# src/menu.c:132 src/menu.c:223 -# src/menu.c:132 src/menu.c:223 -#: ../src/merge-properties-dialog.c:263 -msgid "Merge Properties" -msgstr "Propriétés de fusion" - -# src/merge_ui_text.c:170 -# src/merge_ui_text.c:170 -#: ../src/merge-properties-dialog.c:289 ../src/merge-properties-dialog.c:397 -msgid "Select merge-database source" -msgstr "Sélection du fichier de données pour la fusion" - -# src/merge_ui.c:207 src/merge_ui.c:242 src/merge_ui.c:387 src/merge_ui.c:428 -# src/merge_ui.c:207 src/merge_ui.c:242 src/merge_ui.c:387 src/merge_ui.c:428 -#: ../src/merge-properties-dialog.c:298 ../src/merge-properties-dialog.c:417 -msgid "N/A" -msgstr "Non défini" - -# src/display.c:1157 src/display.c:1205 -# src/display.c:1160 src/display.c:1208 -# src/menu.c:94 -# src/menu.c:94 -#: ../src/merge-properties-dialog.c:324 -msgid "Select" -msgstr "Sélectionner" - -#: ../src/merge-properties-dialog.c:332 -msgid "Record/Field" -msgstr "Enregistrements/Champs" - -# src/item_barcode.c:309 -# src/item_barcode.c:308 -# src/item_barcode.c:297 -# src/item_barcode.c:297 -#: ../src/merge-properties-dialog.c:340 ../data/glade/object-editor.glade.h:10 -msgid "Data" -msgstr "Données" - -# src/item_box.c:274 src/item_ellipse.c:279 -# src/item_box.c:274 src/item_ellipse.c:279 -# src/merge_properties.c:168 -# src/merge_properties.c:168 -#: ../src/merge-properties-dialog.c:410 -msgid "Fixed" -msgstr "" - -# src/print_copies.c:210 -# src/print_copies.c:210 -# src/print_copies.c:188 -# src/print_copies.c:187 -#: ../src/print-op.c:231 ../src/wdgt-print-copies.c:171 -msgid "Labels" -msgstr "Étiquettes" - -#: ../src/template-designer.c:357 -msgid "gLabels Template Designer" -msgstr "Créateur de patrons gLabels" - -#: ../src/template-designer.c:418 -msgid "Welcome" -msgstr "Bienvenue" - -# src/media_select.c:216 -# src/media_select.c:242 -# src/media_select.c:222 -# src/media_select.c:222 -#: ../src/template-designer.c:460 -msgid "Name and Description" -msgstr "Nom et description" - -# src/media_select.c:221 -# src/media_select.c:247 -# src/media_select.c:227 -# src/media_select.c:227 -#: ../src/template-designer.c:513 -msgid "Page Size" -msgstr "Taille de page" - -# src/file.c:59 -# src/file.c:59 -# src/file.c:72 -# src/file.c:72 -#: ../src/template-designer.c:584 -msgid "Label or Card Shape" -msgstr "Forme de carte ou d'étiquette" - -# src/file.c:59 -# src/file.c:59 -# src/file.c:72 -# src/file.c:72 -#: ../src/template-designer.c:634 -msgid "Label or Card Size" -msgstr "Taille de carte ou d'étiquette" - -# src/media_select.c:226 -# src/media_select.c:252 -# src/media_select.c:232 -# src/media_select.c:232 -#: ../src/template-designer.c:734 -msgid "Label Size (round)" -msgstr "Taille d'étiquette (ronde)" - -#: ../src/template-designer.c:817 -msgid "Label Size (CD/DVD)" -msgstr "Taille d'étiquette (CD/DVD)" - -#: ../src/template-designer.c:910 -msgid "Number of Layouts" -msgstr "Nombre de dispositions" - -# src/media_select.c:231 -# src/media_select.c:257 -# src/media_select.c:237 -# src/media_select.c:237 -#: ../src/template-designer.c:973 -msgid "Layout(s)" -msgstr "Disposition(s) :" - -#: ../src/template-designer.c:1084 -msgid "Design Completed" -msgstr "Création terminée" - -#: ../src/bc.c:67 -msgid "POSTNET (any)" -msgstr "POSTNET (tous)" - -#: ../src/bc.c:70 -msgid "POSTNET-5 (ZIP only)" -msgstr "POSTNET-5 (seulement ZIP)" - -#: ../src/bc.c:73 -msgid "POSTNET-9 (ZIP+4)" -msgstr "POSTNET-9 (ZIP+4)" - -#: ../src/bc.c:76 -msgid "POSTNET-11 (DPBC)" -msgstr "POSTNET-11 (DPBC)" - -#: ../src/bc.c:79 -msgid "EAN (any)" -msgstr "EAN (tous)" - -#: ../src/bc.c:82 -msgid "EAN-8" -msgstr "EAN-8" - -#: ../src/bc.c:85 -msgid "EAN-8 +2" -msgstr "EAN-8 +2" - -#: ../src/bc.c:88 -msgid "EAN-8 +5" -msgstr "EAN-8 +5" - -#: ../src/bc.c:91 -msgid "EAN-13" -msgstr "EAN-13" - -#: ../src/bc.c:94 -msgid "EAN-13 +2" -msgstr "EAN-13 +2" - -#: ../src/bc.c:97 -msgid "EAN-13 +5" -msgstr "EAN-13 +5" - -#: ../src/bc.c:100 -msgid "UPC (UPC-A or UPC-E)" -msgstr "UPC (UPC-A ou UPC-E)" - -#: ../src/bc.c:103 -msgid "UPC-A" -msgstr "UPC-A" - -#: ../src/bc.c:106 -msgid "UPC-A +2" -msgstr "UPC-A +2" - -#: ../src/bc.c:109 -msgid "UPC-A +5" -msgstr "UPC-A +5" - -#: ../src/bc.c:112 -msgid "UPC-E" -msgstr "UPC-E" - -#: ../src/bc.c:115 -msgid "UPC-E +2" -msgstr "UPC-E +2" - -#: ../src/bc.c:118 -msgid "UPC-E +5" -msgstr "UPC-E +5" - -#: ../src/bc.c:121 -msgid "ISBN" -msgstr "ISBN" - -#: ../src/bc.c:124 -msgid "ISBN +5" -msgstr "ISBN +5" - -#: ../src/bc.c:127 -msgid "Code 39" -msgstr "Code 39" - -#: ../src/bc.c:130 -msgid "Code 128" -msgstr "Code 128" - -#: ../src/bc.c:133 -msgid "Code 128C" -msgstr "Code 128C" - -#: ../src/bc.c:136 -msgid "Code 128B" -msgstr "Code 128B" - -#: ../src/bc.c:139 -msgid "Interleaved 2 of 5" -msgstr "Entrelacé 2 de 5" - -#: ../src/bc.c:142 -msgid "Codabar" -msgstr "Code-barre" - -#: ../src/bc.c:145 -msgid "MSI" -msgstr "MSI" - -#: ../src/bc.c:148 -msgid "Plessey" -msgstr "Plessey" - -#: ../src/bc.c:151 -msgid "IEC16022 (DataMatrix)" -msgstr "IEC16022 (DataMatrix)" - -#: ../src/label.c:513 -msgid "Untitled" -msgstr "Sans titre" - -# src/item_barcode.c:316 -# src/item_barcode.c:317 -# src/item_barcode.c:299 -# src/item_barcode.c:299 -#: ../src/label-barcode.c:415 -msgid "Barcode data empty" -msgstr "Données de code-barre vides" - -# src/item_barcode.c:564 src/item_barcode.c:588 src/print.c:641 -# src/item_barcode.c:570 src/item_barcode.c:594 src/print.c:641 -# src/item_barcode.c:549 src/item_barcode.c:572 src/print.c:799 -# src/item_barcode.c:549 src/item_barcode.c:572 src/print.c:600 -#: ../src/label-barcode.c:419 -msgid "Invalid barcode data" -msgstr "Données de code-barre invalides" - -# src/label.c:186 src/label.c:211 -# src/label.c:186 src/label.c:211 -# src/label.c:170 src/label.c:194 -# src/label.c:168 src/label.c:192 -#: ../src/xml-label.c:188 ../src/xml-label.c:225 -msgid "xmlParseFile error" -msgstr "erreur xmlParseFile" - -# src/label.c:243 -# src/label.c:244 -# src/label.c:225 -# src/label.c:223 -#: ../src/xml-label.c:262 -msgid "No document root" -msgstr "Pas de racine de document" - -#: ../src/xml-label.c:276 -msgid "Importing from glabels 0.1 format" -msgstr "Import depuis le format glabels 0.1" - -#: ../src/xml-label.c:284 -msgid "Importing from glabels 0.4 format" -msgstr "Import depuis le format glabels 0.4" - -# src/label.c:248 -# src/label.c:249 -# src/label.c:236 -# src/label.c:234 -#: ../src/xml-label.c:287 -msgid "bad document, unknown glabels Namespace" -msgstr "document de type erroné, espace de noms glabels inconnu" - -# src/label.c:253 -# src/label.c:254 -# src/label.c:241 -# src/label.c:239 -#: ../src/xml-label.c:315 ../src/xml-label-04.c:78 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "Mauvais noeud racine = \"%s\"" - -# src/label.c:253 -# src/label.c:254 -# src/label.c:241 -# src/label.c:239 -#: ../src/xml-label.c:352 -#, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "Mauvais noeud racine = \"%s\"" - -# src/label.c:298 -# src/label.c:301 -# src/label.c:294 -# src/label.c:290 -#: ../src/xml-label.c:397 ../src/xml-label-04.c:126 -#, c-format -msgid "bad node = \"%s\"" -msgstr "mauvais noeud = \"%s\"" - -# src/label.c:298 -# src/label.c:301 -# src/label.c:294 -# src/label.c:290 -#: ../src/xml-label.c:836 -#, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "mauvais noeud de données = \"%s\"" - -#: ../src/xml-label.c:1073 ../libglabels/xml-template.c:585 -msgid "Utf8 conversion error." -msgstr "Erreur de conversion Utf8" - -# src/label.c:487 -# src/label.c:493 -# src/label.c:589 -# src/label.c:587 -#: ../src/xml-label.c:1080 ../libglabels/xml-template.c:592 -msgid "Problem saving xml file." -msgstr "Problème de sauvegarde du fichier xml." - -# src/merge.c:80 -# src/merge.c:78 -#: ../src/merge.c:170 ../src/merge.c:211 ../src/merge.c:375 ../src/merge.c:378 -msgid "None" -msgstr "Aucun" - -# src/merge.c:98 -# src/merge.c:94 -#: ../src/merge-init.c:59 -msgid "Text file with comma delimeters (CSV)" -msgstr "Texte séparé par des virgules (CSV)" - -# src/merge.c:107 -# src/merge.c:102 -#: ../src/merge-init.c:66 -msgid "Text file with colon delimeters" -msgstr "Texte séparé par des deux-points" - -# src/merge.c:89 -# src/merge.c:86 -#: ../src/merge-init.c:73 -msgid "Text file with tab delimeters" -msgstr "Texte avec séparateurs de tabulation" - -#: ../src/merge-init.c:82 -msgid "Data from default Evolution Addressbook" -msgstr "Données du carnet d'adresses Evolution par défaut" - -#: ../src/merge-init.c:88 -msgid "Data from a file containing VCards" -msgstr "Données d'un fichier de VCards" - -#: ../src/merge-evolution.c:278 -msgid "Couldn't construct query" -msgstr "Impossible de construire la requête" - -# src/file.c:214 -# src/file.c:214 -# src/file.c:249 -# src/file.c:249 -# c-format -#: ../src/merge-evolution.c:284 ../src/merge-evolution.c:291 -#, c-format -msgid "Couldn't open addressbook: %s" -msgstr "Impossible d'ouvrir le carnet d'adresses : %s" - -# src/file.c:248 src/mdi.c:635 -# src/file.c:248 src/mdi.c:641 -# src/file.c:288 src/mdi.c:601 -# src/file.c:288 src/mdi.c:601 -#: ../src/merge-evolution.c:303 -#, c-format -msgid "Couldn't list available fields: %s" -msgstr "Impossible d'énumérer les champs disponibles : %s" - -#: ../src/merge-evolution.c:335 -#, c-format -msgid "Couldn't get contacts: %s" -msgstr "Impossible d'obtenir les contacts : %s" - -# src/print_copies.c:193 -# src/print_copies.c:193 -# src/print_copies.c:171 -# src/print_copies.c:170 -#: ../src/wdgt-print-copies.c:153 -msgid "Sheets:" -msgstr "Feuilles :" - -# src/print_copies.c:213 -# src/print_copies.c:213 -# src/print_copies.c:191 -# src/print_copies.c:190 -#: ../src/wdgt-print-copies.c:173 -msgid "from:" -msgstr "de :" - -# src/print_copies.c:221 -# src/print_copies.c:221 -# src/print_copies.c:199 -# src/print_copies.c:198 -#: ../src/wdgt-print-copies.c:179 -msgid "to:" -msgstr "à :" - -# src/print_copies_merge.c:197 -# src/print_merge.c:170 -#: ../src/wdgt-print-merge.c:154 -msgid "Start on label" -msgstr "Commencer par l'étiquette" - -# src/print_copies_merge.c:206 -# src/print_merge.c:179 -#: ../src/wdgt-print-merge.c:162 -msgid "on 1st sheet" -msgstr "en 1ère page" - -# src/print.c:153 -# src/print.c:153 -# src/print_copies_merge.c:173 -# src/print_merge.c:195 -#: ../src/wdgt-print-merge.c:171 -msgid "Copies:" -msgstr "Copies :" - -# src/rotate_select.c:187 -# src/rotate_select.c:187 -# src/print_copies_merge.c:186 -# src/print_merge.c:188 -#: ../src/wdgt-print-merge.c:177 -msgid "Collate" -msgstr "Assembler" - -#: ../src/wdgt-media-select.c:229 ../src/wdgt-media-select.c:238 -#: ../src/wdgt-media-select.c:241 ../src/wdgt-media-select.c:465 -#: ../src/wdgt-media-select.c:474 -msgid "Any" -msgstr "Tous" - -# src/media_select.c:515 -# src/media_select.c:481 -# src/media_select.c:353 -#: ../src/wdgt-media-select.c:499 -#, c-format -msgid "%d per sheet" -msgstr "%d par feuille" - -# src/media_select.c:522 -# src/media_select.c:488 -# src/media_select.c:367 -#: ../src/wdgt-media-select.c:529 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -# src/media_select.c:522 -# src/media_select.c:488 -# src/media_select.c:372 -#: ../src/wdgt-media-select.c:534 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: ../src/wdgt-media-select.c:545 ../src/wdgt-media-select.c:559 -#, c-format -msgid "%s %s diameter" -msgstr "%s %s diamètre" - -#: ../src/wdgt-media-select.c:549 ../src/wdgt-media-select.c:563 -#, c-format -msgid "%.5g %s diameter" -msgstr "%.5g %s diamètre" - -#: ../src/wdgt-media-select.c:638 -msgid "No match." -msgstr "Aucune correspondance." - -#: ../src/wdgt-media-select.c:639 -msgid "Try selecting a different page size or category." -msgstr "Essayez de sélectionner une taille ou une catégorie de page différente." - -# src/merge_ui_text.c:334 -# src/merge_ui_text.c:334 -#. This is the default custom color -#: ../src/mygal/color-palette.c:389 -msgid "custom" -msgstr "personnalisé" - -# src/prop_bc.c:204 src/prop_fill.c:186 src/prop_line.c:203 -# src/prop_text.c:263 -# src/prop_bc.c:210 src/prop_fill.c:184 src/prop_line.c:209 -# src/prop_text.c:247 -# src/prop_bc.c:188 src/prop_fill.c:166 src/prop_line.c:189 -# src/prop_text.c:234 -# src/prop_bc.c:188 src/prop_fill.c:166 src/prop_line.c:189 -# src/prop_text.c:234 -#. "Custom" color - we'll pop up a GtkColorButton -#: ../src/mygal/color-palette.c:431 -msgid "Custom Color:" -msgstr "Couleur personnalisée :" - -#: ../src/mygal/color-palette.c:439 -msgid "Choose Custom Color" -msgstr "Choisir une couleur personnalisée" - -#: ../src/mygal/color-palette.c:572 -msgid "black" -msgstr "noir" - -#: ../src/mygal/color-palette.c:573 -msgid "light brown" -msgstr "brun clair" - -#: ../src/mygal/color-palette.c:574 -msgid "brown gold" -msgstr "brun jaune" - -#: ../src/mygal/color-palette.c:575 -msgid "dark green #2" -msgstr "vert foncé n°2" - -#: ../src/mygal/color-palette.c:576 -msgid "navy" -msgstr "bleu marine" - -#: ../src/mygal/color-palette.c:577 ../src/mygal/color-palette.c:633 -msgid "dark blue" -msgstr "bleu foncé" - -#: ../src/mygal/color-palette.c:578 -msgid "purple #2" -msgstr "violet n°2" - -#: ../src/mygal/color-palette.c:579 -msgid "very dark gray" -msgstr "gris très foncé" - -#: ../src/mygal/color-palette.c:582 ../src/mygal/color-palette.c:638 -msgid "dark red" -msgstr "rouge foncé" - -#: ../src/mygal/color-palette.c:583 -msgid "red-orange" -msgstr "rouge orange" - -#: ../src/mygal/color-palette.c:584 -msgid "gold" -msgstr "jaune" - -#: ../src/mygal/color-palette.c:585 -msgid "dark green" -msgstr "vert foncé" - -#: ../src/mygal/color-palette.c:586 ../src/mygal/color-palette.c:639 -msgid "dull blue" -msgstr "bleu pâle" - -#: ../src/mygal/color-palette.c:587 ../src/mygal/color-palette.c:640 -msgid "blue" -msgstr "bleu" - -#: ../src/mygal/color-palette.c:588 -msgid "dull purple" -msgstr "violet pâle" - -#: ../src/mygal/color-palette.c:589 -msgid "dark grey" -msgstr "gris foncé" - -#: ../src/mygal/color-palette.c:592 -msgid "red" -msgstr "rouge" - -#: ../src/mygal/color-palette.c:593 -msgid "orange" -msgstr "orange" - -#: ../src/mygal/color-palette.c:594 -msgid "lime" -msgstr "tilleul" - -#: ../src/mygal/color-palette.c:595 -msgid "dull green" -msgstr "vert pâle" - -#: ../src/mygal/color-palette.c:596 -msgid "dull blue #2" -msgstr "bleu pâle n°2" - -#: ../src/mygal/color-palette.c:597 -msgid "sky blue #2" -msgstr "bleu ciel n°2" - -#: ../src/mygal/color-palette.c:598 ../src/mygal/color-palette.c:637 -msgid "purple" -msgstr "violet" - -#: ../src/mygal/color-palette.c:599 -msgid "gray" -msgstr "gris" - -# src/item_image.c:283 -# src/item_image.c:283 -# src/item_image.c:268 src/menu.c:113 -# src/item_image.c:268 src/menu.c:113 -#: ../src/mygal/color-palette.c:602 ../src/mygal/color-palette.c:634 -msgid "magenta" -msgstr "magenta" - -#: ../src/mygal/color-palette.c:603 -msgid "bright orange" -msgstr "orange vif" - -#: ../src/mygal/color-palette.c:604 ../src/mygal/color-palette.c:635 -msgid "yellow" -msgstr "jaune" - -# src/prop_vector.c:245 -# src/prop_vector.c:224 -# src/prop_vector.c:224 -#: ../src/mygal/color-palette.c:605 -msgid "green" -msgstr "vert" - -#: ../src/mygal/color-palette.c:606 ../src/mygal/color-palette.c:636 -msgid "cyan" -msgstr "cyan" - -#: ../src/mygal/color-palette.c:607 -msgid "bright blue" -msgstr "bleu vif" - -#: ../src/mygal/color-palette.c:608 ../src/mygal/color-palette.c:625 -msgid "red purple" -msgstr "rouge violet" - -#: ../src/mygal/color-palette.c:609 -msgid "light grey" -msgstr "gris clair" - -#: ../src/mygal/color-palette.c:612 ../src/mygal/color-palette.c:629 -msgid "pink" -msgstr "rose" - -#: ../src/mygal/color-palette.c:613 -msgid "light orange" -msgstr "orange clair" - -#: ../src/mygal/color-palette.c:614 ../src/mygal/color-palette.c:626 -msgid "light yellow" -msgstr "jaune clair" - -#: ../src/mygal/color-palette.c:615 -msgid "light green" -msgstr "vert clair" - -#: ../src/mygal/color-palette.c:616 -msgid "light cyan" -msgstr "cyan clair" - -#: ../src/mygal/color-palette.c:617 ../src/mygal/color-palette.c:627 -msgid "light blue" -msgstr "bleu clair" - -#: ../src/mygal/color-palette.c:618 ../src/mygal/color-palette.c:631 -msgid "light purple" -msgstr "violet clair" - -#: ../src/mygal/color-palette.c:619 -msgid "white" -msgstr "blanc" - -#: ../src/mygal/color-palette.c:624 -msgid "purplish blue" -msgstr "bleu violacé" - -#: ../src/mygal/color-palette.c:628 -msgid "dark purple" -msgstr "violet foncé" - -#: ../src/mygal/color-palette.c:630 -msgid "sky blue" -msgstr "bleu ciel" - -#: ../src/critical-error-handler.c:73 -msgid "gLabels Fatal Error!" -msgstr "Erreur fatale de gLabels !" - -# src/preferences.c:92 -# src/prefs.c:101 -# src/prefs.c:92 -# src/prefs.c:86 -#: ../src/warning-handler.c:73 -msgid "gLabels Error!" -msgstr "Erreur de gLabels !" - -#: ../libglabels/category.c:352 -msgid "" -"Unable to locate category definitions. Libglabels may not be installed " -"correctly!" -msgstr "Impossible de trouver les définitions de catégorie. Il se peut que Libglabels ne soit pas correctement installé." - -#: ../libglabels/template.c:940 -#, c-format -msgid "Generic %s full page" -msgstr "Page entière générique %s" - -#: ../libglabels/template.c:989 -msgid "" -"Unable to locate any template files. Libglabels may not be installed " -"correctly!" -msgstr "Impossible de trouver les fichiers modèles. Il se peut que Libglabels ne soit pas correctement installé." - -#. Create and append an "Other" entry. -#: ../libglabels/paper.c:76 -msgid "Other" -msgstr "Autre" - -#: ../libglabels/paper.c:461 -msgid "" -"Unable to locate paper size definitions. Libglabels may not be installed " -"correctly!" -msgstr "Impossible de trouver les définitions de tailles de papier. Il se peut que Libglabels ne soit pas correctement installé." - -#. This should always be an id, but just in case a name -#. slips by! -#: ../libglabels/xml-template.c:217 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "Taille de papier avec id « %s » inconnue, essai avec le nom" - -#: ../libglabels/xml-template.c:227 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "Identifiant ou nom de taille de papier « %s » inconnu" - -#: ../data/glade/merge-properties-dialog.glade.h:1 -msgid "Record selection/preview" -msgstr "Sélection/Aperçu des enregistrements" - -# src/merge_properties.c:131 -# src/merge_properties.c:131 -#: ../data/glade/merge-properties-dialog.glade.h:2 -msgid "Source" -msgstr "Source" - -# src/prop_text.c:214 -# src/prop_text.c:199 -# src/merge_properties.c:143 -# src/merge_properties.c:143 -#: ../data/glade/merge-properties-dialog.glade.h:3 -msgid "Format:" -msgstr "Format :" - -# src/merge_properties.c:158 -# src/merge_properties.c:158 -#: ../data/glade/merge-properties-dialog.glade.h:4 -msgid "Location:" -msgstr "Emplacement :" - -# src/menu.c:86 -# src/menu.c:86 -# src/menu.c:85 -# src/menu.c:85 -#: ../data/glade/merge-properties-dialog.glade.h:5 -msgid "Select all" -msgstr "Tout sélectionner" - -# src/menu.c:86 -# src/menu.c:86 -# src/menu.c:85 -# src/menu.c:85 -#: ../data/glade/merge-properties-dialog.glade.h:6 -msgid "Unselect all" -msgstr "Désélectionner tout" - -#: ../data/glade/merge-properties-dialog.glade.h:7 -#: ../data/glade/object-editor.glade.h:39 -msgid "dialog1" -msgstr "dialog1" - -# src/file.c:98 -# src/file.c:98 -# src/file.c:109 -# src/file.c:109 -#: ../data/glade/new-label-dialog.glade.h:1 -msgid "Label orientation" -msgstr "Orientation de l'étiquette" - -# src/file.c:87 -# src/file.c:87 -# src/file.c:98 -# src/file.c:98 -#: ../data/glade/new-label-dialog.glade.h:2 -msgid "Media type" -msgstr "Type de média" - -# src/prop_bc.c:202 -# src/prop_bc.c:182 -# src/prop_bc.c:182 -#: ../data/glade/object-editor.glade.h:2 -#, no-c-format -msgid "%" -msgstr "%" - -#: ../data/glade/object-editor.glade.h:3 -msgid "00000000000 00000" -msgstr "00000000000 00000" - -#: ../data/glade/object-editor.glade.h:4 -msgid "Xxx object properties" -msgstr "Xxx Propriétés de l'objet" - -# src/prop_text.c:277 -# src/prop_text.c:264 -# src/prop_text.c:248 -# src/prop_text.c:248 -#: ../data/glade/object-editor.glade.h:5 ../data/glade/prefs-dialog.glade.h:7 -msgid "Alignment:" -msgstr "Alignement :" - -#: ../data/glade/object-editor.glade.h:6 -msgid "Allow merge to automatically shrink text" -msgstr "Permettre à la fusion de diminuer automatiquement la taille du texte" - -# src/prop_vector.c:207 -# src/prop_vector.c:228 -# src/prop_vector.c:207 -# src/prop_vector.c:207 -#: ../data/glade/object-editor.glade.h:7 -msgid "Angle:" -msgstr "Angle :" - -#: ../data/glade/object-editor.glade.h:8 -msgid "Checksum" -msgstr "Somme de contrôle" - -# src/prop_bc.c:204 src/prop_fill.c:186 src/prop_line.c:203 -# src/prop_text.c:263 -# src/prop_bc.c:210 src/prop_fill.c:184 src/prop_line.c:209 -# src/prop_text.c:247 -# src/prop_bc.c:188 src/prop_fill.c:166 src/prop_line.c:189 -# src/prop_text.c:234 -# src/prop_bc.c:188 src/prop_fill.c:166 src/prop_line.c:189 -# src/prop_text.c:234 -#: ../data/glade/object-editor.glade.h:9 ../data/glade/prefs-dialog.glade.h:8 -msgid "Color:" -msgstr "Couleur :" - -#: ../data/glade/object-editor.glade.h:11 -msgid "Enable shadow" -msgstr "Activer l'ombrage" - -# src/item_box.c:274 src/item_ellipse.c:279 -# src/item_box.c:274 src/item_ellipse.c:279 -# src/item_box.c:258 src/item_ellipse.c:260 -# src/item_box.c:258 src/item_ellipse.c:260 -#: ../data/glade/object-editor.glade.h:12 -msgid "Family:" -msgstr "Famille :" - -# src/item_box.c:274 src/item_ellipse.c:279 -# src/item_box.c:274 src/item_ellipse.c:279 -# src/item_box.c:258 src/item_ellipse.c:260 -# src/item_box.c:258 src/item_ellipse.c:260 -#: ../data/glade/object-editor.glade.h:13 -msgid "File:" -msgstr "Fichier :" - -# src/item_box.c:274 src/item_ellipse.c:279 -# src/item_box.c:274 src/item_ellipse.c:279 -# src/item_box.c:258 src/item_ellipse.c:260 -# src/item_box.c:258 src/item_ellipse.c:260 -#: ../data/glade/object-editor.glade.h:14 -msgid "Fill" -msgstr "Remplissage" - -# src/prop_size.c:220 -# src/prop_size.c:198 -# src/prop_size.c:198 -#: ../data/glade/object-editor.glade.h:15 -#: ../data/glade/template-designer.glade.h:31 -msgid "Height:" -msgstr "Hauteur :" - -# src/prop_text_entry.c:196 -# src/prop_text_entry.c:196 -#: ../data/glade/object-editor.glade.h:17 -msgid "Insert merge field" -msgstr "Insérer un champ de fusion" - -# src/prop_bc_data.c:196 src/prop_text_entry.c:180 -# src/prop_bc_data.c:196 src/prop_text_entry.c:180 -#: ../data/glade/object-editor.glade.h:18 -msgid "Key:" -msgstr "Clé :" - -# src/prop_vector.c:196 -# src/prop_vector.c:202 -# src/prop_vector.c:183 -# src/prop_vector.c:183 -#: ../data/glade/object-editor.glade.h:19 -msgid "Length:" -msgstr "Longueur :" - -#: ../data/glade/object-editor.glade.h:21 -#: ../data/glade/prefs-dialog.glade.h:12 -msgid "Line Spacing:" -msgstr "Espacement :" - -# src/prop_bc_data.c:176 -# src/prop_bc_data.c:176 -#: ../data/glade/object-editor.glade.h:22 -msgid "Literal:" -msgstr "Littéral :" - -#: ../data/glade/object-editor.glade.h:23 -msgid "Opacity:" -msgstr "Opacité :" - -# src/item_barcode.c:362 src/item_barcode.c:365 src/item_box.c:291 -# src/item_ellipse.c:296 src/item_image.c:315 src/item_line.c:289 -# src/item_text.c:487 src/item_text.c:490 -# src/item_barcode.c:368 src/item_barcode.c:371 src/item_box.c:291 -# src/item_ellipse.c:296 src/item_image.c:315 src/item_line.c:289 -# src/item_text.c:487 src/item_text.c:490 -# src/item_barcode.c:345 src/item_barcode.c:348 src/item_box.c:275 -# src/item_ellipse.c:277 src/item_image.c:318 src/item_line.c:274 -# src/item_text.c:500 src/item_text.c:503 -# src/item_barcode.c:345 src/item_barcode.c:348 src/item_box.c:275 -# src/item_ellipse.c:277 src/item_image.c:318 src/item_line.c:274 -# src/item_text.c:500 src/item_text.c:503 -#: ../data/glade/object-editor.glade.h:24 -msgid "Position" -msgstr "Position" - -# src/item_image.c:341 -# src/item_image.c:340 -# src/item_image.c:342 -# src/item_image.c:342 -#: ../data/glade/object-editor.glade.h:25 -msgid "Reset image size" -msgstr "Restaurer la taille d'image" - -# src/menu.c:86 -# src/menu.c:86 -# src/menu.c:85 -# src/menu.c:85 -#: ../data/glade/object-editor.glade.h:26 -msgid "Select A File" -msgstr "Sélectionner un fichier" - -#: ../data/glade/object-editor.glade.h:27 -msgid "Shadow" -msgstr "Ombre" - -# src/item_box.c:302 src/item_ellipse.c:307 src/item_image.c:326 -# src/item_line.c:300 -# src/item_box.c:302 src/item_ellipse.c:307 src/item_image.c:326 -# src/item_line.c:300 -# src/item_box.c:286 src/item_ellipse.c:288 src/item_image.c:329 -# src/item_line.c:285 -# src/item_box.c:286 src/item_ellipse.c:288 src/item_image.c:329 -# src/item_line.c:285 -#: ../data/glade/object-editor.glade.h:28 -msgid "Size" -msgstr "Taille" - -# src/item_box.c:302 src/item_ellipse.c:307 src/item_image.c:326 -# src/item_line.c:300 -# src/item_box.c:302 src/item_ellipse.c:307 src/item_image.c:326 -# src/item_line.c:300 -# src/item_box.c:286 src/item_ellipse.c:288 src/item_image.c:329 -# src/item_line.c:285 -# src/item_box.c:286 src/item_ellipse.c:288 src/item_image.c:329 -# src/item_line.c:285 -#: ../data/glade/object-editor.glade.h:29 -msgid "Size:" -msgstr "Taille :" - -# src/item_barcode.c:347 -# src/item_barcode.c:353 -# src/item_barcode.c:330 -# src/item_barcode.c:330 -#: ../data/glade/object-editor.glade.h:30 -msgid "Style" -msgstr "Style" - -# src/item_barcode.c:347 -# src/item_barcode.c:353 -# src/item_barcode.c:330 -# src/item_barcode.c:330 -#: ../data/glade/object-editor.glade.h:31 -msgid "Style:" -msgstr "Style :" - -# src/prop_line.c:188 -# src/prop_line.c:187 src/prop_size.c:202 -# src/prop_line.c:169 src/prop_size.c:182 -# src/prop_line.c:169 src/prop_size.c:182 -#: ../data/glade/object-editor.glade.h:33 -#: ../data/glade/prefs-dialog.glade.h:20 -#: ../data/glade/template-designer.glade.h:62 -msgid "Width:" -msgstr "Largeur :" - -#: ../data/glade/object-editor.glade.h:34 -msgid "X Offset:" -msgstr "Décalage X :" - -# src/prop_position.c:192 -# src/prop_position.c:173 -# src/prop_position.c:173 -#: ../data/glade/object-editor.glade.h:35 -msgid "X:" -msgstr "X :" - -#: ../data/glade/object-editor.glade.h:36 -msgid "Y Offset:" -msgstr "Décalage Y :" - -# src/prop_position.c:212 -# src/prop_position.c:191 -# src/prop_position.c:191 -#: ../data/glade/object-editor.glade.h:37 -msgid "Y:" -msgstr "Y :" - -# src/prop_vector.c:245 -# src/prop_vector.c:224 -# src/prop_vector.c:224 -#: ../data/glade/object-editor.glade.h:38 -msgid "degrees" -msgstr "degrés" - -#: ../data/glade/object-editor.glade.h:40 -msgid "digits:" -msgstr "" - -# src/prop_text.c:214 -# src/prop_text.c:199 -# src/merge_properties.c:143 -# src/merge_properties.c:143 -#: ../data/glade/object-editor.glade.h:41 -msgid "format:" -msgstr "format :" - -#: ../data/glade/prefs-dialog.glade.h:1 -msgid " " -msgstr " " - -#: ../data/glade/prefs-dialog.glade.h:2 -msgid "Default page size" -msgstr "Taille de page par défaut" - -#: ../data/glade/prefs-dialog.glade.h:3 -msgid "Fill" -msgstr "Remplissage" - -#: ../data/glade/prefs-dialog.glade.h:4 -msgid "Line" -msgstr "Ligne" - -#: ../data/glade/prefs-dialog.glade.h:5 -msgid "Text" -msgstr "Texte" - -#: ../data/glade/prefs-dialog.glade.h:6 -msgid "Units" -msgstr "Unités" - -# src/prop_text.c:214 -# src/prop_text.c:199 -# src/prop_text.c:181 -# src/prop_text.c:181 -#: ../data/glade/prefs-dialog.glade.h:9 -msgid "Font:" -msgstr "Police :" - -#: ../data/glade/prefs-dialog.glade.h:10 -msgid "ISO A4" -msgstr "ISO A4" - -# src/prefs.c:265 -# src/prefs.c:243 -# src/prefs.c:237 -#: ../data/glade/prefs-dialog.glade.h:11 -msgid "Inches" -msgstr "Pouces" - -# src/prop_bc.c:189 -# src/prop_bc.c:187 -# src/prop_bc.c:168 -# src/prop_bc.c:168 -#: ../data/glade/prefs-dialog.glade.h:13 -msgid "Locale" -msgstr "Localisation" - -# src/prefs.c:271 -# src/prefs.c:250 -# src/prefs.c:244 -#: ../data/glade/prefs-dialog.glade.h:14 -msgid "Millimeters" -msgstr "Millimètres" - -#: ../data/glade/prefs-dialog.glade.h:15 -msgid "Object defaults" -msgstr "Paramètres par défaut pour les objets" - -# src/print.c:149 -# src/prefs.c:259 -# src/prefs.c:237 -# src/prefs.c:231 -#: ../data/glade/prefs-dialog.glade.h:16 -msgid "Points" -msgstr "Points" - -#: ../data/glade/prefs-dialog.glade.h:17 -msgid "Select default properties for new objects." -msgstr "Sélectionner les propriétés par défaut pour les nouveaux objets." - -#: ../data/glade/prefs-dialog.glade.h:18 -msgid "Select locale specific behavior." -msgstr "Sélectionnez les paramètres de localisation" - -#. Most popular (at top of list) -#: ../data/glade/prefs-dialog.glade.h:19 -#: ../data/templates/paper-sizes.xml.h:29 -msgid "US Letter" -msgstr "Letter US" - -# src/print.c:171 -# src/print.c:171 -# src/print.c:186 -# src/print_dialog.c:141 -#: ../data/glade/print-custom-widget.glade.h:1 -msgid "Options" -msgstr "Options" - -#: ../data/glade/print-custom-widget.glade.h:2 -msgid "Print control (Merge)" -msgstr "Contrôle d'impression (fusion)" - -#: ../data/glade/print-custom-widget.glade.h:3 -msgid "Print control (Simple)" -msgstr "Contrôle d'impression (simple)" - -#: ../data/glade/property-bar.glade.h:1 -msgid "Bold" -msgstr "Gras" - -# src/item_barcode.c:337 -# src/item_barcode.c:343 src/prefs.c:243 -# src/item_barcode.c:320 src/prefs.c:221 -# src/item_barcode.c:320 src/prefs.c:215 -#: ../data/glade/property-bar.glade.h:2 -msgid "Center align" -msgstr "Centrer" - -# src/mdi.c:482 -# src/mdi.c:488 -# src/mdi.c:459 -# src/mdi.c:459 -#: ../data/glade/property-bar.glade.h:4 -msgid "Font family" -msgstr "Famille de police" - -# src/mdi.c:482 -# src/mdi.c:488 -# src/mdi.c:459 -# src/mdi.c:459 -#: ../data/glade/property-bar.glade.h:5 -msgid "Font size" -msgstr "Taille de police" - -#: ../data/glade/property-bar.glade.h:6 -msgid "Italic" -msgstr "Italique" - -#: ../data/glade/property-bar.glade.h:7 -msgid "Left align" -msgstr "Aligner à gauche" - -#: ../data/glade/property-bar.glade.h:9 -msgid "Line width" -msgstr "Largeur de la ligne" - -#: ../data/glade/property-bar.glade.h:10 -msgid "Right align" -msgstr "Aligner à droite" - -#: ../data/glade/property-bar.glade.h:11 -msgid "Text Color" -msgstr "Couleur du texte" - -#: ../data/glade/property-bar.glade.h:12 -msgid "Text color" -msgstr "Couleur du texte" - -#: ../data/glade/template-designer.glade.h:1 -msgid " " -msgstr " " - -#: ../data/glade/template-designer.glade.h:2 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "(ex : « Étiquettes de publipostage », « Cartes de visite », ...)" - -#: ../data/glade/template-designer.glade.h:3 -msgid "(e.g., 8163A)" -msgstr "(ex : 8163A)" - -#: ../data/glade/template-designer.glade.h:4 -msgid "(e.g., Avery, Acme, ...)" -msgstr "(ex : Avery, Acme, ...)" - -#: ../data/glade/template-designer.glade.h:5 -msgid "1. Outer radius:" -msgstr "1. Rayon extérieur :" - -#: ../data/glade/template-designer.glade.h:6 -msgid "1. Radius:" -msgstr "1. Rayon :" - -# src/prop_line.c:188 -# src/prop_line.c:187 src/prop_size.c:202 -# src/prop_line.c:169 src/prop_size.c:182 -# src/prop_line.c:169 src/prop_size.c:182 -#: ../data/glade/template-designer.glade.h:7 -msgid "1. Width:" -msgstr "1. Largeur :" - -# src/prop_size.c:220 -# src/prop_size.c:198 -# src/prop_size.c:198 -#: ../data/glade/template-designer.glade.h:8 -msgid "2. Height:" -msgstr "2. Hauteur :" - -#: ../data/glade/template-designer.glade.h:9 -msgid "2. Inner radius:" -msgstr "2. Rayon Intérieur :" - -#: ../data/glade/template-designer.glade.h:10 -msgid "2. Waste (overprint allowed):" -msgstr "2. Déchet (impression en surcharge autorisée) :" - -#: ../data/glade/template-designer.glade.h:11 -msgid "3. Clipping width:" -msgstr "3. Largeur de rognure :" - -#: ../data/glade/template-designer.glade.h:12 -msgid "3. Margin" -msgstr "3. Marge" - -#: ../data/glade/template-designer.glade.h:13 -msgid "3. Round (radius of corner):" -msgstr "3. Arrondi (rayon du coin) :" - -#: ../data/glade/template-designer.glade.h:14 -msgid "4. Clipping height:" -msgstr "4. Hauteur de rognure :" - -#: ../data/glade/template-designer.glade.h:15 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "4. Déchet horiz. (impression en surcharge autorisée) :" - -#: ../data/glade/template-designer.glade.h:16 -msgid "5. Vert. waste (overprint allowed):" -msgstr "5. Déchet vert. (impression en surcharge autorisée) :" - -#: ../data/glade/template-designer.glade.h:17 -msgid "5. Waste (overprint allowed):" -msgstr "5. Déchet (impression en surcharge autorisée) :" - -#: ../data/glade/template-designer.glade.h:18 -msgid "6. Margin" -msgstr "6. Marge" - -#: ../data/glade/template-designer.glade.h:19 -msgid "Brand/Manufacturer:" -msgstr "Marque/Fabricant :" - -#: ../data/glade/template-designer.glade.h:20 -msgid "CD/DVD (including credit card CDs)" -msgstr "CD/DVD (y compris CD au format carte de crédit)" - -#: ../data/glade/template-designer.glade.h:21 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "" -"Félicitations !\n" -"Vous avez terminé la création d'un patron gLabels.\n" -"Si vous voulez accepter et sauver votre création, cliquez sur « Appliquer ».\n" -"\n" -"Dans le cas contraire, vous pouvez cliquer sur « Annuler » pour abandonner " -"votre création ou « Précédent » pour continuer d'éditer cette création." - -# src/media_select.c:216 -# src/media_select.c:242 -# src/media_select.c:222 -# src/media_select.c:222 -#: ../data/glade/template-designer.glade.h:28 -msgid "Description:" -msgstr "Description :" - -#: ../data/glade/template-designer.glade.h:29 -msgid "Distance from left edge (x0):" -msgstr "Distance par rapport au bord gauche (x0) :" - -#: ../data/glade/template-designer.glade.h:30 -msgid "Distance from top edge (y0):" -msgstr "Distance pas rapport au bord haut (y0) :" - -#: ../data/glade/template-designer.glade.h:32 -msgid "Horizontal pitch (dx):" -msgstr "Espacement horizontal (dx) :" - -#: ../data/glade/template-designer.glade.h:33 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" -"Combien de dispositions votre patron contiendra-t-il ?\n" -"\n" -"Une disposition est un ensemble d'étiquettes ou de cartes qui peuvent être " -"rangés sur une simple grille.\n" -"La plupart des patrons n'ont besoin que d'une disposition, comme pour le " -"premier exemple.\n" -"Le deuxième exemple illustre le cas où deux dispositions sont nécessaires." - -# src/media_select.c:231 -# src/media_select.c:257 -# src/media_select.c:237 -# src/media_select.c:237 -#: ../data/glade/template-designer.glade.h:38 -msgid "Layout #1" -msgstr "Disposition n°1" - -# src/media_select.c:231 -# src/media_select.c:257 -# src/media_select.c:237 -# src/media_select.c:237 -#: ../data/glade/template-designer.glade.h:39 -msgid "Layout #2" -msgstr "Disposition n°2" - -#: ../data/glade/template-designer.glade.h:40 -msgid "Number across (nx):" -msgstr "Nombre horizontalement (nx) :" - -#: ../data/glade/template-designer.glade.h:41 -msgid "Number down (ny):" -msgstr "Nombre verticalement (ny) :" - -#: ../data/glade/template-designer.glade.h:42 -msgid "Number of layouts:" -msgstr "Nombre de dispositions :" - -# src/media_select.c:221 -# src/media_select.c:247 -# src/media_select.c:227 -# src/media_select.c:227 -#: ../data/glade/template-designer.glade.h:43 -#: ../data/glade/wdgt-media-select.glade.h:2 -msgid "Page size:" -msgstr "Taille de page :" - -#: ../data/glade/template-designer.glade.h:44 -msgid "Part #:" -msgstr "N° Ref :" - -#: ../data/glade/template-designer.glade.h:45 -msgid "" -"Please enter the following identifying information about the template " -"stationery." -msgstr "Entrez les informations suivantes à propos du fabricant de papier." - -#: ../data/glade/template-designer.glade.h:46 -msgid "Please enter the following layout information." -msgstr "Entrez les informations suivantes sur la disposition." - -#: ../data/glade/template-designer.glade.h:47 -msgid "" -"Please enter the following size parameters of a single label in your " -"template." -msgstr "Entrez les paramètres de taille suivants pour une étiquette." - -#: ../data/glade/template-designer.glade.h:48 -msgid "" -"Please enter the following size parameters of a single label or card in your " -"template." -msgstr "Entrez les paramètres de taille suivant pour une carte ou une étiquette." - -#: ../data/glade/template-designer.glade.h:49 -msgid "Please select the basic shape of the labels or cards." -msgstr "Sélectionnez la forme de base des cartes ou des étiquettes." - -#: ../data/glade/template-designer.glade.h:50 -msgid "Please select the page size of the template stationery." -msgstr "Sélectionnez la taille du papier." - -# src/print_copies_merge.c:206 -# src/print_merge.c:179 -#: ../data/glade/template-designer.glade.h:51 -msgid "Print test sheet" -msgstr "Imprimer une page de tests" - -#: ../data/glade/template-designer.glade.h:52 -msgid "Rectangular or square (can have rounded corners)" -msgstr "Rectangulaire ou carré (éventuellement à bords arrondis)" - -#: ../data/glade/template-designer.glade.h:53 -msgid "Round" -msgstr "Rond" - -#: ../data/glade/template-designer.glade.h:54 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" -"Patron nécessitant\n" -"deux dispositions." - -#: ../data/glade/template-designer.glade.h:56 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" -"Patron nécessitant\n" -"une disposition." - -#: ../data/glade/template-designer.glade.h:58 -msgid "Vertical pitch (dy):" -msgstr "Espacement vertical (dy) :" - -#: ../data/glade/template-designer.glade.h:59 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" -"Bienvenue dans le créateur de patrons de gLabels.\n" -"Ce questionnaire va vous aider à créer un patron personnalisé pour glabels." - -#: ../data/glade/template-designer.glade.h:63 -msgid "cd_size_page" -msgstr "cd_size_page" - -#: ../data/glade/template-designer.glade.h:64 -msgid "finish_page" -msgstr "finish_page" - -#: ../data/glade/template-designer.glade.h:66 -msgid "layout_page" -msgstr "layout_page" - -#: ../data/glade/template-designer.glade.h:67 -msgid "name_page" -msgstr "name_page" - -#: ../data/glade/template-designer.glade.h:68 -msgid "nlayouts_page" -msgstr "nlayouts_page" - -#: ../data/glade/template-designer.glade.h:69 -msgid "pg_size_page" -msgstr "pg_size_page" - -#: ../data/glade/template-designer.glade.h:70 -msgid "rect_size_page" -msgstr "rect_size_page" - -#: ../data/glade/template-designer.glade.h:71 -msgid "round_size_page" -msgstr "round_size_page" - -#: ../data/glade/template-designer.glade.h:72 -msgid "shape_page" -msgstr "shape_page" - -#: ../data/glade/template-designer.glade.h:73 -msgid "start_page" -msgstr "start_page" - -#: ../data/glade/wdgt-media-select.glade.h:1 -msgid "Category:" -msgstr "Catégorie :" - -# src/rotate_select.c:187 -# src/rotate_select.c:187 -# src/rotate_select.c:167 -# src/rotate_select.c:169 -#: ../data/glade/wdgt-rotate-label.glade.h:1 -msgid "Rotate" -msgstr "Rotation" - -#. Other ISO A series sizes -#: ../data/templates/paper-sizes.xml.h:2 -msgid "A0" -msgstr "A0" - -#: ../data/templates/paper-sizes.xml.h:3 -msgid "A1" -msgstr "A1" - -#: ../data/templates/paper-sizes.xml.h:4 -msgid "A10" -msgstr "A10" - -#: ../data/templates/paper-sizes.xml.h:5 -msgid "A2" -msgstr "A2" - -#: ../data/templates/paper-sizes.xml.h:6 -msgid "A3" -msgstr "A3" - -#: ../data/templates/paper-sizes.xml.h:7 -msgid "A4" -msgstr "A4" - -#: ../data/templates/paper-sizes.xml.h:8 -msgid "A5" -msgstr "A5" - -#: ../data/templates/paper-sizes.xml.h:9 -msgid "A6" -msgstr "A6" - -#: ../data/templates/paper-sizes.xml.h:10 -msgid "A7" -msgstr "A7" - -#: ../data/templates/paper-sizes.xml.h:11 -msgid "A8" -msgstr "A8" - -#: ../data/templates/paper-sizes.xml.h:12 -msgid "A9" -msgstr "A9" - -#. ISO B series sizes -#: ../data/templates/paper-sizes.xml.h:14 -msgid "B0" -msgstr "B0" - -#: ../data/templates/paper-sizes.xml.h:15 -msgid "B1" -msgstr "B1" - -#: ../data/templates/paper-sizes.xml.h:16 -msgid "B10" -msgstr "B10" - -#: ../data/templates/paper-sizes.xml.h:17 -msgid "B2" -msgstr "B2" - -#: ../data/templates/paper-sizes.xml.h:18 -msgid "B3" -msgstr "B3" - -#: ../data/templates/paper-sizes.xml.h:19 -msgid "B4" -msgstr "B4" - -#: ../data/templates/paper-sizes.xml.h:20 -msgid "B5" -msgstr "B5" - -#: ../data/templates/paper-sizes.xml.h:21 -msgid "B6" -msgstr "B6" - -#: ../data/templates/paper-sizes.xml.h:22 -msgid "B7" -msgstr "B7" - -#: ../data/templates/paper-sizes.xml.h:23 -msgid "B8" -msgstr "B8" - -#: ../data/templates/paper-sizes.xml.h:24 -msgid "B9" -msgstr "B9" - -#: ../data/templates/paper-sizes.xml.h:25 -msgid "US Executive" -msgstr "Exécutif US" - -#. Other US paper sizes -#: ../data/templates/paper-sizes.xml.h:27 -msgid "US Legal" -msgstr "Légal US" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:2 -#: ../data/templates/zweckform-iso-templates.xml.h:2 -msgid "Address Labels" -msgstr "Étiquettes d'adresses" - -#. =================================================================== -#. ============================================================ -#. =================================================================== -#. ====================================================== -#: ../data/templates/avery-us-templates.xml.h:4 -#: ../data/templates/avery-iso-templates.xml.h:4 -#: ../data/templates/zweckform-iso-templates.xml.h:6 -#: ../data/templates/misc-us-templates.xml.h:4 -#: ../data/templates/misc-iso-templates.xml.h:12 -msgid "Business Cards" -msgstr "Cartes de visite" - -# src/print_copies.c:210 -# src/print_copies.c:210 -# src/print_copies.c:188 -# src/print_copies.c:187 -#. =================================================================== -#. =============================================================== -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:6 -#: ../data/templates/avery-iso-templates.xml.h:10 -#: ../data/templates/zweckform-iso-templates.xml.h:8 -#: ../data/templates/misc-us-templates.xml.h:8 -#: ../data/templates/misc-iso-templates.xml.h:16 -msgid "CD/DVD Labels" -msgstr "Étiquettes de CD/DVD" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:8 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "Étiquettes de CD/DVD (étiquettes de disque)" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:10 -msgid "CD/DVD Labels (Spine Labels)" -msgstr "Étiquettes de CD/DVD (étiquettes de boîtier)" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:12 -msgid "Diskette Labels" -msgstr "Étiquettes de disquette" - -# src/print_copies.c:210 -# src/print_copies.c:210 -# src/print_copies.c:188 -# src/print_copies.c:187 -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:14 -msgid "Filing Labels" -msgstr "" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:16 -msgid "Full Sheet Labels" -msgstr "" - -# src/print_copies_merge.c:197 -# src/print_merge.c:170 -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:18 -msgid "Large Round Labels" -msgstr "" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:20 -msgid "Name Badge Labels" -msgstr "" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:22 -msgid "Return Address Labels" -msgstr "Étiquettes d'adresse de retour" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:24 -msgid "Shipping Labels" -msgstr "Étiquettes postales" - -# src/print_copies_merge.c:197 -# src/print_merge.c:170 -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:26 -msgid "Small Round Labels" -msgstr "" - -# src/print_copies.c:210 -# src/print_copies.c:210 -# src/print_copies.c:188 -# src/print_copies.c:187 -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:28 -msgid "Square Labels" -msgstr "Étiquettes carrées" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:30 -msgid "Video Tape Face Labels" -msgstr "Étiquettes de face de cassette vidéo" - -#. =================================================================== -#: ../data/templates/avery-us-templates.xml.h:32 -msgid "Video Tape Spine Labels" -msgstr "Étiquettes de dos de cassette vidéo" - -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:2 -msgid "Address labels" -msgstr "Étiquettes d'adresse" - -#. =============================================================== -#: ../data/templates/avery-iso-templates.xml.h:6 -msgid "CD Booklet" -msgstr "Livret de CD" - -#. =============================================================== -#: ../data/templates/avery-iso-templates.xml.h:8 -msgid "CD Inlet" -msgstr "" - -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:12 -msgid "Diskette labels" -msgstr "Étiquettes de disquette" - -#. =============================================================== -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:14 -#: ../data/templates/zweckform-iso-templates.xml.h:14 -#: ../data/templates/misc-iso-templates.xml.h:30 -msgid "Mailing Labels" -msgstr "Étiquettes de publipostage" - -# src/print_copies.c:210 -# src/print_copies.c:210 -# src/print_copies.c:188 -# src/print_copies.c:187 -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:16 -msgid "Mailing labels" -msgstr "Étiquettes de publipostage" - -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:18 -msgid "Mini Address Labels" -msgstr "Étiquettes de mini-adresse" - -# src/file.c:183 -# src/file.c:183 -# src/file.c:213 -# src/file.c:213 -#. =================================================================== -#: ../data/templates/avery-iso-templates.xml.h:20 -msgid "Shipping labels" -msgstr "Étiquettes postales" - -#: ../data/templates/categories.xml.h:1 -msgid "Any card" -msgstr "Toute carte" - -# src/file.c:183 -# src/file.c:183 -# src/file.c:213 -# src/file.c:213 -#: ../data/templates/categories.xml.h:2 -msgid "Any label" -msgstr "Toute étiquette" - -#: ../data/templates/categories.xml.h:3 -msgid "Business cards" -msgstr "Cartes de visite" - -#: ../data/templates/categories.xml.h:4 -msgid "CD/DVD or other media" -msgstr "CD/DVD ou autre support" - -#: ../data/templates/categories.xml.h:5 -msgid "Mailing/shipping products" -msgstr "Produits d'expédition" - -#: ../data/templates/categories.xml.h:6 -msgid "Rectangular labels" -msgstr "Étiquettes rectangulaires" - -#: ../data/templates/categories.xml.h:7 -msgid "Round labels" -msgstr "Étiquettes arrondies" - -# src/print_copies_merge.c:197 -# src/print_merge.c:170 -#: ../data/templates/categories.xml.h:8 -msgid "Square labels" -msgstr "Étiquettes carrées" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:4 -#: ../data/templates/misc-iso-templates.xml.h:4 -msgid "Allround Labels" -msgstr "Étiquettes Allround" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:10 -msgid "Correction and Cover-up Labels" -msgstr "Étiquettes de correction et de recouvrement" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:12 -msgid "Lever Arch File Labels" -msgstr "" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:16 -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "Étiquettes de cartes QSL 70mm x 50,8mm" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:18 -msgid "Rectangular Copier Labels" -msgstr "" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:20 -#: ../data/templates/misc-iso-templates.xml.h:38 -msgid "Rectangular Labels" -msgstr "Étiquettes rectangulaires" - -#. =================================================================== -#: ../data/templates/zweckform-iso-templates.xml.h:22 -msgid "Video Labels (back)" -msgstr "Étiquettes vidéo (dos)" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:2 -msgid "Business Card CD" -msgstr "CD carte de visite" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:6 -msgid "CD Template Rectangles" -msgstr "" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:10 -msgid "CD/DVD Labels (Face Only)" -msgstr "Étiquettes de CD/DVD (face uniquement)" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:12 -#: ../data/templates/misc-iso-templates.xml.h:18 -msgid "CD/DVD Labels (face only)" -msgstr "Étiquettes de CD/DVD (face uniquement)" - -# src/print_copies.c:210 -# src/print_copies.c:210 -# src/print_copies.c:188 -# src/print_copies.c:187 -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:14 -msgid "Cassette Labels" -msgstr "Étiquettes de cassette" - -# src/print_copies.c:210 -# src/print_copies.c:210 -# src/print_copies.c:188 -# src/print_copies.c:187 -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:16 -msgid "DLT Labels" -msgstr "Étiquettes DLT" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:18 -msgid "Microtube labels" -msgstr "Étiquettes microtube" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:20 -msgid "Mini-CD Labels" -msgstr "Étiquettes mini-CD" - -#: ../data/templates/misc-us-templates.xml.h:21 -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "" - -#: ../data/templates/misc-us-templates.xml.h:22 -msgid "PRO CD Labels 2-up (Face only)" -msgstr "" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:24 -#: ../data/templates/misc-iso-templates.xml.h:36 -msgid "PRO CD Labels 2-up (face only)" -msgstr "" - -#. =================================================================== -#: ../data/templates/misc-us-templates.xml.h:26 -msgid "Slimline CD Case (rightside up)" -msgstr "" - -#: ../data/templates/misc-us-templates.xml.h:27 -msgid "Slimline CD Case (upside down)" -msgstr "" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:2 -msgid "Agipa 119488: Business Cards" -msgstr "Agipa 119488 : Cartes de visite" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:6 -msgid "Arch File Labels" -msgstr "Étiquettes de dossier d'archives" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:8 -msgid "Arch File Labels (large)" -msgstr "Étiquettes de dossier d'archives (grandes)" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:10 -msgid "Arch File Labels (small)" -msgstr "Étiquettes de dossier d'archives (petites)" - -# src/print_copies.c:210 -# src/print_copies.c:210 -# src/print_copies.c:188 -# src/print_copies.c:187 -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:14 -msgid "CD Labels" -msgstr "Étiquettes de CD" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:20 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "Format standard d'étiquettes de CD/DVD (face uniquement)" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:22 -msgid "Diskette Labels (face only)" -msgstr "Étiquettes de disquette (face uniquement)" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:24 -msgid "EPSON Photo Stickers 16" -msgstr "Autocollants EPSON Photo 16" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:26 -msgid "Etiketten" -msgstr "Étiquettes" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:28 -msgid "Fridge Magnet Stickers" -msgstr "Autocollants magnétiques" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:32 -msgid "Mailing Labels-2 columns" -msgstr "Étiquettes de publipostage (2 colonnes)" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:34 -msgid "Mailing Labels-3 columns" -msgstr "Étiquettes de publipostage (3 colonnes)" - -#. =================================================================== -#: ../data/templates/misc-iso-templates.xml.h:40 -msgid "Video Labels (face only)" -msgstr "Étiquettes de vidéos (face uniquement)" - -#: ../data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers" -msgstr "Crée des étiquettes et des cartes de visite" - -#: ../data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "Créateur d'étiquettes gLabels" - -# src/item_text.c:467 -# src/item_text.c:467 -# src/item_text.c:482 -# src/item_text.c:482 -#: ../data/mime/glabels.keys.in.h:1 ../data/mime/glabels.xml.in.h:1 -msgid "gLabels Project File" -msgstr "Fichier de projet gLabels" - -#: ../barcode-0.98/compat/getopt.c:583 -#, c-format -msgid "%s: option `%s' is ambiguous\n" -msgstr "%s : l'option « %s » ambiguë\n" - -#: ../barcode-0.98/compat/getopt.c:607 -#, c-format -msgid "%s: option `--%s' doesn't allow an argument\n" -msgstr "%s : l'option « --%s » n'autorise pas d'argument\n" - -#: ../barcode-0.98/compat/getopt.c:612 -#, c-format -msgid "%s: option `%c%s' doesn't allow an argument\n" -msgstr "%s : l'option « %c%s » n'autorise pas d'argument\n" - -#: ../barcode-0.98/compat/getopt.c:629 -#, c-format -msgid "%s: option `%s' requires an argument\n" -msgstr "%s : l'option « %s » exige un argument\n" - -#. --option -#: ../barcode-0.98/compat/getopt.c:658 -#, c-format -msgid "%s: unrecognized option `--%s'\n" -msgstr "%s : option « --%s » inconnue\n" - -#. +option or -option -#: ../barcode-0.98/compat/getopt.c:662 -#, c-format -msgid "%s: unrecognized option `%c%s'\n" -msgstr "%s : option « %c%s » inconnue\n" - -#. 1003.2 specifies the format of this message. -#: ../barcode-0.98/compat/getopt.c:688 -#, c-format -msgid "%s: illegal option -- %c\n" -msgstr "%s : option -- %c non autorisée\n" - -#: ../barcode-0.98/compat/getopt.c:691 -#, c-format -msgid "%s: invalid option -- %c\n" -msgstr "%s : option -- %c non valide\n" - -#: ../barcode-0.98/compat/getopt.c:727 -#, c-format -msgid "%s: option requires an argument -- %c\n" -msgstr "%s : l'option exige un argument -- %c\n" - diff --git a/glabels2/po/it.po b/glabels2/po/it.po deleted file mode 100644 index 09e23b7e..00000000 --- a/glabels2/po/it.po +++ /dev/null @@ -1,2427 +0,0 @@ -# translation of it.po to Italian -# Italian translation of glabels. -# Copyright (C) 2003 THE glabels'S COPYRIGHT HOLDER -# This file is distributed under the same license as the glabels package. -# Andrea , 2003. -# Daniele Medri , 2005. -# -# -msgid "" -msgstr "" -"Project-Id-Version: it\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-06-19 20:43-0400\n" -"PO-Revision-Date: 2005-06-27 09:34+0200\n" -"Last-Translator: Daniele Medri \n" -"Language-Team: Italian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit" - -#: src/glabels.c:116 -msgid "Could not initialize Bonobo!\n" -msgstr "Non è possibile inizializzare Bonobo!\n" - -#: src/glabels-batch.c:52 -msgid "print this message" -msgstr "stampa questo messaggio" - -#: src/glabels-batch.c:54 -msgid "print the version of glabels-batch being used" -msgstr "stampa la versione di glabels batch utilizzata" - -#: src/glabels-batch.c:56 -msgid "set output filename (default=\"output.ps\")" -msgstr "imposta il nome del file di output (default=\"output.ps\")" - -#: src/glabels-batch.c:56 src/glabels-batch.c:70 -msgid "filename" -msgstr "nome file" - -#: src/glabels-batch.c:58 -msgid "number of sheets (default=1)" -msgstr "numero di fogli (default=1)" - -#: src/glabels-batch.c:58 -msgid "sheets" -msgstr "fogli" - -#: src/glabels-batch.c:60 -msgid "number of copies (default=1)" -msgstr "numero di copie (default=1)" - -#: src/glabels-batch.c:60 -msgid "copies" -msgstr "copie" - -#: src/glabels-batch.c:62 -msgid "first label on first sheet (default=1)" -msgstr "prima etichetta del primo foglio (default=1)" - -#: src/glabels-batch.c:62 -msgid "first" -msgstr "primo" - -#: src/glabels-batch.c:64 src/print-dialog.c:336 -msgid "print outlines (to test printer alignment)" -msgstr "stampa bordi (per provare l'allineamento della stampante)" - -#: src/glabels-batch.c:66 src/print-dialog.c:344 -msgid "print in reverse (i.e. a mirror image)" -msgstr "stampa al contrario (es. un'immagine riflessa)" - -#: src/glabels-batch.c:68 src/print-dialog.c:351 -msgid "print crop marks" -msgstr "stampa segni di taglio" - -#: src/glabels-batch.c:70 -msgid "input file for merging" -msgstr "file per la stampa unione" - -#: src/glabels-batch.c:107 -msgid "[OPTION...] GLABELS_FILE..." -msgstr "[OPTION...] GLABELS_FILE..." - -#: src/glabels-batch.c:127 -#, c-format -msgid "missing glabels file\n" -msgstr "file di glabels mancante\n" - -#: src/glabels-batch.c:158 -#, c-format -msgid "cannot perform document merge with glabels file %s\n" -msgstr "non è possibile unire i documenti con il file glabels %s\n" - -#: src/glabels-batch.c:182 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "non è possibile aprire il file glabels %s\n" - -#: src/window.c:244 -msgid "(none) - gLabels" -msgstr "(niente) - gLabels" - -#: src/window.c:414 -msgid "(modified)" -msgstr "(modificato)" - -#: src/stock.c:65 data/ui/glabels-ui.xml.h:162 -msgid "_Select Mode" -msgstr "Modalità di _selezione" - -#: src/stock.c:66 data/ui/glabels-ui.xml.h:163 -msgid "_Text" -msgstr "_Testo" - -#: src/stock.c:67 data/ui/glabels-ui.xml.h:148 -msgid "_Line" -msgstr "_Linea" - -#: src/stock.c:68 data/ui/glabels-ui.xml.h:130 -msgid "_Box" -msgstr "_Area" - -#: src/stock.c:69 data/ui/glabels-ui.xml.h:141 -msgid "_Ellipse" -msgstr "_Ellisse" - -#: src/stock.c:70 data/ui/glabels-ui.xml.h:146 -msgid "_Image" -msgstr "_Immagine" - -#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 -msgid "Bar_code" -msgstr "_Codice a barre" - -#: src/stock.c:72 -msgid "_Merge Properties" -msgstr "Proprietà di _unione" - -#: src/stock.c:73 -msgid "Object _Properties" -msgstr "_Proprietà·Oggetto" - -#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 -msgid "Bring to _Front" -msgstr "Porta in _primo piano" - -#: src/stock.c:75 data/ui/glabels-ui.xml.h:109 -msgid "Send to _Back" -msgstr "Porta in _secondo piano" - -#: src/stock.c:76 data/ui/glabels-ui.xml.h:96 -msgid "Rotate _Left" -msgstr "Ruota a sinistra" - -#: src/stock.c:77 data/ui/glabels-ui.xml.h:97 -msgid "Rotate _Right" -msgstr "Ruota a destra" - -#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 -msgid "Flip _Horizontally" -msgstr "Capovolgi _orizzontalmente" - -#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 -msgid "Flip _Vertically" -msgstr "Capovolgi _verticalmente" - -#: src/stock.c:80 data/ui/glabels-ui.xml.h:147 -msgid "_Lefts" -msgstr "_Sinistra" - -#: src/stock.c:81 data/ui/glabels-ui.xml.h:159 -msgid "_Rights" -msgstr "_Destra" - -#: src/stock.c:82 data/ui/glabels-ui.xml.h:131 -msgid "_Centers" -msgstr "_Centro" - -#: src/stock.c:83 data/ui/glabels-ui.xml.h:164 -msgid "_Tops" -msgstr "_In alto" - -#: src/stock.c:84 -msgid "Bottoms" -msgstr "In basso" - -#: src/stock.c:85 -msgid "Centers" -msgstr "Centrato" - -#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 -msgid "Label Ce_nter" -msgstr "Etichetta ce_ntrata" - -#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 -msgid "Fill color" -msgstr "Colore di riempimento" - -#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 -msgid "Line color" -msgstr "Colore Linea" - -#: src/stock.c:90 src/stock.c:92 -msgid "Linked" -msgstr "Collegato" - -#: src/stock.c:91 src/stock.c:93 -msgid "Not Linked" -msgstr "Nessun collegamento" - -#: src/ui-property-bar.c:345 src/object-editor.c:499 -msgid "Default" -msgstr "Predefinito" - -#: src/ui-property-bar.c:360 src/object-editor.c:512 -msgid "No fill" -msgstr "Nessun riempimento" - -#: src/ui-property-bar.c:375 src/object-editor.c:505 -msgid "No line" -msgstr "Nessuna linea" - -#: src/ui-sidebar.c:180 -msgid "Object properties" -msgstr "Proprietà oggetto" - -#: src/commands.c:385 -msgid "" -"A label and business card creation program for GNOME.\n" -" \n" -"Glabels is free software; you can redistribute it and/or modify it under the " -"terms of the GNU General Public License as published by the Free Software " -"Foundation; either version 2 of the License, or (at your option) any later " -"version.\n" -" \n" -"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.\n" -msgstr "" - -#: src/commands.c:399 -msgid "See the file AUTHORS for additional credits," -msgstr "Visualizza il file AUTHORS per informazioni aggiuntive." - -#: src/commands.c:400 -msgid "or visit http://glabels.sourceforge.net/" -msgstr "oppure visita http://glabels.sourceforge.net/" - -#: src/commands.c:409 -msgid " " -msgstr " " - -#: src/commands.c:424 -msgid "glabels" -msgstr "glabels" - -#: src/file.c:100 -msgid "New Label or Card" -msgstr "Nuova etichetta o scheda" - -#: src/file.c:132 src/file.c:304 -msgid "Media Type" -msgstr "Tipo media" - -#: src/file.c:138 src/file.c:310 -msgid "Label orientation" -msgstr "Orientazione etichetta" - -#: src/file.c:269 -msgid "Label properties" -msgstr "Proprietà etichetta" - -#: src/file.c:452 src/file.c:870 -msgid "All files" -msgstr "Tutti i file" - -#: src/file.c:457 src/file.c:875 -msgid "gLabels documents" -msgstr "Documenti di gLabels" - -#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 -msgid "Empty file name selection" -msgstr "Selezione di un nome file vuoto" - -#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 -msgid "Please select a file or supply a valid file name" -msgstr "Per piacere, indica un file o un nome valido" - -#: src/file.c:519 src/file.c:631 -msgid "File does not exist" -msgstr "Il file non esiste" - -#: src/file.c:563 data/ui/glabels-ui.xml.h:74 -msgid "Open" -msgstr "Apri" - -#: src/file.c:565 -msgid "Open label" -msgstr "Apri etichetta" - -#: src/file.c:707 -#, c-format -msgid "Could not open file \"%s\"" -msgstr "Non riesco ad aprire il file \"%s\"" - -#: src/file.c:715 -msgid "Not a supported file format" -msgstr "Non è un formato file supportato" - -#: src/file.c:797 src/file.c:979 src/file.c:1174 -#, c-format -msgid "Could not save file \"%s\"" -msgstr "Non riesco a salvare il file \"%s\"" - -#: src/file.c:805 src/file.c:987 src/file.c:1182 -msgid "Error encountered during save. The file is still not saved." -msgstr "" - -#: src/file.c:848 src/file.c:1048 -#, c-format -msgid "Save \"%s\" as" -msgstr "Salva \"%s\" come" - -#: src/file.c:935 src/file.c:1131 -msgid "Please supply a valid file name" -msgstr "Per piacere, indica un nome file valido" - -#: src/file.c:952 src/file.c:1147 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "Sovrascrivi il file \"%s\"?" - -#: src/file.c:960 src/file.c:1155 -msgid "File already exists." -msgstr "File già esistente." - -#: src/file.c:1271 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "Salva i cambiamenti al documento \"%s\" prima di chiudere?" - -#: src/file.c:1279 -msgid "Your changes will be lost if you don't save them." -msgstr "I tuoi cambiamenti andranno persi se non salvi." - -#: src/file.c:1282 -msgid "Close without saving" -msgstr "Chiudi senza salvare" - -#. Should not happen -#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 -#: data/glade/object-editor.glade.h:37 -msgid "points" -msgstr "punti" - -#: src/prefs.c:158 data/glade/object-editor.glade.h:36 -#: data/glade/template-designer.glade.h:74 -msgid "inches" -msgstr "pollici" - -#: src/prefs.c:160 -msgid "mm" -msgstr "mm" - -#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 -msgid "gLabels Preferences" -msgstr "Preferenze gLabels" - -#. -#. * Submenu: Order -#. -#: src/view.c:3574 data/ui/glabels-ui.xml.h:154 -msgid "_Order" -msgstr "_Ordine" - -#. -#. * Submenu: Rotate/Flip -#. -#: src/view.c:3595 data/ui/glabels-ui.xml.h:160 -msgid "_Rotate/Flip" -msgstr "_Ruota/capovolgi" - -#. -#. * Submenu: Align Horizontally -#. -#: src/view.c:3628 -msgid "Align _Horizontally" -msgstr "Allineamento _orizzontale" - -#. -#. * Submenu: Align Vertically -#. -#: src/view.c:3667 -msgid "Align _Vertically" -msgstr "Allineamento _verticale" - -#: src/view.c:3728 data/ui/glabels-ui.xml.h:137 -msgid "_Delete" -msgstr "Cancella" - -#. Build editor. -#: src/view-box.c:224 -msgid "Box object properties" -msgstr "Proprietà dell'oggetto area" - -#. Build editor. -#: src/view-ellipse.c:224 -msgid "Ellipse object properties" -msgstr "Proprietà dell'oggetto Ellisse" - -#. Build editor. -#: src/view-line.c:224 -msgid "Line object properties" -msgstr "Proprietà dell'oggetto Linea" - -#. Build editor. -#: src/view-image.c:223 -msgid "Image object properties" -msgstr "Proprietà dell'oggetto Immagine" - -#. Build editor. -#: src/view-text.c:251 -msgid "Text object properties" -msgstr "Proprietà dell'oggetto Testo" - -#: src/view-text.c:563 data/glade/object-editor.glade.h:28 -msgid "Text" -msgstr "Testo" - -#. Build editor. -#: src/view-barcode.c:210 -msgid "Barcode object properties" -msgstr "Proprietà dell'oggetto Codice a barre" - -#: src/view-barcode.c:580 src/print.c:1089 -msgid "Invalid barcode data" -msgstr "Codice a barre non valido" - -#: src/merge-properties-dialog.c:231 -msgid "Merge Properties" -msgstr "Proprietà di unione" - -#. ---- Source section ---- -#: src/merge-properties-dialog.c:237 -msgid "Source" -msgstr "Sorgente" - -#: src/merge-properties-dialog.c:245 -msgid "Format:" -msgstr "Formato:" - -#. Location line -#: src/merge-properties-dialog.c:273 -msgid "Location:" -msgstr "Posizione:" - -#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 -msgid "Select merge-database source" -msgstr "Seleziona sorgente unione-database" - -#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 -msgid "N/A" -msgstr "N/A" - -#. ---- Sample Fields section ---- -#: src/merge-properties-dialog.c:300 -msgid "Record selection/preview:" -msgstr "Selezione/anteprima record:" - -#: src/merge-properties-dialog.c:326 -msgid "Select" -msgstr "Seleziona" - -#: src/merge-properties-dialog.c:334 -msgid "Record/Field" -msgstr "Record/campo" - -#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 -msgid "Data" -msgstr "Dati" - -#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:81 -msgid "Print" -msgstr "Stampa" - -#: src/print-dialog.c:281 -msgid "_Job" -msgstr "Lavoro" - -#: src/print-dialog.c:286 -msgid "P_rinter" -msgstr "Stampante" - -#. ----------- Add simple-copies widget ------------ -#: src/print-dialog.c:314 -msgid "Copies" -msgstr "Copie" - -#. ------- Add merge control widget ------------ -#: src/print-dialog.c:322 -msgid "Document merge control" -msgstr "" - -#. ----------- Add custom print options area ------------ -#: src/print-dialog.c:330 -msgid "Options" -msgstr "Opzioni" - -#: src/print-dialog.c:553 src/print-dialog.c:592 -msgid "Print preview" -msgstr "Anteprima di stampa" - -#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 -msgid "gLabels Template Designer" -msgstr "Progettazione di modelli per gLabels" - -#: src/bc.c:60 -msgid "POSTNET (any)" -msgstr "POSTNET (qualsiasi)" - -#: src/bc.c:63 -msgid "POSTNET-5 (ZIP only)" -msgstr "POSTNET-5 (solo ZIP/CAP)" - -#: src/bc.c:66 -msgid "POSTNET-9 (ZIP+4)" -msgstr "POSTNET-9 (ZIP/CAP+4)" - -#: src/bc.c:69 -msgid "POSTNET-11 (DPBC)" -msgstr "POSTNET-11 (DPBC)" - -#: src/bc.c:72 -msgid "EAN (any)" -msgstr "EAN (qualsiasi)" - -#: src/bc.c:75 -msgid "EAN-8" -msgstr "EAN-8" - -#: src/bc.c:78 -msgid "EAN-8 +2" -msgstr "EAN-8 +2" - -#: src/bc.c:81 -msgid "EAN-8 +5" -msgstr "EAN-8 +5" - -#: src/bc.c:84 -msgid "EAN-13" -msgstr "EAN-13" - -#: src/bc.c:87 -msgid "EAN-13 +2" -msgstr "EAN-13 +2" - -#: src/bc.c:90 -msgid "EAN-13 +5" -msgstr "EAN-13 +5" - -#: src/bc.c:93 -msgid "UPC (UPC-A or UPC-E)" -msgstr "UPC (UPC-A o UPC-E)" - -#: src/bc.c:96 -msgid "UPC-A" -msgstr "UPC-A" - -#: src/bc.c:99 -msgid "UPC-A +2" -msgstr "UPC-A +2" - -#: src/bc.c:102 -msgid "UPC-A +5" -msgstr "UPC-A +5" - -#: src/bc.c:105 -msgid "UPC-E" -msgstr "UPC-E" - -#: src/bc.c:108 -msgid "UPC-E +2" -msgstr "UPC-E +2" - -#: src/bc.c:111 -msgid "UPC-E +5" -msgstr "UPC-E +5" - -#: src/bc.c:114 -msgid "ISBN" -msgstr "ISBN" - -#: src/bc.c:117 -msgid "ISBN +5" -msgstr "ISBN +5" - -#: src/bc.c:120 -msgid "Code 39" -msgstr "Code 39" - -#: src/bc.c:123 -msgid "Code 128" -msgstr "Code 128" - -#: src/bc.c:126 -msgid "Code 128C" -msgstr "Code 128C" - -#: src/bc.c:129 -msgid "Code 128B" -msgstr "Code 128B" - -#: src/bc.c:132 -msgid "Interleaved 2 of 5" -msgstr "" - -#: src/bc.c:135 -msgid "Codabar" -msgstr "Codabar" - -#: src/bc.c:138 -msgid "MSI" -msgstr "MSI" - -#: src/bc.c:141 -msgid "Plessey" -msgstr "Plessey" - -#: src/label.c:569 -msgid "Untitled" -msgstr "Senza nome" - -#: src/xml-label.c:176 src/xml-label.c:213 -msgid "xmlParseFile error" -msgstr "" - -#: src/xml-label.c:250 -msgid "No document root" -msgstr "Nessun documento radice" - -#: src/xml-label.c:264 -msgid "Importing from glabels 0.1 format" -msgstr "" - -#: src/xml-label.c:272 -msgid "Importing from glabels 0.4 format" -msgstr "" - -#: src/xml-label.c:279 -msgid "Importing from glabels 1.91 format" -msgstr "" - -#: src/xml-label.c:282 -msgid "bad document, unknown glabels Namespace" -msgstr "" - -#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "" - -#: src/xml-label.c:348 src/xml-label-191.c:165 -#, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "" - -#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 -#, c-format -msgid "bad node = \"%s\"" -msgstr "" - -#: src/xml-label.c:796 src/xml-label-191.c:605 -#, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "" - -#: src/xml-label.c:962 libglabels/xml-template.c:535 -msgid "Utf8 conversion error." -msgstr "Conversione di errore Utf8." - -#: src/xml-label.c:969 libglabels/xml-template.c:542 -msgid "Problem saving xml file." -msgstr "Problema nel salvataggio del file xml" - -#. This should always be an id, but just in case a name -#. slips by! -#: src/xml-label-191.c:680 libglabels/xml-template.c:199 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "" - -#: src/xml-label-191.c:690 libglabels/xml-template.c:209 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "" - -#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 -msgid "None" -msgstr "Nessuno" - -#: src/merge-init.c:53 -msgid "Text file with comma delimeters (CSV)" -msgstr "" - -#: src/merge-init.c:60 -msgid "Text file with colon delimeters" -msgstr "" - -#: src/merge-init.c:67 -msgid "Text file with tab delimeters" -msgstr "" - -#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 -msgid "File:" -msgstr "File:" - -#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 -msgid "Key:" -msgstr "Chiave:" - -#: src/wdgt-print-copies.c:179 -msgid "Sheets:" -msgstr "Fogli:" - -#: src/wdgt-print-copies.c:197 -msgid "Labels" -msgstr "Etichette" - -#: src/wdgt-print-copies.c:200 -msgid "from:" -msgstr "da:" - -#: src/wdgt-print-copies.c:207 -msgid "to:" -msgstr "a:" - -#: src/wdgt-print-merge.c:178 -msgid "Start on label" -msgstr "" - -#: src/wdgt-print-merge.c:186 -msgid "on 1st sheet" -msgstr "nel 1° foglio" - -#: src/wdgt-print-merge.c:195 -msgid "Copies:" -msgstr "Copie:" - -#: src/wdgt-print-merge.c:201 -msgid "Collate" -msgstr "Fascicoli" - -#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 -msgid "Description:" -msgstr "Descrizione:" - -#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 -msgid "Page size:" -msgstr "Dimensioni·pagina:" - -#: src/wdgt-media-select.c:290 -msgid "Label size:" -msgstr "Dimensioni etichetta:" - -#: src/wdgt-media-select.c:301 -msgid "Layout:" -msgstr "Layout:" - -#: src/wdgt-media-select.c:578 -#, c-format -msgid "%d x %d (%d per sheet)" -msgstr "%d x %d (%d per foglio)" - -#: src/wdgt-media-select.c:582 -#, c-format -msgid "%d per sheet" -msgstr "%d per foglio" - -#: src/wdgt-media-select.c:614 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -#: src/wdgt-media-select.c:619 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 -#, c-format -msgid "%s %s diameter" -msgstr "%s %s diametro" - -#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 -#, c-format -msgid "%.5g %s diameter" -msgstr "%.5g %s diametro" - -#: src/wdgt-rotate-label.c:193 -msgid "Rotate" -msgstr "Girare" - -#. This is the default custom color -#: src/mygal/color-palette.c:396 -msgid "custom" -msgstr "personalizzato" - -#. "Custom" color - we'll pop up a GnomeColorPicker -#: src/mygal/color-palette.c:438 -msgid "Custom Color:" -msgstr "Colore personalizzato:" - -#: src/mygal/color-palette.c:446 -msgid "Choose Custom Color" -msgstr "Scegli colore personalizzato" - -#: src/mygal/color-palette.c:579 -msgid "black" -msgstr "nero" - -#: src/mygal/color-palette.c:580 -msgid "light brown" -msgstr "Marrone chiaro" - -#: src/mygal/color-palette.c:581 -msgid "brown gold" -msgstr "" - -#: src/mygal/color-palette.c:582 -msgid "dark green #2" -msgstr "verde scuro #2" - -#: src/mygal/color-palette.c:583 -msgid "navy" -msgstr "" - -#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 -msgid "dark blue" -msgstr "blu scuro" - -#: src/mygal/color-palette.c:585 -msgid "purple #2" -msgstr "" - -#: src/mygal/color-palette.c:586 -msgid "very dark gray" -msgstr "" - -#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 -msgid "dark red" -msgstr "rosso scuro" - -#: src/mygal/color-palette.c:590 -msgid "red-orange" -msgstr "" - -#: src/mygal/color-palette.c:591 -msgid "gold" -msgstr "oro" - -#: src/mygal/color-palette.c:592 -msgid "dark green" -msgstr "verde scuro" - -#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 -msgid "dull blue" -msgstr "" - -#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 -msgid "blue" -msgstr "blu" - -#: src/mygal/color-palette.c:595 -msgid "dull purple" -msgstr "" - -#: src/mygal/color-palette.c:596 -msgid "dark grey" -msgstr "" - -#: src/mygal/color-palette.c:599 -msgid "red" -msgstr "rosso" - -#: src/mygal/color-palette.c:600 -msgid "orange" -msgstr "arancione" - -#: src/mygal/color-palette.c:601 -msgid "lime" -msgstr "tiglio" - -#: src/mygal/color-palette.c:602 -msgid "dull green" -msgstr "" - -#: src/mygal/color-palette.c:603 -msgid "dull blue #2" -msgstr "" - -#: src/mygal/color-palette.c:604 -msgid "sky blue #2" -msgstr "" - -#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 -msgid "purple" -msgstr "viola" - -#: src/mygal/color-palette.c:606 -msgid "gray" -msgstr "grigio" - -#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 -msgid "magenta" -msgstr "" - -#: src/mygal/color-palette.c:610 -msgid "bright orange" -msgstr "" - -#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 -msgid "yellow" -msgstr "giallo" - -#: src/mygal/color-palette.c:612 -msgid "green" -msgstr "verde" - -#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 -msgid "cyan" -msgstr "" - -#: src/mygal/color-palette.c:614 -msgid "bright blue" -msgstr "" - -#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 -msgid "red purple" -msgstr "" - -#: src/mygal/color-palette.c:616 -msgid "light grey" -msgstr "" - -#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 -msgid "pink" -msgstr "rosa" - -#: src/mygal/color-palette.c:620 -msgid "light orange" -msgstr "" - -#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 -msgid "light yellow" -msgstr "" - -#: src/mygal/color-palette.c:622 -msgid "light green" -msgstr "" - -#: src/mygal/color-palette.c:623 -msgid "light cyan" -msgstr "" - -#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 -msgid "light blue" -msgstr "blu chiaro" - -#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 -msgid "light purple" -msgstr "" - -#: src/mygal/color-palette.c:626 -msgid "white" -msgstr "bianco" - -#: src/mygal/color-palette.c:631 -msgid "purplish blue" -msgstr "" - -#: src/mygal/color-palette.c:635 -msgid "dark purple" -msgstr "" - -#: src/mygal/color-palette.c:637 -msgid "sky blue" -msgstr "" - -#: libglabels/template.c:848 -#, c-format -msgid "Generic %s full page" -msgstr "" - -#: libglabels/template.c:897 -msgid "No template files found!" -msgstr "Nessun modello trovato!" - -#. Create and append an "Other" entry. -#: libglabels/paper.c:67 -msgid "Other" -msgstr "Altro" - -#: libglabels/paper.c:361 -msgid "No paper files found!" -msgstr "Nessun file paper trovato!" - -#: data/ui/glabels-ui.xml.h:1 -msgid "About glabels" -msgstr "Informazioni su glabels" - -#: data/ui/glabels-ui.xml.h:2 -msgid "About..." -msgstr "Informazioni..." - -#: data/ui/glabels-ui.xml.h:3 -msgid "Align _Horizontal" -msgstr "Allineamento orizzontale" - -#: data/ui/glabels-ui.xml.h:4 -msgid "Align _Vertical" -msgstr "Allineamento _verticale" - -#: data/ui/glabels-ui.xml.h:5 -msgid "Align objects to bottoms" -msgstr "Allinea gli oggetti in basso" - -#: data/ui/glabels-ui.xml.h:6 -msgid "Align objects to horizontal centers" -msgstr "Allinea gli oggetti nel centro orizzontale" - -#: data/ui/glabels-ui.xml.h:7 -msgid "Align objects to left edges" -msgstr "" - -#: data/ui/glabels-ui.xml.h:8 -msgid "Align objects to right edges" -msgstr "" - -#: data/ui/glabels-ui.xml.h:9 -msgid "Align objects to tops" -msgstr "" - -#: data/ui/glabels-ui.xml.h:10 -msgid "Align objects to vertical centers" -msgstr "Allinea gli oggetti al centro verticale" - -#: data/ui/glabels-ui.xml.h:12 -msgid "Bold" -msgstr "Grassetto" - -#: data/ui/glabels-ui.xml.h:14 -msgid "Center align" -msgstr "Allineamento centrato" - -#: data/ui/glabels-ui.xml.h:15 -msgid "Center objects to horizontal label center" -msgstr "" - -#: data/ui/glabels-ui.xml.h:16 -msgid "Center objects to vertical label center" -msgstr "" - -#: data/ui/glabels-ui.xml.h:17 -msgid "Change the visibility of markup lines in the current window" -msgstr "" -"Cambia la visibilità delle linee di demarcazione nella finestra corrente" - -#: data/ui/glabels-ui.xml.h:18 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "Cambia la visibilità della barra degli strumenti di disegno nella finestra corrente" - -#: data/ui/glabels-ui.xml.h:19 -msgid "Change the visibility of the grid in the current window" -msgstr "Cambia la visibilità della griglia nella finestra corrente" - -#: data/ui/glabels-ui.xml.h:20 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "Cambia la visibilità della barra degli strumenti principale nella finestra corrente" - -#: data/ui/glabels-ui.xml.h:21 -msgid "Change the visibility of the property toolbar in the current window" -msgstr "" -"Cambia la visibilità della barra degli strumenti principale nella finestra " -"corrente" - -#: data/ui/glabels-ui.xml.h:22 -msgid "Close" -msgstr "Chiudi" - -#: data/ui/glabels-ui.xml.h:23 -msgid "Close the current file" -msgstr "Chiudi il file corrente" - -#: data/ui/glabels-ui.xml.h:24 -msgid "Configure the application" -msgstr "Configura l'applicazione" - -#: data/ui/glabels-ui.xml.h:25 -msgid "Contents" -msgstr "Contenuti" - -#: data/ui/glabels-ui.xml.h:26 -msgid "Copy" -msgstr "Copia" - -#: data/ui/glabels-ui.xml.h:27 -msgid "Copy the selection" -msgstr "Copia la selezione" - -#: data/ui/glabels-ui.xml.h:28 -msgid "Create a custom template" -msgstr "Crea un modello personalizzato" - -#: data/ui/glabels-ui.xml.h:29 -msgid "Create a new document" -msgstr "Crea un nuovo documento" - -#: data/ui/glabels-ui.xml.h:30 -msgid "Create barcode object" -msgstr "Crea oggetto codice a barre" - -#: data/ui/glabels-ui.xml.h:31 -msgid "Create box/rectangle object" -msgstr "Crea oggetto area/rettangolo" - -#: data/ui/glabels-ui.xml.h:32 -msgid "Create ellipse/circle object" -msgstr "Crea oggetto ellisse/cerchio" - -#: data/ui/glabels-ui.xml.h:33 -msgid "Create image object" -msgstr "Crea oggetto immagine" - -#: data/ui/glabels-ui.xml.h:34 -msgid "Create line object" -msgstr "Crea oggetto linea" - -#: data/ui/glabels-ui.xml.h:35 -msgid "Create text object" -msgstr "Crea oggeto testo" - -#: data/ui/glabels-ui.xml.h:36 -msgid "Cu_t" -msgstr "_Taglia" - -#: data/ui/glabels-ui.xml.h:37 -msgid "Customize" -msgstr "Personalizza" - -#: data/ui/glabels-ui.xml.h:38 -msgid "Customize Drawing Toolbar" -msgstr "Personalizza la barra degli strumenti di disegno" - -#: data/ui/glabels-ui.xml.h:39 -msgid "Customize Main Toolbar" -msgstr "Personalizza la barra degli strumenti principale" - -#: data/ui/glabels-ui.xml.h:40 -msgid "Customize Property Toolbar" -msgstr "Personalizza barra degli strumenti proprietà" - -#: data/ui/glabels-ui.xml.h:41 -msgid "Customize toolbars" -msgstr "Personalizza·le·barre degli strumenti" - -#: data/ui/glabels-ui.xml.h:42 -msgid "Cut" -msgstr "Taglia" - -#: data/ui/glabels-ui.xml.h:43 -msgid "Cut the selection" -msgstr "Taglia la selezione" - -#: data/ui/glabels-ui.xml.h:44 -msgid "Decrease magnification" -msgstr "Decrementa ingrandimento" - -#: data/ui/glabels-ui.xml.h:45 -msgid "Delete" -msgstr "Cancella" - -#: data/ui/glabels-ui.xml.h:46 -msgid "Delete the selected objects" -msgstr "Cancella gli oggetti selezionati" - -#: data/ui/glabels-ui.xml.h:47 -msgid "Drawing toolbar" -msgstr "Barra degli strumenti di disegno" - -#: data/ui/glabels-ui.xml.h:48 -msgid "Dump XML" -msgstr "Scarica XML" - -#: data/ui/glabels-ui.xml.h:49 -msgid "Dump the UI Xml description" -msgstr "" - -#: data/ui/glabels-ui.xml.h:50 -msgid "Edit merge properties" -msgstr "Modifica proprietà di unione" - -#: data/ui/glabels-ui.xml.h:54 -msgid "Flip object horizontally" -msgstr "Capovolgi oggetto orizzontalmente" - -#: data/ui/glabels-ui.xml.h:55 -msgid "Flip object vertically" -msgstr "Capovolgi oggetto verticalmente" - -#: data/ui/glabels-ui.xml.h:56 -msgid "Font name" -msgstr "Nome font" - -#: data/ui/glabels-ui.xml.h:57 -msgid "Font selector" -msgstr "Selettore font" - -#: data/ui/glabels-ui.xml.h:58 -msgid "Font size" -msgstr "Dimesione·font" - -#: data/ui/glabels-ui.xml.h:59 -msgid "Icon and _Text" -msgstr "Icone e _Testo" - -#: data/ui/glabels-ui.xml.h:60 -msgid "Increase magnification" -msgstr "Incrementa ingradimento" - -#: data/ui/glabels-ui.xml.h:61 -msgid "Italic" -msgstr "Corsivo" - -#: data/ui/glabels-ui.xml.h:63 -msgid "Left align" -msgstr "Allinea·a·sinistra" - -#: data/ui/glabels-ui.xml.h:65 -msgid "Line width" -msgstr "Larghezza linea" - -#: data/ui/glabels-ui.xml.h:66 -msgid "Lower object to bottom" -msgstr "" - -#: data/ui/glabels-ui.xml.h:67 -msgid "M_arkup" -msgstr "" - -#: data/ui/glabels-ui.xml.h:68 -msgid "Main toolbar" -msgstr "Barra degli strumenti principale" - -#: data/ui/glabels-ui.xml.h:69 -msgid "Markup" -msgstr "Marcatori" - -#: data/ui/glabels-ui.xml.h:70 -msgid "Modify document properties" -msgstr "Modifica le proprietà del documento" - -#: data/ui/glabels-ui.xml.h:71 -msgid "New" -msgstr "Nuovo" - -#: data/ui/glabels-ui.xml.h:72 -msgid "Object property editor" -msgstr "Editor delle proprietà per l'oggetto" - -#: data/ui/glabels-ui.xml.h:73 -msgid "Only show icons in the main toolbar" -msgstr "Visualizza solo le icone nella barra degli strumenti principale" - -#: data/ui/glabels-ui.xml.h:75 -msgid "Open a file" -msgstr "Apri un file" - -#: data/ui/glabels-ui.xml.h:76 -msgid "Open the glabels manual" -msgstr "Apri il manuale di glabels" - -#: data/ui/glabels-ui.xml.h:77 -msgid "Paste" -msgstr "Incolla" - -#: data/ui/glabels-ui.xml.h:78 -msgid "Paste the clipboard" -msgstr "Incolla gli appunti" - -#: data/ui/glabels-ui.xml.h:79 -msgid "Pr_eferences..." -msgstr "Pr_eferenze..." - -#: data/ui/glabels-ui.xml.h:80 -msgid "Preferences" -msgstr "Preferenze" - -#: data/ui/glabels-ui.xml.h:82 -msgid "Print the current file" -msgstr "Stampa il file corrente" - -#: data/ui/glabels-ui.xml.h:83 -msgid "Proper_ties..." -msgstr "Proprie_tà..." - -#: data/ui/glabels-ui.xml.h:84 -msgid "Properties" -msgstr "Proprietà" - -#: data/ui/glabels-ui.xml.h:85 -msgid "Property toolbar" -msgstr "Proprietà della barra degli strumenti" - -#: data/ui/glabels-ui.xml.h:86 -msgid "Quit" -msgstr "Esci" - -#: data/ui/glabels-ui.xml.h:87 -msgid "Quit the program" -msgstr "Esci dal programma" - -#: data/ui/glabels-ui.xml.h:88 -msgid "Raise object to top" -msgstr "" - -#: data/ui/glabels-ui.xml.h:89 -msgid "Recent _Files" -msgstr "_File Recenti" - -#: data/ui/glabels-ui.xml.h:90 -msgid "Redo" -msgstr "Ripeti" - -#: data/ui/glabels-ui.xml.h:91 -msgid "Redo the undone action" -msgstr "" - -#: data/ui/glabels-ui.xml.h:92 -msgid "Remove all selections" -msgstr "Rimuovi tutte le selezioni" - -#: data/ui/glabels-ui.xml.h:94 -#, no-c-format -msgid "Restore scale to 100%" -msgstr "Ripristina la scala al 100%" - -#: data/ui/glabels-ui.xml.h:95 -msgid "Right align" -msgstr "Allineamento a destra" - -#: data/ui/glabels-ui.xml.h:98 -msgid "Rotate object 90 clockwise" -msgstr "Ruota l'oggetto di 90° in verso orario" - -#: data/ui/glabels-ui.xml.h:99 -msgid "Rotate object 90 counter-clockwise" -msgstr "Ruota l'oggetto di 90° in verso antiorario" - -#: data/ui/glabels-ui.xml.h:100 -msgid "Save" -msgstr "Salva" - -#: data/ui/glabels-ui.xml.h:101 -msgid "Save As" -msgstr "Salva con nome" - -#: data/ui/glabels-ui.xml.h:102 -msgid "Save _As..." -msgstr "Salva _con nome..." - -#: data/ui/glabels-ui.xml.h:103 -msgid "Save the current file" -msgstr "Salva il file corrente" - -#: data/ui/glabels-ui.xml.h:104 -msgid "Save the current file with a different name" -msgstr "Salva il file corrente con un nome differente" - -#: data/ui/glabels-ui.xml.h:105 -msgid "Select All" -msgstr "Seleziona tutto" - -#: data/ui/glabels-ui.xml.h:106 -msgid "Select _All" -msgstr "Seleziona tutto" - -#: data/ui/glabels-ui.xml.h:107 -msgid "Select all objects" -msgstr "Seleziona tutti gli oggetti" - -#: data/ui/glabels-ui.xml.h:108 -msgid "Select, move and modify objects" -msgstr "Seleziona, muovi e modifica oggetti" - -#: data/ui/glabels-ui.xml.h:110 -msgid "Set main toolbar button style according to desktop default" -msgstr "" - -#: data/ui/glabels-ui.xml.h:111 -msgid "Show _Tooltips" -msgstr "Mostra suggerimenti" - -#: data/ui/glabels-ui.xml.h:112 -msgid "Show both icons and texts in the main toolbar" -msgstr "Mostra icone e testo nella barra degli strumenti principale" - -#: data/ui/glabels-ui.xml.h:113 -msgid "Show tooltips in the drawing toolbar" -msgstr "Mostra suggerimenti nella barra degli strumenti di disegno" - -#: data/ui/glabels-ui.xml.h:114 -msgid "Show tooltips in the main toolbar" -msgstr "Mostra suggerimenti nella barra degli strumenti principale" - -#: data/ui/glabels-ui.xml.h:115 -msgid "Show tooltips in the property toolbar" -msgstr "Mostra suggerimenti nella barra degli strumenti principale" - -#: data/ui/glabels-ui.xml.h:116 -msgid "Template Designer" -msgstr "Progettazione modelli" - -#: data/ui/glabels-ui.xml.h:117 -msgid "Template _Designer..." -msgstr "" - -#: data/ui/glabels-ui.xml.h:118 -msgid "Text color" -msgstr "Colore testo" - -#: data/ui/glabels-ui.xml.h:119 -msgid "U_n-select All" -msgstr "Deseleziona tutto" - -#: data/ui/glabels-ui.xml.h:120 -msgid "Un-select All" -msgstr "Deseleziona·tutto" - -#: data/ui/glabels-ui.xml.h:121 -msgid "Undo" -msgstr "Annulla" - -#: data/ui/glabels-ui.xml.h:122 -msgid "Undo the last action" -msgstr "Annulla l'ultima azione" - -#: data/ui/glabels-ui.xml.h:123 -msgid "Zoom _1:1" -msgstr "Zoom _1:1" - -#: data/ui/glabels-ui.xml.h:124 -msgid "Zoom _In" -msgstr "Zoom _in avanti" - -#: data/ui/glabels-ui.xml.h:125 -msgid "Zoom _Out" -msgstr "Zo_om indietro" - -#: data/ui/glabels-ui.xml.h:126 -msgid "Zoom to _fit" -msgstr "Adatta" - -#: data/ui/glabels-ui.xml.h:127 -msgid "Zoom to fit window" -msgstr "Adatta alla finestra" - -#: data/ui/glabels-ui.xml.h:128 -msgid "_About..." -msgstr "Informazioni..." - -#: data/ui/glabels-ui.xml.h:129 -msgid "_Bottoms" -msgstr "In basso" - -#: data/ui/glabels-ui.xml.h:132 -msgid "_Close" -msgstr "_Chiudi" - -#: data/ui/glabels-ui.xml.h:133 -msgid "_Contents" -msgstr "_Contenuti" - -#: data/ui/glabels-ui.xml.h:134 -msgid "_Copy" -msgstr "_Copia" - -#: data/ui/glabels-ui.xml.h:135 -msgid "_Create Object" -msgstr "_Crea Oggetto" - -#: data/ui/glabels-ui.xml.h:136 -msgid "_Debug" -msgstr "_Debug" - -#: data/ui/glabels-ui.xml.h:138 -msgid "_Desktop Default" -msgstr "Predefinito del desktop" - -#: data/ui/glabels-ui.xml.h:139 -msgid "_Drawing Toolbar" -msgstr "Barra degli strumenti di disegno" - -#: data/ui/glabels-ui.xml.h:140 -msgid "_Edit" -msgstr "_Modifica" - -#: data/ui/glabels-ui.xml.h:142 -msgid "_File" -msgstr "_File" - -#: data/ui/glabels-ui.xml.h:143 -msgid "_Grid" -msgstr "_Griglia" - -#: data/ui/glabels-ui.xml.h:144 -msgid "_Help" -msgstr "_Aiuto" - -#: data/ui/glabels-ui.xml.h:145 -msgid "_Icon" -msgstr "_Icone" - -#: data/ui/glabels-ui.xml.h:149 -msgid "_Main Toolbar" -msgstr "Barra degli stru_menti principale" - -#: data/ui/glabels-ui.xml.h:150 -msgid "_Merge Properties..." -msgstr "Proprietà di unione..." - -#: data/ui/glabels-ui.xml.h:151 -msgid "_New" -msgstr "_Nuovo" - -#: data/ui/glabels-ui.xml.h:152 -msgid "_Objects" -msgstr "_Oggetti" - -#: data/ui/glabels-ui.xml.h:153 -msgid "_Open..." -msgstr "_Apri..." - -#: data/ui/glabels-ui.xml.h:155 -msgid "_Paste" -msgstr "Incolla" - -#: data/ui/glabels-ui.xml.h:156 -msgid "_Print..." -msgstr "Stampa..." - -#: data/ui/glabels-ui.xml.h:157 -msgid "_Property Toolbar" -msgstr "Barra degli strumenti _proprietà" - -#: data/ui/glabels-ui.xml.h:158 -msgid "_Quit" -msgstr "_Esci" - -#: data/ui/glabels-ui.xml.h:161 -msgid "_Save" -msgstr "_Salva" - -#: data/ui/glabels-ui.xml.h:165 -msgid "_View" -msgstr "_Visualizza" - -#: data/glade/prefs-dialog.glade.h:1 -msgid " " -msgstr "" - -#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 -#: data/glade/template-designer.glade.h:5 -msgid "*" -msgstr "*" - -#: data/glade/prefs-dialog.glade.h:3 -msgid "Default page size" -msgstr "Dimensione pagina predefinita" - -#: data/glade/prefs-dialog.glade.h:4 -msgid "Fill" -msgstr "Riempimento" - -#: data/glade/prefs-dialog.glade.h:5 -msgid "Line" -msgstr "Linea" - -#: data/glade/prefs-dialog.glade.h:6 -msgid "Text" -msgstr "Testo" - -#: data/glade/prefs-dialog.glade.h:7 -msgid "Units" -msgstr "Unità" - -#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 -msgid "Alignment:" -msgstr "Allineamento:" - -#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 -msgid "Color:" -msgstr "Colore:" - -#: data/glade/prefs-dialog.glade.h:10 -msgid "Font:" -msgstr "Carattere:" - -#: data/glade/prefs-dialog.glade.h:11 -msgid "ISO A4" -msgstr "ISO A4" - -#: data/glade/prefs-dialog.glade.h:12 -msgid "Inches" -msgstr "Pollici" - -#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 -msgid "Line Spacing:" -msgstr "Spaziatura:" - -#: data/glade/prefs-dialog.glade.h:14 -msgid "Locale" -msgstr "Impostazioni nazionali" - -#: data/glade/prefs-dialog.glade.h:15 -msgid "Millimeters" -msgstr "Millimetri" - -#: data/glade/prefs-dialog.glade.h:16 -msgid "Object defaults" -msgstr "Proprietà oggetto" - -#: data/glade/prefs-dialog.glade.h:17 -msgid "Points" -msgstr "Punti" - -#: data/glade/prefs-dialog.glade.h:18 -msgid "Select default properties for new objects." -msgstr "Seleziona le proprietà predefinite per i nuovi oggetti." - -#: data/glade/prefs-dialog.glade.h:19 -msgid "Select locale specific behavior." -msgstr "" - -#. Most popular (at top of list) -#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:29 -msgid "US Letter" -msgstr "US·Letter" - -#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 -#: data/glade/template-designer.glade.h:72 -msgid "Width:" -msgstr "Larghezza:" - -#: data/glade/object-editor.glade.h:2 -msgid "00000000000 00000" -msgstr "" - -#: data/glade/object-editor.glade.h:3 -msgid "Xxx object properties" -msgstr "" - -#: data/glade/object-editor.glade.h:5 -msgid "Allow merge to automatically shrink text" -msgstr "" - -#: data/glade/object-editor.glade.h:6 -msgid "Angle:" -msgstr "Angolo:" - -#: data/glade/object-editor.glade.h:7 -msgid "Checksum" -msgstr "Checksum" - -#: data/glade/object-editor.glade.h:10 -msgid "Family:" -msgstr "Famiglia:" - -#: data/glade/object-editor.glade.h:12 -msgid "Fill" -msgstr "Riempimento" - -#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 -msgid "Height:" -msgstr "Altezza:" - -#: data/glade/object-editor.glade.h:14 -msgid "Image" -msgstr "Immagine" - -#: data/glade/object-editor.glade.h:15 -msgid "Insert merge field" -msgstr "Inserisci campo unione" - -#: data/glade/object-editor.glade.h:17 -msgid "Length:" -msgstr "Lunghezza:" - -#: data/glade/object-editor.glade.h:18 -msgid "Line" -msgstr "Linea" - -#: data/glade/object-editor.glade.h:20 -msgid "Literal:" -msgstr "Letterale:" - -#: data/glade/object-editor.glade.h:21 -msgid "Load image" -msgstr "Carica immagine" - -#: data/glade/object-editor.glade.h:22 -msgid "Position" -msgstr "Posizione" - -#: data/glade/object-editor.glade.h:23 -msgid "Reset image size" -msgstr "Ripristina dimensioni immagine" - -#: data/glade/object-editor.glade.h:24 -msgid "Size" -msgstr "Dimensioni" - -#: data/glade/object-editor.glade.h:25 -msgid "Size:" -msgstr "Dimensione:" - -#: data/glade/object-editor.glade.h:26 -msgid "Style" -msgstr "Stile" - -#: data/glade/object-editor.glade.h:27 -msgid "Style:" -msgstr "Stile:" - -#: data/glade/object-editor.glade.h:30 -msgid "X:" -msgstr "X:" - -#: data/glade/object-editor.glade.h:31 -msgid "Y:" -msgstr "Y:" - -#: data/glade/object-editor.glade.h:32 -msgid "degrees" -msgstr "gradi" - -#: data/glade/object-editor.glade.h:33 -msgid "dialog1" -msgstr "" - -#: data/glade/object-editor.glade.h:34 -msgid "digits:" -msgstr "cifre:" - -#: data/glade/object-editor.glade.h:35 -msgid "format:" -msgstr "formato:" - -#: data/glade/template-designer.glade.h:1 -msgid " " -msgstr "" - -#: data/glade/template-designer.glade.h:2 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "(es., \"Etichette di spedizione,\" \"Biglietti da visita,\" ...)" - -#: data/glade/template-designer.glade.h:3 -msgid "(e.g., 8163A)" -msgstr "(es. 8163A)" - -#: data/glade/template-designer.glade.h:4 -msgid "(e.g., Avery, Acme, ...)" -msgstr "(es. Avery, Acme, ...)" - -#: data/glade/template-designer.glade.h:6 -msgid "1. Outer radius:" -msgstr "1. raggio esterno:" - -#: data/glade/template-designer.glade.h:7 -msgid "1. Radius:" -msgstr "Raggio:" - -#: data/glade/template-designer.glade.h:8 -msgid "1. Width:" -msgstr "1. Larghezza:" - -#: data/glade/template-designer.glade.h:9 -msgid "2. Height:" -msgstr "2. Altezza:" - -#: data/glade/template-designer.glade.h:10 -msgid "2. Inner radius:" -msgstr "2. raggio interno:" - -#: data/glade/template-designer.glade.h:11 -msgid "2. Waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:12 -msgid "3. Clipping width:" -msgstr "" - -#: data/glade/template-designer.glade.h:13 -msgid "3. Margin" -msgstr "3. Margine" - -#: data/glade/template-designer.glade.h:14 -msgid "3. Round (radius of corner):" -msgstr "" - -#: data/glade/template-designer.glade.h:15 -msgid "4. Clipping height:" -msgstr "" - -#: data/glade/template-designer.glade.h:16 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:17 -msgid "5. Vert. waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:18 -msgid "5. Waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:19 -msgid "6. Margin" -msgstr "6. Margine" - -#: data/glade/template-designer.glade.h:20 -msgid "Brand/Manufacturer:" -msgstr "Marca/Produttore:" - -#: data/glade/template-designer.glade.h:21 -msgid "CD/DVD (including credit card CDs)" -msgstr "CD/DVD (inclusa copertina dei ringraziamenti)" - -#: data/glade/template-designer.glade.h:22 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "Congratulazioni!\n" -"\n" -"Hai completato il gLabels Template Designer.\n" -"Se vuoi salvare il tuo progetto fai clic su \"Applica\".\n" -"\n" -"In caso contrario, fai clic su \"Cancella\" per abbandonare\n" -"il tuo progetto o \"Indietro\" per continuare la progettazione." - -#: data/glade/template-designer.glade.h:30 -msgid "Design Completed" -msgstr "Progettazione completata" - -#: data/glade/template-designer.glade.h:31 -msgid "Distance from left edge (x0):" -msgstr "Distanza dal bordo sinistro (x0):" - -#: data/glade/template-designer.glade.h:32 -msgid "Distance from top edge (y0):" -msgstr "Distanza dal bordo in alto (y0):" - -#: data/glade/template-designer.glade.h:34 -msgid "Horizontal pitch (dx):" -msgstr "" - -#: data/glade/template-designer.glade.h:35 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" - -#: data/glade/template-designer.glade.h:40 -msgid "Label Size (CD/DVD)" -msgstr "Dimensione etichetta (CD/DVD)" - -#: data/glade/template-designer.glade.h:41 -msgid "Label Size (Round)" -msgstr "Dimensioni etichetta" - -#: data/glade/template-designer.glade.h:42 -msgid "Label or Card Shape" -msgstr "Forma dell'etichetta o della scheda" - -#: data/glade/template-designer.glade.h:43 -msgid "Label or Card Size (Rectangular)" -msgstr "" - -#: data/glade/template-designer.glade.h:44 -msgid "Layout #1" -msgstr "Layout #1" - -#: data/glade/template-designer.glade.h:45 -msgid "Layout #2" -msgstr "Layout #2" - -#: data/glade/template-designer.glade.h:46 -msgid "Layout(s)" -msgstr "Layout" - -#: data/glade/template-designer.glade.h:47 -msgid "Name and Description" -msgstr "Nome e descrizione" - -#: data/glade/template-designer.glade.h:48 -msgid "Number across (nx):" -msgstr "" - -#: data/glade/template-designer.glade.h:49 -msgid "Number down (ny):" -msgstr "" - -#: data/glade/template-designer.glade.h:50 -msgid "Number of Layouts" -msgstr "Numero di layout" - -#: data/glade/template-designer.glade.h:51 -msgid "Number of layouts:" -msgstr "Numero di layout:" - -#: data/glade/template-designer.glade.h:52 -msgid "Page Size" -msgstr "Dimensione pagina" - -#: data/glade/template-designer.glade.h:54 -msgid "Part #:" -msgstr "Parte #:" - -#: data/glade/template-designer.glade.h:55 -msgid "" -"Please enter the following identifying information about the template " -"stationery." -msgstr "" - -#: data/glade/template-designer.glade.h:56 -msgid "Please enter the following layout information." -msgstr "Per piacere, inserisci le seguenti informazioni." - -#: data/glade/template-designer.glade.h:57 -msgid "" -"Please enter the following size parameters of a single label in your " -"template." -msgstr "" - -#: data/glade/template-designer.glade.h:58 -msgid "" -"Please enter the following size parameters of a single label or card in your " -"template." -msgstr "" - -#: data/glade/template-designer.glade.h:59 -msgid "Please select the basic shape of the labels or cards." -msgstr "" - -#: data/glade/template-designer.glade.h:60 -msgid "Please select the page size of the template stationery." -msgstr "" - -#: data/glade/template-designer.glade.h:61 -msgid "Print test sheet" -msgstr "Stampa foglio di prova" - -#: data/glade/template-designer.glade.h:62 -msgid "Rectangular or square (can have rounded corners)" -msgstr "" - -#: data/glade/template-designer.glade.h:63 -msgid "Round" -msgstr "Rotonda" - -#: data/glade/template-designer.glade.h:64 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" - -#: data/glade/template-designer.glade.h:66 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" - -#: data/glade/template-designer.glade.h:68 -msgid "Vertical pitch (dy):" -msgstr "" - -#: data/glade/template-designer.glade.h:69 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" - -#. Other ISO A series sizes -#: data/templates/paper-sizes.xml.h:2 -msgid "A0" -msgstr "A0" - -#: data/templates/paper-sizes.xml.h:3 -msgid "A1" -msgstr "A1" - -#: data/templates/paper-sizes.xml.h:4 -msgid "A10" -msgstr "A10" - -#: data/templates/paper-sizes.xml.h:5 -msgid "A2" -msgstr "A2" - -#: data/templates/paper-sizes.xml.h:6 -msgid "A3" -msgstr "A3" - -#: data/templates/paper-sizes.xml.h:7 -msgid "A4" -msgstr "A4" - -#: data/templates/paper-sizes.xml.h:8 -msgid "A5" -msgstr "A5" - -#: data/templates/paper-sizes.xml.h:9 -msgid "A6" -msgstr "A6" - -#: data/templates/paper-sizes.xml.h:10 -msgid "A7" -msgstr "A7" - -#: data/templates/paper-sizes.xml.h:11 -msgid "A8" -msgstr "A8" - -#: data/templates/paper-sizes.xml.h:12 -msgid "A9" -msgstr "A9" - -#. ISO B series sizes -#: data/templates/paper-sizes.xml.h:14 -msgid "B0" -msgstr "B0" - -#: data/templates/paper-sizes.xml.h:15 -msgid "B1" -msgstr "B1" - -#: data/templates/paper-sizes.xml.h:16 -msgid "B10" -msgstr "B10" - -#: data/templates/paper-sizes.xml.h:17 -msgid "B2" -msgstr "B2" - -#: data/templates/paper-sizes.xml.h:18 -msgid "B3" -msgstr "B3" - -#: data/templates/paper-sizes.xml.h:19 -msgid "B4" -msgstr "B4" - -#: data/templates/paper-sizes.xml.h:20 -msgid "B5" -msgstr "B5" - -#: data/templates/paper-sizes.xml.h:21 -msgid "B6" -msgstr "B6" - -#: data/templates/paper-sizes.xml.h:22 -msgid "B7" -msgstr "B7" - -#: data/templates/paper-sizes.xml.h:23 -msgid "B8" -msgstr "B8" - -#: data/templates/paper-sizes.xml.h:24 -msgid "B9" -msgstr "B9" - -#: data/templates/paper-sizes.xml.h:25 -msgid "US Executive" -msgstr "US Executive" - -#. Other US paper sizes -#: data/templates/paper-sizes.xml.h:27 -msgid "US Legal" -msgstr "US Legale" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:2 -#: data/templates/zweckform-iso-templates.xml.h:2 -msgid "Address Labels" -msgstr "Etichette di indirizzo" - -#. =================================================================== -#. ============================================================ -#. =================================================================== -#. ====================================================== -#: data/templates/avery-us-templates.xml.h:4 -#: data/templates/avery-iso-templates.xml.h:4 -#: data/templates/zweckform-iso-templates.xml.h:6 -#: data/templates/misc-us-templates.xml.h:3 -#: data/templates/misc-iso-templates.xml.h:17 -msgid "Business Cards" -msgstr "Biglietti da visita" - -#: data/templates/avery-us-templates.xml.h:5 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "Etichette CD/DVD (Etichette Dischi)" - -#: data/templates/avery-us-templates.xml.h:6 -msgid "CD/DVD Labels (Spine Labels)" -msgstr "Etichette CD/DVD (Etichette dischi)" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:8 -msgid "Diskette Labels" -msgstr "Etichette per floppy" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:10 -msgid "Filing Labels" -msgstr "" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:12 -msgid "Full Sheet Labels" -msgstr "Pagina piena di etichette" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:14 -msgid "Large Round Labels" -msgstr "Etichetta con bordi arrotondati" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:16 -msgid "Name Badge Labels" -msgstr "" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:18 -msgid "Return Address Labels" -msgstr "Etichette con indirizzo del mittente" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:20 -msgid "Shipping Labels" -msgstr "Etichette di spedizione" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:22 -msgid "Small Round Labels" -msgstr "Etichette piccole con bordi arrotondati" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:24 -msgid "Square Labels" -msgstr "Etichette quadrate" - -#: data/templates/avery-us-templates.xml.h:25 -msgid "Video Tape Face Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:26 -msgid "Video Tape Spine Labels" -msgstr "" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:2 -msgid "Address labels" -msgstr "Etichette per indirizzo" - -#. =============================================================== -#: data/templates/avery-iso-templates.xml.h:6 -msgid "CD Booklet" -msgstr "CD Booklet" - -#. =============================================================== -#: data/templates/avery-iso-templates.xml.h:8 -msgid "CD Inlet" -msgstr "CD Inlet" - -#. =============================================================== -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:10 -#: data/templates/zweckform-iso-templates.xml.h:8 -#: data/templates/misc-us-templates.xml.h:5 -#: data/templates/misc-iso-templates.xml.h:21 -msgid "CD/DVD Labels" -msgstr "Etichette CD/DVD" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:12 -msgid "Diskette labels" -msgstr "" - -#. =============================================================== -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:14 -#: data/templates/zweckform-iso-templates.xml.h:14 -#: data/templates/misc-iso-templates.xml.h:35 -msgid "Mailing Labels" -msgstr "Etichette di spedizione" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:16 -msgid "Mailing labels" -msgstr "" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:18 -msgid "Mini Address Labels" -msgstr "Etichette Mini-indirizzo" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:20 -msgid "Shipping labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:4 -msgid "Allround Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:10 -msgid "Correction and Cover-up Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:12 -msgid "Lever Arch File Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:16 -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:18 -msgid "Rectangular Copier Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:20 -#: data/templates/misc-iso-templates.xml.h:44 -msgid "Rectangular Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:22 -msgid "Video Labels (back)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:1 -msgid "Business Card CD" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:4 -msgid "CD Template Rectangles" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:6 -msgid "CD/DVD Labels (Face Only)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:7 -#: data/templates/misc-iso-templates.xml.h:23 -msgid "CD/DVD Labels (face only)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:9 -msgid "Cassette Labels" -msgstr "Etichette per cassette" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:11 -msgid "DLT Labels" -msgstr "Etichette DLT" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:13 -msgid "Microtube labels" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:14 -msgid "Mini-CD Labels" -msgstr "Etichette Mini-CD" - -#: data/templates/misc-us-templates.xml.h:15 -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:16 -msgid "PRO CD Labels 2-up (Face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:17 -#: data/templates/misc-iso-templates.xml.h:42 -msgid "PRO CD Labels 2-up (face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:18 -msgid "Slimline CD Case (rightside up)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:19 -msgid "Slimline CD Case (upside down)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:1 -msgid "Agipa 119488: Business Cards" -msgstr "Agipa 119488: biglietti da visita" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:3 -msgid "Allround Labels --24" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:5 -msgid "Allround Labels --44" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:7 -msgid "Allround Labels --64" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:9 -msgid "Allround Labels --65" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:11 -msgid "Arch File Labels" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:13 -msgid "Arch File Labels (large)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:15 -msgid "Arch File Labels (small)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:19 -msgid "CD Labels" -msgstr "Etichette CD" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:25 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:27 -msgid "Diskette Labels (face only)" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:29 -msgid "EPSON Photo Stickers 16" -msgstr "EPSON Photo Stickers 16" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:31 -msgid "Etiketten" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:33 -msgid "Fridge Magnet Stickers" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:37 -msgid "Mailing Labels --14" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:39 -msgid "Mailing Labels-2 columns" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:41 -msgid "Mailing Labels-3 columns" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:46 -msgid "Video Labels (face only)" -msgstr "Etichette video (solo frontespizio)" - -#: data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers" -msgstr "Crea etichette, biglietti da visita e copertine" - -#: data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "gLabels Designer di etichetta" - -#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 -msgid "gLabels Project File" -msgstr "File di progetto di gLabels" - diff --git a/glabels2/po/ja.po b/glabels2/po/ja.po deleted file mode 100644 index 08b6b3d1..00000000 --- a/glabels2/po/ja.po +++ /dev/null @@ -1,2457 +0,0 @@ -# glabels ja.po -# Copyright (C) 2001-2004 Free Software Foundation, Inc. -# Takeshi Aihana , 2001-2004. -# -msgid "" -msgstr "" -"Project-Id-Version: glabels 2.0.0\n" -"POT-Creation-Date: 2004-08-15 18:13-0400\n" -"PO-Revision-Date: 2004-08-11 08:44+0900\n" -"Last-Translator: Takeshi AIHANA \n" -"Language-Team: Japanese \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: src/glabels.c:55 -msgid "Show view debugging messages." -msgstr "表示のデバッグ・メッセージを表示する" - -#: src/glabels.c:58 -msgid "Show item debugging messages." -msgstr "アイテムのデバッグ・メッセージを表示する" - -#: src/glabels.c:61 -msgid "Show printing debugging messages." -msgstr "印刷のデバッグ・メッセージを表示する" - -#: src/glabels.c:64 -msgid "Show prefs debugging messages." -msgstr "設定のデバッグ・メッセージを表示する" - -#: src/glabels.c:67 -msgid "Show file debugging messages." -msgstr "ファイルのデバッグ・メッセージを表示する" - -#: src/glabels.c:70 -msgid "Show document debugging messages." -msgstr "ドキュメントのデバッグ・メッセージを表示する" - -#: src/glabels.c:73 -msgid "Show template debugging messages." -msgstr "テンプレートのデバッグ・メッセージを表示する" - -#: src/glabels.c:76 -msgid "Show paper debugging messages." -msgstr "設定の用紙のデバッグ・メッセージを表示する" - -#: src/glabels.c:79 -msgid "Show xml debugging messages." -msgstr "XML のデバッグ・メッセージを表示する" - -#: src/glabels.c:82 -msgid "Show document merge debugging messages." -msgstr "ドキュメント結合のデバッグ・メッセージを表示する" - -#: src/glabels.c:85 -msgid "Show commands debugging messages." -msgstr "コマンドのデバッグ・メッセージを表示する" - -#: src/glabels.c:88 -msgid "Show undo debugging messages." -msgstr "Undo のデバッグ・メッセージを表示する" - -#: src/glabels.c:91 -msgid "Show recent debugging messages." -msgstr "最近開いたファイルのデバッグ・メッセージを表示する" - -#: src/glabels.c:94 -msgid "Show window debugging messages." -msgstr "ウィンドウのデバッグ・メッセージを表示する" - -#: src/glabels.c:97 -msgid "Show ui debugging messages." -msgstr "GUI のデバッグ・メッセージを表示する" - -#: src/glabels.c:100 -msgid "Show property_bar debugging messages." -msgstr "設定バーのデバッグ・メッセージを表示する" - -#: src/glabels.c:103 -msgid "Show media select widget debugging messages." -msgstr "メディア選択ウィジットのデバッグ・メッセージを表示する" - -#: src/glabels.c:106 -msgid "Show mini preview widget debugging messages." -msgstr "プレビュー・ウィジットのデバッグ・メッセージを表示する" - -#: src/glabels.c:109 -msgid "Show pixbuf cache debugging messages." -msgstr "pixbuf cache のデバッグ・メッセージを表示する" - -#: src/glabels.c:112 -msgid "Show widget debugging messages." -msgstr "ウィジットのデバッグ・メッセージを表示する" - -#: src/glabels.c:115 -msgid "Show object editor debugging messages." -msgstr "オブジェクト・エディタのデバッグメッセージを表示する" - -#: src/glabels.c:118 -msgid "Turn on all debugging messages." -msgstr "全てのデバッグ・メッセージを表示する" - -#: src/glabels.c:187 -msgid "Could not initialize Bonobo!\n" -msgstr "Bonobo を初期化することができませんでした!\n" - -#: src/glabels-batch.c:48 -msgid "print this message" -msgstr "このメッセージを表示する" - -#: src/glabels-batch.c:50 -msgid "print the version of glabels-batch being used" -msgstr "使用している gLabel のバージョンを表示する" - -#: src/glabels-batch.c:52 -msgid "set output filename (default=\"output.ps\")" -msgstr "出力するファイル名を指定する (デフォルト = \"output.ps\")" - -#: src/glabels-batch.c:52 -msgid "filename" -msgstr "ファイル名" - -#: src/glabels-batch.c:54 -msgid "number of sheets (default=1)" -msgstr "用紙の数 (デフォルト = 1)" - -#: src/glabels-batch.c:54 -msgid "sheets" -msgstr "用紙の数" - -#: src/glabels-batch.c:56 -msgid "number of copies (default=1)" -msgstr "コピーの数 (デフォルト = 1)" - -#: src/glabels-batch.c:56 -msgid "copies" -msgstr "コピーの数" - -#: src/glabels-batch.c:58 src/print-dialog.c:336 -msgid "print outlines (to test printer alignment)" -msgstr "アウトラインを印刷する (印刷時の配置を確認するため)" - -#: src/glabels-batch.c:60 src/print-dialog.c:344 -msgid "print in reverse (i.e. a mirror image)" -msgstr "(画像をミラーするように) 反転して印刷する" - -#: src/glabels-batch.c:96 -msgid "[OPTION...] GLABELS_FILE..." -msgstr "[オプション...] ファイル名..." - -#: src/glabels-batch.c:116 -#, c-format -msgid "missing glabels file\n" -msgstr "gLabel で使用するファイルがありません\n" - -#: src/glabels-batch.c:157 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "gLabel で使用するファイル %s が開けません\n" - -#: src/window.c:244 -msgid "(none) - gLabels" -msgstr "(なし) - gLabels" - -#: src/window.c:414 -msgid "(modified)" -msgstr "(変更済み)" - -#: src/stock.c:65 data/ui/glabels-ui.xml.h:165 -msgid "_Select Mode" -msgstr "選択モード(_S)" - -#: src/stock.c:66 data/ui/glabels-ui.xml.h:166 -msgid "_Text" -msgstr "文字(_T)" - -#: src/stock.c:67 data/ui/glabels-ui.xml.h:151 -msgid "_Line" -msgstr "直線(_L)" - -#: src/stock.c:68 data/ui/glabels-ui.xml.h:133 -msgid "_Box" -msgstr "矩形(_B)" - -#: src/stock.c:69 data/ui/glabels-ui.xml.h:144 -msgid "_Ellipse" -msgstr "楕円(_E)" - -#: src/stock.c:70 data/ui/glabels-ui.xml.h:149 -msgid "_Image" -msgstr "画像(_I)" - -#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 -msgid "Bar_code" -msgstr "バーコード(_C)" - -#: src/stock.c:72 -msgid "_Merge Properties" -msgstr "結合プロパティ(_M)" - -#: src/stock.c:73 -msgid "Object _Properties" -msgstr "オブジェクトのプロパティ(_P)" - -#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 -msgid "Bring to _Front" -msgstr "前に持ってくる(_F)" - -#: src/stock.c:75 data/ui/glabels-ui.xml.h:110 -msgid "Send to _Back" -msgstr "後ろにまわす(_B)" - -#: src/stock.c:76 data/ui/glabels-ui.xml.h:97 -msgid "Rotate _Left" -msgstr "左に回転(_L)" - -#: src/stock.c:77 data/ui/glabels-ui.xml.h:98 -msgid "Rotate _Right" -msgstr "右に回転(_R)" - -#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 -msgid "Flip _Horizontally" -msgstr "水平方向にフリップ(_H)" - -#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 -msgid "Flip _Vertically" -msgstr "垂直方向にフリップ(_V)" - -#: src/stock.c:80 data/ui/glabels-ui.xml.h:150 -msgid "_Lefts" -msgstr "左端(_L)" - -#: src/stock.c:81 data/ui/glabels-ui.xml.h:162 -msgid "_Rights" -msgstr "右端(_R)" - -#: src/stock.c:82 data/ui/glabels-ui.xml.h:134 -msgid "_Centers" -msgstr "中央(_C)" - -#: src/stock.c:83 data/ui/glabels-ui.xml.h:167 -msgid "_Tops" -msgstr "上端(_T)" - -#: src/stock.c:84 -msgid "Bottoms" -msgstr "下部" - -#: src/stock.c:85 -msgid "Centers" -msgstr "中央" - -#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 -msgid "Label Ce_nter" -msgstr "ラベルの中心(_N)" - -#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 -msgid "Fill color" -msgstr "色で塗りつぶします" - -#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 -msgid "Line color" -msgstr "線の色を選択します" - -#: src/stock.c:90 src/stock.c:92 -msgid "Linked" -msgstr "結合済" - -#: src/stock.c:91 src/stock.c:93 -msgid "Not Linked" -msgstr "結合なし" - -#: src/ui-property-bar.c:345 src/object-editor.c:499 -msgid "Default" -msgstr "デフォルト" - -#: src/ui-property-bar.c:360 src/object-editor.c:512 -msgid "No fill" -msgstr "塗りつぶさない" - -#: src/ui-property-bar.c:375 src/object-editor.c:505 -msgid "No line" -msgstr "線を消す" - -#: src/ui-sidebar.c:180 -msgid "Object properties" -msgstr "オブジェクトのプロパティ" - -#: src/commands.c:385 -msgid "" -"A label and business card creation program for GNOME.\n" -" \n" -"Glabels is free software; you can redistribute it and/or modify it under the " -"terms of the GNU General Public License as published by the Free Software " -"Foundation; either version 2 of the License, or (at your option) any later " -"version.\n" -" \n" -"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.\n" -msgstr "" -"GNOME 向けのラベル/ビジネスカードの作成プログラムです。\n" -"\n" -"Glabels はフリーソフトです。フリーソフトウェア財団が定める GNU 一般公有使用許" -"諾契約書の第2版もしくはそれ以降のバージョンの下で複製、改編、再配布が認められ" -"ています。\n" -"\n" -"このプログラムが役に立つことを望む中で配布されていますが、完全無保証です。販" -"売目的または商用目的の保証はありません。詳細については GNU 一般公有使用許諾契" -"約書を参照して下さい。\n" - -#: src/commands.c:399 -msgid "See the file AUTHORS for additional credits," -msgstr "補足のクレジットについては AUTHORS ファイルをご覧になるか、" - -#: src/commands.c:400 -msgid "or visit http://glabels.sourceforge.net/" -msgstr "または http://glabels.sourceforge.net/ を訪れてみて下さい。" - -#: src/commands.c:409 -msgid " " -msgstr " " - -#: src/commands.c:424 -msgid "glabels" -msgstr "gLabels" - -#: src/file.c:100 -msgid "New Label or Card" -msgstr "新規ラベルまたはカード" - -#: src/file.c:132 src/file.c:304 -msgid "Media Type" -msgstr "メディアの種類" - -#: src/file.c:138 src/file.c:310 -msgid "Label orientation" -msgstr "ラベルの向き" - -#: src/file.c:269 -msgid "Label properties" -msgstr "ラベルのプロパティ" - -#: src/file.c:452 src/file.c:870 -msgid "All files" -msgstr "全てのファイル" - -#: src/file.c:457 src/file.c:875 -msgid "gLabels documents" -msgstr "gLabels のドキュメント" - -#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 -msgid "Empty file name selection" -msgstr "ファイル名の入力欄が空です" - -#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 -msgid "Please select a file or supply a valid file name" -msgstr "既存のファイルを選択するか、または正しいファイル名を指定して下さい。" - -#: src/file.c:519 src/file.c:631 -msgid "File does not exist" -msgstr "ファイルがありません。" - -#: src/file.c:563 data/ui/glabels-ui.xml.h:75 -msgid "Open" -msgstr "開く" - -#: src/file.c:565 -msgid "Open label" -msgstr "ラベルを開きます" - -#: src/file.c:707 -#, c-format -msgid "Could not open file \"%s\"" -msgstr "ファイル \"%s\" が開けませんでした" - -#: src/file.c:715 -msgid "Not a supported file format" -msgstr "サポートしていないファイル形式です。" - -#: src/file.c:797 src/file.c:979 src/file.c:1174 -#, c-format -msgid "Could not save file \"%s\"" -msgstr "ファイル \"%s\" を保存できませんでした" - -#: src/file.c:805 src/file.c:987 src/file.c:1182 -msgid "Error encountered during save. The file is still not saved." -msgstr "データ保存中にエラーが発生しました。データはまだ保存されていません。" - -#: src/file.c:848 src/file.c:1048 -#, c-format -msgid "Save \"%s\" as" -msgstr "\"%s\" に名前を付けて保存" - -#: src/file.c:935 src/file.c:1131 -msgid "Please supply a valid file name" -msgstr "正しいファイル名を指定して下さい" - -#: src/file.c:952 src/file.c:1147 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "ファイル \"%s\" に上書きしますか?" - -#: src/file.c:960 src/file.c:1155 -msgid "File already exists." -msgstr "ファイルが既に存在します。" - -#: src/file.c:1271 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "終了する前にドキュメント \"%s\" に対する変更を保存しますか?" - -#: src/file.c:1279 -msgid "Your changes will be lost if you don't save them." -msgstr "保存しないと変更したデータを失うことになります。" - -#: src/file.c:1282 -msgid "Close without saving" -msgstr "保存せずに閉じる" - -#. Should not happen -#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 -#: data/glade/object-editor.glade.h:37 -msgid "points" -msgstr "ポイント" - -#: src/prefs.c:158 data/glade/object-editor.glade.h:36 -#: data/glade/template-designer.glade.h:74 -msgid "inches" -msgstr "[インチ]" - -#: src/prefs.c:160 -msgid "mm" -msgstr "[ミリ]" - -#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 -msgid "gLabels Preferences" -msgstr "gLabels の設定" - -#. -#. * Submenu: Order -#. -#: src/view.c:3570 data/ui/glabels-ui.xml.h:157 -msgid "_Order" -msgstr "順序(_O)" - -#. -#. * Submenu: Rotate/Flip -#. -#: src/view.c:3591 data/ui/glabels-ui.xml.h:163 -msgid "_Rotate/Flip" -msgstr "回転/フリップ(_R)" - -#. -#. * Submenu: Align Horizontally -#. -#: src/view.c:3624 -msgid "Align _Horizontally" -msgstr "水平方向に配置(_H)" - -#. -#. * Submenu: Align Vertically -#. -#: src/view.c:3663 -msgid "Align _Vertically" -msgstr "垂直方向に配置(_V)" - -#: src/view.c:3724 data/ui/glabels-ui.xml.h:140 -msgid "_Delete" -msgstr "削除(_D)" - -#. Build editor. -#: src/view-box.c:223 -msgid "Box object properties" -msgstr "矩形オブジェクトのプロパティ" - -#. Build editor. -#: src/view-ellipse.c:223 -msgid "Ellipse object properties" -msgstr "楕円オブジェクトのプロパティ" - -#. Build editor. -#: src/view-line.c:223 -msgid "Line object properties" -msgstr "直線オブジェクトのプロパティ" - -#. Build editor. -#: src/view-image.c:222 -msgid "Image object properties" -msgstr "画像オブジェクトのプロパティ" - -#. Build editor. -#: src/view-text.c:250 -msgid "Text object properties" -msgstr "文字オブジェクトのプロパティ" - -#: src/view-text.c:562 data/glade/object-editor.glade.h:28 -msgid "Text" -msgstr "文字" - -#. Build editor. -#: src/view-barcode.c:209 -msgid "Barcode object properties" -msgstr "バーコード・オブジェクトのプロパティ" - -#: src/view-barcode.c:579 src/print.c:1088 -msgid "Invalid barcode data" -msgstr "おかしなバーコード・データ" - -#: src/merge-properties-dialog.c:231 -msgid "Merge Properties" -msgstr "結合プロパティ" - -#. ---- Source section ---- -#: src/merge-properties-dialog.c:237 -msgid "Source" -msgstr "ソース" - -#: src/merge-properties-dialog.c:245 -msgid "Format:" -msgstr "書式:" - -#. Location line -#: src/merge-properties-dialog.c:273 -msgid "Location:" -msgstr "場所:" - -#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 -msgid "Select merge-database source" -msgstr "結合データベース・ソースの選択" - -#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 -msgid "N/A" -msgstr "N/A" - -#. ---- Sample Fields section ---- -#: src/merge-properties-dialog.c:300 -msgid "Record selection/preview:" -msgstr "選択範囲/プレビューの記録:" - -#: src/merge-properties-dialog.c:326 -msgid "Select" -msgstr "選択" - -#: src/merge-properties-dialog.c:334 -msgid "Record/Field" -msgstr "レコード/フィールド" - -#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 -msgid "Data" -msgstr "データ" - -#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:82 -msgid "Print" -msgstr "印刷" - -#: src/print-dialog.c:281 -msgid "_Job" -msgstr "ジョブ(_J)" - -#: src/print-dialog.c:286 -msgid "P_rinter" -msgstr "プリンタ(_R)" - -#. ----------- Add simple-copies widget ------------ -#: src/print-dialog.c:314 -msgid "Copies" -msgstr "コピー" - -#. ------- Add merge control widget ------------ -#: src/print-dialog.c:322 -msgid "Document merge control" -msgstr "ドキュメントをコントロールにマージする" - -#. ----------- Add custom print options area ------------ -#: src/print-dialog.c:330 -msgid "Options" -msgstr "オプション" - -#: src/print-dialog.c:351 -msgid "print crop marks" -msgstr "端のマークを揃えて印刷する" - -#: src/print-dialog.c:553 src/print-dialog.c:592 -msgid "Print preview" -msgstr "印刷プレビュー" - -#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 -msgid "gLabels Template Designer" -msgstr "gLabels テンプレート・デザイナ" - -#: src/bc.c:60 -msgid "POSTNET (any)" -msgstr "POSTNET (何でも)" - -#: src/bc.c:63 -msgid "POSTNET-5 (ZIP only)" -msgstr "POSTNET-5 (ZIP のみ)" - -#: src/bc.c:66 -msgid "POSTNET-9 (ZIP+4)" -msgstr "POSTNET-9 (ZIP+4)" - -#: src/bc.c:69 -msgid "POSTNET-11 (DPBC)" -msgstr "POSTNET-11 (DPBC)" - -#: src/bc.c:72 -msgid "EAN (any)" -msgstr "EAN (何でも)" - -#: src/bc.c:75 -msgid "EAN-8" -msgstr "EAN-8" - -#: src/bc.c:78 -msgid "EAN-8 +2" -msgstr "EAN-8 +2" - -#: src/bc.c:81 -msgid "EAN-8 +5" -msgstr "EAN-8 +5" - -#: src/bc.c:84 -msgid "EAN-13" -msgstr "EAN-13" - -#: src/bc.c:87 -msgid "EAN-13 +2" -msgstr "EAN-13 +2" - -#: src/bc.c:90 -msgid "EAN-13 +5" -msgstr "EAN-13 +5" - -#: src/bc.c:93 -msgid "UPC (UPC-A or UPC-E)" -msgstr "UPC (UPC-A または UPC-E)" - -#: src/bc.c:96 -msgid "UPC-A" -msgstr "UPC-A" - -#: src/bc.c:99 -msgid "UPC-A +2" -msgstr "UPC-A +2" - -#: src/bc.c:102 -msgid "UPC-A +5" -msgstr "UPC-A +5" - -#: src/bc.c:105 -msgid "UPC-E" -msgstr "UPC-E" - -#: src/bc.c:108 -msgid "UPC-E +2" -msgstr "UPC-E +2" - -#: src/bc.c:111 -msgid "UPC-E +5" -msgstr "UPC-E +5" - -#: src/bc.c:114 -msgid "ISBN" -msgstr "ISBN" - -#: src/bc.c:117 -msgid "ISBN +5" -msgstr "ISBN +5" - -#: src/bc.c:120 -msgid "Code 39" -msgstr "Code 39" - -#: src/bc.c:123 -msgid "Code 128" -msgstr "Code 128" - -#: src/bc.c:126 -msgid "Code 128C" -msgstr "Code 128C" - -#: src/bc.c:129 -msgid "Code 128B" -msgstr "Code 128B" - -#: src/bc.c:132 -msgid "Interleaved 2 of 5" -msgstr "綴じ込み 2/5" - -#: src/bc.c:135 -msgid "Codabar" -msgstr "Codabar" - -#: src/bc.c:138 -msgid "MSI" -msgstr "MSI" - -#: src/bc.c:141 -msgid "Plessey" -msgstr "Plessey" - -#: src/label.c:569 -msgid "Untitled" -msgstr "タイトルなし" - -#: src/xml-label.c:176 src/xml-label.c:213 -msgid "xmlParseFile error" -msgstr "xmlParseFile エラー" - -#: src/xml-label.c:250 -msgid "No document root" -msgstr "root ドキュメントではありません" - -#: src/xml-label.c:264 -msgid "Importing from glabels 0.1 format" -msgstr "gLabels 0.1 形式からインポートする" - -#: src/xml-label.c:272 -msgid "Importing from glabels 0.4 format" -msgstr "gLabels 0.4 形式からインポートする" - -#: src/xml-label.c:279 -msgid "Importing from glabels 1.91 format" -msgstr "gLabels 1.91 形式からインポートする" - -#: src/xml-label.c:282 -msgid "bad document, unknown glabels Namespace" -msgstr "ドキュメントの種類が間違っています。Glabels 名前空間が見つかりません。" - -#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "おかしな root のノード = \"%s\"" - -#: src/xml-label.c:348 src/xml-label-191.c:165 -#, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "Document ノードにおかしな root のノード = \"%s\"" - -#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 -#, c-format -msgid "bad node = \"%s\"" -msgstr "おかしなノード = \"%s\"" - -#: src/xml-label.c:796 src/xml-label-191.c:605 -#, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "Data ノードにおかしなノード = \"%s\"" - -#: src/xml-label.c:962 libglabels/xml-template.c:535 -msgid "Utf8 conversion error." -msgstr "Utf8 変換エラーです。" - -#: src/xml-label.c:969 libglabels/xml-template.c:542 -msgid "Problem saving xml file." -msgstr "XML ファイルの保存で問題があります" - -#. This should always be an id, but just in case a name -#. slips by! -#: src/xml-label-191.c:680 libglabels/xml-template.c:199 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "不明なページ・サイズの ID \"%s\" です。名前として扱います。" - -#: src/xml-label-191.c:690 libglabels/xml-template.c:209 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "不明なページ・サイズの ID または名前 \"%s\" です。" - -#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 -msgid "None" -msgstr "なし" - -#: src/merge-init.c:53 -msgid "Text file with comma delimeters (CSV)" -msgstr "コンマで区切ったテキスト・ファイル (CSV)" - -#: src/merge-init.c:60 -msgid "Text file with colon delimeters" -msgstr "コロンで区切ったテキスト・ファイル" - -#: src/merge-init.c:67 -msgid "Text file with tab delimeters" -msgstr "タブで区切ったテキスト・ファイル" - -#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 -msgid "File:" -msgstr "ファイル:" - -#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 -msgid "Key:" -msgstr "キー:" - -#: src/wdgt-print-copies.c:179 -msgid "Sheets:" -msgstr "用紙:" - -#: src/wdgt-print-copies.c:197 -msgid "Labels" -msgstr "ラベル" - -#: src/wdgt-print-copies.c:200 -msgid "from:" -msgstr "開始:" - -#: src/wdgt-print-copies.c:207 -msgid "to:" -msgstr "終了:" - -#: src/wdgt-print-merge.c:178 -msgid "Start on label" -msgstr "ラベルの開始" - -#: src/wdgt-print-merge.c:186 -msgid "on 1st sheet" -msgstr "(最初のシート)" - -#: src/wdgt-print-merge.c:195 -msgid "Copies:" -msgstr "コピー:" - -#: src/wdgt-print-merge.c:201 -msgid "Collate" -msgstr "製本" - -#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 -msgid "Description:" -msgstr "説明:" - -#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 -msgid "Page size:" -msgstr "用紙のサイズ:" - -#: src/wdgt-media-select.c:290 -msgid "Label size:" -msgstr "ラベルのサイズ:" - -#: src/wdgt-media-select.c:301 -msgid "Layout:" -msgstr "レイアウト:" - -#: src/wdgt-media-select.c:578 -#, c-format -msgid "%d x %d (%d per sheet)" -msgstr "%d x %d (%d 個/シート)" - -#: src/wdgt-media-select.c:582 -#, c-format -msgid "%d per sheet" -msgstr "%d /シート" - -#: src/wdgt-media-select.c:614 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -#: src/wdgt-media-select.c:619 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 -#, c-format -msgid "%s %s diameter" -msgstr "%s %s 倍率" - -#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 -#, c-format -msgid "%.5g %s diameter" -msgstr "%.5g %s 倍率" - -#: src/wdgt-rotate-label.c:193 -msgid "Rotate" -msgstr "回転させる" - -#. This is the default custom color -#: src/mygal/color-palette.c:396 -msgid "custom" -msgstr "カスタム" - -#. "Custom" color - we'll pop up a GnomeColorPicker -#: src/mygal/color-palette.c:438 -msgid "Custom Color:" -msgstr "カスタム色:" - -#: src/mygal/color-palette.c:446 -msgid "Choose Custom Color" -msgstr "カスタム・カラーの選択" - -#: src/mygal/color-palette.c:579 -msgid "black" -msgstr "黒" - -#: src/mygal/color-palette.c:580 -msgid "light brown" -msgstr "淡い茶" - -#: src/mygal/color-palette.c:581 -msgid "brown gold" -msgstr "茶銀" - -#: src/mygal/color-palette.c:582 -msgid "dark green #2" -msgstr "暗い緑 #2" - -#: src/mygal/color-palette.c:583 -msgid "navy" -msgstr "ネービー" - -#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 -msgid "dark blue" -msgstr "暗い青" - -#: src/mygal/color-palette.c:585 -msgid "purple #2" -msgstr "ç´« #2" - -#: src/mygal/color-palette.c:586 -msgid "very dark gray" -msgstr "とても暗い灰" - -#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 -msgid "dark red" -msgstr "暗い赤" - -#: src/mygal/color-palette.c:590 -msgid "red-orange" -msgstr "赤みの橙" - -#: src/mygal/color-palette.c:591 -msgid "gold" -msgstr "金" - -#: src/mygal/color-palette.c:592 -msgid "dark green" -msgstr "暗い緑" - -#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 -msgid "dull blue" -msgstr "くすんだ青" - -#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 -msgid "blue" -msgstr "青" - -#: src/mygal/color-palette.c:595 -msgid "dull purple" -msgstr "くすんだ紫" - -#: src/mygal/color-palette.c:596 -msgid "dark grey" -msgstr "暗い灰" - -#: src/mygal/color-palette.c:599 -msgid "red" -msgstr "赤" - -#: src/mygal/color-palette.c:600 -msgid "orange" -msgstr "橙" - -#: src/mygal/color-palette.c:601 -msgid "lime" -msgstr "ライム" - -#: src/mygal/color-palette.c:602 -msgid "dull green" -msgstr "くすんだ緑" - -#: src/mygal/color-palette.c:603 -msgid "dull blue #2" -msgstr "くすんだ青 #2" - -#: src/mygal/color-palette.c:604 -msgid "sky blue #2" -msgstr "スカイブルー #2" - -#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 -msgid "purple" -msgstr "ç´«" - -#: src/mygal/color-palette.c:606 -msgid "gray" -msgstr "灰" - -#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 -msgid "magenta" -msgstr "マゼンタ" - -#: src/mygal/color-palette.c:610 -msgid "bright orange" -msgstr "明るい橙" - -#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 -msgid "yellow" -msgstr "黄" - -#: src/mygal/color-palette.c:612 -msgid "green" -msgstr "緑" - -#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 -msgid "cyan" -msgstr "シアン" - -#: src/mygal/color-palette.c:614 -msgid "bright blue" -msgstr "明るい青" - -#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 -msgid "red purple" -msgstr "赤紫" - -#: src/mygal/color-palette.c:616 -msgid "light grey" -msgstr "淡い灰" - -#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 -msgid "pink" -msgstr "ピンク" - -#: src/mygal/color-palette.c:620 -msgid "light orange" -msgstr "淡い橙" - -#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 -msgid "light yellow" -msgstr "淡い黄" - -#: src/mygal/color-palette.c:622 -msgid "light green" -msgstr "淡い緑" - -#: src/mygal/color-palette.c:623 -msgid "light cyan" -msgstr "淡いシアン" - -#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 -msgid "light blue" -msgstr "淡い青" - -#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 -msgid "light purple" -msgstr "淡い紫" - -#: src/mygal/color-palette.c:626 -msgid "white" -msgstr "白" - -#: src/mygal/color-palette.c:631 -msgid "purplish blue" -msgstr "紫みの青" - -#: src/mygal/color-palette.c:635 -msgid "dark purple" -msgstr "暗い紫" - -#: src/mygal/color-palette.c:637 -msgid "sky blue" -msgstr "スカイブルー" - -#: libglabels/template.c:848 -#, c-format -msgid "Generic %s full page" -msgstr "Generic %s フル・ページ" - -#: libglabels/template.c:897 -msgid "No template files found!" -msgstr "テンプレート・ファイルが見つかりません!" - -#. Create and append an "Other" entry. -#: libglabels/paper.c:67 -msgid "Other" -msgstr "その他" - -#: libglabels/paper.c:361 -msgid "No paper files found!" -msgstr "用紙ふぃあるが見つかりません!" - -#: data/ui/glabels-ui.xml.h:1 -msgid "About glabels" -msgstr "gLabels について" - -#: data/ui/glabels-ui.xml.h:2 -msgid "About..." -msgstr "情報..." - -#: data/ui/glabels-ui.xml.h:3 -msgid "Align _Horizontal" -msgstr "水平方向に配置(_H)" - -#: data/ui/glabels-ui.xml.h:4 -msgid "Align _Vertical" -msgstr "垂直方向に配置(_V)" - -#: data/ui/glabels-ui.xml.h:5 -msgid "Align objects to bottoms" -msgstr "オブジェクトを下端に配置します" - -#: data/ui/glabels-ui.xml.h:6 -msgid "Align objects to horizontal centers" -msgstr "オブジェクトを水平方向の中心に配置します" - -#: data/ui/glabels-ui.xml.h:7 -msgid "Align objects to left edges" -msgstr "オブジェクトを左端に配置します" - -#: data/ui/glabels-ui.xml.h:8 -msgid "Align objects to right edges" -msgstr "オブジェクトを右端に配置します" - -#: data/ui/glabels-ui.xml.h:9 -msgid "Align objects to tops" -msgstr "オブジェクトを上端に配置します" - -#: data/ui/glabels-ui.xml.h:10 -msgid "Align objects to vertical centers" -msgstr "オブジェクトを垂直方向の中心に配置します" - -#: data/ui/glabels-ui.xml.h:12 -msgid "Bold" -msgstr "文字を太字にします" - -#: data/ui/glabels-ui.xml.h:14 -msgid "Center align" -msgstr "中央に揃えます" - -#: data/ui/glabels-ui.xml.h:15 -msgid "Center objects to horizontal label center" -msgstr "オブジェクトをラベルの中心に水平移動します" - -#: data/ui/glabels-ui.xml.h:16 -msgid "Center objects to vertical label center" -msgstr "オブジェクトをラベルの中心に垂直移動します" - -#: data/ui/glabels-ui.xml.h:17 -msgid "Change the visibility of markup lines in the current window" -msgstr "ラベルの外枠線の表示/非表示を変更します" - -#: data/ui/glabels-ui.xml.h:18 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "ツールバーの表示/非表示を変更します" - -#: data/ui/glabels-ui.xml.h:19 -msgid "Change the visibility of the grid in the current window" -msgstr "ラベルのグリッド (格子線) の表示/非表示を変更します" - -#: data/ui/glabels-ui.xml.h:20 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "メイン・ツールバーの表示/非表示を変更します" - -#: data/ui/glabels-ui.xml.h:21 -msgid "Change the visibility of the property toolbar in the current window" -msgstr "プロパティ・ツールバーの表示/非表示を変更します" - -#: data/ui/glabels-ui.xml.h:22 -msgid "Close" -msgstr "閉じる" - -#: data/ui/glabels-ui.xml.h:23 -msgid "Close the current file" -msgstr "このファイルを閉じます" - -#: data/ui/glabels-ui.xml.h:24 -msgid "Configure the application" -msgstr "gLabel の設定を変更します" - -#: data/ui/glabels-ui.xml.h:25 -msgid "Contents" -msgstr "目次" - -#: data/ui/glabels-ui.xml.h:26 -msgid "Copy" -msgstr "コピー" - -#: data/ui/glabels-ui.xml.h:27 -msgid "Copy the selection" -msgstr "選択範囲をコピーします" - -#: data/ui/glabels-ui.xml.h:28 -msgid "Create a custom template" -msgstr "カスタム・テンプレートを生成します" - -#: data/ui/glabels-ui.xml.h:29 -msgid "Create a new document" -msgstr "新しいドキュメントを作成します" - -#: data/ui/glabels-ui.xml.h:30 -msgid "Create barcode object" -msgstr "バーコード・オブジェクトを作成します" - -#: data/ui/glabels-ui.xml.h:31 -msgid "Create box/rectangle object" -msgstr "四角/三角のオブジェクトを作成します" - -#: data/ui/glabels-ui.xml.h:32 -msgid "Create ellipse/circle object" -msgstr "楕円/円オブジェクトを作成します" - -#: data/ui/glabels-ui.xml.h:33 -msgid "Create image object" -msgstr "画像オブジェクトを作成します" - -#: data/ui/glabels-ui.xml.h:34 -msgid "Create line object" -msgstr "直線オブジェクトを作成します" - -#: data/ui/glabels-ui.xml.h:35 -msgid "Create text object" -msgstr "文字オブジェクトを作成します" - -#: data/ui/glabels-ui.xml.h:36 -msgid "Cu_t" -msgstr "切り取り(_T)" - -#: data/ui/glabels-ui.xml.h:37 -msgid "Customize" -msgstr "カスタマイズ" - -#: data/ui/glabels-ui.xml.h:38 -msgid "Customize Drawing Toolbar" -msgstr "ツールバー" - -#: data/ui/glabels-ui.xml.h:39 -msgid "Customize Main Toolbar" -msgstr "メイン・ツールバー" - -#: data/ui/glabels-ui.xml.h:40 -msgid "Customize Property Toolbar" -msgstr "プロパティ・ツールバー" - -#: data/ui/glabels-ui.xml.h:41 -msgid "Customize toolbars" -msgstr "ツールバーのカスタマイズ" - -#: data/ui/glabels-ui.xml.h:42 -msgid "Cut" -msgstr "切り取り" - -#: data/ui/glabels-ui.xml.h:43 -msgid "Cut the selection" -msgstr "選択範囲を切り取ります" - -#: data/ui/glabels-ui.xml.h:44 -msgid "Decrease magnification" -msgstr "拡大率を下げます" - -#: data/ui/glabels-ui.xml.h:45 -msgid "Delete" -msgstr "削除" - -#: data/ui/glabels-ui.xml.h:46 -msgid "Delete the selected objects" -msgstr "選択したオブジェクトを削除します" - -#: data/ui/glabels-ui.xml.h:47 -msgid "Drawing toolbar" -msgstr "ツールバーの表示方法" - -#: data/ui/glabels-ui.xml.h:48 -msgid "Dump XML" -msgstr "XML のダンプ" - -#: data/ui/glabels-ui.xml.h:49 -msgid "Dump the UI Xml description" -msgstr "GUI の XML 記述をダンプ表示します" - -#: data/ui/glabels-ui.xml.h:50 -msgid "Edit merge properties" -msgstr "結合プロパティを編集します" - -#: data/ui/glabels-ui.xml.h:54 -msgid "Flip object horizontally" -msgstr "オブジェクトを水平方向にひっくり返します" - -#: data/ui/glabels-ui.xml.h:55 -msgid "Flip object vertically" -msgstr "オブジェクトを垂直方向にひっくり返します" - -#: data/ui/glabels-ui.xml.h:56 -msgid "Font name" -msgstr "フォント名です" - -#: data/ui/glabels-ui.xml.h:57 -msgid "Font selector" -msgstr "フォント・セレクタ" - -#: data/ui/glabels-ui.xml.h:58 -msgid "Font size" -msgstr "フォント・サイズです" - -#: data/ui/glabels-ui.xml.h:59 -msgid "Icon and _Text" -msgstr "アイコンとラベル(_T)" - -#: data/ui/glabels-ui.xml.h:60 -msgid "Increase magnification" -msgstr "拡大率を上げます" - -#: data/ui/glabels-ui.xml.h:61 -msgid "Italic" -msgstr "文字を斜体にします" - -#: data/ui/glabels-ui.xml.h:63 -msgid "Left align" -msgstr "左に寄せませす" - -#: data/ui/glabels-ui.xml.h:65 -msgid "Line width" -msgstr "線の幅を選択します" - -#: data/ui/glabels-ui.xml.h:66 -msgid "Lower object to bottom" -msgstr "オブジェクトを後ろに回します" - -#: data/ui/glabels-ui.xml.h:67 -msgid "M_arkup" -msgstr "マークアップ(_A)" - -#: data/ui/glabels-ui.xml.h:68 -msgid "Main toolbar" -msgstr "メイン・ツールバー" - -#: data/ui/glabels-ui.xml.h:69 -msgid "Markup" -msgstr "マークアップ" - -#: data/ui/glabels-ui.xml.h:70 -msgid "Modify document properties" -msgstr "ドキュメントのプロパティを修正します" - -#: data/ui/glabels-ui.xml.h:71 -msgid "New" -msgstr "新規" - -#: data/ui/glabels-ui.xml.h:72 -msgid "Object property editor" -msgstr "オブジェクト・プロパティのエディタ" - -#: data/ui/glabels-ui.xml.h:73 -msgid "Only show icons in the drawing toolbar" -msgstr "ツールバーの中にアイコンのみ表示します" - -#: data/ui/glabels-ui.xml.h:74 -msgid "Only show icons in the main toolbar" -msgstr "メイン・ツールバーの中にアイコンのみ表示します" - -#: data/ui/glabels-ui.xml.h:76 -msgid "Open a file" -msgstr "ファイルを開きます" - -#: data/ui/glabels-ui.xml.h:77 -msgid "Open the glabels manual" -msgstr "gLabeles のマニュアルを開きます" - -#: data/ui/glabels-ui.xml.h:78 -msgid "Paste" -msgstr "貼り付け" - -#: data/ui/glabels-ui.xml.h:79 -msgid "Paste the clipboard" -msgstr "クリップボードの内容を貼り付けます" - -#: data/ui/glabels-ui.xml.h:80 -msgid "Pr_eferences..." -msgstr "設定(_E)..." - -#: data/ui/glabels-ui.xml.h:81 -msgid "Preferences" -msgstr "gLabel の設定" - -#: data/ui/glabels-ui.xml.h:83 -msgid "Print the current file" -msgstr "このファイルを印刷します" - -#: data/ui/glabels-ui.xml.h:84 -msgid "Proper_ties..." -msgstr "プロパティ(_T)..." - -#: data/ui/glabels-ui.xml.h:85 -msgid "Properties" -msgstr "プロパティ" - -#: data/ui/glabels-ui.xml.h:86 -msgid "Property toolbar" -msgstr "プロパティのツールバー" - -#: data/ui/glabels-ui.xml.h:87 -msgid "Quit" -msgstr "終了" - -#: data/ui/glabels-ui.xml.h:88 -msgid "Quit the program" -msgstr "gLabels を終了します" - -#: data/ui/glabels-ui.xml.h:89 -msgid "Raise object to top" -msgstr "オブジェクトを前に持ってきます" - -#: data/ui/glabels-ui.xml.h:90 -msgid "Recent _Files" -msgstr "最近開いたファイル(_F)" - -#: data/ui/glabels-ui.xml.h:91 -msgid "Redo" -msgstr "やり直し" - -#: data/ui/glabels-ui.xml.h:92 -msgid "Redo the undone action" -msgstr "完了していない操作をやり直します" - -#: data/ui/glabels-ui.xml.h:93 -msgid "Remove all selections" -msgstr "選択範囲を解除します" - -#: data/ui/glabels-ui.xml.h:95 -#, no-c-format -msgid "Restore scale to 100%" -msgstr "拡大率を 100% に戻します" - -#: data/ui/glabels-ui.xml.h:96 -msgid "Right align" -msgstr "右に寄せます" - -#: data/ui/glabels-ui.xml.h:99 -msgid "Rotate object 90 clockwise" -msgstr "オブジェクトを時計回りに 90°回転させます" - -#: data/ui/glabels-ui.xml.h:100 -msgid "Rotate object 90 counter-clockwise" -msgstr "オブジェクトを反時計回りに 90°回転させます" - -#: data/ui/glabels-ui.xml.h:101 -msgid "Save" -msgstr "保存" - -#: data/ui/glabels-ui.xml.h:102 -msgid "Save As" -msgstr "名前を付けて保存" - -#: data/ui/glabels-ui.xml.h:103 -msgid "Save _As..." -msgstr "別名で保存(_A)..." - -#: data/ui/glabels-ui.xml.h:104 -msgid "Save the current file" -msgstr "このファイルを保存します" - -#: data/ui/glabels-ui.xml.h:105 -msgid "Save the current file with a different name" -msgstr "このデータに別の名前を付けて保存します" - -#: data/ui/glabels-ui.xml.h:106 -msgid "Select All" -msgstr "全て選択" - -#: data/ui/glabels-ui.xml.h:107 -msgid "Select _All" -msgstr "全て選択(_A)" - -#: data/ui/glabels-ui.xml.h:108 -msgid "Select all objects" -msgstr "全てのオブジェクトを選択します" - -#: data/ui/glabels-ui.xml.h:109 -msgid "Select, move and modify objects" -msgstr "オブジェクトの選択、移動、編集を行います" - -#: data/ui/glabels-ui.xml.h:111 -msgid "Set drawing toolbar button style according to desktop default" -msgstr "デスクトップの設定に従ってツールバーを表示します" - -#: data/ui/glabels-ui.xml.h:112 -msgid "Set main toolbar button style according to desktop default" -msgstr "デスクトップの設定に従ってメイン・ツールバーを表示します" - -#: data/ui/glabels-ui.xml.h:113 -msgid "Show _Tooltips" -msgstr "ツールチップの表示(_T)" - -#: data/ui/glabels-ui.xml.h:114 -msgid "Show both icons and texts in the drawing toolbar" -msgstr "ツールバーにアイコンとラベルの両方を表示します" - -#: data/ui/glabels-ui.xml.h:115 -msgid "Show both icons and texts in the main toolbar" -msgstr "メイン・ツールバーにアイコンとラベルの両方を表示します" - -#: data/ui/glabels-ui.xml.h:116 -msgid "Show tooltips in the drawing toolbar" -msgstr "ツールバーにツールチップを表示します" - -#: data/ui/glabels-ui.xml.h:117 -msgid "Show tooltips in the main toolbar" -msgstr "メイン・ツールバーにツールチップを表示します" - -#: data/ui/glabels-ui.xml.h:118 -msgid "Show tooltips in the property toolbar" -msgstr "プロパティ・ツールバーにツールチップを表示します" - -#: data/ui/glabels-ui.xml.h:119 -msgid "Template Designer" -msgstr "テンプレート・デザイナ" - -#: data/ui/glabels-ui.xml.h:120 -msgid "Template _Designer..." -msgstr "テンプレート・デザイナ(_D)..." - -#: data/ui/glabels-ui.xml.h:121 -msgid "Text color" -msgstr "文字の色を選択します" - -#: data/ui/glabels-ui.xml.h:122 -msgid "U_n-select All" -msgstr "全て選択解除(_N)" - -#: data/ui/glabels-ui.xml.h:123 -msgid "Un-select All" -msgstr "全て選択解除" - -#: data/ui/glabels-ui.xml.h:124 -msgid "Undo" -msgstr "元に戻す" - -#: data/ui/glabels-ui.xml.h:125 -msgid "Undo the last action" -msgstr "最後の操作を取り消します" - -#: data/ui/glabels-ui.xml.h:126 -msgid "Zoom _1:1" -msgstr "拡大率 1:1(_1)" - -#: data/ui/glabels-ui.xml.h:127 -msgid "Zoom _In" -msgstr "拡大(_I)" - -#: data/ui/glabels-ui.xml.h:128 -msgid "Zoom _Out" -msgstr "縮小(_O)" - -#: data/ui/glabels-ui.xml.h:129 -msgid "Zoom to _fit" -msgstr "ウィンドウにあわせる(_F)" - -#: data/ui/glabels-ui.xml.h:130 -msgid "Zoom to fit window" -msgstr "ウィンドウのサイズに合わせます" - -#: data/ui/glabels-ui.xml.h:131 -msgid "_About..." -msgstr "情報(_A)..." - -#: data/ui/glabels-ui.xml.h:132 -msgid "_Bottoms" -msgstr "下部(_B)" - -#: data/ui/glabels-ui.xml.h:135 -msgid "_Close" -msgstr "閉じる(_C)" - -#: data/ui/glabels-ui.xml.h:136 -msgid "_Contents" -msgstr "目次(_C)" - -#: data/ui/glabels-ui.xml.h:137 -msgid "_Copy" -msgstr "複写(_C)" - -#: data/ui/glabels-ui.xml.h:138 -msgid "_Create Object" -msgstr "オブジェクトの生成(_C)" - -#: data/ui/glabels-ui.xml.h:139 -msgid "_Debug" -msgstr "デバッグ(_D)" - -#: data/ui/glabels-ui.xml.h:141 -msgid "_Desktop Default" -msgstr "デスクトップ設定(_D)" - -#: data/ui/glabels-ui.xml.h:142 -msgid "_Drawing Toolbar" -msgstr "ツールバー(_D)" - -#: data/ui/glabels-ui.xml.h:143 -msgid "_Edit" -msgstr "編集(_E)" - -#: data/ui/glabels-ui.xml.h:145 -msgid "_File" -msgstr "ファイル(_F)" - -#: data/ui/glabels-ui.xml.h:146 -msgid "_Grid" -msgstr "グリッド(_G)" - -#: data/ui/glabels-ui.xml.h:147 -msgid "_Help" -msgstr "ヘルプ(_H)" - -#: data/ui/glabels-ui.xml.h:148 -msgid "_Icon" -msgstr "アイコン(_I)" - -#: data/ui/glabels-ui.xml.h:152 -msgid "_Main Toolbar" -msgstr "メイン・ツールバー(_M)" - -#: data/ui/glabels-ui.xml.h:153 -msgid "_Merge Properties..." -msgstr "結合プロパティ(_M)..." - -#: data/ui/glabels-ui.xml.h:154 -msgid "_New" -msgstr "新規(_N)" - -#: data/ui/glabels-ui.xml.h:155 -msgid "_Objects" -msgstr "オブジェクト(_O)" - -#: data/ui/glabels-ui.xml.h:156 -msgid "_Open..." -msgstr "開く(_O)..." - -#: data/ui/glabels-ui.xml.h:158 -msgid "_Paste" -msgstr "貼り付け(_P)" - -#: data/ui/glabels-ui.xml.h:159 -msgid "_Print..." -msgstr "印刷(_P)..." - -#: data/ui/glabels-ui.xml.h:160 -msgid "_Property Toolbar" -msgstr "プロパティ・ツールバー(_P)" - -#: data/ui/glabels-ui.xml.h:161 -msgid "_Quit" -msgstr "終了(_Q)" - -#: data/ui/glabels-ui.xml.h:164 -msgid "_Save" -msgstr "保存(_S)" - -#: data/ui/glabels-ui.xml.h:168 -msgid "_View" -msgstr "表示(_V)" - -#: data/glade/prefs-dialog.glade.h:1 -msgid " " -msgstr " " - -#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 -#: data/glade/template-designer.glade.h:5 -msgid "*" -msgstr "*" - -#: data/glade/prefs-dialog.glade.h:3 -msgid "Default page size" -msgstr "ページ・サイズの初期値" - -#: data/glade/prefs-dialog.glade.h:4 -msgid "Fill" -msgstr "塗りつぶし" - -#: data/glade/prefs-dialog.glade.h:5 -msgid "Line" -msgstr "線" - -#: data/glade/prefs-dialog.glade.h:6 -msgid "Text" -msgstr "文字" - -#: data/glade/prefs-dialog.glade.h:7 -msgid "Units" -msgstr "単位" - -#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 -msgid "Alignment:" -msgstr "位置:" - -#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 -msgid "Color:" -msgstr "色:" - -#: data/glade/prefs-dialog.glade.h:10 -msgid "Font:" -msgstr "フォント:" - -#: data/glade/prefs-dialog.glade.h:11 -msgid "ISO A4" -msgstr "ISO A4 版" - -#: data/glade/prefs-dialog.glade.h:12 -msgid "Inches" -msgstr "インチ" - -#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 -msgid "Line Spacing:" -msgstr "行間:" - -#: data/glade/prefs-dialog.glade.h:14 -msgid "Locale" -msgstr "ローケル" - -#: data/glade/prefs-dialog.glade.h:15 -msgid "Millimeters" -msgstr "ミリ" - -#: data/glade/prefs-dialog.glade.h:16 -msgid "Object defaults" -msgstr "オブジェクトのデフォルト" - -#: data/glade/prefs-dialog.glade.h:17 -msgid "Points" -msgstr "ポイント" - -#: data/glade/prefs-dialog.glade.h:18 -msgid "Select default properties for new objects." -msgstr "新規に作成するオブジェクトのデフォルト値を選択して下さい。" - -#: data/glade/prefs-dialog.glade.h:19 -msgid "Select locale specific behavior." -msgstr "利用する言語 (ロケール) に依存する動作を選択して下さい。" - -#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:25 -msgid "US Letter" -msgstr "US レター" - -#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 -#: data/glade/template-designer.glade.h:72 -msgid "Width:" -msgstr "幅:" - -#: data/glade/object-editor.glade.h:2 -msgid "00000000000 00000" -msgstr "00000000000 00000" - -#: data/glade/object-editor.glade.h:3 -msgid "Xxx object properties" -msgstr "" -"Xxx オブジェクトのプロパティ" - -#: data/glade/object-editor.glade.h:5 -msgid "Allow merge to automatically shrink text" -msgstr "自動的に文字を小さくして結合できるようにする" - -#: data/glade/object-editor.glade.h:6 -msgid "Angle:" -msgstr "角度:" - -#: data/glade/object-editor.glade.h:7 -msgid "Checksum" -msgstr "チェックサム" - -#: data/glade/object-editor.glade.h:10 -msgid "Family:" -msgstr "ファミリ:" - -#: data/glade/object-editor.glade.h:12 -msgid "Fill" -msgstr "塗りつぶし" - -#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 -msgid "Height:" -msgstr "高さ:" - -#: data/glade/object-editor.glade.h:14 -msgid "Image" -msgstr "画像" - -#: data/glade/object-editor.glade.h:15 -msgid "Insert merge field" -msgstr "結合フィールドの挿入" - -#: data/glade/object-editor.glade.h:17 -msgid "Length:" -msgstr "長さ:" - -#: data/glade/object-editor.glade.h:18 -msgid "Line" -msgstr "直線" - -#: data/glade/object-editor.glade.h:20 -msgid "Literal:" -msgstr "リテラル:" - -#: data/glade/object-editor.glade.h:21 -msgid "Load image" -msgstr "画像の読み込み" - -#: data/glade/object-editor.glade.h:22 -msgid "Position" -msgstr "位置" - -#: data/glade/object-editor.glade.h:23 -msgid "Reset image size" -msgstr "画像サイズのリセット" - -#: data/glade/object-editor.glade.h:24 -msgid "Size" -msgstr "サイズ" - -#: data/glade/object-editor.glade.h:25 -msgid "Size:" -msgstr "サイズ:" - -#: data/glade/object-editor.glade.h:26 -msgid "Style" -msgstr "スタイル" - -#: data/glade/object-editor.glade.h:27 -msgid "Style:" -msgstr "スタイル:" - -#: data/glade/object-editor.glade.h:30 -msgid "X:" -msgstr "X:" - -#: data/glade/object-editor.glade.h:31 -msgid "Y:" -msgstr "Y:" - -#: data/glade/object-editor.glade.h:32 -msgid "degrees" -msgstr "度" - -#: data/glade/object-editor.glade.h:33 -msgid "dialog1" -msgstr "dialog1" - -#: data/glade/object-editor.glade.h:34 -msgid "digits:" -msgstr "桁数:" - -#: data/glade/object-editor.glade.h:35 -msgid "format:" -msgstr "書式:" - -#: data/glade/template-designer.glade.h:1 -msgid " " -msgstr " " - -#: data/glade/template-designer.glade.h:2 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "(例: \"封筒のラベル\", \"名刺\", ...)" - -#: data/glade/template-designer.glade.h:3 -msgid "(e.g., 8163A)" -msgstr "(例: 8163A)" - -#: data/glade/template-designer.glade.h:4 -msgid "(e.g., Avery, Acme, ...)" -msgstr "(例: Avery, Acme, ...)" - -#: data/glade/template-designer.glade.h:6 -msgid "1. Outer radius:" -msgstr "1. 外径:" - -#: data/glade/template-designer.glade.h:7 -msgid "1. Radius:" -msgstr "1. 半径:" - -#: data/glade/template-designer.glade.h:8 -msgid "1. Width:" -msgstr "1. 幅:" - -#: data/glade/template-designer.glade.h:9 -msgid "2. Height:" -msgstr "2. 高さ:" - -#: data/glade/template-designer.glade.h:10 -msgid "2. Inner radius:" -msgstr "2. インナーの半径:" - -#: data/glade/template-designer.glade.h:11 -msgid "2. Waste (overprint allowed):" -msgstr "2. 余分な部分 (重ね刷り可):" - -#: data/glade/template-designer.glade.h:12 -msgid "3. Clipping width:" -msgstr "3. クリッピングの幅:" - -#: data/glade/template-designer.glade.h:13 -msgid "3. Margin" -msgstr "3. 余白" - -#: data/glade/template-designer.glade.h:14 -msgid "3. Round (radius of corner):" -msgstr "3. コーナー (角度):" - -#: data/glade/template-designer.glade.h:15 -msgid "4. Clipping height:" -msgstr "4. クリッピングの高さ:" - -#: data/glade/template-designer.glade.h:16 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "4. 水平方向の余分な部分 (重ね刷り可):" - -#: data/glade/template-designer.glade.h:17 -msgid "5. Vert. waste (overprint allowed):" -msgstr "5. 垂直方向の余分な部分 (重ね刷り可):" - -#: data/glade/template-designer.glade.h:18 -msgid "5. Waste (overprint allowed):" -msgstr "5. 余分な部分 (重ね刷り可):" - -#: data/glade/template-designer.glade.h:19 -msgid "6. Margin" -msgstr "6. 余白" - -#: data/glade/template-designer.glade.h:20 -msgid "Brand/Manufacturer:" -msgstr "ブランド/製造元:" - -#: data/glade/template-designer.glade.h:21 -msgid "CD/DVD (including credit card CDs)" -msgstr "CD/DVD の形 (含むクレジット・カード CD)" - -#: data/glade/template-designer.glade.h:22 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "" -"おめでとうございます!\n" -"\n" -"gLabels テンプレートの生成が完了しました。\n" -"このデザインを採用し保存する場合は、[適用] をクリックして下さい。\n" -"\n" -"[キャンセル] をクリックするとデザインを破棄することができます。\n" -"または [戻る] をクリックするとやり直すことが可能です。" - -#: data/glade/template-designer.glade.h:30 -msgid "Design Completed" -msgstr "デザインが完了しました" - -#: data/glade/template-designer.glade.h:31 -msgid "Distance from left edge (x0):" -msgstr "左上隅からの距離 (x0):" - -#: data/glade/template-designer.glade.h:32 -msgid "Distance from top edge (y0):" -msgstr "左上隅からの距離 (y0):" - -#: data/glade/template-designer.glade.h:34 -msgid "Horizontal pitch (dx):" -msgstr "水平方向のピッチ (dx):" - -#: data/glade/template-designer.glade.h:35 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" -"何個のラベルをテンプレートの中に作成しますか?\n" -"\n" -"レイアウトはラベルまたはカードの集まりで、それらを格子状に配置することができ" -"ます。\n" -"最初のサンプルのように、ほとんどのテンプレートではレイアウトは一つで十分で" -"す。\n" -"二番目のサンプルでは、二つのレイアウトが必要な場合を図にしたものです。" - -#: data/glade/template-designer.glade.h:40 -msgid "Label Size (CD/DVD)" -msgstr "ラベルのサイズ (CD/DVD)" - -#: data/glade/template-designer.glade.h:41 -msgid "Label Size (Round)" -msgstr "ラベルのサイズ (円)" - -#: data/glade/template-designer.glade.h:42 -msgid "Label or Card Shape" -msgstr "ラベルまたはカードの形状" - -#: data/glade/template-designer.glade.h:43 -msgid "Label or Card Size (Rectangular)" -msgstr "ラベルまたはカードのサイズ (長方形)" - -#: data/glade/template-designer.glade.h:44 -msgid "Layout #1" -msgstr "レイアウト #1:" - -#: data/glade/template-designer.glade.h:45 -msgid "Layout #2" -msgstr "レイアウト #2:" - -#: data/glade/template-designer.glade.h:46 -msgid "Layout(s)" -msgstr "レイアウト" - -#: data/glade/template-designer.glade.h:47 -msgid "Name and Description" -msgstr "名前と説明" - -#: data/glade/template-designer.glade.h:48 -msgid "Number across (nx):" -msgstr "横方向の数 (nx):" - -#: data/glade/template-designer.glade.h:49 -msgid "Number down (ny):" -msgstr "縦方向の数 (ny):" - -#: data/glade/template-designer.glade.h:50 -msgid "Number of Layouts" -msgstr "レイアウトの数" - -#: data/glade/template-designer.glade.h:51 -msgid "Number of layouts:" -msgstr "レイアウトの数:" - -#: data/glade/template-designer.glade.h:52 -msgid "Page Size" -msgstr "用紙のサイズ" - -#: data/glade/template-designer.glade.h:54 -msgid "Part #:" -msgstr "パート番号" - -#: data/glade/template-designer.glade.h:55 -msgid "" -"Please enter the following identifying information about the template " -"stationery." -msgstr "テンプレートの識別情報を入力して下さい。" - -#: data/glade/template-designer.glade.h:56 -msgid "Please enter the following layout information." -msgstr "レイアウト情報を入力して下さい。" - -#: data/glade/template-designer.glade.h:57 -msgid "" -"Please enter the following size parameters of a single label in your " -"template." -msgstr "テンプレートのラベル単体のサイズをそれぞれ入力して下さい。" - -#: data/glade/template-designer.glade.h:58 -msgid "" -"Please enter the following size parameters of a single label or card in your " -"template." -msgstr "テンプレートのラベルまたはカード単体のサイズをそれぞれ入力して下さい。" - -#: data/glade/template-designer.glade.h:59 -msgid "Please select the basic shape of the labels or cards." -msgstr "ラベルまたはカードの基本的な形状を選択して下さい。" - -#: data/glade/template-designer.glade.h:60 -msgid "Please select the page size of the template stationery." -msgstr "テンプレート用紙のサイズを選択して下さい。" - -#: data/glade/template-designer.glade.h:61 -msgid "Print test sheet" -msgstr "用紙のテスト印刷" - -#: data/glade/template-designer.glade.h:62 -msgid "Rectangular or square (can have rounded corners)" -msgstr "長方形または正方形 (コーナーを丸くすることも可)" - -#: data/glade/template-designer.glade.h:63 -msgid "Round" -msgstr "円" - -#: data/glade/template-designer.glade.h:64 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" -"レイアウトが二つ必要な\n" -"テンプレート" - -#: data/glade/template-designer.glade.h:66 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" -"レイアウトが一つだけで\n" -"十分なレイアウト" - -#: data/glade/template-designer.glade.h:68 -msgid "Vertical pitch (dy):" -msgstr "垂直方向のピッチ (dy):" - -#: data/glade/template-designer.glade.h:69 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" -"gLabels のテンプレート・デザイナへようこそ。\n" -"\n" -"このデザイナでは gLabels のカスタム・テンプレートの作成をお手伝いします。" - -#: data/templates/paper-sizes.xml.h:1 -msgid "A0" -msgstr "A0版" - -#: data/templates/paper-sizes.xml.h:2 -msgid "A1" -msgstr "A1版" - -#: data/templates/paper-sizes.xml.h:3 -msgid "A10" -msgstr "A10版" - -#: data/templates/paper-sizes.xml.h:4 -msgid "A2" -msgstr "A2版" - -#: data/templates/paper-sizes.xml.h:5 -msgid "A3" -msgstr "A3版" - -#: data/templates/paper-sizes.xml.h:6 -msgid "A4" -msgstr "A4版" - -#: data/templates/paper-sizes.xml.h:7 -msgid "A5" -msgstr "A5版" - -#: data/templates/paper-sizes.xml.h:8 -msgid "A6" -msgstr "A6版" - -#: data/templates/paper-sizes.xml.h:9 -msgid "A7" -msgstr "A7版" - -#: data/templates/paper-sizes.xml.h:10 -msgid "A8" -msgstr "A8版" - -#: data/templates/paper-sizes.xml.h:11 -msgid "A9" -msgstr "A9版" - -#: data/templates/paper-sizes.xml.h:12 -msgid "B0" -msgstr "B0版" - -#: data/templates/paper-sizes.xml.h:13 -msgid "B1" -msgstr "B1版" - -#: data/templates/paper-sizes.xml.h:14 -msgid "B10" -msgstr "B10版" - -#: data/templates/paper-sizes.xml.h:15 -msgid "B2" -msgstr "B2版" - -#: data/templates/paper-sizes.xml.h:16 -msgid "B3" -msgstr "B3版" - -#: data/templates/paper-sizes.xml.h:17 -msgid "B4" -msgstr "B4版" - -#: data/templates/paper-sizes.xml.h:18 -msgid "B5" -msgstr "B5版" - -#: data/templates/paper-sizes.xml.h:19 -msgid "B6" -msgstr "B6版" - -#: data/templates/paper-sizes.xml.h:20 -msgid "B7" -msgstr "B7版" - -#: data/templates/paper-sizes.xml.h:21 -msgid "B8" -msgstr "B8版" - -#: data/templates/paper-sizes.xml.h:22 -msgid "B9" -msgstr "B9版" - -#: data/templates/paper-sizes.xml.h:23 -msgid "US Executive" -msgstr "US エグゼクティブ" - -#: data/templates/paper-sizes.xml.h:24 -msgid "US Legal" -msgstr "US リーガル" - -#: data/templates/avery-us-templates.xml.h:1 -#: data/templates/zweckform-iso-templates.xml.h:1 -msgid "Address Labels" -msgstr "宛名のラベル" - -#: data/templates/avery-us-templates.xml.h:2 -#: data/templates/avery-iso-templates.xml.h:2 -#: data/templates/zweckform-iso-templates.xml.h:3 -#: data/templates/misc-us-templates.xml.h:2 -#: data/templates/misc-iso-templates.xml.h:9 -msgid "Business Cards" -msgstr "名刺" - -#: data/templates/avery-us-templates.xml.h:3 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "CD/DVD のラベル (Disc ラベル)" - -#: data/templates/avery-us-templates.xml.h:4 -msgid "Diskette Labels" -msgstr "フロッピーのラベル" - -#: data/templates/avery-us-templates.xml.h:5 -msgid "Filing Labels" -msgstr "ファイル・バインダーのラベル" - -#: data/templates/avery-us-templates.xml.h:6 -msgid "Full Sheet Labels" -msgstr "全用紙のラベル" - -#: data/templates/avery-us-templates.xml.h:7 -msgid "Large Round Labels" -msgstr "大きな矩形のラベル" - -#: data/templates/avery-us-templates.xml.h:8 -msgid "Name Badge Labels" -msgstr "名前つきバッジのラベル" - -#: data/templates/avery-us-templates.xml.h:9 -msgid "Return Address Labels" -msgstr "返信用宛名のラベル" - -#: data/templates/avery-us-templates.xml.h:10 -msgid "Shipping Labels" -msgstr "出荷ラベル" - -#: data/templates/avery-us-templates.xml.h:11 -msgid "Small Round Labels" -msgstr "小さな矩形のラベル" - -#: data/templates/avery-us-templates.xml.h:12 -msgid "Square Labels" -msgstr "矩形のラベル" - -#: data/templates/avery-us-templates.xml.h:13 -msgid "Video Tape Face Labels" -msgstr "ビデオ・テープの表面ラベル" - -#: data/templates/avery-us-templates.xml.h:14 -msgid "Video Tape Spine Labels" -msgstr "ビデオ・テープの背面ラベル" - -#: data/templates/avery-iso-templates.xml.h:1 -msgid "Address labels" -msgstr "宛名のラベル" - -#: data/templates/avery-iso-templates.xml.h:3 -msgid "CD Booklet" -msgstr "CD の小冊子" - -#: data/templates/avery-iso-templates.xml.h:4 -msgid "CD Inlet" -msgstr "CD のインレット" - -#: data/templates/avery-iso-templates.xml.h:5 -#: data/templates/zweckform-iso-templates.xml.h:4 -#: data/templates/misc-us-templates.xml.h:4 -#: data/templates/misc-iso-templates.xml.h:10 -msgid "CD/DVD Labels" -msgstr "CD/DVD のラベル" - -#: data/templates/avery-iso-templates.xml.h:6 -msgid "Diskette labels" -msgstr "フロッピーのラベル" - -#: data/templates/avery-iso-templates.xml.h:7 -#: data/templates/zweckform-iso-templates.xml.h:7 -#: data/templates/misc-iso-templates.xml.h:17 -msgid "Mailing Labels" -msgstr "封筒のラベル" - -#: data/templates/avery-iso-templates.xml.h:8 -msgid "Mailing labels" -msgstr "封筒のラベル" - -#: data/templates/avery-iso-templates.xml.h:9 -msgid "Mini Address Labels" -msgstr "小さな宛名のラベル" - -#: data/templates/avery-iso-templates.xml.h:10 -msgid "Shipping labels" -msgstr "出荷ラベル" - -#: data/templates/zweckform-iso-templates.xml.h:2 -msgid "Allround Labels" -msgstr "汎用的なラベル" - -#: data/templates/zweckform-iso-templates.xml.h:5 -msgid "Correction and Cover-up Labels" -msgstr "コレクションとカバーのラベル" - -#: data/templates/zweckform-iso-templates.xml.h:6 -msgid "Lever Arch File Labels" -msgstr "レバー・アーチ・ファイルのラベル" - -#: data/templates/zweckform-iso-templates.xml.h:8 -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "QSL-Karten Etiketten (70mm x 50.8mm)" - -#: data/templates/zweckform-iso-templates.xml.h:9 -msgid "Rectangular Copier Labels" -msgstr "長方形のコピー機のラベル" - -#: data/templates/zweckform-iso-templates.xml.h:10 -#: data/templates/misc-iso-templates.xml.h:22 -msgid "Rectangular Labels" -msgstr "長方形のラベル" - -#: data/templates/zweckform-iso-templates.xml.h:11 -msgid "Video Labels (back)" -msgstr "ビデオのラベル (裏側)" - -#: data/templates/misc-us-templates.xml.h:1 -msgid "Business Card CD" -msgstr "名刺 CD" - -#: data/templates/misc-us-templates.xml.h:3 -msgid "CD Template Rectangles" -msgstr "CD テンプレート (長方形)" - -#: data/templates/misc-us-templates.xml.h:5 -msgid "CD/DVD Labels (Face Only)" -msgstr "CD/DVD のラベル (外側のみ)" - -#: data/templates/misc-us-templates.xml.h:6 -#: data/templates/misc-iso-templates.xml.h:11 -msgid "CD/DVD Labels (face only)" -msgstr "CD/DVD のラベル (外側のみ)" - -#: data/templates/misc-us-templates.xml.h:7 -msgid "DLT Labels" -msgstr "DLT のラベル" - -#: data/templates/misc-us-templates.xml.h:8 -msgid "Microtube labels" -msgstr "マイクロチューブのラベル" - -#: data/templates/misc-us-templates.xml.h:9 -msgid "Mini-CD Labels" -msgstr "ミニ CD のラベル" - -#: data/templates/misc-us-templates.xml.h:10 -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "PRO CD のラベル二枚 (CD 格納ケースのみ)" - -#: data/templates/misc-us-templates.xml.h:11 -msgid "PRO CD Labels 2-up (Face only)" -msgstr "PRO CD ラベル二枚 (外側のみ)" - -#: data/templates/misc-us-templates.xml.h:12 -#: data/templates/misc-iso-templates.xml.h:21 -msgid "PRO CD Labels 2-up (face only)" -msgstr "PRO CD ラベル二枚 (外側のみ)" - -#: data/templates/misc-us-templates.xml.h:13 -msgid "Slimline CD Case (rightside up)" -msgstr "薄い CD フォルダ (右側)" - -#: data/templates/misc-us-templates.xml.h:14 -msgid "Slimline CD Case (upside down)" -msgstr "薄い CD フォルダ (上側)" - -#: data/templates/misc-iso-templates.xml.h:1 -msgid "Agipa 119488: Business Cards" -msgstr "Agipa 119488: 名刺" - -#: data/templates/misc-iso-templates.xml.h:2 -msgid "Allround Labels --24" -msgstr "汎用的なラベル --24" - -#: data/templates/misc-iso-templates.xml.h:3 -msgid "Allround Labels --44" -msgstr "汎用的なラベル --44" - -#: data/templates/misc-iso-templates.xml.h:4 -msgid "Allround Labels --64" -msgstr "汎用的なラベル --64" - -#: data/templates/misc-iso-templates.xml.h:5 -msgid "Allround Labels --65" -msgstr "汎用的なラベル --65" - -#: data/templates/misc-iso-templates.xml.h:6 -msgid "Arch File Labels" -msgstr "アーチ・ファイルのラベル" - -#: data/templates/misc-iso-templates.xml.h:7 -msgid "Arch File Labels (large)" -msgstr "アーチ・ファイルのラベル (大)" - -#: data/templates/misc-iso-templates.xml.h:8 -msgid "Arch File Labels (small)" -msgstr "アーチ・ファイルのラベル (小)" - -#: data/templates/misc-iso-templates.xml.h:12 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "CD/DVD のラベル標準書式 (外側のみ)" - -#: data/templates/misc-iso-templates.xml.h:13 -msgid "Diskette Labels (face only)" -msgstr "フロッピーのラベル (外側のみ)" - -#: data/templates/misc-iso-templates.xml.h:14 -msgid "EPSON Photo Stickers 16" -msgstr "EPSON フォト・ステッカー 16" - -#: data/templates/misc-iso-templates.xml.h:15 -msgid "Etiketten" -msgstr "Etiketten" - -#: data/templates/misc-iso-templates.xml.h:16 -msgid "Fridge Magnet Stickers" -msgstr "冷蔵庫に貼る磁気ステッカ" - -#: data/templates/misc-iso-templates.xml.h:18 -msgid "Mailing Labels --14" -msgstr "封筒のラベル --14" - -#: data/templates/misc-iso-templates.xml.h:19 -msgid "Mailing Labels-2 columns" -msgstr "封筒のラベル (二列)" - -#: data/templates/misc-iso-templates.xml.h:20 -msgid "Mailing Labels-3 columns" -msgstr "封筒のラベル (三列)" - -#: data/templates/misc-iso-templates.xml.h:23 -msgid "Video Labels (face only)" -msgstr "ビデオのラベル (外側のみ)" - -#: data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers" -msgstr "ラベルや名刺、メディアのカバーを生成します" - -#: data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "gLabels ラベル・デザイナ" - -#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 -msgid "gLabels Project File" -msgstr "gLabels のプロジェクト・ファイル" diff --git a/glabels2/po/ko.po b/glabels2/po/ko.po deleted file mode 100644 index f908f70a..00000000 --- a/glabels2/po/ko.po +++ /dev/null @@ -1,2543 +0,0 @@ -# gLabels 한국어 번역 파일입니다. -# -# -msgid "" -msgstr "" -"Project-Id-Version: glabels 2.3. pre0svn\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2004-08-15 18:13-0400\n" -"PO-Revision-Date: 2008-02-26 10:59+0900\n" -"Last-Translator: YunSeok Choi \n" -"Language-Team: none\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: src/glabels.c:55 -msgid "Show view debugging messages." -msgstr "보기의 디버깅 메시지를 보이기" - -#: src/glabels.c:58 -msgid "Show item debugging messages." -msgstr "아이템 디버깅 메시지를 보이기" - -#: src/glabels.c:61 -msgid "Show printing debugging messages." -msgstr "인쇄 디버깅 메시지를 보이기" - -#: src/glabels.c:64 -msgid "Show prefs debugging messages." -msgstr "Prefs 디버깅 메시지를 보이기" - -#: src/glabels.c:67 -msgid "Show file debugging messages." -msgstr "파일 디버깅 메시지를 보이기" - -#: src/glabels.c:70 -msgid "Show document debugging messages." -msgstr "문서 디버깅 메시지를 보이기" - -#: src/glabels.c:73 -msgid "Show template debugging messages." -msgstr "Template 디버깅 메시지를 보이기" - -#: src/glabels.c:76 -msgid "Show paper debugging messages." -msgstr "Paper 디버깅 메시지를 보이기" - -#: src/glabels.c:79 -msgid "Show xml debugging messages." -msgstr "XML 디버깅 메시지를 보이기" - -#: src/glabels.c:82 -msgid "Show document merge debugging messages." -msgstr "Document 여백 디버깅 메시지를 보이기" - -#: src/glabels.c:85 -msgid "Show commands debugging messages." -msgstr "Command 디버깅 메시지를 보이기" - -#: src/glabels.c:88 -msgid "Show undo debugging messages." -msgstr "Undo 디버깅 메시지를 보이기" - -#: src/glabels.c:91 -msgid "Show recent debugging messages." -msgstr "최근의 디버깅 메시지를 보이기" - -#: src/glabels.c:94 -msgid "Show window debugging messages." -msgstr "윈도우 디버깅 메시지를 보이기" - -#: src/glabels.c:97 -msgid "Show ui debugging messages." -msgstr "GUI 디버깅 메시지를 보이기" - -#: src/glabels.c:100 -msgid "Show property_bar debugging messages." -msgstr "속성도구 디버깅 메시지를 보이기" - -#: src/glabels.c:103 -msgid "Show media select widget debugging messages." -msgstr "선택 제품 미디어 디버깅 메시지를 보이기" - -#: src/glabels.c:106 -msgid "Show mini preview widget debugging messages." -msgstr "제품 작게 미리보기 디버깅 메시지를 보이기" - -#: src/glabels.c:109 -msgid "Show pixbuf cache debugging messages." -msgstr "pixbuf cache 디버깅 메시지를 보이기" - -#: src/glabels.c:112 -msgid "Show widget debugging messages." -msgstr "제품 디버깅 메시지를 보이기" - -#: src/glabels.c:115 -msgid "Show object editor debugging messages." -msgstr "개채 편집기 디버깅 메시지를 보이기" - -#: src/glabels.c:118 -msgid "Turn on all debugging messages." -msgstr "모든 디버깅 메시지 켜기" - -#: src/glabels.c:187 -msgid "Could not initialize Bonobo!\n" -msgstr "Bonobo 초기화 할 수 없음!\n" - -#: src/glabels-batch.c:48 -msgid "print this message" -msgstr "이 메시지를 인쇄" - -#: src/glabels-batch.c:50 -msgid "print the version of glabels-batch being used" -msgstr "gLabel-batch 버전 인쇄" - -#: src/glabels-batch.c:52 -msgid "set output filename (default=\"output.ps\")" -msgstr "출력 파일이름 지정 (기본 = \"output.ps\")" - -#: src/glabels-batch.c:52 -msgid "filename" -msgstr "파일이름" - -#: src/glabels-batch.c:54 -msgid "number of sheets (default=1)" -msgstr "용지 수(기본= 1)" - -#: src/glabels-batch.c:54 -msgid "sheets" -msgstr "용지" - -#: src/glabels-batch.c:56 -msgid "number of copies (default=1)" -msgstr "복사 수(기본= 1)" - -#: src/glabels-batch.c:56 -msgid "copies" -msgstr "복사" - -#: src/glabels-batch.c:58 -#: src/print-dialog.c:336 -msgid "print outlines (to test printer alignment)" -msgstr "외곽선 인쇄 (프린터 정렬 테스트)" - -#: src/glabels-batch.c:60 -#: src/print-dialog.c:344 -msgid "print in reverse (i.e. a mirror image)" -msgstr "거꾸로 인쇄 (거울 효과)" - -#: src/glabels-batch.c:96 -msgid "[OPTION...] GLABELS_FILE..." -msgstr "[옵션...] gLabels 파일..." - -#: src/glabels-batch.c:116 -#, c-format -msgid "missing glabels file\n" -msgstr "gLabel 파일이 보이지 않음\n" - -#: src/glabels-batch.c:157 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "gLabel 파일 %s 을(를) 열 수 없습니다.\n" - -#: src/window.c:244 -msgid "(none) - gLabels" -msgstr "(없음) - gLabels" - -#: src/window.c:414 -msgid "(modified)" -msgstr "(수정됨)" - -#: src/stock.c:65 -#: data/ui/glabels-ui.xml.h:165 -msgid "_Select Mode" -msgstr "모드 선택(_S)" - -#: src/stock.c:66 -#: data/ui/glabels-ui.xml.h:166 -msgid "_Text" -msgstr "글자(_T)" - -#: src/stock.c:67 -#: data/ui/glabels-ui.xml.h:151 -msgid "_Line" -msgstr "선(_L)" - -#: src/stock.c:68 -#: data/ui/glabels-ui.xml.h:133 -msgid "_Box" -msgstr "사각형(_B)" - -#: src/stock.c:69 -#: data/ui/glabels-ui.xml.h:144 -msgid "_Ellipse" -msgstr "타원(_E)" - -#: src/stock.c:70 -#: data/ui/glabels-ui.xml.h:149 -msgid "_Image" -msgstr "그림(_I)" - -#: src/stock.c:71 -#: data/ui/glabels-ui.xml.h:11 -msgid "Bar_code" -msgstr "바코드(_C)" - -#: src/stock.c:72 -msgid "_Merge Properties" -msgstr "여백 속성(_M)" - -#: src/stock.c:73 -msgid "Object _Properties" -msgstr "항목 속성(_P)" - -#: src/stock.c:74 -#: data/ui/glabels-ui.xml.h:13 -msgid "Bring to _Front" -msgstr "앞으로 내기(_F)" - -#: src/stock.c:75 -#: data/ui/glabels-ui.xml.h:110 -msgid "Send to _Back" -msgstr "뒤로 보내기(_B)" - -#: src/stock.c:76 -#: data/ui/glabels-ui.xml.h:97 -msgid "Rotate _Left" -msgstr "왼쪽으로 회전(_L)" - -#: src/stock.c:77 -#: data/ui/glabels-ui.xml.h:98 -msgid "Rotate _Right" -msgstr "오른쪽으로 회전(_R)" - -#: src/stock.c:78 -#: data/ui/glabels-ui.xml.h:52 -msgid "Flip _Horizontally" -msgstr "수직 뒤집기(_H)" - -#: src/stock.c:79 -#: data/ui/glabels-ui.xml.h:53 -msgid "Flip _Vertically" -msgstr "수평 뒤집기(_V)" - -#: src/stock.c:80 -#: data/ui/glabels-ui.xml.h:150 -msgid "_Lefts" -msgstr "좌측(_L)" - -#: src/stock.c:81 -#: data/ui/glabels-ui.xml.h:162 -msgid "_Rights" -msgstr "우측(_R)" - -#: src/stock.c:82 -#: data/ui/glabels-ui.xml.h:134 -msgid "_Centers" -msgstr "중앙(_C)" - -#: src/stock.c:83 -#: data/ui/glabels-ui.xml.h:167 -msgid "_Tops" -msgstr "상위(_T)" - -#: src/stock.c:84 -msgid "Bottoms" -msgstr "하위" - -#: src/stock.c:85 -msgid "Centers" -msgstr "중앙" - -#: src/stock.c:86 -#: src/stock.c:87 -#: data/ui/glabels-ui.xml.h:62 -msgid "Label Ce_nter" -msgstr "라벨 중앙(_N)" - -#: src/stock.c:88 -#: data/ui/glabels-ui.xml.h:51 -msgid "Fill color" -msgstr "색 채우기" - -#: src/stock.c:89 -#: data/ui/glabels-ui.xml.h:64 -msgid "Line color" -msgstr "선 색상" - -#: src/stock.c:90 -#: src/stock.c:92 -msgid "Linked" -msgstr "연결" - -#: src/stock.c:91 -#: src/stock.c:93 -msgid "Not Linked" -msgstr "연결되지 않음" - -#: src/ui-property-bar.c:345 -#: src/object-editor.c:499 -msgid "Default" -msgstr "기본" - -#: src/ui-property-bar.c:360 -#: src/object-editor.c:512 -msgid "No fill" -msgstr "채우기 없음" - -#: src/ui-property-bar.c:375 -#: src/object-editor.c:505 -msgid "No line" -msgstr "선 없음" - -#: src/ui-sidebar.c:180 -msgid "Object properties" -msgstr "항목 속성" - -#: src/commands.c:385 -msgid "" -"A label and business card creation program for GNOME.\n" -" \n" -"Glabels is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n" -" \n" -"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.\n" -msgstr "" -"GNOME 에서 Labelê³¼ 명함을 제작하는 프로그램입니다.\n" -"\n" -"Glabels는 자유소프트웨어 입니다; 여러분은 이 프로그램을 GNU(General Public License)에 따라 자유롭게 수정 배포 할 수 있습니다. 이 프로그램은 GNU의 Ver.2 를 따르고 있습니다. \n" -"\n" -"이 프로그램은 어떠한 저작권료 없이 사용되어 질 수 있습니다.(번역주 : 번역자는 GNU를 깊이 알지 못합니다. 이 부분의 번역에 지적하고픈 부분이 있다면 번역 자료와 함께 연락주십시오. xein@naver.com)\n" - -#: src/commands.c:399 -msgid "See the file AUTHORS for additional credits," -msgstr "참여 제작자 AUTHORS 파일을 보세요." - -#: src/commands.c:400 -msgid "or visit http://glabels.sourceforge.net/" -msgstr "또는 이곳을 방문 하세요. http://glabels.sourceforge.net/" - -#: src/commands.c:409 -msgid " " -msgstr " " - -#: src/commands.c:424 -msgid "glabels" -msgstr "gLabels" - -#: src/file.c:100 -msgid "New Label or Card" -msgstr "새 라벨 또는 카드" - -#: src/file.c:132 -#: src/file.c:304 -msgid "Media Type" -msgstr "매체 형식" - -#: src/file.c:138 -#: src/file.c:310 -msgid "Label orientation" -msgstr "라벨의 방향" - -#: src/file.c:269 -msgid "Label properties" -msgstr "라벨 속성" - -#: src/file.c:452 -#: src/file.c:870 -msgid "All files" -msgstr "모든 파일" - -#: src/file.c:457 -#: src/file.c:875 -msgid "gLabels documents" -msgstr "gLabels 문서" - -#: src/file.c:505 -#: src/file.c:617 -#: src/file.c:934 -#: src/file.c:1130 -msgid "Empty file name selection" -msgstr "비어있는 파일 이름" - -#: src/file.c:506 -#: src/file.c:520 -#: src/file.c:618 -#: src/file.c:632 -msgid "Please select a file or supply a valid file name" -msgstr "지원하는 파일을 선택하세요." - -#: src/file.c:519 -#: src/file.c:631 -msgid "File does not exist" -msgstr "파일이 없습니다." - -#: src/file.c:563 -#: data/ui/glabels-ui.xml.h:75 -msgid "Open" -msgstr "열기" - -#: src/file.c:565 -msgid "Open label" -msgstr "라벨 열기" - -#: src/file.c:707 -#, c-format -msgid "Could not open file \"%s\"" -msgstr "\"%s\" 파일을 열 수 없습니다." - -#: src/file.c:715 -msgid "Not a supported file format" -msgstr "지원되지 않는 파일 형식" - -#: src/file.c:797 -#: src/file.c:979 -#: src/file.c:1174 -#, c-format -msgid "Could not save file \"%s\"" -msgstr "\"%s\" 파일을 저장할 수 없습니다." - -#: src/file.c:805 -#: src/file.c:987 -#: src/file.c:1182 -msgid "Error encountered during save. The file is still not saved." -msgstr "저장하는데 오류가 발생했습니다. 파일을 저장하지 못했습니다." - -#: src/file.c:848 -#: src/file.c:1048 -#, c-format -msgid "Save \"%s\" as" -msgstr "\"%s\" 이름으로 저장" - -#: src/file.c:935 -#: src/file.c:1131 -msgid "Please supply a valid file name" -msgstr "유효한 파일이름이 필요합니다." - -#: src/file.c:952 -#: src/file.c:1147 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "\"%s\"파일이름으로 덮어쓰시겠습니까?" - -#: src/file.c:960 -#: src/file.c:1155 -msgid "File already exists." -msgstr "파일이름이 존재합니다." - -#: src/file.c:1271 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "닫기전에 바뀐부분을 \"%s\"이름으로 저장하시겠습니까?" - -#: src/file.c:1279 -msgid "Your changes will be lost if you don't save them." -msgstr "저장하지 않으면, 바뀐부분을 잃어버리게 됩니다." - -#: src/file.c:1282 -msgid "Close without saving" -msgstr "저장없이 닫기" - -#. Should not happen -#: src/prefs.c:156 -#: src/prefs.c:163 -#: data/glade/prefs-dialog.glade.h:23 -#: data/glade/object-editor.glade.h:37 -msgid "points" -msgstr "포인트" - -#: src/prefs.c:158 -#: data/glade/object-editor.glade.h:36 -#: data/glade/template-designer.glade.h:74 -msgid "inches" -msgstr "[인치]" - -#: src/prefs.c:160 -msgid "mm" -msgstr "[밀리미터]" - -#: src/prefs-dialog.c:248 -#: data/glade/prefs-dialog.glade.h:22 -msgid "gLabels Preferences" -msgstr "gLabels 환경설정" - -#. -#. * Submenu: Order -#. -#: src/view.c:3570 -#: data/ui/glabels-ui.xml.h:157 -msgid "_Order" -msgstr "순서(_O)" - -#. -#. * Submenu: Rotate/Flip -#. -#: src/view.c:3591 -#: data/ui/glabels-ui.xml.h:163 -msgid "_Rotate/Flip" -msgstr "회전/뒤집기(_R)" - -#. -#. * Submenu: Align Horizontally -#. -#: src/view.c:3624 -msgid "Align _Horizontally" -msgstr "가로로 정렬(_H)" - -#. -#. * Submenu: Align Vertically -#. -#: src/view.c:3663 -msgid "Align _Vertically" -msgstr "세로로 정렬(_V)" - -#: src/view.c:3724 -#: data/ui/glabels-ui.xml.h:140 -msgid "_Delete" -msgstr "삭제(_D)" - -#. Build editor. -#: src/view-box.c:223 -msgid "Box object properties" -msgstr "사각형 개체 속성" - -#. Build editor. -#: src/view-ellipse.c:223 -msgid "Ellipse object properties" -msgstr "타원 개체 속성" - -#. Build editor. -#: src/view-line.c:223 -msgid "Line object properties" -msgstr "선 개체 속성" - -#. Build editor. -#: src/view-image.c:222 -msgid "Image object properties" -msgstr "그림 개체 속성" - -#. Build editor. -#: src/view-text.c:250 -msgid "Text object properties" -msgstr "글자 개체 속성" - -#: src/view-text.c:562 -#: data/glade/object-editor.glade.h:28 -msgid "Text" -msgstr "글자" - -#. Build editor. -#: src/view-barcode.c:209 -msgid "Barcode object properties" -msgstr "바코드 개체 속성" - -#: src/view-barcode.c:579 -#: src/print.c:1088 -msgid "Invalid barcode data" -msgstr "잘못된 바코드 데이터" - -#: src/merge-properties-dialog.c:231 -msgid "Merge Properties" -msgstr "여백 속성" - -#. ---- Source section ---- -#: src/merge-properties-dialog.c:237 -msgid "Source" -msgstr "소스" - -#: src/merge-properties-dialog.c:245 -msgid "Format:" -msgstr "서식:" - -#. Location line -#: src/merge-properties-dialog.c:273 -msgid "Location:" -msgstr "장소:" - -#: src/merge-properties-dialog.c:282 -#: src/merge-properties-dialog.c:393 -msgid "Select merge-database source" -msgstr "병합 데이터베이스 소스 선택" - -#: src/merge-properties-dialog.c:289 -#: src/merge-properties-dialog.c:404 -msgid "N/A" -msgstr "N/A" - -#. ---- Sample Fields section ---- -#: src/merge-properties-dialog.c:300 -msgid "Record selection/preview:" -msgstr "선택 기록/미리보기:" - -#: src/merge-properties-dialog.c:326 -msgid "Select" -msgstr "선택" - -#: src/merge-properties-dialog.c:334 -msgid "Record/Field" -msgstr "기록/범위" - -#: src/merge-properties-dialog.c:342 -#: data/glade/object-editor.glade.h:9 -msgid "Data" -msgstr "데이터" - -#: src/print-dialog.c:266 -#: data/ui/glabels-ui.xml.h:82 -msgid "Print" -msgstr "인쇄" - -#: src/print-dialog.c:281 -msgid "_Job" -msgstr "작업(_J)" - -#: src/print-dialog.c:286 -msgid "P_rinter" -msgstr "프린터(_R)" - -#. ----------- Add simple-copies widget ------------ -#: src/print-dialog.c:314 -msgid "Copies" -msgstr "매수" - -#. ------- Add merge control widget ------------ -#: src/print-dialog.c:322 -msgid "Document merge control" -msgstr "문서 여백 제어" - -#. ----------- Add custom print options area ------------ -#: src/print-dialog.c:330 -msgid "Options" -msgstr "옵션" - -#: src/print-dialog.c:351 -msgid "print crop marks" -msgstr "자르기 표시 인쇄" - -#: src/print-dialog.c:553 -#: src/print-dialog.c:592 -msgid "Print preview" -msgstr "인쇄 미리보기" - -#: src/template-designer.c:409 -#: data/glade/template-designer.glade.h:73 -msgid "gLabels Template Designer" -msgstr "gLabels 서식 디자이너" - -#: src/bc.c:60 -msgid "POSTNET (any)" -msgstr "POSTNET (임의)" - -#: src/bc.c:63 -msgid "POSTNET-5 (ZIP only)" -msgstr "POSTNET-5 (ZIP만)" - -#: src/bc.c:66 -msgid "POSTNET-9 (ZIP+4)" -msgstr "POSTNET-9 (ZIP+4)" - -#: src/bc.c:69 -msgid "POSTNET-11 (DPBC)" -msgstr "POSTNET-11 (DPBC)" - -#: src/bc.c:72 -msgid "EAN (any)" -msgstr "EAN (임의)" - -#: src/bc.c:75 -msgid "EAN-8" -msgstr "EAN-8" - -#: src/bc.c:78 -msgid "EAN-8 +2" -msgstr "EAN-8 +2" - -#: src/bc.c:81 -msgid "EAN-8 +5" -msgstr "EAN-8 +5" - -#: src/bc.c:84 -msgid "EAN-13" -msgstr "EAN-13" - -#: src/bc.c:87 -msgid "EAN-13 +2" -msgstr "EAN-13 +2" - -#: src/bc.c:90 -msgid "EAN-13 +5" -msgstr "EAN-13 +5" - -#: src/bc.c:93 -msgid "UPC (UPC-A or UPC-E)" -msgstr "UPC (UPC-A 또는 UPC-E)" - -#: src/bc.c:96 -msgid "UPC-A" -msgstr "UPC-A" - -#: src/bc.c:99 -msgid "UPC-A +2" -msgstr "UPC-A +2" - -#: src/bc.c:102 -msgid "UPC-A +5" -msgstr "UPC-A +5" - -#: src/bc.c:105 -msgid "UPC-E" -msgstr "UPC-E" - -#: src/bc.c:108 -msgid "UPC-E +2" -msgstr "UPC-E +2" - -#: src/bc.c:111 -msgid "UPC-E +5" -msgstr "UPC-E +5" - -#: src/bc.c:114 -msgid "ISBN" -msgstr "ISBN" - -#: src/bc.c:117 -msgid "ISBN +5" -msgstr "ISBN +5" - -#: src/bc.c:120 -msgid "Code 39" -msgstr "Code 39" - -#: src/bc.c:123 -msgid "Code 128" -msgstr "Code 128" - -#: src/bc.c:126 -msgid "Code 128C" -msgstr "Code 128C" - -#: src/bc.c:129 -msgid "Code 128B" -msgstr "Code 128B" - -#: src/bc.c:132 -msgid "Interleaved 2 of 5" -msgstr "Interleaved 2 of 5" - -#: src/bc.c:135 -msgid "Codabar" -msgstr "Codabar" - -#: src/bc.c:138 -msgid "MSI" -msgstr "MSI" - -#: src/bc.c:141 -msgid "Plessey" -msgstr "Plessey" - -#: src/label.c:569 -msgid "Untitled" -msgstr "제목없음" - -#: src/xml-label.c:176 -#: src/xml-label.c:213 -msgid "xmlParseFile error" -msgstr "xmlParse파일 오류" - -#: src/xml-label.c:250 -msgid "No document root" -msgstr "root 문서가 아님" - -#: src/xml-label.c:264 -msgid "Importing from glabels 0.1 format" -msgstr "gLabels 0.1로 부터 가져오기" - -#: src/xml-label.c:272 -msgid "Importing from glabels 0.4 format" -msgstr "gLabels 0.4로 부터 가져오기" - -#: src/xml-label.c:279 -msgid "Importing from glabels 1.91 format" -msgstr "gLabels 1.91로 부터 가져오기" - -#: src/xml-label.c:282 -msgid "bad document, unknown glabels Namespace" -msgstr "잘못된 문서, 알 수 없는 Glabels 이름공간" - -#: src/xml-label.c:311 -#: src/xml-label-04.c:75 -#: src/xml-label-191.c:131 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "잘못된 Root 노드 = \"%s\"" - -#: src/xml-label.c:348 -#: src/xml-label-191.c:165 -#, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "문서 노드 내의 잘못된 노드 = \"%s\"" - -#: src/xml-label.c:393 -#: src/xml-label-04.c:123 -#: src/xml-label-191.c:197 -#, c-format -msgid "bad node = \"%s\"" -msgstr "잘못된 노드 = \"%s\"" - -#: src/xml-label.c:796 -#: src/xml-label-191.c:605 -#, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "데이터 노드 내의 잘못된 노드 = \"%s\"" - -#: src/xml-label.c:962 -#: libglabels/xml-template.c:535 -msgid "Utf8 conversion error." -msgstr "Utf8 변환 에러" - -#: src/xml-label.c:969 -#: libglabels/xml-template.c:542 -msgid "Problem saving xml file." -msgstr "XML 파일 저장에 문제가 있습니다." - -#. This should always be an id, but just in case a name -#. slips by! -#: src/xml-label-191.c:680 -#: libglabels/xml-template.c:199 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "알 수 없는 용지 크기 ID \"%s\"。名前として扱います。" - -#: src/xml-label-191.c:690 -#: libglabels/xml-template.c:209 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "알 수 없는 용지 크기 ID 또는 이름 \"%s\"" - -#: src/merge.c:172 -#: src/merge.c:213 -#: src/merge.c:399 -#: src/merge.c:402 -msgid "None" -msgstr "없음" - -#: src/merge-init.c:53 -msgid "Text file with comma delimeters (CSV)" -msgstr "콤마로 구분된 텍스트파일(CSV)" - -#: src/merge-init.c:60 -msgid "Text file with colon delimeters" -msgstr "콜론으로 구분된 텍스트 파일" - -#: src/merge-init.c:67 -msgid "Text file with tab delimeters" -msgstr "텝으로 구분된 텍스트 파일" - -#: src/wdgt-image-select.c:201 -#: data/glade/object-editor.glade.h:11 -msgid "File:" -msgstr "파일:" - -#: src/wdgt-image-select.c:245 -#: data/glade/object-editor.glade.h:16 -msgid "Key:" -msgstr "키:" - -#: src/wdgt-print-copies.c:179 -msgid "Sheets:" -msgstr "용지:" - -#: src/wdgt-print-copies.c:197 -msgid "Labels" -msgstr "라벨" - -#: src/wdgt-print-copies.c:200 -msgid "from:" -msgstr "부터:" - -#: src/wdgt-print-copies.c:207 -msgid "to:" -msgstr "에게:" - -#: src/wdgt-print-merge.c:178 -msgid "Start on label" -msgstr "라벨의 시작" - -#: src/wdgt-print-merge.c:186 -msgid "on 1st sheet" -msgstr "첫번째 용지에서" - -#: src/wdgt-print-merge.c:195 -msgid "Copies:" -msgstr "매수:" - -#: src/wdgt-print-merge.c:201 -msgid "Collate" -msgstr "제본" - -#: src/wdgt-media-select.c:269 -#: data/glade/template-designer.glade.h:29 -msgid "Description:" -msgstr "설명:" - -#: src/wdgt-media-select.c:279 -#: data/glade/template-designer.glade.h:53 -msgid "Page size:" -msgstr "용지 크기:" - -#: src/wdgt-media-select.c:290 -msgid "Label size:" -msgstr "라벨 크기:" - -#: src/wdgt-media-select.c:301 -msgid "Layout:" -msgstr "배치:" - -#: src/wdgt-media-select.c:578 -#, c-format -msgid "%d x %d (%d per sheet)" -msgstr "%d x %d (용지의 %d)" - -#: src/wdgt-media-select.c:582 -#, c-format -msgid "%d per sheet" -msgstr "용지의 %d" - -#: src/wdgt-media-select.c:614 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -#: src/wdgt-media-select.c:619 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: src/wdgt-media-select.c:630 -#: src/wdgt-media-select.c:644 -#, c-format -msgid "%s %s diameter" -msgstr "지름 %s %s" - -#: src/wdgt-media-select.c:634 -#: src/wdgt-media-select.c:648 -#, c-format -msgid "%.5g %s diameter" -msgstr "지름 %.5g %s" - -#: src/wdgt-rotate-label.c:193 -msgid "Rotate" -msgstr "회전" - -#. This is the default custom color -#: src/mygal/color-palette.c:396 -msgid "custom" -msgstr "임의의" - -#. "Custom" color - we'll pop up a GnomeColorPicker -#: src/mygal/color-palette.c:438 -msgid "Custom Color:" -msgstr "임의의 색상:" - -#: src/mygal/color-palette.c:446 -msgid "Choose Custom Color" -msgstr "임의의 색상 선택" - -#: src/mygal/color-palette.c:579 -msgid "black" -msgstr "검은색" - -#: src/mygal/color-palette.c:580 -msgid "light brown" -msgstr "밝은 갈색" - -#: src/mygal/color-palette.c:581 -msgid "brown gold" -msgstr "고동색" - -#: src/mygal/color-palette.c:582 -msgid "dark green #2" -msgstr "어두운 녹색 #2" - -#: src/mygal/color-palette.c:583 -msgid "navy" -msgstr "남색" - -#: src/mygal/color-palette.c:584 -#: src/mygal/color-palette.c:640 -msgid "dark blue" -msgstr "어두운 파랑색" - -#: src/mygal/color-palette.c:585 -msgid "purple #2" -msgstr "자주색 #2" - -#: src/mygal/color-palette.c:586 -msgid "very dark gray" -msgstr "매우 어두운 회색" - -#: src/mygal/color-palette.c:589 -#: src/mygal/color-palette.c:645 -msgid "dark red" -msgstr "어두운 빨강색" - -#: src/mygal/color-palette.c:590 -msgid "red-orange" -msgstr "적오렌지색" - -#: src/mygal/color-palette.c:591 -msgid "gold" -msgstr "금색" - -#: src/mygal/color-palette.c:592 -msgid "dark green" -msgstr "어두운 녹색" - -#: src/mygal/color-palette.c:593 -#: src/mygal/color-palette.c:646 -msgid "dull blue" -msgstr "탁한 파랑색" - -#: src/mygal/color-palette.c:594 -#: src/mygal/color-palette.c:647 -msgid "blue" -msgstr "파랑색" - -#: src/mygal/color-palette.c:595 -msgid "dull purple" -msgstr "탁한 자주색" - -#: src/mygal/color-palette.c:596 -msgid "dark grey" -msgstr "어두운 회색" - -#: src/mygal/color-palette.c:599 -msgid "red" -msgstr "빨강색" - -#: src/mygal/color-palette.c:600 -msgid "orange" -msgstr "오렌지색" - -#: src/mygal/color-palette.c:601 -msgid "lime" -msgstr "라임색" - -#: src/mygal/color-palette.c:602 -msgid "dull green" -msgstr "탁한 녹색" - -#: src/mygal/color-palette.c:603 -msgid "dull blue #2" -msgstr "탁한 파랑색#2" - -#: src/mygal/color-palette.c:604 -msgid "sky blue #2" -msgstr "하늘색 #2" - -#: src/mygal/color-palette.c:605 -#: src/mygal/color-palette.c:644 -msgid "purple" -msgstr "자주색" - -#: src/mygal/color-palette.c:606 -msgid "gray" -msgstr "회색" - -#: src/mygal/color-palette.c:609 -#: src/mygal/color-palette.c:641 -msgid "magenta" -msgstr "마젠타색" - -#: src/mygal/color-palette.c:610 -msgid "bright orange" -msgstr "밝은 오렌지색" - -#: src/mygal/color-palette.c:611 -#: src/mygal/color-palette.c:642 -msgid "yellow" -msgstr "노랑색" - -#: src/mygal/color-palette.c:612 -msgid "green" -msgstr "녹색" - -#: src/mygal/color-palette.c:613 -#: src/mygal/color-palette.c:643 -msgid "cyan" -msgstr "청록색" - -#: src/mygal/color-palette.c:614 -msgid "bright blue" -msgstr "밝은 파랑색" - -#: src/mygal/color-palette.c:615 -#: src/mygal/color-palette.c:632 -msgid "red purple" -msgstr "빨간 자주색" - -#: src/mygal/color-palette.c:616 -msgid "light grey" -msgstr "가벼운 회색" - -#: src/mygal/color-palette.c:619 -#: src/mygal/color-palette.c:636 -msgid "pink" -msgstr "분홍색" - -#: src/mygal/color-palette.c:620 -msgid "light orange" -msgstr "가벼운 오렌지색" - -#: src/mygal/color-palette.c:621 -#: src/mygal/color-palette.c:633 -msgid "light yellow" -msgstr "가벼운 노랑색" - -#: src/mygal/color-palette.c:622 -msgid "light green" -msgstr "가벼운 녹색" - -#: src/mygal/color-palette.c:623 -msgid "light cyan" -msgstr "가벼운 청록색" - -#: src/mygal/color-palette.c:624 -#: src/mygal/color-palette.c:634 -msgid "light blue" -msgstr "가벼운 바랑색" - -#: src/mygal/color-palette.c:625 -#: src/mygal/color-palette.c:638 -msgid "light purple" -msgstr "가벼운 자주색" - -#: src/mygal/color-palette.c:626 -msgid "white" -msgstr "흰색" - -#: src/mygal/color-palette.c:631 -msgid "purplish blue" -msgstr "자주빛 파랑색" - -#: src/mygal/color-palette.c:635 -msgid "dark purple" -msgstr "어두운 자주색" - -#: src/mygal/color-palette.c:637 -msgid "sky blue" -msgstr "하늘색" - -#: libglabels/template.c:848 -#, c-format -msgid "Generic %s full page" -msgstr "Generic %s 전면에 걸친" - -#: libglabels/template.c:897 -msgid "No template files found!" -msgstr "서식파일을 찾을 수 없음!" - -#. Create and append an "Other" entry. -#: libglabels/paper.c:67 -msgid "Other" -msgstr "직접지정" - -#: libglabels/paper.c:361 -msgid "No paper files found!" -msgstr "용지 파일을 찾을 수 없음!" - -#: data/ui/glabels-ui.xml.h:1 -msgid "About glabels" -msgstr "gLabels에 대해" - -#: data/ui/glabels-ui.xml.h:2 -msgid "About..." -msgstr "정보..." - -#: data/ui/glabels-ui.xml.h:3 -msgid "Align _Horizontal" -msgstr "세로로 정렬(_H)" - -#: data/ui/glabels-ui.xml.h:4 -msgid "Align _Vertical" -msgstr "가로로 정렬(_V)" - -#: data/ui/glabels-ui.xml.h:5 -msgid "Align objects to bottoms" -msgstr "개체 아래로 정렬" - -#: data/ui/glabels-ui.xml.h:6 -msgid "Align objects to horizontal centers" -msgstr "개체 세로 중앙으로 정렬" - -#: data/ui/glabels-ui.xml.h:7 -msgid "Align objects to left edges" -msgstr "개체 좌측 가장자리로 정렬" - -#: data/ui/glabels-ui.xml.h:8 -msgid "Align objects to right edges" -msgstr "개체 우측 가장자리로 정렬" - -#: data/ui/glabels-ui.xml.h:9 -msgid "Align objects to tops" -msgstr "개체 상위로 정렬" - -#: data/ui/glabels-ui.xml.h:10 -msgid "Align objects to vertical centers" -msgstr "개체 수평 중앙으로 정렬" - -#: data/ui/glabels-ui.xml.h:12 -msgid "Bold" -msgstr "굵게" - -#: data/ui/glabels-ui.xml.h:14 -msgid "Center align" -msgstr "중앙 정렬" - -#: data/ui/glabels-ui.xml.h:15 -msgid "Center objects to horizontal label center" -msgstr "중앙 개체를 수직라벨 중앙으로" - -#: data/ui/glabels-ui.xml.h:16 -msgid "Center objects to vertical label center" -msgstr "중앙 개체를 수평라벨 중상으로" - -#: data/ui/glabels-ui.xml.h:17 -msgid "Change the visibility of markup lines in the current window" -msgstr "현재 윈도우의 보이는 마크업 선 변경" - -#: data/ui/glabels-ui.xml.h:18 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "현재 윈도우의 보이는 그리기 도구 변경" - -#: data/ui/glabels-ui.xml.h:19 -msgid "Change the visibility of the grid in the current window" -msgstr "현재 윈도우의 보이는 그리드 변경" - -#: data/ui/glabels-ui.xml.h:20 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "현재 윈도우의 보이는 주 도구 변경" - -#: data/ui/glabels-ui.xml.h:21 -msgid "Change the visibility of the property toolbar in the current window" -msgstr "현재 윈도우의 보이는 속성 도구 변경" - -#: data/ui/glabels-ui.xml.h:22 -msgid "Close" -msgstr "닫기" - -#: data/ui/glabels-ui.xml.h:23 -msgid "Close the current file" -msgstr "현재 파일을 닫기" - -#: data/ui/glabels-ui.xml.h:24 -msgid "Configure the application" -msgstr "gLabel 구성" - -#: data/ui/glabels-ui.xml.h:25 -msgid "Contents" -msgstr "목차" - -#: data/ui/glabels-ui.xml.h:26 -msgid "Copy" -msgstr "복사" - -#: data/ui/glabels-ui.xml.h:27 -msgid "Copy the selection" -msgstr "선택 복사" - -#: data/ui/glabels-ui.xml.h:28 -msgid "Create a custom template" -msgstr "임의의 서식 만들기" - -#: data/ui/glabels-ui.xml.h:29 -msgid "Create a new document" -msgstr "새로운 문서 만들기" - -#: data/ui/glabels-ui.xml.h:30 -msgid "Create barcode object" -msgstr "바코드 개체 만들기" - -#: data/ui/glabels-ui.xml.h:31 -msgid "Create box/rectangle object" -msgstr "사각형/직사각형 개체 만들기" - -#: data/ui/glabels-ui.xml.h:32 -msgid "Create ellipse/circle object" -msgstr "타원/원형 개체 만들기" - -#: data/ui/glabels-ui.xml.h:33 -msgid "Create image object" -msgstr "그림 개체 만들기" - -#: data/ui/glabels-ui.xml.h:34 -msgid "Create line object" -msgstr "선 개체 만들기" - -#: data/ui/glabels-ui.xml.h:35 -msgid "Create text object" -msgstr "글자 개체 만들기" - -#: data/ui/glabels-ui.xml.h:36 -msgid "Cu_t" -msgstr "자르기(_T)" - -#: data/ui/glabels-ui.xml.h:37 -msgid "Customize" -msgstr "커스터마이즈" - -#: data/ui/glabels-ui.xml.h:38 -msgid "Customize Drawing Toolbar" -msgstr "그리기 도구 커스터마이즈" - -#: data/ui/glabels-ui.xml.h:39 -msgid "Customize Main Toolbar" -msgstr "주 도구 커스터마이즈" - -#: data/ui/glabels-ui.xml.h:40 -msgid "Customize Property Toolbar" -msgstr "속성 도구 커스터마이즈" - -#: data/ui/glabels-ui.xml.h:41 -msgid "Customize toolbars" -msgstr "도구 커스터마이즈" - -#: data/ui/glabels-ui.xml.h:42 -msgid "Cut" -msgstr "잘라내기" - -#: data/ui/glabels-ui.xml.h:43 -msgid "Cut the selection" -msgstr "선택한것 잘라내기" - -#: data/ui/glabels-ui.xml.h:44 -msgid "Decrease magnification" -msgstr "확대 감소" - -#: data/ui/glabels-ui.xml.h:45 -msgid "Delete" -msgstr "삭제" - -#: data/ui/glabels-ui.xml.h:46 -msgid "Delete the selected objects" -msgstr "선택한 개체 삭제" - -#: data/ui/glabels-ui.xml.h:47 -msgid "Drawing toolbar" -msgstr "그리기 도구" - -#: data/ui/glabels-ui.xml.h:48 -msgid "Dump XML" -msgstr "XML 덤프" - -#: data/ui/glabels-ui.xml.h:49 -msgid "Dump the GUI Xml description" -msgstr "GUI의 XML설명 덤프" - -#: data/ui/glabels-ui.xml.h:50 -msgid "Edit merge properties" -msgstr "여백 속성 편집" - -#: data/ui/glabels-ui.xml.h:54 -msgid "Flip object horizontally" -msgstr "수직 개체 뒤집기" - -#: data/ui/glabels-ui.xml.h:55 -msgid "Flip object vertically" -msgstr "수평 개체 뒤집기" - -#: data/ui/glabels-ui.xml.h:56 -msgid "Font name" -msgstr "글꼴" - -#: data/ui/glabels-ui.xml.h:57 -msgid "Font selector" -msgstr "글꼴 선택기" - -#: data/ui/glabels-ui.xml.h:58 -msgid "Font size" -msgstr "글꼴 크기" - -#: data/ui/glabels-ui.xml.h:59 -msgid "Icon and _Text" -msgstr "아이콘과 글자(_T)" - -#: data/ui/glabels-ui.xml.h:60 -msgid "Increase magnification" -msgstr "상승 확대" - -#: data/ui/glabels-ui.xml.h:61 -msgid "Italic" -msgstr "이탤릭" - -#: data/ui/glabels-ui.xml.h:63 -msgid "Left align" -msgstr "왼쪽 정렬" - -#: data/ui/glabels-ui.xml.h:65 -msgid "Line width" -msgstr "선 넓이" - -#: data/ui/glabels-ui.xml.h:66 -msgid "Lower object to bottom" -msgstr "개체를 하단으로 내리기" - -#: data/ui/glabels-ui.xml.h:67 -msgid "M_arkup" -msgstr "마크업(_A)" - -#: data/ui/glabels-ui.xml.h:68 -msgid "Main toolbar" -msgstr "주 도구" - -#: data/ui/glabels-ui.xml.h:69 -msgid "Markup" -msgstr "마크업" - -#: data/ui/glabels-ui.xml.h:70 -msgid "Modify document properties" -msgstr "문서 속성 고치기" - -#: data/ui/glabels-ui.xml.h:71 -msgid "New" -msgstr "새로 만들기" - -#: data/ui/glabels-ui.xml.h:72 -msgid "Object property editor" -msgstr "항목 속성 편집기" - -#: data/ui/glabels-ui.xml.h:73 -msgid "Only show icons in the drawing toolbar" -msgstr "그리기 도구에서 아이콘만 보이기" - -#: data/ui/glabels-ui.xml.h:74 -msgid "Only show icons in the main toolbar" -msgstr "주 도구에서 아이콘만 보이기" - -#: data/ui/glabels-ui.xml.h:76 -msgid "Open a file" -msgstr "파일 열기" - -#: data/ui/glabels-ui.xml.h:77 -msgid "Open the glabels manual" -msgstr "gLabeles 메뉴얼 열기" - -#: data/ui/glabels-ui.xml.h:78 -msgid "Paste" -msgstr "붙이기" - -#: data/ui/glabels-ui.xml.h:79 -msgid "Paste the clipboard" -msgstr "클립보드에 붙이기" - -#: data/ui/glabels-ui.xml.h:80 -msgid "Pr_eferences..." -msgstr "속성(_E)..." - -#: data/ui/glabels-ui.xml.h:81 -msgid "Preferences" -msgstr "설정" - -#: data/ui/glabels-ui.xml.h:83 -msgid "Print the current file" -msgstr "현재 파일을 인쇄" - -#: data/ui/glabels-ui.xml.h:84 -msgid "Proper_ties..." -msgstr "속성(_T)..." - -#: data/ui/glabels-ui.xml.h:85 -msgid "Properties" -msgstr "속성" - -#: data/ui/glabels-ui.xml.h:86 -msgid "Property toolbar" -msgstr "속성 도구" - -#: data/ui/glabels-ui.xml.h:87 -msgid "Quit" -msgstr "종료" - -#: data/ui/glabels-ui.xml.h:88 -msgid "Quit the program" -msgstr "gLabels을 종료" - -#: data/ui/glabels-ui.xml.h:89 -msgid "Raise object to top" -msgstr "개체를 상위로 올리기" - -#: data/ui/glabels-ui.xml.h:90 -msgid "Recent _Files" -msgstr "최근의 파일(_F)" - -#: data/ui/glabels-ui.xml.h:91 -msgid "Redo" -msgstr "재실행" - -#: data/ui/glabels-ui.xml.h:92 -msgid "Redo the undone action" -msgstr "재실행 할것 없음" - -#: data/ui/glabels-ui.xml.h:93 -msgid "Remove all selections" -msgstr "모든 선택사항 삭제" - -#: data/ui/glabels-ui.xml.h:95 -#, no-c-format -msgid "Restore scale to 100%" -msgstr "100%크기로 복구" - -#: data/ui/glabels-ui.xml.h:96 -msgid "Right align" -msgstr "오른쪽으로 정렬" - -#: data/ui/glabels-ui.xml.h:99 -msgid "Rotate object 90 clockwise" -msgstr "90° 시계방향으로 회전" - -#: data/ui/glabels-ui.xml.h:100 -msgid "Rotate object 90 counter-clockwise" -msgstr "90° 반시계방향으로 회전" - -#: data/ui/glabels-ui.xml.h:101 -msgid "Save" -msgstr "저장" - -#: data/ui/glabels-ui.xml.h:102 -msgid "Save As" -msgstr "다른 이름으로 저장" - -#: data/ui/glabels-ui.xml.h:103 -msgid "Save _As..." -msgstr "다른 이름으로 저장(_A)..." - -#: data/ui/glabels-ui.xml.h:104 -msgid "Save the current file" -msgstr "현재 파일이름으로 저장" - -#: data/ui/glabels-ui.xml.h:105 -msgid "Save the current file with a different name" -msgstr "현재파일을 다른이름으로 저장" - -#: data/ui/glabels-ui.xml.h:106 -msgid "Select All" -msgstr "모두 선택" - -#: data/ui/glabels-ui.xml.h:107 -msgid "Select _All" -msgstr "모두 선택(_A)" - -#: data/ui/glabels-ui.xml.h:108 -msgid "Select all objects" -msgstr "모든 개체 선택" - -#: data/ui/glabels-ui.xml.h:109 -msgid "Select, move and modify objects" -msgstr "선택, 개체 이동과 수정" - -#: data/ui/glabels-ui.xml.h:111 -msgid "Set drawing toolbar button style according to desktop default" -msgstr "기본 데스크탑 모양에 따라 그리기 도구 버튼 모양을 지정" - -#: data/ui/glabels-ui.xml.h:112 -msgid "Set main toolbar button style according to desktop default" -msgstr "기본 데스크탑 모양에 따라 주 도구 버튼 모양을 지정" - -#: data/ui/glabels-ui.xml.h:113 -msgid "Show _Tooltips" -msgstr "팁 보기(_T)" - -#: data/ui/glabels-ui.xml.h:114 -msgid "Show both icons and texts in the drawing toolbar" -msgstr "그리기 도구에 아이콘과 글자 보이기" - -#: data/ui/glabels-ui.xml.h:115 -msgid "Show both icons and texts in the main toolbar" -msgstr "주 도구에 아이콘 ê³¼ 글자 보이기" - -#: data/ui/glabels-ui.xml.h:116 -msgid "Show tooltips in the drawing toolbar" -msgstr "그리기 도구에 팁 보이기" - -#: data/ui/glabels-ui.xml.h:117 -msgid "Show tooltips in the main toolbar" -msgstr "주 도구에 팁 보이기" - -#: data/ui/glabels-ui.xml.h:118 -msgid "Show tooltips in the property toolbar" -msgstr "속성 도구에 팁 보이기" - -#: data/ui/glabels-ui.xml.h:119 -msgid "Template Designer" -msgstr "서식 디자이너" - -#: data/ui/glabels-ui.xml.h:120 -msgid "Template _Designer..." -msgstr "서식 디자이너(_D)..." - -#: data/ui/glabels-ui.xml.h:121 -msgid "Text color" -msgstr "글자 색상" - -#: data/ui/glabels-ui.xml.h:122 -msgid "U_n-select All" -msgstr "모든 선택 해제(_N)" - -#: data/ui/glabels-ui.xml.h:123 -msgid "Un-select All" -msgstr "모든 선택 해제" - -#: data/ui/glabels-ui.xml.h:124 -msgid "Undo" -msgstr "되돌리기" - -#: data/ui/glabels-ui.xml.h:125 -msgid "Undo the last action" -msgstr "마지막 동작으로 되돌리기" - -#: data/ui/glabels-ui.xml.h:126 -msgid "Zoom _1:1" -msgstr "1:1로 확대(_1)" - -#: data/ui/glabels-ui.xml.h:127 -msgid "Zoom _In" -msgstr "확대(_I)" - -#: data/ui/glabels-ui.xml.h:128 -msgid "Zoom _Out" -msgstr "축소(_O)" - -#: data/ui/glabels-ui.xml.h:129 -msgid "Zoom to _fit" -msgstr "맞춰서 확대(_F)" - -#: data/ui/glabels-ui.xml.h:130 -msgid "Zoom to fit window" -msgstr "윈도우에 맞춰서 확대" - -#: data/ui/glabels-ui.xml.h:131 -msgid "_About..." -msgstr "...에 대해(_A)" - -#: data/ui/glabels-ui.xml.h:132 -msgid "_Bottoms" -msgstr "아래(_B)" - -#: data/ui/glabels-ui.xml.h:135 -msgid "_Close" -msgstr "닫기(_C)" - -#: data/ui/glabels-ui.xml.h:136 -msgid "_Contents" -msgstr "목차(_C)" - -#: data/ui/glabels-ui.xml.h:137 -msgid "_Copy" -msgstr "복사(_C)" - -#: data/ui/glabels-ui.xml.h:138 -msgid "_Create Object" -msgstr "항목 만들기(_C)" - -#: data/ui/glabels-ui.xml.h:139 -msgid "_Debug" -msgstr "디버그(_D)" - -#: data/ui/glabels-ui.xml.h:141 -msgid "_Desktop Default" -msgstr "기본 데스크탑(_D)" - -#: data/ui/glabels-ui.xml.h:142 -msgid "_Drawing Toolbar" -msgstr "그리기 도구(_D)" - -#: data/ui/glabels-ui.xml.h:143 -msgid "_Edit" -msgstr "편집(_E)" - -#: data/ui/glabels-ui.xml.h:145 -msgid "_File" -msgstr "파일(_F)" - -#: data/ui/glabels-ui.xml.h:146 -msgid "_Grid" -msgstr "그리드(_G)" - -#: data/ui/glabels-ui.xml.h:147 -msgid "_Help" -msgstr "도움말(_H)" - -#: data/ui/glabels-ui.xml.h:148 -msgid "_Icon" -msgstr "아이콘(_I)" - -#: data/ui/glabels-ui.xml.h:152 -msgid "_Main Toolbar" -msgstr "주 도구(_M)" - -#: data/ui/glabels-ui.xml.h:153 -msgid "_Merge Properties..." -msgstr "여백 속성(_M)..." - -#: data/ui/glabels-ui.xml.h:154 -msgid "_New" -msgstr "새로 만들기(_N)" - -#: data/ui/glabels-ui.xml.h:155 -msgid "_Objects" -msgstr "항목(_O)" - -#: data/ui/glabels-ui.xml.h:156 -msgid "_Open..." -msgstr "열기(_O)..." - -#: data/ui/glabels-ui.xml.h:158 -msgid "_Paste" -msgstr "붙이기(_P)" - -#: data/ui/glabels-ui.xml.h:159 -msgid "_Print..." -msgstr "인쇄(_P)..." - -#: data/ui/glabels-ui.xml.h:160 -msgid "_Property Toolbar" -msgstr "속성 도구(_P)" - -#: data/ui/glabels-ui.xml.h:161 -msgid "_Quit" -msgstr "종료(_Q)" - -#: data/ui/glabels-ui.xml.h:164 -msgid "_Save" -msgstr "저장(_S)" - -#: data/ui/glabels-ui.xml.h:168 -msgid "_View" -msgstr "보기(_V)" - -#: data/glade/prefs-dialog.glade.h:1 -msgid " " -msgstr " " - -#: data/glade/prefs-dialog.glade.h:2 -#: data/glade/object-editor.glade.h:1 -#: data/glade/template-designer.glade.h:5 -msgid "*" -msgstr "*" - -#: data/glade/prefs-dialog.glade.h:3 -msgid "Default page size" -msgstr "기본 용지 크기" - -#: data/glade/prefs-dialog.glade.h:4 -msgid "Fill" -msgstr "채우기" - -#: data/glade/prefs-dialog.glade.h:5 -msgid "Line" -msgstr "선" - -#: data/glade/prefs-dialog.glade.h:6 -msgid "Text" -msgstr "글자" - -#: data/glade/prefs-dialog.glade.h:7 -msgid "Units" -msgstr "유닛" - -#: data/glade/prefs-dialog.glade.h:8 -#: data/glade/object-editor.glade.h:4 -msgid "Alignment:" -msgstr "위치:" - -#: data/glade/prefs-dialog.glade.h:9 -#: data/glade/object-editor.glade.h:8 -msgid "Color:" -msgstr "색상:" - -#: data/glade/prefs-dialog.glade.h:10 -msgid "Font:" -msgstr "글꼴:" - -#: data/glade/prefs-dialog.glade.h:11 -msgid "ISO A4" -msgstr "ISO A4 용지" - -#: data/glade/prefs-dialog.glade.h:12 -msgid "Inches" -msgstr "인치" - -#: data/glade/prefs-dialog.glade.h:13 -#: data/glade/object-editor.glade.h:19 -msgid "Line Spacing:" -msgstr "행간:" - -#: data/glade/prefs-dialog.glade.h:14 -msgid "Locale" -msgstr "로케일" - -#: data/glade/prefs-dialog.glade.h:15 -msgid "Millimeters" -msgstr "밀리미터" - -#: data/glade/prefs-dialog.glade.h:16 -msgid "Object defaults" -msgstr "기본 항목" - -#: data/glade/prefs-dialog.glade.h:17 -msgid "Points" -msgstr "포인트" - -#: data/glade/prefs-dialog.glade.h:18 -msgid "Select default properties for new objects." -msgstr "새 개체의 기본 속성을 선택" - -#: data/glade/prefs-dialog.glade.h:19 -msgid "Select locale specific behavior." -msgstr "구체적인 로케일을 선택" - -#: data/glade/prefs-dialog.glade.h:20 -#: data/templates/paper-sizes.xml.h:25 -msgid "US Letter" -msgstr "US Letter" - -#: data/glade/prefs-dialog.glade.h:21 -#: data/glade/object-editor.glade.h:29 -#: data/glade/template-designer.glade.h:72 -msgid "Width:" -msgstr "넓이:" - -#: data/glade/object-editor.glade.h:2 -msgid "00000000000 00000" -msgstr "00000000000 00000" - -#: data/glade/object-editor.glade.h:3 -msgid "Xxx object properties" -msgstr "Xxx 개체 속성" - -#: data/glade/object-editor.glade.h:5 -msgid "Allow merge to automatically shrink text" -msgstr "자동으로 축소한 글자에 병합" - -#: data/glade/object-editor.glade.h:6 -msgid "Angle:" -msgstr "각도:" - -#: data/glade/object-editor.glade.h:7 -msgid "Checksum" -msgstr "체크섬" - -#: data/glade/object-editor.glade.h:10 -msgid "Family:" -msgstr "패밀리:" - -#: data/glade/object-editor.glade.h:12 -msgid "Fill" -msgstr "채우기" - -#: data/glade/object-editor.glade.h:13 -#: data/glade/template-designer.glade.h:33 -msgid "Height:" -msgstr "높이:" - -#: data/glade/object-editor.glade.h:14 -msgid "Image" -msgstr "그림" - -#: data/glade/object-editor.glade.h:15 -msgid "Insert merge field" -msgstr "병합 필드 삽입" - -#: data/glade/object-editor.glade.h:17 -msgid "Length:" -msgstr "길이:" - -#: data/glade/object-editor.glade.h:18 -msgid "Line" -msgstr "선" - -#: data/glade/object-editor.glade.h:20 -msgid "Literal:" -msgstr "Literal:" - -#: data/glade/object-editor.glade.h:21 -msgid "Load image" -msgstr "그림 불러옴" - -#: data/glade/object-editor.glade.h:22 -msgid "Position" -msgstr "위치" - -#: data/glade/object-editor.glade.h:23 -msgid "Reset image size" -msgstr "그림크기 재설정" - -#: data/glade/object-editor.glade.h:24 -msgid "Size" -msgstr "크기" - -#: data/glade/object-editor.glade.h:25 -msgid "Size:" -msgstr "크기:" - -#: data/glade/object-editor.glade.h:26 -msgid "Style" -msgstr "모양" - -#: data/glade/object-editor.glade.h:27 -msgid "Style:" -msgstr "모양:" - -#: data/glade/object-editor.glade.h:30 -msgid "X:" -msgstr "X:" - -#: data/glade/object-editor.glade.h:31 -msgid "Y:" -msgstr "Y:" - -#: data/glade/object-editor.glade.h:32 -msgid "degrees" -msgstr "degrees" - -#: data/glade/object-editor.glade.h:33 -msgid "dialog1" -msgstr "dialog1" - -#: data/glade/object-editor.glade.h:34 -msgid "digits:" -msgstr "digits:" - -#: data/glade/object-editor.glade.h:35 -msgid "format:" -msgstr "서식:" - -#: data/glade/template-designer.glade.h:1 -msgid " " -msgstr " " - -#: data/glade/template-designer.glade.h:2 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "(예: \"주소라벨\", \"명함\", ...)" - -#: data/glade/template-designer.glade.h:3 -msgid "(e.g., 8163A)" -msgstr "(예: 8163A)" - -#: data/glade/template-designer.glade.h:4 -msgid "(e.g., Avery, Acme, ...)" -msgstr "(예: Avery, Acme, ...)" - -#: data/glade/template-designer.glade.h:6 -msgid "1. Outer radius:" -msgstr "1. 바깥 반지름:" - -#: data/glade/template-designer.glade.h:7 -msgid "1. Radius:" -msgstr "1. 반지름:" - -#: data/glade/template-designer.glade.h:8 -msgid "1. Width:" -msgstr "1. 넓이:" - -#: data/glade/template-designer.glade.h:9 -msgid "2. Height:" -msgstr "2. 높이:" - -#: data/glade/template-designer.glade.h:10 -msgid "2. Inner radius:" -msgstr "2. 안쪽 반지름:" - -#: data/glade/template-designer.glade.h:11 -msgid "2. Waste (overprint allowed):" -msgstr "2. 여백 (겹친 인쇄 허용):" - -#: data/glade/template-designer.glade.h:12 -msgid "3. Clipping width:" -msgstr "3. 오려내기 넓이:" - -#: data/glade/template-designer.glade.h:13 -msgid "3. Margin" -msgstr "3. 여백" - -#: data/glade/template-designer.glade.h:14 -msgid "3. Round (radius of corner):" -msgstr "3. 둥글기 (귀퉁이 각도):" - -#: data/glade/template-designer.glade.h:15 -msgid "4. Clipping height:" -msgstr "4. 오려내기 높이:" - -#: data/glade/template-designer.glade.h:16 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "4. 좌우 여백 (겹친 인쇄 허용):" - -#: data/glade/template-designer.glade.h:17 -msgid "5. Vert. waste (overprint allowed):" -msgstr "5. 아래위 여백 (겹친 인쇄 허용):" - -#: data/glade/template-designer.glade.h:18 -msgid "5. Waste (overprint allowed):" -msgstr "5. 여백 (겹친 인쇄 허용):" - -#: data/glade/template-designer.glade.h:19 -msgid "6. Margin" -msgstr "6. 라벨 내 여백" - -#: data/glade/template-designer.glade.h:20 -msgid "Brand/Manufacturer:" -msgstr "상표/제조업체:" - -#: data/glade/template-designer.glade.h:21 -msgid "CD/DVD (including credit card CDs)" -msgstr "CD/DVD (credit card CD 포함)" - -#: data/glade/template-designer.glade.h:22 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "" -"축하드립니다!\n" -"\n" -"gLabels 서식문서 디자이너로 서식 만들기를 마쳤습니다.\n" -"새로 만든 서식을 저장하기 원한다면 \"적용\" 을 누르세요.\n" -"\n" -"\"취소\"를 누르면 만든것을 버리게 됩니다.\n" -"또는 \"뒤로\"를 선택하여 만든것을 편집 할 수 있습니다." - -#: data/glade/template-designer.glade.h:30 -msgid "Design Completed" -msgstr "서식 디자인 완료됨" - -#: data/glade/template-designer.glade.h:31 -msgid "Distance from left edge (x0):" -msgstr "왼쪽 가장자리 부터 (x0):" - -#: data/glade/template-designer.glade.h:32 -msgid "Distance from top edge (y0):" -msgstr "위쪽 가장자리 부터 (y0):" - -#: data/glade/template-designer.glade.h:34 -msgid "Horizontal pitch (dx):" -msgstr "수평 pitch (dx):" - -#: data/glade/template-designer.glade.h:35 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" -"서식을 얼마나 포함합니까?\n" -"\n" -"레이아웃 서식 개수 지정을 통해 두개 이내의 레이아웃을 만들 수 있습니다.\n" -"보통은 아래 첫번째 예제처럼 한개의 레이아웃을 필요로 하지만,\n" -"어떤것은 두번째 예제처럼 두개의 레이아웃을 필요로 하는것도 있습니다." - -#: data/glade/template-designer.glade.h:40 -msgid "Label Size (CD/DVD)" -msgstr "라벨 크기(CD/DVD)" - -#: data/glade/template-designer.glade.h:41 -msgid "Label Size (Round)" -msgstr "라벨 크기 (둥글기)" - -#: data/glade/template-designer.glade.h:42 -msgid "Label or Card Shape" -msgstr "라벨 또는 카드 외형" - -#: data/glade/template-designer.glade.h:43 -msgid "Label or Card Size (Rectangular)" -msgstr "라벨 또는 카드 크기(직사각형)" - -#: data/glade/template-designer.glade.h:44 -msgid "Layout #1" -msgstr "레이아웃 #1:" - -#: data/glade/template-designer.glade.h:45 -msgid "Layout #2" -msgstr "레이아웃 #2:" - -#: data/glade/template-designer.glade.h:46 -msgid "Layout(s)" -msgstr "레이아웃" - -#: data/glade/template-designer.glade.h:47 -msgid "Name and Description" -msgstr "이름과 설명" - -#: data/glade/template-designer.glade.h:48 -msgid "Number across (nx):" -msgstr "가로 개수 (nx):" - -#: data/glade/template-designer.glade.h:49 -msgid "Number down (ny):" -msgstr "세로 개수 (ny):" - -#: data/glade/template-designer.glade.h:50 -msgid "Number of Layouts" -msgstr "레이아웃 선택" - -#: data/glade/template-designer.glade.h:51 -msgid "Number of layouts:" -msgstr "레이아웃 선택:" - -#: data/glade/template-designer.glade.h:52 -msgid "Page Size" -msgstr "용지 크기" - -#: data/glade/template-designer.glade.h:54 -msgid "Part #:" -msgstr "라벨분류:" - -#: data/glade/template-designer.glade.h:55 -msgid "Please enter the following identifying information about the template stationery." -msgstr "입력 상자에 기본 서식 정보를 입력하세요." - -#: data/glade/template-designer.glade.h:56 -msgid "Please enter the following layout information." -msgstr "레이아웃 정보를 입력하세요." - -#: data/glade/template-designer.glade.h:57 -msgid "Please enter the following size parameters of a single label in your template." -msgstr "라벨서식의 치수를 입력하세요." - -#: data/glade/template-designer.glade.h:58 -msgid "Please enter the following size parameters of a single label or card in your template." -msgstr "라벨서식 또는 카드서식의 치수를 입력하세요." - -#: data/glade/template-designer.glade.h:59 -msgid "Please select the basic shape of the labels or cards." -msgstr "라벨 또는 카드의 기본 형태를 선택하세요." - -#: data/glade/template-designer.glade.h:60 -msgid "Please select the page size of the template stationery." -msgstr "서식 용지의 크기 선택" - -#: data/glade/template-designer.glade.h:61 -msgid "Print test sheet" -msgstr "용지 테스트 인쇄" - -#: data/glade/template-designer.glade.h:62 -msgid "Rectangular or square (can have rounded corners)" -msgstr "직사각형 또는 정사각형(마무리를 둥글게 만들 수 있음)" - -#: data/glade/template-designer.glade.h:63 -msgid "Round" -msgstr "둥근형" - -#: data/glade/template-designer.glade.h:64 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" -"2. 두개의 레이아웃\n" -"서식 필요" - -#: data/glade/template-designer.glade.h:66 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" -"1. 한개의 레이아웃\n" -"서식 필요" - -#: data/glade/template-designer.glade.h:68 -msgid "Vertical pitch (dy):" -msgstr "수직 pitch (dy):" - -#: data/glade/template-designer.glade.h:69 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" -"gLabels 서식 제작기에 어서오세요.\n" -"\n" -"차근차근 gLabels의 사용자 서식을 쉽게 만들 수 있게 도와드립니다. " - -#: data/templates/paper-sizes.xml.h:1 -msgid "A0" -msgstr "A0용지" - -#: data/templates/paper-sizes.xml.h:2 -msgid "A1" -msgstr "A1용지" - -#: data/templates/paper-sizes.xml.h:3 -msgid "A10" -msgstr "A10용지" - -#: data/templates/paper-sizes.xml.h:4 -msgid "A2" -msgstr "A2용지" - -#: data/templates/paper-sizes.xml.h:5 -msgid "A3" -msgstr "A3용지" - -#: data/templates/paper-sizes.xml.h:6 -msgid "A4" -msgstr "A4용지" - -#: data/templates/paper-sizes.xml.h:7 -msgid "A5" -msgstr "A5용지" - -#: data/templates/paper-sizes.xml.h:8 -msgid "A6" -msgstr "A6용지" - -#: data/templates/paper-sizes.xml.h:9 -msgid "A7" -msgstr "A7용지" - -#: data/templates/paper-sizes.xml.h:10 -msgid "A8" -msgstr "A8용지" - -#: data/templates/paper-sizes.xml.h:11 -msgid "A9" -msgstr "A9용지" - -#: data/templates/paper-sizes.xml.h:12 -msgid "B0" -msgstr "B0용지" - -#: data/templates/paper-sizes.xml.h:13 -msgid "B1" -msgstr "B1용지" - -#: data/templates/paper-sizes.xml.h:14 -msgid "B10" -msgstr "B10용지" - -#: data/templates/paper-sizes.xml.h:15 -msgid "B2" -msgstr "B2용지" - -#: data/templates/paper-sizes.xml.h:16 -msgid "B3" -msgstr "B3용지" - -#: data/templates/paper-sizes.xml.h:17 -msgid "B4" -msgstr "B4용지" - -#: data/templates/paper-sizes.xml.h:18 -msgid "B5" -msgstr "B5용지" - -#: data/templates/paper-sizes.xml.h:19 -msgid "B6" -msgstr "B6용지" - -#: data/templates/paper-sizes.xml.h:20 -msgid "B7" -msgstr "B7용지" - -#: data/templates/paper-sizes.xml.h:21 -msgid "B8" -msgstr "B8용지" - -#: data/templates/paper-sizes.xml.h:22 -msgid "B9" -msgstr "B9용지" - -#: data/templates/paper-sizes.xml.h:23 -msgid "US Executive" -msgstr "US Executive" - -#: data/templates/paper-sizes.xml.h:24 -msgid "US Legal" -msgstr "US Legal" - -#: data/templates/avery-us-templates.xml.h:1 -#: data/templates/zweckform-iso-templates.xml.h:1 -msgid "Address Labels" -msgstr "주소 라벨" - -#: data/templates/avery-us-templates.xml.h:2 -#: data/templates/avery-iso-templates.xml.h:2 -#: data/templates/zweckform-iso-templates.xml.h:3 -#: data/templates/misc-us-templates.xml.h:2 -#: data/templates/misc-iso-templates.xml.h:9 -msgid "Business Cards" -msgstr "명함" - -#: data/templates/avery-us-templates.xml.h:3 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "CD/DVD 라벨 (Disc 라벨)" - -#: data/templates/avery-us-templates.xml.h:4 -msgid "Diskette Labels" -msgstr "디스크 라벨" - -#: data/templates/avery-us-templates.xml.h:5 -msgid "Filing Labels" -msgstr "출원 라벨" - -#: data/templates/avery-us-templates.xml.h:6 -msgid "Full Sheet Labels" -msgstr "Full Sheet 라벨" - -#: data/templates/avery-us-templates.xml.h:7 -msgid "Large Round Labels" -msgstr "큰 원형 라벨" - -#: data/templates/avery-us-templates.xml.h:8 -msgid "Name Badge Labels" -msgstr "Name Badge 라벨" - -#: data/templates/avery-us-templates.xml.h:9 -msgid "Return Address Labels" -msgstr "반송 주소용 라벨" - -#: data/templates/avery-us-templates.xml.h:10 -msgid "Shipping Labels" -msgstr "출하 라벨" - -#: data/templates/avery-us-templates.xml.h:11 -msgid "Small Round Labels" -msgstr "작은 원형 라벨" - -#: data/templates/avery-us-templates.xml.h:12 -msgid "Square Labels" -msgstr "구형 라벨" - -#: data/templates/avery-us-templates.xml.h:13 -msgid "Video Tape Face Labels" -msgstr "비디오 테입 앞면 라벨" - -#: data/templates/avery-us-templates.xml.h:14 -msgid "Video Tape Spine Labels" -msgstr "비디오 테입 옆면 라벨" - -#: data/templates/avery-iso-templates.xml.h:1 -msgid "Address labels" -msgstr "주소 라벨" - -#: data/templates/avery-iso-templates.xml.h:3 -msgid "CD Booklet" -msgstr "CD Booklet" - -#: data/templates/avery-iso-templates.xml.h:4 -msgid "CD Inlet" -msgstr "CD Inlet" - -#: data/templates/avery-iso-templates.xml.h:5 -#: data/templates/zweckform-iso-templates.xml.h:4 -#: data/templates/misc-us-templates.xml.h:4 -#: data/templates/misc-iso-templates.xml.h:10 -msgid "CD/DVD Labels" -msgstr "CD/DVD 라벨" - -#: data/templates/avery-iso-templates.xml.h:6 -msgid "Diskette labels" -msgstr "디스크 라벨" - -#: data/templates/avery-iso-templates.xml.h:7 -#: data/templates/zweckform-iso-templates.xml.h:7 -#: data/templates/misc-iso-templates.xml.h:17 -msgid "Mailing Labels" -msgstr "봉투 라벨" - -#: data/templates/avery-iso-templates.xml.h:8 -msgid "Mailing labels" -msgstr "봉투 라벨" - -#: data/templates/avery-iso-templates.xml.h:9 -msgid "Mini Address Labels" -msgstr "작은 주소라벨" - -#: data/templates/avery-iso-templates.xml.h:10 -msgid "Shipping labels" -msgstr "출하 라벨" - -#: data/templates/zweckform-iso-templates.xml.h:2 -msgid "Allround Labels" -msgstr "Allround 라벨" - -#: data/templates/zweckform-iso-templates.xml.h:5 -msgid "Correction and Cover-up Labels" -msgstr "수집 ê³¼ Cover-up 라벨" - -#: data/templates/zweckform-iso-templates.xml.h:6 -msgid "Lever Arch File Labels" -msgstr "Lever Arch 파일 라벨" - -#: data/templates/zweckform-iso-templates.xml.h:8 -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "QSL-Karten Etiketten (70mm x 50.8mm)" - -#: data/templates/zweckform-iso-templates.xml.h:9 -msgid "Rectangular Copier Labels" -msgstr "분류표기 라벨" - -#: data/templates/zweckform-iso-templates.xml.h:10 -#: data/templates/misc-iso-templates.xml.h:22 -msgid "Rectangular Labels" -msgstr "직사각형 라벨" - -#: data/templates/zweckform-iso-templates.xml.h:11 -msgid "Video Labels (back)" -msgstr "비디오 라벨 (뒤)" - -#: data/templates/misc-us-templates.xml.h:1 -msgid "Business Card CD" -msgstr "명함 CD" - -#: data/templates/misc-us-templates.xml.h:3 -msgid "CD Template Rectangles" -msgstr "CD 서식 (직사각형)" - -#: data/templates/misc-us-templates.xml.h:5 -msgid "CD/DVD Labels (Face Only)" -msgstr "CD/DVD 라벨 (표지만)" - -#: data/templates/misc-us-templates.xml.h:6 -#: data/templates/misc-iso-templates.xml.h:11 -msgid "CD/DVD Labels (face only)" -msgstr "CD/DVD 라벨 (표지만)" - -#: data/templates/misc-us-templates.xml.h:7 -msgid "DLT Labels" -msgstr "DLT 라벨" - -#: data/templates/misc-us-templates.xml.h:8 -msgid "Microtube labels" -msgstr "Microtube 라벨" - -#: data/templates/misc-us-templates.xml.h:9 -msgid "Mini-CD Labels" -msgstr "Mini-CD 라벨" - -#: data/templates/misc-us-templates.xml.h:10 -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "PRO CD 라벨 2-up (CD 세로표지 전용)" - -#: data/templates/misc-us-templates.xml.h:11 -msgid "PRO CD Labels 2-up (Face only)" -msgstr "PRO CD 라벨 2-up (표지만)" - -#: data/templates/misc-us-templates.xml.h:12 -#: data/templates/misc-iso-templates.xml.h:21 -msgid "PRO CD Labels 2-up (face only)" -msgstr "PRO CD 라벨 2-up (표지만)" - -#: data/templates/misc-us-templates.xml.h:13 -msgid "Slimline CD Case (rightside up)" -msgstr "Slimline CD 케이스 (우측옆)" - -#: data/templates/misc-us-templates.xml.h:14 -msgid "Slimline CD Case (upside down)" -msgstr "Slimline CD 케이스(상위)" - -#: data/templates/misc-iso-templates.xml.h:1 -msgid "Agipa 119488: Business Cards" -msgstr "Agipa 119488: 명함" - -#: data/templates/misc-iso-templates.xml.h:2 -msgid "Allround Labels --24" -msgstr "Allround 라벨 --24" - -#: data/templates/misc-iso-templates.xml.h:3 -msgid "Allround Labels --44" -msgstr "Allround 라벨 --44" - -#: data/templates/misc-iso-templates.xml.h:4 -msgid "Allround Labels --64" -msgstr "Allround 라벨 --64" - -#: data/templates/misc-iso-templates.xml.h:5 -msgid "Allround Labels --65" -msgstr "Allround 라벨 --65" - -#: data/templates/misc-iso-templates.xml.h:6 -msgid "Arch File Labels" -msgstr "Arch 파일 라벨" - -#: data/templates/misc-iso-templates.xml.h:7 -msgid "Arch File Labels (large)" -msgstr "Arch 파일 라벨 (큰것)" - -#: data/templates/misc-iso-templates.xml.h:8 -msgid "Arch File Labels (small)" -msgstr "Arch 파일 라벨 (작은것)" - -#: data/templates/misc-iso-templates.xml.h:12 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "기본 CD/DVD 라벨 (표지만)" - -#: data/templates/misc-iso-templates.xml.h:13 -msgid "Diskette Labels (face only)" -msgstr "디스켓 라벨 (표지만)" - -#: data/templates/misc-iso-templates.xml.h:14 -msgid "EPSON Photo Stickers 16" -msgstr "EPSON 포토 스티커 16" - -#: data/templates/misc-iso-templates.xml.h:15 -msgid "Etiketten" -msgstr "Etiketten" - -#: data/templates/misc-iso-templates.xml.h:16 -msgid "Fridge Magnet Stickers" -msgstr "Fridge Magnet 스티커" - -#: data/templates/misc-iso-templates.xml.h:18 -msgid "Mailing Labels --14" -msgstr "봉투 라벨 --14" - -#: data/templates/misc-iso-templates.xml.h:19 -msgid "Mailing Labels-2 columns" -msgstr "주소 라벨 (2형)" - -#: data/templates/misc-iso-templates.xml.h:20 -msgid "Mailing Labels-3 columns" -msgstr "주소라벨 (3형)" - -#: data/templates/misc-iso-templates.xml.h:23 -msgid "Video Labels (face only)" -msgstr "비디오 라벨 (표지만)" - -#: data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers" -msgstr "라벨, 명함 그리고 미디어 커버 만들기" - -#: data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "gLabels 라벨 디자이너" - -#: data/mime/glabels.keys.in.h:1 -#: data/mime/glabels.xml.in.h:1 -msgid "gLabels Project File" -msgstr "gLabels 프로젝트 파일" - diff --git a/glabels2/po/pl.po b/glabels2/po/pl.po deleted file mode 100644 index d67a9065..00000000 --- a/glabels2/po/pl.po +++ /dev/null @@ -1,2650 +0,0 @@ -# Polish translation for gLabels -# Copyright (C) 2002 Free Software Foundation, Inc. -# Arkadiusz Lipiec , 2002. -# -msgid "" -msgstr "" -"Project-Id-Version: gLabels\n" -"POT-Creation-Date: 2004-08-08 00:43-0400\n" -"PO-Revision-Date: 2002-07-23 11:43+0100\n" -"Last-Translator: Arkadiusz Lipiec \n" -"Language-Team: Polish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=iso-8859-2\n" -"Content-Transfer-Encoding: 8bit\n" - -#: src/glabels.c:55 -msgid "Show view debugging messages." -msgstr "" - -#: src/glabels.c:58 -msgid "Show item debugging messages." -msgstr "" - -#: src/glabels.c:61 -msgid "Show printing debugging messages." -msgstr "" - -#: src/glabels.c:64 -msgid "Show prefs debugging messages." -msgstr "" - -#: src/glabels.c:67 -msgid "Show file debugging messages." -msgstr "" - -#: src/glabels.c:70 -msgid "Show document debugging messages." -msgstr "" - -#: src/glabels.c:73 -msgid "Show template debugging messages." -msgstr "" - -#: src/glabels.c:76 -msgid "Show paper debugging messages." -msgstr "" - -#: src/glabels.c:79 -msgid "Show xml debugging messages." -msgstr "" - -#: src/glabels.c:82 -msgid "Show document merge debugging messages." -msgstr "" - -#: src/glabels.c:85 -msgid "Show commands debugging messages." -msgstr "" - -#: src/glabels.c:88 -msgid "Show undo debugging messages." -msgstr "" - -#: src/glabels.c:91 -msgid "Show recent debugging messages." -msgstr "" - -#: src/glabels.c:94 -msgid "Show window debugging messages." -msgstr "" - -#: src/glabels.c:97 -msgid "Show ui debugging messages." -msgstr "" - -#: src/glabels.c:100 -msgid "Show property_bar debugging messages." -msgstr "" - -#: src/glabels.c:103 -msgid "Show media select widget debugging messages." -msgstr "" - -#: src/glabels.c:106 -msgid "Show mini preview widget debugging messages." -msgstr "" - -#: src/glabels.c:109 -msgid "Show pixbuf cache debugging messages." -msgstr "" - -#: src/glabels.c:112 -msgid "Show widget debugging messages." -msgstr "" - -#: src/glabels.c:115 -msgid "Show object editor debugging messages." -msgstr "" - -#: src/glabels.c:118 -msgid "Turn on all debugging messages." -msgstr "" - -#: src/glabels.c:187 -msgid "Could not initialize Bonobo!\n" -msgstr "" - -#: src/glabels-batch.c:48 -msgid "print this message" -msgstr "wy¶wietla ten komunikat" - -#: src/glabels-batch.c:50 -msgid "print the version of glabels-batch being used" -msgstr "wy¶wietla aktualnie u¿ywan± wersjê glabel-batch" - -#: src/glabels-batch.c:52 -msgid "set output filename (default=\"output.ps\")" -msgstr "okre¶l nazwê pliku wyj¶ciowego (domy¶lnie=\"output.ps\")" - -#: src/glabels-batch.c:52 -msgid "filename" -msgstr "nazwa pliku" - -#: src/glabels-batch.c:54 -msgid "number of sheets (default=1)" -msgstr "liczba arkuszy (domy¶lnie=1)" - -#: src/glabels-batch.c:54 -msgid "sheets" -msgstr "arkusz(e/y)" - -#: src/glabels-batch.c:56 -msgid "number of copies (default=1)" -msgstr "liczba kopii (domy¶lnie=1)" - -#: src/glabels-batch.c:56 -msgid "copies" -msgstr "kopi(a/e/i)" - -#: src/glabels-batch.c:58 src/print-dialog.c:336 -msgid "print outlines (to test printer alignment)" -msgstr "drukowanie ramek (w celu przetestowania wyrównania)" - -#: src/glabels-batch.c:60 src/print-dialog.c:344 -msgid "print in reverse (i.e. a mirror image)" -msgstr "drukowanie odwrócone (np. odbicie zwierciadlane)" - -#: src/glabels-batch.c:96 -msgid "[OPTION...] GLABELS_FILE..." -msgstr "[OPCJA...] PLIK_GLABELS..." - -#: src/glabels-batch.c:116 -msgid "missing glabels file\n" -msgstr "brak pliku glabels\n" - -#: src/glabels-batch.c:157 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "nie mo¿na otworzyæ pliku glabels o nazwie %s\n" - -#: src/window.c:244 -msgid "(none) - gLabels" -msgstr "" - -#: src/window.c:414 -msgid "(modified)" -msgstr "" - -#: src/stock.c:65 data/ui/glabels-ui.xml.h:165 -#, fuzzy -msgid "_Select Mode" -msgstr "Wybierz" - -#: src/stock.c:66 data/ui/glabels-ui.xml.h:166 -#, fuzzy -msgid "_Text" -msgstr "Tekst" - -#: src/stock.c:67 data/ui/glabels-ui.xml.h:151 -#, fuzzy -msgid "_Line" -msgstr "Linia" - -#: src/stock.c:68 data/ui/glabels-ui.xml.h:133 -#, fuzzy -msgid "_Box" -msgstr "Skrzynka" - -#: src/stock.c:69 data/ui/glabels-ui.xml.h:144 -#, fuzzy -msgid "_Ellipse" -msgstr "Elipsa" - -#: src/stock.c:70 data/ui/glabels-ui.xml.h:149 -#, fuzzy -msgid "_Image" -msgstr "Obraz" - -#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 -#, fuzzy -msgid "Bar_code" -msgstr "Kod paskowy" - -#: src/stock.c:72 -#, fuzzy -msgid "_Merge Properties" -msgstr "W³a¶ciwo¶ci z³±czania" - -#: src/stock.c:73 -#, fuzzy -msgid "Object _Properties" -msgstr "W³a¶ciwo¶ci tekstu" - -#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 -#, fuzzy -msgid "Bring to _Front" -msgstr "Przesun na wierzch" - -#: src/stock.c:75 data/ui/glabels-ui.xml.h:110 -#, fuzzy -msgid "Send to _Back" -msgstr "Przesuñ w dó³" - -#: src/stock.c:76 data/ui/glabels-ui.xml.h:97 -#, fuzzy -msgid "Rotate _Left" -msgstr "Obróæ" - -#: src/stock.c:77 data/ui/glabels-ui.xml.h:98 -#, fuzzy -msgid "Rotate _Right" -msgstr "Obróæ" - -#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 -msgid "Flip _Horizontally" -msgstr "" - -#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 -msgid "Flip _Vertically" -msgstr "" - -#: src/stock.c:80 data/ui/glabels-ui.xml.h:150 -msgid "_Lefts" -msgstr "" - -#: src/stock.c:81 data/ui/glabels-ui.xml.h:162 -msgid "_Rights" -msgstr "" - -#: src/stock.c:82 data/ui/glabels-ui.xml.h:134 -msgid "_Centers" -msgstr "" - -#: src/stock.c:83 data/ui/glabels-ui.xml.h:167 -#, fuzzy -msgid "_Tops" -msgstr "_Narzêdzia" - -#: src/stock.c:84 -msgid "Bottoms" -msgstr "" - -#: src/stock.c:85 -msgid "Centers" -msgstr "" - -#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 -msgid "Label Ce_nter" -msgstr "" - -#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 -msgid "Fill color" -msgstr "" - -#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 -msgid "Line color" -msgstr "" - -#: src/stock.c:90 src/stock.c:92 -#, fuzzy -msgid "Linked" -msgstr "Linia" - -#: src/stock.c:91 src/stock.c:93 -#, fuzzy -msgid "Not Linked" -msgstr "Brak" - -#: src/ui-property-bar.c:345 src/object-editor.c:499 -#, fuzzy -msgid "Default" -msgstr "Usuñ" - -#: src/ui-property-bar.c:360 src/object-editor.c:512 -msgid "No fill" -msgstr "" - -#: src/ui-property-bar.c:375 src/object-editor.c:505 -#, fuzzy -msgid "No line" -msgstr "Brak" - -#: src/ui-sidebar.c:180 -#, fuzzy -msgid "Object properties" -msgstr "W³a¶ciwo¶ci tekstu" - -#: src/commands.c:385 -msgid "" -"A label and business card creation program for GNOME.\n" -" \n" -"Glabels is free software; you can redistribute it and/or modify it under the " -"terms of the GNU General Public License as published by the Free Software " -"Foundation; either version 2 of the License, or (at your option) any later " -"version.\n" -" \n" -"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.\n" -msgstr "" -"Program do tworzenia etykiet i wizytówek dla GNOME.\n" -"\n" -"Glabels jest oprogramowaniem wolnodostêpnym, mo¿na rozpowszechniaæ go lub/" -"imodyfikowaæ na zasadach Licencji Publicznej GNU opublikowanej przez Free " -"Software Foundation; zarówno w wersji 2 tej licencji, jak (do wyboru) i " -"dowolnej pó¼niejszej wersji.\n" -"\n" -"Ten program jest rozpowszechniany w nadziei u¿yteczno¶ci, lecz BEZ ¯ADNEJ " -"GWARANCJI; nawet wynikaj±cej z RÊKOJMI lub U¯YWANIA W OKRE¦LONYM CELU. " -"Zajrzyj do Licencji Publicznej GNU aby uzyskaæ wiêcej szczegó³ów.\n" - -#: src/commands.c:399 -msgid "See the file AUTHORS for additional credits," -msgstr "" - -#: src/commands.c:400 -msgid "or visit http://glabels.sourceforge.net/" -msgstr "" - -#: src/commands.c:409 -msgid " " -msgstr "" - -#: src/commands.c:424 -#, fuzzy -msgid "glabels" -msgstr "Etykiety" - -#: src/file.c:100 -msgid "New Label or Card" -msgstr "Nowa etykieta lub karta" - -#: src/file.c:132 src/file.c:304 -msgid "Media Type" -msgstr "Typ no¶nika" - -#: src/file.c:138 src/file.c:310 -msgid "Label orientation" -msgstr "U³o¿enie etykiety" - -#: src/file.c:269 -#, fuzzy -msgid "Label properties" -msgstr "W³a¶ciwo¶ci tekstu" - -#: src/file.c:452 src/file.c:870 -msgid "All files" -msgstr "" - -#: src/file.c:457 src/file.c:875 -#, fuzzy -msgid "gLabels documents" -msgstr "Glabels: Preferencje" - -#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 -#, fuzzy -msgid "Empty file name selection" -msgstr "Usuwa wszelkie zaznaczenia" - -#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 -msgid "Please select a file or supply a valid file name" -msgstr "" - -#: src/file.c:519 src/file.c:631 -msgid "File does not exist" -msgstr "" - -#: src/file.c:563 data/ui/glabels-ui.xml.h:75 -msgid "Open" -msgstr "Otwórz" - -#: src/file.c:565 -msgid "Open label" -msgstr "Otwórz etykietê" - -#: src/file.c:707 -#, fuzzy, c-format -msgid "Could not open file \"%s\"" -msgstr "Nie mo¿na otworzyæ pliku" - -#: src/file.c:715 -msgid "Not a supported file format" -msgstr "" - -#: src/file.c:797 src/file.c:979 src/file.c:1174 -#, fuzzy, c-format -msgid "Could not save file \"%s\"" -msgstr "Nie mo¿na zapisaæ pliku" - -#: src/file.c:805 src/file.c:987 src/file.c:1182 -msgid "Error encountered during save. The file is still not saved." -msgstr "" - -#: src/file.c:848 src/file.c:1048 -#, fuzzy, c-format -msgid "Save \"%s\" as" -msgstr "Zapisz etykietê jako" - -#: src/file.c:935 src/file.c:1131 -#, fuzzy -msgid "Please supply a valid file name" -msgstr "Nale¿y podaæ nazwê pliku" - -#: src/file.c:952 src/file.c:1147 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "" - -#: src/file.c:960 src/file.c:1155 -msgid "File already exists." -msgstr "" - -#: src/file.c:1271 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "" - -#: src/file.c:1279 -msgid "Your changes will be lost if you don't save them." -msgstr "" - -#: src/file.c:1282 -msgid "Close without saving" -msgstr "" - -#. Should not happen -#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 -#: data/glade/object-editor.glade.h:37 -msgid "points" -msgstr "punkty(-ów)" - -#: src/prefs.c:158 data/glade/object-editor.glade.h:36 -#: data/glade/template-designer.glade.h:74 -msgid "inches" -msgstr "cali" - -#: src/prefs.c:160 -msgid "mm" -msgstr "mm" - -#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 -#, fuzzy -msgid "gLabels Preferences" -msgstr "Glabels: Preferencje" - -#. -#. * Submenu: Order -#. -#: src/view.c:3570 data/ui/glabels-ui.xml.h:157 -msgid "_Order" -msgstr "" - -#. -#. * Submenu: Rotate/Flip -#. -#: src/view.c:3591 data/ui/glabels-ui.xml.h:163 -#, fuzzy -msgid "_Rotate/Flip" -msgstr "Obróæ" - -#. -#. * Submenu: Align Horizontally -#. -#: src/view.c:3624 -msgid "Align _Horizontally" -msgstr "" - -#. -#. * Submenu: Align Vertically -#. -#: src/view.c:3663 -msgid "Align _Vertically" -msgstr "" - -#: src/view.c:3724 data/ui/glabels-ui.xml.h:140 -#, fuzzy -msgid "_Delete" -msgstr "Usuñ" - -#. Build editor. -#: src/view-box.c:223 -#, fuzzy -msgid "Box object properties" -msgstr "Modyfikacja w³a¶ciwo¶ci skrzynki" - -#. Build editor. -#: src/view-ellipse.c:223 -#, fuzzy -msgid "Ellipse object properties" -msgstr "Modyfikacja w³a¶ciwo¶ci elipsy" - -#. Build editor. -#: src/view-line.c:223 -#, fuzzy -msgid "Line object properties" -msgstr "Modyfikacja w³a¶ciwo¶ci skrzynki" - -#. Build editor. -#: src/view-image.c:222 -#, fuzzy -msgid "Image object properties" -msgstr "Modyfikacja w³a¶ciwo¶ci obrazu" - -#. Build editor. -#: src/view-text.c:250 -#, fuzzy -msgid "Text object properties" -msgstr "Modyfikacja w³a¶ciwo¶ci skrzynki" - -#: src/view-text.c:562 data/glade/object-editor.glade.h:28 -msgid "Text" -msgstr "Tekst" - -#. Build editor. -#: src/view-barcode.c:209 -#, fuzzy -msgid "Barcode object properties" -msgstr "Modyfikacja w³a¶ciwo¶ci kodu paskowego" - -#: src/view-barcode.c:579 src/print.c:1088 -#, fuzzy -msgid "Invalid barcode data" -msgstr "Niepoprawny kod paskowy" - -#: src/merge-properties-dialog.c:231 -#, fuzzy -msgid "Merge Properties" -msgstr "W³a¶ciwo¶ci z³±czania" - -#. ---- Source section ---- -#: src/merge-properties-dialog.c:237 -msgid "Source" -msgstr "¬ród³o" - -#: src/merge-properties-dialog.c:245 -msgid "Format:" -msgstr "Format:" - -#. Location line -#: src/merge-properties-dialog.c:273 -msgid "Location:" -msgstr "Po³o¿enie:" - -#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 -msgid "Select merge-database source" -msgstr "Wybierz ¼ród³o bazy danych z³±czania " - -#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 -msgid "N/A" -msgstr "N/A" - -#. ---- Sample Fields section ---- -#: src/merge-properties-dialog.c:300 -msgid "Record selection/preview:" -msgstr "" - -#: src/merge-properties-dialog.c:326 -msgid "Select" -msgstr "Wybierz" - -#: src/merge-properties-dialog.c:334 -msgid "Record/Field" -msgstr "" - -#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 -msgid "Data" -msgstr "Dane" - -#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:82 -msgid "Print" -msgstr "Wydrukuj" - -#: src/print-dialog.c:281 -msgid "_Job" -msgstr "" - -#: src/print-dialog.c:286 -#, fuzzy -msgid "P_rinter" -msgstr "Wydrukuj" - -#. ----------- Add simple-copies widget ------------ -#: src/print-dialog.c:314 -msgid "Copies" -msgstr "Kopie" - -#. ------- Add merge control widget ------------ -#: src/print-dialog.c:322 -msgid "Document merge control" -msgstr "Kontrola z³±czania dokumentów" - -#. ----------- Add custom print options area ------------ -#: src/print-dialog.c:330 -msgid "Options" -msgstr "Opcje" - -#: src/print-dialog.c:351 -msgid "print crop marks" -msgstr "" - -#: src/print-dialog.c:553 src/print-dialog.c:592 -msgid "Print preview" -msgstr "Podgl±d wydruku" - -#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 -msgid "gLabels Template Designer" -msgstr "" - -#: src/bc.c:60 -msgid "POSTNET (any)" -msgstr "" - -#: src/bc.c:63 -msgid "POSTNET-5 (ZIP only)" -msgstr "" - -#: src/bc.c:66 -msgid "POSTNET-9 (ZIP+4)" -msgstr "" - -#: src/bc.c:69 -msgid "POSTNET-11 (DPBC)" -msgstr "" - -#: src/bc.c:72 -msgid "EAN (any)" -msgstr "" - -#: src/bc.c:75 -msgid "EAN-8" -msgstr "" - -#: src/bc.c:78 -msgid "EAN-8 +2" -msgstr "" - -#: src/bc.c:81 -msgid "EAN-8 +5" -msgstr "" - -#: src/bc.c:84 -msgid "EAN-13" -msgstr "" - -#: src/bc.c:87 -msgid "EAN-13 +2" -msgstr "" - -#: src/bc.c:90 -msgid "EAN-13 +5" -msgstr "" - -#: src/bc.c:93 -msgid "UPC (UPC-A or UPC-E)" -msgstr "" - -#: src/bc.c:96 -msgid "UPC-A" -msgstr "" - -#: src/bc.c:99 -msgid "UPC-A +2" -msgstr "" - -#: src/bc.c:102 -msgid "UPC-A +5" -msgstr "" - -#: src/bc.c:105 -msgid "UPC-E" -msgstr "" - -#: src/bc.c:108 -msgid "UPC-E +2" -msgstr "" - -#: src/bc.c:111 -msgid "UPC-E +5" -msgstr "" - -#: src/bc.c:114 -msgid "ISBN" -msgstr "" - -#: src/bc.c:117 -msgid "ISBN +5" -msgstr "" - -#: src/bc.c:120 -msgid "Code 39" -msgstr "" - -#: src/bc.c:123 -msgid "Code 128" -msgstr "" - -#: src/bc.c:126 -msgid "Code 128C" -msgstr "" - -#: src/bc.c:129 -msgid "Code 128B" -msgstr "" - -#: src/bc.c:132 -msgid "Interleaved 2 of 5" -msgstr "" - -#: src/bc.c:135 -msgid "Codabar" -msgstr "" - -#: src/bc.c:138 -msgid "MSI" -msgstr "" - -#: src/bc.c:141 -msgid "Plessey" -msgstr "" - -#: src/label.c:569 -msgid "Untitled" -msgstr "" - -#: src/xml-label.c:176 src/xml-label.c:213 -msgid "xmlParseFile error" -msgstr "b³±d przetwarzania pliku xml" - -#: src/xml-label.c:250 -msgid "No document root" -msgstr "Brak g³ównego dokumentu" - -#: src/xml-label.c:264 -msgid "Importing from glabels 0.1 format" -msgstr "" - -#: src/xml-label.c:272 -msgid "Importing from glabels 0.4 format" -msgstr "" - -#: src/xml-label.c:279 -msgid "Importing from glabels 1.91 format" -msgstr "" - -#: src/xml-label.c:282 -#, fuzzy -msgid "bad document, unknown glabels Namespace" -msgstr "" -"dokument jest niepoprawnego typu, nie odnaleziono przestrzeni nazw glabels" - -#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "Niepoprawny wêze³ g³ówny = \"%s\"" - -#: src/xml-label.c:348 src/xml-label-191.c:165 -#, fuzzy, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "Niepoprawny wêze³ g³ówny = \"%s\"" - -#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 -#, c-format -msgid "bad node = \"%s\"" -msgstr "niepoprawny wêze³ = \"%s\"" - -#: src/xml-label.c:796 src/xml-label-191.c:605 -#, fuzzy, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "niepoprawny wêze³ = \"%s\"" - -#: src/xml-label.c:962 libglabels/xml-template.c:528 -msgid "Utf8 conversion error." -msgstr "" - -#: src/xml-label.c:969 libglabels/xml-template.c:535 -msgid "Problem saving xml file." -msgstr "Problem podczas zapisu pliku xml." - -#. This should always be an id, but just in case a name -#. slips by! -#: src/xml-label-191.c:680 libglabels/xml-template.c:192 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "" - -#: src/xml-label-191.c:690 libglabels/xml-template.c:202 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "" - -#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 -msgid "None" -msgstr "Brak" - -#: src/merge-init.c:53 -#, fuzzy -msgid "Text file with comma delimeters (CSV)" -msgstr "Tekst oddzielony przecinkami (CSV)" - -#: src/merge-init.c:60 -#, fuzzy -msgid "Text file with colon delimeters" -msgstr "Tekst oddzielany dwukropkami" - -#: src/merge-init.c:67 -#, fuzzy -msgid "Text file with tab delimeters" -msgstr "Tekst oddzielony tabulacjami" - -#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 -#, fuzzy -msgid "File:" -msgstr "Wype³nienie" - -#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 -msgid "Key:" -msgstr "Klucz:" - -#: src/wdgt-print-copies.c:179 -msgid "Sheets:" -msgstr "Arkusze:" - -#: src/wdgt-print-copies.c:197 -msgid "Labels" -msgstr "Etykiety" - -#: src/wdgt-print-copies.c:200 -msgid "from:" -msgstr "od:" - -#: src/wdgt-print-copies.c:207 -msgid "to:" -msgstr "do:" - -#: src/wdgt-print-merge.c:178 -msgid "Start on label" -msgstr "Rozpocznij od etykiety" - -#: src/wdgt-print-merge.c:186 -msgid "on 1st sheet" -msgstr "na pierwszym arkuszu" - -#: src/wdgt-print-merge.c:195 -msgid "Copies:" -msgstr "Kopie:" - -#: src/wdgt-print-merge.c:201 -msgid "Collate" -msgstr "Uk³adanie" - -#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 -msgid "Description:" -msgstr "Opis:" - -#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 -msgid "Page size:" -msgstr "Rozmiar strony:" - -#: src/wdgt-media-select.c:290 -msgid "Label size:" -msgstr "Rozmiar etykiety:" - -#: src/wdgt-media-select.c:301 -msgid "Layout:" -msgstr "Wygl±d:" - -#: src/wdgt-media-select.c:578 -#, c-format -msgid "%d x %d (%d per sheet)" -msgstr "%d x %d (%d na arkusz)" - -#: src/wdgt-media-select.c:582 -#, fuzzy, c-format -msgid "%d per sheet" -msgstr "%d x %d (%d na arkusz)" - -#: src/wdgt-media-select.c:614 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -#: src/wdgt-media-select.c:619 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 -#, c-format -msgid "%s %s diameter" -msgstr "" - -#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 -#, c-format -msgid "%.5g %s diameter" -msgstr "" - -#: src/wdgt-rotate-label.c:193 -msgid "Rotate" -msgstr "Obróæ" - -#. This is the default custom color -#: src/mygal/color-palette.c:396 -#, fuzzy -msgid "custom" -msgstr "W³asny klucz pola" - -#. "Custom" color - we'll pop up a GnomeColorPicker -#: src/mygal/color-palette.c:438 -#, fuzzy -msgid "Custom Color:" -msgstr "Kolor:" - -#: src/mygal/color-palette.c:446 -msgid "Choose Custom Color" -msgstr "" - -#: src/mygal/color-palette.c:579 -msgid "black" -msgstr "" - -#: src/mygal/color-palette.c:580 -msgid "light brown" -msgstr "" - -#: src/mygal/color-palette.c:581 -msgid "brown gold" -msgstr "" - -#: src/mygal/color-palette.c:582 -msgid "dark green #2" -msgstr "" - -#: src/mygal/color-palette.c:583 -msgid "navy" -msgstr "" - -#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 -msgid "dark blue" -msgstr "" - -#: src/mygal/color-palette.c:585 -msgid "purple #2" -msgstr "" - -#: src/mygal/color-palette.c:586 -msgid "very dark gray" -msgstr "" - -#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 -msgid "dark red" -msgstr "" - -#: src/mygal/color-palette.c:590 -msgid "red-orange" -msgstr "" - -#: src/mygal/color-palette.c:591 -msgid "gold" -msgstr "" - -#: src/mygal/color-palette.c:592 -msgid "dark green" -msgstr "" - -#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 -msgid "dull blue" -msgstr "" - -#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 -msgid "blue" -msgstr "" - -#: src/mygal/color-palette.c:595 -msgid "dull purple" -msgstr "" - -#: src/mygal/color-palette.c:596 -msgid "dark grey" -msgstr "" - -#: src/mygal/color-palette.c:599 -msgid "red" -msgstr "" - -#: src/mygal/color-palette.c:600 -msgid "orange" -msgstr "" - -#: src/mygal/color-palette.c:601 -msgid "lime" -msgstr "" - -#: src/mygal/color-palette.c:602 -msgid "dull green" -msgstr "" - -#: src/mygal/color-palette.c:603 -msgid "dull blue #2" -msgstr "" - -#: src/mygal/color-palette.c:604 -msgid "sky blue #2" -msgstr "" - -#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 -msgid "purple" -msgstr "" - -#: src/mygal/color-palette.c:606 -msgid "gray" -msgstr "" - -#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 -#, fuzzy -msgid "magenta" -msgstr "Obraz" - -#: src/mygal/color-palette.c:610 -msgid "bright orange" -msgstr "" - -#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 -msgid "yellow" -msgstr "" - -#: src/mygal/color-palette.c:612 -#, fuzzy -msgid "green" -msgstr "stopni(e)" - -#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 -msgid "cyan" -msgstr "" - -#: src/mygal/color-palette.c:614 -msgid "bright blue" -msgstr "" - -#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 -msgid "red purple" -msgstr "" - -#: src/mygal/color-palette.c:616 -msgid "light grey" -msgstr "" - -#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 -msgid "pink" -msgstr "" - -#: src/mygal/color-palette.c:620 -msgid "light orange" -msgstr "" - -#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 -msgid "light yellow" -msgstr "" - -#: src/mygal/color-palette.c:622 -msgid "light green" -msgstr "" - -#: src/mygal/color-palette.c:623 -msgid "light cyan" -msgstr "" - -#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 -msgid "light blue" -msgstr "" - -#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 -msgid "light purple" -msgstr "" - -#: src/mygal/color-palette.c:626 -msgid "white" -msgstr "" - -#: src/mygal/color-palette.c:631 -msgid "purplish blue" -msgstr "" - -#: src/mygal/color-palette.c:635 -msgid "dark purple" -msgstr "" - -#: src/mygal/color-palette.c:637 -msgid "sky blue" -msgstr "" - -#: libglabels/template.c:848 -#, c-format -msgid "Generic %s full page" -msgstr "" - -#: libglabels/template.c:897 -msgid "No template files found!" -msgstr "Nie znaleziono pliku szablonu!" - -#. Create and append an "Other" entry. -#: libglabels/paper.c:67 -msgid "Other" -msgstr "" - -#: libglabels/paper.c:361 -#, fuzzy -msgid "No paper files found!" -msgstr "Nie znaleziono pliku szablonu!" - -#: data/ui/glabels-ui.xml.h:1 -msgid "About glabels" -msgstr "" - -#: data/ui/glabels-ui.xml.h:2 -msgid "About..." -msgstr "" - -#: data/ui/glabels-ui.xml.h:3 -msgid "Align _Horizontal" -msgstr "" - -#: data/ui/glabels-ui.xml.h:4 -msgid "Align _Vertical" -msgstr "" - -#: data/ui/glabels-ui.xml.h:5 -msgid "Align objects to bottoms" -msgstr "" - -#: data/ui/glabels-ui.xml.h:6 -msgid "Align objects to horizontal centers" -msgstr "" - -#: data/ui/glabels-ui.xml.h:7 -msgid "Align objects to left edges" -msgstr "" - -#: data/ui/glabels-ui.xml.h:8 -msgid "Align objects to right edges" -msgstr "" - -#: data/ui/glabels-ui.xml.h:9 -msgid "Align objects to tops" -msgstr "" - -#: data/ui/glabels-ui.xml.h:10 -msgid "Align objects to vertical centers" -msgstr "" - -#: data/ui/glabels-ui.xml.h:12 -msgid "Bold" -msgstr "" - -#: data/ui/glabels-ui.xml.h:14 -#, fuzzy -msgid "Center align" -msgstr "Ogólne" - -#: data/ui/glabels-ui.xml.h:15 -msgid "Center objects to horizontal label center" -msgstr "" - -#: data/ui/glabels-ui.xml.h:16 -msgid "Center objects to vertical label center" -msgstr "" - -#: data/ui/glabels-ui.xml.h:17 -msgid "Change the visibility of markup lines in the current window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:18 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:19 -msgid "Change the visibility of the grid in the current window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:20 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:21 -msgid "Change the visibility of the property toolbar in the current window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:22 -msgid "Close" -msgstr "" - -#: data/ui/glabels-ui.xml.h:23 -#, fuzzy -msgid "Close the current file" -msgstr "Zapisuje bie¿±cy plik" - -#: data/ui/glabels-ui.xml.h:24 -msgid "Configure the application" -msgstr "" - -#: data/ui/glabels-ui.xml.h:25 -msgid "Contents" -msgstr "" - -#: data/ui/glabels-ui.xml.h:26 -msgid "Copy" -msgstr "" - -#: data/ui/glabels-ui.xml.h:27 -#, fuzzy -msgid "Copy the selection" -msgstr "Usuwa wszelkie zaznaczenia" - -#: data/ui/glabels-ui.xml.h:28 -#, fuzzy -msgid "Create a custom template" -msgstr "Tworzy liniê" - -#: data/ui/glabels-ui.xml.h:29 -#, fuzzy -msgid "Create a new document" -msgstr "Tworzy liniê" - -#: data/ui/glabels-ui.xml.h:30 -msgid "Create barcode object" -msgstr "Tworzy kod paskowy" - -#: data/ui/glabels-ui.xml.h:31 -msgid "Create box/rectangle object" -msgstr "Tworzy skrzynkê/prostok±t" - -#: data/ui/glabels-ui.xml.h:32 -msgid "Create ellipse/circle object" -msgstr "Tworzy elipsê/okr±g" - -#: data/ui/glabels-ui.xml.h:33 -msgid "Create image object" -msgstr "Tworzy obraz" - -#: data/ui/glabels-ui.xml.h:34 -msgid "Create line object" -msgstr "Tworzy liniê" - -#: data/ui/glabels-ui.xml.h:35 -msgid "Create text object" -msgstr "Tworzy obiekt tekstowy" - -#: data/ui/glabels-ui.xml.h:36 -msgid "Cu_t" -msgstr "" - -#: data/ui/glabels-ui.xml.h:37 -#, fuzzy -msgid "Customize" -msgstr "W³asny klucz pola" - -#: data/ui/glabels-ui.xml.h:38 -msgid "Customize Drawing Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:39 -msgid "Customize Main Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:40 -msgid "Customize Property Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:41 -msgid "Customize toolbars" -msgstr "" - -#: data/ui/glabels-ui.xml.h:42 -msgid "Cut" -msgstr "" - -#: data/ui/glabels-ui.xml.h:43 -msgid "Cut the selection" -msgstr "" - -#: data/ui/glabels-ui.xml.h:44 -msgid "Decrease magnification" -msgstr "" - -#: data/ui/glabels-ui.xml.h:45 -msgid "Delete" -msgstr "Usuñ" - -#: data/ui/glabels-ui.xml.h:46 -#, fuzzy -msgid "Delete the selected objects" -msgstr "Tworzy obiekt tekstowy" - -#: data/ui/glabels-ui.xml.h:47 -msgid "Drawing toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:48 -msgid "Dump XML" -msgstr "" - -#: data/ui/glabels-ui.xml.h:49 -msgid "Dump the UI Xml description" -msgstr "" - -#: data/ui/glabels-ui.xml.h:50 -msgid "Edit merge properties" -msgstr "Modyfikuje w³a¶ciwo¶ci z³±czania" - -#: data/ui/glabels-ui.xml.h:54 -msgid "Flip object horizontally" -msgstr "" - -#: data/ui/glabels-ui.xml.h:55 -msgid "Flip object vertically" -msgstr "" - -#: data/ui/glabels-ui.xml.h:56 -#, fuzzy -msgid "Font name" -msgstr "Nie zapisuj" - -#: data/ui/glabels-ui.xml.h:57 -#, fuzzy -msgid "Font selector" -msgstr "Usuwa wszelkie zaznaczenia" - -#: data/ui/glabels-ui.xml.h:58 -#, fuzzy -msgid "Font size" -msgstr "Nie zapisuj" - -#: data/ui/glabels-ui.xml.h:59 -msgid "Icon and _Text" -msgstr "" - -#: data/ui/glabels-ui.xml.h:60 -msgid "Increase magnification" -msgstr "" - -#: data/ui/glabels-ui.xml.h:61 -msgid "Italic" -msgstr "" - -#: data/ui/glabels-ui.xml.h:63 -msgid "Left align" -msgstr "" - -#: data/ui/glabels-ui.xml.h:65 -msgid "Line width" -msgstr "" - -#: data/ui/glabels-ui.xml.h:66 -msgid "Lower object to bottom" -msgstr "" - -#: data/ui/glabels-ui.xml.h:67 -msgid "M_arkup" -msgstr "" - -#: data/ui/glabels-ui.xml.h:68 -msgid "Main toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:69 -msgid "Markup" -msgstr "" - -#: data/ui/glabels-ui.xml.h:70 -#, fuzzy -msgid "Modify document properties" -msgstr "Modyfikacja w³a¶ciwo¶ci z³±czania dokumentów" - -#: data/ui/glabels-ui.xml.h:71 -#, fuzzy -msgid "New" -msgstr "_Nowa" - -#: data/ui/glabels-ui.xml.h:72 -#, fuzzy -msgid "Object property editor" -msgstr "W³a¶ciwo¶ci tekstu" - -#: data/ui/glabels-ui.xml.h:73 -msgid "Only show icons in the drawing toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:74 -msgid "Only show icons in the main toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:76 -msgid "Open a file" -msgstr "Otwiera plik" - -#: data/ui/glabels-ui.xml.h:77 -#, fuzzy -msgid "Open the glabels manual" -msgstr "Otwórz etykietê" - -#: data/ui/glabels-ui.xml.h:78 -msgid "Paste" -msgstr "" - -#: data/ui/glabels-ui.xml.h:79 -msgid "Paste the clipboard" -msgstr "" - -#: data/ui/glabels-ui.xml.h:80 -#, fuzzy -msgid "Pr_eferences..." -msgstr "Glabels: Preferencje" - -#: data/ui/glabels-ui.xml.h:81 -#, fuzzy -msgid "Preferences" -msgstr "Glabels: Preferencje" - -#: data/ui/glabels-ui.xml.h:83 -#, fuzzy -msgid "Print the current file" -msgstr "Drukuje bie¿±cy plik" - -#: data/ui/glabels-ui.xml.h:84 -#, fuzzy -msgid "Proper_ties..." -msgstr "W³a¶ciwo¶ci tekstu" - -#: data/ui/glabels-ui.xml.h:85 -#, fuzzy -msgid "Properties" -msgstr "W³a¶ciwo¶ci tekstu" - -#: data/ui/glabels-ui.xml.h:86 -msgid "Property toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:87 -msgid "Quit" -msgstr "" - -#: data/ui/glabels-ui.xml.h:88 -msgid "Quit the program" -msgstr "" - -#: data/ui/glabels-ui.xml.h:89 -msgid "Raise object to top" -msgstr "" - -#: data/ui/glabels-ui.xml.h:90 -msgid "Recent _Files" -msgstr "" - -#: data/ui/glabels-ui.xml.h:91 -msgid "Redo" -msgstr "" - -#: data/ui/glabels-ui.xml.h:92 -msgid "Redo the undone action" -msgstr "" - -#: data/ui/glabels-ui.xml.h:93 -msgid "Remove all selections" -msgstr "Usuwa wszelkie zaznaczenia" - -#: data/ui/glabels-ui.xml.h:95 -#, no-c-format -msgid "Restore scale to 100%" -msgstr "" - -#: data/ui/glabels-ui.xml.h:96 -msgid "Right align" -msgstr "" - -#: data/ui/glabels-ui.xml.h:99 -msgid "Rotate object 90 clockwise" -msgstr "" - -#: data/ui/glabels-ui.xml.h:100 -msgid "Rotate object 90 counter-clockwise" -msgstr "" - -#: data/ui/glabels-ui.xml.h:101 -#, fuzzy -msgid "Save" -msgstr "Zapisz jako" - -#: data/ui/glabels-ui.xml.h:102 -msgid "Save As" -msgstr "Zapisz jako" - -#: data/ui/glabels-ui.xml.h:103 -#, fuzzy -msgid "Save _As..." -msgstr "Zapisz jako" - -#: data/ui/glabels-ui.xml.h:104 -#, fuzzy -msgid "Save the current file" -msgstr "Zapisuje bie¿±cy plik" - -#: data/ui/glabels-ui.xml.h:105 -msgid "Save the current file with a different name" -msgstr "" - -#: data/ui/glabels-ui.xml.h:106 -#, fuzzy -msgid "Select All" -msgstr "O_dznacz wszystko" - -#: data/ui/glabels-ui.xml.h:107 -#, fuzzy -msgid "Select _All" -msgstr "O_dznacz wszystko" - -#: data/ui/glabels-ui.xml.h:108 -#, fuzzy -msgid "Select all objects" -msgstr "Wybierz, przeno¶ i modyfikuj obiekty" - -#: data/ui/glabels-ui.xml.h:109 -msgid "Select, move and modify objects" -msgstr "Wybierz, przeno¶ i modyfikuj obiekty" - -#: data/ui/glabels-ui.xml.h:111 -msgid "Set drawing toolbar button style according to desktop default" -msgstr "" - -#: data/ui/glabels-ui.xml.h:112 -msgid "Set main toolbar button style according to desktop default" -msgstr "" - -#: data/ui/glabels-ui.xml.h:113 -msgid "Show _Tooltips" -msgstr "" - -#: data/ui/glabels-ui.xml.h:114 -msgid "Show both icons and texts in the drawing toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:115 -msgid "Show both icons and texts in the main toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:116 -msgid "Show tooltips in the drawing toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:117 -msgid "Show tooltips in the main toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:118 -msgid "Show tooltips in the property toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:119 -msgid "Template Designer" -msgstr "" - -#: data/ui/glabels-ui.xml.h:120 -msgid "Template _Designer..." -msgstr "" - -#: data/ui/glabels-ui.xml.h:121 -msgid "Text color" -msgstr "" - -#: data/ui/glabels-ui.xml.h:122 -#, fuzzy -msgid "U_n-select All" -msgstr "O_dznacz wszystko" - -#: data/ui/glabels-ui.xml.h:123 -#, fuzzy -msgid "Un-select All" -msgstr "O_dznacz wszystko" - -#: data/ui/glabels-ui.xml.h:124 -msgid "Undo" -msgstr "" - -#: data/ui/glabels-ui.xml.h:125 -msgid "Undo the last action" -msgstr "" - -#: data/ui/glabels-ui.xml.h:126 -#, fuzzy -msgid "Zoom _1:1" -msgstr "Powiêkszenie 1:1" - -#: data/ui/glabels-ui.xml.h:127 -#, fuzzy -msgid "Zoom _In" -msgstr "Powiêksz" - -#: data/ui/glabels-ui.xml.h:128 -#, fuzzy -msgid "Zoom _Out" -msgstr "Pomniejsz" - -#: data/ui/glabels-ui.xml.h:129 -#, fuzzy -msgid "Zoom to _fit" -msgstr "Powiêksza 1:1" - -#: data/ui/glabels-ui.xml.h:130 -msgid "Zoom to fit window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:131 -msgid "_About..." -msgstr "" - -#: data/ui/glabels-ui.xml.h:132 -msgid "_Bottoms" -msgstr "" - -#: data/ui/glabels-ui.xml.h:135 -msgid "_Close" -msgstr "" - -#: data/ui/glabels-ui.xml.h:136 -msgid "_Contents" -msgstr "" - -#: data/ui/glabels-ui.xml.h:137 -msgid "_Copy" -msgstr "" - -#: data/ui/glabels-ui.xml.h:138 -#, fuzzy -msgid "_Create Object" -msgstr "Tworzy obiekt tekstowy" - -#: data/ui/glabels-ui.xml.h:139 -msgid "_Debug" -msgstr "" - -#: data/ui/glabels-ui.xml.h:141 -msgid "_Desktop Default" -msgstr "" - -#: data/ui/glabels-ui.xml.h:142 -msgid "_Drawing Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:143 -msgid "_Edit" -msgstr "" - -#: data/ui/glabels-ui.xml.h:145 -#, fuzzy -msgid "_File" -msgstr "Wype³nienie" - -#: data/ui/glabels-ui.xml.h:146 -msgid "_Grid" -msgstr "" - -#: data/ui/glabels-ui.xml.h:147 -msgid "_Help" -msgstr "" - -#: data/ui/glabels-ui.xml.h:148 -msgid "_Icon" -msgstr "" - -#: data/ui/glabels-ui.xml.h:152 -msgid "_Main Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:153 -#, fuzzy -msgid "_Merge Properties..." -msgstr "W³a¶ciwo¶ci z³±czania" - -#: data/ui/glabels-ui.xml.h:154 -msgid "_New" -msgstr "_Nowa" - -#: data/ui/glabels-ui.xml.h:155 -msgid "_Objects" -msgstr "" - -#: data/ui/glabels-ui.xml.h:156 -#, fuzzy -msgid "_Open..." -msgstr "Otwórz" - -#: data/ui/glabels-ui.xml.h:158 -msgid "_Paste" -msgstr "" - -#: data/ui/glabels-ui.xml.h:159 -#, fuzzy -msgid "_Print..." -msgstr "Wydrukuj" - -#: data/ui/glabels-ui.xml.h:160 -msgid "_Property Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:161 -msgid "_Quit" -msgstr "" - -#: data/ui/glabels-ui.xml.h:164 -#, fuzzy -msgid "_Save" -msgstr "Zapisz jako" - -#: data/ui/glabels-ui.xml.h:168 -#, fuzzy -msgid "_View" -msgstr "_Nowa" - -#: data/glade/prefs-dialog.glade.h:1 -msgid " " -msgstr "" - -#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 -#: data/glade/template-designer.glade.h:5 -msgid "*" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:3 -msgid "Default page size" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:4 -msgid "Fill" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:5 -msgid "Line" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:6 -msgid "Text" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:7 -msgid "Units" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 -msgid "Alignment:" -msgstr "Wyrównanie:" - -#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 -msgid "Color:" -msgstr "Kolor:" - -#: data/glade/prefs-dialog.glade.h:10 -msgid "Font:" -msgstr "Czcionka:" - -#: data/glade/prefs-dialog.glade.h:11 -msgid "ISO A4" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:12 -msgid "Inches" -msgstr "Cale" - -#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 -msgid "Line Spacing:" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:14 -#, fuzzy -msgid "Locale" -msgstr "Skala" - -#: data/glade/prefs-dialog.glade.h:15 -msgid "Millimeters" -msgstr "Milimetry" - -#: data/glade/prefs-dialog.glade.h:16 -msgid "Object defaults" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:17 -msgid "Points" -msgstr "Punkty" - -#: data/glade/prefs-dialog.glade.h:18 -msgid "Select default properties for new objects." -msgstr "" - -#: data/glade/prefs-dialog.glade.h:19 -msgid "Select locale specific behavior." -msgstr "" - -#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:25 -msgid "US Letter" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 -#: data/glade/template-designer.glade.h:72 -msgid "Width:" -msgstr "Szeroko¶æ:" - -#: data/glade/object-editor.glade.h:2 -msgid "00000000000 00000" -msgstr "" - -#: data/glade/object-editor.glade.h:3 -msgid "Xxx object properties" -msgstr "" - -#: data/glade/object-editor.glade.h:5 -msgid "Allow merge to automatically shrink text" -msgstr "" - -#: data/glade/object-editor.glade.h:6 -msgid "Angle:" -msgstr "K±t" - -#: data/glade/object-editor.glade.h:7 -msgid "Checksum" -msgstr "" - -#: data/glade/object-editor.glade.h:10 -#, fuzzy -msgid "Family:" -msgstr "Wype³nienie" - -#: data/glade/object-editor.glade.h:12 -msgid "Fill" -msgstr "Wype³nienie" - -#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 -msgid "Height:" -msgstr "Wysoko¶æ:" - -#: data/glade/object-editor.glade.h:14 -msgid "Image" -msgstr "Obraz" - -#: data/glade/object-editor.glade.h:15 -msgid "Insert merge field" -msgstr "Wstaw pole z³±czenia" - -#: data/glade/object-editor.glade.h:17 -msgid "Length:" -msgstr "D³ugo¶æ:" - -#: data/glade/object-editor.glade.h:18 -msgid "Line" -msgstr "Linia" - -#: data/glade/object-editor.glade.h:20 -msgid "Literal:" -msgstr "Litera³:" - -#: data/glade/object-editor.glade.h:21 -msgid "Load image" -msgstr "" - -#: data/glade/object-editor.glade.h:22 -msgid "Position" -msgstr "Pozycja" - -#: data/glade/object-editor.glade.h:23 -msgid "Reset image size" -msgstr "Wyzeruj rozmiar obrazu" - -#: data/glade/object-editor.glade.h:24 -msgid "Size" -msgstr "Rozmiar" - -#: data/glade/object-editor.glade.h:25 -#, fuzzy -msgid "Size:" -msgstr "Rozmiar" - -#: data/glade/object-editor.glade.h:26 -#, fuzzy -msgid "Style" -msgstr "Styl" - -#: data/glade/object-editor.glade.h:27 -#, fuzzy -msgid "Style:" -msgstr "Styl" - -#: data/glade/object-editor.glade.h:30 -msgid "X:" -msgstr "X:" - -#: data/glade/object-editor.glade.h:31 -msgid "Y:" -msgstr "Y:" - -#: data/glade/object-editor.glade.h:32 -msgid "degrees" -msgstr "stopni(e)" - -#: data/glade/object-editor.glade.h:33 -msgid "dialog1" -msgstr "" - -#: data/glade/object-editor.glade.h:34 -msgid "digits:" -msgstr "" - -#: data/glade/object-editor.glade.h:35 -#, fuzzy -msgid "format:" -msgstr "Format:" - -#: data/glade/template-designer.glade.h:1 -msgid " " -msgstr "" - -#: data/glade/template-designer.glade.h:2 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "" - -#: data/glade/template-designer.glade.h:3 -msgid "(e.g., 8163A)" -msgstr "" - -#: data/glade/template-designer.glade.h:4 -msgid "(e.g., Avery, Acme, ...)" -msgstr "" - -#: data/glade/template-designer.glade.h:6 -msgid "1. Outer radius:" -msgstr "" - -#: data/glade/template-designer.glade.h:7 -msgid "1. Radius:" -msgstr "" - -#: data/glade/template-designer.glade.h:8 -#, fuzzy -msgid "1. Width:" -msgstr "Szeroko¶æ:" - -#: data/glade/template-designer.glade.h:9 -#, fuzzy -msgid "2. Height:" -msgstr "Wysoko¶æ:" - -#: data/glade/template-designer.glade.h:10 -msgid "2. Inner radius:" -msgstr "" - -#: data/glade/template-designer.glade.h:11 -msgid "2. Waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:12 -msgid "3. Clipping width:" -msgstr "" - -#: data/glade/template-designer.glade.h:13 -msgid "3. Margin" -msgstr "" - -#: data/glade/template-designer.glade.h:14 -msgid "3. Round (radius of corner):" -msgstr "" - -#: data/glade/template-designer.glade.h:15 -msgid "4. Clipping height:" -msgstr "" - -#: data/glade/template-designer.glade.h:16 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:17 -msgid "5. Vert. waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:18 -msgid "5. Waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:19 -msgid "6. Margin" -msgstr "" - -#: data/glade/template-designer.glade.h:20 -msgid "Brand/Manufacturer:" -msgstr "" - -#: data/glade/template-designer.glade.h:21 -msgid "CD/DVD (including credit card CDs)" -msgstr "" - -#: data/glade/template-designer.glade.h:22 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "" - -#: data/glade/template-designer.glade.h:30 -msgid "Design Completed" -msgstr "" - -#: data/glade/template-designer.glade.h:31 -msgid "Distance from left edge (x0):" -msgstr "" - -#: data/glade/template-designer.glade.h:32 -msgid "Distance from top edge (y0):" -msgstr "" - -#: data/glade/template-designer.glade.h:34 -msgid "Horizontal pitch (dx):" -msgstr "" - -#: data/glade/template-designer.glade.h:35 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" - -#: data/glade/template-designer.glade.h:40 -msgid "Label Size (CD/DVD)" -msgstr "" - -#: data/glade/template-designer.glade.h:41 -#, fuzzy -msgid "Label Size (Round)" -msgstr "Rozmiar etykiety:" - -#: data/glade/template-designer.glade.h:42 -#, fuzzy -msgid "Label or Card Shape" -msgstr "Nowa etykieta lub karta" - -#: data/glade/template-designer.glade.h:43 -msgid "Label or Card Size (Rectangular)" -msgstr "" - -#: data/glade/template-designer.glade.h:44 -#, fuzzy -msgid "Layout #1" -msgstr "Wygl±d:" - -#: data/glade/template-designer.glade.h:45 -#, fuzzy -msgid "Layout #2" -msgstr "Wygl±d:" - -#: data/glade/template-designer.glade.h:46 -#, fuzzy -msgid "Layout(s)" -msgstr "Wygl±d:" - -#: data/glade/template-designer.glade.h:47 -#, fuzzy -msgid "Name and Description" -msgstr "Opis:" - -#: data/glade/template-designer.glade.h:48 -msgid "Number across (nx):" -msgstr "" - -#: data/glade/template-designer.glade.h:49 -msgid "Number down (ny):" -msgstr "" - -#: data/glade/template-designer.glade.h:50 -msgid "Number of Layouts" -msgstr "" - -#: data/glade/template-designer.glade.h:51 -msgid "Number of layouts:" -msgstr "" - -#: data/glade/template-designer.glade.h:52 -#, fuzzy -msgid "Page Size" -msgstr "Rozmiar strony:" - -#: data/glade/template-designer.glade.h:54 -msgid "Part #:" -msgstr "" - -#: data/glade/template-designer.glade.h:55 -msgid "" -"Please enter the following identifying information about the template " -"stationery." -msgstr "" - -#: data/glade/template-designer.glade.h:56 -msgid "Please enter the following layout information." -msgstr "" - -#: data/glade/template-designer.glade.h:57 -msgid "" -"Please enter the following size parameters of a single label in your " -"template." -msgstr "" - -#: data/glade/template-designer.glade.h:58 -msgid "" -"Please enter the following size parameters of a single label or card in your " -"template." -msgstr "" - -#: data/glade/template-designer.glade.h:59 -msgid "Please select the basic shape of the labels or cards." -msgstr "" - -#: data/glade/template-designer.glade.h:60 -msgid "Please select the page size of the template stationery." -msgstr "" - -#: data/glade/template-designer.glade.h:61 -#, fuzzy -msgid "Print test sheet" -msgstr "na pierwszym arkuszu" - -#: data/glade/template-designer.glade.h:62 -msgid "Rectangular or square (can have rounded corners)" -msgstr "" - -#: data/glade/template-designer.glade.h:63 -msgid "Round" -msgstr "" - -#: data/glade/template-designer.glade.h:64 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" - -#: data/glade/template-designer.glade.h:66 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" - -#: data/glade/template-designer.glade.h:68 -msgid "Vertical pitch (dy):" -msgstr "" - -#: data/glade/template-designer.glade.h:69 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" - -#: data/templates/paper-sizes.xml.h:1 -msgid "A0" -msgstr "" - -#: data/templates/paper-sizes.xml.h:2 -msgid "A1" -msgstr "" - -#: data/templates/paper-sizes.xml.h:3 -msgid "A10" -msgstr "" - -#: data/templates/paper-sizes.xml.h:4 -msgid "A2" -msgstr "" - -#: data/templates/paper-sizes.xml.h:5 -msgid "A3" -msgstr "" - -#: data/templates/paper-sizes.xml.h:6 -msgid "A4" -msgstr "" - -#: data/templates/paper-sizes.xml.h:7 -msgid "A5" -msgstr "" - -#: data/templates/paper-sizes.xml.h:8 -msgid "A6" -msgstr "" - -#: data/templates/paper-sizes.xml.h:9 -msgid "A7" -msgstr "" - -#: data/templates/paper-sizes.xml.h:10 -msgid "A8" -msgstr "" - -#: data/templates/paper-sizes.xml.h:11 -msgid "A9" -msgstr "" - -#: data/templates/paper-sizes.xml.h:12 -msgid "B0" -msgstr "" - -#: data/templates/paper-sizes.xml.h:13 -msgid "B1" -msgstr "" - -#: data/templates/paper-sizes.xml.h:14 -msgid "B10" -msgstr "" - -#: data/templates/paper-sizes.xml.h:15 -msgid "B2" -msgstr "" - -#: data/templates/paper-sizes.xml.h:16 -msgid "B3" -msgstr "" - -#: data/templates/paper-sizes.xml.h:17 -msgid "B4" -msgstr "" - -#: data/templates/paper-sizes.xml.h:18 -msgid "B5" -msgstr "" - -#: data/templates/paper-sizes.xml.h:19 -msgid "B6" -msgstr "" - -#: data/templates/paper-sizes.xml.h:20 -msgid "B7" -msgstr "" - -#: data/templates/paper-sizes.xml.h:21 -msgid "B8" -msgstr "" - -#: data/templates/paper-sizes.xml.h:22 -msgid "B9" -msgstr "" - -#: data/templates/paper-sizes.xml.h:23 -msgid "US Executive" -msgstr "" - -#: data/templates/paper-sizes.xml.h:24 -msgid "US Legal" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:1 -#: data/templates/zweckform-iso-templates.xml.h:1 -msgid "Address Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:2 -#: data/templates/avery-iso-templates.xml.h:2 -#: data/templates/zweckform-iso-templates.xml.h:3 -#: data/templates/misc-us-templates.xml.h:2 -#: data/templates/misc-iso-templates.xml.h:9 -msgid "Business Cards" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:3 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:4 -msgid "Diskette Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:5 -#, fuzzy -msgid "Filing Labels" -msgstr "Etykiety" - -#: data/templates/avery-us-templates.xml.h:6 -msgid "Full Sheet Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:7 -#, fuzzy -msgid "Large Round Labels" -msgstr "Rozpocznij od etykiety" - -#: data/templates/avery-us-templates.xml.h:8 -msgid "Name Badge Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:9 -msgid "Return Address Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:10 -msgid "Shipping Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:11 -#, fuzzy -msgid "Small Round Labels" -msgstr "Rozpocznij od etykiety" - -#: data/templates/avery-us-templates.xml.h:12 -#, fuzzy -msgid "Square Labels" -msgstr "Etykiety" - -#: data/templates/avery-us-templates.xml.h:13 -msgid "Video Tape Face Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:14 -msgid "Video Tape Spine Labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:1 -msgid "Address labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:3 -msgid "CD Booklet" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:4 -msgid "CD Inlet" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:5 -#: data/templates/zweckform-iso-templates.xml.h:4 -#: data/templates/misc-us-templates.xml.h:4 -#: data/templates/misc-iso-templates.xml.h:10 -#, fuzzy -msgid "CD/DVD Labels" -msgstr "Etykiety" - -#: data/templates/avery-iso-templates.xml.h:6 -msgid "Diskette labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:7 -#: data/templates/zweckform-iso-templates.xml.h:7 -#: data/templates/misc-iso-templates.xml.h:17 -msgid "Mailing Labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:8 -#, fuzzy -msgid "Mailing labels" -msgstr "Etykiety" - -#: data/templates/avery-iso-templates.xml.h:9 -msgid "Mini Address Labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:10 -#, fuzzy -msgid "Shipping labels" -msgstr "Otwórz etykietê" - -#: data/templates/zweckform-iso-templates.xml.h:2 -msgid "Allround Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:5 -msgid "Correction and Cover-up Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:6 -msgid "Lever Arch File Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:8 -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:9 -msgid "Rectangular Copier Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:10 -#: data/templates/misc-iso-templates.xml.h:22 -msgid "Rectangular Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:11 -msgid "Video Labels (back)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:1 -msgid "Business Card CD" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:3 -msgid "CD Template Rectangles" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:5 -msgid "CD/DVD Labels (Face Only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:6 -#: data/templates/misc-iso-templates.xml.h:11 -msgid "CD/DVD Labels (face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:7 -#, fuzzy -msgid "DLT Labels" -msgstr "Etykiety" - -#: data/templates/misc-us-templates.xml.h:8 -msgid "Microtube labels" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:9 -msgid "Mini-CD Labels" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:10 -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:11 -msgid "PRO CD Labels 2-up (Face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:12 -#: data/templates/misc-iso-templates.xml.h:21 -msgid "PRO CD Labels 2-up (face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:13 -msgid "Slimline CD Case (rightside up)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:14 -msgid "Slimline CD Case (upside down)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:1 -msgid "Agipa 119488: Business Cards" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:2 -msgid "Allround Labels --24" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:3 -msgid "Allround Labels --44" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:4 -msgid "Allround Labels --64" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:5 -msgid "Allround Labels --65" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:6 -msgid "Arch File Labels" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:7 -msgid "Arch File Labels (large)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:8 -msgid "Arch File Labels (small)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:12 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:13 -msgid "Diskette Labels (face only)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:14 -msgid "EPSON Photo Stickers 16" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:15 -msgid "Etiketten" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:16 -msgid "Fridge Magnet Stickers" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:18 -msgid "Mailing Labels --14" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:19 -msgid "Mailing Labels-2 columns" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:20 -msgid "Mailing Labels-3 columns" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:23 -msgid "Video Labels (face only)" -msgstr "" - -#: data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers." -msgstr "" - -#: data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "" - -#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 -#, fuzzy -msgid "gLabels Project File" -msgstr "W³a¶ciwo¶ci tekstu" - -#, fuzzy -#~ msgid "Object _Properties..." -#~ msgstr "W³a¶ciwo¶ci tekstu" - -#~ msgid "Display units" -#~ msgstr "Jednostki wy¶wietlania" - -#~ msgid "Default page size" -#~ msgstr "Domy¶lny rozmiar strony" - -#~ msgid "Outline" -#~ msgstr "Ramka" - -#~ msgid "Edit line object properties" -#~ msgstr "Modyfikacja w³a¶ciwo¶ci linii" - -#~ msgid "Edit text object properties" -#~ msgstr "Modyfikacja w³a¶ciowo¶ci tekstu" - -#~ msgid "Maintain current aspect ratio" -#~ msgstr "Utrzymywanie aktualnych proporcji" - -#, fuzzy -#~ msgid "CD Labels" -#~ msgstr "Etykiety" - -#, fuzzy -#~ msgid "Open %s" -#~ msgstr "Otwórz" - -#~ msgid "Revert to saved copy of %s?" -#~ msgstr "Przywróciæ zapisan± kopiê pliku %s?" - -#~ msgid "Unknown media type. Using default." -#~ msgstr "Nieznany typ no¶nika. U¿yto warto¶ci domy¶lnych." - -#~ msgid "" -#~ "``%s'' has been modified.\n" -#~ "\n" -#~ "Do you wish to save it?" -#~ msgstr "" -#~ "Plik \"%s\" zosta³ zmodyfikowany.\n" -#~ "\n" -#~ "Czy chcesz go zapisaæ?" - -#~ msgid "Close / Save label as" -#~ msgstr "Zamyka / Zapisuje etykietê jako" - -#~ msgid "Label no longer valid!" -#~ msgstr "Etykieta nie jest ju¿ poprawna!" - -#~ msgid "Error writing file" -#~ msgstr "B³±d podczas zapisu pliku" - -#~ msgid "Edit properties..." -#~ msgstr "Modyfikuj w³a¶ciwo¶ci..." - -#~ msgid "Appearance" -#~ msgstr "Wygl±d" - -#~ msgid "Position/Size" -#~ msgstr "Pozycja/Rozmiar" - -#~ msgid "Image format not currently supported" -#~ msgstr "Format obrazu aktualnie nie jest obs³ugiwany" - -#~ msgid "Barcode data" -#~ msgstr "Dane kodu paskowego" - -#~ msgid "%" -#~ msgstr "%" - -#~ msgid "Show text with barcode" -#~ msgstr "Wy¶wietlanie tekstu z kodem paskowym" - -#~ msgid "Fields" -#~ msgstr "Pola" - -#~ msgid "Column" -#~ msgstr "Kolumna" - -#~ msgid "Sample data" -#~ msgstr "Próbne dane" - -#~ msgid "Make a new, empty label" -#~ msgstr "Tworzy now±, pust± etykietê" - -#~ msgid " New " -#~ msgstr " Nowa " - -#~ msgid "New Label/Card" -#~ msgstr "Nowa Etykieta/Karta" - -#~ msgid " Open " -#~ msgstr " Otwórz " - -#~ msgid " Save " -#~ msgstr " Zapisz " - -#~ msgid " Print " -#~ msgstr " Wydrukuj " - -#~ msgid "Function is not implemented!" -#~ msgstr "Funkcja nie jest zaimplementowana!" diff --git a/glabels2/po/pt_BR.po b/glabels2/po/pt_BR.po deleted file mode 100644 index 2c1568eb..00000000 --- a/glabels2/po/pt_BR.po +++ /dev/null @@ -1,2624 +0,0 @@ -# Brazilian Portuguese translation of Glabels. -# Copyright (C) 2001 Jim Evins -# Paulo R. Ormenese , 2001. -# -msgid "" -msgstr "" -"Project-Id-Version: glabels 1.91.0\n" -"POT-Creation-Date: 2004-08-08 00:43-0400\n" -"PO-Revision-Date: 2003-01-03 23:15-0300\n" -"Last-Translator: Paulo R. Ormenese \n" -"Language-Team: Brazilian portuguese <>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=iso-8859-1\n" -"Content-Transfer-Encoding: 8bit\n" - -#: src/glabels.c:55 -msgid "Show view debugging messages." -msgstr "Exibe mensagens de depuração de visualização." - -#: src/glabels.c:58 -msgid "Show item debugging messages." -msgstr "Exibe mensagens de depuração de item." - -#: src/glabels.c:61 -msgid "Show printing debugging messages." -msgstr "Exibe mensagens de depuração de impressão." - -#: src/glabels.c:64 -msgid "Show prefs debugging messages." -msgstr "Exibe mensagens de depuração de preferências." - -#: src/glabels.c:67 -msgid "Show file debugging messages." -msgstr "Exibe mensagens de depuração de arquivo." - -#: src/glabels.c:70 -msgid "Show document debugging messages." -msgstr "Exibe mensagens de depuração de documeto." - -#: src/glabels.c:73 -msgid "Show template debugging messages." -msgstr "Exibe mensagens de depuração de modelo." - -#: src/glabels.c:76 -#, fuzzy -msgid "Show paper debugging messages." -msgstr "Exibe mensagens de depuração de preferências." - -#: src/glabels.c:79 -msgid "Show xml debugging messages." -msgstr "Exibe mensagens de depuração de xml." - -#: src/glabels.c:82 -msgid "Show document merge debugging messages." -msgstr "Exibe mensagens de depuração de fusão de documento." - -#: src/glabels.c:85 -msgid "Show commands debugging messages." -msgstr "Exibe mensagens de depuração de comandos." - -#: src/glabels.c:88 -msgid "Show undo debugging messages." -msgstr "Exibe mensagens de depuração de desfazer." - -#: src/glabels.c:91 -msgid "Show recent debugging messages." -msgstr "Exibe mensagens de depuração de recentes" - -#: src/glabels.c:94 -msgid "Show window debugging messages." -msgstr "Exibe mensagens de depuração de janela." - -#: src/glabels.c:97 -msgid "Show ui debugging messages." -msgstr "Exibe mensagens de depuração de ui." - -#: src/glabels.c:100 -#, fuzzy -msgid "Show property_bar debugging messages." -msgstr "Exibe mensagens de depuração de preferências." - -#: src/glabels.c:103 -msgid "Show media select widget debugging messages." -msgstr "Exibe mensagens de depuração de widget de seleção de mídia." - -#: src/glabels.c:106 -msgid "Show mini preview widget debugging messages." -msgstr "Exibe mensagens de depuração de widget de mini previsão." - -#: src/glabels.c:109 -#, fuzzy -msgid "Show pixbuf cache debugging messages." -msgstr "Exibe mensagens de depuração de visualização." - -#: src/glabels.c:112 -msgid "Show widget debugging messages." -msgstr "Exibe mensagens de depuração de widget." - -#: src/glabels.c:115 -#, fuzzy -msgid "Show object editor debugging messages." -msgstr "Exibe mensagens de depuração de recentes" - -#: src/glabels.c:118 -msgid "Turn on all debugging messages." -msgstr "Ativa todas as mensagens de depuração." - -#: src/glabels.c:187 -msgid "Could not initialize Bonobo!\n" -msgstr "Impossível inicializar Bonobo!\n" - -#: src/glabels-batch.c:48 -msgid "print this message" -msgstr "mostra esta mensagem" - -#: src/glabels-batch.c:50 -msgid "print the version of glabels-batch being used" -msgstr "mostra a versão de glabels-batch que está sendo usada" - -#: src/glabels-batch.c:52 -msgid "set output filename (default=\"output.ps\")" -msgstr "define o nome do arquivo de saída (padrão=\"output.ps\")" - -#: src/glabels-batch.c:52 -msgid "filename" -msgstr "nome_de_arquivo" - -#: src/glabels-batch.c:54 -msgid "number of sheets (default=1)" -msgstr "número de páginas (padrão=1)" - -#: src/glabels-batch.c:54 -msgid "sheets" -msgstr "páginas" - -#: src/glabels-batch.c:56 -msgid "number of copies (default=1)" -msgstr "número de cópias (padrão=1)" - -#: src/glabels-batch.c:56 -msgid "copies" -msgstr "cópias" - -#: src/glabels-batch.c:58 src/print-dialog.c:336 -msgid "print outlines (to test printer alignment)" -msgstr "imprimir contornos (testar alinhamento da impressora)" - -#: src/glabels-batch.c:60 src/print-dialog.c:344 -msgid "print in reverse (i.e. a mirror image)" -msgstr "imprimir ao contrário (como uma imagem de espelho)" - -#: src/glabels-batch.c:96 -msgid "[OPTION...] GLABELS_FILE..." -msgstr "[OPÇÃO...] ARQUIVO_GLABELS..." - -#: src/glabels-batch.c:116 -msgid "missing glabels file\n" -msgstr "faltando arquivo glabels\n" - -#: src/glabels-batch.c:157 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "impossível abrir o arquivo glabels %s\n" - -#: src/window.c:244 -msgid "(none) - gLabels" -msgstr "(sem nome) - gLabels" - -#: src/window.c:414 -msgid "(modified)" -msgstr "(modificado)" - -#: src/stock.c:65 data/ui/glabels-ui.xml.h:165 -msgid "_Select Mode" -msgstr "_Selecionar Modo" - -#: src/stock.c:66 data/ui/glabels-ui.xml.h:166 -msgid "_Text" -msgstr "_Texto" - -#: src/stock.c:67 data/ui/glabels-ui.xml.h:151 -msgid "_Line" -msgstr "_Linha" - -#: src/stock.c:68 data/ui/glabels-ui.xml.h:133 -msgid "_Box" -msgstr "_Caixa" - -#: src/stock.c:69 data/ui/glabels-ui.xml.h:144 -msgid "_Ellipse" -msgstr "_Elipse" - -#: src/stock.c:70 data/ui/glabels-ui.xml.h:149 -msgid "_Image" -msgstr "_Imagem" - -#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 -msgid "Bar_code" -msgstr "_Código barras" - -#: src/stock.c:72 -msgid "_Merge Properties" -msgstr "Propriedades de _Fusão" - -#: src/stock.c:73 -msgid "Object _Properties" -msgstr "_Propriedades de Objeto" - -#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 -msgid "Bring to _Front" -msgstr "Trazer para _Frente" - -#: src/stock.c:75 data/ui/glabels-ui.xml.h:110 -msgid "Send to _Back" -msgstr "Enviar para _trás" - -#: src/stock.c:76 data/ui/glabels-ui.xml.h:97 -msgid "Rotate _Left" -msgstr "Girar _Esquerda" - -#: src/stock.c:77 data/ui/glabels-ui.xml.h:98 -msgid "Rotate _Right" -msgstr "Girar _Direita" - -#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 -msgid "Flip _Horizontally" -msgstr "Refletir _Horizontalmente" - -#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 -msgid "Flip _Vertically" -msgstr "Refletir _Verticalmente" - -#: src/stock.c:80 data/ui/glabels-ui.xml.h:150 -msgid "_Lefts" -msgstr "_Esquerdas" - -#: src/stock.c:81 data/ui/glabels-ui.xml.h:162 -msgid "_Rights" -msgstr "_Direitas" - -#: src/stock.c:82 data/ui/glabels-ui.xml.h:134 -msgid "_Centers" -msgstr "C_entros" - -#: src/stock.c:83 data/ui/glabels-ui.xml.h:167 -msgid "_Tops" -msgstr "_Topos" - -#: src/stock.c:84 -msgid "Bottoms" -msgstr "Bases" - -#: src/stock.c:85 -msgid "Centers" -msgstr "Centros" - -#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 -msgid "Label Ce_nter" -msgstr "Ce_ntro Etiqueta" - -#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 -msgid "Fill color" -msgstr "" - -#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 -msgid "Line color" -msgstr "" - -#: src/stock.c:90 src/stock.c:92 -#, fuzzy -msgid "Linked" -msgstr "Linha" - -#: src/stock.c:91 src/stock.c:93 -#, fuzzy -msgid "Not Linked" -msgstr "Nenhum" - -#: src/ui-property-bar.c:345 src/object-editor.c:499 -#, fuzzy -msgid "Default" -msgstr "Apagar" - -#: src/ui-property-bar.c:360 src/object-editor.c:512 -msgid "No fill" -msgstr "" - -#: src/ui-property-bar.c:375 src/object-editor.c:505 -#, fuzzy -msgid "No line" -msgstr "Nenhum" - -#: src/ui-sidebar.c:180 -#, fuzzy -msgid "Object properties" -msgstr "_Propriedades de Objeto" - -#: src/commands.c:385 -msgid "" -"A label and business card creation program for GNOME.\n" -" \n" -"Glabels is free software; you can redistribute it and/or modify it under the " -"terms of the GNU General Public License as published by the Free Software " -"Foundation; either version 2 of the License, or (at your option) any later " -"version.\n" -" \n" -"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.\n" -msgstr "" -"Um programa para criação de etiquetas e cartões de negócios para o GNOME.\n" -"\n" -"Glabels é software livre; você pode redistribuí-lo e/ou modificá-lo sob os " -"termos da Licença Pública Geral GNU conforme publicada pela Free Software " -"Foundation; ou a versão 2 da Licença, ou (sob sua opção) qualquer versão " -"posterior.\n" -"\n" -"Este programa é distribuido na esperança de que seja útil, mas SEM QUALQUER " -"GARANTIA; sem mesmo as garantias implícitas de COMERCIALIZAÇÃO ou AJUSTES A " -"UM PROPÓSITO PARTICULAR. Veja a Licença Pública Geral GNU para mais " -"detalhes.\n" - -#: src/commands.c:399 -msgid "See the file AUTHORS for additional credits," -msgstr "Veja o arquivo AUTHORS para ver créditos adicionais," - -#: src/commands.c:400 -#, fuzzy -msgid "or visit http://glabels.sourceforge.net/" -msgstr "ou visite http://snaught.com/glabels" - -#: src/commands.c:409 -msgid " " -msgstr "" - -#: src/commands.c:424 -msgid "glabels" -msgstr "glabels" - -#: src/file.c:100 -msgid "New Label or Card" -msgstr "Nova Etiqueta ou Cartão" - -#: src/file.c:132 src/file.c:304 -msgid "Media Type" -msgstr "Tipo de mídia" - -#: src/file.c:138 src/file.c:310 -msgid "Label orientation" -msgstr "Orientação da etiqueta" - -#: src/file.c:269 -#, fuzzy -msgid "Label properties" -msgstr "_Propriedades de Objeto" - -#: src/file.c:452 src/file.c:870 -msgid "All files" -msgstr "" - -#: src/file.c:457 src/file.c:875 -#, fuzzy -msgid "gLabels documents" -msgstr "Preferências do gLabels" - -#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 -msgid "Empty file name selection" -msgstr "Seleção de nome de arquivo vazia" - -#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 -msgid "Please select a file or supply a valid file name" -msgstr "Por favor, selecione um arquivo ou forneça um nome de arquivo válido" - -#: src/file.c:519 src/file.c:631 -msgid "File does not exist" -msgstr "Arquivo inexistente" - -#: src/file.c:563 data/ui/glabels-ui.xml.h:75 -msgid "Open" -msgstr "Abrir" - -#: src/file.c:565 -msgid "Open label" -msgstr "Abrir etiqueta" - -#: src/file.c:707 -#, c-format -msgid "Could not open file \"%s\"" -msgstr "Impossível abrir o arquivo \"%s\"" - -#: src/file.c:715 -msgid "Not a supported file format" -msgstr "Formato de arquivo não suportado" - -#: src/file.c:797 src/file.c:979 src/file.c:1174 -#, c-format -msgid "Could not save file \"%s\"" -msgstr "Impossível salvar o arquivo \"%s\"" - -#: src/file.c:805 src/file.c:987 src/file.c:1182 -msgid "Error encountered during save. The file is still not saved." -msgstr "Erro encontrado ao salvar. O arquivo ainda não foi salvo." - -#: src/file.c:848 src/file.c:1048 -#, c-format -msgid "Save \"%s\" as" -msgstr "Salvar \"%s\" como" - -#: src/file.c:935 src/file.c:1131 -msgid "Please supply a valid file name" -msgstr "Por favor, forneça um nome de arquivo válido" - -#: src/file.c:952 src/file.c:1147 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "Sobrescrever o arquivo \"%s\"?" - -#: src/file.c:960 src/file.c:1155 -msgid "File already exists." -msgstr "O arquivo já existe." - -#: src/file.c:1271 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "Salvar modificações no documento \"%s\" antes de fechar?" - -#: src/file.c:1279 -msgid "Your changes will be lost if you don't save them." -msgstr "Suas modificações serão perdidas se você não salvá-las." - -#: src/file.c:1282 -msgid "Close without saving" -msgstr "Fechar sem salvar" - -#. Should not happen -#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 -#: data/glade/object-editor.glade.h:37 -msgid "points" -msgstr "pontos" - -#: src/prefs.c:158 data/glade/object-editor.glade.h:36 -#: data/glade/template-designer.glade.h:74 -msgid "inches" -msgstr "poleg." - -#: src/prefs.c:160 -msgid "mm" -msgstr "mm" - -#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 -msgid "gLabels Preferences" -msgstr "Preferências do gLabels" - -#. -#. * Submenu: Order -#. -#: src/view.c:3570 data/ui/glabels-ui.xml.h:157 -msgid "_Order" -msgstr "_Ordenar" - -#. -#. * Submenu: Rotate/Flip -#. -#: src/view.c:3591 data/ui/glabels-ui.xml.h:163 -msgid "_Rotate/Flip" -msgstr "_Girar/Refletir" - -#. -#. * Submenu: Align Horizontally -#. -#: src/view.c:3624 -msgid "Align _Horizontally" -msgstr "Alinhar _Horizontalmente" - -#. -#. * Submenu: Align Vertically -#. -#: src/view.c:3663 -msgid "Align _Vertically" -msgstr "Alinhar _Verticalmente" - -#: src/view.c:3724 data/ui/glabels-ui.xml.h:140 -msgid "_Delete" -msgstr "_Apagar" - -#. Build editor. -#: src/view-box.c:223 -#, fuzzy -msgid "Box object properties" -msgstr "Editar propriedades do objeto caixa" - -#. Build editor. -#: src/view-ellipse.c:223 -#, fuzzy -msgid "Ellipse object properties" -msgstr "Editar propriedades do objeto elipse" - -#. Build editor. -#: src/view-line.c:223 -#, fuzzy -msgid "Line object properties" -msgstr "Edita propriedades do objeto" - -#. Build editor. -#: src/view-image.c:222 -#, fuzzy -msgid "Image object properties" -msgstr "Editar propriedades do objeto imagem" - -#. Build editor. -#: src/view-text.c:250 -#, fuzzy -msgid "Text object properties" -msgstr "Edita propriedades do objeto" - -#: src/view-text.c:562 data/glade/object-editor.glade.h:28 -msgid "Text" -msgstr "Texto" - -#. Build editor. -#: src/view-barcode.c:209 -#, fuzzy -msgid "Barcode object properties" -msgstr "Editar propriedades do objeto código de barras" - -#: src/view-barcode.c:579 src/print.c:1088 -#, fuzzy -msgid "Invalid barcode data" -msgstr "Código de barras inválido" - -#: src/merge-properties-dialog.c:231 -msgid "Merge Properties" -msgstr "Propriedades de Fusão" - -#. ---- Source section ---- -#: src/merge-properties-dialog.c:237 -msgid "Source" -msgstr "Fonte" - -#: src/merge-properties-dialog.c:245 -msgid "Format:" -msgstr "Formato:" - -#. Location line -#: src/merge-properties-dialog.c:273 -msgid "Location:" -msgstr "Localização" - -#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 -msgid "Select merge-database source" -msgstr "Selecione a fonte da base de dados da fusão" - -#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 -msgid "N/A" -msgstr "Não definido" - -#. ---- Sample Fields section ---- -#: src/merge-properties-dialog.c:300 -msgid "Record selection/preview:" -msgstr "Seleção/previsão de registro:" - -#: src/merge-properties-dialog.c:326 -msgid "Select" -msgstr "Selecionar" - -#: src/merge-properties-dialog.c:334 -msgid "Record/Field" -msgstr "Registro/Campo" - -#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 -msgid "Data" -msgstr "Dado" - -#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:82 -msgid "Print" -msgstr "Imprimir" - -#: src/print-dialog.c:281 -msgid "_Job" -msgstr "_Trabalho" - -#: src/print-dialog.c:286 -msgid "P_rinter" -msgstr "Imp_ressora" - -#. ----------- Add simple-copies widget ------------ -#: src/print-dialog.c:314 -msgid "Copies" -msgstr "Cópias" - -#. ------- Add merge control widget ------------ -#: src/print-dialog.c:322 -msgid "Document merge control" -msgstr "Controle de fusão do documento" - -#. ----------- Add custom print options area ------------ -#: src/print-dialog.c:330 -msgid "Options" -msgstr "Opções" - -#: src/print-dialog.c:351 -msgid "print crop marks" -msgstr "" - -#: src/print-dialog.c:553 src/print-dialog.c:592 -msgid "Print preview" -msgstr "Visualizar impressão" - -#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 -msgid "gLabels Template Designer" -msgstr "" - -#: src/bc.c:60 -msgid "POSTNET (any)" -msgstr "" - -#: src/bc.c:63 -msgid "POSTNET-5 (ZIP only)" -msgstr "" - -#: src/bc.c:66 -msgid "POSTNET-9 (ZIP+4)" -msgstr "" - -#: src/bc.c:69 -msgid "POSTNET-11 (DPBC)" -msgstr "" - -#: src/bc.c:72 -msgid "EAN (any)" -msgstr "" - -#: src/bc.c:75 -msgid "EAN-8" -msgstr "" - -#: src/bc.c:78 -msgid "EAN-8 +2" -msgstr "" - -#: src/bc.c:81 -msgid "EAN-8 +5" -msgstr "" - -#: src/bc.c:84 -msgid "EAN-13" -msgstr "" - -#: src/bc.c:87 -msgid "EAN-13 +2" -msgstr "" - -#: src/bc.c:90 -msgid "EAN-13 +5" -msgstr "" - -#: src/bc.c:93 -msgid "UPC (UPC-A or UPC-E)" -msgstr "" - -#: src/bc.c:96 -msgid "UPC-A" -msgstr "" - -#: src/bc.c:99 -msgid "UPC-A +2" -msgstr "" - -#: src/bc.c:102 -msgid "UPC-A +5" -msgstr "" - -#: src/bc.c:105 -msgid "UPC-E" -msgstr "" - -#: src/bc.c:108 -msgid "UPC-E +2" -msgstr "" - -#: src/bc.c:111 -msgid "UPC-E +5" -msgstr "" - -#: src/bc.c:114 -msgid "ISBN" -msgstr "" - -#: src/bc.c:117 -msgid "ISBN +5" -msgstr "" - -#: src/bc.c:120 -msgid "Code 39" -msgstr "" - -#: src/bc.c:123 -msgid "Code 128" -msgstr "" - -#: src/bc.c:126 -msgid "Code 128C" -msgstr "" - -#: src/bc.c:129 -msgid "Code 128B" -msgstr "" - -#: src/bc.c:132 -msgid "Interleaved 2 of 5" -msgstr "" - -#: src/bc.c:135 -msgid "Codabar" -msgstr "" - -#: src/bc.c:138 -msgid "MSI" -msgstr "" - -#: src/bc.c:141 -msgid "Plessey" -msgstr "" - -#: src/label.c:569 -msgid "Untitled" -msgstr "Sem_título" - -#: src/xml-label.c:176 src/xml-label.c:213 -msgid "xmlParseFile error" -msgstr "erro: xmlParseFile" - -#: src/xml-label.c:250 -msgid "No document root" -msgstr "Sem raiz do documento" - -#: src/xml-label.c:264 -msgid "Importing from glabels 0.1 format" -msgstr "Importando do formato do glabels 0.1" - -#: src/xml-label.c:272 -msgid "Importing from glabels 0.4 format" -msgstr "Importando do formato do glabels 0.4" - -#: src/xml-label.c:279 -#, fuzzy -msgid "Importing from glabels 1.91 format" -msgstr "Importando do formato do glabels 0.1" - -#: src/xml-label.c:282 -msgid "bad document, unknown glabels Namespace" -msgstr "documento ruim, espaço de nome glabels não encontrado" - -#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "Nó raiz ruim = \"%s\"" - -#: src/xml-label.c:348 src/xml-label-191.c:165 -#, fuzzy, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "Nó raiz ruim = \"%s\"" - -#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 -#, c-format -msgid "bad node = \"%s\"" -msgstr "nó ruim = \"%s\"" - -#: src/xml-label.c:796 src/xml-label-191.c:605 -#, fuzzy, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "nó ruim = \"%s\"" - -#: src/xml-label.c:962 libglabels/xml-template.c:528 -msgid "Utf8 conversion error." -msgstr "" - -#: src/xml-label.c:969 libglabels/xml-template.c:535 -msgid "Problem saving xml file." -msgstr "Problema salvando arquivo xml." - -#. This should always be an id, but just in case a name -#. slips by! -#: src/xml-label-191.c:680 libglabels/xml-template.c:192 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "" - -#: src/xml-label-191.c:690 libglabels/xml-template.c:202 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "" - -#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 -msgid "None" -msgstr "Nenhum" - -#: src/merge-init.c:53 -msgid "Text file with comma delimeters (CSV)" -msgstr "Arquivo texto separado com vírgulas (CSV)" - -#: src/merge-init.c:60 -msgid "Text file with colon delimeters" -msgstr "Arquivo texto separado com dois pontos" - -#: src/merge-init.c:67 -msgid "Text file with tab delimeters" -msgstr "Arquivo texto separado com tab" - -#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 -msgid "File:" -msgstr "Arquivo:" - -#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 -msgid "Key:" -msgstr "Chave:" - -#: src/wdgt-print-copies.c:179 -msgid "Sheets:" -msgstr "Páginas:" - -#: src/wdgt-print-copies.c:197 -msgid "Labels" -msgstr "Etiquetas" - -#: src/wdgt-print-copies.c:200 -msgid "from:" -msgstr "de:" - -#: src/wdgt-print-copies.c:207 -msgid "to:" -msgstr "até:" - -#: src/wdgt-print-merge.c:178 -msgid "Start on label" -msgstr "Iniciar na etiqueta" - -#: src/wdgt-print-merge.c:186 -msgid "on 1st sheet" -msgstr "na primeira folha" - -#: src/wdgt-print-merge.c:195 -msgid "Copies:" -msgstr "Cópias:" - -#: src/wdgt-print-merge.c:201 -msgid "Collate" -msgstr "Ordenar" - -#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 -msgid "Description:" -msgstr "Descrição:" - -#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 -msgid "Page size:" -msgstr "Tamanho da página:" - -#: src/wdgt-media-select.c:290 -msgid "Label size:" -msgstr "Tamanho da etiqueta:" - -#: src/wdgt-media-select.c:301 -msgid "Layout:" -msgstr "Disposição:" - -#: src/wdgt-media-select.c:578 -#, c-format -msgid "%d x %d (%d per sheet)" -msgstr "%d x %d (%d por página)" - -#: src/wdgt-media-select.c:582 -#, c-format -msgid "%d per sheet" -msgstr "%d por página" - -#: src/wdgt-media-select.c:614 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -#: src/wdgt-media-select.c:619 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 -#, c-format -msgid "%s %s diameter" -msgstr "%s %s diâmetro" - -#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 -#, c-format -msgid "%.5g %s diameter" -msgstr "%.5g %s diâmetro" - -#: src/wdgt-rotate-label.c:193 -msgid "Rotate" -msgstr "Girar" - -#. This is the default custom color -#: src/mygal/color-palette.c:396 -#, fuzzy -msgid "custom" -msgstr "Personalizar" - -#. "Custom" color - we'll pop up a GnomeColorPicker -#: src/mygal/color-palette.c:438 -#, fuzzy -msgid "Custom Color:" -msgstr "Personaliza barras de ferramentas" - -#: src/mygal/color-palette.c:446 -msgid "Choose Custom Color" -msgstr "" - -#: src/mygal/color-palette.c:579 -msgid "black" -msgstr "" - -#: src/mygal/color-palette.c:580 -msgid "light brown" -msgstr "" - -#: src/mygal/color-palette.c:581 -msgid "brown gold" -msgstr "" - -#: src/mygal/color-palette.c:582 -msgid "dark green #2" -msgstr "" - -#: src/mygal/color-palette.c:583 -msgid "navy" -msgstr "" - -#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 -msgid "dark blue" -msgstr "" - -#: src/mygal/color-palette.c:585 -msgid "purple #2" -msgstr "" - -#: src/mygal/color-palette.c:586 -msgid "very dark gray" -msgstr "" - -#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 -msgid "dark red" -msgstr "" - -#: src/mygal/color-palette.c:590 -msgid "red-orange" -msgstr "" - -#: src/mygal/color-palette.c:591 -msgid "gold" -msgstr "" - -#: src/mygal/color-palette.c:592 -msgid "dark green" -msgstr "" - -#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 -msgid "dull blue" -msgstr "" - -#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 -msgid "blue" -msgstr "" - -#: src/mygal/color-palette.c:595 -msgid "dull purple" -msgstr "" - -#: src/mygal/color-palette.c:596 -msgid "dark grey" -msgstr "" - -#: src/mygal/color-palette.c:599 -msgid "red" -msgstr "" - -#: src/mygal/color-palette.c:600 -msgid "orange" -msgstr "" - -#: src/mygal/color-palette.c:601 -msgid "lime" -msgstr "" - -#: src/mygal/color-palette.c:602 -msgid "dull green" -msgstr "" - -#: src/mygal/color-palette.c:603 -msgid "dull blue #2" -msgstr "" - -#: src/mygal/color-palette.c:604 -msgid "sky blue #2" -msgstr "" - -#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 -msgid "purple" -msgstr "" - -#: src/mygal/color-palette.c:606 -msgid "gray" -msgstr "" - -#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 -#, fuzzy -msgid "magenta" -msgstr "Imagem" - -#: src/mygal/color-palette.c:610 -msgid "bright orange" -msgstr "" - -#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 -msgid "yellow" -msgstr "" - -#: src/mygal/color-palette.c:612 -#, fuzzy -msgid "green" -msgstr "graus" - -#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 -msgid "cyan" -msgstr "" - -#: src/mygal/color-palette.c:614 -msgid "bright blue" -msgstr "" - -#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 -msgid "red purple" -msgstr "" - -#: src/mygal/color-palette.c:616 -msgid "light grey" -msgstr "" - -#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 -msgid "pink" -msgstr "" - -#: src/mygal/color-palette.c:620 -msgid "light orange" -msgstr "" - -#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 -msgid "light yellow" -msgstr "" - -#: src/mygal/color-palette.c:622 -msgid "light green" -msgstr "" - -#: src/mygal/color-palette.c:623 -msgid "light cyan" -msgstr "" - -#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 -msgid "light blue" -msgstr "" - -#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 -msgid "light purple" -msgstr "" - -#: src/mygal/color-palette.c:626 -msgid "white" -msgstr "" - -#: src/mygal/color-palette.c:631 -msgid "purplish blue" -msgstr "" - -#: src/mygal/color-palette.c:635 -msgid "dark purple" -msgstr "" - -#: src/mygal/color-palette.c:637 -msgid "sky blue" -msgstr "" - -#: libglabels/template.c:848 -#, c-format -msgid "Generic %s full page" -msgstr "Página completa %s genérico" - -#: libglabels/template.c:897 -msgid "No template files found!" -msgstr "Nenhum arquivo modelo encontrado!" - -#. Create and append an "Other" entry. -#: libglabels/paper.c:67 -msgid "Other" -msgstr "" - -#: libglabels/paper.c:361 -#, fuzzy -msgid "No paper files found!" -msgstr "Nenhum arquivo modelo encontrado!" - -#: data/ui/glabels-ui.xml.h:1 -msgid "About glabels" -msgstr "Sobre glabels" - -#: data/ui/glabels-ui.xml.h:2 -msgid "About..." -msgstr "Sobre..." - -#: data/ui/glabels-ui.xml.h:3 -msgid "Align _Horizontal" -msgstr "Alinhar _Horizontal" - -#: data/ui/glabels-ui.xml.h:4 -msgid "Align _Vertical" -msgstr "Alinhar _Vertical" - -#: data/ui/glabels-ui.xml.h:5 -msgid "Align objects to bottoms" -msgstr "Alinha objetos pelas bases" - -#: data/ui/glabels-ui.xml.h:6 -msgid "Align objects to horizontal centers" -msgstr "Alinha objetos pelos centros horizontais" - -#: data/ui/glabels-ui.xml.h:7 -msgid "Align objects to left edges" -msgstr "Alinha objetos pelas bordas esquerdas" - -#: data/ui/glabels-ui.xml.h:8 -msgid "Align objects to right edges" -msgstr "Alinha objetos pelas bordas direitas" - -#: data/ui/glabels-ui.xml.h:9 -msgid "Align objects to tops" -msgstr "Alinha objetos pelos topos" - -#: data/ui/glabels-ui.xml.h:10 -msgid "Align objects to vertical centers" -msgstr "Alinha objetos pelos centros verticais" - -#: data/ui/glabels-ui.xml.h:12 -msgid "Bold" -msgstr "" - -#: data/ui/glabels-ui.xml.h:14 -#, fuzzy -msgid "Center align" -msgstr "Centros" - -#: data/ui/glabels-ui.xml.h:15 -msgid "Center objects to horizontal label center" -msgstr "Centra objetos no centro horizontal da etiqueta" - -#: data/ui/glabels-ui.xml.h:16 -msgid "Center objects to vertical label center" -msgstr "Centra objetos no centro vertical da etiqueta" - -#: data/ui/glabels-ui.xml.h:17 -msgid "Change the visibility of markup lines in the current window" -msgstr "Muda a visibilidade das linhas de marcação na janela atual" - -#: data/ui/glabels-ui.xml.h:18 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "Muda a visibilidade da barra de ferramentas de desenho na janela atual" - -#: data/ui/glabels-ui.xml.h:19 -msgid "Change the visibility of the grid in the current window" -msgstr "Muda a visibilidade da grade na janela atual" - -#: data/ui/glabels-ui.xml.h:20 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "Muda a visibilidade da barra de ferramentas principal na janela atual" - -#: data/ui/glabels-ui.xml.h:21 -#, fuzzy -msgid "Change the visibility of the property toolbar in the current window" -msgstr "Muda a visibilidade da barra de ferramentas principal na janela atual" - -#: data/ui/glabels-ui.xml.h:22 -msgid "Close" -msgstr "Fechar" - -#: data/ui/glabels-ui.xml.h:23 -msgid "Close the current file" -msgstr "Fechar o arquivo atual" - -#: data/ui/glabels-ui.xml.h:24 -msgid "Configure the application" -msgstr "Configurar a aplicação" - -#: data/ui/glabels-ui.xml.h:25 -msgid "Contents" -msgstr "Conteúdo" - -#: data/ui/glabels-ui.xml.h:26 -msgid "Copy" -msgstr "Copiar" - -#: data/ui/glabels-ui.xml.h:27 -msgid "Copy the selection" -msgstr "Copia a seleção" - -#: data/ui/glabels-ui.xml.h:28 -#, fuzzy -msgid "Create a custom template" -msgstr "Cria um novo documento" - -#: data/ui/glabels-ui.xml.h:29 -msgid "Create a new document" -msgstr "Cria um novo documento" - -#: data/ui/glabels-ui.xml.h:30 -msgid "Create barcode object" -msgstr "Criar objeto código de barras" - -#: data/ui/glabels-ui.xml.h:31 -msgid "Create box/rectangle object" -msgstr "Criar objeto caixa/retângulo" - -#: data/ui/glabels-ui.xml.h:32 -msgid "Create ellipse/circle object" -msgstr "Criar objeto elipse/círculo" - -#: data/ui/glabels-ui.xml.h:33 -msgid "Create image object" -msgstr "Criar objeto imagem" - -#: data/ui/glabels-ui.xml.h:34 -msgid "Create line object" -msgstr "Criar objeto linha" - -#: data/ui/glabels-ui.xml.h:35 -msgid "Create text object" -msgstr "Criar objeto texto" - -#: data/ui/glabels-ui.xml.h:36 -msgid "Cu_t" -msgstr "Cor_tar" - -#: data/ui/glabels-ui.xml.h:37 -msgid "Customize" -msgstr "Personalizar" - -#: data/ui/glabels-ui.xml.h:38 -msgid "Customize Drawing Toolbar" -msgstr "Personaliza barra de ferramentas de desenho" - -#: data/ui/glabels-ui.xml.h:39 -msgid "Customize Main Toolbar" -msgstr "Personaliza barra de ferramentas principal" - -#: data/ui/glabels-ui.xml.h:40 -#, fuzzy -msgid "Customize Property Toolbar" -msgstr "Personaliza barras de ferramentas" - -#: data/ui/glabels-ui.xml.h:41 -msgid "Customize toolbars" -msgstr "Personaliza barras de ferramentas" - -#: data/ui/glabels-ui.xml.h:42 -msgid "Cut" -msgstr "Cortar" - -#: data/ui/glabels-ui.xml.h:43 -msgid "Cut the selection" -msgstr "Corta a seleção" - -#: data/ui/glabels-ui.xml.h:44 -msgid "Decrease magnification" -msgstr "Diminuir aumento" - -#: data/ui/glabels-ui.xml.h:45 -msgid "Delete" -msgstr "Apagar" - -#: data/ui/glabels-ui.xml.h:46 -msgid "Delete the selected objects" -msgstr "Apaga os objetos selecionados" - -#: data/ui/glabels-ui.xml.h:47 -msgid "Drawing toolbar" -msgstr "Barra de ferramentas de desenho" - -#: data/ui/glabels-ui.xml.h:48 -msgid "Dump XML" -msgstr "Descarregar XML" - -#: data/ui/glabels-ui.xml.h:49 -msgid "Dump the UI Xml description" -msgstr "Descarrega a descrição da UI Xml" - -#: data/ui/glabels-ui.xml.h:50 -msgid "Edit merge properties" -msgstr "Editar propriedades de fusão" - -#: data/ui/glabels-ui.xml.h:54 -msgid "Flip object horizontally" -msgstr "Reflete objeto horizontalmente" - -#: data/ui/glabels-ui.xml.h:55 -msgid "Flip object vertically" -msgstr "Reflete objeto verticalmente" - -#: data/ui/glabels-ui.xml.h:56 -#, fuzzy -msgid "Font name" -msgstr "Não salve" - -#: data/ui/glabels-ui.xml.h:57 -#, fuzzy -msgid "Font selector" -msgstr "Copia a seleção" - -#: data/ui/glabels-ui.xml.h:58 -#, fuzzy -msgid "Font size" -msgstr "Não salve" - -#: data/ui/glabels-ui.xml.h:59 -msgid "Icon and _Text" -msgstr "Ícone e _Texto" - -#: data/ui/glabels-ui.xml.h:60 -msgid "Increase magnification" -msgstr "Aumentar aumento" - -#: data/ui/glabels-ui.xml.h:61 -msgid "Italic" -msgstr "" - -#: data/ui/glabels-ui.xml.h:63 -msgid "Left align" -msgstr "" - -#: data/ui/glabels-ui.xml.h:65 -msgid "Line width" -msgstr "" - -#: data/ui/glabels-ui.xml.h:66 -msgid "Lower object to bottom" -msgstr "Abaixa objeto à base" - -#: data/ui/glabels-ui.xml.h:67 -msgid "M_arkup" -msgstr "M_arcação" - -#: data/ui/glabels-ui.xml.h:68 -msgid "Main toolbar" -msgstr "Barra de ferramentas principal" - -#: data/ui/glabels-ui.xml.h:69 -msgid "Markup" -msgstr "Marcação" - -#: data/ui/glabels-ui.xml.h:70 -#, fuzzy -msgid "Modify document properties" -msgstr "Editar propriedades de fusão do documento" - -#: data/ui/glabels-ui.xml.h:71 -msgid "New" -msgstr "Novo" - -#: data/ui/glabels-ui.xml.h:72 -#, fuzzy -msgid "Object property editor" -msgstr "_Propriedades de Objeto" - -#: data/ui/glabels-ui.xml.h:73 -msgid "Only show icons in the drawing toolbar" -msgstr "Exibe somente ícones na barra de ferramentas de desenho" - -#: data/ui/glabels-ui.xml.h:74 -msgid "Only show icons in the main toolbar" -msgstr "Exibe somente ícones na barra de ferramentas principal" - -#: data/ui/glabels-ui.xml.h:76 -msgid "Open a file" -msgstr "Abrir um arquivo" - -#: data/ui/glabels-ui.xml.h:77 -msgid "Open the glabels manual" -msgstr "Abre o manual do glabels" - -#: data/ui/glabels-ui.xml.h:78 -msgid "Paste" -msgstr "Colar" - -#: data/ui/glabels-ui.xml.h:79 -msgid "Paste the clipboard" -msgstr "Cola a área de transferência" - -#: data/ui/glabels-ui.xml.h:80 -msgid "Pr_eferences..." -msgstr "Pr_eferências..." - -#: data/ui/glabels-ui.xml.h:81 -msgid "Preferences" -msgstr "Preferências" - -#: data/ui/glabels-ui.xml.h:83 -msgid "Print the current file" -msgstr "Imprime o arquivo atual" - -#: data/ui/glabels-ui.xml.h:84 -#, fuzzy -msgid "Proper_ties..." -msgstr "Propriedades" - -#: data/ui/glabels-ui.xml.h:85 -msgid "Properties" -msgstr "Propriedades" - -#: data/ui/glabels-ui.xml.h:86 -msgid "Property toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:87 -msgid "Quit" -msgstr "Sair" - -#: data/ui/glabels-ui.xml.h:88 -msgid "Quit the program" -msgstr "Sai do programa" - -#: data/ui/glabels-ui.xml.h:89 -msgid "Raise object to top" -msgstr "Sobe objetos ao topo" - -#: data/ui/glabels-ui.xml.h:90 -msgid "Recent _Files" -msgstr "_Arquivos recentes" - -#: data/ui/glabels-ui.xml.h:91 -msgid "Redo" -msgstr "Refazer" - -#: data/ui/glabels-ui.xml.h:92 -msgid "Redo the undone action" -msgstr "Refaz a ação desfeita" - -#: data/ui/glabels-ui.xml.h:93 -msgid "Remove all selections" -msgstr "Remover todas as seleções" - -#: data/ui/glabels-ui.xml.h:95 -#, no-c-format -msgid "Restore scale to 100%" -msgstr "Restaura escala para 100%" - -#: data/ui/glabels-ui.xml.h:96 -msgid "Right align" -msgstr "" - -#: data/ui/glabels-ui.xml.h:99 -msgid "Rotate object 90 clockwise" -msgstr "Gira objeto 90 sentido horário" - -#: data/ui/glabels-ui.xml.h:100 -msgid "Rotate object 90 counter-clockwise" -msgstr "Gira objeto 90 sentido anti-horário" - -#: data/ui/glabels-ui.xml.h:101 -msgid "Save" -msgstr "Salvar" - -#: data/ui/glabels-ui.xml.h:102 -msgid "Save As" -msgstr "Salvar como" - -#: data/ui/glabels-ui.xml.h:103 -msgid "Save _As..." -msgstr "Salvar _como..." - -#: data/ui/glabels-ui.xml.h:104 -msgid "Save the current file" -msgstr "Salva o arquivo atual" - -#: data/ui/glabels-ui.xml.h:105 -msgid "Save the current file with a different name" -msgstr "Salva o arquivo atual com um nome diferente" - -#: data/ui/glabels-ui.xml.h:106 -msgid "Select All" -msgstr "Selecionar Tudo" - -#: data/ui/glabels-ui.xml.h:107 -msgid "Select _All" -msgstr "Selecionar _Tudo" - -#: data/ui/glabels-ui.xml.h:108 -msgid "Select all objects" -msgstr "Seleciona todos os objetos" - -#: data/ui/glabels-ui.xml.h:109 -msgid "Select, move and modify objects" -msgstr "Seleciona, movimenta e modifica objetos" - -#: data/ui/glabels-ui.xml.h:111 -msgid "Set drawing toolbar button style according to desktop default" -msgstr "" -"Define estilo de botão da barra de ferramentas de desenho de acordo com " -"padrão do desktop" - -#: data/ui/glabels-ui.xml.h:112 -msgid "Set main toolbar button style according to desktop default" -msgstr "" -"Define estilo de botão da barra de ferramentas principal de acordo com " -"padrão do desktop" - -#: data/ui/glabels-ui.xml.h:113 -msgid "Show _Tooltips" -msgstr "Exibir _Dicas" - -#: data/ui/glabels-ui.xml.h:114 -#, fuzzy -msgid "Show both icons and texts in the drawing toolbar" -msgstr "Exibe dicas na barra de ferramentas de desenho" - -#: data/ui/glabels-ui.xml.h:115 -#, fuzzy -msgid "Show both icons and texts in the main toolbar" -msgstr "Exibe dicas na barra de ferramentas principal" - -#: data/ui/glabels-ui.xml.h:116 -msgid "Show tooltips in the drawing toolbar" -msgstr "Exibe dicas na barra de ferramentas de desenho" - -#: data/ui/glabels-ui.xml.h:117 -msgid "Show tooltips in the main toolbar" -msgstr "Exibe dicas na barra de ferramentas principal" - -#: data/ui/glabels-ui.xml.h:118 -#, fuzzy -msgid "Show tooltips in the property toolbar" -msgstr "Exibe dicas na barra de ferramentas principal" - -#: data/ui/glabels-ui.xml.h:119 -msgid "Template Designer" -msgstr "" - -#: data/ui/glabels-ui.xml.h:120 -msgid "Template _Designer..." -msgstr "" - -#: data/ui/glabels-ui.xml.h:121 -msgid "Text color" -msgstr "" - -#: data/ui/glabels-ui.xml.h:122 -msgid "U_n-select All" -msgstr "D_esmarcar Tudo" - -#: data/ui/glabels-ui.xml.h:123 -msgid "Un-select All" -msgstr "Desmarcar Tudo" - -#: data/ui/glabels-ui.xml.h:124 -msgid "Undo" -msgstr "Desfazer" - -#: data/ui/glabels-ui.xml.h:125 -msgid "Undo the last action" -msgstr "Desfaz a última ação" - -#: data/ui/glabels-ui.xml.h:126 -msgid "Zoom _1:1" -msgstr "Zoom _1:1" - -#: data/ui/glabels-ui.xml.h:127 -msgid "Zoom _In" -msgstr "M_ais Zoom" - -#: data/ui/glabels-ui.xml.h:128 -msgid "Zoom _Out" -msgstr "M_enos Zoom" - -#: data/ui/glabels-ui.xml.h:129 -#, fuzzy -msgid "Zoom to _fit" -msgstr "Zoom para 1:1" - -#: data/ui/glabels-ui.xml.h:130 -msgid "Zoom to fit window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:131 -msgid "_About..." -msgstr "_Sobre..." - -#: data/ui/glabels-ui.xml.h:132 -msgid "_Bottoms" -msgstr "_Bases" - -#: data/ui/glabels-ui.xml.h:135 -msgid "_Close" -msgstr "_Fechar" - -#: data/ui/glabels-ui.xml.h:136 -msgid "_Contents" -msgstr "_Conteúdo" - -#: data/ui/glabels-ui.xml.h:137 -msgid "_Copy" -msgstr "_Copiar" - -#: data/ui/glabels-ui.xml.h:138 -msgid "_Create Object" -msgstr "_Criar Objeto" - -#: data/ui/glabels-ui.xml.h:139 -msgid "_Debug" -msgstr "_Depurar" - -#: data/ui/glabels-ui.xml.h:141 -msgid "_Desktop Default" -msgstr "Padrão _Desktop" - -#: data/ui/glabels-ui.xml.h:142 -msgid "_Drawing Toolbar" -msgstr "Barra de _Desenho" - -#: data/ui/glabels-ui.xml.h:143 -msgid "_Edit" -msgstr "_Editar" - -#: data/ui/glabels-ui.xml.h:145 -msgid "_File" -msgstr "_Arquivo" - -#: data/ui/glabels-ui.xml.h:146 -msgid "_Grid" -msgstr "_Grade" - -#: data/ui/glabels-ui.xml.h:147 -msgid "_Help" -msgstr "A_juda" - -#: data/ui/glabels-ui.xml.h:148 -msgid "_Icon" -msgstr "_Ícone" - -#: data/ui/glabels-ui.xml.h:152 -msgid "_Main Toolbar" -msgstr "Barra _Principal" - -#: data/ui/glabels-ui.xml.h:153 -msgid "_Merge Properties..." -msgstr "Propriedades de _Fusão..." - -#: data/ui/glabels-ui.xml.h:154 -msgid "_New" -msgstr "_Novo" - -#: data/ui/glabels-ui.xml.h:155 -msgid "_Objects" -msgstr "_Objetos" - -#: data/ui/glabels-ui.xml.h:156 -msgid "_Open..." -msgstr "_Abrir..." - -#: data/ui/glabels-ui.xml.h:158 -msgid "_Paste" -msgstr "_Colar" - -#: data/ui/glabels-ui.xml.h:159 -msgid "_Print..." -msgstr "Im_primir..." - -#: data/ui/glabels-ui.xml.h:160 -#, fuzzy -msgid "_Property Toolbar" -msgstr "Barra de _Desenho" - -#: data/ui/glabels-ui.xml.h:161 -msgid "_Quit" -msgstr "_Sair" - -#: data/ui/glabels-ui.xml.h:164 -msgid "_Save" -msgstr "_Salvar" - -#: data/ui/glabels-ui.xml.h:168 -msgid "_View" -msgstr "_Visualizar" - -#: data/glade/prefs-dialog.glade.h:1 -msgid " " -msgstr "" - -#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 -#: data/glade/template-designer.glade.h:5 -msgid "*" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:3 -msgid "Default page size" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:4 -msgid "Fill" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:5 -msgid "Line" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:6 -msgid "Text" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:7 -msgid "Units" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 -msgid "Alignment:" -msgstr "Alinhamento:" - -#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 -msgid "Color:" -msgstr "Cor:" - -#: data/glade/prefs-dialog.glade.h:10 -msgid "Font:" -msgstr "Fonte:" - -#: data/glade/prefs-dialog.glade.h:11 -msgid "ISO A4" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:12 -msgid "Inches" -msgstr "Polegadas" - -#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 -msgid "Line Spacing:" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:14 -msgid "Locale" -msgstr "Local" - -#: data/glade/prefs-dialog.glade.h:15 -msgid "Millimeters" -msgstr "Milímetros" - -#: data/glade/prefs-dialog.glade.h:16 -msgid "Object defaults" -msgstr "Padrões do objeto" - -#: data/glade/prefs-dialog.glade.h:17 -msgid "Points" -msgstr "Pontos" - -#: data/glade/prefs-dialog.glade.h:18 -msgid "Select default properties for new objects." -msgstr "Selecione as propriedades padrões para novos objetos." - -#: data/glade/prefs-dialog.glade.h:19 -msgid "Select locale specific behavior." -msgstr "Selecione comportamento específico do local." - -#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:25 -msgid "US Letter" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 -#: data/glade/template-designer.glade.h:72 -msgid "Width:" -msgstr "Largura:" - -#: data/glade/object-editor.glade.h:2 -msgid "00000000000 00000" -msgstr "" - -#: data/glade/object-editor.glade.h:3 -msgid "Xxx object properties" -msgstr "" - -#: data/glade/object-editor.glade.h:5 -msgid "Allow merge to automatically shrink text" -msgstr "" - -#: data/glade/object-editor.glade.h:6 -msgid "Angle:" -msgstr "Ângulo:" - -#: data/glade/object-editor.glade.h:7 -msgid "Checksum" -msgstr "" - -#: data/glade/object-editor.glade.h:10 -#, fuzzy -msgid "Family:" -msgstr "Arquivo:" - -#: data/glade/object-editor.glade.h:12 -msgid "Fill" -msgstr "Preencher" - -#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 -msgid "Height:" -msgstr "Altura:" - -#: data/glade/object-editor.glade.h:14 -msgid "Image" -msgstr "Imagem" - -#: data/glade/object-editor.glade.h:15 -msgid "Insert merge field" -msgstr "Inserir campo de fusão" - -#: data/glade/object-editor.glade.h:17 -msgid "Length:" -msgstr "Comprimento:" - -#: data/glade/object-editor.glade.h:18 -msgid "Line" -msgstr "Linha" - -#: data/glade/object-editor.glade.h:20 -msgid "Literal:" -msgstr "Literal:" - -#: data/glade/object-editor.glade.h:21 -msgid "Load image" -msgstr "" - -#: data/glade/object-editor.glade.h:22 -msgid "Position" -msgstr "Posição" - -#: data/glade/object-editor.glade.h:23 -msgid "Reset image size" -msgstr "Redefinir tamanho da imagem" - -#: data/glade/object-editor.glade.h:24 -msgid "Size" -msgstr "Tamanho" - -#: data/glade/object-editor.glade.h:25 -#, fuzzy -msgid "Size:" -msgstr "Tamanho" - -#: data/glade/object-editor.glade.h:26 -#, fuzzy -msgid "Style" -msgstr "Estilo:" - -#: data/glade/object-editor.glade.h:27 -msgid "Style:" -msgstr "Estilo:" - -#: data/glade/object-editor.glade.h:30 -msgid "X:" -msgstr "X:" - -#: data/glade/object-editor.glade.h:31 -msgid "Y:" -msgstr "Y:" - -#: data/glade/object-editor.glade.h:32 -msgid "degrees" -msgstr "graus" - -#: data/glade/object-editor.glade.h:33 -msgid "dialog1" -msgstr "" - -#: data/glade/object-editor.glade.h:34 -msgid "digits:" -msgstr "" - -#: data/glade/object-editor.glade.h:35 -#, fuzzy -msgid "format:" -msgstr "Formato:" - -#: data/glade/template-designer.glade.h:1 -msgid " " -msgstr "" - -#: data/glade/template-designer.glade.h:2 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "" - -#: data/glade/template-designer.glade.h:3 -msgid "(e.g., 8163A)" -msgstr "" - -#: data/glade/template-designer.glade.h:4 -msgid "(e.g., Avery, Acme, ...)" -msgstr "" - -#: data/glade/template-designer.glade.h:6 -msgid "1. Outer radius:" -msgstr "" - -#: data/glade/template-designer.glade.h:7 -msgid "1. Radius:" -msgstr "" - -#: data/glade/template-designer.glade.h:8 -#, fuzzy -msgid "1. Width:" -msgstr "Largura:" - -#: data/glade/template-designer.glade.h:9 -#, fuzzy -msgid "2. Height:" -msgstr "Altura:" - -#: data/glade/template-designer.glade.h:10 -msgid "2. Inner radius:" -msgstr "" - -#: data/glade/template-designer.glade.h:11 -msgid "2. Waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:12 -msgid "3. Clipping width:" -msgstr "" - -#: data/glade/template-designer.glade.h:13 -msgid "3. Margin" -msgstr "" - -#: data/glade/template-designer.glade.h:14 -msgid "3. Round (radius of corner):" -msgstr "" - -#: data/glade/template-designer.glade.h:15 -msgid "4. Clipping height:" -msgstr "" - -#: data/glade/template-designer.glade.h:16 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:17 -msgid "5. Vert. waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:18 -msgid "5. Waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:19 -msgid "6. Margin" -msgstr "" - -#: data/glade/template-designer.glade.h:20 -msgid "Brand/Manufacturer:" -msgstr "" - -#: data/glade/template-designer.glade.h:21 -msgid "CD/DVD (including credit card CDs)" -msgstr "" - -#: data/glade/template-designer.glade.h:22 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "" - -#: data/glade/template-designer.glade.h:30 -msgid "Design Completed" -msgstr "" - -#: data/glade/template-designer.glade.h:31 -msgid "Distance from left edge (x0):" -msgstr "" - -#: data/glade/template-designer.glade.h:32 -msgid "Distance from top edge (y0):" -msgstr "" - -#: data/glade/template-designer.glade.h:34 -msgid "Horizontal pitch (dx):" -msgstr "" - -#: data/glade/template-designer.glade.h:35 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" - -#: data/glade/template-designer.glade.h:40 -msgid "Label Size (CD/DVD)" -msgstr "" - -#: data/glade/template-designer.glade.h:41 -#, fuzzy -msgid "Label Size (Round)" -msgstr "Tamanho da etiqueta:" - -#: data/glade/template-designer.glade.h:42 -#, fuzzy -msgid "Label or Card Shape" -msgstr "Nova Etiqueta ou Cartão" - -#: data/glade/template-designer.glade.h:43 -msgid "Label or Card Size (Rectangular)" -msgstr "" - -#: data/glade/template-designer.glade.h:44 -#, fuzzy -msgid "Layout #1" -msgstr "Disposição:" - -#: data/glade/template-designer.glade.h:45 -#, fuzzy -msgid "Layout #2" -msgstr "Disposição:" - -#: data/glade/template-designer.glade.h:46 -#, fuzzy -msgid "Layout(s)" -msgstr "Disposição:" - -#: data/glade/template-designer.glade.h:47 -#, fuzzy -msgid "Name and Description" -msgstr "Descrição:" - -#: data/glade/template-designer.glade.h:48 -msgid "Number across (nx):" -msgstr "" - -#: data/glade/template-designer.glade.h:49 -msgid "Number down (ny):" -msgstr "" - -#: data/glade/template-designer.glade.h:50 -msgid "Number of Layouts" -msgstr "" - -#: data/glade/template-designer.glade.h:51 -msgid "Number of layouts:" -msgstr "" - -#: data/glade/template-designer.glade.h:52 -#, fuzzy -msgid "Page Size" -msgstr "Tamanho da página:" - -#: data/glade/template-designer.glade.h:54 -msgid "Part #:" -msgstr "" - -#: data/glade/template-designer.glade.h:55 -msgid "" -"Please enter the following identifying information about the template " -"stationery." -msgstr "" - -#: data/glade/template-designer.glade.h:56 -msgid "Please enter the following layout information." -msgstr "" - -#: data/glade/template-designer.glade.h:57 -msgid "" -"Please enter the following size parameters of a single label in your " -"template." -msgstr "" - -#: data/glade/template-designer.glade.h:58 -msgid "" -"Please enter the following size parameters of a single label or card in your " -"template." -msgstr "" - -#: data/glade/template-designer.glade.h:59 -msgid "Please select the basic shape of the labels or cards." -msgstr "" - -#: data/glade/template-designer.glade.h:60 -msgid "Please select the page size of the template stationery." -msgstr "" - -#: data/glade/template-designer.glade.h:61 -#, fuzzy -msgid "Print test sheet" -msgstr "na primeira folha" - -#: data/glade/template-designer.glade.h:62 -msgid "Rectangular or square (can have rounded corners)" -msgstr "" - -#: data/glade/template-designer.glade.h:63 -msgid "Round" -msgstr "" - -#: data/glade/template-designer.glade.h:64 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" - -#: data/glade/template-designer.glade.h:66 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" - -#: data/glade/template-designer.glade.h:68 -msgid "Vertical pitch (dy):" -msgstr "" - -#: data/glade/template-designer.glade.h:69 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" - -#: data/templates/paper-sizes.xml.h:1 -msgid "A0" -msgstr "" - -#: data/templates/paper-sizes.xml.h:2 -msgid "A1" -msgstr "" - -#: data/templates/paper-sizes.xml.h:3 -msgid "A10" -msgstr "" - -#: data/templates/paper-sizes.xml.h:4 -msgid "A2" -msgstr "" - -#: data/templates/paper-sizes.xml.h:5 -msgid "A3" -msgstr "" - -#: data/templates/paper-sizes.xml.h:6 -msgid "A4" -msgstr "" - -#: data/templates/paper-sizes.xml.h:7 -msgid "A5" -msgstr "" - -#: data/templates/paper-sizes.xml.h:8 -msgid "A6" -msgstr "" - -#: data/templates/paper-sizes.xml.h:9 -msgid "A7" -msgstr "" - -#: data/templates/paper-sizes.xml.h:10 -msgid "A8" -msgstr "" - -#: data/templates/paper-sizes.xml.h:11 -msgid "A9" -msgstr "" - -#: data/templates/paper-sizes.xml.h:12 -msgid "B0" -msgstr "" - -#: data/templates/paper-sizes.xml.h:13 -msgid "B1" -msgstr "" - -#: data/templates/paper-sizes.xml.h:14 -msgid "B10" -msgstr "" - -#: data/templates/paper-sizes.xml.h:15 -msgid "B2" -msgstr "" - -#: data/templates/paper-sizes.xml.h:16 -msgid "B3" -msgstr "" - -#: data/templates/paper-sizes.xml.h:17 -msgid "B4" -msgstr "" - -#: data/templates/paper-sizes.xml.h:18 -msgid "B5" -msgstr "" - -#: data/templates/paper-sizes.xml.h:19 -msgid "B6" -msgstr "" - -#: data/templates/paper-sizes.xml.h:20 -msgid "B7" -msgstr "" - -#: data/templates/paper-sizes.xml.h:21 -msgid "B8" -msgstr "" - -#: data/templates/paper-sizes.xml.h:22 -msgid "B9" -msgstr "" - -#: data/templates/paper-sizes.xml.h:23 -msgid "US Executive" -msgstr "" - -#: data/templates/paper-sizes.xml.h:24 -msgid "US Legal" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:1 -#: data/templates/zweckform-iso-templates.xml.h:1 -msgid "Address Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:2 -#: data/templates/avery-iso-templates.xml.h:2 -#: data/templates/zweckform-iso-templates.xml.h:3 -#: data/templates/misc-us-templates.xml.h:2 -#: data/templates/misc-iso-templates.xml.h:9 -msgid "Business Cards" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:3 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:4 -msgid "Diskette Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:5 -#, fuzzy -msgid "Filing Labels" -msgstr "Etiquetas" - -#: data/templates/avery-us-templates.xml.h:6 -msgid "Full Sheet Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:7 -#, fuzzy -msgid "Large Round Labels" -msgstr "Iniciar na etiqueta" - -#: data/templates/avery-us-templates.xml.h:8 -msgid "Name Badge Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:9 -msgid "Return Address Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:10 -msgid "Shipping Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:11 -#, fuzzy -msgid "Small Round Labels" -msgstr "Iniciar na etiqueta" - -#: data/templates/avery-us-templates.xml.h:12 -#, fuzzy -msgid "Square Labels" -msgstr "Etiquetas" - -#: data/templates/avery-us-templates.xml.h:13 -msgid "Video Tape Face Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:14 -msgid "Video Tape Spine Labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:1 -msgid "Address labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:3 -msgid "CD Booklet" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:4 -msgid "CD Inlet" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:5 -#: data/templates/zweckform-iso-templates.xml.h:4 -#: data/templates/misc-us-templates.xml.h:4 -#: data/templates/misc-iso-templates.xml.h:10 -#, fuzzy -msgid "CD/DVD Labels" -msgstr "Etiquetas" - -#: data/templates/avery-iso-templates.xml.h:6 -#, fuzzy -msgid "Diskette labels" -msgstr "Sobre glabels" - -#: data/templates/avery-iso-templates.xml.h:7 -#: data/templates/zweckform-iso-templates.xml.h:7 -#: data/templates/misc-iso-templates.xml.h:17 -msgid "Mailing Labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:8 -#, fuzzy -msgid "Mailing labels" -msgstr "glabels" - -#: data/templates/avery-iso-templates.xml.h:9 -msgid "Mini Address Labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:10 -#, fuzzy -msgid "Shipping labels" -msgstr "Abrir etiqueta" - -#: data/templates/zweckform-iso-templates.xml.h:2 -#, fuzzy -msgid "Allround Labels" -msgstr "Sobre glabels" - -#: data/templates/zweckform-iso-templates.xml.h:5 -msgid "Correction and Cover-up Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:6 -msgid "Lever Arch File Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:8 -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:9 -msgid "Rectangular Copier Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:10 -#: data/templates/misc-iso-templates.xml.h:22 -msgid "Rectangular Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:11 -msgid "Video Labels (back)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:1 -msgid "Business Card CD" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:3 -msgid "CD Template Rectangles" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:5 -msgid "CD/DVD Labels (Face Only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:6 -#: data/templates/misc-iso-templates.xml.h:11 -msgid "CD/DVD Labels (face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:7 -#, fuzzy -msgid "DLT Labels" -msgstr "Etiquetas" - -#: data/templates/misc-us-templates.xml.h:8 -#, fuzzy -msgid "Microtube labels" -msgstr "Sobre glabels" - -#: data/templates/misc-us-templates.xml.h:9 -msgid "Mini-CD Labels" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:10 -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:11 -msgid "PRO CD Labels 2-up (Face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:12 -#: data/templates/misc-iso-templates.xml.h:21 -msgid "PRO CD Labels 2-up (face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:13 -msgid "Slimline CD Case (rightside up)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:14 -msgid "Slimline CD Case (upside down)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:1 -msgid "Agipa 119488: Business Cards" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:2 -msgid "Allround Labels --24" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:3 -msgid "Allround Labels --44" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:4 -msgid "Allround Labels --64" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:5 -msgid "Allround Labels --65" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:6 -msgid "Arch File Labels" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:7 -msgid "Arch File Labels (large)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:8 -msgid "Arch File Labels (small)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:12 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:13 -msgid "Diskette Labels (face only)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:14 -msgid "EPSON Photo Stickers 16" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:15 -msgid "Etiketten" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:16 -msgid "Fridge Magnet Stickers" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:18 -msgid "Mailing Labels --14" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:19 -msgid "Mailing Labels-2 columns" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:20 -msgid "Mailing Labels-3 columns" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:23 -msgid "Video Labels (face only)" -msgstr "" - -#: data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers." -msgstr "" - -#: data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "" - -#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 -#, fuzzy -msgid "gLabels Project File" -msgstr "_Propriedades de Objeto" - -#~ msgid "Object _Properties..." -#~ msgstr "_Propriedades do Objeto..." - -#~ msgid "Display units" -#~ msgstr "Exibir unidades" - -#~ msgid "Default page size" -#~ msgstr "Tamanho de página padrão" - -#~ msgid "Outline" -#~ msgstr "Contorno" - -#~ msgid "Edit line object properties" -#~ msgstr "Editar propriedades do objeto linha" - -#~ msgid "Edit text object properties" -#~ msgstr "Editar propriedades do objeto texto" - -#~ msgid "Edit text:" -#~ msgstr "Editar texto:" - -#~ msgid "Maintain current aspect ratio" -#~ msgstr "Manter taxa de aspecto atual" - -#, fuzzy -#~ msgid "CD Labels" -#~ msgstr "Etiquetas" - -#~ msgid "Open %s" -#~ msgstr "Abrir %s" - -#~ msgid "Scale:" -#~ msgstr "Escala:" - -#~ msgid "%" -#~ msgstr "%" - -#~ msgid "Show text with barcode" -#~ msgstr "Exibir texto com código de barras" - -#~ msgid "Edit properties..." -#~ msgstr "Editar propriedades..." - -#~ msgid "Fields" -#~ msgstr "Campos" - -#~ msgid "Column" -#~ msgstr "Coluna" - -#~ msgid "Custom field key" -#~ msgstr "Chave do campo específico" - -#~ msgid "Sample data" -#~ msgstr "Dado de amostra" - -#~ msgid "Revert to saved copy of %s?" -#~ msgstr "Reverter para a cópia gravada de %s?" - -#~ msgid "Unknown media type. Using default." -#~ msgstr "Tipo de mídia desconhecido. Usando padrão." - -#~ msgid "" -#~ "``%s'' has been modified.\n" -#~ "\n" -#~ "Do you wish to save it?" -#~ msgstr "" -#~ "``%s'' foi modificado.\n" -#~ "\n" -#~ "Deseja salvá-lo?" - -#~ msgid "Close / Save label as" -#~ msgstr "Fechar / Salvar etiqueta como" - -#~ msgid "Label no longer valid!" -#~ msgstr "Etiqueta não é mais válida" - -#~ msgid "Error writing file" -#~ msgstr "Erro gravando o arquivo" - -#~ msgid "Appearance" -#~ msgstr "Aparência" - -#~ msgid "Position/Size" -#~ msgstr "Posição/Tamanho" - -#~ msgid "Image format not currently supported" -#~ msgstr "Formato de imagem não suportado atualmente" - -#~ msgid "Barcode data" -#~ msgstr "Dado do Código de Barras:" - -#~ msgid "General" -#~ msgstr "Geral" - -#~ msgid "Make a new, empty label" -#~ msgstr "Criar uma etiqueta nova, vazia" - -#~ msgid " New " -#~ msgstr " Novo " - -#~ msgid "New Label/Card" -#~ msgstr "Nova Etiqueta/Cartão" - -#~ msgid " Open " -#~ msgstr " Abrir " - -#~ msgid " Save " -#~ msgstr " Salvar " - -#~ msgid " Print " -#~ msgstr " Imprimir " - -#~ msgid "Function is not implemented!" -#~ msgstr "Função não está implementada!" - -#~ msgid "Function is not yet implemented!" -#~ msgstr "Função ainda não implementada!" diff --git a/glabels2/po/ru.po b/glabels2/po/ru.po deleted file mode 100644 index 40067b12..00000000 --- a/glabels2/po/ru.po +++ /dev/null @@ -1,2459 +0,0 @@ -# Russian translation of glabels. -# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -# Vitaly Lipatov , 2002, 2003, 2004, 2005. -# -msgid "" -msgstr "" -"Project-Id-Version: glabels 2.1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-01-22 14:03-0500\n" -"PO-Revision-Date: 2005-04-10 02:18MSK\n" -"Last-Translator: Vitaly Lipatov \n" -"Language-Team: Russian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.10\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" - -#: src/glabels.c:116 -msgid "Could not initialize Bonobo!\n" -msgstr "Невозможно инициализировать Bonobo!\n" - -#: src/glabels-batch.c:52 -msgid "print this message" -msgstr "напечатать это сообщение" - -#: src/glabels-batch.c:54 -msgid "print the version of glabels-batch being used" -msgstr "выводит версию используемого glabels-batch" - -#: src/glabels-batch.c:56 -msgid "set output filename (default=\"output.ps\")" -msgstr "установить название выходного файла (по умолчанию - \"output.ps\"" - -#: src/glabels-batch.c:56 src/glabels-batch.c:70 -msgid "filename" -msgstr "название" - -#: src/glabels-batch.c:58 -msgid "number of sheets (default=1)" -msgstr "количество страниц (по умолчанию - 1)" - -#: src/glabels-batch.c:58 -msgid "sheets" -msgstr "страниц" - -#: src/glabels-batch.c:60 -msgid "number of copies (default=1)" -msgstr "количество копий (по умолчанию - 1)" - -#: src/glabels-batch.c:60 -msgid "copies" -msgstr "копий" - -#: src/glabels-batch.c:62 -msgid "first label on first sheet (default=1)" -msgstr "первая этикетка на первой странице (по умолчанию - 1)" - -#: src/glabels-batch.c:62 -msgid "first" -msgstr "первое" - -#: src/glabels-batch.c:64 src/print-dialog.c:336 -msgid "print outlines (to test printer alignment)" -msgstr "печатать контуры этикеток" - -#: src/glabels-batch.c:66 src/print-dialog.c:344 -msgid "print in reverse (i.e. a mirror image)" -msgstr "печатать перевёрнуто (как отражается в зеркале)" - -#: src/glabels-batch.c:68 src/print-dialog.c:351 -msgid "print crop marks" -msgstr "печатать метки для обрезки" - -#: src/glabels-batch.c:70 -msgid "input file for merging" -msgstr "входной файл для объединения" - -#: src/glabels-batch.c:107 -msgid "[OPTION...] GLABELS_FILE..." -msgstr "[ПАРАМЕТРЫ...] файл_glabels..." - -#: src/glabels-batch.c:127 -#, c-format -msgid "missing glabels file\n" -msgstr "не указан файл glabels\n" - -#: src/glabels-batch.c:158 -msgid "cannot perform document merge with glabels file %s\n" -msgstr "невозможно выполнить объединение документа с файлом glabels %s\n" - -#: src/glabels-batch.c:182 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "невозможно открыть файл %s\n" - -#: src/window.c:244 -msgid "(none) - gLabels" -msgstr "(ничего) - gLabels" - -#: src/window.c:414 -msgid "(modified)" -msgstr "(изменено)" - -#: src/stock.c:65 data/ui/glabels-ui.xml.h:162 -msgid "_Select Mode" -msgstr "_Режим выбора" - -#: src/stock.c:66 data/ui/glabels-ui.xml.h:163 -msgid "_Text" -msgstr "_Текст" - -#: src/stock.c:67 data/ui/glabels-ui.xml.h:148 -msgid "_Line" -msgstr "_Линия" - -#: src/stock.c:68 data/ui/glabels-ui.xml.h:130 -msgid "_Box" -msgstr "_Прямоугольник" - -#: src/stock.c:69 data/ui/glabels-ui.xml.h:141 -msgid "_Ellipse" -msgstr "_Эллипс" - -#: src/stock.c:70 data/ui/glabels-ui.xml.h:146 -msgid "_Image" -msgstr "_Изображение" - -#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 -msgid "Bar_code" -msgstr "_Штрих-код" - -#: src/stock.c:72 -msgid "_Merge Properties" -msgstr "Свойства _объединения" - -#: src/stock.c:73 -msgid "Object _Properties" -msgstr "_Свойства объекта" - -#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 -msgid "Bring to _Front" -msgstr "На _передний план" - -#: src/stock.c:75 data/ui/glabels-ui.xml.h:109 -msgid "Send to _Back" -msgstr "На _задний план" - -#: src/stock.c:76 data/ui/glabels-ui.xml.h:96 -msgid "Rotate _Left" -msgstr "Повернуть на_лево" - -#: src/stock.c:77 data/ui/glabels-ui.xml.h:97 -msgid "Rotate _Right" -msgstr "Повернуть на_право" - -#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 -msgid "Flip _Horizontally" -msgstr "Отразить _горизонтально" - -#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 -msgid "Flip _Vertically" -msgstr "Отразить _вертикально" - -#: src/stock.c:80 data/ui/glabels-ui.xml.h:147 -msgid "_Lefts" -msgstr "С_лева" - -#: src/stock.c:81 data/ui/glabels-ui.xml.h:159 -msgid "_Rights" -msgstr "С_права" - -#: src/stock.c:82 data/ui/glabels-ui.xml.h:131 -msgid "_Centers" -msgstr "По _центру" - -#: src/stock.c:83 data/ui/glabels-ui.xml.h:164 -msgid "_Tops" -msgstr "По _верху" - -#: src/stock.c:84 -msgid "Bottoms" -msgstr "По низу" - -#: src/stock.c:85 -msgid "Centers" -msgstr "По центру" - -#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 -msgid "Label Ce_nter" -msgstr "_Центр этикетки" - -#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 -msgid "Fill color" -msgstr "Цвет заливки" - -#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 -msgid "Line color" -msgstr "Цвет линии" - -#: src/stock.c:90 src/stock.c:92 -msgid "Linked" -msgstr "Прикреплено" - -#: src/stock.c:91 src/stock.c:93 -msgid "Not Linked" -msgstr "Не прикреплено" - -#: src/ui-property-bar.c:345 src/object-editor.c:587 -msgid "Default" -msgstr "По умолчанию" - -#: src/ui-property-bar.c:360 src/object-editor.c:600 -msgid "No fill" -msgstr "Не заполнять" - -#: src/ui-property-bar.c:375 src/object-editor.c:593 -msgid "No line" -msgstr "Нет линии" - -#: src/ui-sidebar.c:180 -msgid "Object properties" -msgstr "Свойства объекта" - -#: src/commands.c:385 -msgid "" -"A label and business card creation program for GNOME.\n" -" \n" -"Glabels is free software; you can redistribute it and/or modify it under the " -"terms of the GNU General Public License as published by the Free Software " -"Foundation; either version 2 of the License, or (at your option) any later " -"version.\n" -" \n" -"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.\n" -msgstr "" -"Программа создания этикеток и визиток для GNOME\n" -" \n" -"Glabels является свободным программным обеспечением; вы вправе " -"распространять её и/или модифицировать в соответствии с условиями версии 2 " -"либо по вашему выбору более поздней версии Стандартной Общественной Лицензии " -"GNU, опубликованной Free Software Foundation.\n" -" \n" -"Мы распространяем данную программу в надежде на то, что она будет вам " -"полезной, однако НЕ ПРЕДОСТАВЛЯЕМ НА НЕЁ НИКАКИХ ГАРАНТИЙ, в том числе " -"ГАРАНТИИ ТОВАРНОГО СОСТОЯНИЯ ПРИ ПРОДАЖЕ и ПРИГОДНОСТИ ДЛЯ ИСПОЛЬЗОВАНИЯ В " -"КОНКРЕТНЫХ ЦЕЛЯХ. Для получения более подробной информации ознакомьтесь со " -"Стандартной Общественной Лицензией GNU.\n" - -#: src/commands.c:399 -msgid "See the file AUTHORS for additional credits," -msgstr "Смотрите в файл AUTHORS для дополнительной информации," - -#: src/commands.c:400 -msgid "or visit http://glabels.sourceforge.net/" -msgstr "или посетите сайт http://glabels.sourceforge.net/" - -#: src/commands.c:409 -msgid " " -msgstr "" - -#: src/commands.c:424 -msgid "glabels" -msgstr "glabels" - -#: src/file.c:100 -msgid "New Label or Card" -msgstr "Новая этикетка или визитка" - -#: src/file.c:132 src/file.c:304 -msgid "Media Type" -msgstr "Размер бумаги" - -#: src/file.c:138 src/file.c:310 -msgid "Label orientation" -msgstr "Расположение этикетки" - -#: src/file.c:269 -msgid "Label properties" -msgstr "Свойства этикетки" - -#: src/file.c:452 src/file.c:870 -msgid "All files" -msgstr "Все файлы" - -#: src/file.c:457 src/file.c:875 -msgid "gLabels documents" -msgstr "Документы gLabels" - -#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 -msgid "Empty file name selection" -msgstr "Пустой выбор файла" - -#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 -msgid "Please select a file or supply a valid file name" -msgstr "Выберите файл или введите корректное название файла" - -#: src/file.c:519 src/file.c:631 -msgid "File does not exist" -msgstr "Файл не существует" - -#: src/file.c:563 data/ui/glabels-ui.xml.h:74 -msgid "Open" -msgstr "Открыть" - -#: src/file.c:565 -msgid "Open label" -msgstr "Открыть этикетку" - -#: src/file.c:707 -#, c-format -msgid "Could not open file \"%s\"" -msgstr "Невозможно открыть файл \"%s\"" - -#: src/file.c:715 -msgid "Not a supported file format" -msgstr "Файл неподдерживаемого формата" - -#: src/file.c:797 src/file.c:979 src/file.c:1174 -#, c-format -msgid "Could not save file \"%s\"" -msgstr "Невозможно сохранить файл \"%s\"" - -#: src/file.c:805 src/file.c:987 src/file.c:1182 -msgid "Error encountered during save. The file is still not saved." -msgstr "Произошла ошибка при сохранении файла. Файл всё ещё не сохранён." - -#: src/file.c:848 src/file.c:1048 -#, c-format -msgid "Save \"%s\" as" -msgstr "Сохранить \"%s\" как" - -#: src/file.c:935 src/file.c:1131 -msgid "Please supply a valid file name" -msgstr "Укажите корректное название файла" - -#: src/file.c:952 src/file.c:1147 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "Перезаписать файл \"%s\"?" - -#: src/file.c:960 src/file.c:1155 -msgid "File already exists." -msgstr "Файл уже существует." - -#: src/file.c:1271 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "Сохранить изменения в документе \"%s\" перед закрытием?" - -#: src/file.c:1279 -msgid "Your changes will be lost if you don't save them." -msgstr "Все изменения будут потеряны, если вы их не сохраните." - -#: src/file.c:1282 -msgid "Close without saving" -msgstr "Закрыть без сохранения" - -#. Should not happen -#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 -#: data/glade/object-editor.glade.h:37 -msgid "points" -msgstr "точек" - -#: src/prefs.c:158 data/glade/object-editor.glade.h:36 -#: data/glade/template-designer.glade.h:74 -msgid "inches" -msgstr "дюймов" - -#: src/prefs.c:160 -msgid "mm" -msgstr "мм" - -#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 -msgid "gLabels Preferences" -msgstr "Параметры gLabels" - -#. -#. * Submenu: Order -#. -#: src/view.c:3574 data/ui/glabels-ui.xml.h:154 -msgid "_Order" -msgstr "_Порядок" - -#. -#. * Submenu: Rotate/Flip -#. -#: src/view.c:3595 data/ui/glabels-ui.xml.h:160 -msgid "_Rotate/Flip" -msgstr "_Повернуть/Отразить" - -#. -#. * Submenu: Align Horizontally -#. -#: src/view.c:3628 -msgid "Align _Horizontally" -msgstr "Выровнять _горизонтально" - -#. -#. * Submenu: Align Vertically -#. -#: src/view.c:3667 -msgid "Align _Vertically" -msgstr "Выровнять _вертикально" - -#: src/view.c:3728 data/ui/glabels-ui.xml.h:137 -msgid "_Delete" -msgstr "У_далить" - -#. Build editor. -#: src/view-box.c:236 -msgid "Box object properties" -msgstr "Свойства прямоугольника" - -#. Build editor. -#: src/view-ellipse.c:236 -msgid "Ellipse object properties" -msgstr "Свойства эллипса" - -#. Build editor. -#: src/view-line.c:229 -msgid "Line object properties" -msgstr "Свойство линии" - -#. Build editor. -#: src/view-image.c:223 -msgid "Image object properties" -msgstr "Свойства изображения" - -#. Build editor. -#: src/view-text.c:251 -msgid "Text object properties" -msgstr "Свойства текста" - -#: src/view-text.c:571 data/glade/object-editor.glade.h:28 -msgid "Text" -msgstr "Текст" - -#. Build editor. -#: src/view-barcode.c:210 -msgid "Barcode object properties" -msgstr "Свойства объекта типа штрих-код" - -#: src/view-barcode.c:594 src/print.c:1125 -msgid "Invalid barcode data" -msgstr "Неверные данные штрих-кода" - -#: src/merge-properties-dialog.c:231 -msgid "Merge Properties" -msgstr "Свойства объединения" - -#. ---- Source section ---- -#: src/merge-properties-dialog.c:237 -msgid "Source" -msgstr "Источник" - -#: src/merge-properties-dialog.c:245 -msgid "Format:" -msgstr "Формат:" - -#. Location line -#: src/merge-properties-dialog.c:273 -msgid "Location:" -msgstr "Расположение:" - -#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 -msgid "Select merge-database source" -msgstr "Выбрать источник данных для объединения" - -#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 -msgid "N/A" -msgstr "Недоступно" - -#. ---- Sample Fields section ---- -#: src/merge-properties-dialog.c:300 -msgid "Record selection/preview:" -msgstr "Просмотр и выбор записей:" - -#: src/merge-properties-dialog.c:326 -msgid "Select" -msgstr "Выбран" - -#: src/merge-properties-dialog.c:334 -msgid "Record/Field" -msgstr "Запись/Поле" - -#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 -msgid "Data" -msgstr "Данные" - -#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:81 -msgid "Print" -msgstr "Напечатать" - -#: src/print-dialog.c:281 -msgid "_Job" -msgstr "_Задание" - -#: src/print-dialog.c:286 -msgid "P_rinter" -msgstr "П_ринтер" - -#. ----------- Add simple-copies widget ------------ -#: src/print-dialog.c:314 -msgid "Copies" -msgstr "Копий" - -#. ------- Add merge control widget ------------ -#: src/print-dialog.c:322 -msgid "Document merge control" -msgstr "Управление объединением" - -#. ----------- Add custom print options area ------------ -#: src/print-dialog.c:330 -msgid "Options" -msgstr "Параметры" - -#: src/print-dialog.c:553 src/print-dialog.c:592 -msgid "Print preview" -msgstr "Просмотреть" - -#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 -msgid "gLabels Template Designer" -msgstr "Дизайнер шаблонов gLabels" - -#: src/bc.c:60 -msgid "POSTNET (any)" -msgstr "POSTNET (любой)" - -#: src/bc.c:63 -msgid "POSTNET-5 (ZIP only)" -msgstr "POSTNET-5 (только почтовый индекс)" - -#: src/bc.c:66 -msgid "POSTNET-9 (ZIP+4)" -msgstr "POSTNET-9 (ZIP+4)" - -#: src/bc.c:69 -msgid "POSTNET-11 (DPBC)" -msgstr "POSTNET-11 (DPBC)" - -#: src/bc.c:72 -msgid "EAN (any)" -msgstr "EAN (любой)" - -#: src/bc.c:75 -msgid "EAN-8" -msgstr "EAN-8" - -#: src/bc.c:78 -msgid "EAN-8 +2" -msgstr "EAN-8 +2" - -#: src/bc.c:81 -msgid "EAN-8 +5" -msgstr "EAN-8 +5" - -#: src/bc.c:84 -msgid "EAN-13" -msgstr "EAN-13" - -#: src/bc.c:87 -msgid "EAN-13 +2" -msgstr "EAN-13 +2" - -#: src/bc.c:90 -msgid "EAN-13 +5" -msgstr "EAN-13 +5" - -#: src/bc.c:93 -msgid "UPC (UPC-A or UPC-E)" -msgstr "UPC (UPC-A or UPC-E)" - -#: src/bc.c:96 -msgid "UPC-A" -msgstr "UPC-A" - -#: src/bc.c:99 -msgid "UPC-A +2" -msgstr "UPC-A +2" - -#: src/bc.c:102 -msgid "UPC-A +5" -msgstr "UPC-A +5" - -#: src/bc.c:105 -msgid "UPC-E" -msgstr "UPC-E" - -#: src/bc.c:108 -msgid "UPC-E +2" -msgstr "UPC-E +2" - -#: src/bc.c:111 -msgid "UPC-E +5" -msgstr "UPC-E +5" - -#: src/bc.c:114 -msgid "ISBN" -msgstr "ISBN" - -#: src/bc.c:117 -msgid "ISBN +5" -msgstr "ISBN +5" - -#: src/bc.c:120 -msgid "Code 39" -msgstr "Code 39" - -#: src/bc.c:123 -msgid "Code 128" -msgstr "Code 128" - -#: src/bc.c:126 -msgid "Code 128C" -msgstr "Code 128C" - -#: src/bc.c:129 -msgid "Code 128B" -msgstr "Code 128B" - -#: src/bc.c:132 -msgid "Interleaved 2 of 5" -msgstr "Interleaved 2 of 5" - -#: src/bc.c:135 -msgid "Codabar" -msgstr "" - -#: src/bc.c:138 -msgid "MSI" -msgstr "MSI" - -#: src/bc.c:141 -msgid "Plessey" -msgstr "" - -#: src/label.c:569 -msgid "Untitled" -msgstr "Без названия" - -#: src/xml-label.c:176 src/xml-label.c:213 -msgid "xmlParseFile error" -msgstr "Ошибка при разборе файла XML" - -#: src/xml-label.c:250 -msgid "No document root" -msgstr "Нет корня документа" - -#: src/xml-label.c:264 -msgid "Importing from glabels 0.1 format" -msgstr "Импортируем из файла glabels версии 0.1" - -#: src/xml-label.c:272 -msgid "Importing from glabels 0.4 format" -msgstr "Импортируем из файла glabels версии 0.4" - -#: src/xml-label.c:279 -msgid "Importing from glabels 1.91 format" -msgstr "Импортируем из формата glabels версии 1.91" - -#: src/xml-label.c:282 -msgid "bad document, unknown glabels Namespace" -msgstr "документ неверного типа, неизвестное пространство имён glabels" - -#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "Неверный корневой узел = \"%s\"" - -#: src/xml-label.c:348 src/xml-label-191.c:165 -#, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "Неверный узел в узле документа= \"%s\"" - -#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 -#, c-format -msgid "bad node = \"%s\"" -msgstr "неверный узел = \"%s\"" - -#: src/xml-label.c:855 src/xml-label-191.c:624 -#, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "неверный узел в узле данных= \"%s\"" - -#: src/xml-label.c:1030 libglabels/xml-template.c:535 -msgid "Utf8 conversion error." -msgstr "Ошибка преобразования UTF8." - -#: src/xml-label.c:1037 libglabels/xml-template.c:542 -msgid "Problem saving xml file." -msgstr "Проблемы при сохранении файла XML" - -#. This should always be an id, but just in case a name -#. slips by! -#: src/xml-label-191.c:699 libglabels/xml-template.c:199 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "Неизвестный идентификатор размера страницы \"%s\", пробуем как название" - -#: src/xml-label-191.c:709 libglabels/xml-template.c:209 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "Неизвестный идентификатор размера страницы или название \"%s\"" - -#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 -msgid "None" -msgstr "Ничего" - -#: src/merge-init.c:53 -msgid "Text file with comma delimeters (CSV)" -msgstr "Текст с разделителем \"запятая\" (CSV)" - -#: src/merge-init.c:60 -msgid "Text file with colon delimeters" -msgstr "Текст с разделителем \"двоеточие\"" - -#: src/merge-init.c:67 -msgid "Text file with tab delimeters" -msgstr "Текст с разделителем \"символ табуляции\"" - -#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 -msgid "File:" -msgstr "Файл:" - -#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 -msgid "Key:" -msgstr "Ключ:" - -#: src/wdgt-print-copies.c:179 -msgid "Sheets:" -msgstr "Листов:" - -#: src/wdgt-print-copies.c:197 -msgid "Labels" -msgstr "Этикетки" - -#: src/wdgt-print-copies.c:200 -msgid "from:" -msgstr "с:" - -#: src/wdgt-print-copies.c:207 -msgid "to:" -msgstr "до:" - -#: src/wdgt-print-merge.c:178 -msgid "Start on label" -msgstr "Начать с этикетки" - -#: src/wdgt-print-merge.c:186 -msgid "on 1st sheet" -msgstr "на первом листе" - -#: src/wdgt-print-merge.c:195 -msgid "Copies:" -msgstr "Копий:" - -#: src/wdgt-print-merge.c:201 -msgid "Collate" -msgstr "Собирать" - -#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 -msgid "Description:" -msgstr "Описание:" - -#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 -msgid "Page size:" -msgstr "Размер страницы:" - -#: src/wdgt-media-select.c:290 -msgid "Label size:" -msgstr "Размер этикетки:" - -#: src/wdgt-media-select.c:301 -msgid "Layout:" -msgstr "Формат:" - -#: src/wdgt-media-select.c:578 -#, c-format -msgid "%d x %d (%d per sheet)" -msgstr "%d x %d (%d на лист)" - -#: src/wdgt-media-select.c:582 -#, c-format -msgid "%d per sheet" -msgstr "%d на лист" - -#: src/wdgt-media-select.c:614 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -#: src/wdgt-media-select.c:619 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 -#, c-format -msgid "%s %s diameter" -msgstr "%s %s диаметр" - -#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 -#, c-format -msgid "%.5g %s diameter" -msgstr "%.5g %s диаметр" - -#: src/wdgt-rotate-label.c:193 -msgid "Rotate" -msgstr "Повернуть" - -#. This is the default custom color -#: src/mygal/color-palette.c:396 -msgid "custom" -msgstr "выборочно" - -#. "Custom" color - we'll pop up a GnomeColorPicker -#: src/mygal/color-palette.c:438 -msgid "Custom Color:" -msgstr "Пользовательский цвет:" - -#: src/mygal/color-palette.c:446 -msgid "Choose Custom Color" -msgstr "Выберите пользовательский цвет" - -#: src/mygal/color-palette.c:579 -msgid "black" -msgstr "чёрный" - -#: src/mygal/color-palette.c:580 -msgid "light brown" -msgstr "светло-коричневый" - -#: src/mygal/color-palette.c:581 -msgid "brown gold" -msgstr "золотой коричневый" - -#: src/mygal/color-palette.c:582 -msgid "dark green #2" -msgstr "чёрно-зелёный ?2" - -#: src/mygal/color-palette.c:583 -msgid "navy" -msgstr "морской" - -#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 -msgid "dark blue" -msgstr "тёмно-синий" - -#: src/mygal/color-palette.c:585 -msgid "purple #2" -msgstr "пурпурный ?2" - -#: src/mygal/color-palette.c:586 -msgid "very dark gray" -msgstr "очень тёмно-серый" - -#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 -msgid "dark red" -msgstr "тёмно-красный" - -#: src/mygal/color-palette.c:590 -msgid "red-orange" -msgstr "красно-оранжевый" - -#: src/mygal/color-palette.c:591 -msgid "gold" -msgstr "золотой" - -#: src/mygal/color-palette.c:592 -msgid "dark green" -msgstr "тёмно-зелёный" - -#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 -msgid "dull blue" -msgstr "тускло-синий" - -#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 -msgid "blue" -msgstr "синий" - -#: src/mygal/color-palette.c:595 -msgid "dull purple" -msgstr "тускло-пурпурный" - -#: src/mygal/color-palette.c:596 -msgid "dark grey" -msgstr "тёмно-серый" - -#: src/mygal/color-palette.c:599 -msgid "red" -msgstr "красный" - -#: src/mygal/color-palette.c:600 -msgid "orange" -msgstr "оранжевый" - -#: src/mygal/color-palette.c:601 -msgid "lime" -msgstr "лимонный" - -#: src/mygal/color-palette.c:602 -msgid "dull green" -msgstr "тускло-зелёный" - -#: src/mygal/color-palette.c:603 -msgid "dull blue #2" -msgstr "туско-синий ?2" - -#: src/mygal/color-palette.c:604 -msgid "sky blue #2" -msgstr "небесно-синий ?2" - -#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 -msgid "purple" -msgstr "пурпурный" - -#: src/mygal/color-palette.c:606 -msgid "gray" -msgstr "серый" - -#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 -msgid "magenta" -msgstr "малиновый" - -#: src/mygal/color-palette.c:610 -msgid "bright orange" -msgstr "ярко-оранжевый" - -#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 -msgid "yellow" -msgstr "жёлтый" - -#: src/mygal/color-palette.c:612 -msgid "green" -msgstr "зелёный" - -#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 -msgid "cyan" -msgstr "циан" - -#: src/mygal/color-palette.c:614 -msgid "bright blue" -msgstr "ярко-синий" - -#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 -msgid "red purple" -msgstr "красно-пурпурный" - -#: src/mygal/color-palette.c:616 -msgid "light grey" -msgstr "светло-серый" - -#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 -msgid "pink" -msgstr "розовый" - -#: src/mygal/color-palette.c:620 -msgid "light orange" -msgstr "светло-оранжевый" - -#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 -msgid "light yellow" -msgstr "светло-жёлтый" - -#: src/mygal/color-palette.c:622 -msgid "light green" -msgstr "светло-зелёный" - -#: src/mygal/color-palette.c:623 -msgid "light cyan" -msgstr "светло-циан" - -#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 -msgid "light blue" -msgstr "светло-синий" - -#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 -msgid "light purple" -msgstr "светло-пурпурный" - -#: src/mygal/color-palette.c:626 -msgid "white" -msgstr "белый" - -#: src/mygal/color-palette.c:631 -msgid "purplish blue" -msgstr "пурпурно-синий" - -#: src/mygal/color-palette.c:635 -msgid "dark purple" -msgstr "тёмно-пурпурный" - -#: src/mygal/color-palette.c:637 -msgid "sky blue" -msgstr "небесно-синий" - -#: libglabels/template.c:848 -#, c-format -msgid "Generic %s full page" -msgstr "Основная %s полная страница" - -#: libglabels/template.c:897 -msgid "No template files found!" -msgstr "Не найдены файлы шаблона!" - -#. Create and append an "Other" entry. -#: libglabels/paper.c:67 -msgid "Other" -msgstr "Другой" - -#: libglabels/paper.c:361 -msgid "No paper files found!" -msgstr "Не найдены файлы описания бумаги!" - -#: data/ui/glabels-ui.xml.h:1 -msgid "About glabels" -msgstr "О gLabels" - -#: data/ui/glabels-ui.xml.h:2 -msgid "About..." -msgstr "О программе..." - -#: data/ui/glabels-ui.xml.h:3 -msgid "Align _Horizontal" -msgstr "Выровнять по _горизонтали" - -#: data/ui/glabels-ui.xml.h:4 -msgid "Align _Vertical" -msgstr "Выровнять по _вертикали" - -#: data/ui/glabels-ui.xml.h:5 -msgid "Align objects to bottoms" -msgstr "Выровнять объекты по низам" - -#: data/ui/glabels-ui.xml.h:6 -msgid "Align objects to horizontal centers" -msgstr "Выровнять объекты по горизонтальным центрам" - -#: data/ui/glabels-ui.xml.h:7 -msgid "Align objects to left edges" -msgstr "Выровнять объекты по левому краю" - -#: data/ui/glabels-ui.xml.h:8 -msgid "Align objects to right edges" -msgstr "Выровнять объекты по правому краю" - -#: data/ui/glabels-ui.xml.h:9 -msgid "Align objects to tops" -msgstr "Выровнять объекты по верхам" - -#: data/ui/glabels-ui.xml.h:10 -msgid "Align objects to vertical centers" -msgstr "Выровнять объекты по вертикальным центрам" - -#: data/ui/glabels-ui.xml.h:12 -msgid "Bold" -msgstr "Жирный" - -#: data/ui/glabels-ui.xml.h:14 -msgid "Center align" -msgstr "Выровнять по центру" - -#: data/ui/glabels-ui.xml.h:15 -msgid "Center objects to horizontal label center" -msgstr "Центрировать объекты по центру горизонтальной метки" - -#: data/ui/glabels-ui.xml.h:16 -msgid "Center objects to vertical label center" -msgstr "Центрировать объекты по центру вертикальной метки" - -#: data/ui/glabels-ui.xml.h:17 -msgid "Change the visibility of markup lines in the current window" -msgstr "Изменить видимость линии разметки в текущем окне" - -#: data/ui/glabels-ui.xml.h:18 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "Изменить видимость панели инструментов для рисования в текущем окне" - -#: data/ui/glabels-ui.xml.h:19 -msgid "Change the visibility of the grid in the current window" -msgstr "Изменить видимость сетки в текущем окне" - -#: data/ui/glabels-ui.xml.h:20 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "Изменить видимость главной панели инструментов в текущем окне" - -#: data/ui/glabels-ui.xml.h:21 -msgid "Change the visibility of the property toolbar in the current window" -msgstr "Изменить видимость панели свойств в текущем окне" - -#: data/ui/glabels-ui.xml.h:22 -msgid "Close" -msgstr "Закрыть" - -#: data/ui/glabels-ui.xml.h:23 -msgid "Close the current file" -msgstr "Закрыть текущий файл" - -#: data/ui/glabels-ui.xml.h:24 -msgid "Configure the application" -msgstr "Настроить программу" - -#: data/ui/glabels-ui.xml.h:25 -msgid "Contents" -msgstr "Содержание справки" - -#: data/ui/glabels-ui.xml.h:26 -msgid "Copy" -msgstr "Запомнить" - -#: data/ui/glabels-ui.xml.h:27 -msgid "Copy the selection" -msgstr "Запомнить выделенное" - -#: data/ui/glabels-ui.xml.h:28 -msgid "Create a custom template" -msgstr "Создать свой шаблон" - -#: data/ui/glabels-ui.xml.h:29 -msgid "Create a new document" -msgstr "Создать новый документ" - -#: data/ui/glabels-ui.xml.h:30 -msgid "Create barcode object" -msgstr "Разместить штрих-код" - -#: data/ui/glabels-ui.xml.h:31 -msgid "Create box/rectangle object" -msgstr "Разместить прямоугольник" - -#: data/ui/glabels-ui.xml.h:32 -msgid "Create ellipse/circle object" -msgstr "Разместить эллипс/круг" - -#: data/ui/glabels-ui.xml.h:33 -msgid "Create image object" -msgstr "Разместить растровое изображение" - -#: data/ui/glabels-ui.xml.h:34 -msgid "Create line object" -msgstr "Разместить линию" - -#: data/ui/glabels-ui.xml.h:35 -msgid "Create text object" -msgstr "Разместить текст" - -#: data/ui/glabels-ui.xml.h:36 -msgid "Cu_t" -msgstr "_Вырезать" - -#: data/ui/glabels-ui.xml.h:37 -msgid "Customize" -msgstr "Настроить" - -#: data/ui/glabels-ui.xml.h:38 -msgid "Customize Drawing Toolbar" -msgstr "Настроить панель рисования" - -#: data/ui/glabels-ui.xml.h:39 -msgid "Customize Main Toolbar" -msgstr "Настроить панель инструментов" - -#: data/ui/glabels-ui.xml.h:40 -msgid "Customize Property Toolbar" -msgstr "Настроить панель свойств" - -#: data/ui/glabels-ui.xml.h:41 -msgid "Customize toolbars" -msgstr "Настроить панель инструментов" - -#: data/ui/glabels-ui.xml.h:42 -msgid "Cut" -msgstr "Вырезать" - -#: data/ui/glabels-ui.xml.h:43 -msgid "Cut the selection" -msgstr "Вырезать выделенное" - -#: data/ui/glabels-ui.xml.h:44 -msgid "Decrease magnification" -msgstr "Уменьшить" - -#: data/ui/glabels-ui.xml.h:45 -msgid "Delete" -msgstr "Удалить" - -#: data/ui/glabels-ui.xml.h:46 -msgid "Delete the selected objects" -msgstr "Удалить выбранные объекты" - -#: data/ui/glabels-ui.xml.h:47 -msgid "Drawing toolbar" -msgstr "Панель рисования" - -#: data/ui/glabels-ui.xml.h:48 -msgid "Dump XML" -msgstr "Дамп XML" - -#: data/ui/glabels-ui.xml.h:49 -msgid "Dump the UI Xml description" -msgstr "Дамп XML-описания UI" - -#: data/ui/glabels-ui.xml.h:50 -msgid "Edit merge properties" -msgstr "Изменить свойства объединения" - -#: data/ui/glabels-ui.xml.h:54 -msgid "Flip object horizontally" -msgstr "Отразить объект горизонтально" - -#: data/ui/glabels-ui.xml.h:55 -msgid "Flip object vertically" -msgstr "Отразить объект вертикально" - -#: data/ui/glabels-ui.xml.h:56 -msgid "Font name" -msgstr "Название шрифта" - -#: data/ui/glabels-ui.xml.h:57 -msgid "Font selector" -msgstr "Выбор шрифта" - -#: data/ui/glabels-ui.xml.h:58 -msgid "Font size" -msgstr "Размер шрифта" - -#: data/ui/glabels-ui.xml.h:59 -msgid "Icon and _Text" -msgstr "Пиктограмма и _Текст" - -#: data/ui/glabels-ui.xml.h:60 -msgid "Increase magnification" -msgstr "Увеличить" - -#: data/ui/glabels-ui.xml.h:61 -msgid "Italic" -msgstr "Курсив" - -#: data/ui/glabels-ui.xml.h:63 -msgid "Left align" -msgstr "Выровнять слева" - -#: data/ui/glabels-ui.xml.h:65 -msgid "Line width" -msgstr "Толщина линии" - -#: data/ui/glabels-ui.xml.h:66 -msgid "Lower object to bottom" -msgstr "Переместить объект на задний план" - -#: data/ui/glabels-ui.xml.h:67 -msgid "M_arkup" -msgstr "_Разметка" - -#: data/ui/glabels-ui.xml.h:68 -msgid "Main toolbar" -msgstr "Показывать панель инструментов" - -#: data/ui/glabels-ui.xml.h:69 -msgid "Markup" -msgstr "Разметка" - -#: data/ui/glabels-ui.xml.h:70 -msgid "Modify document properties" -msgstr "Изменить свойства документа" - -#: data/ui/glabels-ui.xml.h:71 -msgid "New" -msgstr "Создать" - -#: data/ui/glabels-ui.xml.h:72 -msgid "Object property editor" -msgstr "Редактор свойств объекта" - -#: data/ui/glabels-ui.xml.h:73 -msgid "Only show icons in the main toolbar" -msgstr "Показывать только картинки в главной панели инструментов" - -#: data/ui/glabels-ui.xml.h:75 -msgid "Open a file" -msgstr "Открыть файл" - -#: data/ui/glabels-ui.xml.h:76 -msgid "Open the glabels manual" -msgstr "Открыть руководство по glabels" - -#: data/ui/glabels-ui.xml.h:77 -msgid "Paste" -msgstr "Вставить" - -#: data/ui/glabels-ui.xml.h:78 -msgid "Paste the clipboard" -msgstr "Вставить из буфера" - -#: data/ui/glabels-ui.xml.h:79 -msgid "Pr_eferences..." -msgstr "_Настроить..." - -#: data/ui/glabels-ui.xml.h:80 -msgid "Preferences" -msgstr "Параметры" - -#: data/ui/glabels-ui.xml.h:82 -msgid "Print the current file" -msgstr "Напечатать текущий файл" - -#: data/ui/glabels-ui.xml.h:83 -msgid "Proper_ties..." -msgstr "Свойс_тва..." - -#: data/ui/glabels-ui.xml.h:84 -msgid "Properties" -msgstr "Свойства" - -#: data/ui/glabels-ui.xml.h:85 -msgid "Property toolbar" -msgstr "Панель свойств" - -#: data/ui/glabels-ui.xml.h:86 -msgid "Quit" -msgstr "Выйти" - -#: data/ui/glabels-ui.xml.h:87 -msgid "Quit the program" -msgstr "Выйти из программы" - -#: data/ui/glabels-ui.xml.h:88 -msgid "Raise object to top" -msgstr "Переместить объект на передний план" - -#: data/ui/glabels-ui.xml.h:89 -msgid "Recent _Files" -msgstr "Недавние _файлы" - -#: data/ui/glabels-ui.xml.h:90 -msgid "Redo" -msgstr "Повторить" - -#: data/ui/glabels-ui.xml.h:91 -msgid "Redo the undone action" -msgstr "Повторить отменённое действие" - -#: data/ui/glabels-ui.xml.h:92 -msgid "Remove all selections" -msgstr "Удалить всё выделенное" - -#: data/ui/glabels-ui.xml.h:94 -#, no-c-format -msgid "Restore scale to 100%" -msgstr "Масштаб 1:1" - -#: data/ui/glabels-ui.xml.h:95 -msgid "Right align" -msgstr "Выровнять справа" - -#: data/ui/glabels-ui.xml.h:98 -msgid "Rotate object 90 clockwise" -msgstr "Повернуть объект на 90 градусов по часовой стрелке" - -#: data/ui/glabels-ui.xml.h:99 -msgid "Rotate object 90 counter-clockwise" -msgstr "Повернуть объект на 90 градусов против часовой стрелке" - -#: data/ui/glabels-ui.xml.h:100 -msgid "Save" -msgstr "Сохранить" - -#: data/ui/glabels-ui.xml.h:101 -msgid "Save As" -msgstr "Сохранить как" - -#: data/ui/glabels-ui.xml.h:102 -msgid "Save _As..." -msgstr "Сохранить _как..." - -#: data/ui/glabels-ui.xml.h:103 -msgid "Save the current file" -msgstr "Сохранить текущий файл" - -#: data/ui/glabels-ui.xml.h:104 -msgid "Save the current file with a different name" -msgstr "Сохранить текущий файл под другим именем" - -#: data/ui/glabels-ui.xml.h:105 -msgid "Select All" -msgstr "Выбрать всё" - -#: data/ui/glabels-ui.xml.h:106 -msgid "Select _All" -msgstr "Выбрать вс_ё" - -#: data/ui/glabels-ui.xml.h:107 -msgid "Select all objects" -msgstr "Выбрать все объекты" - -#: data/ui/glabels-ui.xml.h:108 -msgid "Select, move and modify objects" -msgstr "Выбрать, переместить или изменить объекты" - -#: data/ui/glabels-ui.xml.h:110 -msgid "Set main toolbar button style according to desktop default" -msgstr "" -"Установить стиль кнопок главной панели инструментов согласно настройкам " -"рабочего стола" - -#: data/ui/glabels-ui.xml.h:111 -msgid "Show _Tooltips" -msgstr "Показывать _подсказки" - -#: data/ui/glabels-ui.xml.h:112 -msgid "Show both icons and texts in the main toolbar" -msgstr "Показывать и пиктограммы и текст в главной панели инструментов" - -#: data/ui/glabels-ui.xml.h:113 -msgid "Show tooltips in the drawing toolbar" -msgstr "Показывать подсказки в панели рисования" - -#: data/ui/glabels-ui.xml.h:114 -msgid "Show tooltips in the main toolbar" -msgstr "Показывать подсказки в главной панели инструментов" - -#: data/ui/glabels-ui.xml.h:115 -msgid "Show tooltips in the property toolbar" -msgstr "Показывать подсказки на панели свойств" - -#: data/ui/glabels-ui.xml.h:116 -msgid "Template Designer" -msgstr "Дизайнер шаблонов" - -#: data/ui/glabels-ui.xml.h:117 -msgid "Template _Designer..." -msgstr "Дизайнер _Шаблонов..." - -#: data/ui/glabels-ui.xml.h:118 -msgid "Text color" -msgstr "Цвет текста" - -#: data/ui/glabels-ui.xml.h:119 -msgid "U_n-select All" -msgstr "_Снять выделение со всего" - -#: data/ui/glabels-ui.xml.h:120 -msgid "Un-select All" -msgstr "_Снять выделение со всего" - -#: data/ui/glabels-ui.xml.h:121 -msgid "Undo" -msgstr "Отменить" - -#: data/ui/glabels-ui.xml.h:122 -msgid "Undo the last action" -msgstr "Отменить последнее действие" - -#: data/ui/glabels-ui.xml.h:123 -msgid "Zoom _1:1" -msgstr "Масштаб _1:1" - -#: data/ui/glabels-ui.xml.h:124 -msgid "Zoom _In" -msgstr "У_величить" - -#: data/ui/glabels-ui.xml.h:125 -msgid "Zoom _Out" -msgstr "У_меньшить" - -#: data/ui/glabels-ui.xml.h:126 -msgid "Zoom to _fit" -msgstr "Уместить целиком в окно" - -#: data/ui/glabels-ui.xml.h:127 -msgid "Zoom to fit window" -msgstr "Изменить масштаб, чтобы изображение было видно полностью" - -#: data/ui/glabels-ui.xml.h:128 -msgid "_About..." -msgstr "_О программе..." - -#: data/ui/glabels-ui.xml.h:129 -msgid "_Bottoms" -msgstr "По _низу" - -#: data/ui/glabels-ui.xml.h:132 -msgid "_Close" -msgstr "_Закрыть" - -#: data/ui/glabels-ui.xml.h:133 -msgid "_Contents" -msgstr "_Содержание справки" - -#: data/ui/glabels-ui.xml.h:134 -msgid "_Copy" -msgstr "_Запомнить" - -#: data/ui/glabels-ui.xml.h:135 -msgid "_Create Object" -msgstr "_Создать объект" - -#: data/ui/glabels-ui.xml.h:136 -msgid "_Debug" -msgstr "_Отладка" - -#: data/ui/glabels-ui.xml.h:138 -msgid "_Desktop Default" -msgstr "_Согласно настройкам рабочего стола" - -#: data/ui/glabels-ui.xml.h:139 -msgid "_Drawing Toolbar" -msgstr "Показывать панель _рисования" - -#: data/ui/glabels-ui.xml.h:140 -msgid "_Edit" -msgstr "_Правка" - -#: data/ui/glabels-ui.xml.h:142 -msgid "_File" -msgstr "_Файл" - -#: data/ui/glabels-ui.xml.h:143 -msgid "_Grid" -msgstr "_Сетка" - -#: data/ui/glabels-ui.xml.h:144 -msgid "_Help" -msgstr "_Справка" - -#: data/ui/glabels-ui.xml.h:145 -msgid "_Icon" -msgstr "_Пиктограмма" - -#: data/ui/glabels-ui.xml.h:149 -msgid "_Main Toolbar" -msgstr "Показывать панель _инструментов" - -#: data/ui/glabels-ui.xml.h:150 -msgid "_Merge Properties..." -msgstr "_Свойства объединения..." - -#: data/ui/glabels-ui.xml.h:151 -msgid "_New" -msgstr "_Создать" - -#: data/ui/glabels-ui.xml.h:152 -msgid "_Objects" -msgstr "_Объекты" - -#: data/ui/glabels-ui.xml.h:153 -msgid "_Open..." -msgstr "_Открыть..." - -#: data/ui/glabels-ui.xml.h:155 -msgid "_Paste" -msgstr "Вст_авить" - -#: data/ui/glabels-ui.xml.h:156 -msgid "_Print..." -msgstr "_Напечатать..." - -#: data/ui/glabels-ui.xml.h:157 -msgid "_Property Toolbar" -msgstr "Показывать панель с_войств" - -#: data/ui/glabels-ui.xml.h:158 -msgid "_Quit" -msgstr "В_ыйти" - -#: data/ui/glabels-ui.xml.h:161 -msgid "_Save" -msgstr "_Сохранить" - -#: data/ui/glabels-ui.xml.h:165 -msgid "_View" -msgstr "_Вид" - -#: data/glade/prefs-dialog.glade.h:1 -msgid " " -msgstr " " - -#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 -#: data/glade/template-designer.glade.h:5 -msgid "*" -msgstr "*" - -#: data/glade/prefs-dialog.glade.h:3 -msgid "Default page size" -msgstr "Размер страницы по умолчанию" - -#: data/glade/prefs-dialog.glade.h:4 -msgid "Fill" -msgstr "Заполнение" - -#: data/glade/prefs-dialog.glade.h:5 -msgid "Line" -msgstr "Линия" - -#: data/glade/prefs-dialog.glade.h:6 -msgid "Text" -msgstr "Текст" - -#: data/glade/prefs-dialog.glade.h:7 -msgid "Units" -msgstr "Единицы измерения" - -#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 -msgid "Alignment:" -msgstr "Выравнивание:" - -#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 -msgid "Color:" -msgstr "Цвет:" - -#: data/glade/prefs-dialog.glade.h:10 -msgid "Font:" -msgstr "Шрифт:" - -#: data/glade/prefs-dialog.glade.h:11 -msgid "ISO A4" -msgstr "ISO A4" - -#: data/glade/prefs-dialog.glade.h:12 -msgid "Inches" -msgstr "Дюймы" - -#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 -msgid "Line Spacing:" -msgstr "" -"Межстрочный\n" -"интервал:" - -#: data/glade/prefs-dialog.glade.h:14 -msgid "Locale" -msgstr "Локаль" - -#: data/glade/prefs-dialog.glade.h:15 -msgid "Millimeters" -msgstr "Миллиметры" - -#: data/glade/prefs-dialog.glade.h:16 -msgid "Object defaults" -msgstr "Настройки объектов по умолчанию" - -#: data/glade/prefs-dialog.glade.h:17 -msgid "Points" -msgstr "Пункты" - -#: data/glade/prefs-dialog.glade.h:18 -msgid "Select default properties for new objects." -msgstr "Укажите свойства новых объектов по умолчанию." - -#: data/glade/prefs-dialog.glade.h:19 -msgid "Select locale specific behavior." -msgstr "Укажите ваши предпочтения." - -#. Most popular (at top of list) -#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:29 -msgid "US Letter" -msgstr "US Letter" - -#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 -#: data/glade/template-designer.glade.h:72 -msgid "Width:" -msgstr "Ширина:" - -#: data/glade/object-editor.glade.h:2 -msgid "00000000000 00000" -msgstr "00000000000 00000" - -#: data/glade/object-editor.glade.h:3 -msgid "Xxx object properties" -msgstr "Xxx свойства объекта" - -#: data/glade/object-editor.glade.h:5 -msgid "Allow merge to automatically shrink text" -msgstr "Разрешить автоматически уменьшать текст при объединении" - -#: data/glade/object-editor.glade.h:6 -msgid "Angle:" -msgstr "Угол:" - -#: data/glade/object-editor.glade.h:7 -msgid "Checksum" -msgstr "Контрольная сумма" - -#: data/glade/object-editor.glade.h:10 -msgid "Family:" -msgstr "Семейство:" - -#: data/glade/object-editor.glade.h:12 -msgid "Fill" -msgstr "Заполнение" - -#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 -msgid "Height:" -msgstr "Высота:" - -#: data/glade/object-editor.glade.h:14 -msgid "Image" -msgstr "Изображение" - -#: data/glade/object-editor.glade.h:15 -msgid "Insert merge field" -msgstr "Вставить объединительное поле" - -#: data/glade/object-editor.glade.h:17 -msgid "Length:" -msgstr "Длина:" - -#: data/glade/object-editor.glade.h:18 -msgid "Line" -msgstr "Линия" - -#: data/glade/object-editor.glade.h:20 -msgid "Literal:" -msgstr "Буквально:" - -#: data/glade/object-editor.glade.h:21 -msgid "Load image" -msgstr "Загрузить изображение" - -#: data/glade/object-editor.glade.h:22 -msgid "Position" -msgstr "Расположение" - -#: data/glade/object-editor.glade.h:23 -msgid "Reset image size" -msgstr "Установить размер изображения по умолчанию" - -#: data/glade/object-editor.glade.h:24 -msgid "Size" -msgstr "Размер" - -#: data/glade/object-editor.glade.h:25 -msgid "Size:" -msgstr "Размер:" - -#: data/glade/object-editor.glade.h:26 -msgid "Style" -msgstr "Стиль:" - -#: data/glade/object-editor.glade.h:27 -msgid "Style:" -msgstr "Стиль:" - -#: data/glade/object-editor.glade.h:30 -msgid "X:" -msgstr "X:" - -#: data/glade/object-editor.glade.h:31 -msgid "Y:" -msgstr "Y:" - -#: data/glade/object-editor.glade.h:32 -msgid "degrees" -msgstr "градусов" - -#: data/glade/object-editor.glade.h:33 -msgid "dialog1" -msgstr "dialog1" - -#: data/glade/object-editor.glade.h:34 -msgid "digits:" -msgstr "цифры:" - -#: data/glade/object-editor.glade.h:35 -msgid "format:" -msgstr "формат:" - -#: data/glade/template-designer.glade.h:1 -msgid " " -msgstr " " - -#: data/glade/template-designer.glade.h:2 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "(например, \"Почтовые этикетки,\" \"Визитные карточки,\" ...)" - -#: data/glade/template-designer.glade.h:3 -msgid "(e.g., 8163A)" -msgstr "(e.g., 8163A)" - -#: data/glade/template-designer.glade.h:4 -msgid "(e.g., Avery, Acme, ...)" -msgstr "(e.g., Avery, Acme, ...)" - -#: data/glade/template-designer.glade.h:6 -msgid "1. Outer radius:" -msgstr "1. Наружный радиус:" - -#: data/glade/template-designer.glade.h:7 -msgid "1. Radius:" -msgstr "1. Радиус:" - -#: data/glade/template-designer.glade.h:8 -msgid "1. Width:" -msgstr "1. Ширина:" - -#: data/glade/template-designer.glade.h:9 -msgid "2. Height:" -msgstr "2. Высота:" - -#: data/glade/template-designer.glade.h:10 -msgid "2. Inner radius:" -msgstr "2. Внутренний радиус:" - -#: data/glade/template-designer.glade.h:11 -msgid "2. Waste (overprint allowed):" -msgstr "2. Пустое поле (на нём можно будет печать):" - -#: data/glade/template-designer.glade.h:12 -msgid "3. Clipping width:" -msgstr "3. Ширина для обрезки:" - -#: data/glade/template-designer.glade.h:13 -msgid "3. Margin" -msgstr "3. Поле" - -#: data/glade/template-designer.glade.h:14 -msgid "3. Round (radius of corner):" -msgstr "3. Округлость (радиус вершины):" - -#: data/glade/template-designer.glade.h:15 -msgid "4. Clipping height:" -msgstr "4. Высота обрезки:" - -#: data/glade/template-designer.glade.h:16 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "4. Пустое гориз. пространство (может быть заполнено):" - -#: data/glade/template-designer.glade.h:17 -msgid "5. Vert. waste (overprint allowed):" -msgstr "5. Пустое верт. пространство (может быть заполнено):" - -#: data/glade/template-designer.glade.h:18 -msgid "5. Waste (overprint allowed):" -msgstr "5. Пустое пространство (может быть заполнено):" - -#: data/glade/template-designer.glade.h:19 -msgid "6. Margin" -msgstr "6. Поле" - -#: data/glade/template-designer.glade.h:20 -msgid "Brand/Manufacturer:" -msgstr "Производитель или торговая марка:" - -#: data/glade/template-designer.glade.h:21 -msgid "CD/DVD (including credit card CDs)" -msgstr "CD/DVD (включая CD размером с визитку)" - -#: data/glade/template-designer.glade.h:22 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "" -"Поздравляем!\n" -"\n" -"Вы завершили создание шаблона в gLabels.\n" -"Чтобы сохранить разработку, нажмите \"Применить\"\n" -"\n" -"Также вы можете нажать \"Отменить\", чтобы не сохранять, или \"Назад\", " -"чтобы продолжить редактирование." - -#: data/glade/template-designer.glade.h:30 -msgid "Design Completed" -msgstr "Оформление завершено" - -#: data/glade/template-designer.glade.h:31 -msgid "Distance from left edge (x0):" -msgstr "Расстояние от левого угла (x0):" - -#: data/glade/template-designer.glade.h:32 -msgid "Distance from top edge (y0):" -msgstr "Расстояние от верхнего угла (y0)" - -#: data/glade/template-designer.glade.h:34 -msgid "Horizontal pitch (dx):" -msgstr "Интервал по горизонтали (dx):" - -#: data/glade/template-designer.glade.h:35 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" -"Сколько форм будет содержать шаблон? \n" -"\n" -"Форма - это набор этикеток или визиток, которые можут быть распределены по " -"простой сетке.\n" -"Большинству шаблонов требуется только одна форма, как в первом примере.\n" -"Второй пример иллюстрирует случай, когда необходимо применять две формы." - -#: data/glade/template-designer.glade.h:40 -msgid "Label Size (CD/DVD)" -msgstr "Размер метки (CD/DVD)" - -#: data/glade/template-designer.glade.h:41 -msgid "Label Size (Round)" -msgstr "Размер метки (диаметр)" - -#: data/glade/template-designer.glade.h:42 -msgid "Label or Card Shape" -msgstr "Форма этикетки или визитки" - -#: data/glade/template-designer.glade.h:43 -msgid "Label or Card Size (Rectangular)" -msgstr "Развер этикетки или визитки (прямоугольник)" - -#: data/glade/template-designer.glade.h:44 -msgid "Layout #1" -msgstr "Форма #1" - -#: data/glade/template-designer.glade.h:45 -msgid "Layout #2" -msgstr "Форма #2" - -#: data/glade/template-designer.glade.h:46 -msgid "Layout(s)" -msgstr "Формы" - -#: data/glade/template-designer.glade.h:47 -msgid "Name and Description" -msgstr "Название и Описание" - -#: data/glade/template-designer.glade.h:48 -msgid "Number across (nx):" -msgstr "По горизонтали (nx):" - -#: data/glade/template-designer.glade.h:49 -msgid "Number down (ny):" -msgstr "По вертикали (ny):" - -#: data/glade/template-designer.glade.h:50 -msgid "Number of Layouts" -msgstr "Количество форм" - -#: data/glade/template-designer.glade.h:51 -msgid "Number of layouts:" -msgstr "Количество форм:" - -#: data/glade/template-designer.glade.h:52 -msgid "Page Size" -msgstr "Размер страницы" - -#: data/glade/template-designer.glade.h:54 -msgid "Part #:" -msgstr "Часть #:" - -#: data/glade/template-designer.glade.h:55 -msgid "" -"Please enter the following identifying information about the template " -"stationery." -msgstr "Укажите следующую идентификационную информацию о ." - -#: data/glade/template-designer.glade.h:56 -msgid "Please enter the following layout information." -msgstr "Введите следующую информацию об оформлении." - -#: data/glade/template-designer.glade.h:57 -msgid "" -"Please enter the following size parameters of a single label in your " -"template." -msgstr "Введите геометрические размеры одиночной этикетки в вашем шаблоне." - -#: data/glade/template-designer.glade.h:58 -msgid "" -"Please enter the following size parameters of a single label or card in your " -"template." -msgstr "" -"Введите геометрические размеры одиночной этикетки или визитки в вашем " -"шаблоне." - -#: data/glade/template-designer.glade.h:59 -msgid "Please select the basic shape of the labels or cards." -msgstr "Выберите основную фигуру этикетки или карточки." - -#: data/glade/template-designer.glade.h:60 -msgid "Please select the page size of the template stationery." -msgstr "Выберите размер страницы для шаблона." - -#: data/glade/template-designer.glade.h:61 -msgid "Print test sheet" -msgstr "Напечатать тестовую страницу" - -#: data/glade/template-designer.glade.h:62 -msgid "Rectangular or square (can have rounded corners)" -msgstr "Прямоугольник или квадрат (может иметь скруглённые края)" - -#: data/glade/template-designer.glade.h:63 -msgid "Round" -msgstr "Круг" - -#: data/glade/template-designer.glade.h:64 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" -"Для данного шаблона\n" -"требуется две формы." - -#: data/glade/template-designer.glade.h:66 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" -"Для данного шаблона требуется\n" -"только одна форма." - -#: data/glade/template-designer.glade.h:68 -msgid "Vertical pitch (dy):" -msgstr "Интервал по вертикали (dy):" - -#: data/glade/template-designer.glade.h:69 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" -"Добро пожаловать в Дизайнер шаблонов gLabels.\n" -"\n" -"Этот диалог будет сопровождать вас в создании вашего собственного шаблона " -"gLabels." - -#. Other ISO A series sizes -#: data/templates/paper-sizes.xml.h:2 -msgid "A0" -msgstr "A0" - -#: data/templates/paper-sizes.xml.h:3 -msgid "A1" -msgstr "A1" - -#: data/templates/paper-sizes.xml.h:4 -msgid "A10" -msgstr "A10" - -#: data/templates/paper-sizes.xml.h:5 -msgid "A2" -msgstr "A2" - -#: data/templates/paper-sizes.xml.h:6 -msgid "A3" -msgstr "A3" - -#: data/templates/paper-sizes.xml.h:7 -msgid "A4" -msgstr "A4" - -#: data/templates/paper-sizes.xml.h:8 -msgid "A5" -msgstr "A5" - -#: data/templates/paper-sizes.xml.h:9 -msgid "A6" -msgstr "A6" - -#: data/templates/paper-sizes.xml.h:10 -msgid "A7" -msgstr "A7" - -#: data/templates/paper-sizes.xml.h:11 -msgid "A8" -msgstr "A8" - -#: data/templates/paper-sizes.xml.h:12 -msgid "A9" -msgstr "A9" - -#. ISO B series sizes -#: data/templates/paper-sizes.xml.h:14 -msgid "B0" -msgstr "B0" - -#: data/templates/paper-sizes.xml.h:15 -msgid "B1" -msgstr "B1" - -#: data/templates/paper-sizes.xml.h:16 -msgid "B10" -msgstr "B10" - -#: data/templates/paper-sizes.xml.h:17 -msgid "B2" -msgstr "B2" - -#: data/templates/paper-sizes.xml.h:18 -msgid "B3" -msgstr "B3" - -#: data/templates/paper-sizes.xml.h:19 -msgid "B4" -msgstr "B4" - -#: data/templates/paper-sizes.xml.h:20 -msgid "B5" -msgstr "B5" - -#: data/templates/paper-sizes.xml.h:21 -msgid "B6" -msgstr "B6" - -#: data/templates/paper-sizes.xml.h:22 -msgid "B7" -msgstr "B7" - -#: data/templates/paper-sizes.xml.h:23 -msgid "B8" -msgstr "B8" - -#: data/templates/paper-sizes.xml.h:24 -msgid "B9" -msgstr "B9" - -#: data/templates/paper-sizes.xml.h:25 -msgid "US Executive" -msgstr "US Executive" - -#. Other US paper sizes -#: data/templates/paper-sizes.xml.h:27 -msgid "US Legal" -msgstr "US Legal" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:2 -#: data/templates/zweckform-iso-templates.xml.h:2 -msgid "Address Labels" -msgstr "Этикетка с адресом" - -#. =================================================================== -#. ============================================================ -#. =================================================================== -#. ====================================================== -#: data/templates/avery-us-templates.xml.h:4 -#: data/templates/avery-iso-templates.xml.h:4 -#: data/templates/zweckform-iso-templates.xml.h:6 -#: data/templates/misc-us-templates.xml.h:3 -#: data/templates/misc-iso-templates.xml.h:17 -msgid "Business Cards" -msgstr "Визитные карточки" - -#: data/templates/avery-us-templates.xml.h:5 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "Метки для CD/DVD (Наклейки на диск)" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:7 -msgid "Diskette Labels" -msgstr "Наклейки на дискеты" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:9 -msgid "Filing Labels" -msgstr "Заполняемые этикетки" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:11 -msgid "Full Sheet Labels" -msgstr "Этикетки на всю страницу" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:13 -msgid "Large Round Labels" -msgstr "Этикетки с большим закруглением" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:15 -msgid "Name Badge Labels" -msgstr "Именной бейджик" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:17 -msgid "Return Address Labels" -msgstr "Наклейка для обратного адреса" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:19 -msgid "Shipping Labels" -msgstr "Ценники" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:21 -msgid "Small Round Labels" -msgstr "Маленькие круглые этикетки" - -#. =================================================================== -#: data/templates/avery-us-templates.xml.h:23 -msgid "Square Labels" -msgstr "Прямоугольные этикетки" - -#: data/templates/avery-us-templates.xml.h:24 -msgid "Video Tape Face Labels" -msgstr "Лицевые наклейки на видеокассету" - -#: data/templates/avery-us-templates.xml.h:25 -msgid "Video Tape Spine Labels" -msgstr "Торцевые наклейки на видеокассету" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:2 -msgid "Address labels" -msgstr "Адресные наклейки" - -#. =============================================================== -#: data/templates/avery-iso-templates.xml.h:6 -msgid "CD Booklet" -msgstr "Вкладыш в CD" - -#. =============================================================== -#: data/templates/avery-iso-templates.xml.h:8 -#, fuzzy -msgid "CD Inlet" -msgstr "CD" - -#. =============================================================== -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:10 -#: data/templates/zweckform-iso-templates.xml.h:8 -#: data/templates/misc-us-templates.xml.h:5 -#: data/templates/misc-iso-templates.xml.h:21 -msgid "CD/DVD Labels" -msgstr "Этикетки для CD/DVD" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:12 -msgid "Diskette labels" -msgstr "Наклейки на дискеты" - -#. =============================================================== -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:14 -#: data/templates/zweckform-iso-templates.xml.h:14 -#: data/templates/misc-iso-templates.xml.h:35 -msgid "Mailing Labels" -msgstr "Почтовые этикетки" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:16 -msgid "Mailing labels" -msgstr "Почтовые наклейки" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:18 -msgid "Mini Address Labels" -msgstr "Маленькие наклейки с адресом" - -#. =================================================================== -#: data/templates/avery-iso-templates.xml.h:20 -msgid "Shipping labels" -msgstr "Ценники" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:4 -msgid "Allround Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:10 -msgid "Correction and Cover-up Labels" -msgstr "Исправляющие и покрывающие метки" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:12 -#, fuzzy -msgid "Lever Arch File Labels" -msgstr "Файл" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:16 -#, fuzzy -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "x" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:18 -msgid "Rectangular Copier Labels" -msgstr "" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:20 -#: data/templates/misc-iso-templates.xml.h:44 -msgid "Rectangular Labels" -msgstr "Прямоугольные метки" - -#. =================================================================== -#: data/templates/zweckform-iso-templates.xml.h:22 -msgid "Video Labels (back)" -msgstr "Видеонаклейки (оборотная сторона)" - -#: data/templates/misc-us-templates.xml.h:1 -msgid "Business Card CD" -msgstr "Визитная карточка на CD" - -#: data/templates/misc-us-templates.xml.h:4 -msgid "CD Template Rectangles" -msgstr "Прямоугольный шаблон для CD" - -#: data/templates/misc-us-templates.xml.h:6 -msgid "CD/DVD Labels (Face Only)" -msgstr "Наклейки для CD/DVD (лицевая сторона)" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:7 -#: data/templates/misc-iso-templates.xml.h:23 -msgid "CD/DVD Labels (face only)" -msgstr "Вкладыши CD/DVD (лицевая сторона)" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:9 -msgid "Cassette Labels" -msgstr "Наклейки на кассеты" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:11 -msgid "DLT Labels" -msgstr "Этикетки на DLT" - -#. =================================================================== -#: data/templates/misc-us-templates.xml.h:13 -msgid "Microtube labels" -msgstr "Этикетки для Microtube" - -#: data/templates/misc-us-templates.xml.h:14 -msgid "Mini-CD Labels" -msgstr "Этикетки для Мини-CD" - -#: data/templates/misc-us-templates.xml.h:15 -#, fuzzy -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "CD CD" - -#: data/templates/misc-us-templates.xml.h:16 -#, fuzzy -msgid "PRO CD Labels 2-up (Face only)" -msgstr "CD" - -#: data/templates/misc-us-templates.xml.h:17 -#: data/templates/misc-iso-templates.xml.h:42 -#, fuzzy -msgid "PRO CD Labels 2-up (face only)" -msgstr "CD" - -#: data/templates/misc-us-templates.xml.h:18 -msgid "Slimline CD Case (rightside up)" -msgstr "Тонкие коробки для CD (правая сторона вверху)" - -#: data/templates/misc-us-templates.xml.h:19 -msgid "Slimline CD Case (upside down)" -msgstr "Тонкие коробки для CD (кверх ногами)" - -#: data/templates/misc-iso-templates.xml.h:1 -msgid "Agipa 119488: Business Cards" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:3 -msgid "Allround Labels --24" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:5 -msgid "Allround Labels --44" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:7 -msgid "Allround Labels --64" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:9 -msgid "Allround Labels --65" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:11 -#, fuzzy -msgid "Arch File Labels" -msgstr "Файл" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:13 -#, fuzzy -msgid "Arch File Labels (large)" -msgstr "Файл большой" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:15 -#, fuzzy -msgid "Arch File Labels (small)" -msgstr "Файл маленький" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:19 -msgid "CD Labels" -msgstr "Этикетки для CD" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:25 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "Наклейки стандартного формата для CD/DVD (лицевая сторона)" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:27 -msgid "Diskette Labels (face only)" -msgstr "Наклейки для дискет (лицевая сторона)" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:29 -msgid "EPSON Photo Stickers 16" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:31 -msgid "Etiketten" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:33 -msgid "Fridge Magnet Stickers" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:37 -msgid "Mailing Labels --14" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:39 -msgid "Mailing Labels-2 columns" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:41 -msgid "Mailing Labels-3 columns" -msgstr "" - -#. =================================================================== -#: data/templates/misc-iso-templates.xml.h:46 -msgid "Video Labels (face only)" -msgstr "Наклейки на видеокассеты (лицевая сторона)" - -#: data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers" -msgstr "Создание этикеток, визитных карточек и вкладышей для дисков" - -#: data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "Дизайнер этикеток gLabels" - -#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 -msgid "gLabels Project File" -msgstr "Файл проекта gLabels" - diff --git a/glabels2/po/zh_TW.Big5.po b/glabels2/po/zh_TW.Big5.po deleted file mode 100644 index 485e1ccc..00000000 --- a/glabels2/po/zh_TW.Big5.po +++ /dev/null @@ -1,2650 +0,0 @@ -# Traditional Chinese Translation for glabels -# Copyright (C) 2002 Free Software Foundation, Inc. -# Shell Hung , 2002 -# -msgid "" -msgstr "" -"Project-Id-Version: glabels 0.4.4\n" -"POT-Creation-Date: 2004-08-08 00:43-0400\n" -"PO-Revision-Date: 2002-07-14 18:30+0800\n" -"Last-Translator: Shell Hung \n" -"Language-Team: zh-l10n \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=big5\n" -"Content-Transfer-Encoding: 8bit\n" - -#: src/glabels.c:55 -msgid "Show view debugging messages." -msgstr "" - -#: src/glabels.c:58 -msgid "Show item debugging messages." -msgstr "" - -#: src/glabels.c:61 -msgid "Show printing debugging messages." -msgstr "" - -#: src/glabels.c:64 -msgid "Show prefs debugging messages." -msgstr "" - -#: src/glabels.c:67 -msgid "Show file debugging messages." -msgstr "" - -#: src/glabels.c:70 -msgid "Show document debugging messages." -msgstr "" - -#: src/glabels.c:73 -msgid "Show template debugging messages." -msgstr "" - -#: src/glabels.c:76 -msgid "Show paper debugging messages." -msgstr "" - -#: src/glabels.c:79 -msgid "Show xml debugging messages." -msgstr "" - -#: src/glabels.c:82 -msgid "Show document merge debugging messages." -msgstr "" - -#: src/glabels.c:85 -msgid "Show commands debugging messages." -msgstr "" - -#: src/glabels.c:88 -msgid "Show undo debugging messages." -msgstr "" - -#: src/glabels.c:91 -msgid "Show recent debugging messages." -msgstr "" - -#: src/glabels.c:94 -msgid "Show window debugging messages." -msgstr "" - -#: src/glabels.c:97 -msgid "Show ui debugging messages." -msgstr "" - -#: src/glabels.c:100 -msgid "Show property_bar debugging messages." -msgstr "" - -#: src/glabels.c:103 -msgid "Show media select widget debugging messages." -msgstr "" - -#: src/glabels.c:106 -msgid "Show mini preview widget debugging messages." -msgstr "" - -#: src/glabels.c:109 -msgid "Show pixbuf cache debugging messages." -msgstr "" - -#: src/glabels.c:112 -msgid "Show widget debugging messages." -msgstr "" - -#: src/glabels.c:115 -msgid "Show object editor debugging messages." -msgstr "" - -#: src/glabels.c:118 -msgid "Turn on all debugging messages." -msgstr "" - -#: src/glabels.c:187 -msgid "Could not initialize Bonobo!\n" -msgstr "" - -#: src/glabels-batch.c:48 -msgid "print this message" -msgstr "¦C¦L³o­Ó°T®§" - -#: src/glabels-batch.c:50 -msgid "print the version of glabels-batch being used" -msgstr "¦C¦L¥X glabels-batch ªºª©¥»¸ê°T" - -#: src/glabels-batch.c:52 -msgid "set output filename (default=\"output.ps\")" -msgstr "³]©w¿é¥XÀɦWºÙ (¹w³]¬°\"output.ps\")" - -#: src/glabels-batch.c:52 -msgid "filename" -msgstr "ÀɮצWºÙ" - -#: src/glabels-batch.c:54 -msgid "number of sheets (default=1)" -msgstr "¯È±i¼Æ¥Ø (¹w³]¬° 1)" - -#: src/glabels-batch.c:54 -msgid "sheets" -msgstr "¯È±i" - -#: src/glabels-batch.c:56 -msgid "number of copies (default=1)" -msgstr "¥÷¼Æ (¹w³]¬° 1)" - -#: src/glabels-batch.c:56 -msgid "copies" -msgstr "¥÷¼Æ" - -#: src/glabels-batch.c:58 src/print-dialog.c:336 -msgid "print outlines (to test printer alignment)" -msgstr "¦L¥X¥~Ãä (´ú¸Õ¥´¦L¾÷°Ñ¼Æ)" - -#: src/glabels-batch.c:60 src/print-dialog.c:344 -msgid "print in reverse (i.e. a mirror image)" -msgstr "¤Ï¤è¦V¦C¦L (¦p­Ë¦V¼v¹³)" - -#: src/glabels-batch.c:96 -msgid "[OPTION...] GLABELS_FILE..." -msgstr "[¿ï¶µ...] GLABELS_FILE..." - -#: src/glabels-batch.c:116 -msgid "missing glabels file\n" -msgstr "¨S¦³¿é¤J glabels ªºÀÉ®×\n" - -#: src/glabels-batch.c:157 -#, c-format -msgid "cannot open glabels file %s\n" -msgstr "¶}±ÒÀÉ®×¥¢±Ñ %s\n" - -#: src/window.c:244 -msgid "(none) - gLabels" -msgstr "" - -#: src/window.c:414 -msgid "(modified)" -msgstr "" - -#: src/stock.c:65 data/ui/glabels-ui.xml.h:165 -#, fuzzy -msgid "_Select Mode" -msgstr "¿ï¾Ü" - -#: src/stock.c:66 data/ui/glabels-ui.xml.h:166 -#, fuzzy -msgid "_Text" -msgstr "¤å¦r" - -#: src/stock.c:67 data/ui/glabels-ui.xml.h:151 -#, fuzzy -msgid "_Line" -msgstr "½u" - -#: src/stock.c:68 data/ui/glabels-ui.xml.h:133 -#, fuzzy -msgid "_Box" -msgstr "²°¤l" - -#: src/stock.c:69 data/ui/glabels-ui.xml.h:144 -#, fuzzy -msgid "_Ellipse" -msgstr "¾ò¶ê§Î" - -#: src/stock.c:70 data/ui/glabels-ui.xml.h:149 -#, fuzzy -msgid "_Image" -msgstr "¹Ï¹³" - -#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 -#, fuzzy -msgid "Bar_code" -msgstr "¼Æ½X±ø" - -#: src/stock.c:72 -#, fuzzy -msgid "_Merge Properties" -msgstr "¦X¨Ö³]©w" - -#: src/stock.c:73 -#, fuzzy -msgid "Object _Properties" -msgstr "¤å¦r¼Ë»ª" - -#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 -#, fuzzy -msgid "Bring to _Front" -msgstr "±a¥X¨ì«e­±" - -#: src/stock.c:75 data/ui/glabels-ui.xml.h:110 -#, fuzzy -msgid "Send to _Back" -msgstr "©ñ¦b³Ì©³" - -#: src/stock.c:76 data/ui/glabels-ui.xml.h:97 -#, fuzzy -msgid "Rotate _Left" -msgstr "±ÛÂà" - -#: src/stock.c:77 data/ui/glabels-ui.xml.h:98 -#, fuzzy -msgid "Rotate _Right" -msgstr "±ÛÂà" - -#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 -msgid "Flip _Horizontally" -msgstr "" - -#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 -msgid "Flip _Vertically" -msgstr "" - -#: src/stock.c:80 data/ui/glabels-ui.xml.h:150 -msgid "_Lefts" -msgstr "" - -#: src/stock.c:81 data/ui/glabels-ui.xml.h:162 -msgid "_Rights" -msgstr "" - -#: src/stock.c:82 data/ui/glabels-ui.xml.h:134 -msgid "_Centers" -msgstr "" - -#: src/stock.c:83 data/ui/glabels-ui.xml.h:167 -#, fuzzy -msgid "_Tops" -msgstr "¤u¨ã (&_T)" - -#: src/stock.c:84 -msgid "Bottoms" -msgstr "" - -#: src/stock.c:85 -msgid "Centers" -msgstr "" - -#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 -msgid "Label Ce_nter" -msgstr "" - -#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 -msgid "Fill color" -msgstr "" - -#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 -msgid "Line color" -msgstr "" - -#: src/stock.c:90 src/stock.c:92 -#, fuzzy -msgid "Linked" -msgstr "½u" - -#: src/stock.c:91 src/stock.c:93 -#, fuzzy -msgid "Not Linked" -msgstr "¨S¦³" - -#: src/ui-property-bar.c:345 src/object-editor.c:499 -#, fuzzy -msgid "Default" -msgstr "§R°£" - -#: src/ui-property-bar.c:360 src/object-editor.c:512 -msgid "No fill" -msgstr "" - -#: src/ui-property-bar.c:375 src/object-editor.c:505 -#, fuzzy -msgid "No line" -msgstr "¨S¦³" - -#: src/ui-sidebar.c:180 -#, fuzzy -msgid "Object properties" -msgstr "¤å¦r¼Ë»ª" - -#: src/commands.c:385 -msgid "" -"A label and business card creation program for GNOME.\n" -" \n" -"Glabels is free software; you can redistribute it and/or modify it under the " -"terms of the GNU General Public License as published by the Free Software " -"Foundation; either version 2 of the License, or (at your option) any later " -"version.\n" -" \n" -"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.\n" -msgstr "" -"A label and business card creation program for GNOME.\n" -" \n" -"Glabels is free software; you can redistribute it and/or modify it under the " -"terms of the GNU General Public License as published by the Free Software " -"Foundation; either version 2 of the License, or (at your option) any later " -"version.\n" -" \n" -"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.\n" - -#: src/commands.c:399 -msgid "See the file AUTHORS for additional credits," -msgstr "" - -#: src/commands.c:400 -msgid "or visit http://glabels.sourceforge.net/" -msgstr "" - -#: src/commands.c:409 -msgid " " -msgstr "" - -#: src/commands.c:424 -#, fuzzy -msgid "glabels" -msgstr "¼Ðñ" - -#: src/file.c:100 -msgid "New Label or Card" -msgstr "·s¼W¼Ðñ©Î¥d" - -#: src/file.c:132 src/file.c:304 -msgid "Media Type" -msgstr "´CÅéºØÃþ" - -#: src/file.c:138 src/file.c:310 -msgid "Label orientation" -msgstr "¼Ðñ¤è¦V" - -#: src/file.c:269 -#, fuzzy -msgid "Label properties" -msgstr "¤å¦r¼Ë»ª" - -#: src/file.c:452 src/file.c:870 -msgid "All files" -msgstr "" - -#: src/file.c:457 src/file.c:875 -#, fuzzy -msgid "gLabels documents" -msgstr "Glabels: ³]©w­È" - -#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 -#, fuzzy -msgid "Empty file name selection" -msgstr "²¾°£©Ò¦³¿ï¾Ü¶µ" - -#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 -msgid "Please select a file or supply a valid file name" -msgstr "" - -#: src/file.c:519 src/file.c:631 -msgid "File does not exist" -msgstr "" - -#: src/file.c:563 data/ui/glabels-ui.xml.h:75 -msgid "Open" -msgstr "¶}±Ò" - -#: src/file.c:565 -msgid "Open label" -msgstr "¶}±Ò¼Ðñ" - -#: src/file.c:707 -#, fuzzy, c-format -msgid "Could not open file \"%s\"" -msgstr "¶}±ÒÀÉ®×¥¢±Ñ" - -#: src/file.c:715 -msgid "Not a supported file format" -msgstr "" - -#: src/file.c:797 src/file.c:979 src/file.c:1174 -#, fuzzy, c-format -msgid "Could not save file \"%s\"" -msgstr "¤£¯àÀx¦sÀÉ®×" - -#: src/file.c:805 src/file.c:987 src/file.c:1182 -msgid "Error encountered during save. The file is still not saved." -msgstr "" - -#: src/file.c:848 src/file.c:1048 -#, fuzzy, c-format -msgid "Save \"%s\" as" -msgstr "Àx¦s¼Ðñ¬°..." - -#: src/file.c:935 src/file.c:1131 -#, fuzzy -msgid "Please supply a valid file name" -msgstr "½Ð¥²»Ý¿é¤JÀɮצWºÙ" - -#: src/file.c:952 src/file.c:1147 -#, c-format -msgid "Overwrite file \"%s\"?" -msgstr "" - -#: src/file.c:960 src/file.c:1155 -msgid "File already exists." -msgstr "" - -#: src/file.c:1271 -#, c-format -msgid "Save changes to document \"%s\" before closing?" -msgstr "" - -#: src/file.c:1279 -msgid "Your changes will be lost if you don't save them." -msgstr "" - -#: src/file.c:1282 -msgid "Close without saving" -msgstr "" - -#. Should not happen -#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 -#: data/glade/object-editor.glade.h:37 -msgid "points" -msgstr "ÂI" - -#: src/prefs.c:158 data/glade/object-editor.glade.h:36 -#: data/glade/template-designer.glade.h:74 -msgid "inches" -msgstr "­^¤o" - -#: src/prefs.c:160 -msgid "mm" -msgstr "mm" - -#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 -#, fuzzy -msgid "gLabels Preferences" -msgstr "Glabels: ³]©w­È" - -#. -#. * Submenu: Order -#. -#: src/view.c:3570 data/ui/glabels-ui.xml.h:157 -msgid "_Order" -msgstr "" - -#. -#. * Submenu: Rotate/Flip -#. -#: src/view.c:3591 data/ui/glabels-ui.xml.h:163 -#, fuzzy -msgid "_Rotate/Flip" -msgstr "±ÛÂà" - -#. -#. * Submenu: Align Horizontally -#. -#: src/view.c:3624 -msgid "Align _Horizontally" -msgstr "" - -#. -#. * Submenu: Align Vertically -#. -#: src/view.c:3663 -msgid "Align _Vertically" -msgstr "" - -#: src/view.c:3724 data/ui/glabels-ui.xml.h:140 -#, fuzzy -msgid "_Delete" -msgstr "§R°£" - -#. Build editor. -#: src/view-box.c:223 -#, fuzzy -msgid "Box object properties" -msgstr "­×§ï¤è¶ôª«¥ó³]©w" - -#. Build editor. -#: src/view-ellipse.c:223 -#, fuzzy -msgid "Ellipse object properties" -msgstr "­×§ï¾ò¶êª«¥ó³]©w" - -#. Build editor. -#: src/view-line.c:223 -#, fuzzy -msgid "Line object properties" -msgstr "­×§ï¤è¶ôª«¥ó³]©w" - -#. Build editor. -#: src/view-image.c:222 -#, fuzzy -msgid "Image object properties" -msgstr "­×§ï¹Ï¹³ª«¥ó³]©w" - -#. Build editor. -#: src/view-text.c:250 -#, fuzzy -msgid "Text object properties" -msgstr "­×§ï¤è¶ôª«¥ó³]©w" - -#: src/view-text.c:562 data/glade/object-editor.glade.h:28 -msgid "Text" -msgstr "¤å¦r" - -#. Build editor. -#: src/view-barcode.c:209 -#, fuzzy -msgid "Barcode object properties" -msgstr "­×§ï¼Æ½X±øª«¥ó³]©w" - -#: src/view-barcode.c:579 src/print.c:1088 -#, fuzzy -msgid "Invalid barcode data" -msgstr "¤£¥¿½Tªº¼Æ½X±ø" - -#: src/merge-properties-dialog.c:231 -#, fuzzy -msgid "Merge Properties" -msgstr "¦X¨Ö³]©w" - -#. ---- Source section ---- -#: src/merge-properties-dialog.c:237 -msgid "Source" -msgstr "¨Ó·½ÀÉ" - -#: src/merge-properties-dialog.c:245 -msgid "Format:" -msgstr "®æ¦¡:" - -#. Location line -#: src/merge-properties-dialog.c:273 -msgid "Location:" -msgstr "¦ì¸m:" - -#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 -msgid "Select merge-database source" -msgstr "¿ï¾Ü¦X¨Ö¸ê®Æ®w¨Ó·½" - -#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 -msgid "N/A" -msgstr "N/A" - -#. ---- Sample Fields section ---- -#: src/merge-properties-dialog.c:300 -msgid "Record selection/preview:" -msgstr "" - -#: src/merge-properties-dialog.c:326 -msgid "Select" -msgstr "¿ï¾Ü" - -#: src/merge-properties-dialog.c:334 -msgid "Record/Field" -msgstr "" - -#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 -msgid "Data" -msgstr "¸ê®Æ" - -#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:82 -msgid "Print" -msgstr "¦C¦L" - -#: src/print-dialog.c:281 -msgid "_Job" -msgstr "" - -#: src/print-dialog.c:286 -#, fuzzy -msgid "P_rinter" -msgstr "¦C¦L" - -#. ----------- Add simple-copies widget ------------ -#: src/print-dialog.c:314 -msgid "Copies" -msgstr "¥÷¼Æ" - -#. ------- Add merge control widget ------------ -#: src/print-dialog.c:322 -msgid "Document merge control" -msgstr "¤å¥ó¦X¨Ö±±¨î" - -#. ----------- Add custom print options area ------------ -#: src/print-dialog.c:330 -msgid "Options" -msgstr "³]©w" - -#: src/print-dialog.c:351 -msgid "print crop marks" -msgstr "" - -#: src/print-dialog.c:553 src/print-dialog.c:592 -msgid "Print preview" -msgstr "¹wÄý¦C¦L" - -#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 -msgid "gLabels Template Designer" -msgstr "" - -#: src/bc.c:60 -msgid "POSTNET (any)" -msgstr "" - -#: src/bc.c:63 -msgid "POSTNET-5 (ZIP only)" -msgstr "" - -#: src/bc.c:66 -msgid "POSTNET-9 (ZIP+4)" -msgstr "" - -#: src/bc.c:69 -msgid "POSTNET-11 (DPBC)" -msgstr "" - -#: src/bc.c:72 -msgid "EAN (any)" -msgstr "" - -#: src/bc.c:75 -msgid "EAN-8" -msgstr "" - -#: src/bc.c:78 -msgid "EAN-8 +2" -msgstr "" - -#: src/bc.c:81 -msgid "EAN-8 +5" -msgstr "" - -#: src/bc.c:84 -msgid "EAN-13" -msgstr "" - -#: src/bc.c:87 -msgid "EAN-13 +2" -msgstr "" - -#: src/bc.c:90 -msgid "EAN-13 +5" -msgstr "" - -#: src/bc.c:93 -msgid "UPC (UPC-A or UPC-E)" -msgstr "" - -#: src/bc.c:96 -msgid "UPC-A" -msgstr "" - -#: src/bc.c:99 -msgid "UPC-A +2" -msgstr "" - -#: src/bc.c:102 -msgid "UPC-A +5" -msgstr "" - -#: src/bc.c:105 -msgid "UPC-E" -msgstr "" - -#: src/bc.c:108 -msgid "UPC-E +2" -msgstr "" - -#: src/bc.c:111 -msgid "UPC-E +5" -msgstr "" - -#: src/bc.c:114 -msgid "ISBN" -msgstr "" - -#: src/bc.c:117 -msgid "ISBN +5" -msgstr "" - -#: src/bc.c:120 -msgid "Code 39" -msgstr "" - -#: src/bc.c:123 -msgid "Code 128" -msgstr "" - -#: src/bc.c:126 -msgid "Code 128C" -msgstr "" - -#: src/bc.c:129 -msgid "Code 128B" -msgstr "" - -#: src/bc.c:132 -msgid "Interleaved 2 of 5" -msgstr "" - -#: src/bc.c:135 -msgid "Codabar" -msgstr "" - -#: src/bc.c:138 -msgid "MSI" -msgstr "" - -#: src/bc.c:141 -msgid "Plessey" -msgstr "" - -#: src/label.c:569 -msgid "Untitled" -msgstr "" - -#: src/xml-label.c:176 src/xml-label.c:213 -msgid "xmlParseFile error" -msgstr "xmlParseFile ¿ù»~" - -#: src/xml-label.c:250 -msgid "No document root" -msgstr "¨S¦³¤å¥ó©lºÝ" - -#: src/xml-label.c:264 -msgid "Importing from glabels 0.1 format" -msgstr "" - -#: src/xml-label.c:272 -msgid "Importing from glabels 0.4 format" -msgstr "" - -#: src/xml-label.c:279 -msgid "Importing from glabels 1.91 format" -msgstr "" - -#: src/xml-label.c:282 -#, fuzzy -msgid "bad document, unknown glabels Namespace" -msgstr "¤£¥¿½Tªº¤å¥óºØÃþ, §ä¤£¨ì glabels ®æ¦¡" - -#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 -#, c-format -msgid "Bad root node = \"%s\"" -msgstr "¿ù»~ªº°ò½X = \"%s\"" - -#: src/xml-label.c:348 src/xml-label-191.c:165 -#, fuzzy, c-format -msgid "bad node in Document node = \"%s\"" -msgstr "¿ù»~ªº°ò½X = \"%s\"" - -#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 -#, c-format -msgid "bad node = \"%s\"" -msgstr "¿ù»~ªº¸`ÂI = \"%s\"" - -#: src/xml-label.c:796 src/xml-label-191.c:605 -#, fuzzy, c-format -msgid "bad node in Data node = \"%s\"" -msgstr "¿ù»~ªº¸`ÂI = \"%s\"" - -#: src/xml-label.c:962 libglabels/xml-template.c:528 -msgid "Utf8 conversion error." -msgstr "" - -#: src/xml-label.c:969 libglabels/xml-template.c:535 -msgid "Problem saving xml file." -msgstr "Àx¦s XML Àɮ׮ɵo¥Í¿ù»~." - -#. This should always be an id, but just in case a name -#. slips by! -#: src/xml-label-191.c:680 libglabels/xml-template.c:192 -#, c-format -msgid "Unknown page size id \"%s\", trying as name" -msgstr "" - -#: src/xml-label-191.c:690 libglabels/xml-template.c:202 -#, c-format -msgid "Unknown page size id or name \"%s\"" -msgstr "" - -#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 -msgid "None" -msgstr "¨S¦³" - -#: src/merge-init.c:53 -#, fuzzy -msgid "Text file with comma delimeters (CSV)" -msgstr "¥H³r¸¹¤À®æ (CSV)" - -#: src/merge-init.c:60 -#, fuzzy -msgid "Text file with colon delimeters" -msgstr "¥H«_¸¹¤À®æ" - -#: src/merge-init.c:67 -#, fuzzy -msgid "Text file with tab delimeters" -msgstr "¥H [TAB] ¬°¤À®æ" - -#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 -#, fuzzy -msgid "File:" -msgstr "¶ñº¡" - -#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 -msgid "Key:" -msgstr "¸ê®Æ­È:" - -#: src/wdgt-print-copies.c:179 -msgid "Sheets:" -msgstr "¯È±i:" - -#: src/wdgt-print-copies.c:197 -msgid "Labels" -msgstr "¼Ðñ" - -#: src/wdgt-print-copies.c:200 -msgid "from:" -msgstr "¥Ñ:" - -#: src/wdgt-print-copies.c:207 -msgid "to:" -msgstr "¨ì:" - -#: src/wdgt-print-merge.c:178 -msgid "Start on label" -msgstr "¥Ñ¸Tñ¶}¯Å" - -#: src/wdgt-print-merge.c:186 -msgid "on 1st sheet" -msgstr "¦b­º±i¯È" - -#: src/wdgt-print-merge.c:195 -msgid "Copies:" -msgstr "¥÷¼Æ:" - -#: src/wdgt-print-merge.c:201 -msgid "Collate" -msgstr "®Õ¹ï" - -#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 -msgid "Description:" -msgstr "´y­z:" - -#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 -msgid "Page size:" -msgstr "¯È±i¤j¤p:" - -#: src/wdgt-media-select.c:290 -msgid "Label size:" -msgstr "¼Ðñ¤j¤p:" - -#: src/wdgt-media-select.c:301 -msgid "Layout:" -msgstr "ª©­±:" - -#: src/wdgt-media-select.c:578 -#, c-format -msgid "%d x %d (%d per sheet)" -msgstr "%d x %d (¨C­¶ %d)" - -#: src/wdgt-media-select.c:582 -#, fuzzy, c-format -msgid "%d per sheet" -msgstr "%d x %d (¨C­¶ %d)" - -#: src/wdgt-media-select.c:614 -#, c-format -msgid "%s x %s %s" -msgstr "%s x %s %s" - -#: src/wdgt-media-select.c:619 -#, c-format -msgid "%.5g x %.5g %s" -msgstr "%.5g x %.5g %s" - -#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 -#, c-format -msgid "%s %s diameter" -msgstr "" - -#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 -#, c-format -msgid "%.5g %s diameter" -msgstr "" - -#: src/wdgt-rotate-label.c:193 -msgid "Rotate" -msgstr "±ÛÂà" - -#. This is the default custom color -#: src/mygal/color-palette.c:396 -#, fuzzy -msgid "custom" -msgstr "¦Û­qÄæ¦ìÆ_" - -#. "Custom" color - we'll pop up a GnomeColorPicker -#: src/mygal/color-palette.c:438 -#, fuzzy -msgid "Custom Color:" -msgstr "ÃC¦â:" - -#: src/mygal/color-palette.c:446 -msgid "Choose Custom Color" -msgstr "" - -#: src/mygal/color-palette.c:579 -msgid "black" -msgstr "" - -#: src/mygal/color-palette.c:580 -msgid "light brown" -msgstr "" - -#: src/mygal/color-palette.c:581 -msgid "brown gold" -msgstr "" - -#: src/mygal/color-palette.c:582 -msgid "dark green #2" -msgstr "" - -#: src/mygal/color-palette.c:583 -msgid "navy" -msgstr "" - -#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 -msgid "dark blue" -msgstr "" - -#: src/mygal/color-palette.c:585 -msgid "purple #2" -msgstr "" - -#: src/mygal/color-palette.c:586 -msgid "very dark gray" -msgstr "" - -#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 -msgid "dark red" -msgstr "" - -#: src/mygal/color-palette.c:590 -msgid "red-orange" -msgstr "" - -#: src/mygal/color-palette.c:591 -msgid "gold" -msgstr "" - -#: src/mygal/color-palette.c:592 -msgid "dark green" -msgstr "" - -#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 -msgid "dull blue" -msgstr "" - -#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 -msgid "blue" -msgstr "" - -#: src/mygal/color-palette.c:595 -msgid "dull purple" -msgstr "" - -#: src/mygal/color-palette.c:596 -msgid "dark grey" -msgstr "" - -#: src/mygal/color-palette.c:599 -msgid "red" -msgstr "" - -#: src/mygal/color-palette.c:600 -msgid "orange" -msgstr "" - -#: src/mygal/color-palette.c:601 -msgid "lime" -msgstr "" - -#: src/mygal/color-palette.c:602 -msgid "dull green" -msgstr "" - -#: src/mygal/color-palette.c:603 -msgid "dull blue #2" -msgstr "" - -#: src/mygal/color-palette.c:604 -msgid "sky blue #2" -msgstr "" - -#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 -msgid "purple" -msgstr "" - -#: src/mygal/color-palette.c:606 -msgid "gray" -msgstr "" - -#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 -#, fuzzy -msgid "magenta" -msgstr "¹Ï¹³" - -#: src/mygal/color-palette.c:610 -msgid "bright orange" -msgstr "" - -#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 -msgid "yellow" -msgstr "" - -#: src/mygal/color-palette.c:612 -#, fuzzy -msgid "green" -msgstr "«×¼Æ" - -#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 -msgid "cyan" -msgstr "" - -#: src/mygal/color-palette.c:614 -msgid "bright blue" -msgstr "" - -#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 -msgid "red purple" -msgstr "" - -#: src/mygal/color-palette.c:616 -msgid "light grey" -msgstr "" - -#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 -msgid "pink" -msgstr "" - -#: src/mygal/color-palette.c:620 -msgid "light orange" -msgstr "" - -#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 -msgid "light yellow" -msgstr "" - -#: src/mygal/color-palette.c:622 -msgid "light green" -msgstr "" - -#: src/mygal/color-palette.c:623 -msgid "light cyan" -msgstr "" - -#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 -msgid "light blue" -msgstr "" - -#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 -msgid "light purple" -msgstr "" - -#: src/mygal/color-palette.c:626 -msgid "white" -msgstr "" - -#: src/mygal/color-palette.c:631 -msgid "purplish blue" -msgstr "" - -#: src/mygal/color-palette.c:635 -msgid "dark purple" -msgstr "" - -#: src/mygal/color-palette.c:637 -msgid "sky blue" -msgstr "" - -#: libglabels/template.c:848 -#, c-format -msgid "Generic %s full page" -msgstr "" - -#: libglabels/template.c:897 -msgid "No template files found!" -msgstr "§ä¤£¨ì¼Ëª©ÀÉ®× !" - -#. Create and append an "Other" entry. -#: libglabels/paper.c:67 -msgid "Other" -msgstr "" - -#: libglabels/paper.c:361 -#, fuzzy -msgid "No paper files found!" -msgstr "§ä¤£¨ì¼Ëª©ÀÉ®× !" - -#: data/ui/glabels-ui.xml.h:1 -msgid "About glabels" -msgstr "" - -#: data/ui/glabels-ui.xml.h:2 -msgid "About..." -msgstr "" - -#: data/ui/glabels-ui.xml.h:3 -msgid "Align _Horizontal" -msgstr "" - -#: data/ui/glabels-ui.xml.h:4 -msgid "Align _Vertical" -msgstr "" - -#: data/ui/glabels-ui.xml.h:5 -msgid "Align objects to bottoms" -msgstr "" - -#: data/ui/glabels-ui.xml.h:6 -msgid "Align objects to horizontal centers" -msgstr "" - -#: data/ui/glabels-ui.xml.h:7 -msgid "Align objects to left edges" -msgstr "" - -#: data/ui/glabels-ui.xml.h:8 -msgid "Align objects to right edges" -msgstr "" - -#: data/ui/glabels-ui.xml.h:9 -msgid "Align objects to tops" -msgstr "" - -#: data/ui/glabels-ui.xml.h:10 -msgid "Align objects to vertical centers" -msgstr "" - -#: data/ui/glabels-ui.xml.h:12 -msgid "Bold" -msgstr "" - -#: data/ui/glabels-ui.xml.h:14 -#, fuzzy -msgid "Center align" -msgstr "¤@¯ë" - -#: data/ui/glabels-ui.xml.h:15 -msgid "Center objects to horizontal label center" -msgstr "" - -#: data/ui/glabels-ui.xml.h:16 -msgid "Center objects to vertical label center" -msgstr "" - -#: data/ui/glabels-ui.xml.h:17 -msgid "Change the visibility of markup lines in the current window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:18 -msgid "Change the visibility of the drawing toolbar in the current window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:19 -msgid "Change the visibility of the grid in the current window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:20 -msgid "Change the visibility of the main toolbar in the current window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:21 -msgid "Change the visibility of the property toolbar in the current window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:22 -msgid "Close" -msgstr "" - -#: data/ui/glabels-ui.xml.h:23 -#, fuzzy -msgid "Close the current file" -msgstr "Àx¦s²{¦bÀÉ®×" - -#: data/ui/glabels-ui.xml.h:24 -msgid "Configure the application" -msgstr "" - -#: data/ui/glabels-ui.xml.h:25 -msgid "Contents" -msgstr "" - -#: data/ui/glabels-ui.xml.h:26 -msgid "Copy" -msgstr "" - -#: data/ui/glabels-ui.xml.h:27 -#, fuzzy -msgid "Copy the selection" -msgstr "²¾°£©Ò¦³¿ï¾Ü¶µ" - -#: data/ui/glabels-ui.xml.h:28 -#, fuzzy -msgid "Create a custom template" -msgstr "µe½uª«¥ó" - -#: data/ui/glabels-ui.xml.h:29 -#, fuzzy -msgid "Create a new document" -msgstr "µe½uª«¥ó" - -#: data/ui/glabels-ui.xml.h:30 -msgid "Create barcode object" -msgstr "«Ø¥ß¼Æ½X±ø" - -#: data/ui/glabels-ui.xml.h:31 -msgid "Create box/rectangle object" -msgstr "«Ø¥ß·sªº²°¤l/¤è§Îª«¥ó" - -#: data/ui/glabels-ui.xml.h:32 -msgid "Create ellipse/circle object" -msgstr "«Ø¥ß¾ò¶ê§Î/¹Ï§Îª«¥ó" - -#: data/ui/glabels-ui.xml.h:33 -msgid "Create image object" -msgstr "«Ø¥ß¼v¹³ª«¥ó" - -#: data/ui/glabels-ui.xml.h:34 -msgid "Create line object" -msgstr "µe½uª«¥ó" - -#: data/ui/glabels-ui.xml.h:35 -msgid "Create text object" -msgstr "«Ø¥ß·sªº¤å¦rª«¥ó" - -#: data/ui/glabels-ui.xml.h:36 -msgid "Cu_t" -msgstr "" - -#: data/ui/glabels-ui.xml.h:37 -#, fuzzy -msgid "Customize" -msgstr "¦Û­qÄæ¦ìÆ_" - -#: data/ui/glabels-ui.xml.h:38 -msgid "Customize Drawing Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:39 -msgid "Customize Main Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:40 -msgid "Customize Property Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:41 -msgid "Customize toolbars" -msgstr "" - -#: data/ui/glabels-ui.xml.h:42 -msgid "Cut" -msgstr "" - -#: data/ui/glabels-ui.xml.h:43 -msgid "Cut the selection" -msgstr "" - -#: data/ui/glabels-ui.xml.h:44 -msgid "Decrease magnification" -msgstr "" - -#: data/ui/glabels-ui.xml.h:45 -msgid "Delete" -msgstr "§R°£" - -#: data/ui/glabels-ui.xml.h:46 -#, fuzzy -msgid "Delete the selected objects" -msgstr "«Ø¥ß·sªº¤å¦rª«¥ó" - -#: data/ui/glabels-ui.xml.h:47 -msgid "Drawing toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:48 -msgid "Dump XML" -msgstr "" - -#: data/ui/glabels-ui.xml.h:49 -msgid "Dump the UI Xml description" -msgstr "" - -#: data/ui/glabels-ui.xml.h:50 -msgid "Edit merge properties" -msgstr "­×§ï¦X¨Ö³]©w" - -#: data/ui/glabels-ui.xml.h:54 -msgid "Flip object horizontally" -msgstr "" - -#: data/ui/glabels-ui.xml.h:55 -msgid "Flip object vertically" -msgstr "" - -#: data/ui/glabels-ui.xml.h:56 -#, fuzzy -msgid "Font name" -msgstr "¤£­nÀx¦s" - -#: data/ui/glabels-ui.xml.h:57 -#, fuzzy -msgid "Font selector" -msgstr "²¾°£©Ò¦³¿ï¾Ü¶µ" - -#: data/ui/glabels-ui.xml.h:58 -#, fuzzy -msgid "Font size" -msgstr "¤£­nÀx¦s" - -#: data/ui/glabels-ui.xml.h:59 -msgid "Icon and _Text" -msgstr "" - -#: data/ui/glabels-ui.xml.h:60 -msgid "Increase magnification" -msgstr "" - -#: data/ui/glabels-ui.xml.h:61 -msgid "Italic" -msgstr "" - -#: data/ui/glabels-ui.xml.h:63 -msgid "Left align" -msgstr "" - -#: data/ui/glabels-ui.xml.h:65 -msgid "Line width" -msgstr "" - -#: data/ui/glabels-ui.xml.h:66 -msgid "Lower object to bottom" -msgstr "" - -#: data/ui/glabels-ui.xml.h:67 -msgid "M_arkup" -msgstr "" - -#: data/ui/glabels-ui.xml.h:68 -msgid "Main toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:69 -msgid "Markup" -msgstr "" - -#: data/ui/glabels-ui.xml.h:70 -#, fuzzy -msgid "Modify document properties" -msgstr "­×§ï¤å¥ó¦X¨Ö³]©w" - -#: data/ui/glabels-ui.xml.h:71 -#, fuzzy -msgid "New" -msgstr "·s¼W (&_N)" - -#: data/ui/glabels-ui.xml.h:72 -#, fuzzy -msgid "Object property editor" -msgstr "¤å¦r¼Ë»ª" - -#: data/ui/glabels-ui.xml.h:73 -msgid "Only show icons in the drawing toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:74 -msgid "Only show icons in the main toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:76 -msgid "Open a file" -msgstr "¶}±ÒÀÉ®×" - -#: data/ui/glabels-ui.xml.h:77 -#, fuzzy -msgid "Open the glabels manual" -msgstr "¶}±Ò¼Ðñ" - -#: data/ui/glabels-ui.xml.h:78 -msgid "Paste" -msgstr "" - -#: data/ui/glabels-ui.xml.h:79 -msgid "Paste the clipboard" -msgstr "" - -#: data/ui/glabels-ui.xml.h:80 -#, fuzzy -msgid "Pr_eferences..." -msgstr "Glabels: ³]©w­È" - -#: data/ui/glabels-ui.xml.h:81 -#, fuzzy -msgid "Preferences" -msgstr "Glabels: ³]©w­È" - -#: data/ui/glabels-ui.xml.h:83 -#, fuzzy -msgid "Print the current file" -msgstr "¦C¦L²{¦³ÀÉ®×" - -#: data/ui/glabels-ui.xml.h:84 -#, fuzzy -msgid "Proper_ties..." -msgstr "¤å¦r¼Ë»ª" - -#: data/ui/glabels-ui.xml.h:85 -#, fuzzy -msgid "Properties" -msgstr "¤å¦r¼Ë»ª" - -#: data/ui/glabels-ui.xml.h:86 -msgid "Property toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:87 -msgid "Quit" -msgstr "" - -#: data/ui/glabels-ui.xml.h:88 -msgid "Quit the program" -msgstr "" - -#: data/ui/glabels-ui.xml.h:89 -msgid "Raise object to top" -msgstr "" - -#: data/ui/glabels-ui.xml.h:90 -msgid "Recent _Files" -msgstr "" - -#: data/ui/glabels-ui.xml.h:91 -msgid "Redo" -msgstr "" - -#: data/ui/glabels-ui.xml.h:92 -msgid "Redo the undone action" -msgstr "" - -#: data/ui/glabels-ui.xml.h:93 -msgid "Remove all selections" -msgstr "²¾°£©Ò¦³¿ï¾Ü¶µ" - -#: data/ui/glabels-ui.xml.h:95 -#, no-c-format -msgid "Restore scale to 100%" -msgstr "" - -#: data/ui/glabels-ui.xml.h:96 -msgid "Right align" -msgstr "" - -#: data/ui/glabels-ui.xml.h:99 -msgid "Rotate object 90 clockwise" -msgstr "" - -#: data/ui/glabels-ui.xml.h:100 -msgid "Rotate object 90 counter-clockwise" -msgstr "" - -#: data/ui/glabels-ui.xml.h:101 -#, fuzzy -msgid "Save" -msgstr "¥t¦s¬°..." - -#: data/ui/glabels-ui.xml.h:102 -msgid "Save As" -msgstr "¥t¦s¬°..." - -#: data/ui/glabels-ui.xml.h:103 -#, fuzzy -msgid "Save _As..." -msgstr "¥t¦s¬°..." - -#: data/ui/glabels-ui.xml.h:104 -#, fuzzy -msgid "Save the current file" -msgstr "Àx¦s²{¦bÀÉ®×" - -#: data/ui/glabels-ui.xml.h:105 -msgid "Save the current file with a different name" -msgstr "" - -#: data/ui/glabels-ui.xml.h:106 -#, fuzzy -msgid "Select All" -msgstr "¤Ï¿ï¾Ü¥þ³¡ (&_N)" - -#: data/ui/glabels-ui.xml.h:107 -#, fuzzy -msgid "Select _All" -msgstr "¤Ï¿ï¾Ü¥þ³¡ (&_N)" - -#: data/ui/glabels-ui.xml.h:108 -#, fuzzy -msgid "Select all objects" -msgstr "¿ï¾Ü, ²¾°Ê¤Î­×§ïª«¥ó" - -#: data/ui/glabels-ui.xml.h:109 -msgid "Select, move and modify objects" -msgstr "¿ï¾Ü, ²¾°Ê¤Î­×§ïª«¥ó" - -#: data/ui/glabels-ui.xml.h:111 -msgid "Set drawing toolbar button style according to desktop default" -msgstr "" - -#: data/ui/glabels-ui.xml.h:112 -msgid "Set main toolbar button style according to desktop default" -msgstr "" - -#: data/ui/glabels-ui.xml.h:113 -msgid "Show _Tooltips" -msgstr "" - -#: data/ui/glabels-ui.xml.h:114 -msgid "Show both icons and texts in the drawing toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:115 -msgid "Show both icons and texts in the main toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:116 -msgid "Show tooltips in the drawing toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:117 -msgid "Show tooltips in the main toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:118 -msgid "Show tooltips in the property toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:119 -msgid "Template Designer" -msgstr "" - -#: data/ui/glabels-ui.xml.h:120 -msgid "Template _Designer..." -msgstr "" - -#: data/ui/glabels-ui.xml.h:121 -msgid "Text color" -msgstr "" - -#: data/ui/glabels-ui.xml.h:122 -#, fuzzy -msgid "U_n-select All" -msgstr "¤Ï¿ï¾Ü¥þ³¡ (&_N)" - -#: data/ui/glabels-ui.xml.h:123 -#, fuzzy -msgid "Un-select All" -msgstr "¤Ï¿ï¾Ü¥þ³¡ (&_N)" - -#: data/ui/glabels-ui.xml.h:124 -msgid "Undo" -msgstr "" - -#: data/ui/glabels-ui.xml.h:125 -msgid "Undo the last action" -msgstr "" - -#: data/ui/glabels-ui.xml.h:126 -#, fuzzy -msgid "Zoom _1:1" -msgstr "1:1 Åã¥Ü" - -#: data/ui/glabels-ui.xml.h:127 -#, fuzzy -msgid "Zoom _In" -msgstr "©ñ¤j" - -#: data/ui/glabels-ui.xml.h:128 -#, fuzzy -msgid "Zoom _Out" -msgstr "ÁY¤p" - -#: data/ui/glabels-ui.xml.h:129 -#, fuzzy -msgid "Zoom to _fit" -msgstr "1:1 Åã¥Ü" - -#: data/ui/glabels-ui.xml.h:130 -msgid "Zoom to fit window" -msgstr "" - -#: data/ui/glabels-ui.xml.h:131 -msgid "_About..." -msgstr "" - -#: data/ui/glabels-ui.xml.h:132 -msgid "_Bottoms" -msgstr "" - -#: data/ui/glabels-ui.xml.h:135 -msgid "_Close" -msgstr "" - -#: data/ui/glabels-ui.xml.h:136 -msgid "_Contents" -msgstr "" - -#: data/ui/glabels-ui.xml.h:137 -msgid "_Copy" -msgstr "" - -#: data/ui/glabels-ui.xml.h:138 -#, fuzzy -msgid "_Create Object" -msgstr "«Ø¥ß·sªº¤å¦rª«¥ó" - -#: data/ui/glabels-ui.xml.h:139 -msgid "_Debug" -msgstr "" - -#: data/ui/glabels-ui.xml.h:141 -msgid "_Desktop Default" -msgstr "" - -#: data/ui/glabels-ui.xml.h:142 -msgid "_Drawing Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:143 -msgid "_Edit" -msgstr "" - -#: data/ui/glabels-ui.xml.h:145 -#, fuzzy -msgid "_File" -msgstr "¶ñº¡" - -#: data/ui/glabels-ui.xml.h:146 -msgid "_Grid" -msgstr "" - -#: data/ui/glabels-ui.xml.h:147 -msgid "_Help" -msgstr "" - -#: data/ui/glabels-ui.xml.h:148 -msgid "_Icon" -msgstr "" - -#: data/ui/glabels-ui.xml.h:152 -msgid "_Main Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:153 -#, fuzzy -msgid "_Merge Properties..." -msgstr "¦X¨Ö³]©w" - -#: data/ui/glabels-ui.xml.h:154 -msgid "_New" -msgstr "·s¼W (&_N)" - -#: data/ui/glabels-ui.xml.h:155 -msgid "_Objects" -msgstr "" - -#: data/ui/glabels-ui.xml.h:156 -#, fuzzy -msgid "_Open..." -msgstr "¶}±Ò" - -#: data/ui/glabels-ui.xml.h:158 -msgid "_Paste" -msgstr "" - -#: data/ui/glabels-ui.xml.h:159 -#, fuzzy -msgid "_Print..." -msgstr "¦C¦L" - -#: data/ui/glabels-ui.xml.h:160 -msgid "_Property Toolbar" -msgstr "" - -#: data/ui/glabels-ui.xml.h:161 -msgid "_Quit" -msgstr "" - -#: data/ui/glabels-ui.xml.h:164 -#, fuzzy -msgid "_Save" -msgstr "¥t¦s¬°..." - -#: data/ui/glabels-ui.xml.h:168 -#, fuzzy -msgid "_View" -msgstr "·s¼W (&_N)" - -#: data/glade/prefs-dialog.glade.h:1 -msgid " " -msgstr "" - -#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 -#: data/glade/template-designer.glade.h:5 -msgid "*" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:3 -msgid "Default page size" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:4 -msgid "Fill" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:5 -msgid "Line" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:6 -msgid "Text" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:7 -msgid "Units" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 -msgid "Alignment:" -msgstr "¹ï¸m:" - -#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 -msgid "Color:" -msgstr "ÃC¦â:" - -#: data/glade/prefs-dialog.glade.h:10 -msgid "Font:" -msgstr "¦r«¬:" - -#: data/glade/prefs-dialog.glade.h:11 -msgid "ISO A4" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:12 -msgid "Inches" -msgstr "­^¤o" - -#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 -msgid "Line Spacing:" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:14 -#, fuzzy -msgid "Locale" -msgstr "¤ñ¨Ò:" - -#: data/glade/prefs-dialog.glade.h:15 -msgid "Millimeters" -msgstr "²@¦Ì" - -#: data/glade/prefs-dialog.glade.h:16 -msgid "Object defaults" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:17 -msgid "Points" -msgstr "ÂI" - -#: data/glade/prefs-dialog.glade.h:18 -msgid "Select default properties for new objects." -msgstr "" - -#: data/glade/prefs-dialog.glade.h:19 -msgid "Select locale specific behavior." -msgstr "" - -#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:25 -msgid "US Letter" -msgstr "" - -#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 -#: data/glade/template-designer.glade.h:72 -msgid "Width:" -msgstr "Áï«×:" - -#: data/glade/object-editor.glade.h:2 -msgid "00000000000 00000" -msgstr "" - -#: data/glade/object-editor.glade.h:3 -msgid "Xxx object properties" -msgstr "" - -#: data/glade/object-editor.glade.h:5 -msgid "Allow merge to automatically shrink text" -msgstr "" - -#: data/glade/object-editor.glade.h:6 -msgid "Angle:" -msgstr "¨¤«×:" - -#: data/glade/object-editor.glade.h:7 -msgid "Checksum" -msgstr "" - -#: data/glade/object-editor.glade.h:10 -#, fuzzy -msgid "Family:" -msgstr "¶ñº¡" - -#: data/glade/object-editor.glade.h:12 -msgid "Fill" -msgstr "¶ñº¡" - -#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 -msgid "Height:" -msgstr "°ª«×:" - -#: data/glade/object-editor.glade.h:14 -msgid "Image" -msgstr "¹Ï¹³" - -#: data/glade/object-editor.glade.h:15 -msgid "Insert merge field" -msgstr "´¡¤J¦X¨Ö¦C" - -#: data/glade/object-editor.glade.h:17 -msgid "Length:" -msgstr "ªø«×:" - -#: data/glade/object-editor.glade.h:18 -msgid "Line" -msgstr "½u" - -#: data/glade/object-editor.glade.h:20 -msgid "Literal:" -msgstr "¤å¦r:" - -#: data/glade/object-editor.glade.h:21 -msgid "Load image" -msgstr "" - -#: data/glade/object-editor.glade.h:22 -msgid "Position" -msgstr "¦ì¸m" - -#: data/glade/object-editor.glade.h:23 -msgid "Reset image size" -msgstr "­«³]¹Ï¹³¤j¤p" - -#: data/glade/object-editor.glade.h:24 -msgid "Size" -msgstr "¤j¤p" - -#: data/glade/object-editor.glade.h:25 -#, fuzzy -msgid "Size:" -msgstr "¤j¤p" - -#: data/glade/object-editor.glade.h:26 -#, fuzzy -msgid "Style" -msgstr "¼Ë¦¡" - -#: data/glade/object-editor.glade.h:27 -#, fuzzy -msgid "Style:" -msgstr "¼Ë¦¡" - -#: data/glade/object-editor.glade.h:30 -msgid "X:" -msgstr "X:" - -#: data/glade/object-editor.glade.h:31 -msgid "Y:" -msgstr "Y:" - -#: data/glade/object-editor.glade.h:32 -msgid "degrees" -msgstr "«×¼Æ" - -#: data/glade/object-editor.glade.h:33 -msgid "dialog1" -msgstr "" - -#: data/glade/object-editor.glade.h:34 -msgid "digits:" -msgstr "" - -#: data/glade/object-editor.glade.h:35 -#, fuzzy -msgid "format:" -msgstr "®æ¦¡:" - -#: data/glade/template-designer.glade.h:1 -msgid " " -msgstr "" - -#: data/glade/template-designer.glade.h:2 -msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" -msgstr "" - -#: data/glade/template-designer.glade.h:3 -msgid "(e.g., 8163A)" -msgstr "" - -#: data/glade/template-designer.glade.h:4 -msgid "(e.g., Avery, Acme, ...)" -msgstr "" - -#: data/glade/template-designer.glade.h:6 -msgid "1. Outer radius:" -msgstr "" - -#: data/glade/template-designer.glade.h:7 -msgid "1. Radius:" -msgstr "" - -#: data/glade/template-designer.glade.h:8 -#, fuzzy -msgid "1. Width:" -msgstr "Áï«×:" - -#: data/glade/template-designer.glade.h:9 -#, fuzzy -msgid "2. Height:" -msgstr "°ª«×:" - -#: data/glade/template-designer.glade.h:10 -msgid "2. Inner radius:" -msgstr "" - -#: data/glade/template-designer.glade.h:11 -msgid "2. Waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:12 -msgid "3. Clipping width:" -msgstr "" - -#: data/glade/template-designer.glade.h:13 -msgid "3. Margin" -msgstr "" - -#: data/glade/template-designer.glade.h:14 -msgid "3. Round (radius of corner):" -msgstr "" - -#: data/glade/template-designer.glade.h:15 -msgid "4. Clipping height:" -msgstr "" - -#: data/glade/template-designer.glade.h:16 -msgid "4. Horiz. waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:17 -msgid "5. Vert. waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:18 -msgid "5. Waste (overprint allowed):" -msgstr "" - -#: data/glade/template-designer.glade.h:19 -msgid "6. Margin" -msgstr "" - -#: data/glade/template-designer.glade.h:20 -msgid "Brand/Manufacturer:" -msgstr "" - -#: data/glade/template-designer.glade.h:21 -msgid "CD/DVD (including credit card CDs)" -msgstr "" - -#: data/glade/template-designer.glade.h:22 -msgid "" -"Congratulations!\n" -"\n" -"You have completed the gLabels Template Designer.\n" -"If you wish to accept and save your design, click \"Apply.\"\n" -"\n" -"Otherwise, you may click \"Cancel\" to abandon your design\n" -"or \"Back\" to continue editing this design." -msgstr "" - -#: data/glade/template-designer.glade.h:30 -msgid "Design Completed" -msgstr "" - -#: data/glade/template-designer.glade.h:31 -msgid "Distance from left edge (x0):" -msgstr "" - -#: data/glade/template-designer.glade.h:32 -msgid "Distance from top edge (y0):" -msgstr "" - -#: data/glade/template-designer.glade.h:34 -msgid "Horizontal pitch (dx):" -msgstr "" - -#: data/glade/template-designer.glade.h:35 -msgid "" -"How many layouts will your template contain? \n" -"\n" -"A layout is a set of labels or cards that can be arranged in a simple grid.\n" -"Most templates only need one layout, as in the first example.\n" -"The second example illustrates when two layouts are needed." -msgstr "" - -#: data/glade/template-designer.glade.h:40 -msgid "Label Size (CD/DVD)" -msgstr "" - -#: data/glade/template-designer.glade.h:41 -#, fuzzy -msgid "Label Size (Round)" -msgstr "¼Ðñ¤j¤p:" - -#: data/glade/template-designer.glade.h:42 -#, fuzzy -msgid "Label or Card Shape" -msgstr "·s¼W¼Ðñ©Î¥d" - -#: data/glade/template-designer.glade.h:43 -msgid "Label or Card Size (Rectangular)" -msgstr "" - -#: data/glade/template-designer.glade.h:44 -#, fuzzy -msgid "Layout #1" -msgstr "ª©­±:" - -#: data/glade/template-designer.glade.h:45 -#, fuzzy -msgid "Layout #2" -msgstr "ª©­±:" - -#: data/glade/template-designer.glade.h:46 -#, fuzzy -msgid "Layout(s)" -msgstr "ª©­±:" - -#: data/glade/template-designer.glade.h:47 -#, fuzzy -msgid "Name and Description" -msgstr "´y­z:" - -#: data/glade/template-designer.glade.h:48 -msgid "Number across (nx):" -msgstr "" - -#: data/glade/template-designer.glade.h:49 -msgid "Number down (ny):" -msgstr "" - -#: data/glade/template-designer.glade.h:50 -msgid "Number of Layouts" -msgstr "" - -#: data/glade/template-designer.glade.h:51 -msgid "Number of layouts:" -msgstr "" - -#: data/glade/template-designer.glade.h:52 -#, fuzzy -msgid "Page Size" -msgstr "¯È±i¤j¤p:" - -#: data/glade/template-designer.glade.h:54 -msgid "Part #:" -msgstr "" - -#: data/glade/template-designer.glade.h:55 -msgid "" -"Please enter the following identifying information about the template " -"stationery." -msgstr "" - -#: data/glade/template-designer.glade.h:56 -msgid "Please enter the following layout information." -msgstr "" - -#: data/glade/template-designer.glade.h:57 -msgid "" -"Please enter the following size parameters of a single label in your " -"template." -msgstr "" - -#: data/glade/template-designer.glade.h:58 -msgid "" -"Please enter the following size parameters of a single label or card in your " -"template." -msgstr "" - -#: data/glade/template-designer.glade.h:59 -msgid "Please select the basic shape of the labels or cards." -msgstr "" - -#: data/glade/template-designer.glade.h:60 -msgid "Please select the page size of the template stationery." -msgstr "" - -#: data/glade/template-designer.glade.h:61 -#, fuzzy -msgid "Print test sheet" -msgstr "¦b­º±i¯È" - -#: data/glade/template-designer.glade.h:62 -msgid "Rectangular or square (can have rounded corners)" -msgstr "" - -#: data/glade/template-designer.glade.h:63 -msgid "Round" -msgstr "" - -#: data/glade/template-designer.glade.h:64 -msgid "" -"Templates needing\n" -"two layouts." -msgstr "" - -#: data/glade/template-designer.glade.h:66 -msgid "" -"Templates needing only\n" -"one layout." -msgstr "" - -#: data/glade/template-designer.glade.h:68 -msgid "Vertical pitch (dy):" -msgstr "" - -#: data/glade/template-designer.glade.h:69 -msgid "" -"Welcome to the gLabels Template Designer.\n" -"\n" -"This dialog will assist you in the creation of a custom gLabels template." -msgstr "" - -#: data/templates/paper-sizes.xml.h:1 -msgid "A0" -msgstr "" - -#: data/templates/paper-sizes.xml.h:2 -msgid "A1" -msgstr "" - -#: data/templates/paper-sizes.xml.h:3 -msgid "A10" -msgstr "" - -#: data/templates/paper-sizes.xml.h:4 -msgid "A2" -msgstr "" - -#: data/templates/paper-sizes.xml.h:5 -msgid "A3" -msgstr "" - -#: data/templates/paper-sizes.xml.h:6 -msgid "A4" -msgstr "" - -#: data/templates/paper-sizes.xml.h:7 -msgid "A5" -msgstr "" - -#: data/templates/paper-sizes.xml.h:8 -msgid "A6" -msgstr "" - -#: data/templates/paper-sizes.xml.h:9 -msgid "A7" -msgstr "" - -#: data/templates/paper-sizes.xml.h:10 -msgid "A8" -msgstr "" - -#: data/templates/paper-sizes.xml.h:11 -msgid "A9" -msgstr "" - -#: data/templates/paper-sizes.xml.h:12 -msgid "B0" -msgstr "" - -#: data/templates/paper-sizes.xml.h:13 -msgid "B1" -msgstr "" - -#: data/templates/paper-sizes.xml.h:14 -msgid "B10" -msgstr "" - -#: data/templates/paper-sizes.xml.h:15 -msgid "B2" -msgstr "" - -#: data/templates/paper-sizes.xml.h:16 -msgid "B3" -msgstr "" - -#: data/templates/paper-sizes.xml.h:17 -msgid "B4" -msgstr "" - -#: data/templates/paper-sizes.xml.h:18 -msgid "B5" -msgstr "" - -#: data/templates/paper-sizes.xml.h:19 -msgid "B6" -msgstr "" - -#: data/templates/paper-sizes.xml.h:20 -msgid "B7" -msgstr "" - -#: data/templates/paper-sizes.xml.h:21 -msgid "B8" -msgstr "" - -#: data/templates/paper-sizes.xml.h:22 -msgid "B9" -msgstr "" - -#: data/templates/paper-sizes.xml.h:23 -msgid "US Executive" -msgstr "" - -#: data/templates/paper-sizes.xml.h:24 -msgid "US Legal" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:1 -#: data/templates/zweckform-iso-templates.xml.h:1 -msgid "Address Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:2 -#: data/templates/avery-iso-templates.xml.h:2 -#: data/templates/zweckform-iso-templates.xml.h:3 -#: data/templates/misc-us-templates.xml.h:2 -#: data/templates/misc-iso-templates.xml.h:9 -msgid "Business Cards" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:3 -msgid "CD/DVD Labels (Disc Labels)" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:4 -msgid "Diskette Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:5 -#, fuzzy -msgid "Filing Labels" -msgstr "¼Ðñ" - -#: data/templates/avery-us-templates.xml.h:6 -msgid "Full Sheet Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:7 -#, fuzzy -msgid "Large Round Labels" -msgstr "¥Ñ¸Tñ¶}¯Å" - -#: data/templates/avery-us-templates.xml.h:8 -msgid "Name Badge Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:9 -msgid "Return Address Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:10 -msgid "Shipping Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:11 -#, fuzzy -msgid "Small Round Labels" -msgstr "¥Ñ¸Tñ¶}¯Å" - -#: data/templates/avery-us-templates.xml.h:12 -#, fuzzy -msgid "Square Labels" -msgstr "¼Ðñ" - -#: data/templates/avery-us-templates.xml.h:13 -msgid "Video Tape Face Labels" -msgstr "" - -#: data/templates/avery-us-templates.xml.h:14 -msgid "Video Tape Spine Labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:1 -msgid "Address labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:3 -msgid "CD Booklet" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:4 -msgid "CD Inlet" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:5 -#: data/templates/zweckform-iso-templates.xml.h:4 -#: data/templates/misc-us-templates.xml.h:4 -#: data/templates/misc-iso-templates.xml.h:10 -#, fuzzy -msgid "CD/DVD Labels" -msgstr "¼Ðñ" - -#: data/templates/avery-iso-templates.xml.h:6 -msgid "Diskette labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:7 -#: data/templates/zweckform-iso-templates.xml.h:7 -#: data/templates/misc-iso-templates.xml.h:17 -msgid "Mailing Labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:8 -#, fuzzy -msgid "Mailing labels" -msgstr "¼Ðñ" - -#: data/templates/avery-iso-templates.xml.h:9 -msgid "Mini Address Labels" -msgstr "" - -#: data/templates/avery-iso-templates.xml.h:10 -#, fuzzy -msgid "Shipping labels" -msgstr "¶}±Ò¼Ðñ" - -#: data/templates/zweckform-iso-templates.xml.h:2 -msgid "Allround Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:5 -msgid "Correction and Cover-up Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:6 -msgid "Lever Arch File Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:8 -msgid "QSL-Karten Etiketten 70mm x 50,8mm" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:9 -msgid "Rectangular Copier Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:10 -#: data/templates/misc-iso-templates.xml.h:22 -msgid "Rectangular Labels" -msgstr "" - -#: data/templates/zweckform-iso-templates.xml.h:11 -msgid "Video Labels (back)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:1 -msgid "Business Card CD" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:3 -msgid "CD Template Rectangles" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:5 -msgid "CD/DVD Labels (Face Only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:6 -#: data/templates/misc-iso-templates.xml.h:11 -msgid "CD/DVD Labels (face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:7 -#, fuzzy -msgid "DLT Labels" -msgstr "¼Ðñ" - -#: data/templates/misc-us-templates.xml.h:8 -msgid "Microtube labels" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:9 -msgid "Mini-CD Labels" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:10 -msgid "PRO CD Labels 2-up (CD spine only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:11 -msgid "PRO CD Labels 2-up (Face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:12 -#: data/templates/misc-iso-templates.xml.h:21 -msgid "PRO CD Labels 2-up (face only)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:13 -msgid "Slimline CD Case (rightside up)" -msgstr "" - -#: data/templates/misc-us-templates.xml.h:14 -msgid "Slimline CD Case (upside down)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:1 -msgid "Agipa 119488: Business Cards" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:2 -msgid "Allround Labels --24" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:3 -msgid "Allround Labels --44" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:4 -msgid "Allround Labels --64" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:5 -msgid "Allround Labels --65" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:6 -msgid "Arch File Labels" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:7 -msgid "Arch File Labels (large)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:8 -msgid "Arch File Labels (small)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:12 -msgid "CD/DVD Labels Standard Format (face only)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:13 -msgid "Diskette Labels (face only)" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:14 -msgid "EPSON Photo Stickers 16" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:15 -msgid "Etiketten" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:16 -msgid "Fridge Magnet Stickers" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:18 -msgid "Mailing Labels --14" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:19 -msgid "Mailing Labels-2 columns" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:20 -msgid "Mailing Labels-3 columns" -msgstr "" - -#: data/templates/misc-iso-templates.xml.h:23 -msgid "Video Labels (face only)" -msgstr "" - -#: data/desktop/glabels.desktop.in.h:1 -msgid "Create labels, business cards and media covers." -msgstr "" - -#: data/desktop/glabels.desktop.in.h:2 -msgid "gLabels Label Designer" -msgstr "" - -#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 -#, fuzzy -msgid "gLabels Project File" -msgstr "¤å¦r¼Ë»ª" - -#, fuzzy -#~ msgid "Object _Properties..." -#~ msgstr "¤å¦r¼Ë»ª" - -#~ msgid "Display units" -#~ msgstr "Åã¥Ü³æ¦ì" - -#~ msgid "Default page size" -#~ msgstr "¹w³]¯È±i¤j¤p" - -#~ msgid "Outline" -#~ msgstr "¥~Ãä" - -#~ msgid "Edit line object properties" -#~ msgstr "­×§ï½uª«¥óªº³]©w" - -#~ msgid "Edit text object properties" -#~ msgstr "­×§ï¤å¦rª«¥óªº³]©w" - -#~ msgid "Maintain current aspect ratio" -#~ msgstr "«O¯d²{¦³ªº¤j¤p¤ñ¨Ò" - -#, fuzzy -#~ msgid "CD Labels" -#~ msgstr "¼Ðñ" - -#, fuzzy -#~ msgid "Open %s" -#~ msgstr "¶}±Ò" - -#~ msgid "Revert to saved copy of %s?" -#~ msgstr "­n¸ü¤J¤wÀx¦sªº³Æ¥÷ %s ?" - -#~ msgid "Unknown media type. Using default." -#~ msgstr "¤£©úªº´CÅéÃþ§Î. ¨Ï¥Î¹w³]." - -#~ msgid "" -#~ "``%s'' has been modified.\n" -#~ "\n" -#~ "Do you wish to save it?" -#~ msgstr "" -#~ "``%s`` ¤w³Q­×§ï.\n" -#~ "\n" -#~ "­n²{¦bÀx¦s¶Ü ?" - -#~ msgid "Close / Save label as" -#~ msgstr "Ãö³¬ / Àx¦s¼Ðñ¬°..." - -#~ msgid "Label no longer valid!" -#~ msgstr "¼Ðñ¨Ã¤£¬O¥¿½T¥iŪªº !" - -#~ msgid "Error writing file" -#~ msgstr "¦b¼g¤JÀɮ׮ɵo¥Í¿ù»~" - -#~ msgid "Edit properties..." -#~ msgstr "­×§ï³]©w..." - -#~ msgid "Appearance" -#~ msgstr "¼Ë»ª" - -#~ msgid "Position/Size" -#~ msgstr "¦ì¸m/¤j¤p" - -#~ msgid "Image format not currently supported" -#~ msgstr "¹Ï¹³®æ¦¡¨Ã¨S¦³¤ä´©" - -#~ msgid "Barcode data" -#~ msgstr "¼Æ½X±ø¸ê®Æ" - -#~ msgid "%" -#~ msgstr "%" - -#~ msgid "Show text with barcode" -#~ msgstr "Åã¥Ü¼Æ½X±ø¤å¦r" - -#~ msgid "Fields" -#~ msgstr "Äæ¦ì" - -#~ msgid "Column" -#~ msgstr "¦C" - -#~ msgid "Sample data" -#~ msgstr "¼Ë¥»¸ê®Æ" - -#~ msgid "Make a new, empty label" -#~ msgstr "»s§@·sÀÉ, ªÅªº¼Ëñ" - -#~ msgid " New " -#~ msgstr " ·s¼W " - -#~ msgid "New Label/Card" -#~ msgstr "·s¼W¼Ðñ/¥d" - -#~ msgid " Open " -#~ msgstr " ¶}±Ò " - -#~ msgid " Save " -#~ msgstr " Àx¦s " - -#~ msgid " Print " -#~ msgstr " ¦C¦L " - -#~ msgid "Function is not implemented!" -#~ msgstr "¥\¯à¥¼§¹¦¨ !" diff --git a/glabels2/src/Makefile.am b/glabels2/src/Makefile.am deleted file mode 100644 index d687e1ba..00000000 --- a/glabels2/src/Makefile.am +++ /dev/null @@ -1,289 +0,0 @@ -LIB_BARCODE_DIR = ../barcode-0.98 -LIB_IEC16022_DIR = ../iec16022-0.2.1 - -SUBDIRS= pixmaps stock-pixmaps mygal - -bin_PROGRAMS = glabels glabels-batch - -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_builddir) \ - -I$(LIB_BARCODE_DIR) \ - -I$(LIB_IEC16022_DIR) \ - $(GLABELS_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) \ - -DPREFIX=\""$(prefix)"\" \ - -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -DDATADIR=\""$(datadir)"\" \ - -DLIBDIR=\""$(libdir)"\" \ - -DGLABELS_LOCALEDIR=\""$(datadir)/locale"\" \ - -DGLABELS_GLADE_DIR=\""$(datadir)/glabels/glade/"\" \ - -DGLABELS_ICON_DIR=\""$(datadir)/pixmaps/"\" \ - -DGLABELS_PIXMAP_DIR=\""$(datadir)/pixmaps/glabels/"\" \ - -DG_LOG_DOMAIN=\""glabels\"" - -glabels_LDFLAGS = -export-dynamic - -glabels_LDADD = \ - $(GLABELS_LIBS) \ - ../libglabels/libglabels.la \ - mygal/libmygal.la \ - $(LIB_BARCODE_DIR)/libbarcode.la \ - $(LIB_IEC16022_DIR)/libiec16022.la - -glabels_batch_LDFLAGS = -export-dynamic - -glabels_batch_LDADD = \ - $(GLABELS_LIBS) \ - ../libglabels/libglabels.la \ - $(LIB_BARCODE_DIR)/libbarcode.la \ - $(LIB_IEC16022_DIR)/libiec16022.la - -BUILT_SOURCES = \ - marshal.c \ - marshal.h - -glabels_SOURCES = \ - glabels.c \ - warning-handler.c \ - warning-handler.h \ - critical-error-handler.c \ - critical-error-handler.h \ - window.c \ - window.h \ - stock.c \ - stock.h \ - ui.h \ - ui.c \ - ui-util.h \ - ui-util.c \ - ui-commands.h \ - ui-commands.c \ - ui-property-bar.h \ - ui-property-bar.c \ - ui-sidebar.h \ - ui-sidebar.c \ - file.h \ - file.c \ - new-label-dialog.h \ - new-label-dialog.c \ - recent.h \ - recent.c \ - prefs.c \ - prefs.h \ - prefs-model.c \ - prefs-model.h \ - prefs-dialog.c \ - prefs-dialog.h \ - hig.h \ - view.c \ - view.h \ - view-object.c \ - view-object.h \ - view-box.c \ - view-box.h \ - view-ellipse.c \ - view-ellipse.h \ - view-line.c \ - view-line.h \ - view-image.c \ - view-image.h \ - view-text.c \ - view-text.h \ - view-barcode.c \ - view-barcode.h \ - merge-properties-dialog.c \ - merge-properties-dialog.h \ - object-editor.c \ - object-editor.h \ - object-editor-private.h \ - object-editor-position-page.c \ - object-editor-size-page.c \ - object-editor-lsize-page.c \ - object-editor-line-page.c \ - object-editor-fill-page.c \ - object-editor-image-page.c \ - object-editor-text-page.c \ - object-editor-edit-page.c \ - object-editor-bc-page.c \ - object-editor-data-page.c \ - object-editor-shadow-page.c \ - print.c \ - print.h \ - print-op.c \ - print-op.h \ - template-designer.c \ - template-designer.h \ - bc.c \ - bc.h \ - bc-gnubarcode.c \ - bc-gnubarcode.h \ - bc-postnet.c \ - bc-postnet.h \ - bc-iec16022.c \ - bc-iec16022.h \ - label.c \ - label.h \ - label-object.c \ - label-object.h \ - label-text.c \ - label-text.h \ - label-box.c \ - label-box.h \ - label-line.c \ - label-line.h \ - label-ellipse.c \ - label-ellipse.h \ - label-image.c \ - label-image.h \ - label-barcode.c \ - label-barcode.h \ - xml-label.c \ - xml-label.h \ - xml-label-04.c \ - xml-label-04.h \ - pixbuf-cache.c \ - pixbuf-cache.h \ - base64.c \ - base64.h \ - merge.c \ - merge.h \ - merge-init.c \ - merge-init.h \ - merge-text.c \ - merge-text.h \ - merge-evolution.c \ - merge-evolution.h \ - merge-vcard.c \ - merge-vcard.h \ - text-node.c \ - text-node.h \ - mini-preview-pixbuf.c \ - mini-preview-pixbuf.h \ - mini-preview-pixbuf-cache.c \ - mini-preview-pixbuf-cache.h \ - wdgt-print-copies.c \ - wdgt-print-copies.h \ - wdgt-print-merge.c \ - wdgt-print-merge.h \ - wdgt-media-select.c \ - wdgt-media-select.h \ - wdgt-mini-preview.c \ - wdgt-mini-preview.h \ - wdgt-rotate-label.c \ - wdgt-rotate-label.h \ - wdgt-chain-button.c \ - wdgt-chain-button.h \ - cairo-label-path.c \ - cairo-label-path.h \ - cairo-markup-path.c \ - cairo-markup-path.h \ - cairo-ellipse-path.c \ - cairo-ellipse-path.h \ - util.c \ - util.h \ - color.c \ - color.h \ - debug.c \ - debug.h \ - $(BUILT_SOURCES) - - -glabels_batch_SOURCES = \ - glabels-batch.c \ - print.c \ - print.h \ - print-op.c \ - print-op.h \ - bc.c \ - bc.h \ - bc-gnubarcode.c \ - bc-gnubarcode.h \ - bc-postnet.c \ - bc-postnet.h \ - bc-iec16022.c \ - bc-iec16022.h \ - label.c \ - label.h \ - label-object.c \ - label-object.h \ - label-text.c \ - label-text.h \ - label-box.c \ - label-box.h \ - label-line.c \ - label-line.h \ - label-ellipse.c \ - label-ellipse.h \ - label-image.c \ - label-image.h \ - label-barcode.c \ - label-barcode.h \ - xml-label.c \ - xml-label.h \ - xml-label-04.c \ - xml-label-04.h \ - pixbuf-cache.c \ - pixbuf-cache.h \ - base64.c \ - base64.h \ - merge.c \ - merge.h \ - merge-init.c \ - merge-init.h \ - merge-text.c \ - merge-text.h \ - merge-evolution.c \ - merge-evolution.h \ - merge-vcard.c \ - merge-vcard.h \ - text-node.c \ - text-node.h \ - prefs.c \ - prefs.h \ - prefs-model.c \ - prefs-model.h \ - util.c \ - util.h \ - color.c \ - color.h \ - debug.c \ - debug.h \ - wdgt-print-copies.c \ - wdgt-print-copies.h \ - wdgt-print-merge.c \ - wdgt-print-merge.h \ - wdgt-mini-preview.c \ - wdgt-mini-preview.h \ - hig.h \ - cairo-label-path.c \ - cairo-label-path.h \ - cairo-ellipse-path.c \ - cairo-ellipse-path.h \ - $(BUILT_SOURCES) - -marshal.h: marshal.list $(GLIB_GENMARSHAL) - $(GLIB_GENMARSHAL) $< --header --prefix=gl_marshal > $@ - -marshal.c: marshal.list $(GLIB_GENMARSHAL) - echo "#include \"marshal.h\"" > $@ && \ - $(GLIB_GENMARSHAL) $< --body --prefix=gl_marshal >> $@ - -EXTRA_DIST = \ - marshal.list - -CLEANFILES = $(BUILT_SOURCES) - -$(bin_PROGRAMS): $(LIB_BARCODE_DIR)/libbarcode.la \ - $(LIB_IEC16022_DIR)/libiec16022.la \ - ../libglabels/libglabels.la - -$(LIB_BARCODE_DIR)/libbarcode.la: - cd $(LIB_BARCODE_DIR); $(MAKE) - -$(LIB_IEC16022_DIR)/libiec16022.la: - cd $(LIB_IEC16022_DIR); $(MAKE) - -../libglabels/libglabels.la: - cd ../libglabels; $(MAKE) - diff --git a/glabels2/src/base64.c b/glabels2/src/base64.c deleted file mode 100644 index b3de985b..00000000 --- a/glabels2/src/base64.c +++ /dev/null @@ -1,204 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * base64.c: GLabels base64 encode/decode module - * - * Copyright (C) 2003 Jim Evins - * - * This module is based on base64.c from fetchmail: - * - * Copyright (C)2002 by Eric S. Raymond. - * Portions are copyrighted by Carl E. Harris and George M. Sipe. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * This base 64 encoding is defined in RFC2045 section 6.8. - */ -#include - -#include "base64.h" - -#include -#include -#include - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -#define LINE_LENGTH 76 /* Must be <= 76 and must be a multiple of 4 */ -#define BAD -1 - -#define DECODE64(c) (isascii(c) ? base64val[c] : BAD) - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -static const gchar base64digits[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -static const gchar base64val[] = { - BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, - BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, - BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD, 62, BAD,BAD,BAD, 63, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,BAD,BAD, BAD,BAD,BAD,BAD, - BAD, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,BAD, BAD,BAD,BAD,BAD, - BAD, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,BAD, BAD,BAD,BAD,BAD -}; - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - - -/*****************************************************************************/ -/* Encode to Base64 string. */ -/*****************************************************************************/ -gchar * -gl_base64_encode (const guchar *in, guint inlen) -{ - gchar *out, *p_out; - gint buf_size; - gint i; - - /* Calculate output buffer size */ - buf_size = 4*((inlen+2)/3); /* Encoded characters */ - buf_size += buf_size / LINE_LENGTH + 2; /* Line breaks */ - buf_size += 1; /* null termination */ - - /* Allocate output buffer */ - out = g_new0 (gchar, buf_size); - p_out=out; - - /* Now do the encoding */ - *p_out++ = '\n'; - for ( i=0; inlen >= 3; inlen-=3 ) { - - *p_out++ = base64digits[in[0] >> 2]; - *p_out++ = base64digits[((in[0] << 4) & 0x30) | (in[1] >> 4)]; - *p_out++ = base64digits[((in[1] << 2) & 0x3c) | (in[2] >> 6)]; - *p_out++ = base64digits[in[2] & 0x3f]; - in += 3; - - i += 4; - if ( (i % LINE_LENGTH) == 0 ) { - *p_out++ = '\n'; - } - - } - if (inlen > 0) { - guchar fragment; - - *p_out++ = base64digits[in[0] >> 2]; - fragment = (in[0] << 4) & 0x30; - if (inlen > 1) - fragment |= in[1] >> 4; - *p_out++ = base64digits[fragment]; - *p_out++ = (inlen < 2) ? '=' : base64digits[(in[1] << 2) & 0x3c]; - *p_out++ = '='; - - *p_out++ = '\n'; - } - *p_out++ = '\0'; - - return out; -} - -/*****************************************************************************/ -/* Decode from a Base64 string. */ -/*****************************************************************************/ -guchar * -gl_base64_decode (const gchar *in, guint *outlen) -{ - gchar *out, *p_out; - gint buf_size; - register guchar digit1, digit2, digit3, digit4; - - /* Calculate output buffer size */ - buf_size = strlen (in) * 3 / 4; - - /* Allocate output buffer */ - out = g_new0 (gchar, buf_size); - - *outlen = 0; - p_out = out; - - /* Skip non-printable characters */ - while ( (*in == '\n') || (*in == '\r') || (*in == ' ') ) { - in ++; - } - if (!*in) { - g_free (out); - return NULL; - } - - /* Now do the decoding */ - do { - digit1 = in[0]; - if (DECODE64(digit1) == BAD) { - g_free (out); - return NULL; - } - digit2 = in[1]; - if (DECODE64(digit2) == BAD) { - g_free (out); - return NULL; - } - digit3 = in[2]; - if (digit3 != '=' && DECODE64(digit3) == BAD) { - g_free (out); - return NULL; - } - digit4 = in[3]; - if (digit4 != '=' && DECODE64(digit4) == BAD) { - g_free (out); - return NULL; - } - in += 4; - - *p_out++ = (DECODE64(digit1)<<2) | (DECODE64(digit2) >> 4); - (*outlen)++; - if (digit3 != '=') - { - *p_out++ = ((DECODE64(digit2)<<4)&0xf0) | (DECODE64(digit3)>>2); - (*outlen)++; - if (digit4 != '=') - { - *p_out++ = ((DECODE64(digit3)<<6)&0xc0) | DECODE64(digit4); - (*outlen)++; - } - } - - /* Skip non-printable characters */ - while ( (*in == '\n') || (*in == '\r') || (*in == ' ') ) { - in ++; - } - - } while (*in && digit4 != '='); - - return (guchar *)out; -} - diff --git a/glabels2/src/base64.h b/glabels2/src/base64.h deleted file mode 100644 index 420d2a4c..00000000 --- a/glabels2/src/base64.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * base64.h: GLabels base64 encode/decode module - * - * Copyright (C) 2003 Jim Evins - * - * This module is based on base64.c from fetchmail: - * - * Copyright (C)2002 by Eric S. Raymond. - * Portions are copyrighted by Carl E. Harris and George M. Sipe. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __BASE64_H__ -#define __BASE64_H__ - -#include - -G_BEGIN_DECLS - -gchar *gl_base64_encode (const guchar *in, - guint inlen); - -guchar *gl_base64_decode (const gchar *in, - guint *outlen); - -G_END_DECLS - -#endif - diff --git a/glabels2/src/bc-gnubarcode.c b/glabels2/src/bc-gnubarcode.c deleted file mode 100644 index 2c84114b..00000000 --- a/glabels2/src/bc-gnubarcode.c +++ /dev/null @@ -1,459 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * bc-gnubarcode.c: front-end to GNU-barcode-library module - * - * Copyright (C) 2001-2003 Jim Evins . - * - * Some of this code is borrowed from the postscript renderer (ps.c) - * from the GNU barcode library: - * - * Copyright (C) 1999 Alessaandro Rubini (rubini@gnu.org) - * Copyright (C) 1999 Prosa Srl. (prosa@prosa.it) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "bc-gnubarcode.h" - -#include -#include -#include -#include -#include - -#include "barcode.h" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ -#define SHRINK_AMOUNT 0.15 /* shrink bars to account for ink spreading */ -#define FONT_SCALE 0.95 /* Shrink fonts just a hair */ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ -static glBarcode *render_pass1 (struct Barcode_Item *bci, - gint flags); - -static gboolean is_length_valid (const gchar *digits, - gint n1, - gint n2); - -static gboolean is_length1_valid (const gchar *digits, - gint n1, - gint n2); - -static gboolean is_length2_valid (const gchar *digits, - gint n1, - gint n2); - - -/*****************************************************************************/ -/* Generate intermediate representation of barcode. */ -/*****************************************************************************/ -glBarcode * -gl_barcode_gnubarcode_new (const gchar *id, - gboolean text_flag, - gboolean checksum_flag, - gdouble w, - gdouble h, - const gchar *digits) -{ - glBarcode *gbc; - struct Barcode_Item *bci; - gint flags; - - /* Assign type flag. Pre-filter by length for subtypes. */ - if (g_strcasecmp (id, "EAN") == 0) { - flags = BARCODE_EAN; - } else if (g_strcasecmp (id, "EAN-8") == 0) { - if (!is_length_valid (digits, 7, 8)) { - return NULL; - } - flags = BARCODE_EAN; - } else if (g_strcasecmp (id, "EAN-8+2") == 0) { - if (!is_length1_valid (digits, 7, 8) || !is_length2_valid (digits, 2, 2)) { - return NULL; - } - flags = BARCODE_EAN; - } else if (g_strcasecmp (id, "EAN-8+5") == 0) { - if (!is_length1_valid (digits, 7, 8) || !is_length2_valid (digits, 5, 5)) { - return NULL; - } - flags = BARCODE_EAN; - } else if (g_strcasecmp (id, "EAN-13") == 0) { - if (!is_length_valid (digits, 12, 13)) { - return NULL; - } - flags = BARCODE_EAN; - } else if (g_strcasecmp (id, "EAN-13+2") == 0) { - if (!is_length1_valid (digits, 12,13) || !is_length2_valid (digits, 2,2)) { - return NULL; - } - flags = BARCODE_EAN; - } else if (g_strcasecmp (id, "EAN-13+5") == 0) { - if (!is_length1_valid (digits, 12,13) || !is_length2_valid (digits, 5,5)) { - return NULL; - } - flags = BARCODE_EAN; - } else if (g_strcasecmp (id, "UPC") == 0) { - flags = BARCODE_UPC; - } else if (g_strcasecmp (id, "UPC-A") == 0) { - if (!is_length_valid (digits, 11, 12)) { - return NULL; - } - flags = BARCODE_UPC; - } else if (g_strcasecmp (id, "UPC-A+2") == 0) { - if (!is_length1_valid (digits, 11,12) || !is_length2_valid (digits, 2,2)) { - return NULL; - } - flags = BARCODE_UPC; - } else if (g_strcasecmp (id, "UPC-A+5") == 0) { - if (!is_length1_valid (digits, 11,12) || !is_length2_valid (digits, 5,5)) { - return NULL; - } - flags = BARCODE_UPC; - } else if (g_strcasecmp (id, "UPC-E") == 0) { - if (!is_length_valid (digits, 6, 8)) { - return NULL; - } - flags = BARCODE_UPC; - } else if (g_strcasecmp (id, "UPC-E+2") == 0) { - if (!is_length1_valid (digits, 6, 8) || !is_length2_valid (digits, 2,2)) { - return NULL; - } - flags = BARCODE_UPC; - } else if (g_strcasecmp (id, "UPC-E+5") == 0) { - if (!is_length1_valid (digits, 6, 8) || !is_length2_valid (digits, 5,5)) { - return NULL; - } - flags = BARCODE_UPC; - } else if (g_strcasecmp (id, "ISBN") == 0) { - if (!is_length_valid (digits, 9, 10)) { - return NULL; - } - flags = BARCODE_ISBN; - } else if (g_strcasecmp (id, "ISBN+5") == 0) { - if (!is_length1_valid (digits, 9, 10) || !is_length2_valid (digits, 5,5)) { - return NULL; - } - flags = BARCODE_ISBN; - } else if (g_strcasecmp (id, "Code39") == 0) { - flags = BARCODE_39; - } else if (g_strcasecmp (id, "Code128") == 0) { - flags = BARCODE_128; - } else if (g_strcasecmp (id, "Code128C") == 0) { - flags = BARCODE_128C; - } else if (g_strcasecmp (id, "Code128B") == 0) { - flags = BARCODE_128B; - } else if (g_strcasecmp (id, "I25") == 0) { - flags = BARCODE_I25; - } else if (g_strcasecmp (id, "CBR") == 0) { - flags = BARCODE_CBR; - } else if (g_strcasecmp (id, "MSI") == 0) { - flags = BARCODE_MSI; - } else if (g_strcasecmp (id, "PLS") == 0) { - flags = BARCODE_PLS; - } else { - g_message( "Illegal barcode id %s", id ); - flags = BARCODE_ANY; - } - - - bci = Barcode_Create ((char *)digits); - - /* First encode using GNU Barcode library */ - if (!text_flag) { - flags |= BARCODE_NO_ASCII; - } - if (!checksum_flag) { - flags |= BARCODE_NO_CHECKSUM; - } - - bci->scalef = 0.0; - bci->width = w; - bci->height = h; - - Barcode_Encode (bci, flags); - if (!bci->partial || !bci->textinfo) { - Barcode_Delete (bci); - return NULL; - } - - /* now render with our custom back-end, - to create appropriate intermdediate format */ - gbc = render_pass1 (bci, flags); - - Barcode_Delete (bci); - return gbc; -} - -/*-------------------------------------------------------------------------- - * PRIVATE. Render to glBarcode intermediate representation of barcode. - * - * Some of this code is borrowed from the postscript renderer (ps.c) - * from the GNU barcode library: - * - * Copyright (C) 1999 Alessaandro Rubini (rubini@gnu.org) - * Copyright (C) 1999 Prosa Srl. (prosa@prosa.it) - * - *--------------------------------------------------------------------------*/ -static glBarcode * -render_pass1 (struct Barcode_Item *bci, - gint flags) -{ - gint validbits = BARCODE_NO_ASCII; - glBarcode *gbc; - glBarcodeLine *line; - glBarcodeChar *bchar; - gdouble scalef = 1.0; - gdouble x; - gint i, j, barlen; - gdouble f1, f2; - gint mode = '-'; /* text below bars */ - gdouble x0, y0, yr; - gchar *p, c; - - if (bci->width > (2*bci->margin)) { - bci->width -= 2*bci->margin; - } - if (bci->height > (2*bci->margin)) { - bci->height -= 2*bci->margin; - } - - /* If any flag is clear in "flags", inherit it from "bci->flags" */ - if (!(flags & BARCODE_NO_ASCII)) { - flags |= bci->flags & BARCODE_NO_ASCII; - } - flags = bci->flags = (flags & validbits) | (bci->flags & ~validbits); - - /* First calculate barlen */ - barlen = bci->partial[0] - '0'; - for (p = bci->partial + 1; *p != 0; p++) { - if (isdigit (*p)) { - barlen += *p - '0'; - } else { - if ((*p != '+') && (*p != '-')) { - barlen += *p - 'a' + 1; - } - } - } - - /* The scale factor depends on bar length */ - if (!bci->scalef) { - if (!bci->width) bci->width = barlen; /* default */ - scalef = bci->scalef = (double)bci->width / (double)barlen; - if (scalef < 0.5) scalef = 0.5; - } - - /* The width defaults to "just enough" */ - bci->width = barlen * scalef + 1; - - /* But it can be too small, in this case enlarge and center the area */ - if (bci->width < barlen * scalef) { - int wid = barlen * scalef + 1; - bci->xoff -= (wid - bci->width)/2 ; - bci->width = wid; - /* Can't extend too far on the left */ - if (bci->xoff < 0) { - bci->width += -bci->xoff; - bci->xoff = 0; - } - } - - /* The height defaults to 80 points (rescaled) */ - if (!bci->height) - bci->height = 80 * scalef; - - /* If too small (5 + text), reduce the scale factor and center */ - i = 5 + 10 * ((bci->flags & BARCODE_NO_ASCII)==0); - if (bci->height < i * scalef ) { -#if 0 - double scaleg = ((double)bci->height) / i; - int wid = bci->width * scaleg / scalef; - bci->xoff += (bci->width - wid)/2; - bci->width = wid; - scalef = scaleg; -#else - bci->height = i * scalef; -#endif - } - - gbc = g_new0 (glBarcode, 1); - - /* Now traverse the code string and create a list of lines */ - x = bci->margin + (bci->partial[0] - '0') * scalef; - for (p = bci->partial + 1, i = 1; *p != 0; p++, i++) { - /* special cases: '+' and '-' */ - if (*p == '+' || *p == '-') { - mode = *p; /* don't count it */ - i++; - continue; - } - /* j is the width of this bar/space */ - if (isdigit (*p)) - j = *p - '0'; - else - j = *p - 'a' + 1; - if (i % 2) { /* bar */ - x0 = x + (j * scalef) / 2; - y0 = bci->margin; - yr = bci->height; - if (!(bci->flags & BARCODE_NO_ASCII)) { /* leave space for text */ - if (mode == '-') { - /* text below bars: 10 or 5 points */ - yr -= (isdigit (*p) ? 10 : 5) * scalef; - } else { /* '+' */ - /* above bars: 10 or 0 from bottom, - and 10 from top */ - y0 += 10 * scalef; - yr -= (isdigit (*p) ? 20 : 10) * scalef; - } - } - line = g_new0 (glBarcodeLine, 1); - line->x = x0; - line->y = y0; - line->length = yr; - line->width = (j * scalef) - SHRINK_AMOUNT; - gbc->lines = g_list_append (gbc->lines, line); - } - x += j * scalef; - - } - - /* Now the text */ - mode = '-'; /* reinstantiate default */ - if (!(bci->flags & BARCODE_NO_ASCII)) { - for (p = bci->textinfo; p; p = strchr (p, ' ')) { - while (*p == ' ') - p++; - if (!*p) - break; - if (*p == '+' || *p == '-') { - mode = *p; - continue; - } - if (sscanf (p, "%lf:%lf:%c", &f1, &f2, &c) != 3) { - g_message ("impossible data: %s", p); - continue; - } - bchar = g_new0 (glBarcodeChar, 1); - bchar->x = f1 * scalef + bci->margin; - if (mode == '-') { - bchar->y = - bci->margin + bci->height - 8 * scalef; - } else { - bchar->y = bci->margin; - } - bchar->fsize = f2 * FONT_SCALE * scalef; - bchar->c = c; - gbc->chars = g_list_append (gbc->chars, bchar); - } - } - - /* Fill in other info */ - gbc->height = bci->height + 2.0 * bci->margin; - gbc->width = bci->width + 2.0 * bci->margin; - -#if 0 - g_print ("w=%f, h=%f\n", gbc->width, gbc->height); -#endif - - return gbc; -} - -/*--------------------------------------------------------------------------*/ -/* Validate specific length of string (for subtypes). */ -/*--------------------------------------------------------------------------*/ -static gboolean -is_length_valid (const gchar *digits, - gint n1, - gint n2) -{ - gchar *p; - gint i; - - if (!digits) { - return FALSE; - } - - for (p = (gchar *)digits, i=0; *p != 0; p++) { - if (g_ascii_isdigit (*p)) { - i++; - } - } - - return (i >= n1) && (i <= n2); -} - -/*--------------------------------------------------------------------------*/ -/* Validate specific length of string (for subtypes). */ -/*--------------------------------------------------------------------------*/ -static gboolean -is_length1_valid (const gchar *digits, - gint n1, - gint n2) -{ - gchar *p; - gint i; - - if (!digits) { - return FALSE; - } - - for (p = (gchar *)digits, i=0; !g_ascii_isspace (*p) && *p != 0; p++) { - if (g_ascii_isdigit (*p)) { - i++; - } - } - - return (i >= n1) && (i <= n2); -} - -/*--------------------------------------------------------------------------*/ -/* Validate specific length of second string (for subtypes). */ -/*--------------------------------------------------------------------------*/ -static gboolean -is_length2_valid (const gchar *digits, - gint n1, - gint n2) -{ - gchar *p; - gint i; - - if (!digits) { - return FALSE; - } - - for (p = (gchar *)digits; !g_ascii_isspace (*p) && (*p != 0); p++) { - /* Skip over 1st string */ - } - - for (i=0; *p != 0; p++) { - if (g_ascii_isdigit (*p)) { - i++; - } - } - - return (i >= n1) && (i <= n2); -} - diff --git a/glabels2/src/bc-gnubarcode.h b/glabels2/src/bc-gnubarcode.h deleted file mode 100644 index 1e91d998..00000000 --- a/glabels2/src/bc-gnubarcode.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * bc_gnubarcode.h: front-end to GNU-barcode-library module header file - * - * Copyright (C) 2001-2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __BC_GNUBARCODE_H__ -#define __BC_GNUBARCODE_H__ - -#include "bc.h" - -G_BEGIN_DECLS - -glBarcode *gl_barcode_gnubarcode_new (const gchar *id, - gboolean text_flag, - gboolean checksum_flag, - gdouble w, - gdouble h, - const gchar *digits); - -G_END_DECLS - -#endif /* __BC_GNUBARCODE_H__ */ diff --git a/glabels2/src/bc-iec16022.c b/glabels2/src/bc-iec16022.c deleted file mode 100644 index 8fb87fc4..00000000 --- a/glabels2/src/bc-iec16022.c +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * bc-iec16022.c: front-end to iec16022-library module - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "bc-iec16022.h" - -#include -#include -#include -#include - -#include "iec16022ecc200.h" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ -#define MIN_PIXEL_SIZE 1.0 - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ -static glBarcode *render_iec16022 (const gchar *grid, - gint i_width, - gint i_height, - gdouble w, - gdouble h); - -/*****************************************************************************/ -/* Generate intermediate representation of barcode. */ -/*****************************************************************************/ -glBarcode * -gl_barcode_iec16022_new (const gchar *id, - gboolean text_flag, - gboolean checksum_flag, - gdouble w, - gdouble h, - const gchar *digits) -{ - gchar *grid; - gint i_width, i_height; - glBarcode *gbc; - - if ( strlen (digits) == 0 ) - { - return NULL; - } - - i_width = 0; - i_height = 0; - - grid = (gchar *)iec16022ecc200 (&i_width, &i_height, NULL, - strlen (digits), (unsigned char *)digits, - NULL, NULL, NULL); - - /* now render with our custom back-end, - to create appropriate intermdediate format */ - gbc = render_iec16022 (grid, i_width, i_height, w, h); - - free (grid); - return gbc; -} - -/*-------------------------------------------------------------------------- - * PRIVATE. Render to glBarcode intermediate representation of barcode. - *--------------------------------------------------------------------------*/ -static glBarcode * -render_iec16022 (const gchar *grid, - gint i_width, - gint i_height, - gdouble w, - gdouble h) -{ - glBarcode *gbc; - glBarcodeLine *line; - gint x, y; - gdouble aspect_ratio, pixel_size; - - /* Treat requested size as a bounding box, scale to maintain aspect - * ratio while fitting it in this bounding box. */ - aspect_ratio = (gdouble)i_height / (gdouble)i_width; - if ( h > w*aspect_ratio ) { - h = w * aspect_ratio; - } else { - w = h / aspect_ratio; - } - - /* Now determine pixel size. */ - pixel_size = w / i_width; - if ( pixel_size < MIN_PIXEL_SIZE ) - { - pixel_size = MIN_PIXEL_SIZE; - } - - gbc = g_new0 (glBarcode, 1); - - /* Now traverse the code string and create a list of boxes */ - for ( y = i_height-1; y >= 0; y-- ) - { - - for ( x = 0; x < i_width; x++ ) - { - - if (*grid++) - { - line = g_new0 (glBarcodeLine, 1); - line->x = x*pixel_size + pixel_size/2.0; - line->y = y*pixel_size; - line->length = pixel_size; - line->width = pixel_size; - gbc->lines = g_list_append (gbc->lines, line); - } - - } - - } - - /* Fill in other info */ - gbc->height = i_height * pixel_size; - gbc->width = i_width * pixel_size; - -#if 0 - g_print ("w=%f, h=%f\n", gbc->width, gbc->height); -#endif - - return gbc; -} - diff --git a/glabels2/src/bc-iec16022.h b/glabels2/src/bc-iec16022.h deleted file mode 100644 index 099387ac..00000000 --- a/glabels2/src/bc-iec16022.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * bc_iec16022.h: front-end to iec16022-library module header file - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __BC_IEC16022_H__ -#define __BC_IEC16022_H__ - -#include "bc.h" - -G_BEGIN_DECLS - -glBarcode *gl_barcode_iec16022_new (const gchar *id, - gboolean text_flag, - gboolean checksum_flag, - gdouble w, - gdouble h, - const gchar *digits); - -G_END_DECLS - -#endif /* __BC_IEC16022_H__ */ diff --git a/glabels2/src/bc-postnet.c b/glabels2/src/bc-postnet.c deleted file mode 100644 index 5b710c09..00000000 --- a/glabels2/src/bc-postnet.c +++ /dev/null @@ -1,222 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * bc_postnet.c: GLabels POSTNET barcode module - * - * Copyright (C) 2001-2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * This module implements the POSTNET barcode specified in the USPS - * publication 25, Mar 2001. - */ - -#include - -#include "bc-postnet.h" - -#include -#include -#include -#include - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ -#define POSTNET_BAR_WIDTH 1.25 -#define POSTNET_FULLBAR_HEIGHT 9.00 -#define POSTNET_HALFBAR_HEIGHT 3.50 -#define POSTNET_BAR_PITCH 3.25 -#define POSTNET_HORIZ_MARGIN 9.00 -#define POSTNET_VERT_MARGIN 3.00 - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ -static gchar *symbols[] = { - /* 0 */ "11000", - /* 1 */ "00011", - /* 2 */ "00101", - /* 3 */ "00110", - /* 4 */ "01001", - /* 5 */ "01010", - /* 6 */ "01100", - /* 7 */ "10001", - /* 8 */ "10010", - /* 9 */ "10100", -}; - -static gchar *frame_symbol = "1"; - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ -static gchar *postnet_code (const gchar *digits); - -static gboolean is_length_valid (const gchar *digits, - gint n); - - -/****************************************************************************/ -/* Generate list of lines that form the barcode for the given digits. */ -/****************************************************************************/ -glBarcode * -gl_barcode_postnet_new (const gchar *id, - gboolean text_flag, - gboolean checksum_flag, - gdouble w, - gdouble h, - const gchar *digits) -{ - gchar *code, *p; - glBarcode *gbc; - glBarcodeLine *line; - gdouble x; - - /* Validate code length for all subtypes. */ - if ( (g_strcasecmp (id, "POSTNET") == 0) ) { - if (!is_length_valid (digits, 5) && - !is_length_valid (digits, 9) && - !is_length_valid (digits, 11)) { - return NULL; - } - } - if ( (g_strcasecmp (id, "POSTNET-5") == 0) ) { - if (!is_length_valid (digits, 5)) { - return NULL; - } - } - if ( (g_strcasecmp (id, "POSTNET-9") == 0) ) { - if (!is_length_valid (digits, 9)) { - return NULL; - } - } - if ( (g_strcasecmp (id, "POSTNET-11") == 0) ) { - if (!is_length_valid (digits, 11)) { - return NULL; - } - } - if ( (g_strcasecmp (id, "CEPNET") == 0) ) { - if (!is_length_valid (digits, 8)) { - return NULL; - } - } - - /* First get code string */ - code = postnet_code (digits); - if (code == NULL) { - return NULL; - } - - gbc = g_new0 (glBarcode, 1); - - /* Now traverse the code string and create a list of lines */ - x = POSTNET_HORIZ_MARGIN; - for (p = code; *p != 0; p++) { - line = g_new0 (glBarcodeLine, 1); - line->x = x; - line->y = POSTNET_VERT_MARGIN; - if (*p == '0') { - line->y += - POSTNET_FULLBAR_HEIGHT - POSTNET_HALFBAR_HEIGHT; - line->length = POSTNET_HALFBAR_HEIGHT; - } else { - line->length = POSTNET_FULLBAR_HEIGHT; - } - line->width = POSTNET_BAR_WIDTH; - - gbc->lines = g_list_append (gbc->lines, line); - - x += POSTNET_BAR_PITCH; - } - - g_free (code); - - gbc->width = x + POSTNET_HORIZ_MARGIN; - gbc->height = POSTNET_FULLBAR_HEIGHT + 2 * POSTNET_VERT_MARGIN; - - gbc->chars = NULL; - - return gbc; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Generate string of symbols, representing barcode. */ -/*--------------------------------------------------------------------------*/ -static gchar * -postnet_code (const gchar *digits) -{ - gchar *p; - gint len; - gint d, sum; - GString *code; - gchar *ret; - - /* Left frame bar */ - code = g_string_new (frame_symbol); - - sum = 0; - for (p = (gchar *)digits, len = 0; (*p != 0) && (len < 11); p++) { - if (g_ascii_isdigit (*p)) { - /* Only translate valid characters (0-9) */ - d = (*p) - '0'; - sum += d; - code = g_string_append (code, symbols[d]); - len++; - } - } - - /* Create correction character */ - d = (10 - (sum % 10)) % 10; - code = g_string_append (code, symbols[d]); - - /* Right frame bar */ - code = g_string_append (code, frame_symbol); - - ret = g_strdup (code->str); - g_string_free (code, TRUE); - - return ret; -} - -/*--------------------------------------------------------------------------*/ -/* Validate specific length of string (for subtypes). */ -/*--------------------------------------------------------------------------*/ -static gboolean -is_length_valid (const gchar *digits, - gint n) -{ - gchar *p; - gint i; - - if (!digits) { - return FALSE; - } - - for (p = (gchar *)digits, i=0; *p != 0; p++) { - if (g_ascii_isdigit (*p)) { - i++; - } - } - - return (i == n); -} - diff --git a/glabels2/src/bc-postnet.h b/glabels2/src/bc-postnet.h deleted file mode 100644 index 6e642ab2..00000000 --- a/glabels2/src/bc-postnet.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * bc_postnet.h: GLabels POSTNET barcode module header file - * - * Copyright (C) 2001-2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __BC_POSTNET_H__ -#define __BC_POSTNET_H__ - -#include "bc.h" - -G_BEGIN_DECLS - -glBarcode *gl_barcode_postnet_new (const gchar *id, - gboolean text_flag, - gboolean checksum_flag, - gdouble w, - gdouble h, - const gchar *digits); - -G_END_DECLS - -#endif /* __BC_POSTNET_H__ */ diff --git a/glabels2/src/bc.c b/glabels2/src/bc.c deleted file mode 100644 index bcb427f5..00000000 --- a/glabels2/src/bc.c +++ /dev/null @@ -1,386 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * bc.c: GLabels barcode module - * - * Copyright (C) 2001-2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "bc.h" - -#include -#include -#include -#include - -#include "bc-postnet.h" -#include "bc-gnubarcode.h" -#include "bc-iec16022.h" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -typedef struct { - gchar *id; - gchar *name; - glBarcodeNewFunc new; - gboolean can_text; - gboolean text_optional; - gboolean can_checksum; - gboolean checksum_optional; - gchar *default_digits; - gboolean can_freeform; - guint prefered_n; -} Backend; - - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -static const Backend backends[] = { - - { "POSTNET", N_("POSTNET (any)"), gl_barcode_postnet_new, - FALSE, FALSE, TRUE, FALSE, "12345-6789-12", FALSE, 11}, - - { "POSTNET-5", N_("POSTNET-5 (ZIP only)"), gl_barcode_postnet_new, - FALSE, FALSE, TRUE, FALSE, "12345", FALSE, 5}, - - { "POSTNET-9", N_("POSTNET-9 (ZIP+4)"), gl_barcode_postnet_new, - FALSE, FALSE, TRUE, FALSE, "12345-6789", FALSE, 9}, - - { "POSTNET-11", N_("POSTNET-11 (DPBC)"), gl_barcode_postnet_new, - FALSE, FALSE, TRUE, FALSE, "12345-6789-12", FALSE, 11}, - - { "CEPNET", N_("CEPNET"), gl_barcode_postnet_new, - FALSE, FALSE, TRUE, FALSE, "12345-678", FALSE, 8}, - - { "EAN", N_("EAN (any)"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "000000000000 00000", FALSE, 17}, - - { "EAN-8", N_("EAN-8"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "0000000", FALSE, 7}, - - { "EAN-8+2", N_("EAN-8 +2"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "0000000 00", FALSE, 9}, - - { "EAN-8+5", N_("EAN-8 +5"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "0000000 00000", FALSE, 12}, - - { "EAN-13", N_("EAN-13"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "000000000000", FALSE, 12}, - - { "EAN-13+2", N_("EAN-13 +2"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "000000000000 00", FALSE, 14}, - - { "EAN-13+5", N_("EAN-13 +5"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "000000000000 00000", FALSE, 17}, - - { "UPC", N_("UPC (UPC-A or UPC-E)"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "00000000000 00000", FALSE, 16}, - - { "UPC-A", N_("UPC-A"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "00000000000", FALSE, 11}, - - { "UPC-A+2", N_("UPC-A +2"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "00000000000 00", FALSE, 13}, - - { "UPC-A+5", N_("UPC-A +5"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "00000000000 00000", FALSE, 16}, - - { "UPC-E", N_("UPC-E"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "000000", FALSE, 6}, - - { "UPC-E+2", N_("UPC-E +2"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "000000 00", FALSE, 8}, - - { "UPC-E+5", N_("UPC-E +5"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "000000 00000", FALSE, 11}, - - { "ISBN", N_("ISBN"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, TRUE, "0-00000-000-0", FALSE, 10}, - - { "ISBN+5", N_("ISBN +5"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, TRUE, "0-00000-000-0 00000", FALSE, 15}, - - { "Code39", N_("Code 39"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, - - { "Code128", N_("Code 128"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, - - { "Code128C", N_("Code 128C"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, FALSE, "0000000000", TRUE, 10}, - - { "Code128B", N_("Code 128B"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, - - { "I25", N_("Interleaved 2 of 5"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, - - { "CBR", N_("Codabar"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, - - { "MSI", N_("MSI"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, - - { "PLS", N_("Plessey"), gl_barcode_gnubarcode_new, - TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, - - { "IEC16022", N_("IEC16022 (DataMatrix)"), gl_barcode_iec16022_new, - FALSE, FALSE, TRUE, FALSE, "12345678", TRUE, 8}, - - { NULL, NULL, NULL, FALSE, FALSE, FALSE, FALSE, NULL, FALSE, 0} - -}; - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - - -/*---------------------------------------------------------------------------*/ -/* Convert id to index into above table. */ -/*---------------------------------------------------------------------------*/ -static gint -id_to_index (const gchar *id) -{ - gint i; - - if (id == 0) { - return 0; /* NULL request default. I.e., the first element. */ - } - - for (i=0; backends[i].id != NULL; i++) { - if (g_strcasecmp (id, backends[i].id) == 0) { - return i; - } - } - - g_message( "Unknown barcode id \"%s\"", id ); - return 0; -} - -/*---------------------------------------------------------------------------*/ -/* Convert name to index into above table. */ -/*---------------------------------------------------------------------------*/ -static gint -name_to_index (const gchar *name) -{ - gint i; - - g_return_val_if_fail (name!=NULL, 0); - - for (i=0; backends[i].id != NULL; i++) { - if (g_strcasecmp (name, backends[i].name) == 0) { - return i; - } - } - - g_message( "Unknown barcode name \"%s\"", name ); - return 0; -} - -/*****************************************************************************/ -/* Call appropriate barcode backend to create barcode in intermediate format.*/ -/*****************************************************************************/ -glBarcode * -gl_barcode_new (const gchar *id, - gboolean text_flag, - gboolean checksum_flag, - gdouble w, - gdouble h, - const gchar *digits) -{ - glBarcode *gbc; - gint i; - - g_return_val_if_fail (digits!=NULL, NULL); - - i = id_to_index (id); - gbc = backends[i].new (backends[i].id, - text_flag, - checksum_flag, - w, - h, - digits); - - return gbc; -} - -/*****************************************************************************/ -/* Free previously created barcode. */ -/*****************************************************************************/ -void -gl_barcode_free (glBarcode **gbc) -{ - GList *p; - - if (*gbc != NULL) { - - for (p = (*gbc)->lines; p != NULL; p = p->next) { - g_free (p->data); - p->data = NULL; - } - g_list_free ((*gbc)->lines); - (*gbc)->lines = NULL; - - for (p = (*gbc)->chars; p != NULL; p = p->next) { - g_free (p->data); - p->data = NULL; - } - g_list_free ((*gbc)->chars); - (*gbc)->chars = NULL; - - g_free (*gbc); - *gbc = NULL; - } -} - -/*****************************************************************************/ -/* Get a list of names for valid barcode styles. */ -/*****************************************************************************/ -GList * -gl_barcode_get_styles_list (void) -{ - gint i; - GList *list = NULL; - - for (i=0; backends[i].id != NULL; i++) { - list = g_list_append (list, g_strdup (backends[i].name)); - } - - return list; -} - -/*****************************************************************************/ -/* Free up a previously allocated list of style names. */ -/*****************************************************************************/ -void -gl_barcode_free_styles_list (GList *styles_list) -{ - GList *p; - - for (p=styles_list; p != NULL; p=p->next) { - g_free (p->data); - p->data = NULL; - } - - g_list_free (styles_list); -} - - -/*****************************************************************************/ -/* Return an appropriate set of digits for the given barcode style. */ -/*****************************************************************************/ -gchar * -gl_barcode_default_digits (const gchar *id, - guint n) -{ - int i; - - i = id_to_index (id); - - if (backends[i].can_freeform) { - - return g_strnfill (MAX (n,1), '0'); - - } else { - - return g_strdup (backends[i].default_digits); - - } -} - -/*****************************************************************************/ -/* Query text capabilities. */ -/*****************************************************************************/ -gboolean -gl_barcode_can_text (const gchar *id) -{ - return backends[id_to_index (id)].can_text; -} - -gboolean -gl_barcode_text_optional (const gchar *id) -{ - return backends[id_to_index (id)].text_optional; -} - -/*****************************************************************************/ -/* Query checksum capabilities. */ -/*****************************************************************************/ -gboolean -gl_barcode_can_csum (const gchar *id) -{ - return backends[id_to_index (id)].can_checksum; -} - -gboolean -gl_barcode_csum_optional (const gchar *id) -{ - return backends[id_to_index (id)].checksum_optional; -} - - -/*****************************************************************************/ -/* Query if freeform input is allowed. */ -/*****************************************************************************/ -gboolean -gl_barcode_can_freeform (const gchar *id) -{ - return backends[id_to_index (id)].can_freeform; -} - -/*****************************************************************************/ -/* Query prefered number of digits of input. */ -/*****************************************************************************/ -guint -gl_barcode_get_prefered_n (const gchar *id) -{ - return backends[id_to_index (id)].prefered_n; -} - -/*****************************************************************************/ -/* Convert style to text. */ -/*****************************************************************************/ -const gchar * -gl_barcode_id_to_name (const gchar *id) -{ - return backends[id_to_index (id)].name; -} - -/*****************************************************************************/ -/* Convert name to style. */ -/*****************************************************************************/ -const gchar * -gl_barcode_name_to_id (const gchar *name) -{ - g_return_val_if_fail (name!=NULL, backends[0].id); - - return backends[name_to_index (name)].id; -} diff --git a/glabels2/src/bc.h b/glabels2/src/bc.h deleted file mode 100644 index f46d8897..00000000 --- a/glabels2/src/bc.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * bc.h: GLabels barcode module header file - * - * Copyright (C) 2001-2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __BC_H__ -#define __BC_H__ - -#include -#include -#include - -G_BEGIN_DECLS - -typedef struct { - gdouble x, y, length, width; -} glBarcodeLine; - -typedef struct { - gdouble x, y, fsize; - gchar c; -} glBarcodeChar; - -typedef struct { - gdouble width, height; - GList *lines; /* List of glBarcodeLine */ - GList *chars; /* List of glBarcodeChar */ -} glBarcode; - -typedef glBarcode *(*glBarcodeNewFunc) (const gchar *id, - gboolean text_flag, - gboolean checksum_flag, - gdouble w, - gdouble h, - const gchar *digits); - - -#define GL_BARCODE_FONT_FAMILY "Sans" -#define GL_BARCODE_FONT_WEIGHT PANGO_WEIGHT_NORMAL - - -glBarcode *gl_barcode_new (const gchar *id, - gboolean text_flag, - gboolean checksum_flag, - gdouble w, - gdouble h, - const gchar *digits); - -void gl_barcode_free (glBarcode **bc); - -GList *gl_barcode_get_styles_list (void); -void gl_barcode_free_styles_list (GList *styles_list); - -gchar *gl_barcode_default_digits (const gchar *id, - guint n); - -gboolean gl_barcode_can_text (const gchar *id); -gboolean gl_barcode_text_optional (const gchar *id); - -gboolean gl_barcode_can_csum (const gchar *id); -gboolean gl_barcode_csum_optional (const gchar *id); - -gboolean gl_barcode_can_freeform (const gchar *id); -guint gl_barcode_get_prefered_n (const gchar *id); - -const gchar *gl_barcode_id_to_name (const gchar *id); -const gchar *gl_barcode_name_to_id (const gchar *name); - -G_END_DECLS - -#endif /* __BC_H__ */ - diff --git a/glabels2/src/cairo-ellipse-path.c b/glabels2/src/cairo-ellipse-path.c deleted file mode 100644 index 3a4cb888..00000000 --- a/glabels2/src/cairo-ellipse-path.c +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * cairo_ellipse_path.c: Cairo ellipse path module - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "cairo-ellipse-path.h" - -#include -#include - -#include "debug.h" - -/*===========================================*/ -/* Private macros and constants. */ -/*===========================================*/ - -#define ARC_FINE 2 - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - - - -/*****************************************************************************/ -/* Create ellipse path */ -/*****************************************************************************/ -void -gl_cairo_ellipse_path (cairo_t *cr, - gdouble rx, - gdouble ry) -{ - gdouble x, y; - gint i_theta; - - gl_debug (DEBUG_VIEW, "START"); - - cairo_new_path (cr); - cairo_move_to (cr, 2*rx, ry); - for (i_theta = ARC_FINE; i_theta <= 360; i_theta += ARC_FINE) { - x = rx + rx * cos (i_theta * G_PI / 180.0); - y = ry + ry * sin (i_theta * G_PI / 180.0); - cairo_line_to (cr, x, y); - } - cairo_close_path (cr); - - gl_debug (DEBUG_VIEW, "END"); -} - - diff --git a/glabels2/src/cairo-ellipse-path.h b/glabels2/src/cairo-ellipse-path.h deleted file mode 100644 index 3c6a7568..00000000 --- a/glabels2/src/cairo-ellipse-path.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * cairo_ellipse_path.h: Cairo ellipse path module header file - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __CAIRO_ELLIPSE_PATH_H__ -#define __CAIRO_ELLIPSE_PATH_H__ - -#include -#include - -G_BEGIN_DECLS - -void gl_cairo_ellipse_path (cairo_t *cr, - gdouble rx, - gdouble ry); - - -G_END_DECLS - -#endif diff --git a/glabels2/src/cairo-label-path.c b/glabels2/src/cairo-label-path.c deleted file mode 100644 index 1bc194ac..00000000 --- a/glabels2/src/cairo-label-path.c +++ /dev/null @@ -1,263 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * cairo_label_path.c: Cairo label path module - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "cairo-label-path.h" - -#include -#include - -#include "debug.h" - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_cairo_rect_label_path (cairo_t *cr, - lglTemplate *template, - gboolean rotate_flag, - gboolean waste_flag); -static void gl_cairo_round_label_path (cairo_t *cr, - lglTemplate *template, - gboolean rotate_flag, - gboolean waste_flag); -static void gl_cairo_cd_label_path (cairo_t *cr, - lglTemplate *template, - gboolean rotate_flag, - gboolean waste_flag); - - -/*--------------------------------------------------------------------------*/ -/* Create label path */ -/*--------------------------------------------------------------------------*/ -void -gl_cairo_label_path (cairo_t *cr, - lglTemplate *template, - gboolean rotate_flag, - gboolean waste_flag) -{ - const lglTemplateFrame *frame; - - gl_debug (DEBUG_PATH, "START"); - - frame = (lglTemplateFrame *)template->frames->data; - - switch (frame->shape) { - - case LGL_TEMPLATE_FRAME_SHAPE_RECT: - gl_cairo_rect_label_path (cr, template, rotate_flag, waste_flag); - break; - - case LGL_TEMPLATE_FRAME_SHAPE_ROUND: - gl_cairo_round_label_path (cr, template, rotate_flag, waste_flag); - break; - - case LGL_TEMPLATE_FRAME_SHAPE_CD: - gl_cairo_cd_label_path (cr, template, rotate_flag, waste_flag); - break; - - default: - g_message ("Unknown label style"); - break; - } - - gl_debug (DEBUG_PATH, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* Create rectangular label path */ -/*--------------------------------------------------------------------------*/ -static void -gl_cairo_rect_label_path (cairo_t *cr, - lglTemplate *template, - gboolean rotate_flag, - gboolean waste_flag) -{ - const lglTemplateFrame *frame; - gdouble w, h, r; - gdouble x_waste, y_waste; - - gl_debug (DEBUG_PATH, "START"); - - frame = (lglTemplateFrame *)template->frames->data; - r = frame->rect.r; - - x_waste = 0.0; - y_waste = 0.0; - - if (rotate_flag) - { - lgl_template_frame_get_size (frame, &h, &w); - if (waste_flag) - { - x_waste = frame->rect.y_waste; - y_waste = frame->rect.x_waste; - } - } - else - { - lgl_template_frame_get_size (frame, &w, &h); - if (waste_flag) - { - x_waste = frame->rect.x_waste; - y_waste = frame->rect.y_waste; - } - } - - - if ( r == 0.0 ) - { - cairo_rectangle (cr, -x_waste, -y_waste, w+x_waste, h+y_waste); - } - else - { - cairo_new_path (cr); - cairo_arc_negative (cr, r-x_waste, r-y_waste, r, 3*G_PI/2, G_PI); - cairo_arc_negative (cr, r-x_waste, h-r+y_waste, r, G_PI, G_PI/2); - cairo_arc_negative (cr, w-r+x_waste, h-r+y_waste, r, G_PI/2, 0.); - cairo_arc_negative (cr, w-r+x_waste, r-y_waste, r, 2*G_PI, 3*G_PI/2); - cairo_close_path (cr); - } - - gl_debug (DEBUG_PATH, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* Create round label path */ -/*--------------------------------------------------------------------------*/ -static void -gl_cairo_round_label_path (cairo_t *cr, - lglTemplate *template, - gboolean rotate_flag, - gboolean waste_flag) -{ - const lglTemplateFrame *frame; - gdouble w, h; - gdouble waste; - - gl_debug (DEBUG_PATH, "START"); - - frame = (lglTemplateFrame *)template->frames->data; - - if (rotate_flag) - { - lgl_template_frame_get_size (frame, &h, &w); - } - else - { - lgl_template_frame_get_size (frame, &w, &h); - } - - if (waste_flag) - { - waste = frame->round.waste; - } - else - { - waste = 0.0; - } - - cairo_arc (cr, w/2, h/2, w/2+waste, 0.0, 2*G_PI); - cairo_close_path (cr); - - gl_debug (DEBUG_PATH, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* Create cd label path */ -/*--------------------------------------------------------------------------*/ -static void -gl_cairo_cd_label_path (cairo_t *cr, - lglTemplate *template, - gboolean rotate_flag, - gboolean waste_flag) -{ - const lglTemplateFrame *frame; - gdouble w, h; - gdouble xc, yc; - gdouble r1, r2; - gdouble theta1, theta2; - gdouble waste; - - gl_debug (DEBUG_PATH, "START"); - - frame = (lglTemplateFrame *)template->frames->data; - - if (rotate_flag) - { - lgl_template_frame_get_size (frame, &h, &w); - } - else - { - lgl_template_frame_get_size (frame, &w, &h); - } - - xc = w/2.0; - yc = h/2.0; - - r1 = frame->cd.r1; - r2 = frame->cd.r2; - - if (waste_flag) - { - waste = frame->cd.waste; - } - else - { - waste = 0.0; - } - - /* - * Outer path (may be clipped in the case of a business card type CD) - */ - theta1 = acos (w / (2.0*r1)); - theta2 = asin (h / (2.0*r1)); - - cairo_new_path (cr); - cairo_arc (cr, xc, yc, r1+waste, theta1, theta2); - cairo_arc (cr, xc, yc, r1+waste, G_PI-theta2, G_PI-theta1); - cairo_arc (cr, xc, yc, r1+waste, G_PI+theta1, G_PI+theta2); - cairo_arc (cr, xc, yc, r1+waste, 2*G_PI-theta2, 2*G_PI-theta1); - cairo_close_path (cr); - - - /* - * Inner path (hole) - */ - cairo_new_sub_path (cr); - cairo_arc (cr, xc, yc, r2-waste, 0.0, 2*G_PI); - cairo_close_path (cr); - - gl_debug (DEBUG_PATH, "END"); -} - diff --git a/glabels2/src/cairo-label-path.h b/glabels2/src/cairo-label-path.h deleted file mode 100644 index ad0495f5..00000000 --- a/glabels2/src/cairo-label-path.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * cairo_label_path.h: Cairo label path module header file - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __CAIRO_LABEL_PATH_H__ -#define __CAIRO_LABEL_PATH_H__ - -#include -#include - -G_BEGIN_DECLS - -void gl_cairo_label_path (cairo_t *cr, - lglTemplate *template, - gboolean rotate_flag, - gboolean waste_flag); - -G_END_DECLS - -#endif diff --git a/glabels2/src/cairo-markup-path.c b/glabels2/src/cairo-markup-path.c deleted file mode 100644 index 04a2a68f..00000000 --- a/glabels2/src/cairo-markup-path.c +++ /dev/null @@ -1,315 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * cairo_markup_path.c: Cairo markup path module - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "cairo-markup-path.h" - -#include -#include - -#include "debug.h" - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_cairo_markup_margin_path (cairo_t *cr, - const lglTemplateMarkup *markup, - glLabel *label); - -static void gl_cairo_markup_margin_rect_path (cairo_t *cr, - const lglTemplateMarkup *markup, - glLabel *label); - -static void gl_cairo_markup_margin_round_path (cairo_t *cr, - const lglTemplateMarkup *markup, - glLabel *label); - -static void gl_cairo_markup_margin_cd_path (cairo_t *cr, - const lglTemplateMarkup *markup, - glLabel *label); - -static void gl_cairo_markup_line_path (cairo_t *cr, - const lglTemplateMarkup *markup); - -static void gl_cairo_markup_circle_path (cairo_t *cr, - const lglTemplateMarkup *markup); - -static void gl_cairo_markup_rect_path (cairo_t *cr, - const lglTemplateMarkup *markup); - - -/*--------------------------------------------------------------------------*/ -/* Create markup path */ -/*--------------------------------------------------------------------------*/ -void -gl_cairo_markup_path (cairo_t *cr, - const lglTemplateMarkup *markup, - glLabel *label) -{ - gl_debug (DEBUG_PATH, "START"); - - switch (markup->type) { - case LGL_TEMPLATE_MARKUP_MARGIN: - gl_cairo_markup_margin_path (cr, markup, label); - break; - case LGL_TEMPLATE_MARKUP_LINE: - gl_cairo_markup_line_path (cr, markup); - break; - case LGL_TEMPLATE_MARKUP_CIRCLE: - gl_cairo_markup_circle_path (cr, markup); - break; - case LGL_TEMPLATE_MARKUP_RECT: - gl_cairo_markup_rect_path (cr, markup); - break; - default: - g_message ("Unknown template markup type"); - break; - } - - gl_debug (DEBUG_PATH, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw margin markup. */ -/*---------------------------------------------------------------------------*/ -static void -gl_cairo_markup_margin_path (cairo_t *cr, - const lglTemplateMarkup *markup, - glLabel *label) -{ - const lglTemplateFrame *frame; - - gl_debug (DEBUG_PATH, "START"); - - frame = (lglTemplateFrame *)label->template->frames->data; - - switch (frame->shape) { - - case LGL_TEMPLATE_FRAME_SHAPE_RECT: - gl_cairo_markup_margin_rect_path (cr, markup, label); - break; - - case LGL_TEMPLATE_FRAME_SHAPE_ROUND: - gl_cairo_markup_margin_round_path (cr, markup, label); - break; - - case LGL_TEMPLATE_FRAME_SHAPE_CD: - gl_cairo_markup_margin_cd_path (cr, markup, label); - break; - - default: - g_message ("Unknown template label style"); - break; - } - - gl_debug (DEBUG_PATH, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw simple recangular margin. */ -/*---------------------------------------------------------------------------*/ -static void -gl_cairo_markup_margin_rect_path (cairo_t *cr, - const lglTemplateMarkup *markup, - glLabel *label) -{ - const lglTemplateFrame *frame; - gdouble w, h, r, m; - - gl_debug (DEBUG_PATH, "START"); - - frame = (lglTemplateFrame *)label->template->frames->data; - - m = markup->margin.size; - - lgl_template_frame_get_size (frame, &w, &h); - w = w - 2*m; - h = h - 2*m; - r = MAX (frame->rect.r - m, 0.0); - - if ( r == 0.0 ) - { - cairo_rectangle (cr, m, m, w, h); - } - else - { - cairo_new_path (cr); - cairo_arc_negative (cr, m+r, m+r, r, 3*G_PI/2, G_PI); - cairo_arc_negative (cr, m+r, m+h-r, r, G_PI, G_PI/2); - cairo_arc_negative (cr, m+w-r, m+h-r, r, G_PI/2, 0.); - cairo_arc_negative (cr, m+w-r, m+r, r, 2*G_PI, 3*G_PI/2); - cairo_close_path (cr); - } - - gl_debug (DEBUG_PATH, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw round margin. */ -/*---------------------------------------------------------------------------*/ -static void -gl_cairo_markup_margin_round_path (cairo_t *cr, - const lglTemplateMarkup *markup, - glLabel *label) -{ - const lglTemplateFrame *frame; - gdouble r, m; - - gl_debug (DEBUG_PATH, "START"); - - frame = (lglTemplateFrame *)label->template->frames->data; - - r = frame->round.r; - m = markup->margin.size; - - cairo_arc (cr, r, r, r-m, 0, 2*G_PI); - cairo_close_path (cr); - - gl_debug (DEBUG_PATH, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw CD margins. */ -/*---------------------------------------------------------------------------*/ -static void -gl_cairo_markup_margin_cd_path (cairo_t *cr, - const lglTemplateMarkup *markup, - glLabel *label) -{ - const lglTemplateFrame *frame; - gdouble m, r1, r2; - gdouble theta1, theta2; - gdouble xc, yc; - gdouble w, h; - - gl_debug (DEBUG_PATH, "START"); - - frame = (lglTemplateFrame *)label->template->frames->data; - - lgl_template_frame_get_size (frame, &w, &h); - xc = w/2.0; - yc = h/2.0; - - m = markup->margin.size; - r1 = frame->cd.r1 - m; - r2 = frame->cd.r2 + m; - - - /* - * Outer path (may be clipped) - */ - theta1 = acos ((w-2*m) / (2.0*r1)); - theta2 = asin ((h-2*m) / (2.0*r1)); - - cairo_new_path (cr); - cairo_arc (cr, xc, yc, r1, theta1, theta2); - cairo_arc (cr, xc, yc, r1, G_PI-theta2, G_PI-theta1); - cairo_arc (cr, xc, yc, r1, G_PI+theta1, G_PI+theta2); - cairo_arc (cr, xc, yc, r1, 2*G_PI-theta2, 2*G_PI-theta1); - cairo_close_path (cr); - - - /* Inner path (hole) */ - cairo_new_sub_path (cr); - cairo_arc (cr, xc, yc, r2, 0.0, 2*G_PI); - cairo_close_path (cr); - - gl_debug (DEBUG_PATH, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw line markup. */ -/*---------------------------------------------------------------------------*/ -static void -gl_cairo_markup_line_path (cairo_t *cr, - const lglTemplateMarkup *markup) -{ - gl_debug (DEBUG_PATH, "START"); - - cairo_move_to (cr, markup->line.x1, markup->line.y1); - cairo_line_to (cr, markup->line.x2, markup->line.y2); - - gl_debug (DEBUG_PATH, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw circle markup. */ -/*---------------------------------------------------------------------------*/ -static void -gl_cairo_markup_circle_path (cairo_t *cr, - const lglTemplateMarkup *markup) -{ - gl_debug (DEBUG_PATH, "START"); - - cairo_arc (cr, - markup->circle.x0, markup->circle.y0, - markup->circle.r, - 0.0, 2*G_PI); - cairo_close_path (cr); - - gl_debug (DEBUG_PATH, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw rect markup. */ -/*---------------------------------------------------------------------------*/ -static void -gl_cairo_markup_rect_path (cairo_t *cr, - const lglTemplateMarkup *markup) -{ - gdouble x1 = markup->rect.x1; - gdouble y1 = markup->rect.y1; - gdouble w = markup->rect.w; - gdouble h = markup->rect.h; - gdouble r = markup->rect.r; - - gl_debug (DEBUG_PATH, "START"); - - if ( r == 0.0 ) - { - cairo_rectangle (cr, x1, y1, w, h); - } - else - { - cairo_new_path (cr); - cairo_arc_negative (cr, x1+r, y1+r, r, 3*G_PI/2, G_PI); - cairo_arc_negative (cr, x1+r, y1+h-r, r, G_PI, G_PI/2); - cairo_arc_negative (cr, x1+w-r, y1+h-r, r, G_PI/2, 0.); - cairo_arc_negative (cr, x1+w-r, y1+r, r, 2*G_PI, 3*G_PI/2); - cairo_close_path (cr); - } - - gl_debug (DEBUG_PATH, "END"); -} - diff --git a/glabels2/src/cairo-markup-path.h b/glabels2/src/cairo-markup-path.h deleted file mode 100644 index 9dfab554..00000000 --- a/glabels2/src/cairo-markup-path.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * cairo_markup_path.h: Cairo markup path module header file - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __CAIRO_MARKUP_PATH_H__ -#define __CAIRO_MARKUP_PATH_H__ - -#include -#include -#include "label.h" - -G_BEGIN_DECLS - -void gl_cairo_markup_path (cairo_t *cr, - const lglTemplateMarkup *markup, - glLabel *label); - -G_END_DECLS - -#endif diff --git a/glabels2/src/color.c b/glabels2/src/color.c deleted file mode 100644 index e4bf3bdf..00000000 --- a/glabels2/src/color.c +++ /dev/null @@ -1,249 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * color.c: various small utilities for dealing with canvas colors - * - * Copyright (C) 2002-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "color.h" - -#include - -/*****************************************************************************/ -/* Apply given opacity to given color. */ -/*****************************************************************************/ -guint -gl_color_set_opacity (guint color, - gdouble opacity) -{ - guint new_color; - - new_color = (color & 0xFFFFFF00) | (((guint)(255.0*opacity)) & 0xFF); - - return new_color; -} - -/*****************************************************************************/ -/* Resolve actual shadow color by adjusting opacity. */ -/*****************************************************************************/ -guint -gl_color_shadow (guint base_color, - gdouble opacity, - guint object_color) -{ - guint color; - - color = gl_color_set_opacity (base_color, - opacity * GL_COLOR_F_ALPHA (object_color)); - - return color; -} - -/*****************************************************************************/ -/* Convert gLabels color into a GdkColor */ -/*****************************************************************************/ -GdkColor * -gl_color_to_gdk_color (guint color) -{ - GdkColor *gdk_color = NULL; - - if ( GL_COLOR_F_ALPHA (color) ) - { - gdk_color = g_new0 (GdkColor, 1); - - gdk_color->red = GL_COLOR_F_RED (color) * 65535; - gdk_color->green = GL_COLOR_F_GREEN (color) * 65535; - gdk_color->blue = GL_COLOR_F_BLUE (color) * 65535; - } - - return gdk_color; -} - -/*****************************************************************************/ -/* Convert GdkColor into a gLabels color */ -/*****************************************************************************/ -guint -gl_color_from_gdk_color (GdkColor *gdk_color) -{ - guint color = GL_COLOR_NONE; - - if ( gdk_color ) - { - color = GL_COLOR ((gdk_color->red >>8), - (gdk_color->green >>8), - (gdk_color->blue >>8)); - } - - return color; -} - -/****************************************************************************/ -/* Create a single color node with default color. */ -/****************************************************************************/ -glColorNode * -gl_color_node_new_default (void) -{ - glColorNode* color_node; - - color_node = g_new0(glColorNode,1); - - color_node->field_flag = FALSE; - color_node->color = GL_COLOR_NONE; - color_node->key = NULL; - - return color_node; -} - -/****************************************************************************/ -/* Copy a single color node. */ -/****************************************************************************/ -glColorNode * -gl_color_node_dup (glColorNode *src) -{ - glColorNode *dst; - - if ( src == NULL ) return NULL; - - dst = g_new0 (glColorNode, 1); - - dst->field_flag = src->field_flag; - if (src->key != NULL) - { - dst->key = g_strdup (src->key); - } - else - { - dst->key = NULL; - } - dst->color = src->color; - - return dst; -} - -/****************************************************************************/ -/* Compare 2 color nodes for equality. */ -/****************************************************************************/ -gboolean -gl_color_node_equal (glColorNode *color_node1, - glColorNode *color_node2) -{ - /* First take care of the case of either or both being NULL. */ - if ( color_node1 == NULL ) - { - return ( color_node2 == NULL ); - } - else - { - if ( color_node2 == NULL ) - { - return FALSE; - } - } - - /* Bail if field flags differ. */ - if ( color_node1->field_flag != color_node2->field_flag ) - { - return FALSE; - } - - /* Now take care of the case of either or both color fields being different. */ - if ( color_node1->color != color_node2->color ) - { - return FALSE; - } - - /* Then take care of the case of either or both key fields being NULL. */ - if ( color_node1->key == NULL ) - { - return ( color_node2->key == NULL ); - } - else - { - if ( color_node2->key == NULL ) - { - return FALSE; - } - } - - /* Field flags are identical, so now compare the keys. */ - return (strcmp (color_node1->key, color_node2->key) == 0); -} - -/****************************************************************************/ -/* Expand single node into representative color. */ -/****************************************************************************/ -guint -gl_color_node_expand (glColorNode *color_node, - glMergeRecord *record) -{ - gchar *text; - GdkColor *gdk_color; - guint color; - - if (color_node->field_flag) - { - if (record == NULL) - { - return GL_COLOR_NONE; - } - else - { - text = gl_merge_eval_key (record, color_node->key); - if (text != NULL) - { - gdk_color = g_new0 (GdkColor, 1); - if (gdk_color_parse (text, gdk_color)) - { - color = gl_color_from_gdk_color (gdk_color); - g_free (gdk_color); - return color; - } - else - { - g_free (gdk_color); - return GL_COLOR_NONE; - } - } - else - { - return GL_COLOR_NONE; - } - } - } - else - { - return color_node->color; - } -} - -/****************************************************************************/ -/* Free a single color node. */ -/****************************************************************************/ -void -gl_color_node_free (glColorNode **color_node) -{ - if ( *color_node == NULL ) return; - - g_free ((*color_node)->key); - (*color_node)->key = NULL; - g_free (*color_node); - *color_node = NULL; -} diff --git a/glabels2/src/color.h b/glabels2/src/color.h deleted file mode 100644 index c4403ad5..00000000 --- a/glabels2/src/color.h +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * color.h: various small utilities for dealing with canvas colors - * - * Copyright (C) 2002-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __COLOR_H__ -#define __COLOR_H__ - -#include "merge.h" -#include - -G_BEGIN_DECLS - -/* - * gLabels stores colors as a 32-bit unsigned integer in RGBA format (MSByte = Red) - */ -#define GL_COLOR(r,g,b) ( (((unsigned int) (r) & 0xff) << 24) \ - | (((unsigned int) (g) & 0xff) << 16) \ - | (((unsigned int) (b) & 0xff) << 8) \ - | 0xff ) - -#define GL_COLOR_A(r,g,b,a) ( (((unsigned int) (r) & 0xff) << 24) \ - | (((unsigned int) (g) & 0xff) << 16) \ - | (((unsigned int) (b) & 0xff) << 8) \ - | ( (unsigned int) (a) & 0xff ) ) - - -#define GL_COLOR_NONE GL_COLOR_A(0,0,0,0) -#define GL_COLOR_FILL_MERGE_DEFAULT GL_COLOR_A(255,255,255,128) -#define GL_COLOR_MERGE_DEFAULT GL_COLOR_A(0,0,0,128) -#define GL_COLOR_SHADOW_DEFAULT GL_COLOR(0,0,0) -#define GL_COLOR_SHADOW_MERGE_DEFAULT GL_COLOR_A(0,0,0,255) - - -/* - * Extract components as floating point (0.0 .. 1.0) - */ -#define GL_COLOR_F_RED(x) ( (((x)>>24) & 0xff) / 255.0 ) -#define GL_COLOR_F_GREEN(x) ( (((x)>>16) & 0xff) / 255.0 ) -#define GL_COLOR_F_BLUE(x) ( (((x)>>8) & 0xff) / 255.0 ) -#define GL_COLOR_F_ALPHA(x) ( ( (x) & 0xff) / 255.0 ) - -/* - * Extract arguments for cairo_set_source_rgb() - */ -#define GL_COLOR_RGB_ARGS(x) \ - GL_COLOR_F_RED(x), \ - GL_COLOR_F_GREEN(x), \ - GL_COLOR_F_BLUE(x) - -/* - * Extract arguments for cairo_set_source_rgba() - */ -#define GL_COLOR_RGBA_ARGS(x) \ - GL_COLOR_F_RED(x), \ - GL_COLOR_F_GREEN(x), \ - GL_COLOR_F_BLUE(x), \ - GL_COLOR_F_ALPHA(x) - - - - -guint gl_color_set_opacity (guint color, - gdouble opacity); - -guint gl_color_shadow (guint base_color, - gdouble opacity, - guint object_color); - -/* - * Routines to convert to/from GdkColor. - */ -GdkColor *gl_color_to_gdk_color (guint color); - -guint gl_color_from_gdk_color (GdkColor *gdk_color); - - - -/* - * Color nodes - */ -typedef struct { - gboolean field_flag; - guint color; - gchar *key; -} glColorNode; - -glColorNode *gl_color_node_new_default (void); - -glColorNode *gl_color_node_dup (glColorNode *color_node); -gboolean gl_color_node_equal (glColorNode *color_node1, - glColorNode *color_node2); -guint gl_color_node_expand (glColorNode *color_node, - glMergeRecord *record); -void gl_color_node_free (glColorNode **color_node); - - -G_END_DECLS - -#endif /* __COLOR_H__ */ diff --git a/glabels2/src/critical-error-handler.c b/glabels2/src/critical-error-handler.c deleted file mode 100644 index 69a88665..00000000 --- a/glabels2/src/critical-error-handler.c +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * critical-error-handler.c: critical error handler - * - * Copyright (C) 2005 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include - -#include "critical-error-handler.h" - -#include -#include -#include -#include -#include - -static void critical_error_handler (const gchar *log_domain, - GLogLevelFlags log_level, - const gchar *message, - gpointer user_data); - - -/***************************************************************************/ -/* Initialize error handler. */ -/***************************************************************************/ -void -gl_critical_error_handler_init (void) -{ - g_log_set_handler ("LibGlabels", - G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, - critical_error_handler, - "libglabels"); - - g_log_set_handler (G_LOG_DOMAIN, - G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, - critical_error_handler, - "glabels"); -} - -/*-------------------------------------------------------------------------*/ -/* PRIVATE. Actual error handler. */ -/*-------------------------------------------------------------------------*/ -static void -critical_error_handler (const gchar *log_domain, - GLogLevelFlags log_level, - const gchar *message, - gpointer user_data) -{ - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_NONE, - _("gLabels Fatal Error!")); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - "%s", message); - gtk_dialog_add_button (GTK_DIALOG (dialog), - GTK_STOCK_QUIT, 0); - - gtk_dialog_run (GTK_DIALOG (dialog)); - - abort (); -} - diff --git a/glabels2/src/critical-error-handler.h b/glabels2/src/critical-error-handler.h deleted file mode 100644 index 890db9b5..00000000 --- a/glabels2/src/critical-error-handler.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * critical-error-handler.h: critical error handler header file - * - * Copyright (C) 2005 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __CRITICAL_ERROR_HANDLER_H__ -#define __CRITICAL_ERROR_HANDLER_H__ - -#include - -G_BEGIN_DECLS - -void gl_critical_error_handler_init (void); - -G_END_DECLS - -#endif diff --git a/glabels2/src/debug.c b/glabels2/src/debug.c deleted file mode 100644 index eea3fe5d..00000000 --- a/glabels2/src/debug.c +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * debug.c: GLabels debug module - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * This file is based on gedit-debug.c from gedit2: - * - * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence - * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi - * - */ - -#include "debug.h" - -#include -#include -#include -#include - -glDebugSection debug_flags = GLABELS_DEBUG_NONE; - -/****************************************************************************/ -/* Initialize debug flags, based on environmental variables. */ -/****************************************************************************/ -void -gl_debug_init (void) -{ - if (g_getenv ("GLABELS_DEBUG") != NULL) - { - /* enable all debugging */ - debug_flags = ~GLABELS_DEBUG_NONE; - return; - } - - if (g_getenv ("GLABELS_DEBUG_VIEW") != NULL) - debug_flags |= GLABELS_DEBUG_VIEW; - if (g_getenv ("GLABELS_DEBUG_ITEM") != NULL) - debug_flags |= GLABELS_DEBUG_ITEM; - if (g_getenv ("GLABELS_DEBUG_PRINT") != NULL) - debug_flags |= GLABELS_DEBUG_PRINT; - if (g_getenv ("GLABELS_DEBUG_PREFS") != NULL) - debug_flags |= GLABELS_DEBUG_PREFS; - if (g_getenv ("GLABELS_DEBUG_FILE") != NULL) - debug_flags |= GLABELS_DEBUG_FILE; - if (g_getenv ("GLABELS_DEBUG_LABEL") != NULL) - debug_flags |= GLABELS_DEBUG_LABEL; - if (g_getenv ("GLABELS_DEBUG_TEMPLATE") != NULL) - debug_flags |= GLABELS_DEBUG_TEMPLATE; - if (g_getenv ("GLABELS_DEBUG_PAPER") != NULL) - debug_flags |= GLABELS_DEBUG_PAPER; - if (g_getenv ("GLABELS_DEBUG_XML") != NULL) - debug_flags |= GLABELS_DEBUG_XML; - if (g_getenv ("GLABELS_DEBUG_MERGE") != NULL) - debug_flags |= GLABELS_DEBUG_MERGE; - if (g_getenv ("GLABELS_DEBUG_UNDO") != NULL) - debug_flags |= GLABELS_DEBUG_UNDO; - if (g_getenv ("GLABELS_DEBUG_RECENT") != NULL) - debug_flags |= GLABELS_DEBUG_RECENT; - if (g_getenv ("GLABELS_DEBUG_COMMANDS") != NULL) - debug_flags |= GLABELS_DEBUG_COMMANDS; - if (g_getenv ("GLABELS_DEBUG_WINDOW") != NULL) - debug_flags |= GLABELS_DEBUG_WINDOW; - if (g_getenv ("GLABELS_DEBUG_UI") != NULL) - debug_flags |= GLABELS_DEBUG_UI; - if (g_getenv ("GLABELS_DEBUG_PROPERTY_BAR") != NULL) - debug_flags |= GLABELS_DEBUG_PROPERTY_BAR; - if (g_getenv ("GLABELS_DEBUG_MEDIA_SELECT") != NULL) - debug_flags |= GLABELS_DEBUG_MEDIA_SELECT; - if (g_getenv ("GLABELS_DEBUG_MINI_PREVIEW") != NULL) - debug_flags |= GLABELS_DEBUG_MINI_PREVIEW; - if (g_getenv ("GLABELS_DEBUG_PIXBUF_CACHE") != NULL) - debug_flags |= GLABELS_DEBUG_PIXBUF_CACHE; - if (g_getenv ("GLABELS_DEBUG_EDITOR") != NULL) - debug_flags |= GLABELS_DEBUG_EDITOR; - if (g_getenv ("GLABELS_DEBUG_WDGT") != NULL) - debug_flags |= GLABELS_DEBUG_WDGT; - if (g_getenv ("GLABELS_DEBUG_PATH") != NULL) - debug_flags |= GLABELS_DEBUG_PATH; -} - - -/****************************************************************************/ -/* Print debugging information. */ -/****************************************************************************/ -void -gl_debug (glDebugSection section, - const gchar *file, - gint line, - const gchar *function, - const gchar *format, - ...) -{ - if (debug_flags & section) - { - va_list args; - gchar *msg; - - g_return_if_fail (format != NULL); - - va_start (args, format); - msg = g_strdup_vprintf (format, args); - va_end (args); - - g_print ("%s:%d (%s) %s\n", file, line, function, msg); - - g_free (msg); - } - -} diff --git a/glabels2/src/debug.h b/glabels2/src/debug.h deleted file mode 100644 index 5840487d..00000000 --- a/glabels2/src/debug.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * debug.h: GLabels debug module - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * This file is based on gedit-debug.h from gedit2: - * - * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence - * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi - * - */ -#ifndef __DEBUG_H__ -#define __DEBUG_H__ - -#include - -G_BEGIN_DECLS - -/* - * Set an environmental var of the same name to turn on - * debugging output. Setting GLABELS_DEBUG will turn on all - * sections. - */ - -typedef enum { - GLABELS_DEBUG_NONE = 0, - GLABELS_DEBUG_VIEW = 1 << 0, - GLABELS_DEBUG_ITEM = 1 << 1, - GLABELS_DEBUG_PRINT = 1 << 2, - GLABELS_DEBUG_PREFS = 1 << 3, - GLABELS_DEBUG_FILE = 1 << 4, - GLABELS_DEBUG_LABEL = 1 << 5, - GLABELS_DEBUG_TEMPLATE = 1 << 6, - GLABELS_DEBUG_PAPER = 1 << 7, - GLABELS_DEBUG_XML = 1 << 8, - GLABELS_DEBUG_MERGE = 1 << 9, - GLABELS_DEBUG_UNDO = 1 << 10, - GLABELS_DEBUG_RECENT = 1 << 11, - GLABELS_DEBUG_COMMANDS = 1 << 12, - GLABELS_DEBUG_WINDOW = 1 << 13, - GLABELS_DEBUG_UI = 1 << 14, - GLABELS_DEBUG_PROPERTY_BAR = 1 << 15, - GLABELS_DEBUG_MEDIA_SELECT = 1 << 16, - GLABELS_DEBUG_MINI_PREVIEW = 1 << 17, - GLABELS_DEBUG_PIXBUF_CACHE = 1 << 18, - GLABELS_DEBUG_EDITOR = 1 << 19, - GLABELS_DEBUG_WDGT = 1 << 20, - GLABELS_DEBUG_PATH = 1 << 21, -} glDebugSection; - - -#ifndef __GNUC__ -#define __FUNCTION__ "" -#endif - -#define DEBUG_VIEW GLABELS_DEBUG_VIEW, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_ITEM GLABELS_DEBUG_ITEM, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_PRINT GLABELS_DEBUG_PRINT, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_PREFS GLABELS_DEBUG_PREFS, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_FILE GLABELS_DEBUG_FILE, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_LABEL GLABELS_DEBUG_LABEL, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_TEMPLATE GLABELS_DEBUG_TEMPLATE,__FILE__, __LINE__, __FUNCTION__ -#define DEBUG_PAPER GLABELS_DEBUG_PAPER, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_XML GLABELS_DEBUG_XML, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_MERGE GLABELS_DEBUG_MERGE, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_UNDO GLABELS_DEBUG_UNDO, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_RECENT GLABELS_DEBUG_RECENT, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_COMMANDS GLABELS_DEBUG_COMMANDS,__FILE__, __LINE__, __FUNCTION__ -#define DEBUG_WINDOW GLABELS_DEBUG_WINDOW, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_UI GLABELS_DEBUG_UI, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_PROPERTY_BAR GLABELS_DEBUG_PROPERTY_BAR, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_MEDIA_SELECT GLABELS_DEBUG_MEDIA_SELECT, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_MINI_PREVIEW GLABELS_DEBUG_MINI_PREVIEW, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_PIXBUF_CACHE GLABELS_DEBUG_PIXBUF_CACHE, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_EDITOR GLABELS_DEBUG_EDITOR, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_WDGT GLABELS_DEBUG_WDGT, __FILE__, __LINE__, __FUNCTION__ -#define DEBUG_PATH GLABELS_DEBUG_PATH, __FILE__, __LINE__, __FUNCTION__ - -void gl_debug_init (void); - -void gl_debug (glDebugSection section, - const gchar *file, - gint line, - const gchar *function, - const gchar *format, - ...); - -G_END_DECLS - -#endif /* __DEBUG_H__ */ diff --git a/glabels2/src/file.c b/glabels2/src/file.c deleted file mode 100644 index 86073e75..00000000 --- a/glabels2/src/file.c +++ /dev/null @@ -1,844 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * file.c: FILE menu dialog module - * - * Copyright (C) 2001 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "file.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "xml-label.h" -#include "recent.h" -#include "util.h" -#include "window.h" -#include "new-label-dialog.h" -#include "libglabels/libglabels.h" -#include "debug.h" - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/* Saved state for new dialog */ -static gchar *page_size = NULL; -static gchar *category = NULL; -static gchar *sheet_name = NULL; -static gboolean rotate_flag = FALSE; - -/* Saved state of file selectors */ -static gchar *open_path = NULL; -static gchar *save_path = NULL; - -/*===========================================*/ -/* Local function prototypes. */ -/*===========================================*/ -static void new_response (GtkDialog *dialog, - gint response, - gpointer user_data); - -static void properties_response (GtkDialog *dialog, - gint response, - gpointer user_data); - -static void open_response (GtkDialog *chooser, - gint response, - glWindow *window); -static void save_as_response (GtkDialog *chooser, - gint response, - glLabel *label); - - -/*****************************************************************************/ -/* "New" menu callback. */ -/*****************************************************************************/ -void -gl_file_new (glWindow *window) -{ - GtkWidget *dialog; - - gl_debug (DEBUG_FILE, "START"); - - g_return_if_fail (window && GTK_IS_WINDOW (window)); - - dialog = gl_new_label_dialog_new (GTK_WINDOW (window)); - gtk_window_set_title (GTK_WINDOW (dialog), _("New Label or Card")); - - g_object_set_data (G_OBJECT (dialog), "parent_window", window); - - g_signal_connect (G_OBJECT(dialog), "response", - G_CALLBACK (new_response), dialog); - - if (page_size != NULL) { - gl_new_label_dialog_set_filter_parameters (GL_NEW_LABEL_DIALOG (dialog), - page_size, - category); - } - if (sheet_name != NULL) { - gl_new_label_dialog_set_template_name (GL_NEW_LABEL_DIALOG (dialog), - sheet_name); - } - gl_new_label_dialog_set_rotate_state (GL_NEW_LABEL_DIALOG (dialog), rotate_flag); - - gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); - gtk_widget_show_all (GTK_WIDGET (dialog)); - - gl_debug (DEBUG_FILE, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. New "ok" button callback. */ -/*---------------------------------------------------------------------------*/ -static void -new_response (GtkDialog *dialog, - gint response, - gpointer user_data) -{ - lglTemplate *template; - glLabel *label; - glWindow *window; - GtkWidget *new_window; - - gl_debug (DEBUG_FILE, "START"); - - switch (response) { - - case GTK_RESPONSE_OK: - - gl_new_label_dialog_get_filter_parameters (GL_NEW_LABEL_DIALOG (dialog), - &page_size, - &category); - - if (sheet_name != NULL) - g_free (sheet_name); - sheet_name = - gl_new_label_dialog_get_template_name (GL_NEW_LABEL_DIALOG (dialog)); - - rotate_flag = - gl_new_label_dialog_get_rotate_state (GL_NEW_LABEL_DIALOG (dialog)); - - template = lgl_db_lookup_template_from_name (sheet_name); - - label = GL_LABEL(gl_label_new ()); - gl_label_set_template (label, template); - gl_label_set_rotate_flag (label, rotate_flag); - - lgl_template_free (template); - - window = - GL_WINDOW (g_object_get_data (G_OBJECT (dialog), - "parent_window")); - if ( gl_window_is_empty (window) ) { - gl_window_set_label (window, label); - } else { - new_window = gl_window_new_from_label (label); - gtk_widget_show_all (new_window); - } - - break; - - default: - break; - } - - gtk_widget_destroy (GTK_WIDGET (dialog)); - - gl_debug (DEBUG_FILE, "END"); -} - -/*****************************************************************************/ -/* "Properties" menu callback. */ -/*****************************************************************************/ -void -gl_file_properties (glLabel *label, - glWindow *window) -{ - GtkWidget *dialog; - gchar *name; - - gl_debug (DEBUG_FILE, "START"); - - g_return_if_fail (label && GL_IS_LABEL (label)); - g_return_if_fail (window && GTK_IS_WINDOW (window)); - - dialog = gl_new_label_dialog_new (GTK_WINDOW (window)); - gtk_window_set_title (GTK_WINDOW (dialog), _("Label properties")); - - g_object_set_data (G_OBJECT (dialog), "label", label); - - g_signal_connect (G_OBJECT(dialog), "response", - G_CALLBACK (properties_response), dialog); - - if (label->template->paper_id != NULL) { - gl_new_label_dialog_set_filter_parameters (GL_NEW_LABEL_DIALOG (dialog), - label->template->paper_id, - NULL); - } - name = lgl_template_get_name (label->template); - if (name != NULL) { - gl_new_label_dialog_set_template_name (GL_NEW_LABEL_DIALOG (dialog), name); - } - g_free (name); - - gl_new_label_dialog_set_rotate_state (GL_NEW_LABEL_DIALOG (dialog), - label->rotate_flag); - - gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); - gtk_widget_show_all (GTK_WIDGET (dialog)); - - gl_debug (DEBUG_FILE, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Properties "ok" button callback. */ -/*---------------------------------------------------------------------------*/ -static void -properties_response (GtkDialog *dialog, - gint response, - gpointer user_data) -{ - lglTemplate *template; - glLabel *label; - - gl_debug (DEBUG_FILE, "START"); - - switch (response) { - - case GTK_RESPONSE_OK: - - gl_new_label_dialog_get_filter_parameters (GL_NEW_LABEL_DIALOG (dialog), - &page_size, - &category); - - if (sheet_name != NULL) - g_free (sheet_name); - sheet_name = - gl_new_label_dialog_get_template_name (GL_NEW_LABEL_DIALOG (dialog)); - - rotate_flag = - gl_new_label_dialog_get_rotate_state (GL_NEW_LABEL_DIALOG (dialog)); - - template = lgl_db_lookup_template_from_name (sheet_name); - - label = GL_LABEL(g_object_get_data (G_OBJECT (dialog), "label")); - gl_label_set_template (label, template); - gl_label_set_rotate_flag (label, rotate_flag); - - break; - - default: - break; - } - - gtk_widget_destroy (GTK_WIDGET (dialog)); - - gl_debug (DEBUG_FILE, "END"); -} - -/*****************************************************************************/ -/* "Open" menu callback. */ -/*****************************************************************************/ -void -gl_file_open (glWindow *window) -{ - GtkWidget *chooser; - GtkFileFilter *filter; - - gl_debug (DEBUG_FILE, "START"); - - g_return_if_fail (window != NULL); - - chooser = gtk_file_chooser_dialog_new ("Open label", - GTK_WINDOW (window), - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - NULL); - - /* Recover state of open dialog */ - if (open_path != NULL) { - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(chooser), - open_path); - } - - filter = gtk_file_filter_new (); - gtk_file_filter_add_pattern (filter, "*"); - gtk_file_filter_set_name (filter, _("All files")); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); - - filter = gtk_file_filter_new (); - gtk_file_filter_add_pattern (filter, "*.glabels"); - gtk_file_filter_set_name (filter, _("gLabels documents")); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); - - gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser), filter); - - g_signal_connect (G_OBJECT (chooser), "response", - G_CALLBACK (open_response), window); - - /* show the dialog */ - gtk_widget_show (GTK_WIDGET (chooser)); - - gl_debug (DEBUG_FILE, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Open "response" callback. */ -/*---------------------------------------------------------------------------*/ -static void -open_response (GtkDialog *chooser, - gint response, - glWindow *window) -{ - gchar *raw_filename; - gchar *filename; - GtkWidget *dialog; - - gl_debug (DEBUG_FILE, "START"); - - g_return_if_fail (chooser && GTK_IS_FILE_CHOOSER (chooser)); - g_return_if_fail (window && GTK_IS_WINDOW (window)); - - switch (response) { - - case GTK_RESPONSE_ACCEPT: - /* get the filename */ - raw_filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(chooser)); - filename = g_filename_to_utf8 (raw_filename, -1, NULL, NULL, NULL); - - if (!raw_filename || - !filename || - g_file_test (raw_filename, G_FILE_TEST_IS_DIR)) { - - dialog = gtk_message_dialog_new (GTK_WINDOW(chooser), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_CLOSE, - _("Empty file name selection")); - gtk_message_dialog_format_secondary_text ( - GTK_MESSAGE_DIALOG (dialog), - _("Please select a file or supply a valid file name")); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - - } else { - - if (!g_file_test (raw_filename, G_FILE_TEST_IS_REGULAR)) { - - dialog = gtk_message_dialog_new (GTK_WINDOW(chooser), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_CLOSE, - _("File does not exist")); - gtk_message_dialog_format_secondary_text ( - GTK_MESSAGE_DIALOG (dialog), - _("Please select a file or supply a valid file name")); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - - - } else { - - if ( gl_file_open_real (filename, window) ) { - gtk_widget_destroy (GTK_WIDGET (chooser)); - } - - } - - } - - g_free (filename); - g_free (raw_filename); - break; - - default: - gtk_widget_destroy (GTK_WIDGET (chooser)); - break; - - } - - gl_debug (DEBUG_FILE, "END"); -} - - -/*****************************************************************************/ -/* "Open recent" menu callback. */ -/*****************************************************************************/ -void -gl_file_open_recent (const gchar *filename, - glWindow *window) -{ - gl_debug (DEBUG_FILE, ""); - - if (filename) { - gl_debug (DEBUG_FILE, "open recent: %s", filename); - - gl_file_open_real (filename, window); - } -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Open a file. */ -/*---------------------------------------------------------------------------*/ -gboolean -gl_file_open_real (const gchar *filename, - glWindow *window) -{ - gchar *abs_filename; - glLabel *label; - glXMLLabelStatus status; - GtkWidget *new_window; - - gl_debug (DEBUG_FILE, "START"); - - abs_filename = gl_util_make_absolute (filename); - label = gl_xml_label_open (abs_filename, &status); - if (!label) { - GtkWidget *dialog; - - gl_debug (DEBUG_FILE, "couldn't open file"); - - dialog = gtk_message_dialog_new (GTK_WINDOW (window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("Could not open file \"%s\""), - filename); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - _("Not a supported file format")); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - - g_free (abs_filename); - - gl_debug (DEBUG_FILE, "END false"); - - return FALSE; - - } else { - - if ( gl_window_is_empty (GL_WINDOW(window)) ) { - gl_window_set_label (GL_WINDOW(window), label); - } else { - new_window = gl_window_new_from_label (label); - gtk_widget_show_all (new_window); - } - - gl_recent_add_utf8_filename (abs_filename); - - if (open_path != NULL) - g_free (open_path); - open_path = g_path_get_dirname (abs_filename); - g_free (abs_filename); - - gl_debug (DEBUG_FILE, "END true"); - - return TRUE; - - } -} - -/*****************************************************************************/ -/* "Save" menu callback. */ -/*****************************************************************************/ -gboolean -gl_file_save (glLabel *label, - glWindow *window) -{ - glXMLLabelStatus status; - gchar *filename = NULL; - - gl_debug (DEBUG_FILE, ""); - - g_return_val_if_fail (label != NULL, FALSE); - - if (gl_label_is_untitled (label)) - { - gl_debug (DEBUG_FILE, "Untitled"); - - return gl_file_save_as (label, window); - } - - if (!gl_label_is_modified (label)) - { - gl_debug (DEBUG_FILE, "Not modified"); - - return TRUE; - } - - filename = gl_label_get_filename (label); - g_return_val_if_fail (filename != NULL, FALSE); - - gl_xml_label_save (label, filename, &status); - - if (status != XML_LABEL_OK) - { - GtkWidget *dialog; - - gl_debug (DEBUG_FILE, "FAILED"); - - dialog = gtk_message_dialog_new (GTK_WINDOW (window), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("Could not save file \"%s\""), - filename); - gtk_message_dialog_format_secondary_text ( - GTK_MESSAGE_DIALOG (dialog), - _("Error encountered during save. The file is still not saved.")); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - - g_free (filename); - - return FALSE; - } - else - { - gl_debug (DEBUG_FILE, "OK"); - - gl_recent_add_utf8_filename (filename); - - g_free (filename); - - return TRUE; - } -} - -/*****************************************************************************/ -/* "Save As" menu callback. */ -/*****************************************************************************/ -gboolean -gl_file_save_as (glLabel *label, - glWindow *window) -{ - GtkWidget *chooser; - GtkFileFilter *filter; - gboolean saved_flag = FALSE; - gchar *name, *title; - - gl_debug (DEBUG_FILE, "START"); - - g_return_val_if_fail (label && GL_IS_LABEL(label), FALSE); - g_return_val_if_fail (window && GL_IS_WINDOW(window), FALSE); - - name = gl_label_get_short_name (label); - title = g_strdup_printf (_("Save \"%s\" as"), name); - g_free (name); - - chooser = gtk_file_chooser_dialog_new (title, - GTK_WINDOW (window), - GTK_FILE_CHOOSER_ACTION_SAVE, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, - NULL); - - gtk_window_set_modal (GTK_WINDOW (chooser), TRUE); - - g_free (title); - - /* Recover proper state of save-as dialog */ - if (save_path != NULL) { - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(chooser), - save_path); - } - - filter = gtk_file_filter_new (); - gtk_file_filter_add_pattern (filter, "*"); - gtk_file_filter_set_name (filter, _("All files")); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); - - filter = gtk_file_filter_new (); - gtk_file_filter_add_pattern (filter, "*.glabels"); - gtk_file_filter_set_name (filter, _("gLabels documents")); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); - - gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser), filter); - - g_signal_connect (G_OBJECT (chooser), "response", - G_CALLBACK (save_as_response), label); - - g_object_set_data (G_OBJECT (chooser), "saved_flag", &saved_flag); - - /* show the dialog */ - gtk_widget_show (GTK_WIDGET (chooser)); - - /* Hold here and process events until we are done with this dialog. */ - /* This is so we can return a boolean result of our save attempt. */ - gtk_main (); - - gl_debug (DEBUG_FILE, "END"); - - /* Return flag as set by one of the above callbacks, TRUE = saved */ - return saved_flag; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. "Save As" ok button callback. */ -/*---------------------------------------------------------------------------*/ -static void -save_as_response (GtkDialog *chooser, - gint response, - glLabel *label) -{ - gchar *raw_filename, *filename, *full_filename; - GtkWidget *dialog; - glXMLLabelStatus status; - gboolean *saved_flag; - gboolean cancel_flag = FALSE; - - gl_debug (DEBUG_FILE, "START"); - - g_return_if_fail (GTK_IS_FILE_CHOOSER (chooser)); - - saved_flag = g_object_get_data (G_OBJECT(chooser), "saved_flag"); - - switch (response) { - - case GTK_RESPONSE_ACCEPT: - /* get the filename */ - raw_filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(chooser)); - - gl_debug (DEBUG_FILE, "raw_filename = \"%s\"", raw_filename); - - if (!raw_filename || g_file_test (raw_filename, G_FILE_TEST_IS_DIR)) { - - dialog = gtk_message_dialog_new (GTK_WINDOW(chooser), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_CLOSE, - _("Empty file name selection")); - gtk_message_dialog_format_secondary_text ( - GTK_MESSAGE_DIALOG (dialog), - _("Please supply a valid file name")); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - - } else { - - full_filename = gl_util_add_extension (raw_filename); - - filename = g_filename_to_utf8 (full_filename, -1, - NULL, NULL, NULL); - - gl_debug (DEBUG_FILE, "filename = \"%s\"", filename); - - if (g_file_test (full_filename, G_FILE_TEST_IS_REGULAR)) { - gint ret; - - dialog = gtk_message_dialog_new (GTK_WINDOW(chooser), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_YES_NO, - _("Overwrite file \"%s\"?"), - filename); - gtk_message_dialog_format_secondary_text ( - GTK_MESSAGE_DIALOG (dialog), - _("File already exists.")); - - ret = gtk_dialog_run (GTK_DIALOG (dialog)); - if ( ret == GTK_RESPONSE_NO ) { - cancel_flag = TRUE; - } - gtk_widget_destroy (dialog); - } - - if (!cancel_flag) { - - gl_xml_label_save (label, filename, &status); - - gl_debug (DEBUG_FILE, "status of save = %d", status); - - if ( status != XML_LABEL_OK ) { - - dialog = gtk_message_dialog_new ( - GTK_WINDOW(chooser), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("Could not save file \"%s\""), - filename); - gtk_message_dialog_format_secondary_text ( - GTK_MESSAGE_DIALOG (dialog), - _("Error encountered during save. The file is still not saved.")); - - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - - } else { - - *saved_flag = TRUE; - - gl_recent_add_utf8_filename (filename); - - if (save_path != NULL) - g_free (save_path); - save_path = g_path_get_dirname (filename); - - gtk_widget_destroy (GTK_WIDGET (chooser)); - gtk_main_quit (); - } - - } - - g_free (filename); - g_free (full_filename); - } - - g_free (raw_filename); - break; - - default: - *saved_flag = FALSE; - gtk_widget_destroy (GTK_WIDGET (chooser)); - gtk_main_quit (); - break; - - } - - gl_debug (DEBUG_FILE, "END"); -} - - -/*****************************************************************************/ -/* "Close" menu callback. */ -/*****************************************************************************/ -gboolean -gl_file_close (glWindow *window) -{ - glView *view; - glLabel *label; - gboolean close = TRUE; - - gl_debug (DEBUG_FILE, "START"); - - g_return_val_if_fail (window && GL_IS_WINDOW(window), TRUE); - - if ( !gl_window_is_empty (window) ) { - - view = GL_VIEW(window->view); - label = view->label; - - if (gl_label_is_modified (label)) { - GtkWidget *dialog; - gchar *fname = NULL; - gint ret; - - fname = gl_label_get_short_name (label); - - dialog = gtk_message_dialog_new (GTK_WINDOW(window), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, - _("Save changes to document \"%s\" before closing?"), - fname); - gtk_message_dialog_format_secondary_text ( - GTK_MESSAGE_DIALOG (dialog), - _("Your changes will be lost if you don't save them.")); - - gtk_dialog_add_button (GTK_DIALOG (dialog), - _("Close without saving"), - GTK_RESPONSE_NO); - - gtk_dialog_add_button (GTK_DIALOG (dialog), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); - - gtk_dialog_add_button (GTK_DIALOG (dialog), - GTK_STOCK_SAVE, GTK_RESPONSE_YES); - - gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES); - - gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); - - ret = gtk_dialog_run (GTK_DIALOG (dialog)); - - gtk_widget_destroy (dialog); - - g_free (fname); - - switch (ret) - { - case GTK_RESPONSE_YES: - close = gl_file_save (label, window); - break; - case GTK_RESPONSE_NO: - close = TRUE; - break; - default: - close = FALSE; - } - - gl_debug (DEBUG_FILE, "CLOSE: %s", close ? "TRUE" : "FALSE"); - } - - } - - if (close) { - gtk_widget_destroy (GTK_WIDGET(window)); - - if ( gl_window_get_window_list () == NULL ) { - - gl_debug (DEBUG_FILE, "All windows closed."); - - gtk_main_quit (); - } - - } - - gl_debug (DEBUG_FILE, "END"); - - return close; -} - -/*****************************************************************************/ -/* "Exit" menu callback. */ -/*****************************************************************************/ -void -gl_file_exit (void) -{ - const GList *window_list; - GList *p, *p_next; - - gl_debug (DEBUG_FILE, "START"); - - window_list = gl_window_get_window_list (); - - for (p=(GList *)window_list; p != NULL; p=p_next) { - p_next = p->next; - - gl_file_close (GL_WINDOW(p->data)); - } - - gl_debug (DEBUG_FILE, "END"); -} diff --git a/glabels2/src/file.h b/glabels2/src/file.h deleted file mode 100644 index ba826075..00000000 --- a/glabels2/src/file.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * file.h: FILE menu dialog module header file - * - * Copyright (C) 2000 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __FILE_H__ -#define __FILE_H__ - -#include - -#include "label.h" -#include "window.h" - -G_BEGIN_DECLS - -void gl_file_new (glWindow *window); - - -void gl_file_properties (glLabel *label, - glWindow *window); - - -void gl_file_open (glWindow *window); - - -void gl_file_open_recent (const gchar *filename, - glWindow *window); - -gboolean gl_file_open_real (const gchar *filename, - glWindow *window); - - -gboolean gl_file_save (glLabel *label, - glWindow *window); - -gboolean gl_file_save_as (glLabel *label, - glWindow *window); - - -gboolean gl_file_close (glWindow *window); - -void gl_file_exit (void); - -G_END_DECLS - -#endif /* __FILE_H__ */ diff --git a/glabels2/src/glabels-batch.c b/glabels2/src/glabels-batch.c deleted file mode 100644 index 41ebf9d6..00000000 --- a/glabels2/src/glabels-batch.c +++ /dev/null @@ -1,173 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * glabels.c: main program module - * - * Copyright (C) 2001 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include -#include - -#include "merge-init.h" -#include "xml-label.h" -#include "print.h" -#include "print-op.h" -#include -#include "util.h" -#include "prefs.h" -#include "debug.h" - -/*============================================*/ -/* Private globals */ -/*============================================*/ -static gchar *output = "output.pdf"; -static gint n_copies = 1; -static gint n_sheets = 1; -static gint first = 1; -static gboolean outline_flag = FALSE; -static gboolean reverse_flag = FALSE; -static gboolean crop_marks_flag = FALSE; -static gchar *input = NULL; -static gchar **remaining_args = NULL; - -static GOptionEntry option_entries[] = { - {"output", 'o', 0, G_OPTION_ARG_STRING, &output, - N_("set output filename (default=\"output.pdf\")"), N_("filename")}, - {"sheets", 's', 0, G_OPTION_ARG_INT, &n_sheets, - N_("number of sheets (default=1)"), N_("sheets")}, - {"copies", 'c', 0, G_OPTION_ARG_INT, &n_copies, - N_("number of copies (default=1)"), N_("copies")}, - {"first", 'f', 0, G_OPTION_ARG_INT, &first, - N_("first label on first sheet (default=1)"), N_("first")}, - {"outline", 'l', 0, G_OPTION_ARG_NONE, &outline_flag, - N_("print outlines (to test printer alignment)"), NULL}, - {"reverse", 'r', 0, G_OPTION_ARG_NONE, &reverse_flag, - N_("print in reverse (i.e. a mirror image)"), NULL}, - {"cropmarks", 'C', 0, G_OPTION_ARG_NONE, &crop_marks_flag, - N_("print crop marks"), NULL}, - {"input", 'i', 0, G_OPTION_ARG_STRING, &input, - N_("input file for merging"), N_("filename")}, - { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, - &remaining_args, NULL, N_("[FILE...]") }, - { NULL } -}; - - - -/*****************************************************************************/ -/* Main */ -/*****************************************************************************/ -int -main (int argc, char **argv) -{ - GOptionContext *option_context; - GnomeProgram *program; - GList *p, *file_list = NULL; - gchar *abs_fn; - glLabel *label = NULL; - glMerge *merge = NULL; - glXMLLabelStatus status; - glPrintOp *print_op; - gchar *utf8_filename; - - bindtextdomain (GETTEXT_PACKAGE, GLABELS_LOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - - option_context = g_option_context_new (_("- batch process gLabels label files")); - g_option_context_add_main_entries (option_context, option_entries, GETTEXT_PACKAGE); - - - /* Initialize minimal gnome program */ - program = gnome_program_init ("glabels-batch", VERSION, - LIBGNOME_MODULE, argc, argv, - GNOME_PARAM_GOPTION_CONTEXT, option_context, - GNOME_PROGRAM_STANDARD_PROPERTIES, - NULL); - - /* create file list */ - if (remaining_args != NULL) { - gint i, num_args; - - num_args = g_strv_length (remaining_args); - for (i = 0; i < num_args; ++i) { - utf8_filename = g_filename_to_utf8 (remaining_args[i], -1, NULL, NULL, NULL); - if (utf8_filename) - file_list = g_list_append (file_list, utf8_filename); - } - g_strfreev (remaining_args); - remaining_args = NULL; - } - - /* initialize components */ - gl_debug_init (); - gl_merge_init (); - lgl_db_init (); - gl_prefs_init (); - - /* now print the files */ - for (p = file_list; p; p = p->next) { - g_print ("LABEL FILE = %s\n", (gchar *) p->data); - label = gl_xml_label_open (p->data, &status); - - - if ( status == XML_LABEL_OK ) { - - if (input != NULL) { - merge = gl_label_get_merge (label); - if (merge != NULL) { - gl_merge_set_src(merge, input); - gl_label_set_merge(label, merge); - } else { - fprintf ( stderr, - _("cannot perform document merge with glabels file %s\n"), - (char *)p->data ); - } - } - abs_fn = gl_util_make_absolute ( output ); - print_op = gl_print_op_new_batch (label, - abs_fn, - n_sheets, - n_copies, - first, - outline_flag, - reverse_flag, - crop_marks_flag); - - gtk_print_operation_run (GTK_PRINT_OPERATION (print_op), - GTK_PRINT_OPERATION_ACTION_EXPORT, - NULL, - NULL); - - g_object_unref (label); - } - else { - fprintf ( stderr, _("cannot open glabels file %s\n"), - (char *)p->data ); - } - } - - g_list_free (file_list); - - return 0; -} - diff --git a/glabels2/src/glabels.c b/glabels2/src/glabels.c deleted file mode 100644 index 832b0821..00000000 --- a/glabels2/src/glabels.c +++ /dev/null @@ -1,218 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/** - * (GLABELS) Label and Business Card Creation program for GNOME - * - * glabels.c: GLabels main module - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include -#include -#include -#include - -#include "warning-handler.h" -#include "critical-error-handler.h" -#include "stock.h" -#include "merge-init.h" -#include "recent.h" -#include -#include "mini-preview-pixbuf-cache.h" -#include "prefs.h" -#include "debug.h" -#include "window.h" -#include "file.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -/*========================================================*/ -/* Private globals */ -/*========================================================*/ - -/*========================================================*/ -/* Local function prototypes */ -/*========================================================*/ -gboolean save_session_cb (GnomeClient *client, - gint phase, - GnomeRestartStyle save_style, - gint shutdown, - GnomeInteractStyle interact_style, - gint fast, - gpointer client_data); - -void client_die_cb (GnomeClient *client, - gpointer client_data); - -/****************************************************************************/ -/* main program */ -/****************************************************************************/ -int -main (int argc, char **argv) -{ - gchar **remaining_args = NULL; - GOptionEntry option_entries[] = { - { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, - &remaining_args, NULL, N_("[FILE...]") }, - { NULL } - }; - - GOptionContext *option_context; - GnomeProgram *program; - gchar *icon_file; - GnomeClient *client; - GList *file_list = NULL, *p; - GtkWidget *win; - gchar *utf8_filename; - - bindtextdomain (GETTEXT_PACKAGE, GLABELS_LOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - - option_context = g_option_context_new (_("- gLabels label designer")); - g_option_context_add_main_entries (option_context, option_entries, GETTEXT_PACKAGE); - - - /* Initialize gnome program */ - program = gnome_program_init ("glabels", VERSION, - LIBGNOMEUI_MODULE, argc, argv, - GNOME_PARAM_GOPTION_CONTEXT, option_context, - GNOME_PROGRAM_STANDARD_PROPERTIES, - NULL); - - /* Install GUI handlers for critical error and warning messages */ - gl_critical_error_handler_init(); - gl_warning_handler_init(); - - /* Set default icon */ - icon_file = GLABELS_ICON_DIR "glabels.png"; - if (!g_file_test (icon_file, G_FILE_TEST_EXISTS)) - { - g_message ("Could not find %s", icon_file); - } - else - { - gnome_window_icon_set_default_from_file (icon_file); - } - - - /* Initialize subsystems */ - gl_debug_init (); - gl_stock_init (); - lgl_db_init (); - gl_prefs_init (); - gl_mini_preview_pixbuf_cache_init (); - gl_merge_init (); - gl_recent_init (); - - - client = gnome_master_client(); - - g_signal_connect (G_OBJECT (client), "save_yourself", - G_CALLBACK (save_session_cb), - (gpointer)argv[0]); - - g_signal_connect (G_OBJECT (client), "die", - G_CALLBACK (client_die_cb), NULL); - - - /* Parse args and build the list of files to be loaded at startup */ - if (remaining_args != NULL) { - gint i, num_args; - - num_args = g_strv_length (remaining_args); - for (i = 0; i < num_args; ++i) { - utf8_filename = g_filename_to_utf8 (remaining_args[i], -1, NULL, NULL, NULL); - if (utf8_filename) - file_list = g_list_append (file_list, utf8_filename); - } - g_strfreev (remaining_args); - remaining_args = NULL; - } - - - /* Open files or create empty top-level window. */ - for (p = file_list; p; p = p->next) { - win = gl_window_new_from_file (p->data); - gtk_widget_show_all (win); - g_free (p->data); - } - if ( gl_window_get_window_list() == NULL ) { - win = gl_window_new (); - gtk_widget_show_all (win); - } - g_list_free (file_list); - - - /* Begin main loop */ - gtk_main(); - - g_object_unref (G_OBJECT (program)); - - return 0; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. "Save session" callback. */ -/*---------------------------------------------------------------------------*/ -gboolean save_session_cb (GnomeClient *client, - gint phase, - GnomeRestartStyle save_style, - gint shutdown, - GnomeInteractStyle interact_style, - gint fast, - gpointer client_data) -{ - gchar *argv[128]; - gint argc; - const GList *window_list; - GList *p; - glWindow *window; - glLabel *label; - - argv[0] = (gchar *)client_data; - argc = 1; - - window_list = gl_window_get_window_list(); - for ( p=(GList *)window_list; p != NULL; p=p->next ) { - window = GL_WINDOW(p->data); - if ( !gl_window_is_empty (window) ) { - label = GL_VIEW(window->view)->label; - argv[argc++] = gl_label_get_filename (label); - } - } - gnome_client_set_clone_command(client, argc, argv); - gnome_client_set_restart_command(client, argc, argv); - - return TRUE; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. "Die" callback. */ -/*---------------------------------------------------------------------------*/ -void client_die_cb (GnomeClient *client, - gpointer client_data) -{ - gl_file_exit (); -} - - diff --git a/glabels2/src/hig.h b/glabels2/src/hig.h deleted file mode 100644 index 6b4c2494..00000000 --- a/glabels2/src/hig.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * hig.h: HIG inspired dialogs and layout tools - * - * Copyright (C) 2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __HIG_H__ -#define __HIG_H__ - -G_BEGIN_DECLS - -#define GL_HIG_PAD1 6 -#define GL_HIG_PAD2 12 - -G_END_DECLS - -#endif /* __HIG_H__ */ diff --git a/glabels2/src/label-barcode.c b/glabels2/src/label-barcode.c deleted file mode 100644 index 1f008ed5..00000000 --- a/glabels2/src/label-barcode.c +++ /dev/null @@ -1,483 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_barcode.c: GLabels label text object - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "label-barcode.h" - -#include -#include -#include -#include -#include -#include - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -#define FONT_SCALE (72.0/96.0) - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glLabelBarcodePrivate { - glTextNode *text_node; - gchar *id; - glColorNode *color_node; - gboolean text_flag; - gboolean checksum_flag; - guint format_digits; -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_label_barcode_finalize (GObject *object); - -static void copy (glLabelObject *dst_object, - glLabelObject *src_object); - -static void get_size (glLabelObject *object, - gdouble *w, - gdouble *h); - -static void set_line_color (glLabelObject *object, - glColorNode *line_color); - -static glColorNode *get_line_color (glLabelObject *object); - -static void draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glLabelBarcode, gl_label_barcode, GL_TYPE_LABEL_OBJECT); - -static void -gl_label_barcode_class_init (glLabelBarcodeClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); - - gl_label_barcode_parent_class = g_type_class_peek_parent (class); - - label_object_class->copy = copy; - label_object_class->get_size = get_size; - label_object_class->set_line_color = set_line_color; - label_object_class->get_line_color = get_line_color; - label_object_class->draw_object = draw_object; - label_object_class->draw_shadow = NULL; - - object_class->finalize = gl_label_barcode_finalize; -} - -static void -gl_label_barcode_init (glLabelBarcode *lbc) -{ - lbc->priv = g_new0 (glLabelBarcodePrivate, 1); - lbc->priv->color_node = gl_color_node_new_default (); - lbc->priv->text_node = gl_text_node_new_from_text (""); -} - -static void -gl_label_barcode_finalize (GObject *object) -{ - glLabelBarcode *lbc = GL_LABEL_BARCODE (object); - - g_return_if_fail (object && GL_IS_LABEL_BARCODE (object)); - - gl_text_node_free (&lbc->priv->text_node); - g_free (lbc->priv->id); - gl_color_node_free (&(lbc->priv->color_node)); - g_free (lbc->priv); - - G_OBJECT_CLASS (gl_label_barcode_parent_class)->finalize (object); -} - -/*****************************************************************************/ -/* NEW label "barcode" object. */ -/*****************************************************************************/ -GObject * -gl_label_barcode_new (glLabel *label) -{ - glLabelBarcode *lbc; - - lbc = g_object_new (gl_label_barcode_get_type(), NULL); - - gl_label_object_set_parent (GL_LABEL_OBJECT(lbc), label); - - return G_OBJECT (lbc); -} - -/*****************************************************************************/ -/* Copy object contents. */ -/*****************************************************************************/ -static void -copy (glLabelObject *dst_object, - glLabelObject *src_object) -{ - glLabelBarcode *lbc = (glLabelBarcode *)src_object; - glLabelBarcode *new_lbc = (glLabelBarcode *)dst_object; - glTextNode *text_node; - gchar *id; - gboolean text_flag; - gboolean checksum_flag; - glColorNode *color_node; - guint format_digits; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc)); - g_return_if_fail (new_lbc && GL_IS_LABEL_BARCODE (new_lbc)); - - text_node = gl_label_barcode_get_data (lbc); - gl_label_barcode_get_props (lbc, &id, &text_flag, &checksum_flag, &format_digits); - color_node = get_line_color (src_object); - - gl_label_barcode_set_data (new_lbc, text_node); - gl_label_barcode_set_props (new_lbc, id, text_flag, checksum_flag, format_digits); - set_line_color (dst_object, color_node); - - gl_color_node_free (&color_node); - gl_text_node_free (&text_node); - g_free (id); - - gl_debug (DEBUG_LABEL, "END"); -} - - -/*****************************************************************************/ -/* Set object params. */ -/*****************************************************************************/ -void -gl_label_barcode_set_data (glLabelBarcode *lbc, - glTextNode *text_node) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc)); - - if (!gl_text_node_equal (lbc->priv->text_node, text_node)) { - - gl_text_node_free (&lbc->priv->text_node); - lbc->priv->text_node = gl_text_node_dup (text_node); - - gl_label_object_emit_changed (GL_LABEL_OBJECT(lbc)); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -void -gl_label_barcode_set_props (glLabelBarcode *lbc, - gchar *id, - gboolean text_flag, - gboolean checksum_flag, - guint format_digits) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc)); - - if ( ((lbc->priv->id == NULL) && (id != NULL)) - || (g_strcasecmp (lbc->priv->id, id) != 0) - || (lbc->priv->text_flag != text_flag) - || (lbc->priv->checksum_flag != checksum_flag) - || (lbc->priv->format_digits != format_digits)) { - - lbc->priv->id = g_strdup (id); - lbc->priv->text_flag = text_flag; - lbc->priv->checksum_flag = checksum_flag; - lbc->priv->format_digits = format_digits; - - gl_label_object_emit_changed (GL_LABEL_OBJECT(lbc)); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - - -/*****************************************************************************/ -/* Get object params. */ -/*****************************************************************************/ -glTextNode * -gl_label_barcode_get_data (glLabelBarcode *lbc) -{ - g_return_val_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc), NULL); - - return gl_text_node_dup (lbc->priv->text_node); -} - -void -gl_label_barcode_get_props (glLabelBarcode *lbc, - gchar **id, - gboolean *text_flag, - gboolean *checksum_flag, - guint *format_digits) -{ - g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc)); - - *id = g_strdup (lbc->priv->id); - *text_flag = lbc->priv->text_flag; - *checksum_flag = lbc->priv->checksum_flag; - *format_digits = lbc->priv->format_digits; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Get object size method. */ -/*---------------------------------------------------------------------------*/ -static void -get_size (glLabelObject *object, - gdouble *w, - gdouble *h) -{ - glLabelBarcode *lbc = (glLabelBarcode *)object; - gchar *data; - gdouble w_parent, h_parent; - glBarcode *gbc; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc)); - - gl_label_object_get_raw_size (object, &w_parent, &h_parent); - - if (lbc->priv->text_node->field_flag) { - data = gl_barcode_default_digits (lbc->priv->id, - lbc->priv->format_digits); - } else { - data = gl_text_node_expand (lbc->priv->text_node, NULL); - } - - gbc = gl_barcode_new (lbc->priv->id, - lbc->priv->text_flag, - lbc->priv->checksum_flag, - w_parent, - h_parent, - data); - g_free (data); - - if ( gbc == NULL ) { - /* Try again with default digits. */ - data = gl_barcode_default_digits (lbc->priv->id, - lbc->priv->format_digits); - gbc = gl_barcode_new (lbc->priv->id, - lbc->priv->text_flag, - lbc->priv->checksum_flag, - w_parent, - h_parent, - data); - g_free (data); - } - - if ( gbc != NULL ) - { - *w = gbc->width; - *h = gbc->height; - } - else - { - /* If we still can't render, just set a default size. */ - *w = 144; - *h = 72; - } - - gl_barcode_free (&gbc); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set line color method. */ -/*---------------------------------------------------------------------------*/ -static void -set_line_color (glLabelObject *object, - glColorNode *line_color_node) -{ - glLabelBarcode *lbarcode = (glLabelBarcode *)object; - - g_return_if_fail (lbarcode && GL_IS_LABEL_BARCODE (lbarcode)); - - if ( !gl_color_node_equal(lbarcode->priv->color_node, line_color_node) ) { - - gl_color_node_free (&(lbarcode->priv->color_node)); - lbarcode->priv->color_node = gl_color_node_dup (line_color_node); - gl_label_object_emit_changed (GL_LABEL_OBJECT(lbarcode)); - } -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Get line color method. */ -/*---------------------------------------------------------------------------*/ -static glColorNode* -get_line_color (glLabelObject *object) -{ - glLabelBarcode *lbarcode = (glLabelBarcode *)object; - - g_return_val_if_fail (lbarcode && GL_IS_LABEL_BARCODE (lbarcode), NULL); - - return gl_color_node_dup (lbarcode->priv->color_node); -} - -/*****************************************************************************/ -/* Draw object method. */ -/*****************************************************************************/ -static void -draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) -{ - gdouble x0, y0; - cairo_matrix_t matrix; - glBarcode *gbc; - glBarcodeLine *line; - glBarcodeChar *bchar; - GList *li; - gdouble y_offset; - PangoLayout *layout; - PangoFontDescription *desc; - gchar *text, *cstring; - glTextNode *text_node; - gchar *id; - gboolean text_flag; - gboolean checksum_flag; - guint color; - glColorNode *color_node; - guint format_digits; - gdouble w, h; - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_object_get_position (object, &x0, &y0); - gl_label_object_get_matrix (object, &matrix); - - text_node = gl_label_barcode_get_data (GL_LABEL_BARCODE (object)); - gl_label_barcode_get_props (GL_LABEL_BARCODE (object), - &id, &text_flag, &checksum_flag, &format_digits); - - color_node = gl_label_object_get_line_color (object); - color = gl_color_node_expand (color_node, record); - if (color_node->field_flag && screen_flag) - { - color = GL_COLOR_MERGE_DEFAULT; - } - gl_color_node_free (&color_node); - - gl_label_object_get_size (object, &w, &h); - - text_node = gl_label_barcode_get_data(GL_LABEL_BARCODE(object)); - text = gl_text_node_expand (text_node, record); - if (text_node->field_flag && screen_flag) { - text = gl_barcode_default_digits (id, format_digits); - } - - gbc = gl_barcode_new (id, text_flag, checksum_flag, w, h, text); - - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (color)); - - if (gbc == NULL) { - - layout = pango_cairo_create_layout (cr); - - desc = pango_font_description_new (); - pango_font_description_set_family (desc, GL_BARCODE_FONT_FAMILY); - pango_font_description_set_size (desc, 12 * PANGO_SCALE * FONT_SCALE); - pango_layout_set_font_description (layout, desc); - pango_font_description_free (desc); - - if (text == NULL || *text == '\0') - { - pango_layout_set_text (layout, _("Barcode data empty"), -1); - } - else - { - pango_layout_set_text (layout, _("Invalid barcode data"), -1); - } - - cairo_move_to (cr, 0, 0); - pango_cairo_show_layout (cr, layout); - - g_object_unref (layout); - - } else { - - for (li = gbc->lines; li != NULL; li = li->next) { - line = (glBarcodeLine *) li->data; - - cairo_move_to (cr, line->x, line->y); - cairo_line_to (cr, line->x, line->y + line->length); - cairo_set_line_width (cr, line->width); - cairo_stroke (cr); - } - - for (li = gbc->chars; li != NULL; li = li->next) { - bchar = (glBarcodeChar *) li->data; - - layout = pango_cairo_create_layout (cr); - - desc = pango_font_description_new (); - pango_font_description_set_family (desc, GL_BARCODE_FONT_FAMILY); - pango_font_description_set_size (desc, bchar->fsize * PANGO_SCALE * FONT_SCALE); - pango_layout_set_font_description (layout, desc); - pango_font_description_free (desc); - - cstring = g_strdup_printf ("%c", bchar->c); - pango_layout_set_text (layout, cstring, -1); - g_free (cstring); - - y_offset = 0.2 * bchar->fsize; - - cairo_move_to (cr, bchar->x, bchar->y-y_offset); - pango_cairo_show_layout (cr, layout); - - g_object_unref (layout); - - } - - gl_barcode_free (&gbc); - - } - - g_free (text); - gl_text_node_free (&text_node); - g_free (id); - - gl_debug (DEBUG_LABEL, "END"); -} - diff --git a/glabels2/src/label-barcode.h b/glabels2/src/label-barcode.h deleted file mode 100644 index 4eda31da..00000000 --- a/glabels2/src/label-barcode.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_barcode.h: GLabels label barcode object - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LABEL_BARCODE_H__ -#define __LABEL_BARCODE_H__ - -#include "bc.h" -#include "text-node.h" -#include "label-object.h" - -G_BEGIN_DECLS - - -#define GL_TYPE_LABEL_BARCODE (gl_label_barcode_get_type ()) -#define GL_LABEL_BARCODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_BARCODE, glLabelBarcode)) -#define GL_LABEL_BARCODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_BARCODE, glLabelBarcodeClass)) -#define GL_IS_LABEL_BARCODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_BARCODE)) -#define GL_IS_LABEL_BARCODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_BARCODE)) - -typedef struct _glLabelBarcode glLabelBarcode; -typedef struct _glLabelBarcodeClass glLabelBarcodeClass; - -typedef struct _glLabelBarcodePrivate glLabelBarcodePrivate; - -struct _glLabelBarcode { - glLabelObject object; - - glLabelBarcodePrivate *priv; -}; - -struct _glLabelBarcodeClass { - glLabelObjectClass parent_class; -}; - - -GType gl_label_barcode_get_type (void) G_GNUC_CONST; - -GObject *gl_label_barcode_new (glLabel *label); - -void gl_label_barcode_set_data (glLabelBarcode *lbc, - glTextNode *text_node); -void gl_label_barcode_set_props (glLabelBarcode *lbc, - gchar *id, - gboolean text_flag, - gboolean checksum_flag, - guint format_digits); - -glTextNode *gl_label_barcode_get_data (glLabelBarcode *lbc); -void gl_label_barcode_get_props (glLabelBarcode *lbc, - gchar **id, - gboolean *text_flag, - gboolean *checksum_flag, - guint *format_digits); - -G_END_DECLS - -#endif /* __LABEL_BARCODE_H__ */ diff --git a/glabels2/src/label-box.c b/glabels2/src/label-box.c deleted file mode 100644 index a42ad75b..00000000 --- a/glabels2/src/label-box.c +++ /dev/null @@ -1,402 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_box.c: GLabels label box object - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "label-box.h" - -#include -#include -#include - -#include "debug.h" - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glLabelBoxPrivate { - gdouble line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_label_box_finalize (GObject *object); - -static void copy (glLabelObject *dst_object, - glLabelObject *src_object); - -static void set_fill_color (glLabelObject *object, - glColorNode *fill_color_node); - -static void set_line_color (glLabelObject *object, - glColorNode *line_color_node); - -static void set_line_width (glLabelObject *object, - gdouble line_width); - -static glColorNode* get_fill_color (glLabelObject *object); - -static glColorNode* get_line_color (glLabelObject *object); - -static gdouble get_line_width (glLabelObject *object); - -static void draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - -static void draw_shadow (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - - - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glLabelBox, gl_label_box, GL_TYPE_LABEL_OBJECT); - -static void -gl_label_box_class_init (glLabelBoxClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); - - gl_label_box_parent_class = g_type_class_peek_parent (class); - - label_object_class->copy = copy; - label_object_class->set_fill_color = set_fill_color; - label_object_class->set_line_color = set_line_color; - label_object_class->set_line_width = set_line_width; - label_object_class->get_fill_color = get_fill_color; - label_object_class->get_line_color = get_line_color; - label_object_class->get_line_width = get_line_width; - label_object_class->draw_object = draw_object; - label_object_class->draw_shadow = draw_shadow; - - object_class->finalize = gl_label_box_finalize; -} - -static void -gl_label_box_init (glLabelBox *lbox) -{ - lbox->priv = g_new0 (glLabelBoxPrivate, 1); - lbox->priv->line_color_node = gl_color_node_new_default (); - lbox->priv->fill_color_node = gl_color_node_new_default (); -} - -static void -gl_label_box_finalize (GObject *object) -{ - glLabelBox *lbox = GL_LABEL_BOX (object); - - g_return_if_fail (object && GL_IS_LABEL_BOX (object)); - - gl_color_node_free (&(lbox->priv->fill_color_node)); - gl_color_node_free (&(lbox->priv->line_color_node)); - g_free (lbox->priv); - - G_OBJECT_CLASS (gl_label_box_parent_class)->finalize (object); -} - -/*****************************************************************************/ -/* NEW label "box" object. */ -/*****************************************************************************/ -GObject * -gl_label_box_new (glLabel *label) -{ - glLabelBox *lbox; - - lbox = g_object_new (gl_label_box_get_type(), NULL); - - gl_label_object_set_parent (GL_LABEL_OBJECT(lbox), label); - - return G_OBJECT (lbox); -} - -/*****************************************************************************/ -/* Copy object contents. */ -/*****************************************************************************/ -static void -copy (glLabelObject *dst_object, - glLabelObject *src_object) -{ - glLabelBox *lbox = (glLabelBox *)src_object; - glLabelBox *new_lbox = (glLabelBox *)dst_object; - gdouble line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox)); - g_return_if_fail (new_lbox && GL_IS_LABEL_BOX (new_lbox)); - - line_width = get_line_width (src_object); - line_color_node = get_line_color (src_object); - fill_color_node = get_fill_color (src_object); - - set_line_width (dst_object, line_width); - set_line_color (dst_object, line_color_node); - set_fill_color (dst_object, fill_color_node); - - gl_color_node_free (&line_color_node); - gl_color_node_free (&fill_color_node); - - gl_debug (DEBUG_LABEL, "END"); -} - - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set fill color method. */ -/*---------------------------------------------------------------------------*/ -static void -set_fill_color (glLabelObject *object, - glColorNode *fill_color_node) -{ - glLabelBox *lbox = (glLabelBox *)object; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox)); - - if (!gl_color_node_equal (lbox->priv->fill_color_node, fill_color_node)) { - - gl_color_node_free (&(lbox->priv->fill_color_node)); - lbox->priv->fill_color_node = gl_color_node_dup (fill_color_node); - - gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox)); - } - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set line color method. */ -/*---------------------------------------------------------------------------*/ -static void -set_line_color (glLabelObject *object, - glColorNode *line_color_node) -{ - glLabelBox *lbox = (glLabelBox *)object; - - g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox)); - - if ( !gl_color_node_equal (lbox->priv->line_color_node, line_color_node )) { - gl_color_node_free (&(lbox->priv->line_color_node)); - lbox->priv->line_color_node = gl_color_node_dup (line_color_node); - gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox)); - } -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set line width method. */ -/*---------------------------------------------------------------------------*/ -static void -set_line_width (glLabelObject *object, - gdouble line_width) -{ - glLabelBox *lbox = (glLabelBox *)object; - - g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox)); - - if ( lbox->priv->line_width != line_width ) { - lbox->priv->line_width = line_width; - gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox)); - } -} - - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Get fill color method. */ -/*---------------------------------------------------------------------------*/ -static gdouble -get_line_width (glLabelObject *object) -{ - glLabelBox *lbox = (glLabelBox *)object; - - g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0.0); - - return lbox->priv->line_width; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Get line color method. */ -/*---------------------------------------------------------------------------*/ -static glColorNode* -get_line_color (glLabelObject *object) -{ - glLabelBox *lbox = (glLabelBox *)object; - - g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0); - - return gl_color_node_dup (lbox->priv->line_color_node); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Get line width method. */ -/*---------------------------------------------------------------------------*/ -static glColorNode* -get_fill_color (glLabelObject *object) -{ - glLabelBox *lbox = (glLabelBox *)object; - - g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0); - - return gl_color_node_dup (lbox->priv->fill_color_node); -} - -/*****************************************************************************/ -/* Draw object method. */ -/*****************************************************************************/ -static void -draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) -{ - gdouble w, h; - gdouble line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; - guint line_color; - guint fill_color; - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_object_get_size (object, &w, &h); - - line_width = gl_label_object_get_line_width (object); - - line_color_node = gl_label_object_get_line_color (object); - fill_color_node = gl_label_object_get_fill_color (object); - line_color = gl_color_node_expand (line_color_node, record); - fill_color = gl_color_node_expand (fill_color_node, record); - if (line_color_node->field_flag && screen_flag) - { - line_color = GL_COLOR_MERGE_DEFAULT; - } - if (fill_color_node->field_flag && screen_flag) - { - fill_color = GL_COLOR_FILL_MERGE_DEFAULT; - } - - - cairo_rectangle (cr, 0.0, 0.0, w, h); - - /* Paint fill color */ - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (fill_color)); - cairo_fill_preserve (cr); - - /* Draw outline */ - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (line_color)); - cairo_set_line_width (cr, line_width); - cairo_stroke (cr); - - gl_color_node_free (&line_color_node); - gl_color_node_free (&fill_color_node); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Draw shadow method. */ -/*****************************************************************************/ -static void -draw_shadow (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) -{ - gdouble w, h; - gdouble line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; - guint line_color; - guint fill_color; - glColorNode *shadow_color_node; - guint shadow_color; - gdouble shadow_opacity; - guint shadow_line_color; - guint shadow_fill_color; - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_object_get_size (object, &w, &h); - - line_width = gl_label_object_get_line_width (object); - - line_color_node = gl_label_object_get_line_color (object); - fill_color_node = gl_label_object_get_fill_color (object); - line_color = gl_color_node_expand (line_color_node, record); - fill_color = gl_color_node_expand (fill_color_node, record); - if (line_color_node->field_flag && screen_flag) - { - line_color = GL_COLOR_MERGE_DEFAULT; - } - if (fill_color_node->field_flag && screen_flag) - { - fill_color = GL_COLOR_FILL_MERGE_DEFAULT; - } - - shadow_color_node = gl_label_object_get_shadow_color (object); - shadow_color = gl_color_node_expand (shadow_color_node, record); - if (shadow_color_node->field_flag && screen_flag) - { - shadow_color = GL_COLOR_SHADOW_MERGE_DEFAULT; - } - shadow_opacity = gl_label_object_get_shadow_opacity (object); - shadow_line_color = gl_color_shadow (shadow_color, shadow_opacity, line_color_node->color); - shadow_fill_color = gl_color_shadow (shadow_color, shadow_opacity, fill_color_node->color); - - - cairo_rectangle (cr, 0.0, 0.0, w, h); - - - /* Draw fill shadow */ - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_fill_color)); - cairo_fill_preserve (cr); - - /* Draw outline shadow */ - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_line_color)); - cairo_set_line_width (cr, line_width); - cairo_stroke (cr); - - - gl_color_node_free (&line_color_node); - gl_color_node_free (&fill_color_node); - gl_color_node_free (&shadow_color_node); - - gl_debug (DEBUG_LABEL, "END"); -} - diff --git a/glabels2/src/label-box.h b/glabels2/src/label-box.h deleted file mode 100644 index 93b05a64..00000000 --- a/glabels2/src/label-box.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_box.h: GLabels label box object - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LABEL_BOX_H__ -#define __LABEL_BOX_H__ - -#include "label-object.h" - - -G_BEGIN_DECLS - - -#define GL_TYPE_LABEL_BOX (gl_label_box_get_type ()) -#define GL_LABEL_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_BOX, glLabelBox)) -#define GL_LABEL_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_BOX, glLabelBoxClass)) -#define GL_IS_LABEL_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_BOX)) -#define GL_IS_LABEL_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_BOX)) - -typedef struct _glLabelBox glLabelBox; -typedef struct _glLabelBoxClass glLabelBoxClass; - -typedef struct _glLabelBoxPrivate glLabelBoxPrivate; - -struct _glLabelBox { - glLabelObject object; - - glLabelBoxPrivate *priv; -}; - -struct _glLabelBoxClass { - glLabelObjectClass parent_class; -}; - -GType gl_label_box_get_type (void) G_GNUC_CONST; - -GObject *gl_label_box_new (glLabel *label); - -G_END_DECLS - -#endif /* __LABEL_BOX_H__ */ diff --git a/glabels2/src/label-ellipse.c b/glabels2/src/label-ellipse.c deleted file mode 100644 index fb21cbf2..00000000 --- a/glabels2/src/label-ellipse.c +++ /dev/null @@ -1,407 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_ellipse.c: GLabels label ellipse object - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "label-ellipse.h" - -#include -#include -#include -#include - -#include "cairo-ellipse-path.h" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glLabelEllipsePrivate { - gdouble line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_label_ellipse_finalize (GObject *object); - -static void copy (glLabelObject *dst_object, - glLabelObject *src_object); - -static void set_fill_color (glLabelObject *object, - glColorNode *fill_color_node); - -static void set_line_color (glLabelObject *object, - glColorNode *line_color_node); - -static void set_line_width (glLabelObject *object, - gdouble line_width); - -static glColorNode* get_fill_color (glLabelObject *object); - -static glColorNode* get_line_color (glLabelObject *object); - -static gdouble get_line_width (glLabelObject *object); - -static void draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - -static void draw_shadow (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glLabelEllipse, gl_label_ellipse, GL_TYPE_LABEL_OBJECT); - -static void -gl_label_ellipse_class_init (glLabelEllipseClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); - - gl_label_ellipse_parent_class = g_type_class_peek_parent (class); - - label_object_class->copy = copy; - label_object_class->set_fill_color = set_fill_color; - label_object_class->set_line_color = set_line_color; - label_object_class->set_line_width = set_line_width; - label_object_class->get_fill_color = get_fill_color; - label_object_class->get_line_color = get_line_color; - label_object_class->get_line_width = get_line_width; - label_object_class->draw_object = draw_object; - label_object_class->draw_shadow = draw_shadow; - - object_class->finalize = gl_label_ellipse_finalize; -} - -static void -gl_label_ellipse_init (glLabelEllipse *lellipse) -{ - lellipse->priv = g_new0 (glLabelEllipsePrivate, 1); - lellipse->priv->line_color_node = gl_color_node_new_default (); - lellipse->priv->fill_color_node = gl_color_node_new_default (); -} - -static void -gl_label_ellipse_finalize (GObject *object) -{ - glLabelEllipse *lellipse = GL_LABEL_ELLIPSE (object); - - g_return_if_fail (object && GL_IS_LABEL_ELLIPSE (object)); - - gl_color_node_free (&(lellipse->priv->line_color_node)); - gl_color_node_free (&(lellipse->priv->fill_color_node)); - g_free (lellipse->priv); - - G_OBJECT_CLASS (gl_label_ellipse_parent_class)->finalize (object); -} - -/*****************************************************************************/ -/* NEW label "ellipse" object. */ -/*****************************************************************************/ -GObject * -gl_label_ellipse_new (glLabel *label) -{ - glLabelEllipse *lellipse; - - lellipse = g_object_new (gl_label_ellipse_get_type(), NULL); - - gl_label_object_set_parent (GL_LABEL_OBJECT(lellipse), label); - - return G_OBJECT (lellipse); -} - -/*****************************************************************************/ -/* Copy object contents. */ -/*****************************************************************************/ -static void -copy (glLabelObject *dst_object, - glLabelObject *src_object) -{ - glLabelEllipse *lellipse = (glLabelEllipse *)src_object; - glLabelEllipse *new_lellipse = (glLabelEllipse *)dst_object; - gdouble line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse)); - g_return_if_fail (new_lellipse && GL_IS_LABEL_ELLIPSE (new_lellipse)); - - line_width = get_line_width (src_object); - line_color_node = get_line_color (src_object); - fill_color_node = get_fill_color (src_object); - - set_line_width (dst_object, line_width); - set_line_color (dst_object, line_color_node); - set_fill_color (dst_object, fill_color_node); - - gl_color_node_free (&line_color_node); - gl_color_node_free (&fill_color_node); - - gl_debug (DEBUG_LABEL, "END"); -} - - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set fill color method. */ -/*---------------------------------------------------------------------------*/ -static void -set_fill_color (glLabelObject *object, - glColorNode *fill_color_node) -{ - glLabelEllipse *lellipse = (glLabelEllipse *)object; - - g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse)); - - if (!gl_color_node_equal (lellipse->priv->fill_color_node, fill_color_node)) { - - gl_color_node_free (&(lellipse->priv->fill_color_node)); - lellipse->priv->fill_color_node = gl_color_node_dup (fill_color_node); - - gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse)); - } -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set line color method. */ -/*---------------------------------------------------------------------------*/ -static void -set_line_color (glLabelObject *object, - glColorNode *line_color_node) -{ - glLabelEllipse *lellipse = (glLabelEllipse *)object; - - g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse)); - - if ( !gl_color_node_equal (lellipse->priv->line_color_node, line_color_node) ) { - - gl_color_node_free (&(lellipse->priv->line_color_node)); - lellipse->priv->line_color_node = gl_color_node_dup (line_color_node); - - gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse)); - } -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set line width method. */ -/*---------------------------------------------------------------------------*/ -static void -set_line_width (glLabelObject *object, - gdouble line_width) -{ - glLabelEllipse *lellipse = (glLabelEllipse *)object; - - g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse)); - - if ( lellipse->priv->line_width != line_width ) { - lellipse->priv->line_width = line_width; - gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse)); - } -} - - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Get fill color method. */ -/*---------------------------------------------------------------------------*/ -static gdouble -get_line_width (glLabelObject *object) -{ - glLabelEllipse *lellipse = (glLabelEllipse *)object; - - g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0.0); - - return lellipse->priv->line_width; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Get line color method. */ -/*---------------------------------------------------------------------------*/ -static glColorNode* -get_line_color (glLabelObject *object) -{ - glLabelEllipse *lellipse = (glLabelEllipse *)object; - - g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0); - - return gl_color_node_dup (lellipse->priv->line_color_node); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Get line width method. */ -/*---------------------------------------------------------------------------*/ -static glColorNode* -get_fill_color (glLabelObject *object) -{ - glLabelEllipse *lellipse = (glLabelEllipse *)object; - - g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0); - - return gl_color_node_dup (lellipse->priv->fill_color_node); -} - -/*****************************************************************************/ -/* Draw object method. */ -/*****************************************************************************/ -static void -draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) -{ - gdouble w, h; - gdouble line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; - guint line_color; - guint fill_color; - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_object_get_size (object, &w, &h); - - line_width = gl_label_object_get_line_width (object); - - line_color_node = gl_label_object_get_line_color (object); - fill_color_node = gl_label_object_get_fill_color (object); - line_color = gl_color_node_expand (line_color_node, record); - fill_color = gl_color_node_expand (fill_color_node, record); - if (line_color_node->field_flag && screen_flag) - { - line_color = GL_COLOR_MERGE_DEFAULT; - } - if (fill_color_node->field_flag && screen_flag) - { - fill_color = GL_COLOR_FILL_MERGE_DEFAULT; - } - - - gl_cairo_ellipse_path (cr, w/2, h/2); - - /* Paint fill color */ - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (fill_color)); - cairo_fill_preserve (cr); - - /* Draw outline */ - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (line_color)); - cairo_set_line_width (cr, line_width); - cairo_stroke (cr); - - gl_color_node_free (&line_color_node); - gl_color_node_free (&fill_color_node); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Draw shadow method. */ -/*****************************************************************************/ -static void -draw_shadow (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) -{ - gdouble w, h; - gdouble line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; - guint line_color; - guint fill_color; - glColorNode *shadow_color_node; - guint shadow_color; - gdouble shadow_opacity; - guint shadow_line_color; - guint shadow_fill_color; - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_object_get_size (object, &w, &h); - - line_width = gl_label_object_get_line_width (object); - - line_color_node = gl_label_object_get_line_color (object); - fill_color_node = gl_label_object_get_fill_color (object); - line_color = gl_color_node_expand (line_color_node, record); - fill_color = gl_color_node_expand (fill_color_node, record); - if (line_color_node->field_flag && screen_flag) - { - line_color = GL_COLOR_MERGE_DEFAULT; - } - if (fill_color_node->field_flag && screen_flag) - { - fill_color = GL_COLOR_FILL_MERGE_DEFAULT; - } - - shadow_color_node = gl_label_object_get_shadow_color (object); - shadow_color = gl_color_node_expand (shadow_color_node, record); - if (shadow_color_node->field_flag && screen_flag) - { - shadow_color = GL_COLOR_SHADOW_MERGE_DEFAULT; - } - shadow_opacity = gl_label_object_get_shadow_opacity (object); - shadow_line_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, line_color_node->color); - shadow_fill_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, fill_color_node->color); - - - gl_cairo_ellipse_path (cr, w/2, h/2); - - - /* Draw fill shadow */ - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_fill_color)); - cairo_fill_preserve (cr); - - /* Draw outline shadow */ - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_line_color)); - cairo_set_line_width (cr, line_width); - cairo_stroke (cr); - - - gl_color_node_free (&line_color_node); - gl_color_node_free (&fill_color_node); - gl_color_node_free (&shadow_color_node); - - gl_debug (DEBUG_LABEL, "END"); -} - diff --git a/glabels2/src/label-ellipse.h b/glabels2/src/label-ellipse.h deleted file mode 100644 index 439ad5f9..00000000 --- a/glabels2/src/label-ellipse.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_ellipse.h: GLabels label ellipse object - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LABEL_ELLIPSE_H__ -#define __LABEL_ELLIPSE_H__ - -#include "label-object.h" - - -G_BEGIN_DECLS - - -#define GL_TYPE_LABEL_ELLIPSE (gl_label_ellipse_get_type ()) -#define GL_LABEL_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_ELLIPSE, glLabelEllipse)) -#define GL_LABEL_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_ELLIPSE, glLabelEllipseClass)) -#define GL_IS_LABEL_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_ELLIPSE)) -#define GL_IS_LABEL_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_ELLIPSE)) - -typedef struct _glLabelEllipse glLabelEllipse; -typedef struct _glLabelEllipseClass glLabelEllipseClass; - -typedef struct _glLabelEllipsePrivate glLabelEllipsePrivate; - -struct _glLabelEllipse { - glLabelObject object; - - glLabelEllipsePrivate *priv; -}; - -struct _glLabelEllipseClass { - glLabelObjectClass parent_class; -}; - -GType gl_label_ellipse_get_type (void) G_GNUC_CONST; - -GObject *gl_label_ellipse_new (glLabel *label); - -G_END_DECLS - -#endif /* __LABEL_ELLIPSE_H__ */ diff --git a/glabels2/src/label-image.c b/glabels2/src/label-image.c deleted file mode 100644 index 9d0bcaf2..00000000 --- a/glabels2/src/label-image.c +++ /dev/null @@ -1,359 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_image.c: GLabels label image object - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "label-image.h" - -#include -#include -#include -#include - -#include "pixmaps/checkerboard.xpm" - -#include "debug.h" - - -#define MIN_IMAGE_SIZE 1.0 - - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glLabelImagePrivate { - glTextNode *filename; - GdkPixbuf *pixbuf; -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -static GdkPixbuf *default_pixbuf = NULL; - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_label_image_finalize (GObject *object); - -static void copy (glLabelObject *dst_object, - glLabelObject *src_object); - -static void set_size (glLabelObject *object, - gdouble w, - gdouble h); - -static void draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glLabelImage, gl_label_image, GL_TYPE_LABEL_OBJECT); - -static void -gl_label_image_class_init (glLabelImageClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); - - gl_label_image_parent_class = g_type_class_peek_parent (class); - - label_object_class->copy = copy; - label_object_class->set_size = set_size; - label_object_class->draw_object = draw_object; - label_object_class->draw_shadow = NULL; - - object_class->finalize = gl_label_image_finalize; -} - -static void -gl_label_image_init (glLabelImage *limage) -{ - GdkPixbuf *pixbuf; - - if ( default_pixbuf == NULL ) { - pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)checkerboard_xpm); - default_pixbuf = - gdk_pixbuf_scale_simple (pixbuf, 128, 128, GDK_INTERP_NEAREST); - g_object_unref (pixbuf); - } - - limage->priv = g_new0 (glLabelImagePrivate, 1); - - limage->priv->filename = g_new0 (glTextNode, 1); - - limage->priv->pixbuf = default_pixbuf; -} - -static void -gl_label_image_finalize (GObject *object) -{ - glLabelObject *lobject = GL_LABEL_OBJECT (object); - glLabelImage *limage = GL_LABEL_IMAGE (object);; - GHashTable *pixbuf_cache; - - g_return_if_fail (object && GL_IS_LABEL_IMAGE (object)); - - if (!limage->priv->filename->field_flag) { - pixbuf_cache = gl_label_get_pixbuf_cache (lobject->parent); - gl_pixbuf_cache_remove_pixbuf (pixbuf_cache, - limage->priv->filename->data); - } - gl_text_node_free (&limage->priv->filename); - g_free (limage->priv); - - G_OBJECT_CLASS (gl_label_image_parent_class)->finalize (object); -} - -/*****************************************************************************/ -/* NEW label "image" object. */ -/*****************************************************************************/ -GObject * -gl_label_image_new (glLabel *label) -{ - glLabelImage *limage; - - limage = g_object_new (gl_label_image_get_type(), NULL); - - gl_label_object_set_parent (GL_LABEL_OBJECT(limage), label); - - return G_OBJECT (limage); -} - -/*****************************************************************************/ -/* Copy object contents. */ -/*****************************************************************************/ -static void -copy (glLabelObject *dst_object, - glLabelObject *src_object) -{ - glLabelImage *limage = (glLabelImage *)src_object; - glLabelImage *new_limage = (glLabelImage *)dst_object; - glTextNode *filename; - GdkPixbuf *pixbuf; - GHashTable *pixbuf_cache; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (limage && GL_IS_LABEL_IMAGE (limage)); - g_return_if_fail (new_limage && GL_IS_LABEL_IMAGE (new_limage)); - - filename = gl_label_image_get_filename (limage); - - /* Make sure destination label has data suitably cached. */ - if ( !filename->field_flag && (filename->data != NULL) ) { - pixbuf = limage->priv->pixbuf; - if ( pixbuf != default_pixbuf ) { - pixbuf_cache = gl_label_get_pixbuf_cache (dst_object->parent); - gl_pixbuf_cache_add_pixbuf (pixbuf_cache, filename->data, pixbuf); - } - } - - gl_label_image_set_filename (new_limage, filename); - gl_text_node_free (&filename); - - gl_debug (DEBUG_LABEL, "END"); -} - - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set size method. */ -/*---------------------------------------------------------------------------*/ -static void -set_size (glLabelObject *object, - gdouble w, - gdouble h) -{ - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if (w < MIN_IMAGE_SIZE) - { - w = MIN_IMAGE_SIZE; - } - - if (h < MIN_IMAGE_SIZE) - { - h = MIN_IMAGE_SIZE; - } - - GL_LABEL_OBJECT_CLASS (gl_label_image_parent_class)->set_size (object, w, h); -} - - -/*****************************************************************************/ -/* Set object params. */ -/*****************************************************************************/ -void -gl_label_image_set_filename (glLabelImage *limage, - glTextNode *filename) -{ - glTextNode *old_filename; - GHashTable *pixbuf_cache; - GdkPixbuf *pixbuf; - gdouble image_w, image_h, aspect_ratio, w, h; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (limage && GL_IS_LABEL_IMAGE (limage)); - g_return_if_fail (filename != NULL); - - old_filename = limage->priv->filename; - - /* If Unchanged don't do anything */ - if ( gl_text_node_equal (filename, old_filename ) ) { - return; - } - - pixbuf_cache = gl_label_get_pixbuf_cache (GL_LABEL_OBJECT(limage)->parent); - - /* Remove reference to previous pixbuf from cache, if needed. */ - if ( !old_filename->field_flag && (old_filename->data != NULL) ) { - gl_pixbuf_cache_remove_pixbuf (pixbuf_cache, old_filename->data); - } - - /* Set new filename. */ - limage->priv->filename = gl_text_node_dup(filename); - gl_text_node_free (&old_filename); - - /* Now set the pixbuf. */ - if ( filename->field_flag || (filename->data == NULL) ) { - - limage->priv->pixbuf = default_pixbuf; - - } else { - - pixbuf = gl_pixbuf_cache_get_pixbuf (pixbuf_cache, filename->data); - - if (pixbuf != NULL) { - limage->priv->pixbuf = pixbuf; - } else { - limage->priv->pixbuf = default_pixbuf; - } - } - - /* Treat current size as a bounding box, scale image to maintain aspect - * ratio while fitting it in this bounding box. */ - image_w = gdk_pixbuf_get_width (limage->priv->pixbuf); - image_h = gdk_pixbuf_get_height (limage->priv->pixbuf); - aspect_ratio = image_h / image_w; - gl_label_object_get_size (GL_LABEL_OBJECT(limage), &w, &h); - if ( h > w*aspect_ratio ) { - h = w * aspect_ratio; - } else { - w = h / aspect_ratio; - } - gl_label_object_set_size (GL_LABEL_OBJECT(limage), w, h); - - gl_label_object_emit_changed (GL_LABEL_OBJECT(limage)); - - gl_debug (DEBUG_LABEL, "END"); -} - - -/*****************************************************************************/ -/* Get object params. */ -/*****************************************************************************/ -glTextNode * -gl_label_image_get_filename (glLabelImage *limage) -{ - g_return_val_if_fail (limage && GL_IS_LABEL_IMAGE (limage), NULL); - - return gl_text_node_dup (limage->priv->filename); -} - -const GdkPixbuf * -gl_label_image_get_pixbuf (glLabelImage *limage, - glMergeRecord *record) -{ - g_return_val_if_fail (limage && GL_IS_LABEL_IMAGE (limage), NULL); - - if ((record != NULL) && limage->priv->filename->field_flag) { - - GdkPixbuf *pixbuf = NULL; - gchar *real_filename; - - /* Indirect filename, re-evaluate for given record. */ - - real_filename = gl_merge_eval_key (record, - limage->priv->filename->data); - - if (real_filename != NULL) { - pixbuf = gdk_pixbuf_new_from_file (real_filename, NULL); - } - if ( pixbuf != NULL ) { - return pixbuf; - } else { - return default_pixbuf; - } - - } - - return limage->priv->pixbuf; - -} - -/*****************************************************************************/ -/* Draw object method. */ -/*****************************************************************************/ -static void -draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) -{ - gdouble x0, y0; - gdouble w, h; - const GdkPixbuf *pixbuf; - gint image_w, image_h; - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_object_get_size (object, &w, &h); - gl_label_object_get_position (object, &x0, &y0); - - pixbuf = gl_label_image_get_pixbuf (GL_LABEL_IMAGE (object), record); - image_w = gdk_pixbuf_get_width (pixbuf); - image_h = gdk_pixbuf_get_height (pixbuf); - - cairo_save (cr); - - cairo_rectangle (cr, 0.0, 0.0, w, h); - - cairo_scale (cr, w/image_w, h/image_h); - gdk_cairo_set_source_pixbuf (cr, (GdkPixbuf *)pixbuf, 0, 0); - cairo_fill (cr); - - cairo_restore (cr); - - gl_debug (DEBUG_LABEL, "END"); -} - - - diff --git a/glabels2/src/label-image.h b/glabels2/src/label-image.h deleted file mode 100644 index a45f0c79..00000000 --- a/glabels2/src/label-image.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_image.h: GLabels label image object - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LABEL_IMAGE_H__ -#define __LABEL_IMAGE_H__ - -#include "label-object.h" -#include "text-node.h" -#include "merge.h" -#include - -G_BEGIN_DECLS - - -#define GL_TYPE_LABEL_IMAGE (gl_label_image_get_type ()) -#define GL_LABEL_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_IMAGE, glLabelImage)) -#define GL_LABEL_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_IMAGE, glLabelImageClass)) -#define GL_IS_LABEL_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_IMAGE)) -#define GL_IS_LABEL_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_IMAGE)) - -typedef struct _glLabelImage glLabelImage; -typedef struct _glLabelImageClass glLabelImageClass; - -typedef struct _glLabelImagePrivate glLabelImagePrivate; - -struct _glLabelImage { - glLabelObject object; - - glLabelImagePrivate *priv; -}; - -struct _glLabelImageClass { - glLabelObjectClass parent_class; -}; - -GType gl_label_image_get_type (void) G_GNUC_CONST; - -GObject *gl_label_image_new (glLabel *label); - -void gl_label_image_set_filename (glLabelImage *limage, - glTextNode *filename); - -glTextNode *gl_label_image_get_filename (glLabelImage *limage); - -const GdkPixbuf *gl_label_image_get_pixbuf (glLabelImage *limage, - glMergeRecord *record); - -G_END_DECLS - -#endif /* __LABEL_IMAGE_H__ */ diff --git a/glabels2/src/label-line.c b/glabels2/src/label-line.c deleted file mode 100644 index b3eae407..00000000 --- a/glabels2/src/label-line.c +++ /dev/null @@ -1,323 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_line.c: GLabels label line object - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "label-line.h" - -#include -#include -#include - -#include "debug.h" - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glLabelLinePrivate { - gdouble line_width; - glColorNode *line_color_node; -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_label_line_finalize (GObject *object); - -static void copy (glLabelObject *dst_object, - glLabelObject *src_object); - -static void set_line_color (glLabelObject *object, - glColorNode *line_color_node); - -static void set_line_width (glLabelObject *object, - gdouble line_width); - -static glColorNode *get_line_color (glLabelObject *object); - -static gdouble get_line_width (glLabelObject *object); - -static void draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - -static void draw_shadow (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glLabelLine, gl_label_line, GL_TYPE_LABEL_OBJECT); - -static void -gl_label_line_class_init (glLabelLineClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); - - gl_label_line_parent_class = g_type_class_peek_parent (class); - - label_object_class->copy = copy; - label_object_class->set_line_color = set_line_color; - label_object_class->set_line_width = set_line_width; - label_object_class->get_line_color = get_line_color; - label_object_class->get_line_width = get_line_width; - label_object_class->draw_object = draw_object; - label_object_class->draw_shadow = draw_shadow; - - object_class->finalize = gl_label_line_finalize; -} - -static void -gl_label_line_init (glLabelLine *lline) -{ - lline->priv = g_new0 (glLabelLinePrivate, 1); - lline->priv->line_color_node = gl_color_node_new_default (); -} - -static void -gl_label_line_finalize (GObject *object) -{ - glLabelLine *lline = GL_LABEL_LINE (object); - - g_return_if_fail (object && GL_IS_LABEL_LINE (object)); - - gl_color_node_free (&(lline->priv->line_color_node)); - g_free (lline->priv); - - G_OBJECT_CLASS (gl_label_line_parent_class)->finalize (object); -} - -/*****************************************************************************/ -/* NEW label "line" object. */ -/*****************************************************************************/ -GObject * -gl_label_line_new (glLabel *label) -{ - glLabelLine *lline; - - lline = g_object_new (gl_label_line_get_type(), NULL); - - gl_label_object_set_parent (GL_LABEL_OBJECT(lline), label); - - return G_OBJECT (lline); -} - -/*****************************************************************************/ -/* Copy object contents. */ -/*****************************************************************************/ -static void -copy (glLabelObject *dst_object, - glLabelObject *src_object) -{ - glLabelLine *lline = (glLabelLine *)src_object; - glLabelLine *new_lline = (glLabelLine *)dst_object; - gdouble line_width; - glColorNode *line_color_node; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (lline && GL_IS_LABEL_LINE (lline)); - g_return_if_fail (new_lline && GL_IS_LABEL_LINE (new_lline)); - - line_width = get_line_width (src_object); - line_color_node = get_line_color (src_object); - - set_line_width (dst_object, line_width); - set_line_color (dst_object, line_color_node); - - gl_color_node_free (&line_color_node); - - gl_debug (DEBUG_LABEL, "END"); -} - - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set line color method. */ -/*---------------------------------------------------------------------------*/ -static void -set_line_color (glLabelObject *object, - glColorNode *line_color_node) -{ - glLabelLine *lline = (glLabelLine *)object; - - g_return_if_fail (lline && GL_IS_LABEL_LINE (lline)); - - if ( !gl_color_node_equal (lline->priv->line_color_node, line_color_node)) { - - gl_color_node_free (&(lline->priv->line_color_node )); - lline->priv->line_color_node = gl_color_node_dup (line_color_node); - - gl_label_object_emit_changed (GL_LABEL_OBJECT(lline)); - } -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set line width method. */ -/*---------------------------------------------------------------------------*/ -static void -set_line_width (glLabelObject *object, - gdouble line_width) -{ - glLabelLine *lline = (glLabelLine *)object; - - g_return_if_fail (lline && GL_IS_LABEL_LINE (lline)); - - if ( lline->priv->line_width != line_width ) { - lline->priv->line_width = line_width; - gl_label_object_emit_changed (GL_LABEL_OBJECT(lline)); - } -} - - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Get line color method. */ -/*---------------------------------------------------------------------------*/ -static gdouble -get_line_width (glLabelObject *object) -{ - glLabelLine *lline = (glLabelLine *)object; - - g_return_val_if_fail (lline && GL_IS_LABEL_LINE (lline), 0.0); - - return lline->priv->line_width; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Get line width method. */ -/*---------------------------------------------------------------------------*/ -static glColorNode* -get_line_color (glLabelObject *object) -{ - glLabelLine *lline = (glLabelLine *)object; - - g_return_val_if_fail (lline && GL_IS_LABEL_LINE (lline), 0); - - return gl_color_node_dup (lline->priv->line_color_node); -} - -/*****************************************************************************/ -/* Draw object method. */ -/*****************************************************************************/ -static void -draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) -{ - gdouble w, h; - gdouble line_width; - glColorNode *line_color_node; - guint line_color; - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h); - - line_width = gl_label_object_get_line_width (object); - - line_color_node = gl_label_object_get_line_color (object); - line_color = gl_color_node_expand (line_color_node, record); - if (line_color_node->field_flag && screen_flag) - { - line_color = GL_COLOR_MERGE_DEFAULT; - } - - - cairo_move_to (cr, 0.0, 0.0); - cairo_line_to (cr, w, h); - - - /* Draw line */ - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (line_color)); - cairo_set_line_width (cr, line_width); - cairo_stroke (cr); - - gl_color_node_free (&line_color_node); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Draw shadow method. */ -/*****************************************************************************/ -static void -draw_shadow (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) -{ - gdouble w, h; - gdouble line_width; - glColorNode *line_color_node; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - guint shadow_line_color; - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h); - - line_width = gl_label_object_get_line_width (object); - - line_color_node = gl_label_object_get_line_color (object); - if (line_color_node->field_flag) - { - line_color_node->color = GL_COLOR_MERGE_DEFAULT; - } - - shadow_color_node = gl_label_object_get_shadow_color (object); - if (shadow_color_node->field_flag) - { - shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT; - } - shadow_opacity = gl_label_object_get_shadow_opacity (object); - shadow_line_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, line_color_node->color); - - - cairo_move_to (cr, 0.0, 0.0); - cairo_line_to (cr, w, h); - - - /* Draw outline shadow */ - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_line_color)); - cairo_set_line_width (cr, line_width); - cairo_stroke (cr); - - - gl_color_node_free (&line_color_node); - gl_color_node_free (&shadow_color_node); - - gl_debug (DEBUG_LABEL, "END"); -} - diff --git a/glabels2/src/label-line.h b/glabels2/src/label-line.h deleted file mode 100644 index 3b73e42e..00000000 --- a/glabels2/src/label-line.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_line.h: GLabels label line object - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LABEL_LINE_H__ -#define __LABEL_LINE_H__ - -#include "label-object.h" - - -G_BEGIN_DECLS - - -#define GL_TYPE_LABEL_LINE (gl_label_line_get_type ()) -#define GL_LABEL_LINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_LINE, glLabelLine)) -#define GL_LABEL_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_LINE, glLabelLineClass)) -#define GL_IS_LABEL_LINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_LINE)) -#define GL_IS_LABEL_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_LINE)) - -typedef struct _glLabelLine glLabelLine; -typedef struct _glLabelLineClass glLabelLineClass; - -typedef struct _glLabelLinePrivate glLabelLinePrivate; - -struct _glLabelLine { - glLabelObject object; - - glLabelLinePrivate *priv; -}; - -struct _glLabelLineClass { - glLabelObjectClass parent_class; -}; - -GType gl_label_line_get_type (void) G_GNUC_CONST; - -GObject *gl_label_line_new (glLabel *label); - - -G_END_DECLS - -#endif /* __LABEL_LINE_H__ */ diff --git a/glabels2/src/label-object.c b/glabels2/src/label-object.c deleted file mode 100644 index fd79e28a..00000000 --- a/glabels2/src/label-object.c +++ /dev/null @@ -1,1525 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_object.c: GLabels label object base class - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "label-object.h" - -#include -#include -#include -#include - -#include "marshal.h" - -#include "debug.h" - - -/*========================================================*/ -/* Private defines. */ -/*========================================================*/ - -#define DEFAULT_SHADOW_X_OFFSET (3.6) -#define DEFAULT_SHADOW_Y_OFFSET (3.6) -#define DEFAULT_SHADOW_OPACITY (0.5) - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glLabelObjectPrivate { - gchar *name; - gdouble x, y; - gdouble w, h; - cairo_matrix_t matrix; - - gdouble aspect_ratio; - - gboolean shadow_state; - gdouble shadow_x; - gdouble shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; -}; - -enum { - CHANGED, - MOVED, - FLIP_ROTATE, - TOP, - BOTTOM, - REMOVED, - LAST_SIGNAL -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -static guint signals[LAST_SIGNAL] = {0}; - -static guint instance = 0; - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_label_object_finalize (GObject *object); - -static void merge_changed_cb (glLabel *label, - glLabelObject *object); - -static void set_size (glLabelObject *object, - gdouble w, - gdouble h); - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glLabelObject, gl_label_object, G_TYPE_OBJECT); - -static void -gl_label_object_class_init (glLabelObjectClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_object_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_label_object_finalize; - - class->set_size = set_size; - - signals[CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelObjectClass, changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - signals[MOVED] = - g_signal_new ("moved", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelObjectClass, moved), - NULL, NULL, - gl_marshal_VOID__DOUBLE_DOUBLE, - G_TYPE_NONE, - 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE); - signals[FLIP_ROTATE] = - g_signal_new ("flip_rotate", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelObjectClass, flip_rotate), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - signals[TOP] = - g_signal_new ("top", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelObjectClass, top), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - signals[BOTTOM] = - g_signal_new ("bottom", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelObjectClass, bottom), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - signals[REMOVED] = - g_signal_new ("removed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelObjectClass, removed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -static void -gl_label_object_init (glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, "START"); - - object->priv = g_new0 (glLabelObjectPrivate, 1); - - object->priv->name = g_strdup_printf ("object%d", instance++); - - cairo_matrix_init_identity (&object->priv->matrix); - - object->priv->shadow_state = FALSE; - object->priv->shadow_x = DEFAULT_SHADOW_X_OFFSET; - object->priv->shadow_y = DEFAULT_SHADOW_Y_OFFSET; - object->priv->shadow_color_node = gl_color_node_new_default (); - object->priv->shadow_opacity = DEFAULT_SHADOW_OPACITY; - - gl_debug (DEBUG_LABEL, "END"); -} - -static void -gl_label_object_finalize (GObject *object) -{ - glLabelObject *label_object = GL_LABEL_OBJECT (object); - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - g_free (label_object->priv->name); - g_free (label_object->priv); - - G_OBJECT_CLASS (gl_label_object_parent_class)->finalize (object); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* New label object. */ -/*****************************************************************************/ -GObject * -gl_label_object_new (glLabel *label) -{ - glLabelObject *object; - - gl_debug (DEBUG_LABEL, "START"); - - object = g_object_new (gl_label_object_get_type(), NULL); - - gl_label_object_set_parent (object, label); - - gl_debug (DEBUG_LABEL, "END"); - - return G_OBJECT (object); -} - -/*****************************************************************************/ -/* Duplicate object. */ -/*****************************************************************************/ -glLabelObject * -gl_label_object_dup (glLabelObject *src_object, - glLabel *label) -{ - glLabelObject *dst_object; - gdouble x, y, w, h; - cairo_matrix_t matrix; - gboolean shadow_state; - gdouble shadow_x, shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (src_object && GL_IS_LABEL_OBJECT (src_object), NULL); - - dst_object = g_object_new (G_OBJECT_TYPE(src_object), NULL); - - gl_label_object_set_parent (dst_object, label); - - gl_label_object_get_position (src_object, &x, &y); - gl_label_object_get_size (src_object, &w, &h); - gl_label_object_get_matrix (src_object, &matrix); - gl_label_object_get_shadow_offset (src_object, &shadow_x, &shadow_y); - shadow_color_node = gl_label_object_get_shadow_color (src_object); - shadow_opacity = gl_label_object_get_shadow_opacity (src_object); - shadow_state = gl_label_object_get_shadow_state (src_object); - - gl_label_object_set_position (dst_object, x, y); - gl_label_object_set_size (dst_object, w, h); - gl_label_object_set_matrix (dst_object, &matrix); - gl_label_object_set_shadow_offset (dst_object, shadow_x, shadow_y); - gl_label_object_set_shadow_color (dst_object, shadow_color_node); - gl_label_object_set_shadow_opacity (dst_object, shadow_opacity); - gl_label_object_set_shadow_state (dst_object, shadow_state); - - gl_color_node_free (&shadow_color_node); - - if ( GL_LABEL_OBJECT_GET_CLASS(src_object)->copy != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(src_object)->copy (dst_object, src_object); - - } - - gl_debug (DEBUG_LABEL, "END"); - - return dst_object; -} - -/*****************************************************************************/ -/* Emit "changed" signal (for derived objects). */ -/*****************************************************************************/ -void -gl_label_object_emit_changed (glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - g_signal_emit (G_OBJECT(object), signals[CHANGED], 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Set parent label of object. */ -/*****************************************************************************/ -void -gl_label_object_set_parent (glLabelObject *object, - glLabel *label) -{ - glLabel *old_parent; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - g_return_if_fail (label && GL_IS_LABEL (label)); - - old_parent = object->parent; - if ( old_parent != NULL ) { - g_signal_handlers_disconnect_by_func (old_parent, - G_CALLBACK(merge_changed_cb), - object); - gl_label_remove_object( old_parent, object ); - } - gl_label_add_object( label, object ); - - g_signal_connect (G_OBJECT(label), "merge_changed", - G_CALLBACK(merge_changed_cb), object); - - g_signal_emit (G_OBJECT(object), signals[CHANGED], 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Get parent label of object. */ -/*****************************************************************************/ -glLabel * -gl_label_object_get_parent (glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), NULL); - - gl_debug (DEBUG_LABEL, "END"); - - return object->parent; -} - -/*****************************************************************************/ -/* Set remove object from parent. */ -/*****************************************************************************/ -void -gl_label_object_remove (glLabelObject *object) -{ - glLabel *parent; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - parent = object->parent; - if ( parent != NULL ) { - g_signal_handlers_disconnect_by_func (parent, - G_CALLBACK(merge_changed_cb), - object); - gl_label_remove_object (parent, object); - - g_signal_emit (G_OBJECT(object), signals[REMOVED], 0); - - g_object_unref (G_OBJECT(object)); - } - - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Set name of object. */ -/*****************************************************************************/ -void -gl_label_object_set_name (glLabelObject *object, - gchar *name) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - g_free(object->priv->name); - object->priv->name = name; - - g_signal_emit (G_OBJECT(object), signals[CHANGED], 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Get name of object. */ -/*****************************************************************************/ -gchar * -gl_label_object_get_name (glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), NULL); - - gl_debug (DEBUG_LABEL, "END"); - - return g_strdup(object->priv->name); -} - -/*****************************************************************************/ -/* Set position of object. */ -/*****************************************************************************/ -void -gl_label_object_set_position (glLabelObject *object, - gdouble x, - gdouble y) -{ - gdouble dx, dy; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( (x != object->priv->x) || (y != object->priv->y) ) { - - dx = x - object->priv->x; - dy = y - object->priv->y; - - object->priv->x = x; - object->priv->y = y; - - g_signal_emit (G_OBJECT(object), signals[MOVED], 0, dx, dy); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Set position of object relative to old position. */ -/*****************************************************************************/ -void -gl_label_object_set_position_relative (glLabelObject *object, - gdouble dx, - gdouble dy) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( (dx != 0.0) || (dy != 0.0) ) { - - object->priv->x += dx; - object->priv->y += dy; - - gl_debug (DEBUG_LABEL, " x = %f, y= %f", - object->priv->x, - object->priv->y); - - g_signal_emit (G_OBJECT(object), signals[MOVED], 0, dx, dy); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Get position of object. */ -/*****************************************************************************/ -void -gl_label_object_get_position (glLabelObject *object, - gdouble *x, - gdouble *y) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - *x = object->priv->x; - *y = object->priv->y; - - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Default set size method. */ -/*---------------------------------------------------------------------------*/ -static void -set_size (glLabelObject *object, - gdouble w, - gdouble h) -{ - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( (object->priv->w != w) || (object->priv->h != h) ) { - - object->priv->w = w; - object->priv->h = h; - - g_signal_emit (G_OBJECT(object), signals[CHANGED], 0); - } -} - -/*****************************************************************************/ -/* Set size of object. */ -/*****************************************************************************/ -void -gl_label_object_set_size (glLabelObject *object, - gdouble w, - gdouble h) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_size != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_size (object, w, h); - - object->priv->aspect_ratio = h / w; - - } - - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Set size of object honoring current aspect ratio. */ -/*****************************************************************************/ -void -gl_label_object_set_size_honor_aspect (glLabelObject *object, - gdouble w, - gdouble h) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( h > w*object->priv->aspect_ratio ) { - - h = w * object->priv->aspect_ratio; - - } else { - - w = h / object->priv->aspect_ratio; - - } - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_size != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_size (object, w, h); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Get raw size method (don't let object content adjust size). */ -/*****************************************************************************/ -void -gl_label_object_get_raw_size (glLabelObject *object, - gdouble *w, - gdouble *h) -{ - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - *w = object->priv->w; - *h = object->priv->h; -} - -/*****************************************************************************/ -/* Get size of object. */ -/*****************************************************************************/ -void -gl_label_object_get_size (glLabelObject *object, - gdouble *w, - gdouble *h) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_size != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->get_size (object, w, h); - - } else { - - gl_label_object_get_raw_size (object, w, h); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Get extent of object. */ -/*****************************************************************************/ -void -gl_label_object_get_extent (glLabelObject *object, - glLabelRegion *region) -{ - gdouble w, h; - gdouble line_w; - gdouble xa1, ya1, xa2, ya2, xa3, ya3, xa4, ya4; - cairo_matrix_t matrix; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - gl_label_object_get_size (object, &w, &h); - line_w = gl_label_object_get_line_width (object); - - /* setup untransformed corners of bounding box, account for line width */ - xa1 = - line_w/2; - ya1 = - line_w/2; - xa2 = w + line_w/2; - ya2 = - line_w/2; - xa3 = w + line_w/2; - ya3 = h + line_w/2; - xa4 = - line_w/2; - ya4 = h + line_w/2; - - /* transform these points */ - gl_label_object_get_matrix (object, &matrix); - cairo_matrix_transform_point (&matrix, &xa1, &ya1); - cairo_matrix_transform_point (&matrix, &xa2, &ya2); - cairo_matrix_transform_point (&matrix, &xa3, &ya3); - cairo_matrix_transform_point (&matrix, &xa4, &ya4); - - /* now find the maximum extent of these points in x and y */ - region->x1 = MIN (xa1, MIN (xa2, MIN (xa3, xa4))) + object->priv->x; - region->y1 = MIN (ya1, MIN (ya2, MIN (ya3, ya4))) + object->priv->y; - region->x2 = MAX (xa1, MAX (xa2, MAX (xa3, xa4))) + object->priv->x; - region->y2 = MAX (ya1, MAX (ya2, MAX (ya3, ya4))) + object->priv->y; - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Can text properties be set for this object? */ -/*****************************************************************************/ -gboolean -gl_label_object_can_text (glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_font_family != NULL ) { - - return TRUE; - - } else { - - return FALSE; - - } - -} - -/*****************************************************************************/ -/* Set font family for all text contained in object. */ -/*****************************************************************************/ -void -gl_label_object_set_font_family (glLabelObject *object, - const gchar *font_family) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_font_family != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_font_family (object, font_family); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Set font size for all text contained in object. */ -/****************************************************************************/ -void -gl_label_object_set_font_size (glLabelObject *object, - gdouble font_size) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_font_size != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_font_size (object, font_size); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Set font weight for all text contained in object. */ -/****************************************************************************/ -void -gl_label_object_set_font_weight (glLabelObject *object, - PangoWeight font_weight) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_font_weight != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_font_weight (object, font_weight); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Set font italic flag for all text contained in object. */ -/****************************************************************************/ -void -gl_label_object_set_font_italic_flag (glLabelObject *object, - gboolean font_italic_flag) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_font_italic_flag != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_font_italic_flag (object, - font_italic_flag); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Set text alignment for all text contained in object. */ -/****************************************************************************/ -void -gl_label_object_set_text_alignment (glLabelObject *object, - PangoAlignment text_alignment) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_text_alignment != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_text_alignment (object, - text_alignment); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Set text line spacing for all text contained in object. */ -/****************************************************************************/ -void -gl_label_object_set_text_line_spacing (glLabelObject *object, - gdouble text_line_spacing) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_text_line_spacing != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_text_line_spacing (object, text_line_spacing); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Set text color for all text contained in object. */ -/****************************************************************************/ -void -gl_label_object_set_text_color (glLabelObject *object, - glColorNode *text_color_node) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_text_color != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_text_color (object, text_color_node); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Get font family for all text contained in object. */ -/*****************************************************************************/ -gchar * -gl_label_object_get_font_family (glLabelObject *object) -{ - gchar *ret = NULL; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), NULL); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_family != NULL ) { - - /* We have an object specific method, use it */ - ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_family (object); - - } - - gl_debug (DEBUG_LABEL, "END"); - - return ret; -} - -/****************************************************************************/ -/* Get font size for all text contained in object. */ -/****************************************************************************/ -gdouble -gl_label_object_get_font_size (glLabelObject *object) -{ - gdouble ret = 0.0; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0.0); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_size != NULL ) { - - /* We have an object specific method, use it */ - ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_size (object); - - } - - gl_debug (DEBUG_LABEL, "END"); - - return ret; -} - -/****************************************************************************/ -/* Get font weight for all text contained in object. */ -/****************************************************************************/ -PangoWeight -gl_label_object_get_font_weight (glLabelObject *object) -{ - PangoWeight ret = PANGO_WEIGHT_NORMAL; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), PANGO_WEIGHT_NORMAL); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_weight != NULL ) { - - /* We have an object specific method, use it */ - ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_weight (object); - - } - - gl_debug (DEBUG_LABEL, "END"); - - return ret; -} - -/****************************************************************************/ -/* Get font italic flag for all text contained in object. */ -/****************************************************************************/ -gboolean -gl_label_object_get_font_italic_flag (glLabelObject *object) -{ - gboolean ret = FALSE; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_italic_flag != NULL ) { - - /* We have an object specific method, use it */ - ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_italic_flag (object); - - } - - gl_debug (DEBUG_LABEL, "END"); - - return ret; -} - -/****************************************************************************/ -/* Get text alignment for all text contained in object. */ -/****************************************************************************/ -PangoAlignment -gl_label_object_get_text_alignment (glLabelObject *object) -{ - PangoAlignment ret = PANGO_ALIGN_LEFT; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), PANGO_ALIGN_LEFT); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_text_alignment != NULL ) { - - /* We have an object specific method, use it */ - ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_text_alignment (object); - - } - - gl_debug (DEBUG_LABEL, "END"); - - return ret; -} - -/****************************************************************************/ -/* Get text line spacing for all text contained in object. */ -/****************************************************************************/ -gdouble -gl_label_object_get_text_line_spacing (glLabelObject *object) -{ - gdouble ret = 0.0; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0.0); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_text_line_spacing != NULL ) { - - /* We have an object specific method, use it */ - ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_text_line_spacing (object); - - } - - gl_debug (DEBUG_LABEL, "END"); - - return ret; -} - -/****************************************************************************/ -/* Get text color for all text contained in object. */ -/****************************************************************************/ -glColorNode* -gl_label_object_get_text_color (glLabelObject *object) -{ - glColorNode *ret = NULL; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_text_color != NULL ) { - - /* We have an object specific method, use it */ - ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_text_color (object); - - } - - gl_debug (DEBUG_LABEL, "END"); - - return ret; -} - -/*****************************************************************************/ -/* Can fill properties be set for this object? */ -/*****************************************************************************/ -gboolean -gl_label_object_can_fill (glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_fill_color != NULL ) { - - return TRUE; - - } else { - - return FALSE; - - } - -} - -/****************************************************************************/ -/* Set fill color for object. */ -/****************************************************************************/ -void -gl_label_object_set_fill_color (glLabelObject *object, - glColorNode *fill_color_node) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_fill_color != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_fill_color (object, fill_color_node); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Get fill color for object. */ -/****************************************************************************/ -glColorNode* -gl_label_object_get_fill_color (glLabelObject *object) -{ - glColorNode *ret = NULL; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_fill_color != NULL ) { - - /* We have an object specific method, use it */ - ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_fill_color (object); - - } - - gl_debug (DEBUG_LABEL, "END"); - - return ret; -} - -/*****************************************************************************/ -/* Can line color property be set for this object? */ -/*****************************************************************************/ -gboolean -gl_label_object_can_line_color (glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_line_color != NULL ) { - - return TRUE; - - } else { - - return FALSE; - - } - -} - -/****************************************************************************/ -/* Set line color for object. */ -/****************************************************************************/ -void -gl_label_object_set_line_color (glLabelObject *object, - glColorNode *line_color_node) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_line_color != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_line_color (object, line_color_node); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Get line color for object. */ -/****************************************************************************/ -glColorNode* -gl_label_object_get_line_color (glLabelObject *object) -{ - glColorNode *ret = NULL; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_line_color != NULL ) { - - /* We have an object specific method, use it */ - ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_line_color (object); - - } - - gl_debug (DEBUG_LABEL, "END"); - - return ret; -} - -/*****************************************************************************/ -/* Can line width property be set for this object? */ -/*****************************************************************************/ -gboolean -gl_label_object_can_line_width (glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_line_width != NULL ) { - - return TRUE; - - } else { - - return FALSE; - - } - -} - -/****************************************************************************/ -/* Set line width for object. */ -/****************************************************************************/ -void -gl_label_object_set_line_width (glLabelObject *object, - gdouble line_width) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_line_width != NULL ) { - - /* We have an object specific method, use it */ - GL_LABEL_OBJECT_GET_CLASS(object)->set_line_width (object, line_width); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Get line width for object. */ -/****************************************************************************/ -gdouble -gl_label_object_get_line_width (glLabelObject *object) -{ - gdouble ret = 0.0; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0.0); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_line_width != NULL ) { - - /* We have an object specific method, use it */ - ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_line_width (object); - - } - - gl_debug (DEBUG_LABEL, "END"); - - return ret; -} - -/****************************************************************************/ -/* Set shadow state of object. */ -/****************************************************************************/ -void -gl_label_object_set_shadow_state (glLabelObject *object, - gboolean state) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if (object->priv->shadow_state != state) - { - object->priv->shadow_state = state; - gl_label_object_emit_changed (object); - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Get shadow state of object. */ -/****************************************************************************/ -gboolean -gl_label_object_get_shadow_state (glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); - - return object->priv->shadow_state; -} - -/****************************************************************************/ -/* Set offset of object's shadow. */ -/****************************************************************************/ -void -gl_label_object_set_shadow_offset (glLabelObject *object, - gdouble x, - gdouble y) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( (x != object->priv->shadow_x) || (y != object->priv->shadow_y) ) - { - object->priv->shadow_x = x; - object->priv->shadow_y = y; - - gl_label_object_emit_changed (object); - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Get offset of object's shadow. */ -/****************************************************************************/ -void -gl_label_object_get_shadow_offset (glLabelObject *object, - gdouble *x, - gdouble *y) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - *x = object->priv->shadow_x; - *y = object->priv->shadow_y; - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Set color of object's shadow. */ -/****************************************************************************/ -void -gl_label_object_set_shadow_color (glLabelObject *object, - glColorNode *color_node) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if ( !gl_color_node_equal (object->priv->shadow_color_node, color_node )) - { - gl_color_node_free (&(object->priv->shadow_color_node)); - object->priv->shadow_color_node = gl_color_node_dup (color_node); - gl_label_object_emit_changed (GL_LABEL_OBJECT(object)); - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Get color of object's shadow. */ -/****************************************************************************/ -glColorNode* -gl_label_object_get_shadow_color (glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), NULL); - - return gl_color_node_dup (object->priv->shadow_color_node); -} - -/****************************************************************************/ -/* Set opacity of object's shadow. */ -/****************************************************************************/ -void -gl_label_object_set_shadow_opacity (glLabelObject *object, - gdouble alpha) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if (object->priv->shadow_opacity != alpha) - { - object->priv->shadow_opacity = alpha; - gl_label_object_emit_changed (object); - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Get opacity of object's shadow. */ -/****************************************************************************/ -gdouble -gl_label_object_get_shadow_opacity (glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); - - return object->priv->shadow_opacity; -} - -/****************************************************************************/ -/* Flip object horizontally. */ -/****************************************************************************/ -void -gl_label_object_flip_horiz (glLabelObject *object) -{ - cairo_matrix_t flip_matrix; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - cairo_matrix_init_scale (&flip_matrix, -1.0, 1.0); - cairo_matrix_multiply (&object->priv->matrix, &object->priv->matrix, &flip_matrix); - - g_signal_emit (G_OBJECT(object), signals[FLIP_ROTATE], 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Flip object vertically. */ -/****************************************************************************/ -void -gl_label_object_flip_vert (glLabelObject *object) -{ - cairo_matrix_t flip_matrix; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - cairo_matrix_init_scale (&flip_matrix, 1.0, -1.0); - cairo_matrix_multiply (&object->priv->matrix, &object->priv->matrix, &flip_matrix); - - g_signal_emit (G_OBJECT(object), signals[FLIP_ROTATE], 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Rotate object. */ -/****************************************************************************/ -void -gl_label_object_rotate (glLabelObject *object, - gdouble theta_degs) -{ - cairo_matrix_t rotate_matrix; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - cairo_matrix_init_rotate (&rotate_matrix, theta_degs*(G_PI/180.)); - cairo_matrix_multiply (&object->priv->matrix, &object->priv->matrix, &rotate_matrix); - - g_signal_emit (G_OBJECT(object), signals[FLIP_ROTATE], 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Set raw affine */ -/****************************************************************************/ -void -gl_label_object_set_matrix (glLabelObject *object, - cairo_matrix_t *matrix) -{ - gl_debug (DEBUG_LABEL, ""); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - object->priv->matrix = *matrix; -} - -/****************************************************************************/ -/* Get raw affine */ -/****************************************************************************/ -void -gl_label_object_get_matrix (glLabelObject *object, - cairo_matrix_t *matrix) -{ - gl_debug (DEBUG_LABEL, ""); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - *matrix = object->priv->matrix; -} - -/****************************************************************************/ -/* Bring label object to front/top. */ -/****************************************************************************/ -void -gl_label_object_raise_to_top (glLabelObject *object) -{ - glLabel *label; - - gl_debug (DEBUG_LABEL, "START"); - - label = object->parent; - - gl_label_raise_object_to_top (label, object); - - g_signal_emit (G_OBJECT(object), signals[TOP], 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Send label object to rear/bottom. */ -/****************************************************************************/ -void -gl_label_object_lower_to_bottom (glLabelObject *object) -{ - glLabel *label; - - gl_debug (DEBUG_LABEL, "START"); - - label = object->parent; - - gl_label_lower_object_to_bottom (label, object); - - g_signal_emit (G_OBJECT(object), signals[BOTTOM], 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Label's merge data changed callback. */ -/*--------------------------------------------------------------------------*/ -static void -merge_changed_cb (glLabel *label, - glLabelObject *object) -{ - gl_label_object_emit_changed (object); -} - -/*****************************************************************************/ -/* Draw object */ -/*****************************************************************************/ -void -gl_label_object_draw (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) - -{ - gdouble x0, y0; - cairo_matrix_t matrix; - gboolean shadow_state; - gdouble shadow_x, shadow_y; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - gl_label_object_get_position (object, &x0, &y0); - gl_label_object_get_matrix (object, &matrix); - - cairo_save (cr); - cairo_translate (cr, x0, y0); - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->draw_shadow != NULL ) { - - shadow_state = gl_label_object_get_shadow_state (object); - - if ( shadow_state ) - { - gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); - - cairo_save (cr); - cairo_translate (cr, shadow_x, shadow_y); - cairo_transform (cr, &matrix); - - GL_LABEL_OBJECT_GET_CLASS(object)->draw_shadow (object, - cr, - screen_flag, - record); - - cairo_restore (cr); - } - } - - if ( GL_LABEL_OBJECT_GET_CLASS(object)->draw_object != NULL ) { - - cairo_save (cr); - cairo_transform (cr, &matrix); - - GL_LABEL_OBJECT_GET_CLASS(object)->draw_object (object, - cr, - screen_flag, - record); - - cairo_restore (cr); - } - - cairo_restore (cr); - - gl_debug (DEBUG_LABEL, "END"); -} - diff --git a/glabels2/src/label-object.h b/glabels2/src/label-object.h deleted file mode 100644 index 5ee0f9ba..00000000 --- a/glabels2/src/label-object.h +++ /dev/null @@ -1,345 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_object.h: GLabels label object base class - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LABEL_OBJECT_H__ -#define __LABEL_OBJECT_H__ - -#include -#include -#include - -G_BEGIN_DECLS - -typedef enum { - GL_LABEL_OBJECT_TEXT, - GL_LABEL_OBJECT_BOX, - GL_LABEL_OBJECT_LINE, - GL_LABEL_OBJECT_ELLIPSE, - GL_LABEL_OBJECT_IMAGE, - GL_LABEL_OBJECT_BARCODE, - GL_LABEL_OBJECT_N_TYPES -} glLabelObjectType; - - -#define GL_TYPE_LABEL_OBJECT (gl_label_object_get_type ()) -#define GL_LABEL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_OBJECT, glLabelObject)) -#define GL_LABEL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_OBJECT, glLabelObjectClass)) -#define GL_IS_LABEL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_OBJECT)) -#define GL_IS_LABEL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_OBJECT)) -#define GL_LABEL_OBJECT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_LABEL_OBJECT, glLabelObjectClass)) - - -typedef struct _glLabelObject glLabelObject; -typedef struct _glLabelObjectClass glLabelObjectClass; - -typedef struct _glLabelObjectPrivate glLabelObjectPrivate; - -#include "label.h" -#include "color.h" - -struct _glLabelObject { - GObject object; - - glLabel *parent; - - glLabelObjectPrivate *priv; -}; - -struct _glLabelObjectClass { - GObjectClass parent_class; - - /* - * Methods - */ - - void (*set_size) (glLabelObject *object, - gdouble w, - gdouble h); - - void (*get_size) (glLabelObject *object, - gdouble *w, - gdouble *h); - - void (*set_font_family) (glLabelObject *object, - const gchar *font_family); - - void (*set_font_size) (glLabelObject *object, - gdouble font_size); - - void (*set_font_weight) (glLabelObject *object, - PangoWeight font_weight); - - void (*set_font_italic_flag) (glLabelObject *object, - gboolean font_italic_flag); - - void (*set_text_alignment) (glLabelObject *object, - PangoAlignment text_alignment); - - void (*set_text_line_spacing) (glLabelObject *object, - gdouble text_line_spacing); - - void (*set_text_color) (glLabelObject *object, - glColorNode *text_color_node); - - void (*set_fill_color) (glLabelObject *object, - glColorNode *fill_color_node); - - void (*set_line_color) (glLabelObject *object, - glColorNode *line_color_node); - - void (*set_line_width) (glLabelObject *object, - gdouble line_width); - - gchar *(*get_font_family) (glLabelObject *object); - - gdouble (*get_font_size) (glLabelObject *object); - - PangoWeight (*get_font_weight) (glLabelObject *object); - - gboolean (*get_font_italic_flag) (glLabelObject *object); - - PangoAlignment (*get_text_alignment) (glLabelObject *object); - - gdouble (*get_text_line_spacing) (glLabelObject *object); - - glColorNode* (*get_text_color) (glLabelObject *object); - - glColorNode* (*get_fill_color) (glLabelObject *object); - - glColorNode* (*get_line_color) (glLabelObject *object); - - gdouble (*get_line_width) (glLabelObject *object); - - void (*copy) (glLabelObject *dst_object, - glLabelObject *src_object); - - /* - * Draw methods - */ - void (*draw_shadow) (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - - void (*draw_object) (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - - - /* - * Signals - */ - void (*changed) (glLabelObject *object, - gpointer user_data); - - void (*moved) (glLabelObject *object, - gdouble dx, - gdouble dy, - gpointer user_data); - - void (*flip_rotate) (glLabelObject *object, - gpointer user_data); - - void (*top) (glLabelObject *object, - gpointer user_data); - - void (*bottom) (glLabelObject *object, - gpointer user_data); - - void (*removed) (glLabelObject *object, - gpointer user_data); - -}; - -GType gl_label_object_get_type (void) G_GNUC_CONST; - -GObject *gl_label_object_new (glLabel *label); - - -glLabelObject *gl_label_object_dup (glLabelObject *src_object, - glLabel *label); - -void gl_label_object_emit_changed (glLabelObject *object); - - -void gl_label_object_set_parent (glLabelObject *object, - glLabel *label); - -glLabel *gl_label_object_get_parent (glLabelObject *object); - - -void gl_label_object_remove (glLabelObject *object); - -void gl_label_object_set_name (glLabelObject *object, - gchar *name); - -gchar *gl_label_object_get_name (glLabelObject *object); - - -void gl_label_object_set_position (glLabelObject *object, - gdouble x, - gdouble y); - -void gl_label_object_set_position_relative (glLabelObject *object, - gdouble dx, - gdouble dy); - -void gl_label_object_get_position (glLabelObject *object, - gdouble *x, - gdouble *y); - -void gl_label_object_set_size (glLabelObject *object, - gdouble w, - gdouble h); - -void gl_label_object_set_size_honor_aspect (glLabelObject *object, - gdouble w, - gdouble h); - -void gl_label_object_get_size (glLabelObject *object, - gdouble *w, - gdouble *h); - -void gl_label_object_get_raw_size (glLabelObject *object, - gdouble *w, - gdouble *h); - -void gl_label_object_get_extent (glLabelObject *object, - glLabelRegion *region); - -gboolean gl_label_object_can_text (glLabelObject *object); - -void gl_label_object_set_font_family (glLabelObject *object, - const gchar *font_family); - -void gl_label_object_set_font_size (glLabelObject *object, - gdouble font_size); - -void gl_label_object_set_font_weight (glLabelObject *object, - PangoWeight font_weight); - -void gl_label_object_set_font_italic_flag (glLabelObject *object, - gboolean font_italic_flag); - -void gl_label_object_set_text_alignment (glLabelObject *object, - PangoAlignment text_alignment); - -void gl_label_object_set_text_color (glLabelObject *object, - glColorNode *text_color_node); - -void gl_label_object_set_text_line_spacing (glLabelObject *object, - gdouble text_line_spacing); - - -gchar *gl_label_object_get_font_family (glLabelObject *object); - -gdouble gl_label_object_get_font_size (glLabelObject *object); - -PangoWeight gl_label_object_get_font_weight (glLabelObject *object); - -gboolean gl_label_object_get_font_italic_flag (glLabelObject *object); - -PangoAlignment gl_label_object_get_text_alignment (glLabelObject *object); - -gdouble gl_label_object_get_text_line_spacing (glLabelObject *object); - -glColorNode *gl_label_object_get_text_color (glLabelObject *object); - - -gboolean gl_label_object_can_fill (glLabelObject *object); - -void gl_label_object_set_fill_color (glLabelObject *object, - glColorNode *fill_color_node); - -glColorNode* gl_label_object_get_fill_color (glLabelObject *object); - - -gboolean gl_label_object_can_line_color (glLabelObject *object); - -void gl_label_object_set_line_color (glLabelObject *object, - glColorNode *line_color_node); - -glColorNode *gl_label_object_get_line_color (glLabelObject *object); - -gboolean gl_label_object_can_line_width (glLabelObject *object); - -void gl_label_object_set_line_width (glLabelObject *object, - gdouble line_width); - -gdouble gl_label_object_get_line_width (glLabelObject *object); - - -void gl_label_object_raise_to_top (glLabelObject *object); - -void gl_label_object_lower_to_bottom (glLabelObject *object); - - -void gl_label_object_flip_horiz (glLabelObject *object); - -void gl_label_object_flip_vert (glLabelObject *object); - -void gl_label_object_rotate (glLabelObject *object, - gdouble theta_degs); - -void gl_label_object_set_matrix (glLabelObject *object, - cairo_matrix_t *matrix); - -void gl_label_object_get_matrix (glLabelObject *object, - cairo_matrix_t *matrix); - -void gl_label_object_set_shadow_state (glLabelObject *object, - gboolean state); - -void gl_label_object_set_shadow_offset (glLabelObject *object, - gdouble x, - gdouble y); - -void gl_label_object_set_shadow_color (glLabelObject *object, - glColorNode *color_node); - -void gl_label_object_set_shadow_opacity (glLabelObject *object, - gdouble alpha); - -gboolean gl_label_object_get_shadow_state (glLabelObject *object); - -void gl_label_object_get_shadow_offset (glLabelObject *object, - gdouble *x, - gdouble *y); - -glColorNode* gl_label_object_get_shadow_color (glLabelObject *object); - -gdouble gl_label_object_get_shadow_opacity (glLabelObject *object); - -void gl_label_object_draw (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - - - - -G_END_DECLS - -#endif /* __LABEL_OBJECT_H__ */ diff --git a/glabels2/src/label-text.c b/glabels2/src/label-text.c deleted file mode 100644 index 9a4d59a1..00000000 --- a/glabels2/src/label-text.c +++ /dev/null @@ -1,1094 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_text.c: GLabels label text object - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "label-text.h" - -#include -#include -#include -#include -#include - -#include "util.h" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -#define DEFAULT_FONT_FAMILY "Sans" -#define DEFAULT_FONT_SIZE 14.0 -#define DEFAULT_FONT_WEIGHT PANGO_WEIGHT_NORMAL -#define DEFAULT_FONT_ITALIC_FLAG FALSE -#define DEFAULT_ALIGN PANGO_ALIGN_LEFT -#define DEFAULT_COLOR GL_COLOR (0,0,0) -#define DEFAULT_TEXT_LINE_SPACING 1.0 -#define DEFAULT_AUTO_SHRINK FALSE - -#define FONT_SCALE (72.0/96.0) - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glLabelTextPrivate { - GtkTextTagTable *tag_table; - GtkTextBuffer *buffer; - - gchar *font_family; - gdouble font_size; - PangoWeight font_weight; - gboolean font_italic_flag; - PangoAlignment align; - glColorNode *color_node; - gdouble line_spacing; - gboolean auto_shrink; - - gboolean size_changed; - gdouble w; - gdouble h; -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_label_text_finalize (GObject *object); - -static void copy (glLabelObject *dst_object, - glLabelObject *src_object); - -static void buffer_changed_cb (GtkTextBuffer *textbuffer, - glLabelText *ltext); - -static void get_size (glLabelObject *object, - gdouble *w, - gdouble *h); - -static void set_font_family (glLabelObject *object, - const gchar *font_family); - -static void set_font_size (glLabelObject *object, - gdouble font_size); - -static void set_font_weight (glLabelObject *object, - PangoWeight font_weight); - -static void set_font_italic_flag (glLabelObject *object, - gboolean font_italic_flag); - -static void set_text_alignment (glLabelObject *object, - PangoAlignment text_alignment); - -static void set_text_line_spacing (glLabelObject *object, - gdouble text_line_spacing); - -static void set_text_color (glLabelObject *object, - glColorNode *text_color_node); - -static gchar *get_font_family (glLabelObject *object); - -static gdouble get_font_size (glLabelObject *object); - -static PangoWeight get_font_weight (glLabelObject *object); - -static gboolean get_font_italic_flag (glLabelObject *object); - -static PangoAlignment get_text_alignment (glLabelObject *object); - -static gdouble get_text_line_spacing (glLabelObject *object); - -static glColorNode* get_text_color (glLabelObject *object); - -static void draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - -static void draw_shadow (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - -static gdouble auto_shrink_font_size (cairo_t *cr, - gchar *family, - gdouble size, - PangoWeight weight, - PangoStyle style, - gchar *text, - gdouble width); - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glLabelText, gl_label_text, GL_TYPE_LABEL_OBJECT); - -static void -gl_label_text_class_init (glLabelTextClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); - - gl_label_text_parent_class = g_type_class_peek_parent (class); - - label_object_class->copy = copy; - - label_object_class->get_size = get_size; - - label_object_class->set_font_family = set_font_family; - label_object_class->set_font_size = set_font_size; - label_object_class->set_font_weight = set_font_weight; - label_object_class->set_font_italic_flag = set_font_italic_flag; - label_object_class->set_text_alignment = set_text_alignment; - label_object_class->set_text_line_spacing = set_text_line_spacing; - label_object_class->set_text_color = set_text_color; - label_object_class->get_font_family = get_font_family; - label_object_class->get_font_size = get_font_size; - label_object_class->get_font_weight = get_font_weight; - label_object_class->get_font_italic_flag = get_font_italic_flag; - label_object_class->get_text_alignment = get_text_alignment; - label_object_class->get_text_line_spacing = get_text_line_spacing; - label_object_class->get_text_color = get_text_color; - label_object_class->draw_object = draw_object; - label_object_class->draw_shadow = draw_shadow; - - object_class->finalize = gl_label_text_finalize; -} - -static void -gl_label_text_init (glLabelText *ltext) -{ - ltext->priv = g_new0 (glLabelTextPrivate, 1); - - ltext->priv->tag_table = gtk_text_tag_table_new (); - ltext->priv->buffer = gtk_text_buffer_new (ltext->priv->tag_table); - - ltext->priv->font_family = g_strdup(DEFAULT_FONT_FAMILY); - ltext->priv->font_size = DEFAULT_FONT_SIZE; - ltext->priv->font_weight = DEFAULT_FONT_WEIGHT; - ltext->priv->font_italic_flag = DEFAULT_FONT_ITALIC_FLAG; - ltext->priv->align = DEFAULT_ALIGN; - ltext->priv->color_node = gl_color_node_new_default (); - ltext->priv->color_node->color = DEFAULT_COLOR; - ltext->priv->line_spacing = DEFAULT_TEXT_LINE_SPACING; - ltext->priv->auto_shrink = DEFAULT_AUTO_SHRINK; - - ltext->priv->size_changed = TRUE; - - g_signal_connect (G_OBJECT(ltext->priv->buffer), "changed", - G_CALLBACK(buffer_changed_cb), ltext); -} - -static void -gl_label_text_finalize (GObject *object) -{ - glLabelText *ltext = GL_LABEL_TEXT (object); - - g_return_if_fail (object && GL_IS_LABEL_TEXT (object)); - - g_object_unref (ltext->priv->tag_table); - g_object_unref (ltext->priv->buffer); - g_free (ltext->priv->font_family); - gl_color_node_free (&(ltext->priv->color_node)); - g_free (ltext->priv); - - G_OBJECT_CLASS (gl_label_text_parent_class)->finalize (object); -} - -/*****************************************************************************/ -/* NEW label "text" object. */ -/*****************************************************************************/ -GObject * -gl_label_text_new (glLabel *label) -{ - glLabelText *ltext; - - ltext = g_object_new (gl_label_text_get_type(), NULL); - - gl_label_object_set_parent (GL_LABEL_OBJECT(ltext), label); - - return G_OBJECT (ltext); -} - -/*****************************************************************************/ -/* Copy object contents. */ -/*****************************************************************************/ -static void -copy (glLabelObject *dst_object, - glLabelObject *src_object) -{ - glLabelText *ltext = (glLabelText *)src_object; - glLabelText *new_ltext = (glLabelText *)dst_object; - GList *lines; - glColorNode *text_color_node; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); - g_return_if_fail (new_ltext && GL_IS_LABEL_TEXT (new_ltext)); - - lines = gl_label_text_get_lines (ltext); - text_color_node = get_text_color (src_object); - gl_label_text_set_lines (new_ltext, lines); - - new_ltext->priv->font_family = g_strdup (ltext->priv->font_family); - new_ltext->priv->font_size = ltext->priv->font_size; - new_ltext->priv->font_weight = ltext->priv->font_weight; - new_ltext->priv->font_italic_flag = ltext->priv->font_italic_flag; - set_text_color (dst_object, text_color_node); - new_ltext->priv->align = ltext->priv->align; - new_ltext->priv->line_spacing = ltext->priv->line_spacing; - new_ltext->priv->auto_shrink = ltext->priv->auto_shrink; - - new_ltext->priv->size_changed = ltext->priv->size_changed; - new_ltext->priv->w = ltext->priv->w; - new_ltext->priv->h = ltext->priv->h; - - gl_color_node_free (&text_color_node); - gl_text_node_lines_free (&lines); - - gl_debug (DEBUG_LABEL, "END"); -} - - -/*****************************************************************************/ -/* Set object params. */ -/*****************************************************************************/ -void -gl_label_text_set_lines (glLabelText *ltext, - GList *lines) -{ - gchar *text; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); - - text = gl_text_node_lines_expand (lines, NULL); - gtk_text_buffer_set_text (ltext->priv->buffer, text, -1); - g_free (text); - - ltext->priv->size_changed = TRUE; - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Get object params. */ -/*****************************************************************************/ -GtkTextBuffer * -gl_label_text_get_buffer (glLabelText *ltext) -{ - g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), NULL); - - return ltext->priv->buffer; -} - -GList * -gl_label_text_get_lines (glLabelText *ltext) -{ - GtkTextIter start, end; - gchar *text; - GList *lines; - - g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), NULL); - - gtk_text_buffer_get_bounds (ltext->priv->buffer, &start, &end); - text = gtk_text_buffer_get_text (ltext->priv->buffer, - &start, &end, FALSE); - lines = gl_text_node_lines_new_from_text (text); - g_free (text); - - return lines; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. text buffer "changed" callback. */ -/*---------------------------------------------------------------------------*/ -void buffer_changed_cb (GtkTextBuffer *textbuffer, - glLabelText *ltext) -{ - ltext->priv->size_changed = TRUE; - - gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get object size method. */ -/*---------------------------------------------------------------------------*/ -static void -get_size (glLabelObject *object, - gdouble *w, - gdouble *h) -{ - glLabelText *ltext = (glLabelText *)object; - PangoFontMap *fontmap; - PangoContext *context; - cairo_font_options_t *options; - PangoStyle style; - PangoLayout *layout; - PangoFontDescription *desc; - gdouble font_size; - gdouble line_spacing; - GtkTextIter start, end; - gchar *text; - gdouble w_parent, h_parent; - gint iw, ih; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); - - gl_label_object_get_raw_size (object, &w_parent, &h_parent); - - if ( (w_parent != 0.0) || (h_parent != 0.0) ) { - *w = w_parent; - *h = h_parent; - return; - } - - if (!ltext->priv->size_changed) - { - *w = ltext->priv->w; - *h = ltext->priv->h; - return; - } - - font_size = GL_LABEL_TEXT (object)->priv->font_size * FONT_SCALE; - line_spacing = GL_LABEL_TEXT (object)->priv->line_spacing; - - gtk_text_buffer_get_bounds (ltext->priv->buffer, &start, &end); - text = gtk_text_buffer_get_text (ltext->priv->buffer, - &start, &end, FALSE); - - - fontmap = pango_cairo_font_map_new (); - context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap)); - options = cairo_font_options_create (); - cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE); - pango_cairo_context_set_font_options (context, options); - cairo_font_options_destroy (options); - - layout = pango_layout_new (context); - - style = GL_LABEL_TEXT (object)->priv->font_italic_flag ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL; - - desc = pango_font_description_new (); - pango_font_description_set_family (desc, GL_LABEL_TEXT (object)->priv->font_family); - pango_font_description_set_weight (desc, GL_LABEL_TEXT (object)->priv->font_weight); - pango_font_description_set_style (desc, style); - pango_font_description_set_size (desc, font_size * PANGO_SCALE); - pango_layout_set_font_description (layout, desc); - pango_font_description_free (desc); - - pango_layout_set_spacing (layout, font_size * (line_spacing-1) * PANGO_SCALE); - pango_layout_set_text (layout, text, -1); - pango_layout_get_size (layout, &iw, &ih); - *w = ltext->priv->w = iw / PANGO_SCALE + 2*GL_LABEL_TEXT_MARGIN; - *h = ltext->priv->h = ih / PANGO_SCALE; - ltext->priv->size_changed = FALSE; - - g_object_unref (layout); - g_object_unref (context); - g_object_unref (fontmap); - g_free (text); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set font family method. */ -/*---------------------------------------------------------------------------*/ -static void -set_font_family (glLabelObject *object, - const gchar *font_family) -{ - glLabelText *ltext = (glLabelText *)object; - GList *family_names; - gchar *good_font_family; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); - g_return_if_fail (font_family); - - family_names = gl_util_get_font_family_list (); - if (g_list_find_custom (family_names, font_family, (GCompareFunc)g_utf8_collate)) { - good_font_family = g_strdup (font_family); - } else { - if (family_names != NULL) { - good_font_family = g_strdup (family_names->data); /* 1st entry */ - } else { - good_font_family = g_strdup (font_family); - } - } - - if (ltext->priv->font_family) { - if (g_strcasecmp (ltext->priv->font_family, good_font_family) == 0) { - g_free (good_font_family); - gl_debug (DEBUG_LABEL, "END (no change)"); - return; - } - g_free (ltext->priv->font_family); - } - ltext->priv->font_family = g_strdup (good_font_family); - g_free (good_font_family); - - gl_debug (DEBUG_LABEL, "new font family = %s", ltext->priv->font_family); - - ltext->priv->size_changed = TRUE; - - gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set font size method. */ -/*---------------------------------------------------------------------------*/ -static void -set_font_size (glLabelObject *object, - gdouble font_size) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); - - if (ltext->priv->font_size != font_size) { - - ltext->priv->size_changed = TRUE; - - ltext->priv->font_size = font_size; - gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set font weight method. */ -/*---------------------------------------------------------------------------*/ -static void -set_font_weight (glLabelObject *object, - PangoWeight font_weight) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); - - if (ltext->priv->font_weight != font_weight) { - - ltext->priv->size_changed = TRUE; - - ltext->priv->font_weight = font_weight; - gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set font italic flag method. */ -/*---------------------------------------------------------------------------*/ -static void -set_font_italic_flag (glLabelObject *object, - gboolean font_italic_flag) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); - - if (ltext->priv->font_italic_flag != font_italic_flag) { - - ltext->priv->size_changed = TRUE; - - ltext->priv->font_italic_flag = font_italic_flag; - gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set text alignment method. */ -/*---------------------------------------------------------------------------*/ -static void -set_text_alignment (glLabelObject *object, - PangoAlignment text_alignment) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); - - if (ltext->priv->align != text_alignment) { - - ltext->priv->size_changed = TRUE; - - ltext->priv->align = text_alignment; - gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set text line spacing method. */ -/*---------------------------------------------------------------------------*/ -static void -set_text_line_spacing (glLabelObject *object, - gdouble line_spacing) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); - - if (ltext->priv->line_spacing != line_spacing) { - - ltext->priv->size_changed = TRUE; - - ltext->priv->line_spacing = line_spacing; - gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. set text color method. */ -/*---------------------------------------------------------------------------*/ -static void -set_text_color (glLabelObject *object, - glColorNode *text_color_node) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); - - if (!gl_color_node_equal (ltext->priv->color_node, text_color_node)) { - - gl_color_node_free (&(ltext->priv->color_node)); - ltext->priv->color_node = gl_color_node_dup (text_color_node); - - gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get font family method. */ -/*---------------------------------------------------------------------------*/ -static gchar * -get_font_family (glLabelObject *object) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), NULL); - - return g_strdup (ltext->priv->font_family); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get font size method. */ -/*---------------------------------------------------------------------------*/ -static gdouble -get_font_size (glLabelObject *object) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0.0); - - return ltext->priv->font_size; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get font weight method. */ -/*---------------------------------------------------------------------------*/ -static PangoWeight -get_font_weight (glLabelObject *object) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), PANGO_WEIGHT_NORMAL); - - return ltext->priv->font_weight; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get font italic flag method. */ -/*---------------------------------------------------------------------------*/ -static gboolean -get_font_italic_flag (glLabelObject *object) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), FALSE); - - return ltext->priv->font_italic_flag; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get text alignment method. */ -/*---------------------------------------------------------------------------*/ -static PangoAlignment -get_text_alignment (glLabelObject *object) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), GTK_JUSTIFY_LEFT); - - return ltext->priv->align; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get text line spacing method. */ -/*---------------------------------------------------------------------------*/ -static gdouble -get_text_line_spacing (glLabelObject *object) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0.0); - - return ltext->priv->line_spacing; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. get text color method. */ -/*---------------------------------------------------------------------------*/ -static glColorNode* -get_text_color (glLabelObject *object) -{ - glLabelText *ltext = (glLabelText *)object; - - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0); - - return gl_color_node_dup (ltext->priv->color_node); -} - -/*****************************************************************************/ -/* Set auto shrink flag. */ -/*****************************************************************************/ -void -gl_label_text_set_auto_shrink (glLabelText *ltext, - gboolean auto_shrink) -{ - gl_debug (DEBUG_LABEL, "BEGIN"); - - g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); - - if (ltext->priv->auto_shrink != auto_shrink) { - - ltext->priv->auto_shrink = auto_shrink; - gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Query auto shrink flag. */ -/*****************************************************************************/ -gboolean -gl_label_text_get_auto_shrink (glLabelText *ltext) -{ - gl_debug (DEBUG_LABEL, ""); - - g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0); - - return ltext->priv->auto_shrink; -} - -/*****************************************************************************/ -/* Draw object method. */ -/*****************************************************************************/ -static void -draw_object (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) -{ - gdouble x0, y0; - cairo_matrix_t matrix; - gdouble object_w, object_h; - gdouble raw_w, raw_h; - gchar *text; - GList *lines; - gchar *font_family; - gdouble font_size; - PangoWeight font_weight; - gboolean font_italic_flag; - glColorNode *color_node; - gboolean auto_shrink; - guint color; - gdouble text_line_spacing; - PangoAlignment alignment; - PangoStyle style; - PangoLayout *layout; - PangoFontDescription *desc; - gdouble scale_x, scale_y; - cairo_font_options_t *font_options; - PangoContext *context; - - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_object_get_position (object, &x0, &y0); - gl_label_object_get_matrix (object, &matrix); - - gl_label_object_get_size (object, &object_w, &object_h); - gl_label_object_get_raw_size (object, &raw_w, &raw_h); - lines = gl_label_text_get_lines (GL_LABEL_TEXT (object)); - font_family = gl_label_object_get_font_family (object); - font_size = gl_label_object_get_font_size (object) * FONT_SCALE; - font_weight = gl_label_object_get_font_weight (object); - font_italic_flag = gl_label_object_get_font_italic_flag (object); - - color_node = gl_label_object_get_text_color (object); - color = gl_color_node_expand (color_node, record); - if (color_node->field_flag && screen_flag) - { - color = GL_COLOR_MERGE_DEFAULT; - } - gl_color_node_free (&color_node); - - alignment = gl_label_object_get_text_alignment (object); - text_line_spacing = - gl_label_object_get_text_line_spacing (object); - auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); - - text = gl_text_node_lines_expand (lines, record); - - style = font_italic_flag ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL; - - - if (!screen_flag && record && auto_shrink && (raw_w != 0.0)) - { - font_size = auto_shrink_font_size (cr, - font_family, - font_size, - font_weight, - style, - text, - object_w); - g_print ("Autosize new size = %g\n", font_size); - } - - - /* - * Workaround for pango Bug#341481. - * Render font at device scale and scale font size accordingly. - */ - scale_x = 1.0; - scale_y = 1.0; - cairo_device_to_user_distance (cr, &scale_x, &scale_y); - scale_x = fabs (scale_x); - scale_y = fabs (scale_y); - cairo_save (cr); - cairo_scale (cr, scale_x, scale_y); - - layout = pango_cairo_create_layout (cr); - - font_options = cairo_font_options_create (); - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - context = pango_layout_get_context (layout); - pango_cairo_context_set_font_options (context, font_options); - cairo_font_options_destroy (font_options); - - desc = pango_font_description_new (); - pango_font_description_set_family (desc, font_family); - pango_font_description_set_weight (desc, font_weight); - pango_font_description_set_style (desc, style); - pango_font_description_set_size (desc, font_size * PANGO_SCALE / scale_x); - pango_layout_set_font_description (layout, desc); - pango_font_description_free (desc); - - pango_layout_set_text (layout, text, -1); - pango_layout_set_spacing (layout, font_size * (text_line_spacing-1) * PANGO_SCALE / scale_x); - if (raw_w == 0.0) - { - pango_layout_set_width (layout, -1); - } - else - { - pango_layout_set_width (layout, object_w * PANGO_SCALE / scale_x); - } - pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); - pango_layout_set_alignment (layout, alignment); - - - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (color)); - cairo_move_to (cr, GL_LABEL_TEXT_MARGIN/scale_x, 0); - pango_cairo_show_layout (cr, layout); - - cairo_restore (cr); - - g_object_unref (layout); - - - gl_text_node_lines_free (&lines); - g_free (font_family); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Draw shadow method. */ -/*****************************************************************************/ -static void -draw_shadow (glLabelObject *object, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) -{ - gdouble x0, y0; - cairo_matrix_t matrix; - gdouble object_w, object_h; - gdouble raw_w, raw_h; - gchar *text; - GList *lines; - gchar *font_family; - gdouble font_size; - PangoWeight font_weight; - gboolean font_italic_flag; - gboolean auto_shrink; - guint color; - glColorNode *color_node; - gdouble text_line_spacing; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - guint shadow_color; - PangoAlignment alignment; - PangoStyle style; - PangoLayout *layout; - PangoFontDescription *desc; - gdouble scale_x, scale_y; - cairo_font_options_t *font_options; - PangoContext *context; - - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_object_get_position (object, &x0, &y0); - gl_label_object_get_matrix (object, &matrix); - - gl_label_object_get_size (object, &object_w, &object_h); - gl_label_object_get_raw_size (object, &raw_w, &raw_h); - lines = gl_label_text_get_lines (GL_LABEL_TEXT (object)); - font_family = gl_label_object_get_font_family (object); - font_size = gl_label_object_get_font_size (object) * FONT_SCALE; - font_weight = gl_label_object_get_font_weight (object); - font_italic_flag = gl_label_object_get_font_italic_flag (object); - - color_node = gl_label_object_get_text_color (object); - color = gl_color_node_expand (color_node, record); - gl_color_node_free (&color_node); - - alignment = gl_label_object_get_text_alignment (object); - text_line_spacing = - gl_label_object_get_text_line_spacing (object); - auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); - - shadow_color_node = gl_label_object_get_shadow_color (object); - if (shadow_color_node->field_flag) - { - shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT; - } - shadow_opacity = gl_label_object_get_shadow_opacity (object); - shadow_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, color); - gl_color_node_free (&shadow_color_node); - - text = gl_text_node_lines_expand (lines, record); - - style = font_italic_flag ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL; - - - if (!screen_flag && record && auto_shrink && (raw_w != 0.0)) - { - font_size = auto_shrink_font_size (cr, - font_family, - font_size, - font_weight, - style, - text, - object_w); - } - - - /* - * Workaround for pango Bug#341481. - * Render font at device scale and scale font size accordingly. - */ - scale_x = 1.0; - scale_y = 1.0; - cairo_device_to_user_distance (cr, &scale_x, &scale_y); - scale_x = fabs (scale_x); - scale_y = fabs (scale_y); - cairo_save (cr); - cairo_scale (cr, scale_x, scale_y); - - layout = pango_cairo_create_layout (cr); - - font_options = cairo_font_options_create (); - cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); - context = pango_layout_get_context (layout); - pango_cairo_context_set_font_options (context, font_options); - cairo_font_options_destroy (font_options); - - desc = pango_font_description_new (); - pango_font_description_set_family (desc, font_family); - pango_font_description_set_weight (desc, font_weight); - pango_font_description_set_style (desc, style); - pango_font_description_set_size (desc, font_size * PANGO_SCALE / scale_x); - pango_layout_set_font_description (layout, desc); - pango_font_description_free (desc); - - pango_layout_set_text (layout, text, -1); - pango_layout_set_spacing (layout, font_size * (text_line_spacing-1) * PANGO_SCALE / scale_x); - if (raw_w == 0.0) - { - pango_layout_set_width (layout, -1); - } - else - { - pango_layout_set_width (layout, object_w * PANGO_SCALE / scale_x); - } - pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); - pango_layout_set_alignment (layout, alignment); - - cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_color)); - cairo_move_to (cr, GL_LABEL_TEXT_MARGIN/scale_x, 0); - pango_cairo_show_layout (cr, layout); - - - cairo_restore (cr); - - g_object_unref (layout); - - gl_text_node_lines_free (&lines); - g_free (font_family); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Automatically shrink text size to fit within horizontal width. */ -/*****************************************************************************/ -static gdouble -auto_shrink_font_size (cairo_t *cr, - gchar *family, - gdouble size, - PangoWeight weight, - PangoStyle style, - gchar *text, - gdouble width) -{ - PangoLayout *layout; - PangoFontDescription *desc; - gint iw, ih; - gdouble layout_width; - gdouble new_size; - - layout = pango_cairo_create_layout (cr); - - desc = pango_font_description_new (); - pango_font_description_set_family (desc, family); - pango_font_description_set_weight (desc, weight); - pango_font_description_set_style (desc, style); - pango_font_description_set_size (desc, size * PANGO_SCALE); - - pango_layout_set_font_description (layout, desc); - pango_font_description_free (desc); - - pango_layout_set_text (layout, text, -1); - pango_layout_set_width (layout, -1); - pango_layout_get_size (layout, &iw, &ih); - layout_width = (gdouble)iw / (gdouble)PANGO_SCALE; - - g_object_unref (layout); - - g_print ("Object w = %g, layout w = %g\n", width, layout_width); - - if ( layout_width > width ) - { - /* Scale down. */ - new_size = size * (width-2*GL_LABEL_TEXT_MARGIN)/layout_width; - - /* Round down to nearest 1/2 point */ - new_size = (int)(new_size*2.0) / 2.0; - - /* don't get ridiculously small. */ - if (new_size < 1.0) - { - new_size = 1.0; - } - } - else - { - new_size = size; - } - - return new_size; -} - diff --git a/glabels2/src/label-text.h b/glabels2/src/label-text.h deleted file mode 100644 index 95c46230..00000000 --- a/glabels2/src/label-text.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label_text.h: GLabels label text object - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LABEL_TEXT_H__ -#define __LABEL_TEXT_H__ - -#include -#include "text-node.h" -#include "label-object.h" - -G_BEGIN_DECLS - -#define GL_LABEL_TEXT_MARGIN 3.0 - - -#define GL_TYPE_LABEL_TEXT (gl_label_text_get_type ()) -#define GL_LABEL_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_TEXT, glLabelText)) -#define GL_LABEL_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_TEXT, glLabelTextClass)) -#define GL_IS_LABEL_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_TEXT)) -#define GL_IS_LABEL_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_TEXT)) - -typedef struct _glLabelText glLabelText; -typedef struct _glLabelTextClass glLabelTextClass; - -typedef struct _glLabelTextPrivate glLabelTextPrivate; - -struct _glLabelText { - glLabelObject object; - - glLabelTextPrivate *priv; -}; - -struct _glLabelTextClass { - glLabelObjectClass parent_class; -}; - -GType gl_label_text_get_type (void) G_GNUC_CONST; - -GObject *gl_label_text_new (glLabel *label); - -void gl_label_text_set_lines (glLabelText *ltext, - GList *lines); -GtkTextBuffer *gl_label_text_get_buffer (glLabelText *ltext); -GList *gl_label_text_get_lines (glLabelText *ltext); - -void gl_label_text_set_auto_shrink (glLabelText *ltext, - gboolean auto_shrink); -gboolean gl_label_text_get_auto_shrink (glLabelText *ltext); - - -G_END_DECLS - -#endif /* __LABEL_TEXT_H__ */ diff --git a/glabels2/src/label.c b/glabels2/src/label.c deleted file mode 100644 index c886529b..00000000 --- a/glabels2/src/label.c +++ /dev/null @@ -1,674 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label.c: GLabels label module - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "label.h" - -#include - -#include "marshal.h" -#include "prefs.h" -#include "util.h" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glLabelPrivate { - - gchar *filename; - gint compression; - gboolean modified_flag; - gint untitled_instance; - - glMerge *merge; - - GHashTable *pixbuf_cache; -}; - -enum { - CHANGED, - NAME_CHANGED, - MODIFIED_CHANGED, - MERGE_CHANGED, - SIZE_CHANGED, - OBJECT_ADDED, - LAST_SIGNAL -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -static guint signals[LAST_SIGNAL] = {0}; - -static guint untitled = 0; - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_label_finalize (GObject *object); - -static void object_changed_cb (glLabelObject *object, - glLabel *label); - -static void object_moved_cb (glLabelObject *object, - gdouble x, - gdouble y, - glLabel *label); - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glLabel, gl_label, G_TYPE_OBJECT); - -static void -gl_label_class_init (glLabelClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_LABEL, "START"); - - gl_label_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_label_finalize; - - signals[CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelClass, changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - signals[NAME_CHANGED] = - g_signal_new ("name_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelClass, name_changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - signals[MODIFIED_CHANGED] = - g_signal_new ("modified_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelClass, modified_changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - signals[MERGE_CHANGED] = - g_signal_new ("merge_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelClass, merge_changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - signals[SIZE_CHANGED] = - g_signal_new ("size_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelClass, size_changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - signals[OBJECT_ADDED] = - g_signal_new ("object_added", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glLabelClass, object_added), - NULL, NULL, - gl_marshal_VOID__OBJECT, - G_TYPE_NONE, - 1, G_TYPE_OBJECT); - - gl_debug (DEBUG_LABEL, "END"); -} - -static void -gl_label_init (glLabel *label) -{ - gl_debug (DEBUG_LABEL, "START"); - - label->template = NULL; - label->rotate_flag = FALSE; - label->objects = NULL; - - label->priv = g_new0 (glLabelPrivate, 1); - - label->priv->filename = NULL; - label->priv->merge = NULL; - label->priv->pixbuf_cache = gl_pixbuf_cache_new (); - - gl_debug (DEBUG_LABEL, "END"); -} - -static void -gl_label_finalize (GObject *object) -{ - glLabel *label = GL_LABEL (object); - GList *p, *p_next; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (object && GL_IS_LABEL (object)); - - for (p = label->objects; p != NULL; p = p_next) { - p_next = p->next; /* NOTE: p will be left dangling */ - g_object_unref (G_OBJECT(p->data)); - } - - lgl_template_free (label->template); - g_free (label->priv->filename); - if (label->priv->merge != NULL) { - g_object_unref (G_OBJECT(label->priv->merge)); - } - gl_pixbuf_cache_free (label->priv->pixbuf_cache); - - g_free (label->priv); - - G_OBJECT_CLASS (gl_label_parent_class)->finalize (object); - - gl_debug (DEBUG_LABEL, "END"); -} - -GObject * -gl_label_new (void) -{ - glLabel *label; - - gl_debug (DEBUG_LABEL, "START"); - - label = g_object_new (gl_label_get_type(), NULL); - - label->priv->compression = 9; - - label->priv->modified_flag = FALSE; - - gl_debug (DEBUG_LABEL, "END"); - - return G_OBJECT (label); -} - - -/*****************************************************************************/ -/* Add object to label. */ -/*****************************************************************************/ -void -gl_label_add_object (glLabel *label, - glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (label && GL_IS_LABEL (label)); - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - object->parent = label; - label->objects = g_list_append (label->objects, g_object_ref (object)); - - label->priv->modified_flag = TRUE; - - g_signal_emit (G_OBJECT(label), signals[OBJECT_ADDED], 0, object); - g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); - g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); - - g_signal_connect (G_OBJECT(object), "changed", - G_CALLBACK(object_changed_cb), label); - - g_signal_connect (G_OBJECT(object), "moved", - G_CALLBACK(object_moved_cb), label); - - gl_debug (DEBUG_LABEL, "END"); -} - -/*****************************************************************************/ -/* Remove object from label. */ -/*****************************************************************************/ -void -gl_label_remove_object (glLabel *label, - glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (label && GL_IS_LABEL (label)); - g_return_if_fail (GL_IS_LABEL_OBJECT (object)); - - object->parent = NULL; - label->objects = g_list_remove (label->objects, object); - - if ( G_OBJECT(label)->ref_count /* not finalized */ ) { - - g_signal_handlers_disconnect_by_func (object, - G_CALLBACK(object_changed_cb), - label); - g_signal_handlers_disconnect_by_func (object, - G_CALLBACK(object_moved_cb), - label); - - label->priv->modified_flag = TRUE; - - g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); - g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Object changed callback. */ -/*---------------------------------------------------------------------------*/ -static void -object_changed_cb (glLabelObject *object, - glLabel *label) -{ - - if ( !label->priv->modified_flag ) { - - label->priv->modified_flag = TRUE; - - g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); - } - - g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Object moved callback. */ -/*---------------------------------------------------------------------------*/ -static void -object_moved_cb (glLabelObject *object, - gdouble x, - gdouble y, - glLabel *label) -{ - - if ( !label->priv->modified_flag ) { - - label->priv->modified_flag = TRUE; - - g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); - } - - g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); -} - -/****************************************************************************/ -/* Bring label object to front/top. */ -/****************************************************************************/ -void -gl_label_raise_object_to_top (glLabel *label, - glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, "START"); - - /* Move to end of list, representing front most object */ - label->objects = g_list_remove (label->objects, object); - label->objects = g_list_append (label->objects, object); - - label->priv->modified_flag = TRUE; - - g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); - g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Send label object to rear/bottom. */ -/****************************************************************************/ -void -gl_label_lower_object_to_bottom (glLabel *label, - glLabelObject *object) -{ - gl_debug (DEBUG_LABEL, "START"); - - /* Move to front of list, representing rear most object */ - label->objects = g_list_remove (label->objects, object); - label->objects = g_list_prepend (label->objects, object); - - label->priv->modified_flag = TRUE; - - g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); - g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* set template. */ -/****************************************************************************/ -extern void -gl_label_set_template (glLabel *label, - lglTemplate *template) -{ - gchar *name; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (label && GL_IS_LABEL (label)); - g_return_if_fail (template); - - if ((label->template == NULL) || - !lgl_template_do_templates_match (template, label->template)) { - - lgl_template_free (label->template); - label->template = lgl_template_dup (template); - - label->priv->modified_flag = TRUE; - - g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); - g_signal_emit (G_OBJECT(label), signals[SIZE_CHANGED], 0); - g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); - - name = lgl_template_get_name (template); - gl_prefs_add_recent_template (name); - g_free (name); - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* set rotate flag. */ -/****************************************************************************/ -extern void -gl_label_set_rotate_flag (glLabel *label, - gboolean rotate_flag) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (label && GL_IS_LABEL (label)); - - if (rotate_flag != label->rotate_flag) { - - label->rotate_flag = rotate_flag; - - label->priv->modified_flag = TRUE; - - g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); - g_signal_emit (G_OBJECT(label), signals[SIZE_CHANGED], 0); - g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); - - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Get label size. */ -/****************************************************************************/ -void -gl_label_get_size (glLabel *label, - gdouble *w, - gdouble *h) -{ - lglTemplate *template; - const lglTemplateFrame *frame; - - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (label && GL_IS_LABEL (label)); - - template = label->template; - if ( !template ) { - gl_debug (DEBUG_LABEL, "END -- template NULL"); - *w = *h = 0; - return; - } - frame = (lglTemplateFrame *)template->frames->data; - - if (!label->rotate_flag) { - lgl_template_frame_get_size (frame, w, h); - } else { - lgl_template_frame_get_size (frame, h, w); - } - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* set merge information structure. */ -/****************************************************************************/ -extern void -gl_label_set_merge (glLabel *label, - glMerge *merge) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_if_fail (label && GL_IS_LABEL (label)); - - if ( label->priv->merge != NULL ) { - g_object_unref (G_OBJECT(label->priv->merge)); - } - label->priv->merge = gl_merge_dup (merge); - - label->priv->modified_flag = TRUE; - - g_signal_emit (G_OBJECT(label), signals[MERGE_CHANGED], 0); - g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); - g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); - - gl_debug (DEBUG_LABEL, "END"); -} - -/****************************************************************************/ -/* Get merge information structure. */ -/****************************************************************************/ -glMerge * -gl_label_get_merge (glLabel *label) -{ - gl_debug (DEBUG_LABEL, "START"); - - g_return_val_if_fail (label && GL_IS_LABEL (label), NULL); - - gl_debug (DEBUG_LABEL, "END"); - - return gl_merge_dup (label->priv->merge); -} - -/****************************************************************************/ -/* return filename. */ -/****************************************************************************/ -gchar * -gl_label_get_filename (glLabel *label) -{ - gl_debug (DEBUG_LABEL, ""); - - return g_strdup ( label->priv->filename ); -} - -/****************************************************************************/ -/* return short filename. */ -/****************************************************************************/ -gchar * -gl_label_get_short_name (glLabel *label) -{ - gl_debug (DEBUG_LABEL, ""); - - if ( label->priv->filename == NULL ) { - - if ( label->priv->untitled_instance == 0 ) { - label->priv->untitled_instance = ++untitled; - } - - return g_strdup_printf ( "%s %d", _("Untitled"), - label->priv->untitled_instance ); - - } else { - gchar *temp_name, *short_name; - - temp_name = g_path_get_basename ( label->priv->filename ); - short_name = gl_util_remove_extension (temp_name); - g_free (temp_name); - - return short_name; - } -} - -/****************************************************************************/ -/* Get pixbuf cache. */ -/****************************************************************************/ -GHashTable * -gl_label_get_pixbuf_cache (glLabel *label) -{ - return label->priv->pixbuf_cache; -} - -/****************************************************************************/ -/* Is label modified? */ -/****************************************************************************/ -gboolean -gl_label_is_modified (glLabel *label) -{ - gl_debug (DEBUG_LABEL, "return %d", label->priv->modified_flag); - return label->priv->modified_flag; -} - -/****************************************************************************/ -/* Is label untitled? */ -/****************************************************************************/ -gboolean -gl_label_is_untitled (glLabel *label) -{ - gl_debug (DEBUG_LABEL, "return %d",(label->priv->filename == NULL)); - return (label->priv->filename == NULL); -} - -/****************************************************************************/ -/* Can undo? */ -/****************************************************************************/ -gboolean -gl_label_can_undo (glLabel *label) -{ - return FALSE; -} - - -/****************************************************************************/ -/* Can redo? */ -/****************************************************************************/ -gboolean -gl_label_can_redo (glLabel *label) -{ - return FALSE; -} - - -/****************************************************************************/ -/* Set filename. */ -/****************************************************************************/ -void -gl_label_set_filename (glLabel *label, - const gchar *filename) -{ - label->priv->filename = g_strdup (filename); - - g_signal_emit (G_OBJECT(label), signals[NAME_CHANGED], 0); -} - -/****************************************************************************/ -/* Clear modified flag. */ -/****************************************************************************/ -void -gl_label_clear_modified (glLabel *label) -{ - - if ( label->priv->modified_flag ) { - - label->priv->modified_flag = FALSE; - - g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); - } - -} - - -/****************************************************************************/ -/* Set compression level. */ -/****************************************************************************/ -void -gl_label_set_compression (glLabel *label, - gint compression) -{ - gl_debug (DEBUG_LABEL, "set %d", compression); - - /* Older versions of libxml2 always return a -1 for documents "read in," so - * default to 9. Also, default to 9 for anything else out of range. */ - if ((compression < 0) || (compression >9)) { - compression = 9; - } - - gl_debug (DEBUG_LABEL, "actual set %d", compression); - label->priv->compression = compression; -} - - -/****************************************************************************/ -/* Get compression level. */ -/****************************************************************************/ -gint -gl_label_get_compression (glLabel *label) -{ - gl_debug (DEBUG_LABEL, "return %d", label->priv->compression); - return label->priv->compression; -} - - -/****************************************************************************/ -/* Draw label. */ -/****************************************************************************/ -void -gl_label_draw (glLabel *label, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record) -{ - GList *p_obj; - glLabelObject *object; - - g_return_if_fail (label && GL_IS_LABEL (label)); - - for (p_obj = label->objects; p_obj != NULL; p_obj = p_obj->next) - { - object = GL_LABEL_OBJECT (p_obj->data); - - gl_label_object_draw (object, cr, screen_flag, record); - } -} diff --git a/glabels2/src/label.h b/glabels2/src/label.h deleted file mode 100644 index f6e0c23b..00000000 --- a/glabels2/src/label.h +++ /dev/null @@ -1,154 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label.h: GLabels label module header file - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __LABEL_H__ -#define __LABEL_H__ - -#include - -#include -#include "merge.h" -#include "pixbuf-cache.h" -#include - -G_BEGIN_DECLS - -typedef struct { - gdouble x1; - gdouble y1; - gdouble x2; - gdouble y2; -} glLabelRegion; - -#define GL_TYPE_LABEL (gl_label_get_type ()) -#define GL_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL, glLabel)) -#define GL_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL, glLabelClass)) -#define GL_IS_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL)) -#define GL_IS_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL)) - -typedef struct _glLabel glLabel; -typedef struct _glLabelClass glLabelClass; - -typedef struct _glLabelPrivate glLabelPrivate; - -#include "label-object.h" -struct _glLabel { - GObject object; - - lglTemplate *template; - gboolean rotate_flag; - - GList *objects; - - glLabelPrivate *priv; -}; - -struct _glLabelClass { - GObjectClass parent_class; - - void (*changed) (glLabel *label, gpointer user_data); - - void (*name_changed) (glLabel *label, gpointer user_data); - - void (*modified_changed) (glLabel *label, gpointer user_data); - - void (*merge_changed) (glLabel *label, gpointer user_data); - - void (*size_changed) (glLabel *label, gpointer user_data); - - void (*object_added) (glLabel *label, - glLabelObject *object, - gpointer user_data); - -}; - - -GType gl_label_get_type (void) G_GNUC_CONST; - -GObject *gl_label_new (void); - - -void gl_label_add_object (glLabel *label, - glLabelObject *object); - -void gl_label_remove_object (glLabel *label, - glLabelObject *object); - -void gl_label_raise_object_to_top (glLabel *label, - glLabelObject *object); - -void gl_label_lower_object_to_bottom (glLabel *label, - glLabelObject *object); - - -void gl_label_set_template (glLabel *label, - lglTemplate *template); - -void gl_label_set_rotate_flag (glLabel *label, - gboolean rotate_flag); - -void gl_label_get_size (glLabel *label, - gdouble *w, - gdouble *h); - - -void gl_label_set_merge (glLabel *label, - glMerge *merge); - -glMerge *gl_label_get_merge (glLabel *label); - - -gchar *gl_label_get_filename (glLabel *label); - -gchar *gl_label_get_short_name (glLabel *label); - -GHashTable *gl_label_get_pixbuf_cache (glLabel *label); - -gboolean gl_label_is_modified (glLabel *label); - -gboolean gl_label_is_untitled (glLabel *label); - -gboolean gl_label_can_undo (glLabel *label); - -gboolean gl_label_can_redo (glLabel *label); - - -void gl_label_set_filename (glLabel *label, - const gchar *filename); - -void gl_label_clear_modified (glLabel *label); - -void gl_label_set_compression (glLabel *label, - gint compression); - -gint gl_label_get_compression (glLabel *label); - -void gl_label_draw (glLabel *label, - cairo_t *cr, - gboolean screen_flag, - glMergeRecord *record); - -G_END_DECLS - - -#endif /* __LABEL_H__ */ diff --git a/glabels2/src/marshal.list b/glabels2/src/marshal.list deleted file mode 100644 index ea17eaf3..00000000 --- a/glabels2/src/marshal.list +++ /dev/null @@ -1,7 +0,0 @@ -VOID:VOID -VOID:INT -VOID:INT,INT -VOID:INT,UINT -VOID:DOUBLE -VOID:DOUBLE,DOUBLE -VOID:OBJECT diff --git a/glabels2/src/merge-evolution.c b/glabels2/src/merge-evolution.c deleted file mode 100644 index bf99e1bb..00000000 --- a/glabels2/src/merge-evolution.c +++ /dev/null @@ -1,546 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge_evolution.c: evolution merge backend module - * - * Copyright (C) 2001 Jim Evins . - * and - * Copyright (C) 2005 Austin Henry - * and - * Copyright (C) 2007 Peter Cherriman - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#ifdef HAVE_LIBEBOOK - - -#include "merge-evolution.h" - -#include -#include -#include -#include -#include - -#include "debug.h" - -#define DEFAULT_QUERY "(exists \"full_name\")" - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -struct _glMergeEvolutionPrivate { - gchar *query; - EBook *book; - GList *contacts; - GList *fields; /* the fields supported by the addressbook */ -}; - -enum { - LAST_SIGNAL -}; - -enum { - ARG_0, - ARG_QUERY, -}; - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_merge_evolution_finalize (GObject *object); - -static void gl_merge_evolution_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec); - -static void gl_merge_evolution_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec); - -static GList *gl_merge_evolution_get_key_list (glMerge *merge); -static gchar *gl_merge_evolution_get_primary_key (glMerge *merge); -static void gl_merge_evolution_open (glMerge *merge); -static void gl_merge_evolution_close (glMerge *merge); -static glMergeRecord *gl_merge_evolution_get_record (glMerge *merge); -static void gl_merge_evolution_copy (glMerge *dst_merge, - glMerge *src_merge); - -/* utility function prototypes go here */ -static void free_field_list (GList *fields); - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glMergeEvolution, gl_merge_evolution, GL_TYPE_MERGE); - -static void -gl_merge_evolution_class_init (glMergeEvolutionClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glMergeClass *merge_class = GL_MERGE_CLASS (class); - - gl_debug (DEBUG_MERGE, "START"); - - gl_merge_evolution_parent_class = g_type_class_peek_parent (class); - - object_class->set_property = gl_merge_evolution_set_property; - object_class->get_property = gl_merge_evolution_get_property; - - g_object_class_install_property - (object_class, - ARG_QUERY, - g_param_spec_string ("query", NULL, - "Query used to select records from the addressbook", - "(exists \"full_name\")", - (G_PARAM_READABLE | G_PARAM_WRITABLE))); - - object_class->finalize = gl_merge_evolution_finalize; - - merge_class->get_key_list = gl_merge_evolution_get_key_list; - merge_class->get_primary_key = gl_merge_evolution_get_primary_key; - merge_class->open = gl_merge_evolution_open; - merge_class->close = gl_merge_evolution_close; - merge_class->get_record = gl_merge_evolution_get_record; - merge_class->copy = gl_merge_evolution_copy; - - gl_debug (DEBUG_MERGE, "END"); -} - -static void -gl_merge_evolution_init (glMergeEvolution *merge_evolution) -{ - gl_debug (DEBUG_MERGE, "START"); - - merge_evolution->priv = g_new0 (glMergeEvolutionPrivate, 1); - merge_evolution->priv->query = g_strdup(DEFAULT_QUERY); - - gl_debug (DEBUG_MERGE, "END"); -} - -static void -gl_merge_evolution_finalize (GObject *object) -{ - glMergeEvolution *merge_evolution = GL_MERGE_EVOLUTION (object); - - gl_debug (DEBUG_MERGE, "START"); - - g_return_if_fail (object && GL_IS_MERGE_EVOLUTION (object)); - - free_field_list(merge_evolution->priv->fields); - g_free (merge_evolution->priv->query); - g_free (merge_evolution->priv); - - G_OBJECT_CLASS (gl_merge_evolution_parent_class)->finalize (object); - - gl_debug (DEBUG_MERGE, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* Set argument. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_evolution_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec) -{ - glMergeEvolution *merge_evolution; - - merge_evolution = GL_MERGE_EVOLUTION (object); - - switch (param_id) { - - case ARG_QUERY: - g_free (merge_evolution->priv->query); - merge_evolution->priv->query = g_value_dup_string (value); - gl_debug (DEBUG_MERGE, "ARG \"query\" = \"%s\"", - merge_evolution->priv->query); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - - } - -} - -/*--------------------------------------------------------------------------*/ -/* Get argument. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_evolution_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec) -{ - glMergeEvolution *merge_evolution; - - merge_evolution = GL_MERGE_EVOLUTION (object); - - switch (param_id) { - - case ARG_QUERY: - g_value_set_string (value, merge_evolution->priv->query); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - - } - -} - -/*--------------------------------------------------------------------------*/ -/* Get key list. */ -/*--------------------------------------------------------------------------*/ -static GList * -gl_merge_evolution_get_key_list (glMerge *merge) -{ - glMergeEvolution *merge_evolution; - GList *key_list = NULL; - GList *iter; - - gl_debug (DEBUG_MERGE, "BEGIN"); - - merge_evolution = GL_MERGE_EVOLUTION (merge); - - /* for the previously retrieved supported fileds, go through them and find - * their pretty names */ - for (iter = merge_evolution->priv->fields; - iter != NULL; - iter = g_list_next(iter)) - { - key_list = g_list_prepend (key_list, - g_strdup (e_contact_pretty_name (*(EContactField *)iter->data))); - } - - key_list = g_list_reverse (key_list); - - gl_debug (DEBUG_MERGE, "END"); - - return key_list; -} - -/*--------------------------------------------------------------------------*/ -/* Get "primary" key. */ -/*--------------------------------------------------------------------------*/ -static gchar * -gl_merge_evolution_get_primary_key (glMerge *merge) -{ - return g_strdup (e_contact_pretty_name(E_CONTACT_FILE_AS)); -} - -/* Sort compare function for sorting contacts by file-as element - * by Peter Cherriman (PJC) - * called by GList* g_list_sort(GList *list, sort_contact_by_file_as); - */ -static gint sort_contact_by_file_as(gconstpointer *a, gconstpointer *b) -{ - /* - * Returns : negative value if a < b; zero if a = b; positive value if a > b - */ - - // Check and cast a and b to EContact - EContact *contact_a = E_CONTACT(a); - EContact *contact_b = E_CONTACT(b); - - // Extract file_as for each contact and compare... - gchar *a_file_as = e_contact_get (contact_a, E_CONTACT_FILE_AS); - gchar *b_file_as = e_contact_get (contact_b, E_CONTACT_FILE_AS); - gint res = lgl_str_utf8_casecmp(a_file_as, b_file_as); - - gl_debug(DEBUG_MERGE, "Sort comparing contacts '%s' and '%s' = %d", a_file_as, b_file_as, res); - - // free file_as strings created earlier.... - g_free (a_file_as); - g_free (b_file_as); - - return res; -} - -/*--------------------------------------------------------------------------*/ -/* Open merge source. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_evolution_open (glMerge *merge) -{ - glMergeEvolution *merge_evolution; - EBookQuery *query; - gboolean status; - GList *fields, *iter; - EContactField *field_id; - GError *error = NULL; - - gl_debug (DEBUG_MERGE, "BEGIN"); - - merge_evolution = GL_MERGE_EVOLUTION (merge); - - query = e_book_query_from_string(merge_evolution->priv->query); - if (!query) { - g_warning (_("Couldn't construct query")); - return; - } - - merge_evolution->priv->book = e_book_new_system_addressbook(&error); - if (!merge_evolution->priv->book) { - g_warning (_("Couldn't open addressbook.")); - if (error) - { - g_warning ("e_book_new_system_addressbook: %s", error->message); - g_error_free (error); - } - e_book_query_unref(query); - return; - } - - if (!e_book_open(merge_evolution->priv->book, FALSE, &error)) { - g_warning (_("Couldn't open addressbook.")); - if (error) - { - g_warning ("e_book_open: %s", error->message); - g_error_free (error); - } - e_book_query_unref(query); - g_object_unref(merge_evolution->priv->book); - merge_evolution->priv->book = NULL; - return; - } - - /* fetch the list of fields supported by this address book */ - status = e_book_get_supported_fields(merge_evolution->priv->book, &fields, &error); - if (status == FALSE) { - g_warning (_("Couldn't list available fields.")); - if (error) - { - g_warning ("e_book_get_supported_fields: %s", error->message); - g_error_free (error); - } - e_book_query_unref(query); - g_object_unref(merge_evolution->priv->book); - merge_evolution->priv->book = NULL; - return; - } - - /* generate a list of field_ids, and put that into private->fields */ - for (iter = fields; iter != NULL; iter = g_list_next(iter)) { - field_id = g_new(EContactField, 1); - *field_id = e_contact_field_id(iter->data); - - /* above this value, the data aren't strings anymore */ - if (*field_id >= E_CONTACT_LAST_SIMPLE_STRING) { - g_free (field_id); - continue; - } - - merge_evolution->priv->fields = - g_list_prepend(merge_evolution->priv->fields, field_id); - } - free_field_list(fields); /* don't need the list of names anymore */ - - gl_debug(DEBUG_MERGE, "Field list length: %d", g_list_length(merge_evolution->priv->fields)); - - /* finally retrieve the contacts */ - status = e_book_get_contacts (merge_evolution->priv->book, - query, - &merge_evolution->priv->contacts, - &error); - if (status == FALSE) { - g_warning (_("Couldn't get contacts.")); - if (error) - { - g_warning ("e_book_get_contacts: %s", error->message); - g_error_free (error); - } - e_book_query_unref(query); - free_field_list(merge_evolution->priv->fields); - g_object_unref(merge_evolution->priv->book); - merge_evolution->priv->book = NULL; - - return; - } - - e_book_query_unref(query); - - /* Sort contacts using file-as element.... - * by Peter Cherriman (PJC) - */ - gl_debug (DEBUG_MERGE, "Starting sort"); - merge_evolution->priv->contacts = g_list_sort(merge_evolution->priv->contacts, (GCompareFunc)sort_contact_by_file_as); - gl_debug (DEBUG_MERGE, "Ended sort"); - - gl_debug (DEBUG_MERGE, "END"); - - return; -} - -/*--------------------------------------------------------------------------*/ -/* Close merge source. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_evolution_close (glMerge *merge) -{ - glMergeEvolution *merge_evolution; - GList *iter; - - merge_evolution = GL_MERGE_EVOLUTION (merge); - - /* unref all of the objects created in _open */ - g_object_unref(merge_evolution->priv->book); - merge_evolution->priv->book = NULL; - - for (iter = merge_evolution->priv->contacts; - iter != NULL; - iter = g_list_next(iter)) - { - EContact *contact = E_CONTACT (iter->data); - - g_object_unref(contact); - } - g_list_free(merge_evolution->priv->contacts); - merge_evolution->priv->contacts = NULL; -} - -/*--------------------------------------------------------------------------*/ -/* Get next record from merge source, NULL if no records left (i.e EOF) */ -/*--------------------------------------------------------------------------*/ -static glMergeRecord * -gl_merge_evolution_get_record (glMerge *merge) -{ - glMergeEvolution *merge_evolution; - glMergeRecord *record; - glMergeField *field; - EContactField field_id; - - GList *head, *iter; - EContact *contact; - - merge_evolution = GL_MERGE_EVOLUTION (merge); - - head = merge_evolution->priv->contacts; - if (head == NULL) { - return NULL; /* past the last record */ - } - contact = E_CONTACT(head->data); - - record = g_new0 (glMergeRecord, 1); - record->select_flag = TRUE; - - /* Take the interesting fields one by one from the contact, and put them - * into the glMergeRecord structure. When done, free up the resources for - * that contact */ - - /* iterate through the supported fields, and add them to the list */ - for (iter = merge_evolution->priv->fields; - iter != NULL; - iter = g_list_next(iter)) - { - gchar *value; - field_id = *(EContactField *)iter->data; - value = g_strdup (e_contact_get_const (contact, field_id)); - - if (value) { - field = g_new0 (glMergeField, 1); - field->key = g_strdup (e_contact_pretty_name (field_id)); - field->value = value; - record->field_list = g_list_prepend (record->field_list, field); - } - } - - record->field_list = g_list_reverse (record->field_list); - - /* do a destructive read */ - g_object_unref (contact); - merge_evolution->priv->contacts = - g_list_remove_link (merge_evolution->priv->contacts, head); - g_list_free_1 (head); - - return record; -} - -/*---------------------------------------------------------------------------*/ -/* Copy merge_evolution specific fields. */ -/*---------------------------------------------------------------------------*/ -static void -gl_merge_evolution_copy (glMerge *dst_merge, - glMerge *src_merge) -{ - GList *src_iter, *dst_iter; - - gl_debug (DEBUG_MERGE, "BEGIN"); - - glMergeEvolution *dst_merge_evolution; - glMergeEvolution *src_merge_evolution; - - dst_merge_evolution = GL_MERGE_EVOLUTION (dst_merge); - src_merge_evolution = GL_MERGE_EVOLUTION (src_merge); - - dst_merge_evolution->priv->query = g_strdup(src_merge_evolution->priv->query); - - dst_merge_evolution->priv->fields = g_list_copy(src_merge_evolution->priv->fields); - for (src_iter = src_merge_evolution->priv->fields, - dst_iter = dst_merge_evolution->priv->fields; - src_iter != NULL && dst_iter != NULL; - src_iter = g_list_next(src_iter), dst_iter = g_list_next(dst_iter)) - { - dst_iter->data = g_new(EContactField, 1); - if (src_iter->data) { /* this better not be null, but... */ - memcpy(dst_iter->data, src_iter->data, sizeof(EContactField)); - } - } - - /* I don't know that there's a good way to do a deep copy of the various - * libebook structures/objects, so I'm just going to leave them out. They - * are all regenerated on gl_merge_evolution_open, anyway */ - - gl_debug (DEBUG_MERGE, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* Free the list of supported fields */ -/*---------------------------------------------------------------------------*/ -static void -free_field_list (GList *fields) -{ - GList *iter; - - for (iter = fields; iter != NULL; iter = g_list_next(iter)) - { - if (iter->data) { - g_free(iter->data); - } - } - g_list_free(fields); - fields = NULL; -} - - -#endif /* HAVE_LIBEBOOK */ diff --git a/glabels2/src/merge-evolution.h b/glabels2/src/merge-evolution.h deleted file mode 100644 index 26468abc..00000000 --- a/glabels2/src/merge-evolution.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge_evolution.h: evolution merge backend module header file - * - * Copyright (C) 2002 Jim Evins . - * and - * Copyright (C) 2005 Austin Henry - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __MERGE_EVOLUTION_H__ -#define __MERGE_EVOLUTION_H__ - -#include "merge.h" - -G_BEGIN_DECLS - -/* The following object arguments are available: - * - * name type description - * --------------------------------------------------------------------------- - * query gchar* The query used to select records - * - */ - -#define GL_TYPE_MERGE_EVOLUTION (gl_merge_evolution_get_type ()) -#define GL_MERGE_EVOLUTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_MERGE_EVOLUTION, glMergeEvolution)) -#define GL_MERGE_EVOLUTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_MERGE_EVOLUTION, glMergeEvolutionClass)) -#define GL_IS_MERGE_EVOLUTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_MERGE_EVOLUTION)) -#define GL_IS_MERGE_EVOLUTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_MERGE_EVOLUTION)) -#define GL_MERGE_EVOLUTION_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_MERGE_EVOLUTION, glMergeEvolutionClass)) - - -typedef struct _glMergeEvolution glMergeEvolution; -typedef struct _glMergeEvolutionClass glMergeEvolutionClass; - -typedef struct _glMergeEvolutionPrivate glMergeEvolutionPrivate; - - -struct _glMergeEvolution { - glMerge object; - - glMergeEvolutionPrivate *priv; -}; - -struct _glMergeEvolutionClass { - glMergeClass parent_class; -}; - - -GType gl_merge_evolution_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -#endif /* __MERGE_EVOLUTION_H__ */ diff --git a/glabels2/src/merge-init.c b/glabels2/src/merge-init.c deleted file mode 100644 index b62551be..00000000 --- a/glabels2/src/merge-init.c +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge.c: document merge initialization - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include - -#include "merge-init.h" -#include "merge-text.h" -#ifdef HAVE_LIBEBOOK -#include "merge-evolution.h" -#include "merge-vcard.h" -#endif /* HAVE_LIBEBOOK */ - -#include "debug.h" - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - - -/*****************************************************************************/ -/* Initailize document merge module, by registering all available backends. */ -/*****************************************************************************/ -void -gl_merge_init (void) -{ - - gl_merge_register_backend (GL_TYPE_MERGE_TEXT, - "Text/Comma", - _("Text file with comma delimeters (CSV)"), - GL_MERGE_SRC_IS_FILE, - "delim", ',', - NULL); - - gl_merge_register_backend (GL_TYPE_MERGE_TEXT, - "Text/Colon", - _("Text file with colon delimeters"), - GL_MERGE_SRC_IS_FILE, - "delim", ':', - NULL); - - gl_merge_register_backend (GL_TYPE_MERGE_TEXT, - "Text/Tab", - _("Text file with tab delimeters"), - GL_MERGE_SRC_IS_FILE, - "delim", '\t', - NULL); - -#ifdef HAVE_LIBEBOOK - - gl_merge_register_backend (GL_TYPE_MERGE_EVOLUTION, - "ebook/eds", - _("Data from default Evolution Addressbook"), - GL_MERGE_SRC_IS_FIXED, - NULL); - - gl_merge_register_backend (GL_TYPE_MERGE_VCARD, - "ebook/vcard", - _("Data from a file containing VCards"), - GL_MERGE_SRC_IS_FILE, - NULL); - -#endif /* HAVE_LIBEBOOK */ - -} diff --git a/glabels2/src/merge-init.h b/glabels2/src/merge-init.h deleted file mode 100644 index 7bd57eef..00000000 --- a/glabels2/src/merge-init.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge-init.h: document merge initialization header file - * - * Copyright (C) 2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __MERGE_INIT_H__ -#define __MERGE_INIT_H__ - -#include "merge.h" - -G_BEGIN_DECLS - -void gl_merge_init (void); - -G_END_DECLS - -#endif diff --git a/glabels2/src/merge-properties-dialog.c b/glabels2/src/merge-properties-dialog.c deleted file mode 100644 index d5f3508d..00000000 --- a/glabels2/src/merge-properties-dialog.c +++ /dev/null @@ -1,659 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge-properties-dialog.c: document merge properties dialog module - * - * Copyright (C) 2001 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "merge-properties-dialog.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "label.h" -#include "merge.h" -#include "util.h" -#include "hig.h" - -#include "debug.h" - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -struct _glMergePropertiesDialogPrivate { - - glLabel *label; - glMerge *merge; - - GtkWidget *type_combo; - GtkWidget *location_vbox; - GtkWidget *src_entry; - - GtkTreeStore *store; - GtkWidget *treeview; - - GtkWidget *select_all_button; - GtkWidget *unselect_all_button; - - gchar *saved_src; - -}; - -enum { - /* Real columns */ - SELECT_COLUMN, - RECORD_FIELD_COLUMN, - VALUE_COLUMN, - - /* Invisible columns */ - IS_RECORD_COLUMN, - DATA_COLUMN, /* points to glMergeRecord */ - - N_COLUMNS -}; - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_merge_properties_dialog_finalize (GObject *object); -static void gl_merge_properties_dialog_construct (glMergePropertiesDialog *dialog, - glLabel *label, - GtkWindow *window); - -static void type_changed_cb (GtkWidget *widget, - glMergePropertiesDialog *dialog); - -static void src_changed_cb (GtkWidget *widget, - glMergePropertiesDialog *dialog); - -static void response_cb (glMergePropertiesDialog *dialog, - gint response, - gpointer user_data); - -static void load_tree (GtkTreeStore *store, - glMerge *merge); - -static void record_select_toggled_cb (GtkCellRendererToggle *cell, - gchar *path_str, - GtkTreeStore *store); - -static void select_all_button_clicked_cb (GtkWidget *widget, - glMergePropertiesDialog *dialog); - -static void unselect_all_button_clicked_cb (GtkWidget *widget, - glMergePropertiesDialog *dialog); - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glMergePropertiesDialog, gl_merge_properties_dialog, GTK_TYPE_DIALOG); - -static void -gl_merge_properties_dialog_class_init (glMergePropertiesDialogClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_MERGE, ""); - - gl_merge_properties_dialog_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_merge_properties_dialog_finalize; -} - -static void -gl_merge_properties_dialog_init (glMergePropertiesDialog *dialog) -{ - gl_debug (DEBUG_MERGE, "START"); - - dialog->priv = g_new0 (glMergePropertiesDialogPrivate, 1); - - gtk_container_set_border_width (GTK_CONTAINER(dialog), GL_HIG_PAD2); - - gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE); - gtk_dialog_add_buttons (GTK_DIALOG (dialog), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); - - gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); - - g_signal_connect(G_OBJECT (dialog), "response", - G_CALLBACK (response_cb), NULL); - - - gl_debug (DEBUG_MERGE, "END"); -} - -static void -gl_merge_properties_dialog_finalize (GObject *object) -{ - glMergePropertiesDialog* dialog = GL_MERGE_PROPERTIES_DIALOG (object); - - gl_debug (DEBUG_MERGE, "START"); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_MERGE_PROPERTIES_DIALOG (dialog)); - g_return_if_fail (dialog->priv != NULL); - - if (dialog->priv->merge != NULL) { - g_object_unref (G_OBJECT (dialog->priv->merge)); - } - g_free (dialog->priv); - - G_OBJECT_CLASS (gl_merge_properties_dialog_parent_class)->finalize (object); - gl_debug (DEBUG_MERGE, "END"); -} - -/*****************************************************************************/ -/* NEW merge properties dialog. */ -/*****************************************************************************/ -GtkWidget* -gl_merge_properties_dialog_new (glLabel *label, - GtkWindow *window) -{ - GtkWidget *dialog; - - gl_debug (DEBUG_MERGE, "START"); - - dialog = GTK_WIDGET (g_object_new (GL_TYPE_MERGE_PROPERTIES_DIALOG, NULL)); - - gl_merge_properties_dialog_construct (GL_MERGE_PROPERTIES_DIALOG (dialog), - label, window); - - gl_debug (DEBUG_MERGE, "END"); - - return dialog; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Create merge widgets. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_properties_dialog_construct (glMergePropertiesDialog *dialog, - glLabel *label, - GtkWindow *window) -{ - GladeXML *gui; - gchar *description; - glMergeSrcType src_type; - gchar *src; - gchar *name, *title; - GList *texts; - GtkWidget *vbox; - GtkCellRenderer *renderer; - GtkTreeViewColumn *column; - GtkTreeSelection *selection; - - gl_debug (DEBUG_MERGE, "START"); - - g_return_if_fail (GL_IS_MERGE_PROPERTIES_DIALOG (dialog)); - g_return_if_fail (dialog->priv != NULL); - - if (window) { - gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(window)); - gtk_window_set_destroy_with_parent (GTK_WINDOW(dialog), TRUE); - } - - gui = glade_xml_new (GLABELS_GLADE_DIR "merge-properties-dialog.glade", - "merge_properties_vbox", NULL); - - if (!gui) { - g_critical ("Could not open merge-properties-dialog.glade. gLabels may not be installed correctly!"); - return; - } - - vbox = glade_xml_get_widget (gui, "merge_properties_vbox"); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox); - - dialog->priv->type_combo = glade_xml_get_widget (gui, "type_combo"); - dialog->priv->location_vbox = glade_xml_get_widget (gui, "location_vbox"); - dialog->priv->treeview = glade_xml_get_widget (gui, "treeview"); - - dialog->priv->select_all_button = glade_xml_get_widget (gui, "select_all_button"); - dialog->priv->unselect_all_button = glade_xml_get_widget (gui, "unselect_all_button"); - - g_object_unref (gui); - - gl_util_combo_box_add_text_model (GTK_COMBO_BOX (dialog->priv->type_combo)); - - dialog->priv->label = label; - - dialog->priv->merge = gl_label_get_merge (dialog->priv->label); - description = gl_merge_get_description (dialog->priv->merge); - src_type = gl_merge_get_src_type (dialog->priv->merge); - src = gl_merge_get_src (dialog->priv->merge); - - /* --- Window title --- */ - name = gl_label_get_short_name (label); - title = g_strdup_printf ("%s %s", name, _("Merge Properties")); - gtk_window_set_title (GTK_WINDOW (dialog), title); - g_free (name); - g_free (title); - - texts = gl_merge_get_descriptions (); - gl_debug (DEBUG_MERGE, "DESCRIPTIONS:"); - { - GList *p; - - for (p=texts; p!=NULL; p=p->next) { - gl_debug (DEBUG_MERGE, " \"%s\"", p->data); - } - } - gl_util_combo_box_set_strings (GTK_COMBO_BOX (dialog->priv->type_combo), - texts); - gl_merge_free_descriptions (&texts); - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (dialog->priv->type_combo), - description); - g_signal_connect (G_OBJECT (dialog->priv->type_combo), "changed", - G_CALLBACK (type_changed_cb), dialog); - - gl_debug (DEBUG_MERGE, "Src_type = %d", src_type); - switch (src_type) { - case GL_MERGE_SRC_IS_FILE: - dialog->priv->src_entry = - gtk_file_chooser_button_new (_("Select merge-database source"), - GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog->priv->src_entry), - src); - g_signal_connect (G_OBJECT (dialog->priv->src_entry), - "selection-changed", - G_CALLBACK (src_changed_cb), dialog); - break; - default: - dialog->priv->src_entry = gtk_label_new (_("N/A")); - gtk_misc_set_alignment (GTK_MISC (dialog->priv->src_entry), 0.0, 0.5); - break; - } - gtk_box_pack_start (GTK_BOX (dialog->priv->location_vbox), - dialog->priv->src_entry, FALSE, FALSE, 0); - gtk_widget_show_all (GTK_WIDGET (dialog->priv->location_vbox)); - - dialog->priv->store = gtk_tree_store_new (N_COLUMNS, - G_TYPE_BOOLEAN, /* Record selector */ - G_TYPE_STRING, /* Record/Field name */ - G_TYPE_STRING, /* Field value */ - G_TYPE_BOOLEAN, /* Is Record? */ - G_TYPE_POINTER /* Pointer to record */); - load_tree (dialog->priv->store, dialog->priv->merge); - - gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->priv->treeview), - GTK_TREE_MODEL (dialog->priv->store)); - - gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (dialog->priv->treeview), - TRUE); - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->priv->treeview)); - gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE); - renderer = gtk_cell_renderer_toggle_new (); - g_signal_connect (G_OBJECT (renderer), "toggled", - G_CALLBACK (record_select_toggled_cb), dialog->priv->store); - column = gtk_tree_view_column_new_with_attributes (_("Select"), renderer, - "active", SELECT_COLUMN, - "visible", IS_RECORD_COLUMN, - NULL); - gtk_tree_view_column_set_clickable (column, TRUE); - gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->treeview), column); - renderer = gtk_cell_renderer_text_new (); - gtk_object_set (GTK_OBJECT (renderer), "yalign", 0.0, NULL); - column = gtk_tree_view_column_new_with_attributes (_("Record/Field"), renderer, - "text", RECORD_FIELD_COLUMN, - NULL); - gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); - gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->treeview), column); - gtk_tree_view_set_expander_column (GTK_TREE_VIEW (dialog->priv->treeview), column); - renderer = gtk_cell_renderer_text_new (); - gtk_object_set (GTK_OBJECT (renderer), "yalign", 0.0, NULL); - column = gtk_tree_view_column_new_with_attributes (_("Data"), renderer, - "text", VALUE_COLUMN, - NULL); - gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); - gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->treeview), column); - - g_signal_connect (G_OBJECT (dialog->priv->select_all_button), - "clicked", - G_CALLBACK (select_all_button_clicked_cb), dialog); - - g_signal_connect (G_OBJECT (dialog->priv->unselect_all_button), - "clicked", - G_CALLBACK (unselect_all_button_clicked_cb), dialog); - - - g_free (src); - g_free (description); - - gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); - - gl_debug (DEBUG_MERGE, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. type "changed" callback. */ -/*--------------------------------------------------------------------------*/ -static void -type_changed_cb (GtkWidget *widget, - glMergePropertiesDialog *dialog) -{ - gchar *description; - gchar *name; - gchar *src; - glMergeSrcType src_type; - - gl_debug (DEBUG_MERGE, "START"); - - description = gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->type_combo)); - name = gl_merge_description_to_name (description); - - src = gl_merge_get_src (dialog->priv->merge); /* keep current src if possible */ - if ( src != NULL ) { - gl_debug (DEBUG_MERGE, "Saving src = \"%s\"", src); - g_free (dialog->priv->saved_src); - dialog->priv->saved_src = src; - } - - if (dialog->priv->merge != NULL) { - g_object_unref (G_OBJECT(dialog->priv->merge)); - } - dialog->priv->merge = gl_merge_new (name); - - gtk_widget_destroy (dialog->priv->src_entry); - src_type = gl_merge_get_src_type (dialog->priv->merge); - switch (src_type) { - case GL_MERGE_SRC_IS_FILE: - dialog->priv->src_entry = - gtk_file_chooser_button_new (_("Select merge-database source"), - GTK_FILE_CHOOSER_ACTION_OPEN); - if (dialog->priv->saved_src != NULL) { - gl_debug (DEBUG_MERGE, "Setting src = \"%s\"", dialog->priv->saved_src); - gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog->priv->src_entry), - dialog->priv->saved_src); - gl_merge_set_src (dialog->priv->merge, dialog->priv->saved_src); - } - g_signal_connect (G_OBJECT (dialog->priv->src_entry), - "selection-changed", - G_CALLBACK (src_changed_cb), dialog); - break; - case GL_MERGE_SRC_IS_FIXED: - dialog->priv->src_entry = gtk_label_new (_("Fixed")); - gtk_misc_set_alignment (GTK_MISC (dialog->priv->src_entry), 0.0, 0.5); - - gl_debug (DEBUG_MERGE, "Setting src = \"%s\"", dialog->priv->saved_src); - gl_merge_set_src (dialog->priv->merge, "Fixed"); - break; - default: - dialog->priv->src_entry = gtk_label_new (_("N/A")); - gtk_misc_set_alignment (GTK_MISC (dialog->priv->src_entry), 0.0, 0.5); - break; - } - gtk_box_pack_start( GTK_BOX (dialog->priv->location_vbox), - dialog->priv->src_entry, FALSE, FALSE, 0); - gtk_widget_show_all (dialog->priv->location_vbox); - - load_tree (dialog->priv->store, dialog->priv->merge); - - g_free (description); - g_free (name); - - gl_debug (DEBUG_MERGE, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. source "changed" callback. */ -/*--------------------------------------------------------------------------*/ -static void -src_changed_cb (GtkWidget *widget, - glMergePropertiesDialog *dialog) -{ - gchar *src, *orig_src; - - gl_debug (DEBUG_MERGE, "START"); - - orig_src = gl_merge_get_src (dialog->priv->merge); - src = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog->priv->src_entry)); - - gl_debug (DEBUG_MERGE, "orig=\"%s\", new=\"%s\"\n", orig_src, src); - - if (((orig_src == NULL) && (src != NULL)) || - ((orig_src != NULL) && (src == NULL)) || - ((orig_src != NULL) && (src != NULL) && strcmp (src, orig_src))) - { - gl_merge_set_src (dialog->priv->merge, src); - load_tree (dialog->priv->store, dialog->priv->merge); - } - - g_free (orig_src); - g_free (src); - - - gl_debug (DEBUG_MERGE, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. response callback. */ -/*--------------------------------------------------------------------------*/ -static void -response_cb (glMergePropertiesDialog *dialog, - gint response, - gpointer user_data) -{ - gl_debug (DEBUG_MERGE, "START"); - - switch (response) { - - case GTK_RESPONSE_OK: - gl_label_set_merge (dialog->priv->label, dialog->priv->merge); - gtk_widget_hide (GTK_WIDGET (dialog)); - break; - case GTK_RESPONSE_CANCEL: - /* Let the dialog get rebuilt next time to recover state. */ - gtk_widget_destroy (GTK_WIDGET (dialog)); - break; - case GTK_RESPONSE_DELETE_EVENT: - break; - default: - g_print ("response = %d", response); - g_assert_not_reached (); - } - - gl_debug (DEBUG_MERGE, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Load tree store from merge data. */ -/*--------------------------------------------------------------------------*/ -static void -load_tree (GtkTreeStore *store, - glMerge *merge) -{ - const GList *record_list; - GList *p_rec, *p_field; - glMergeRecord *record; - glMergeField *field; - GtkTreeIter iter1, iter2; - gchar *primary_key; - gchar *primary_value; - - gl_debug (DEBUG_MERGE, "START"); - - gtk_tree_store_clear (store); - - primary_key = gl_merge_get_primary_key (merge); - record_list = gl_merge_get_record_list (merge); - - for ( p_rec=(GList *)record_list; p_rec!=NULL; p_rec=p_rec->next ) { - record = (glMergeRecord *)p_rec->data; - - primary_value = gl_merge_eval_key (record, primary_key); - - gtk_tree_store_append (store, &iter1, NULL); - gtk_tree_store_set (store, &iter1, - SELECT_COLUMN, record->select_flag, - RECORD_FIELD_COLUMN, primary_value, - IS_RECORD_COLUMN, TRUE, - DATA_COLUMN, record, - -1); - - g_free (primary_value); - - for ( p_field=record->field_list; p_field!=NULL; p_field=p_field->next ) { - field = (glMergeField *)p_field->data; - - gtk_tree_store_append (store, &iter2, &iter1); - gtk_tree_store_set (store, &iter2, - RECORD_FIELD_COLUMN, field->key, - VALUE_COLUMN, field->value, - IS_RECORD_COLUMN, FALSE, - -1); - } - } - - g_free (primary_key); - - gl_debug (DEBUG_MERGE, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Record select toggled. */ -/*--------------------------------------------------------------------------*/ -static void -record_select_toggled_cb (GtkCellRendererToggle *cell, - gchar *path_str, - GtkTreeStore *store) -{ - GtkTreePath *path; - GtkTreeIter iter; - glMergeRecord *record; - - gl_debug (DEBUG_MERGE, "START"); - - /* get toggled iter */ - path = gtk_tree_path_new_from_string (path_str); - gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path); - - /* get current data */ - gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, - DATA_COLUMN, &record, - -1); - - /* toggle the select flag within the record */ - record->select_flag ^= 1; - - /* set new value in store */ - gtk_tree_store_set (store, &iter, - SELECT_COLUMN, record->select_flag, - -1); - - /* clean up */ - gtk_tree_path_free (path); - - gl_debug (DEBUG_MERGE, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. "Select All" button callback. */ -/*--------------------------------------------------------------------------*/ -static void -select_all_button_clicked_cb (GtkWidget *widget, - glMergePropertiesDialog *dialog) -{ - GtkTreeModel *store = GTK_TREE_MODEL (dialog->priv->store); - GtkTreeIter iter; - glMergeRecord *record; - gboolean good; - - gl_debug (DEBUG_MERGE, "START"); - - for ( good = gtk_tree_model_get_iter_first (store, &iter); - good; - good = gtk_tree_model_iter_next (store, &iter) ) - { - - /* get current data */ - gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, - DATA_COLUMN, &record, - -1); - - - /* Set select flag within the record */ - record->select_flag = TRUE; - - /* set new value in store */ - gtk_tree_store_set (GTK_TREE_STORE (store), &iter, - SELECT_COLUMN, record->select_flag, - -1); - - } - - gl_debug (DEBUG_MERGE, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. "Unselect All" button callback. */ -/*--------------------------------------------------------------------------*/ -static void -unselect_all_button_clicked_cb (GtkWidget *widget, - glMergePropertiesDialog *dialog) -{ - GtkTreeModel *store = GTK_TREE_MODEL (dialog->priv->store); - GtkTreeIter iter; - glMergeRecord *record; - gboolean good; - - gl_debug (DEBUG_MERGE, "START"); - - for ( good = gtk_tree_model_get_iter_first (store, &iter); - good; - good = gtk_tree_model_iter_next (store, &iter) ) - { - - /* get current data */ - gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, - DATA_COLUMN, &record, - -1); - - - /* Set select flag within the record */ - record->select_flag = FALSE; - - /* set new value in store */ - gtk_tree_store_set (GTK_TREE_STORE (store), &iter, - SELECT_COLUMN, record->select_flag, - -1); - - } - - gl_debug (DEBUG_MERGE, "END"); -} diff --git a/glabels2/src/merge-properties-dialog.h b/glabels2/src/merge-properties-dialog.h deleted file mode 100644 index f98ea7bf..00000000 --- a/glabels2/src/merge-properties-dialog.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge-properties-dialog.h: document merge properties dialog module header file - * - * Copyright (C) 2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __MERGE_PROPERTIES_DIALOG_H__ -#define __MERGE_PROPERTIES_DIALOG_H__ - -#include -#include -#include "label.h" - -G_BEGIN_DECLS - -#define GL_TYPE_MERGE_PROPERTIES_DIALOG (gl_merge_properties_dialog_get_type ()) -#define GL_MERGE_PROPERTIES_DIALOG(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_MERGE_PROPERTIES_DIALOG, glMergePropertiesDialog)) -#define GL_MERGE_PROPERTIES_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_MERGE_PROPERTIES_DIALOG, glMergePropertiesDialogClass)) -#define GL_IS_MERGE_PROPERTIES_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_MERGE_PROPERTIES_DIALOG)) -#define GL_IS_MERGE_PROPERTIES_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_MERGE_PROPERTIES_DIALOG)) -#define GL_MERGE_PROPERTIES_DIALOG_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_MERGE_PROPERTIES_DIALOG, glMergePropertiesDialogClass)) - - -typedef struct _glMergePropertiesDialog glMergePropertiesDialog; -typedef struct _glMergePropertiesDialogClass glMergePropertiesDialogClass; - -typedef struct _glMergePropertiesDialogPrivate glMergePropertiesDialogPrivate; - -struct _glMergePropertiesDialog -{ - GtkDialog parent_instance; - - glMergePropertiesDialogPrivate *priv; - -}; - -struct _glMergePropertiesDialogClass -{ - GtkDialogClass parent_class; -}; - -GType gl_merge_properties_dialog_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_merge_properties_dialog_new (glLabel *label, - GtkWindow *window); - -G_END_DECLS - -#endif diff --git a/glabels2/src/merge-text.c b/glabels2/src/merge-text.c deleted file mode 100644 index 674e81d1..00000000 --- a/glabels2/src/merge-text.c +++ /dev/null @@ -1,694 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge_text.c: text-file merge backend module - * - * Copyright (C) 2001 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "merge-text.h" - -#include - -#include "debug.h" - -#define LINE_BUF_LEN 1024 - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -struct _glMergeTextPrivate { - gchar delim; - FILE *fp; -}; - -enum { - LAST_SIGNAL -}; - -enum { - ARG_0, - ARG_DELIM, -}; - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_merge_text_finalize (GObject *object); - -static void gl_merge_text_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec); - -static void gl_merge_text_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec); - -static GList *gl_merge_text_get_key_list (glMerge *merge); -static gchar *gl_merge_text_get_primary_key (glMerge *merge); -static void gl_merge_text_open (glMerge *merge); -static void gl_merge_text_close (glMerge *merge); -static glMergeRecord *gl_merge_text_get_record (glMerge *merge); -static void gl_merge_text_copy (glMerge *dst_merge, - glMerge *src_merge); - -static GList *parse_line (FILE *fp, - gchar delim); -static gchar *parse_field (gchar *raw_field); -static void free_fields (GList **fields); - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glMergeText, gl_merge_text, GL_TYPE_MERGE); - -static void -gl_merge_text_class_init (glMergeTextClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glMergeClass *merge_class = GL_MERGE_CLASS (class); - - gl_debug (DEBUG_MERGE, "START"); - - gl_merge_text_parent_class = g_type_class_peek_parent (class); - - object_class->set_property = gl_merge_text_set_property; - object_class->get_property = gl_merge_text_get_property; - - g_object_class_install_property - (object_class, - ARG_DELIM, - g_param_spec_char ("delim", NULL, NULL, - 0, 0x7F, ',', - (G_PARAM_READABLE | G_PARAM_WRITABLE))); - - object_class->finalize = gl_merge_text_finalize; - - merge_class->get_key_list = gl_merge_text_get_key_list; - merge_class->get_primary_key = gl_merge_text_get_primary_key; - merge_class->open = gl_merge_text_open; - merge_class->close = gl_merge_text_close; - merge_class->get_record = gl_merge_text_get_record; - merge_class->copy = gl_merge_text_copy; - - gl_debug (DEBUG_MERGE, "END"); -} - -static void -gl_merge_text_init (glMergeText *merge_text) -{ - gl_debug (DEBUG_MERGE, "START"); - - merge_text->priv = g_new0 (glMergeTextPrivate, 1); - - gl_debug (DEBUG_MERGE, "END"); -} - -static void -gl_merge_text_finalize (GObject *object) -{ - glMergeText *merge_text = GL_MERGE_TEXT (object); - - gl_debug (DEBUG_MERGE, "START"); - - g_return_if_fail (object && GL_IS_MERGE_TEXT (object)); - - g_free (merge_text->priv); - - G_OBJECT_CLASS (gl_merge_text_parent_class)->finalize (object); - - gl_debug (DEBUG_MERGE, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* Set argument. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_text_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec) -{ - glMergeText *merge_text; - - merge_text = GL_MERGE_TEXT (object); - - switch (param_id) { - - case ARG_DELIM: - merge_text->priv->delim = g_value_get_char (value); - gl_debug (DEBUG_MERGE, "ARG \"delim\" = \"%c\"", - merge_text->priv->delim); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - - } - -} - -/*--------------------------------------------------------------------------*/ -/* Get argument. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_text_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec) -{ - glMergeText *merge_text; - - merge_text = GL_MERGE_TEXT (object); - - switch (param_id) { - - case ARG_DELIM: - g_value_set_char (value, merge_text->priv->delim); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - - } - -} - -/*--------------------------------------------------------------------------*/ -/* Get key list. */ -/*--------------------------------------------------------------------------*/ -static GList * -gl_merge_text_get_key_list (glMerge *merge) -{ - glMergeText *merge_text; - GList *record_list, *p_rec; - glMergeRecord *record; - GList *p_field; - gint i_field, n_fields, n_fields_max = 0; - GList *key_list; - - /* Field keys are simply column numbers. */ - - gl_debug (DEBUG_MERGE, "BEGIN"); - - merge_text = GL_MERGE_TEXT (merge); - - record_list = (GList *)gl_merge_get_record_list (merge); - - for ( p_rec=record_list; p_rec!=NULL; p_rec=p_rec->next ) { - record = (glMergeRecord *)p_rec->data; - - n_fields = 0; - for ( p_field=record->field_list; p_field!=NULL; p_field=p_field->next ) { - n_fields++; - } - if ( n_fields > n_fields_max ) n_fields_max = n_fields; - } - - key_list = NULL; - for (i_field=1; i_field <= n_fields_max; i_field++) { - key_list = g_list_append (key_list, g_strdup_printf ("%d", i_field)); - } - - - gl_debug (DEBUG_MERGE, "END"); - - return key_list; -} - -/*--------------------------------------------------------------------------*/ -/* Get "primary" key. */ -/*--------------------------------------------------------------------------*/ -static gchar * -gl_merge_text_get_primary_key (glMerge *merge) -{ - /* For now, let's always assume the first column is the primary key. */ - return g_strdup ("1"); -} - -/*--------------------------------------------------------------------------*/ -/* Open merge source. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_text_open (glMerge *merge) -{ - glMergeText *merge_text; - gchar *src; - - merge_text = GL_MERGE_TEXT (merge); - - src = gl_merge_get_src (merge); - - if (src != NULL) { - merge_text->priv->fp = fopen (src, "r"); - } - - g_free (src); -} - -/*--------------------------------------------------------------------------*/ -/* Close merge source. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_text_close (glMerge *merge) -{ - glMergeText *merge_text; - - merge_text = GL_MERGE_TEXT (merge); - - if (merge_text->priv->fp != NULL) { - - fclose (merge_text->priv->fp); - merge_text->priv->fp = NULL; - - } -} - -/*--------------------------------------------------------------------------*/ -/* Get next record from merge source, NULL if no records left (i.e EOF) */ -/*--------------------------------------------------------------------------*/ -static glMergeRecord * -gl_merge_text_get_record (glMerge *merge) -{ - glMergeText *merge_text; - gchar delim; - FILE *fp; - glMergeRecord *record; - GList *fields, *p; - gint i_field; - glMergeField *field; - - merge_text = GL_MERGE_TEXT (merge); - - delim = merge_text->priv->delim; - fp = merge_text->priv->fp; - - if (fp == NULL) { - return NULL; - } - - fields = parse_line (fp, delim); - if ( fields == NULL ) { - return NULL; - } - - record = g_new0 (glMergeRecord, 1); - record->select_flag = TRUE; - i_field = 1; - for (p=fields; p != NULL; p=p->next) { - - field = g_new0 (glMergeField, 1); - field->key = g_strdup_printf ("%d", i_field++); -#ifndef CSV_ALWAYS_UTF8 - field->value = g_locale_to_utf8 (p->data, -1, NULL, NULL, NULL); -#else - field->value = g_strdup (p->data); -#endif - - record->field_list = g_list_append (record->field_list, field); - } - free_fields (&fields); - - return record; -} - -/*---------------------------------------------------------------------------*/ -/* Copy merge_text specific fields. */ -/*---------------------------------------------------------------------------*/ -static void -gl_merge_text_copy (glMerge *dst_merge, - glMerge *src_merge) -{ - glMergeText *dst_merge_text; - glMergeText *src_merge_text; - - dst_merge_text = GL_MERGE_TEXT (dst_merge); - src_merge_text = GL_MERGE_TEXT (src_merge); - - dst_merge_text->priv->delim = src_merge_text->priv->delim; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Parse line. */ -/* */ -/* Attempt to be a robust parser of various CSV (and similar) formats. */ -/* */ -/* Split into fields, accounting for: */ -/* - delimeters may be embedded in quoted text (") */ -/* - delimeters may be "escaped" by a leading backslash (\) */ -/* - quotes may be embedded in quoted text as two adjacent quotes ("") */ -/* - quotes may be "escaped" either within or outside of quoted text. */ -/* - newlines may be embedded in quoted text, allowing a field to span */ -/* more than one line. */ -/* */ -/* This function does not do any parsing of the individual fields, other */ -/* than to correctly interpet delimeters. Actual parsing of the individual */ -/* fields is done in parse_field(). */ -/* */ -/* Returns a list of fields. A blank line is considered a line with one */ -/* empty field. Returns empty (NULL) when done. */ -/*---------------------------------------------------------------------------*/ -static GList * -parse_line (FILE *fp, - gchar delim ) -{ - GList *list = NULL; - GString *string; - gint c; - enum { BEGIN, NORMAL, QUOTED, QUOTED_QUOTE1, - NORMAL_ESCAPED, QUOTED_ESCAPED, DONE } state; - - state = BEGIN; - string = g_string_new( "" ); - while ( state != DONE ) { - c=getc (fp); - - switch (state) { - - case BEGIN: - if ( c == delim ) - { - /* first field is empty. */ - list = g_list_append (list, g_strdup ("")); - state = NORMAL; - break; - } - switch (c) { - case '"': - string = g_string_append_c (string, c); - state = QUOTED; - break; - case '\\': - string = g_string_append_c (string, c); - state = NORMAL_ESCAPED; - break; - case '\n': - /* treat as one empty field. */ - list = g_list_append (list, g_strdup ("")); - state = DONE; - break; - case EOF: - /* end of file, no more lines. */ - state = DONE; - break; - default: - string = g_string_append_c (string, c); - state = NORMAL; - break; - } - break; - - case NORMAL: - if ( c == delim ) - { - list = g_list_append (list, parse_field (string->str)); - string = g_string_assign( string, "" ); - state = NORMAL; - break; - } - switch (c) { - case '"': - string = g_string_append_c (string, c); - state = QUOTED; - break; - case '\\': - string = g_string_append_c (string, c); - state = NORMAL_ESCAPED; - break; - case '\n': - case EOF: - list = g_list_append (list, parse_field (string->str)); - state = DONE; - break; - default: - string = g_string_append_c (string, c); - state = NORMAL; - break; - } - break; - - case QUOTED: - switch (c) { - case '"': - string = g_string_append_c (string, c); - state = QUOTED_QUOTE1; - break; - case '\\': - string = g_string_append_c (string, c); - state = QUOTED_ESCAPED; - break; - case EOF: - /* File ended mid way through quoted item */ - list = g_list_append (list, parse_field (string->str)); - state = DONE; - break; - default: - string = g_string_append_c (string, c); - break; - } - break; - - case QUOTED_QUOTE1: - if ( c == delim ) - { - list = g_list_append (list, parse_field (string->str)); - string = g_string_assign( string, "" ); - state = NORMAL; - break; - } - switch (c) { - case '"': - /* insert quotes in string, stay quoted. */ - string = g_string_append_c (string, c); - state = QUOTED; - break; - case '\n': - case EOF: - /* line or file ended after quoted item */ - list = g_list_append (list, parse_field (string->str)); - state = DONE; - break; - default: - string = g_string_append_c (string, c); - state = NORMAL; - break; - } - break; - - case NORMAL_ESCAPED: - switch (c) { - case EOF: - /* File ended mid way through quoted item */ - list = g_list_append (list, parse_field (string->str)); - state = DONE; - break; - default: - string = g_string_append_c (string, c); - state = NORMAL; - break; - } - break; - - case QUOTED_ESCAPED: - switch (c) { - case EOF: - /* File ended mid way through quoted item */ - list = g_list_append (list, parse_field (string->str)); - state = DONE; - break; - default: - string = g_string_append_c (string, c); - state = QUOTED; - break; - } - break; - - default: - g_assert_not_reached(); - break; - } - - } - g_string_free( string, TRUE ); - - return list; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Parse field. */ -/* */ -/* - Strip leading and trailing white space, unless quoted. */ -/* - Strip CR, unless escaped. */ -/* - Expand '\n' and '\t' into newline and tab characters. */ -/* - Remove quotes, unless escaped (\" anywhere or "" within quotes) */ -/*---------------------------------------------------------------------------*/ -static gchar * -parse_field (gchar *raw_field) -{ - GString *string; - gchar *pass1_field, *c, *field; - enum { NORMAL, NORMAL_ESCAPED, QUOTED, QUOTED_ESCAPED, QUOTED_QUOTE1} state; - - - /* - * Pass 1: remove leading and trailing spaces. - */ - pass1_field = g_strdup (raw_field); - g_strstrip (pass1_field); - - /* - * Pass 2: resolve quoting and escaping. - */ - state = NORMAL; - string = g_string_new( "" ); - for ( c=pass1_field; *c != 0; c++ ) - { - switch (state) { - - case NORMAL: - switch (*c) { - case '\\': - state = NORMAL_ESCAPED; - break; - case '"': - state = QUOTED; - break; - case '\r': - /* Strip CR. */ - break; - default: - string = g_string_append_c (string, *c); - break; - } - break; - - case NORMAL_ESCAPED: - switch (*c) { - case 'n': - string = g_string_append_c (string, '\n'); - state = NORMAL; - break; - case 't': - string = g_string_append_c (string, '\t'); - state = NORMAL; - break; - default: - string = g_string_append_c (string, *c); - state = NORMAL; - break; - } - break; - - case QUOTED: - switch (*c) { - case '\\': - state = QUOTED_ESCAPED; - break; - case '"': - state = QUOTED_QUOTE1; - break; - case '\r': - /* Strip CR. */ - break; - default: - string = g_string_append_c (string, *c); - break; - } - break; - - case QUOTED_ESCAPED: - switch (*c) { - case 'n': - string = g_string_append_c (string, '\n'); - state = QUOTED; - break; - case 't': - string = g_string_append_c (string, '\t'); - state = QUOTED; - break; - default: - string = g_string_append_c (string, *c); - state = QUOTED; - break; - } - break; - - case QUOTED_QUOTE1: - switch (*c) { - case '"': - /* insert quotes in string, stay quoted. */ - string = g_string_append_c (string, *c); - state = QUOTED; - break; - case '\r': - /* Strip CR, return to QUOTED. */ - state = QUOTED; - break; - default: - string = g_string_append_c (string, *c); - state = NORMAL; - break; - } - break; - - default: - g_assert_not_reached(); - break; - } - - } - - field = g_strdup (string->str); - g_string_free( string, TRUE ); - g_free (pass1_field); - - return field; -} - -/*---------------------------------------------------------------------------*/ -/* Free list of fields. */ -/*---------------------------------------------------------------------------*/ -void -free_fields (GList ** list) -{ - GList *p; - - for (p = *list; p != NULL; p = p->next) { - g_free (p->data); - p->data = NULL; - } - - g_list_free (*list); - *list = NULL; -} - diff --git a/glabels2/src/merge-text.h b/glabels2/src/merge-text.h deleted file mode 100644 index 65bad54d..00000000 --- a/glabels2/src/merge-text.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge_text.h: text-file merge backend module header file - * - * Copyright (C) 2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __MERGE_TEXT_H__ -#define __MERGE_TEXT_H__ - -#include "merge.h" - -G_BEGIN_DECLS - -/* The following object arguments are available: - * - * name type description - * --------------------------------------------------------------------------- - * delim gchar Field delimiter. - * - */ - -#define GL_TYPE_MERGE_TEXT (gl_merge_text_get_type ()) -#define GL_MERGE_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_MERGE_TEXT, glMergeText)) -#define GL_MERGE_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_MERGE_TEXT, glMergeTextClass)) -#define GL_IS_MERGE_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_MERGE_TEXT)) -#define GL_IS_MERGE_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_MERGE_TEXT)) -#define GL_MERGE_TEXT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_MERGE_TEXT, glMergeTextClass)) - - -typedef struct _glMergeText glMergeText; -typedef struct _glMergeTextClass glMergeTextClass; - -typedef struct _glMergeTextPrivate glMergeTextPrivate; - - -struct _glMergeText { - glMerge object; - - glMergeTextPrivate *priv; -}; - -struct _glMergeTextClass { - glMergeClass parent_class; -}; - - -GType gl_merge_text_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -#endif diff --git a/glabels2/src/merge-vcard.c b/glabels2/src/merge-vcard.c deleted file mode 100644 index c0eb1449..00000000 --- a/glabels2/src/merge-vcard.c +++ /dev/null @@ -1,383 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge_vcard.c: vcard merge backend module - * - * Copyright (C) 2001 Jim Evins . - * and - * Copyright (C) 2005 Austin Henry - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#ifdef HAVE_LIBEBOOK - - -#include "merge-vcard.h" -#include - -#include -#include -#include - -#include "debug.h" - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -struct _glMergeVCardPrivate { - FILE *fp; -}; - -enum { - LAST_SIGNAL -}; - -enum { - ARG_0, -}; - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_merge_vcard_finalize (GObject *object); - -static void gl_merge_vcard_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec); - -static void gl_merge_vcard_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec); - -static GList *gl_merge_vcard_get_key_list (glMerge *merge); -static gchar *gl_merge_vcard_get_primary_key (glMerge *merge); -static void gl_merge_vcard_open (glMerge *merge); -static void gl_merge_vcard_close (glMerge *merge); -static glMergeRecord *gl_merge_vcard_get_record (glMerge *merge); -static void gl_merge_vcard_copy (glMerge *dst_merge, - glMerge *src_merge); -static char * parse_next_vcard (FILE *fp); - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glMergeVCard, gl_merge_vcard, GL_TYPE_MERGE); - -static void -gl_merge_vcard_class_init (glMergeVCardClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glMergeClass *merge_class = GL_MERGE_CLASS (class); - - gl_debug (DEBUG_MERGE, "START"); - - gl_merge_vcard_parent_class = g_type_class_peek_parent (class); - - object_class->set_property = gl_merge_vcard_set_property; - object_class->get_property = gl_merge_vcard_get_property; - - object_class->finalize = gl_merge_vcard_finalize; - - merge_class->get_key_list = gl_merge_vcard_get_key_list; - merge_class->get_primary_key = gl_merge_vcard_get_primary_key; - merge_class->open = gl_merge_vcard_open; - merge_class->close = gl_merge_vcard_close; - merge_class->get_record = gl_merge_vcard_get_record; - merge_class->copy = gl_merge_vcard_copy; - - gl_debug (DEBUG_MERGE, "END"); -} - -static void -gl_merge_vcard_init (glMergeVCard *merge_vcard) -{ - gl_debug (DEBUG_MERGE, "START"); - - merge_vcard->priv = g_new0 (glMergeVCardPrivate, 1); - - gl_debug (DEBUG_MERGE, "END"); -} - -static void -gl_merge_vcard_finalize (GObject *object) -{ - glMergeVCard *merge_vcard = GL_MERGE_VCARD (object); - - gl_debug (DEBUG_MERGE, "START"); - - g_return_if_fail (object && GL_IS_MERGE_VCARD (object)); - - g_free (merge_vcard->priv); - - G_OBJECT_CLASS (gl_merge_vcard_parent_class)->finalize (object); - - gl_debug (DEBUG_MERGE, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* Set argument. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_vcard_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec) -{ - glMergeVCard *merge_vcard; - - merge_vcard = GL_MERGE_VCARD (object); - - switch (param_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - } -} - -/*--------------------------------------------------------------------------*/ -/* Get argument. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_vcard_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec) -{ - glMergeVCard *merge_vcard; - - merge_vcard = GL_MERGE_VCARD (object); - - switch (param_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - } - -} - -/* TODO */ -/*--------------------------------------------------------------------------*/ -/* Get key list. */ -/*--------------------------------------------------------------------------*/ -static GList * -gl_merge_vcard_get_key_list (glMerge *merge) -{ - glMergeVCard *merge_vcard; - GList *key_list; - - gl_debug (DEBUG_MERGE, "BEGIN"); - - merge_vcard = GL_MERGE_VCARD (merge); - - /* extremely simple approach until I can list the available keys from the - * server, and return them. */ - key_list = NULL; - key_list = g_list_append (key_list, g_strdup ("full_name")); - key_list = g_list_append (key_list, g_strdup ("home_address")); - key_list = g_list_append (key_list, g_strdup ("work_address")); - - gl_debug (DEBUG_MERGE, "END"); - - return key_list; -} - -/* TODO? */ -/*--------------------------------------------------------------------------*/ -/* Get "primary" key. */ -/*--------------------------------------------------------------------------*/ -static gchar * -gl_merge_vcard_get_primary_key (glMerge *merge) -{ - /* For now, let's always assume the full name is the primary key. */ - return g_strdup ("full_name"); -} - -/*--------------------------------------------------------------------------*/ -/* Open merge source. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_vcard_open (glMerge *merge) -{ - glMergeVCard *merge_vcard; - gchar *src; - - merge_vcard = GL_MERGE_VCARD (merge); - - src = gl_merge_get_src (merge); - - if (src != NULL) { - merge_vcard->priv->fp = fopen (src, "r"); - } - - g_free (src); - - return; -} - -/*--------------------------------------------------------------------------*/ -/* Close merge source. */ -/*--------------------------------------------------------------------------*/ -static void -gl_merge_vcard_close (glMerge *merge) -{ - glMergeVCard *merge_vcard; - - merge_vcard = GL_MERGE_VCARD (merge); - - if (merge_vcard->priv->fp != NULL) { - fclose (merge_vcard->priv->fp); - merge_vcard->priv->fp = NULL; - } -} - -/*--------------------------------------------------------------------------*/ -/* Get next record from merge source, NULL if no records left (i.e EOF) */ -/*--------------------------------------------------------------------------*/ -static glMergeRecord * -gl_merge_vcard_get_record (glMerge *merge) -{ - glMergeVCard *merge_vcard; - glMergeRecord *record; - glMergeField *field; - - char *vcard; - EContact *contact; - - merge_vcard = GL_MERGE_VCARD (merge); - - vcard = parse_next_vcard(merge_vcard->priv->fp); - if (vcard == NULL || vcard[0] == '\0') { - return NULL; /* EOF */ - } - contact = e_contact_new_from_vcard(vcard); - if (contact == NULL) { - return NULL; /* invalid vcard */ - } - - record = g_new0 (glMergeRecord, 1); - record->select_flag = TRUE; - - /* Take the interesting fields one by one from the contact, and put them - * into the glMergeRecord structure. When done, free up the resources for - * that contact */ - - /* get the full name */ - field = g_new0 (glMergeField, 1); - field->key = g_strdup ("full_name"); - field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_FULL_NAME)); - - record->field_list = g_list_append (record->field_list, field); - - /* get the home address */ - field = g_new0 (glMergeField, 1); - field->key = g_strdup ("home_address"); - field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_ADDRESS_LABEL_HOME)); - - record->field_list = g_list_append (record->field_list, field); - - /* get the work address */ - field = g_new0 (glMergeField, 1); - field->key = g_strdup ("work_address"); - field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_ADDRESS_LABEL_WORK)); - - record->field_list = g_list_append (record->field_list, field); - - /* free the contact */ - g_object_unref (contact); - g_free(vcard); - - return record; -} - -/*---------------------------------------------------------------------------*/ -/* Copy merge_vcard specific fields. */ -/*---------------------------------------------------------------------------*/ -static void -gl_merge_vcard_copy (glMerge *dst_merge, - glMerge *src_merge) -{ - glMergeVCard *dst_merge_vcard; - glMergeVCard *src_merge_vcard; - - dst_merge_vcard = GL_MERGE_VCARD (dst_merge); - src_merge_vcard = GL_MERGE_VCARD (src_merge); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE: pull out a full VCard from the open file */ -/* Arguments: */ -/* fp - an open stream to parse in put from */ -/* Returns: */ -/* a pointer to the buffer containing the vcard, the empty string on */ -/* end-of-file or error, this buffer needs to be free by the caller */ -/*---------------------------------------------------------------------------*/ -static char * -parse_next_vcard (FILE *fp) -{ - gboolean found_begin = FALSE; - gboolean found_end = FALSE; - char *vcard; - char line[512]; - int size = 2048; - int cursize = 0; - - /* if no source has been set up, don't try to read from the file */ - if (!fp) { - return NULL; - } - - vcard = g_malloc0(size); - - while (fgets(line, sizeof(line), fp) && found_end == FALSE) { - if (found_begin == TRUE) { - if (g_str_has_prefix(line, "END:VCARD")) { found_end = TRUE; } - } else { - if (g_str_has_prefix(line, "BEGIN:VCARD")) { found_begin = TRUE; } - else { continue; }/* skip lines not in a vcard */ - } - - /* if the buffer passed us isn't big enough, reallocate it */ - cursize += strlen(line); - if (cursize >= size) { - size *= 2; - vcard = (char *)g_realloc(vcard, size); /* aborts program on error */ - } - - /* add the line (or portion thereof) to the vcard */ - strncat(vcard, line, size); - } - - return vcard; -} - - - -#endif /* HAVE_LIBEBOOK */ diff --git a/glabels2/src/merge-vcard.h b/glabels2/src/merge-vcard.h deleted file mode 100644 index 7ede444f..00000000 --- a/glabels2/src/merge-vcard.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge_vcard.h: vcard merge backend module header file - * - * Copyright (C) 2002 Jim Evins . - * and - * Copyright (C) 2005 Austin Henry - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __MERGE_VCARD_H__ -#define __MERGE_VCARD_H__ - -#include "merge.h" - -G_BEGIN_DECLS - -/* The following object arguments are available: - * - * name type description - * --------------------------------------------------------------------------- - * - */ - -#define GL_TYPE_MERGE_VCARD (gl_merge_vcard_get_type ()) -#define GL_MERGE_VCARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_MERGE_VCARD, glMergeVCard)) -#define GL_MERGE_VCARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_MERGE_VCARD, glMergeVCardClass)) -#define GL_IS_MERGE_VCARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_MERGE_VCARD)) -#define GL_IS_MERGE_VCARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_MERGE_VCARD)) -#define GL_MERGE_VCARD_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_MERGE_VCARD, glMergeVCardClass)) - - -typedef struct _glMergeVCard glMergeVCard; -typedef struct _glMergeVCardClass glMergeVCardClass; - -typedef struct _glMergeVCardPrivate glMergeVCardPrivate; - - -struct _glMergeVCard { - glMerge object; - - glMergeVCardPrivate *priv; -}; - -struct _glMergeVCardClass { - glMergeClass parent_class; -}; - - -GType gl_merge_vcard_get_type (void) G_GNUC_CONST; - -G_END_DECLS - - -#endif /* __MERGE_VCARD_H__ */ diff --git a/glabels2/src/merge.c b/glabels2/src/merge.c deleted file mode 100644 index 8af027fc..00000000 --- a/glabels2/src/merge.c +++ /dev/null @@ -1,791 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge.c: document merge module - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "merge.h" - -#include -#include -#include - -#include "debug.h" - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glMergePrivate { - gchar *name; - gchar *description; - gchar *src; - glMergeSrcType src_type; - - GList *record_list; -}; - -enum { - LAST_SIGNAL -}; - -typedef struct { - - GType type; - gchar *name; - gchar *description; - glMergeSrcType src_type; - - guint n_params; - GParameter *params; - -} Backend; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -static GList *backends = NULL; - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_merge_finalize (GObject *object); - -static void merge_open (glMerge *merge); - -static void merge_close (glMerge *merge); - -static glMergeRecord *merge_get_record (glMerge *merge); - -static void merge_free_record (glMergeRecord **record); - -static glMergeRecord *merge_dup_record (glMergeRecord *record); - -static void merge_free_record_list (GList **record_list); - -static GList *merge_dup_record_list (GList *record_list); - - - - -/*****************************************************************************/ -/* Register a new merge backend. */ -/*****************************************************************************/ -void -gl_merge_register_backend (GType type, - gchar *name, - gchar *description, - glMergeSrcType src_type, - const gchar *first_arg_name, - ...) -{ - Backend *backend; - va_list args; - const gchar *pname; - GObjectClass *class; - GParamSpec *pspec; - GParameter *params; - guint n_params = 0, n_alloced_params = 16; - - backend = g_new0 (Backend, 1); - - backend->type = type; - backend->name = g_strdup (name); - backend->description = g_strdup (description); - backend->src_type = src_type; - - params = g_new (GParameter, n_alloced_params); - va_start (args, first_arg_name); - for ( pname=first_arg_name; pname != NULL; pname=va_arg (args,gchar *) ) { - gchar *error = NULL; - - class = g_type_class_ref (type); - if (class == NULL) { - g_message ("%s: unknown object type %d", - G_STRLOC, (int)type); - break; - } - pspec = g_object_class_find_property (class, pname); - if (pspec == NULL) { - g_message ("%s: object class `%s' has no property named `%s'", - G_STRLOC, g_type_name (type), pname); - break; - } - if (n_params >= n_alloced_params) { - n_alloced_params += 16; - params = g_renew (GParameter, params, n_alloced_params); - } - params[n_params].name = pname; - params[n_params].value.g_type = 0; - g_value_init (¶ms[n_params].value, pspec->value_type); - G_VALUE_COLLECT (¶ms[n_params].value, args, 0, &error); - if (error) { - g_message ("%s: %s", G_STRLOC, error); - g_free (error); - break; - } - - n_params++; - } - va_end (args); - - backend->n_params = n_params; - backend->params = params; - - backends = g_list_append (backends, backend); - -} - -/*****************************************************************************/ -/* Get list of registered backend descriptions. */ -/*****************************************************************************/ -GList * -gl_merge_get_descriptions (void) -{ - GList *descriptions = NULL; - GList *p; - Backend *backend; - - descriptions = g_list_append (descriptions, g_strdup(_("None"))); - - for ( p=backends; p!=NULL; p=p->next) { - backend = (Backend *)p->data; - descriptions = g_list_append (descriptions, - g_strdup(backend->description)); - } - - return descriptions; -} - -/*****************************************************************************/ -/* Free list of descriptions. */ -/*****************************************************************************/ -void -gl_merge_free_descriptions (GList **descriptions) -{ - GList *p; - - gl_debug (DEBUG_MERGE, "START"); - - for (p = *descriptions; p != NULL; p = p->next) { - g_free (p->data); - p->data = NULL; - } - - g_list_free (*descriptions); - *descriptions = NULL; - - gl_debug (DEBUG_MERGE, "END"); -} - -/*****************************************************************************/ -/* Lookup name of backend from description. */ -/*****************************************************************************/ -gchar * -gl_merge_description_to_name (gchar *description) -{ - GList *p; - Backend *backend; - - if (g_strcasecmp(description, _("None")) == 0) { - return g_strdup("None"); - } - - for ( p=backends; p!=NULL; p=p->next) { - backend = (Backend *)p->data; - if (g_strcasecmp(description, backend->description) == 0) { - return g_strdup(backend->name); - } - } - - return g_strdup("None"); -} - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glMerge, gl_merge, G_TYPE_OBJECT); - -static void -gl_merge_class_init (glMergeClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_MERGE, "START"); - - gl_merge_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_merge_finalize; - - gl_debug (DEBUG_MERGE, "END"); -} - -static void -gl_merge_init (glMerge *merge) -{ - gl_debug (DEBUG_MERGE, "START"); - - merge->priv = g_new0 (glMergePrivate, 1); - - gl_debug (DEBUG_MERGE, "END"); -} - -static void -gl_merge_finalize (GObject *object) -{ - glMerge *merge = GL_MERGE (object); - - gl_debug (DEBUG_MERGE, "START"); - - g_return_if_fail (object && GL_IS_MERGE (object)); - - merge_free_record_list (&merge->priv->record_list); - g_free (merge->priv->name); - g_free (merge->priv->description); - g_free (merge->priv->src); - g_free (merge->priv); - - G_OBJECT_CLASS (gl_merge_parent_class)->finalize (object); - - gl_debug (DEBUG_MERGE, "END"); -} - -/*****************************************************************************/ -/* New merge object. */ -/*****************************************************************************/ -glMerge * -gl_merge_new (gchar *name) -{ - glMerge *merge = NULL; - GList *p; - Backend *backend; - - gl_debug (DEBUG_MERGE, "START"); - - for (p=backends; p!=NULL; p=p->next) { - backend = (Backend *)p->data; - - if (g_strcasecmp(name, backend->name) == 0) { - - merge = GL_MERGE (g_object_newv (backend->type, - backend->n_params, - backend->params)); - - merge->priv->name = g_strdup (name); - merge->priv->description = g_strdup (backend->description); - merge->priv->src_type = backend->src_type; - - break; - } - } - - if ( (merge == NULL) && (g_strcasecmp (name, "None") != 0)) { - g_message ("Unknown merge backend \"%s\"", name); - } - - gl_debug (DEBUG_MERGE, "END"); - - return merge; -} - -/*****************************************************************************/ -/* Duplicate merge. */ -/*****************************************************************************/ -glMerge * -gl_merge_dup (glMerge *src_merge) -{ - glMerge *dst_merge; - - gl_debug (DEBUG_MERGE, "START"); - - if (src_merge == NULL) { - gl_debug (DEBUG_MERGE, "END (NULL)"); - return NULL; - } - - g_return_val_if_fail (GL_IS_MERGE (src_merge), NULL); - - dst_merge = g_object_new (G_OBJECT_TYPE(src_merge), NULL); - dst_merge->priv->name = g_strdup (src_merge->priv->name); - dst_merge->priv->description = g_strdup (src_merge->priv->description); - dst_merge->priv->src = g_strdup (src_merge->priv->src); - dst_merge->priv->src_type = src_merge->priv->src_type; - dst_merge->priv->record_list - = merge_dup_record_list (src_merge->priv->record_list); - - if ( GL_MERGE_GET_CLASS(src_merge)->copy != NULL ) { - - /* We have an object specific method, use it */ - GL_MERGE_GET_CLASS(src_merge)->copy (dst_merge, src_merge); - - } - - gl_debug (DEBUG_MERGE, "END"); - - return dst_merge; -} - -/*****************************************************************************/ -/* Get name of merge. */ -/*****************************************************************************/ -gchar * -gl_merge_get_name (glMerge *merge) -{ - gl_debug (DEBUG_MERGE, ""); - - if (merge == NULL) { - return g_strdup("None"); - } - - g_return_val_if_fail (GL_IS_MERGE (merge), g_strdup("None")); - - return g_strdup(merge->priv->name); -} - -/*****************************************************************************/ -/* Get description of merge. */ -/*****************************************************************************/ -gchar * -gl_merge_get_description (glMerge *merge) -{ - gl_debug (DEBUG_MERGE, ""); - - if (merge == NULL) { - return g_strdup(_("None")); - } - - g_return_val_if_fail (GL_IS_MERGE (merge), g_strdup(_("None"))); - - return g_strdup(merge->priv->description); -} - -/*****************************************************************************/ -/* Get source type of merge. */ -/*****************************************************************************/ -glMergeSrcType -gl_merge_get_src_type (glMerge *merge) -{ - gl_debug (DEBUG_MERGE, ""); - - if (merge == NULL) { - return GL_MERGE_SRC_IS_FIXED; - } - - g_return_val_if_fail (GL_IS_MERGE (merge), GL_MERGE_SRC_IS_FIXED); - - return merge->priv->src_type; -} - -/*****************************************************************************/ -/* Set src of merge. */ -/*****************************************************************************/ -void -gl_merge_set_src (glMerge *merge, - gchar *src) -{ - GList *record_list = NULL; - glMergeRecord *record; - - gl_debug (DEBUG_MERGE, "START"); - - if (merge == NULL) - { - gl_debug (DEBUG_MERGE, "END (NULL)"); - return; - } - - g_return_if_fail (GL_IS_MERGE (merge)); - - if ( src == NULL) - { - - if ( merge->priv->src != NULL ) - { - g_free (merge->priv->src); - } - merge->priv->src = NULL; - merge_free_record_list (&merge->priv->record_list); - - } - else - { - - if ( merge->priv->src != NULL ) - { - g_free(merge->priv->src); - } - merge->priv->src = g_strdup (src); - - merge_free_record_list (&merge->priv->record_list); - - merge_open (merge); - while ( (record = merge_get_record (merge)) != NULL ) - { - record_list = g_list_append( record_list, record ); - } - merge_close (merge); - merge->priv->record_list = record_list; - - } - - - gl_debug (DEBUG_MERGE, "END"); -} - -/*****************************************************************************/ -/* Get src of merge. */ -/*****************************************************************************/ -gchar * -gl_merge_get_src (glMerge *merge) -{ - gl_debug (DEBUG_MERGE, ""); - - if (merge == NULL) { - return NULL; - } - - g_return_val_if_fail (GL_IS_MERGE (merge), NULL); - - return g_strdup(merge->priv->src); -} - -/*****************************************************************************/ -/* Get Key List. */ -/*****************************************************************************/ -GList * -gl_merge_get_key_list (glMerge *merge) -{ - GList *key_list = NULL; - - gl_debug (DEBUG_MERGE, "START"); - - if (merge == NULL) { - return NULL; - } - - g_return_val_if_fail (GL_IS_MERGE (merge), NULL); - - if ( GL_MERGE_GET_CLASS(merge)->get_key_list != NULL ) { - - key_list = GL_MERGE_GET_CLASS(merge)->get_key_list (merge); - - } - - gl_debug (DEBUG_MERGE, "END"); - - return key_list; -} - -/*****************************************************************************/ -/* Free a list of keys. */ -/*****************************************************************************/ -void -gl_merge_free_key_list (GList **key_list) -{ - GList *p; - - gl_debug (DEBUG_MERGE, "START"); - - for (p = *key_list; p != NULL; p = p->next) { - g_free (p->data); - p->data = NULL; - } - - g_list_free (*key_list); - *key_list = NULL; - - gl_debug (DEBUG_MERGE, "END"); -} - -/*****************************************************************************/ -/* Get Key List. */ -/*****************************************************************************/ -gchar * -gl_merge_get_primary_key (glMerge *merge) -{ - gchar *key = NULL; - - gl_debug (DEBUG_MERGE, "START"); - - if (merge == NULL) { - return NULL; - } - - g_return_val_if_fail (GL_IS_MERGE (merge), NULL); - - if ( GL_MERGE_GET_CLASS(merge)->get_primary_key != NULL ) { - - key = GL_MERGE_GET_CLASS(merge)->get_primary_key (merge); - - } - - gl_debug (DEBUG_MERGE, "END"); - - return key; -} - -/*---------------------------------------------------------------------------*/ -/* Open merge source. */ -/*---------------------------------------------------------------------------*/ -static void -merge_open (glMerge *merge) -{ - gl_debug (DEBUG_MERGE, "START"); - - g_return_if_fail (merge && GL_IS_MERGE (merge)); - - if ( GL_MERGE_GET_CLASS(merge)->open != NULL ) { - - GL_MERGE_GET_CLASS(merge)->open (merge); - - } - - gl_debug (DEBUG_MERGE, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* Close merge source. */ -/*---------------------------------------------------------------------------*/ -static void -merge_close (glMerge *merge) -{ - gl_debug (DEBUG_MERGE, "START"); - - g_return_if_fail (merge && GL_IS_MERGE (merge)); - - if ( GL_MERGE_GET_CLASS(merge)->close != NULL ) { - - GL_MERGE_GET_CLASS(merge)->close (merge); - - } - - gl_debug (DEBUG_MERGE, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* Get next record (list of fields) from opened merge source. */ -/*---------------------------------------------------------------------------*/ -static glMergeRecord * -merge_get_record (glMerge *merge) -{ - glMergeRecord *record = NULL; - - gl_debug (DEBUG_MERGE, "START"); - - g_return_val_if_fail (merge && GL_IS_MERGE (merge), NULL); - - if ( GL_MERGE_GET_CLASS(merge)->get_record != NULL ) { - - record = GL_MERGE_GET_CLASS(merge)->get_record (merge); - - } - - gl_debug (DEBUG_MERGE, "END"); - - return record; -} - -/*---------------------------------------------------------------------------*/ -/* Free a merge record (list of fields) */ -/*---------------------------------------------------------------------------*/ -static void -merge_free_record (glMergeRecord **record) -{ - GList *p; - glMergeField *field; - - gl_debug (DEBUG_MERGE, "START"); - - for (p = (*record)->field_list; p != NULL; p = p->next) { - field = (glMergeField *) p->data; - - g_free (field->key); - field->key = NULL; - g_free (field->value); - field->value = NULL; - - g_free (p->data); - p->data = NULL; - - } - g_list_free ((*record)->field_list); - (*record)->field_list = NULL; - - g_free (*record); - *record = NULL; - - gl_debug (DEBUG_MERGE, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* Duplicate a merge record (list of fields) */ -/*---------------------------------------------------------------------------*/ -static glMergeRecord * -merge_dup_record (glMergeRecord *record) -{ - glMergeRecord *dest_record; - GList *p; - glMergeField *dest_field, *field; - - gl_debug (DEBUG_MERGE, "START"); - - dest_record = g_new0 (glMergeRecord, 1); - dest_record->select_flag = record->select_flag; - - for (p = record->field_list; p != NULL; p = p->next) { - field = (glMergeField *) p->data; - - dest_field = g_new0 (glMergeField, 1); - - dest_field->key = g_strdup (field->key); - dest_field->value = g_strdup (field->value); - - dest_record->field_list = - g_list_append (dest_record->field_list, dest_field); - - } - - gl_debug (DEBUG_MERGE, "END"); - - return dest_record; -} - -/*****************************************************************************/ -/* Find key in given record and evaluate. */ -/*****************************************************************************/ -gchar * -gl_merge_eval_key (glMergeRecord *record, - gchar *key) - -{ - GList *p; - glMergeField *field; - gchar *val = NULL; - - gl_debug (DEBUG_MERGE, "START"); - - if ( (record != NULL) ) { - for (p = record->field_list; p != NULL; p = p->next) { - field = (glMergeField *) p->data; - - if (strcmp (key, field->key) == 0) { - val = g_strdup (field->value); - } - - } - } - - gl_debug (DEBUG_MERGE, "END"); - - return val; -} - -/*****************************************************************************/ -/* Read all records from merge source. */ -/*****************************************************************************/ -const GList * -gl_merge_get_record_list (glMerge *merge) -{ - gl_debug (DEBUG_MERGE, ""); - - if ( merge != NULL ) { - return merge->priv->record_list; - } else { - return NULL; - } -} - -/*---------------------------------------------------------------------------*/ -/* Free a list of records. */ -/*---------------------------------------------------------------------------*/ -static void -merge_free_record_list (GList **record_list) -{ - GList *p; - glMergeRecord *record; - - gl_debug (DEBUG_MERGE, "START"); - - for (p = *record_list; p != NULL; p = p->next) { - record = (glMergeRecord *) p->data; - - merge_free_record( &record ); - - } - - g_list_free (*record_list); - *record_list = NULL; - - gl_debug (DEBUG_MERGE, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* Duplicate a list of records. */ -/*---------------------------------------------------------------------------*/ -static GList * -merge_dup_record_list (GList *record_list) -{ - GList *dest_list = NULL, *p; - glMergeRecord *dest_record, *record; - - gl_debug (DEBUG_MERGE, "START"); - - for (p = record_list; p != NULL; p = p->next) { - record = (glMergeRecord *) p->data; - - dest_record = merge_dup_record( record ); - dest_list = g_list_append (dest_list, dest_record); - } - - - gl_debug (DEBUG_MERGE, "END"); - - return dest_list; -} - -/*****************************************************************************/ -/* Count selected records. */ -/*****************************************************************************/ -gint -gl_merge_get_record_count (glMerge *merge) -{ - GList *p; - glMergeRecord *record; - gint count; - - gl_debug (DEBUG_MERGE, "START"); - - count = 0; - for ( p=merge->priv->record_list; p!=NULL; p=p->next ) { - record = (glMergeRecord *)p->data; - - if ( record->select_flag ) count ++; - } - - gl_debug (DEBUG_MERGE, "END"); - - return count; -} - - diff --git a/glabels2/src/merge.h b/glabels2/src/merge.h deleted file mode 100644 index 819ca25b..00000000 --- a/glabels2/src/merge.h +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * merge.h: document merge module header file - * - * Copyright (C) 2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __MERGE_H__ -#define __MERGE_H__ - -#include - -G_BEGIN_DECLS - -typedef enum { - GL_MERGE_SRC_IS_FIXED, - GL_MERGE_SRC_IS_FILE, -} glMergeSrcType; - -typedef struct { - gchar *key; - gchar *value; -} glMergeField; - -typedef struct { - gboolean select_flag; - GList *field_list; /* List of glMergeFields */ -} glMergeRecord; - - -#define GL_TYPE_MERGE (gl_merge_get_type ()) -#define GL_MERGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_MERGE, glMerge)) -#define GL_MERGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_MERGE, glMergeClass)) -#define GL_IS_MERGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_MERGE)) -#define GL_IS_MERGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_MERGE)) -#define GL_MERGE_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_MERGE, glMergeClass)) - - -typedef struct _glMerge glMerge; -typedef struct _glMergeClass glMergeClass; - -typedef struct _glMergePrivate glMergePrivate; - - -struct _glMerge { - GObject object; - - glMergePrivate *priv; -}; - -struct _glMergeClass { - GObjectClass parent_class; - - GList *(*get_key_list) (glMerge *merge); - - gchar *(*get_primary_key) (glMerge *merge); - - void (*open) (glMerge *merge); - - void (*close) (glMerge *merge); - - glMergeRecord *(*get_record) (glMerge *merge); - - void (*copy) (glMerge *dst_merge, - glMerge *src_merge); -}; - - -void gl_merge_register_backend (GType type, - gchar *name, - gchar *description, - glMergeSrcType src_type, - const gchar *first_arg_name, - ...); - -GList *gl_merge_get_descriptions (void); - -void gl_merge_free_descriptions (GList **descriptions); - -gchar *gl_merge_description_to_name (gchar *description); - -GType gl_merge_get_type (void) G_GNUC_CONST; - -glMerge *gl_merge_new (gchar *name); - -glMerge *gl_merge_dup (glMerge *orig); - -gchar *gl_merge_get_name (glMerge *merge); - -gchar *gl_merge_get_description (glMerge *merge); - -glMergeSrcType gl_merge_get_src_type (glMerge *merge); - -void gl_merge_set_src (glMerge *merge, - gchar *src); - -gchar *gl_merge_get_src (glMerge *merge); - -GList *gl_merge_get_key_list (glMerge *merge); - -void gl_merge_free_key_list (GList **keys); - -gchar *gl_merge_get_primary_key (glMerge *merge); - -gchar *gl_merge_eval_key (glMergeRecord *record, - gchar *key); - -const GList *gl_merge_get_record_list (glMerge *merge); - -gint gl_merge_get_record_count (glMerge *merge); - -G_END_DECLS - -#endif diff --git a/glabels2/src/mini-preview-pixbuf-cache.c b/glabels2/src/mini-preview-pixbuf-cache.c deleted file mode 100644 index c7d3afa3..00000000 --- a/glabels2/src/mini-preview-pixbuf-cache.c +++ /dev/null @@ -1,149 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * mini-preview-pixbuf-cache.c: GLabels mini-preview pixbuf cache module - * - * Copyright (C) 2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "mini-preview-pixbuf-cache.h" -#include "mini-preview-pixbuf.h" - -#include "libglabels/db.h" - -#include -#include - -#include "debug.h" - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -static GHashTable *mini_preview_pixbuf_cache = NULL; - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - - -/*****************************************************************************/ -/* Create a new hash table to keep track of cached mini preview pixbufs. */ -/*****************************************************************************/ -void -gl_mini_preview_pixbuf_cache_init (void) -{ - GList *names = NULL; - GList *p; - lglTemplate *template; - - gl_debug (DEBUG_PIXBUF_CACHE, "START"); - - mini_preview_pixbuf_cache = g_hash_table_new (g_str_hash, g_str_equal); - - names = lgl_db_get_template_name_list_unique (NULL, NULL, NULL); - for ( p=names; p != NULL; p=p->next ) - { - gl_debug (DEBUG_PIXBUF_CACHE, "name = \"%s\"", p->data); - - template = lgl_db_lookup_template_from_name (p->data); - gl_mini_preview_pixbuf_cache_add_by_template (template); - lgl_template_free (template); - } - lgl_db_free_template_name_list (names); - - gl_debug (DEBUG_PIXBUF_CACHE, "END pixbuf_cache=%p", mini_preview_pixbuf_cache); -} - -/*****************************************************************************/ -/* Add pixbuf to cache by template. */ -/*****************************************************************************/ -void -gl_mini_preview_pixbuf_cache_add_by_template (lglTemplate *template) -{ - GdkPixbuf *pixbuf; - GList *p; - lglTemplateAlias *alias; - gchar *name; - - gl_debug (DEBUG_PIXBUF_CACHE, "START"); - - pixbuf = gl_mini_preview_pixbuf_new (template, 72, 72); - - for ( p=template->aliases; p != NULL; p=p->next ) - { - alias = (lglTemplateAlias *)p->data; - - name = g_strdup_printf ("%s %s", alias->brand, alias->part); - g_hash_table_insert (mini_preview_pixbuf_cache, name, g_object_ref (pixbuf)); - } - - g_object_unref (pixbuf); - - gl_debug (DEBUG_PIXBUF_CACHE, "END"); -} - -/*****************************************************************************/ -/* Add pixbuf to cache by name. */ -/*****************************************************************************/ -void -gl_mini_preview_pixbuf_cache_add_by_name (gchar *name) -{ - lglTemplate *template; - GdkPixbuf *pixbuf; - - gl_debug (DEBUG_PIXBUF_CACHE, "START"); - - template = lgl_db_lookup_template_from_name (name); - pixbuf = gl_mini_preview_pixbuf_new (template, 72, 72); - lgl_template_free (template); - - g_hash_table_insert (mini_preview_pixbuf_cache, g_strdup (name), pixbuf); - - gl_debug (DEBUG_PIXBUF_CACHE, "END"); -} - -/*****************************************************************************/ -/* Get pixbuf. */ -/*****************************************************************************/ -GdkPixbuf * -gl_mini_preview_pixbuf_cache_get_pixbuf (gchar *name) -{ - GdkPixbuf *pixbuf; - - gl_debug (DEBUG_PIXBUF_CACHE, "START pixbuf_cache=%p", mini_preview_pixbuf_cache); - - pixbuf = g_hash_table_lookup (mini_preview_pixbuf_cache, name); - - if (!pixbuf) - { - gl_mini_preview_pixbuf_cache_add_by_name (name); - pixbuf = g_hash_table_lookup (mini_preview_pixbuf_cache, name); - } - - gl_debug (DEBUG_PIXBUF_CACHE, "END"); - - return g_object_ref (pixbuf); -} - diff --git a/glabels2/src/mini-preview-pixbuf-cache.h b/glabels2/src/mini-preview-pixbuf-cache.h deleted file mode 100644 index 092d5692..00000000 --- a/glabels2/src/mini-preview-pixbuf-cache.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * mini-preview-pixbuf-cache.h: GLabels mini-preview pixbuf cache module - * - * Copyright (C) 2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __MINI_PREVIEW_PIXBUF_CACHE_H__ -#define __MINI_PREVIEW_PIXBUF_CACHE_H__ - -#include -#include - -G_BEGIN_DECLS - -void gl_mini_preview_pixbuf_cache_init (void); - -void gl_mini_preview_pixbuf_cache_add_by_name (gchar *name); -void gl_mini_preview_pixbuf_cache_add_by_template (lglTemplate *template); - -GdkPixbuf *gl_mini_preview_pixbuf_cache_get_pixbuf (gchar *name); - - -G_END_DECLS - -#endif /*__MINI_PREVIEW_PIXBUF_CACHE_H__ */ diff --git a/glabels2/src/mini-preview-pixbuf.c b/glabels2/src/mini-preview-pixbuf.c deleted file mode 100644 index a4642525..00000000 --- a/glabels2/src/mini-preview-pixbuf.c +++ /dev/null @@ -1,225 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * mini-preview-pixbuf.c: mini preview pixbuf module - * - * Copyright (C) 2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "mini-preview-pixbuf.h" -#include "cairo-label-path.h" - -#include -#include - -#include "debug.h" - -/*===========================================*/ -/* Private macros and constants. */ -/*===========================================*/ - -#define PAPER_RGB_ARGS 0.95, 0.95, 0.95 -#define PAPER_OUTLINE_RGB_ARGS 0.0, 0.0, 0.0 -#define LABEL_RGB_ARGS 1.0, 1.0, 1.0 -#define LABEL_OUTLINE_RGB_ARGS 0.25, 0.25, 0.25 - -#define PAPER_OUTLINE_WIDTH_PIXELS 1.0 -#define LABEL_OUTLINE_WIDTH_PIXELS 1.0 - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void draw_paper (cairo_t *cr, - lglTemplate *template, - gdouble scale); - -static void draw_label_outlines (cairo_t *cr, - lglTemplate *template, - gdouble scale); - -static void draw_label_outline (cairo_t *cr, - lglTemplate *template, - gdouble x0, - gdouble y0); - - - - -/****************************************************************************/ -/* Create new pixbuf with mini preview of template */ -/****************************************************************************/ -GdkPixbuf * -gl_mini_preview_pixbuf_new (lglTemplate *template, - gint width, - gint height) -{ - cairo_surface_t *surface; - cairo_t *cr; - GdkPixbuf *pixbuf; - gdouble scale; - gdouble w, h; - gdouble offset_x, offset_y; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - /* Create pixbuf and cairo context. */ - pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height); - surface = cairo_image_surface_create_for_data (gdk_pixbuf_get_pixels (pixbuf), - CAIRO_FORMAT_RGB24, - gdk_pixbuf_get_width (pixbuf), - gdk_pixbuf_get_height (pixbuf), - gdk_pixbuf_get_rowstride (pixbuf)); - - cr = cairo_create (surface); - cairo_surface_destroy (surface); - - /* Clear pixbuf */ - cairo_save (cr); - cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); - cairo_paint (cr); - cairo_restore (cr); - - cairo_set_antialias (cr, CAIRO_ANTIALIAS_GRAY); - - /* Set scale and offset */ - w = width - 1; - h = height - 1; - if ( (w/template->page_width) > (h/template->page_height) ) { - scale = h / template->page_height; - } else { - scale = w / template->page_width; - } - offset_x = (width/scale - template->page_width) / 2.0; - offset_y = (height/scale - template->page_height) / 2.0; - cairo_identity_matrix (cr); - cairo_scale (cr, scale, scale); - cairo_translate (cr, offset_x, offset_y); - - /* Draw paper and label outlines */ - draw_paper (cr, template, scale); - draw_label_outlines (cr, template, scale); - - /* Cleanup */ - cairo_destroy (cr); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); - - return pixbuf; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Draw paper and paper outline. */ -/*--------------------------------------------------------------------------*/ -static void -draw_paper (cairo_t *cr, - lglTemplate *template, - gdouble scale) -{ - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - cairo_save (cr); - cairo_rectangle (cr, 0.0, 0.0, template->page_width, template->page_height); - cairo_set_source_rgb (cr, PAPER_RGB_ARGS); - cairo_fill_preserve (cr); - cairo_set_line_width (cr, PAPER_OUTLINE_WIDTH_PIXELS/scale); - cairo_set_source_rgb (cr, PAPER_OUTLINE_RGB_ARGS); - cairo_stroke (cr); - cairo_restore (cr); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Draw label outlines. */ -/*--------------------------------------------------------------------------*/ -static void -draw_label_outlines (cairo_t *cr, - lglTemplate *template, - gdouble scale) -{ - const lglTemplateFrame *frame; - gint i, n_labels; - lglTemplateOrigin *origins; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - cairo_save (cr); - - cairo_set_line_width (cr, LABEL_OUTLINE_WIDTH_PIXELS/scale); - - frame = (lglTemplateFrame *)template->frames->data; - - n_labels = lgl_template_frame_get_n_labels (frame); - origins = lgl_template_frame_get_origins (frame); - - for ( i=0; i < n_labels; i++ ) { - - draw_label_outline(cr, template, origins[i].x, origins[i].y); - - } - - g_free (origins); - - cairo_restore (cr); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Draw label outline. */ -/*--------------------------------------------------------------------------*/ -static void -draw_label_outline (cairo_t *cr, - lglTemplate *template, - gdouble x0, - gdouble y0) -{ - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - cairo_save (cr); - - cairo_translate (cr, x0, y0); - - gl_cairo_label_path (cr, template, FALSE, FALSE); - - cairo_set_source_rgb (cr, LABEL_RGB_ARGS); - cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); - cairo_fill_preserve (cr); - - cairo_set_source_rgb (cr, LABEL_OUTLINE_RGB_ARGS); - cairo_stroke (cr); - - cairo_restore (cr); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - diff --git a/glabels2/src/mini-preview-pixbuf.h b/glabels2/src/mini-preview-pixbuf.h deleted file mode 100644 index ddad146b..00000000 --- a/glabels2/src/mini-preview-pixbuf.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * mini-preview-pixbuf.h: mini-preview pixbuf module header file - * - * Copyright (C) 2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __MINI_PREVIEW_PIXBUF_H__ -#define __MINI_PREVIEW_PIXBUF_H__ - - -#include -#include - -G_BEGIN_DECLS - -GdkPixbuf *gl_mini_preview_pixbuf_new (lglTemplate *template, - gint width, - gint height); - -G_END_DECLS - -#endif diff --git a/glabels2/src/mygal/Makefile.am b/glabels2/src/mygal/Makefile.am deleted file mode 100644 index 054cbe7a..00000000 --- a/glabels2/src/mygal/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -INCLUDES = \ - $(MYGAL_CFLAGS) - - -libmygal_la_LDFLAGS=\ - $(MYGAL_LIBS) - -noinst_LTLIBRARIES = libmygal.la - -libmygal_la_SOURCES = \ - widget-color-combo.c \ - widget-color-combo.h \ - e-util.h \ - e-colors.c \ - e-colors.h \ - mygal-combo-box.c \ - mygal-combo-box.h \ - color-palette.c \ - color-palette.h \ - color-group.c \ - color-group.h \ - e-marshal.c \ - e-marshal.h - -marshal_sources = \ - e-marshal.c \ - e-marshal.h - -$(libmygal_la_OBJECTS) : $(marshal_sources) - -e-marshal.h: e-marshal.list $(GLIB_GENMARSHAL) - $(GLIB_GENMARSHAL) $< --header --prefix=e_marshal > $@ -e-marshal.c: e-marshal.list $(GLIB_GENMARSHAL) - $(GLIB_GENMARSHAL) $< --body --prefix=e_marshal > $@ - -EXTRA_DIST = e-marshal.list -CLEANFILES = $(marshal_sources) - -DONT_DIST_SOURCE = $(marshal_sources) - -dist-hook: - for file in $(DONT_DIST_SOURCE) ; do \ - rm -f $(distdir)/$$file ; \ - done diff --git a/glabels2/src/mygal/color-group.c b/glabels2/src/mygal/color-group.c deleted file mode 100644 index 3f35257c..00000000 --- a/glabels2/src/mygal/color-group.c +++ /dev/null @@ -1,333 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * color-group.c - Utility to keep a shered memory of custom colors - * between arbitrary widgets. - * Copyright 2000, Michael Levy - * Copyright 2001, Almer S. Tigelaar - * - * Authors: - * Michael Levy (mlevy@genoscope.cns.fr) - * Revised and polished by: - * Almer S. Tigelaar - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#include "color-group.h" -#include -#include -#include "e-util.h" -#include - -#define PARENT_TYPE G_TYPE_OBJECT - -enum { - CUSTOM_COLOR_ADD, - LAST_SIGNAL -}; - -static GObjectClass *parent_class; - -static GQuark color_group_signals [LAST_SIGNAL] = { 0 }; - -static void color_group_finalize (GObject *obj); - -static void -color_group_class_init (ColorGroupClass *klass) -{ - GObjectClass *object_class; - - object_class = (GObjectClass*) klass; - - object_class->finalize = &color_group_finalize; - parent_class = g_type_class_peek (PARENT_TYPE); - - color_group_signals [CUSTOM_COLOR_ADD] = - g_signal_new ("custom_color_add", - COLOR_GROUP_TYPE, - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ColorGroupClass, custom_color_add), - (GSignalAccumulator) NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, - 1, G_TYPE_POINTER); -} - -static void -color_group_init (ColorGroup *cg) -{ - cg->name = NULL; - cg->history = NULL; - cg->history_size = 0; -} - -E_MAKE_TYPE(color_group, - "ColorGroup", - ColorGroup, - color_group_class_init, - color_group_init, - PARENT_TYPE) - - -/* Hash table used to ensure unicity in newly created names*/ -static GHashTable *group_names = NULL; - -static guint -cg_hash (gconstpointer key) -{ - /* Do NOT use smart type checking it will not work for the tmp_key */ - return g_str_hash (((ColorGroup *)key)->name); -} - -static gint -cg_cmp (gconstpointer a, gconstpointer b) -{ - /* Do NOT use smart type checking it will not work for the tmp_key */ - ColorGroup const *cg_a = (ColorGroup *)a; - ColorGroup const *cg_b = (ColorGroup *)b; - if (cg_a == cg_b) - return TRUE; - if (cg_a->context != cg_b->context) - return FALSE; - return g_str_equal (cg_a->name, cg_b->name); -} - -static void -initialize_group_names (void) -{ - g_assert (group_names == NULL); - group_names = g_hash_table_new (cg_hash, cg_cmp); -} - -/** - * color_group_get : - * @name : - * @context : - * - * Look up the name/context specific color-group. Return NULL if it is not found. - * No reference is added if it is found. - */ -ColorGroup * -color_group_get (const gchar * name, gpointer context) -{ - ColorGroup tmp_key; - gpointer res; - - g_assert(group_names); - - g_return_val_if_fail(name != NULL, NULL); - - tmp_key.name = (char *)name; - tmp_key.context = context; - res = g_hash_table_lookup (group_names, &tmp_key); - - if (res != NULL) - return COLOR_GROUP (res); - else - return NULL; -} - -static gchar * -create_unique_name (gpointer context) -{ - const gchar *prefix = "__cg_autogen_name__"; - static gint latest_suff = 0; - gchar *new_name; - - for(;;latest_suff++) { - new_name = g_strdup_printf("%s%i", prefix, latest_suff); - if (color_group_get (new_name, context) == NULL) - return new_name; - else - g_free(new_name); - } - g_assert_not_reached(); -} - -static void -color_group_finalize (GObject *obj) -{ - ColorGroup *cg; - - g_return_if_fail(obj != NULL); - g_return_if_fail(IS_COLOR_GROUP(obj)); - g_assert(group_names != NULL); - - cg = COLOR_GROUP (obj); - - /* make this name available */ - if (cg->name) { - g_hash_table_remove (group_names, cg); - g_free (cg->name); - cg->name = NULL; - } - - if (cg->history) { - /* Free the whole colour history */ - while ((int) cg->history->len > 0) - gdk_color_free ((GdkColor *) - g_ptr_array_remove_index (cg->history, 0)); - g_ptr_array_free (cg->history, TRUE); - cg->history = NULL; - } - - if (parent_class->finalize) - (parent_class->finalize) (obj); -} - -/* - * color_group_get_history_size: - * Get the size of the custom color history - */ -gint -color_group_get_history_size (ColorGroup *cg) -{ - g_return_val_if_fail (cg != NULL, 0); - - return cg->history_size; -} - -/* - * Change the size of the custom color history. - */ -void -color_group_set_history_size (ColorGroup *cg, gint size) -{ - g_return_if_fail(cg != NULL); - g_return_if_fail(size >= 0); - - /* Remove excess elements (begin with kicking out the oldest) */ - while ((int) cg->history->len > size) - gdk_color_free ((GdkColor *) g_ptr_array_remove_index (cg->history, 0)); -} - -/* - * color_group_fetch : - * @name : - * @context : - * - * if name is NULL or a name not currently in use by another group - * then a new group is created and returned. If name was NULL - * then the new group is given a unique name prefixed by "__cg_autogen_name__" - * (thereby insuring namespace separation). - * If name was already used by a group then the reference count is - * incremented and a pointer to the group is returned. - */ -ColorGroup * -color_group_fetch (const gchar *name, gpointer context) -{ - ColorGroup *cg; - gchar *new_name; - - if (group_names == NULL) - initialize_group_names(); - - if (name == NULL) - new_name = create_unique_name (context); - else - new_name = g_strdup (name); - - cg = color_group_get (new_name, context); - if (cg != NULL) { - g_free (new_name); - g_object_ref (G_OBJECT (cg)); - return cg; - } - - /* Take care of creating the new object */ - cg = g_object_new (color_group_get_type (), NULL); - g_return_val_if_fail(cg != NULL, NULL); - - cg->name = new_name; - cg->context = context; - - /* Create history */ - cg->history = g_ptr_array_new (); - - /* FIXME: Why not 8? We never use more then 8 on the palette, - * maybe we can't free colors while they are still on the palette and - * need to be sure they are not on it when we free them and thus we - * make the upper limit twice the size of the number of displayed items - * (2 * 8) ? - */ - cg->history_size = 16; - - /* lastly register this name */ - g_hash_table_insert (group_names, cg, cg); - - return cg; -} - -/* - * color_group_get_custom_colors: - * Retrieve all custom colors currently in the history using a callback - * mechanism. The custom colors will be passed from the oldest to the newest. - */ -void -color_group_get_custom_colors (ColorGroup *cg, CbCustomColors callback, gpointer user_data) -{ - int i; - - g_return_if_fail (cg != NULL); - - /* Invoke the callback for our full history */ - for (i = 0; i < (int) cg->history->len; i++) { - GdkColor const * const color = g_ptr_array_index (cg->history, i); - - callback (color, user_data); - } -} - -/* - * color_group_add_color: - * Changes the colors. The color to be set should always be a custom - * color! It has no use adding a color which is already in the default - * palette. - */ -void -color_group_add_color (ColorGroup *cg, GdkColor const * const color) -{ - int i; - - g_return_if_fail(cg != NULL); - g_return_if_fail(color != NULL); /* Can't be NULL */ - - /* Let's be smart and see if it's already in our history, no need to add it again*/ - for (i = 0; i < (int) cg->history->len; i++) { - GdkColor *current = g_ptr_array_index (cg->history, i); - - if (gdk_color_equal (color, current)) - return; - } - - /* - * We make our own private copy of the color passed and put - * it in the history, this is freed later. - */ - if (cg->history_size > 0) - g_ptr_array_add (cg->history, gdk_color_copy (color)); - - /* Shift out the oldest item if we grow beyond our set size */ - if ((int) cg->history->len > cg->history_size) - gdk_color_free ((GdkColor *) g_ptr_array_remove_index (cg->history, 0)); - - /* Tell color-palette's that use this group that - * a new custom color was added. - */ - g_signal_emit (G_OBJECT(cg), - color_group_signals [CUSTOM_COLOR_ADD], - 0, - color); -} diff --git a/glabels2/src/mygal/color-group.h b/glabels2/src/mygal/color-group.h deleted file mode 100644 index b35ad614..00000000 --- a/glabels2/src/mygal/color-group.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * color-group.h - Utility to keep a shered memory of custom colors - * between arbitrary widgets. - * Copyright 2000, Michael Levy - * Copyright 2001, Almer S. Tigelaar - * - * Authors: - * Michael Levy (mlevy@genoscope.cns.fr) - * Revised and polished by: - * Almer S. Tigelaar - * - * Modified for gLabels by: - * Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef GNOME_APP_LIB__COLOR_GROUP_H -#define GNOME_APP_LIB__COLOR_GROUP_H - -#include -#include -#include - -G_BEGIN_DECLS - -typedef gboolean (* CbCustomColors) (GdkColor const * const color, gpointer data); - -typedef struct _ColorGroup { - GObject parent; - - gchar *name; - gpointer context; - - GPtrArray *history; /* The custom color history */ - gint history_size; /* length of color_history */ -} ColorGroup; - -typedef struct { - GObjectClass parent_class; - - /* Signals emited by this object */ - void (*custom_color_add) (ColorGroup *color_group, GdkColor const * const color); -} ColorGroupClass; - -#define COLOR_GROUP_TYPE (color_group_get_type ()) -#define COLOR_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COLOR_GROUP_TYPE, ColorGroup)) -#define COLOR_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST (k), COLOR_GROUP_TYPE) -#define IS_COLOR_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COLOR_GROUP_TYPE)) - -GType color_group_get_type (void); -ColorGroup *color_group_fetch (const gchar *name, gpointer context); -ColorGroup *color_group_get (const gchar *name, gpointer context); - -void color_group_set_history_size (ColorGroup *cg, gint size); -gint color_group_get_history_size (ColorGroup *cg); - -void color_group_get_custom_colors (ColorGroup *cg, CbCustomColors callback, - gpointer user_data); -void color_group_add_color (ColorGroup *cg, GdkColor const * const color); - -G_END_DECLS - -#endif /* GNOME_APP_LIB__COLOR_GROUP_H */ diff --git a/glabels2/src/mygal/color-palette.c b/glabels2/src/mygal/color-palette.c deleted file mode 100644 index 49d47795..00000000 --- a/glabels2/src/mygal/color-palette.c +++ /dev/null @@ -1,661 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * color-palette.c - A color selector palette - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * This code was extracted from widget-color-combo.c - * written by Miguel de Icaza (miguel@kernel.org) and - * Dom Lachowicz (dominicl@seas.upenn.edu). The extracted - * code was re-packaged into a separate object by - * Michael Levy (mlevy@genoscope.cns.fr) - * And later revised and polished by - * Almer S. Tigelaar (almer@gnome.org) - * - * Modified for gLabels by: - * Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "e-util.h" -#include "color-group.h" -#include "color-palette.h" -#include "e-colors.h" - -#define COLOR_PREVIEW_WIDTH 15 -#define COLOR_PREVIEW_HEIGHT 15 - -enum { - COLOR_CHANGED, - LAST_SIGNAL -}; - -struct _ColorNamePair { - char *color; /* rgb color or otherwise - eg. "#FFFFFF" */ - char *name; /* english name - eg. "white" */ -}; - -static guint color_palette_signals [LAST_SIGNAL] = { 0, }; - -#define PARENT_TYPE GTK_TYPE_VBOX -static GObjectClass *color_palette_parent_class; - -#define make_color(P,COL) (((COL) != NULL) ? (COL) : ((P) ? ((P)->default_color) : NULL)) - -static void -color_palette_destroy (GtkObject *object) -{ - ColorPalette *P = COLOR_PALETTE (object); - GtkObjectClass *klass = (GtkObjectClass *)color_palette_parent_class; - - if (P->tool_tip) { - g_object_unref (P->tool_tip); - P->tool_tip = NULL; - } - - if (P->current_color) { - gdk_color_free (P->current_color); - P->current_color = NULL; - } - - color_palette_set_group (P, NULL); - - memset (P->items, 0, P->total * sizeof (GnomeCanvasItem *)); - - if (klass->destroy) - klass->destroy (object); -} - -static void -color_palette_finalize (GObject *object) -{ - ColorPalette *P = COLOR_PALETTE (object); - - g_free (P->items); - - (*color_palette_parent_class->finalize) (object); -} - -static void -color_palette_class_init (GObjectClass *object_class) -{ - object_class->finalize = color_palette_finalize; - ((GtkObjectClass *)object_class)->destroy = color_palette_destroy; - - color_palette_parent_class = g_type_class_peek_parent (object_class); - - color_palette_signals [COLOR_CHANGED] = - g_signal_new ("color_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ColorPaletteClass, color_changed), - NULL, NULL, - e_marshal_NONE__POINTER_BOOLEAN_BOOLEAN_BOOLEAN, - G_TYPE_NONE, 4, G_TYPE_POINTER, - G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); -} - -E_MAKE_TYPE (color_palette, - "ColorPalette", - ColorPalette, - color_palette_class_init, - NULL, - PARENT_TYPE) - -static void -emit_color_changed (ColorPalette *P, GdkColor *color, - gboolean custom, gboolean by_user, gboolean is_default) -{ - GdkColor *new = make_color (P, color); - - if (new != NULL) - new = gdk_color_copy (new); - if (P->current_color) - gdk_color_free (P->current_color); - P->current_color = new; - P->current_is_default = is_default; - - /* Only add custom colors to the group */ - if (custom && color) - color_group_add_color (P->color_group, color); - - g_signal_emit (P, color_palette_signals [COLOR_CHANGED], 0, - color, custom, by_user, is_default); -} - - -/* - * Add the new custom color as the first custom color in the custom color rows - * and shift all of the others 'one step down' - * - * Also take care of setting up the GtkColorButton 'display' - */ -static void -color_palette_change_custom_color (ColorPalette *P, GdkColor const * const new) -{ - int index; - GnomeCanvasItem *item; - GnomeCanvasItem *next_item; - - g_return_if_fail (P != NULL); - g_return_if_fail (new != NULL); - g_return_if_fail (P->picker); - - /* make sure there is room */ - if (P->custom_color_pos == -1) - return; - - for (index = P->custom_color_pos; index < P->total - 1; index++) { - GdkColor *color; - GdkColor *outline; - item = P->items[index]; - next_item = P->items[index + 1]; - - g_object_get (G_OBJECT (next_item), - "fill_color_gdk", &color, - "outline_color_gdk", &outline, - NULL); - gnome_canvas_item_set (item, - "fill_color_gdk", color, - "outline_color_gdk", outline, - NULL); - gdk_color_free (color); - gdk_color_free (outline); - } - item = P->items[index]; - gnome_canvas_item_set (item, - "fill_color_gdk", new, - "outline_color_gdk", new, - NULL); - gtk_color_button_set_color (P->picker, new); -} - -/* - * The custom color box was clicked. Find out its value and emit it - * And add it to the custom color row - */ -static void -cust_color_set (GtkWidget *color_picker, ColorPalette *P) -{ - GdkColor c_color; - - gtk_color_button_get_color (GTK_COLOR_BUTTON (color_picker), &c_color); - - e_color_alloc_gdk (NULL, &c_color); - emit_color_changed (P, &c_color, TRUE, TRUE, FALSE); -} - -static void -cb_default_clicked (GtkWidget *button, ColorPalette *P) -{ - emit_color_changed (P, P->default_color, FALSE, TRUE, TRUE); -} - -/* - * Something in our table was clicked. Find out what and emit it - */ -static void -color_clicked (GtkWidget *button, ColorPalette *P) -{ - int index; - GnomeCanvasItem *item; - GdkColor *gdk_color; - - index = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (button))); - item = P->items[index]; - - g_object_get (item, - "fill_color_gdk", &gdk_color, - NULL); - - emit_color_changed (P, gdk_color, FALSE, TRUE, FALSE); - - gdk_color_free (gdk_color); -} - -/* - * The color group sent the 'custom_color_add' signal - */ -static void -cb_group_custom_color_add (GtkObject *cg, GdkColor *color, ColorPalette *P) -{ - GdkColor *new; - - new = make_color (P, color); - color_palette_change_custom_color (P, new); -} - -/* - * Find out if a color is in the default palette (not in the custom colors!) - * - * Utility function - */ -static gboolean -color_in_palette (ColorNamePair *set, GdkColor *color) -{ - int i; - - g_return_val_if_fail (set != NULL, FALSE); - - if (color == NULL) - return TRUE; - - /* Iterator over all the colors and try to find - * if we can find @color - */ - for (i = 0; set[i].color != NULL; i++) { - GdkColor current; - - gdk_color_parse (set[i].color, ¤t); - - if (gdk_color_equal (color, ¤t)) - return TRUE; - } - - return FALSE; -} - -/* - * Create the individual color buttons - * - * Utility function - */ -static GnomeCanvasItem * -color_palette_button_new(ColorPalette *P, GtkTable* table, - GtkTooltips *tool_tip, ColorNamePair* color_name, - gint col, gint row, int data) -{ - GtkWidget *button; - GtkWidget *canvas; - GnomeCanvasItem *item; - - button = gtk_button_new (); - gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); - - canvas = gnome_canvas_new (); - - gtk_widget_set_usize (canvas, COLOR_PREVIEW_WIDTH, COLOR_PREVIEW_HEIGHT); - gtk_container_add (GTK_CONTAINER (button), canvas); - - item = gnome_canvas_item_new (GNOME_CANVAS_GROUP (gnome_canvas_root - (GNOME_CANVAS (canvas))), - gnome_canvas_rect_get_type (), - "x1", 0.0, - "y1", 0.0, - "x2", (double) COLOR_PREVIEW_WIDTH, - "y2", (double) COLOR_PREVIEW_HEIGHT, - "fill_color", color_name->color, - NULL); - - gtk_tooltips_set_tip (tool_tip, button, _(color_name->name), - "Private+Unused"); - - gtk_table_attach (table, button, - col, col+1, row, row+1, GTK_FILL, GTK_FILL, 1, 1); - - g_signal_connect (button, "clicked", - G_CALLBACK (color_clicked), P); - gtk_object_set_user_data (GTK_OBJECT (button), - GINT_TO_POINTER (data)); - return item; -} - -static void -cb_custom_colors (GdkColor const * const color, gpointer data) -{ - ColorPalette *P = data; - - if (color) - color_palette_change_custom_color (P, color); -} - -/* - * gets history information from the group - */ -static void -custom_color_history_setup(ColorPalette *P) -{ - g_return_if_fail (P != NULL); - g_return_if_fail (P->color_group != NULL); - - /* Sync our own palette with all the custom colors in the group */ - color_group_get_custom_colors (P->color_group, (CbCustomColors) cb_custom_colors, P); -} - -/* - * Creates the color table - */ -static GtkWidget * -color_palette_setup (ColorPalette *P, - char const * const no_color_label, - int ncols, int nrows, - ColorNamePair *color_names) -{ - GtkWidget *default_button; - GtkWidget *cust_label; - GtkWidget *table; - GtkTooltips *tool_tip; - int total, row, col; - - table = gtk_table_new (ncols, nrows, FALSE); - - if (no_color_label != NULL) { - default_button = gtk_button_new_with_label (no_color_label); - - gtk_table_attach (GTK_TABLE (table), default_button, - 0, ncols, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); - g_signal_connect (default_button, "clicked", - G_CALLBACK (cb_default_clicked), P); - } - - P->tool_tip = tool_tip = gtk_tooltips_new (); - g_object_ref (P->tool_tip); - gtk_object_sink (GTK_OBJECT (P->tool_tip)); - - P->custom_color_pos = -1; - total = 0; - - for (row = 0; row < nrows; row++) { - for (col = 0; col < ncols; col++) { - int pos; - - pos = row * ncols + col; - /* - * If we are done with all of the colors in color_names - */ - if (color_names [pos].color == NULL) { - /* This is the default custom color */ - ColorNamePair color_name = {"#000", N_("custom")}; - row++; - if (col == 0 || row < nrows) { - /* Add a full row for custom colors */ - for (col = 0; col < ncols; col++) { - /* Have we set custom pos yet ? */ - if (P->custom_color_pos == -1) { - P->custom_color_pos = total; - } - P->items[total] = - color_palette_button_new( - P, - GTK_TABLE (table), - GTK_TOOLTIPS (tool_tip), - &(color_name), - col, - row + 1, - total); - total++; - } - } - /* Break out of two for-loops. */ - row = nrows; - break; - } - - P->items[total] = - color_palette_button_new ( - P, - GTK_TABLE (table), - GTK_TOOLTIPS (tool_tip), - &(color_names [pos]), - col, - row + 1, - total); - total++; - } - } - P->total = total; - - - /* "Custom" color - we'll pop up a GtkColorButton */ - cust_label = gtk_label_new (_("Custom Color:")); - gtk_table_attach (GTK_TABLE (table), cust_label, 0, ncols - 3 , - row + 1, row + 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); - /* - Keep a pointer to the picker so that we can update it's color - to keep it in synch with that of other members of the group - */ - P->picker = GTK_COLOR_BUTTON (gtk_color_button_new ()); - gtk_color_button_set_title (P->picker, _("Choose Custom Color")); - gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (P->picker), ncols - 3, ncols, - row + 1, row + 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); - g_signal_connect (P->picker, "color-set", - G_CALLBACK (cust_color_set), P); - return table; -} - -void -color_palette_set_color_to_default (ColorPalette *P) -{ - g_return_if_fail (P != NULL); - g_return_if_fail (IS_COLOR_GROUP (P->color_group)); - - emit_color_changed (P, P->default_color, FALSE, TRUE, TRUE); -} - -void -color_palette_set_current_color (ColorPalette *P, GdkColor *color) -{ - g_return_if_fail (P != NULL); - g_return_if_fail (IS_COLOR_GROUP (P->color_group)); - - if (color) - emit_color_changed - (P, color, color_in_palette (P->default_set, color), - FALSE, FALSE); - else - color_palette_set_color_to_default (P); -} - -GdkColor * -color_palette_get_current_color (ColorPalette *P, gboolean *is_default) -{ - g_return_val_if_fail (P != NULL, NULL); - g_return_val_if_fail (IS_COLOR_GROUP (P->color_group), NULL); - - if (is_default != NULL) - *is_default = P->current_is_default; - - return P->current_color ? gdk_color_copy (P->current_color) : NULL; -} - -GtkWidget * -color_palette_get_color_picker (ColorPalette *P) -{ - g_return_val_if_fail (IS_COLOR_PALETTE (P), NULL); - - return GTK_WIDGET (P->picker); -} - - -/* - * Where the actual construction goes on - */ -static void -color_palette_construct (ColorPalette *P, - char const * const no_color_label, - int ncols, int nrows) -{ - GtkWidget * table; - g_return_if_fail (P != NULL); - g_return_if_fail (IS_COLOR_PALETTE (P)); - - P->items = g_malloc (sizeof (GnomeCanvasItem *) * ncols * nrows); - - /* - * Our table selector - */ - table = color_palette_setup (P, no_color_label, ncols, - nrows, P->default_set); - gtk_container_add (GTK_CONTAINER(P), table); -} - -/* - * More verbose constructor. Allows for specifying the rows, columns, and - * Colors this palette will contain - * - * Note that if after placing all of the color_names there remains an entire - * row available then a row of custum colors (initialized to black) is added - * - */ -static GtkWidget* -color_palette_new_with_vals (char const * const no_color_label, - int ncols, int nrows, ColorNamePair *color_names, - GdkColor *default_color, - ColorGroup *cg) -{ - ColorPalette *P; - - g_return_val_if_fail (color_names != NULL, NULL); - - P = g_object_new (COLOR_PALETTE_TYPE, NULL); - - P->default_set = color_names; - P->default_color = default_color; - P->current_color = default_color ? gdk_color_copy (default_color) : NULL; - P->current_is_default = TRUE; - color_palette_set_group (P, cg); - - color_palette_construct (P, no_color_label, ncols, nrows); - custom_color_history_setup(P); - - return GTK_WIDGET (P); -} - -/** - * color_palette_set_group : absorbs the reference to the group - */ -void -color_palette_set_group (ColorPalette *P, ColorGroup *cg) -{ - if (P->color_group == cg) - return; - - if (P->color_group) { - g_signal_handlers_disconnect_by_func ( - G_OBJECT (P->color_group), - G_CALLBACK (cb_group_custom_color_add), - P); - g_object_unref (G_OBJECT (P->color_group)); - P->color_group = NULL; - } - if (cg != NULL) { - P->color_group = COLOR_GROUP (cg); - g_signal_connect (G_OBJECT (cg), "custom_color_add", - G_CALLBACK (cb_group_custom_color_add), - P); - - } -} - -static ColorNamePair default_color_set [] = { - {"#000000", N_("black")}, - {"#993300", N_("light brown")}, - {"#333300", N_("brown gold")}, - {"#003300", N_("dark green #2")}, - {"#003366", N_("navy")}, - {"#000080", N_("dark blue")}, - {"#333399", N_("purple #2")}, - {"#333333", N_("very dark gray")}, - - - {"#800000", N_("dark red")}, - {"#FF6600", N_("red-orange")}, - {"#808000", N_("gold")}, - {"#008000", N_("dark green")}, - {"#008080", N_("dull blue")}, - {"#0000FF", N_("blue")}, - {"#666699", N_("dull purple")}, - {"#808080", N_("dark grey")}, - - - {"#FF0000", N_("red")}, - {"#FF9900", N_("orange")}, - {"#99CC00", N_("lime")}, - {"#339966", N_("dull green")}, - {"#33CCCC",N_("dull blue #2")}, - {"#3366FF", N_("sky blue #2")}, - {"#800080", N_("purple")}, - {"#969696", N_("gray")}, - - - {"#FF00FF", N_("magenta")}, - {"#FFCC00", N_("bright orange")}, - {"#FFFF00", N_("yellow")}, - {"#00FF00", N_("green")}, - {"#00FFFF", N_("cyan")}, - {"#00CCFF", N_("bright blue")}, - {"#993366", N_("red purple")}, - {"#C0C0C0", N_("light grey")}, - - - {"#FF99CC", N_("pink")}, - {"#FFCC99", N_("light orange")}, - {"#FFFF99", N_("light yellow")}, - {"#CCFFCC", N_("light green")}, - {"#CCFFFF", N_("light cyan")}, - {"#99CCFF", N_("light blue")}, - {"#CC99FF", N_("light purple")}, - {"#FFFFFF", N_("white")}, - - /* Disable these for now, they are mostly repeats */ - {NULL, NULL}, - - {"#9999FF", N_("purplish blue")}, - {"#993366", N_("red purple")}, - {"#FFFFCC", N_("light yellow")}, - {"#CCFFFF", N_("light blue")}, - {"#660066", N_("dark purple")}, - {"#FF8080", N_("pink")}, - {"#0066CC", N_("sky blue")}, - {"#CCCCFF", N_("light purple")}, - - {"#000080", N_("dark blue")}, - {"#FF00FF", N_("magenta")}, - {"#FFFF00", N_("yellow")}, - {"#00FFFF", N_("cyan")}, - {"#800080", N_("purple")}, - {"#800000", N_("dark red")}, - {"#008080", N_("dull blue")}, - {"#0000FF", N_("blue")}, - - {NULL, NULL} -}; - - - -/* - * Default constructor. Pass an optional label for - * the no/auto color button. - * - */ -GtkWidget* -color_palette_new (const char *no_color_label, - GdkColor *default_color, ColorGroup *color_group) -{ - /* specify 6 rows to allow for a row of custom colors */ - return color_palette_new_with_vals (no_color_label, - 8, 6, - default_color_set, default_color, - color_group); -} diff --git a/glabels2/src/mygal/color-palette.h b/glabels2/src/mygal/color-palette.h deleted file mode 100644 index b2b281c7..00000000 --- a/glabels2/src/mygal/color-palette.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * color-palette.h - A color selector palette - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * This code was extracted from widget-color-combo.c - * written by Miguel de Icaza (miguel@kernel.org) and - * Dom Lachowicz (dominicl@seas.upenn.edu). The extracted - * code was re-packaged into a separate object by - * Michael Levy (mlevy@genoscope.cns.fr) - * And later revised and polished by - * Almer S. Tigelaar (almer@gnome.org) - * - * Modified for gLabels by: - * Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef GNUMERIC_COLOR_PALETTE_H -#define GNUMERIC_COLOR_PALETTE_H - -#include -#include -#include -#include -#include -#include "color-group.h" - -G_BEGIN_DECLS - -typedef struct _ColorNamePair ColorNamePair; - -typedef struct _ColorPalette { - GtkVBox vbox; - GtkTooltips *tool_tip; - GtkColorButton *picker; - /* - * Array of colors - */ - GnomeCanvasItem **items; - /* The (potentially NULL) default color */ - GdkColor *default_color; - - /* The current color */ - GdkColor *current_color; - gboolean current_is_default; - - /* - * Position of the last possible position - * for custom colors in **items - * (i.e. custom colors go from items[custom_color_pos] - * to items[total - 1]) - * - * If custom_color_pos == -1, there is no room for custom colors - */ - int custom_color_pos; - /* - * Number of default colors in **items - */ - int total; - - /* The table with our default color names */ - ColorNamePair *default_set; - - /* The color group to which we belong */ - ColorGroup *color_group; -} ColorPalette; - -typedef struct { - GtkVBoxClass parent_class; - - /* Signals emited by this widget */ - void (* color_changed) (ColorPalette *color_palette, GdkColor *color, - gboolean custom, gboolean by_user, gboolean is_default); -} ColorPaletteClass; - -#define COLOR_PALETTE_TYPE (color_palette_get_type ()) -#define COLOR_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), COLOR_PALETTE_TYPE, ColorPalette)) -#define COLOR_PALETTE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST(k), COLOR_PALETTE_TYPE) -#define IS_COLOR_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), COLOR_PALETTE_TYPE)) - -GtkType color_palette_get_type (void); - -GtkWidget *color_palette_new (const char *no_color_label, - GdkColor *default_color, - ColorGroup *color_group); -void color_palette_set_group (ColorPalette *P, - ColorGroup *cg); - -void color_palette_set_current_color (ColorPalette *P, GdkColor *color); -void color_palette_set_color_to_default (ColorPalette *P); -GdkColor *color_palette_get_current_color (ColorPalette *P, gboolean *is_default); -GtkWidget *color_palette_get_color_picker (ColorPalette *P); - -G_END_DECLS - -#endif /* GNUMERIC_PALETTE_H */ - - diff --git a/glabels2/src/mygal/e-colors.c b/glabels2/src/mygal/e-colors.c deleted file mode 100644 index fc4bf483..00000000 --- a/glabels2/src/mygal/e-colors.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-colors.c - General color allocation utilities - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Miguel de Icaza (miguel@kernel.org) - * - * Modified for gLabels by: - * Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -/* We keep our own color context, as the color allocation might take - * place before things are realized. - */ - -#include -#include -#include "e-colors.h" - -GdkColor e_white, e_dark_gray, e_black; - -gulong -e_color_alloc (gushort red, gushort green, gushort blue) -{ - e_color_init (); - - red >>= 8; - green >>= 8; - blue >>= 8; - return gdk_rgb_xpixel_from_rgb ( - ((red & 0xff) << 16) | ((green & 0xff) << 8) | - (blue & 0xff)); -} - -void -e_color_alloc_gdk (GtkWidget *widget, GdkColor *c) -{ - GdkColormap *map; - - e_color_init (); - - if (widget) - map = gtk_widget_get_colormap (widget); - else /* FIXME: multi depth broken ? */ - map = gtk_widget_get_default_colormap (); - - gdk_rgb_find_color (map, c); -} - -void -e_color_alloc_name (GtkWidget *widget, const char *name, GdkColor *c) -{ - GdkColormap *map; - - e_color_init (); - - gdk_color_parse (name, c); - - if (widget) - map = gtk_widget_get_colormap (widget); - else /* FIXME: multi depth broken ? */ - map = gtk_widget_get_default_colormap (); - - gdk_rgb_find_color (map, c); -} - -void -e_color_init (void) -{ - static gboolean e_color_inited = FALSE; - - /* It's surprisingly easy to end up calling this twice. Survive. */ - if (e_color_inited) - return; - - e_color_inited = TRUE; - - /* Allocate the default colors */ - e_white.red = 65535; - e_white.green = 65535; - e_white.blue = 65535; - e_color_alloc_gdk (NULL, &e_white); - - e_black.red = 0; - e_black.green = 0; - e_black.blue = 0; - e_color_alloc_gdk (NULL, &e_black); - - e_color_alloc_name (NULL, "gray20", &e_dark_gray); -} - diff --git a/glabels2/src/mygal/e-colors.h b/glabels2/src/mygal/e-colors.h deleted file mode 100644 index 13665046..00000000 --- a/glabels2/src/mygal/e-colors.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-colors.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Miguel de Icaza (miguel@kernel.org) - * - * Modified for gLabels by: - * Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef GNOME_APP_LIBS_COLOR_H -#define GNOME_APP_LIBS_COLOR_H - -#include -#include -#include - -G_BEGIN_DECLS - -void e_color_init (void); - -/* Return the pixel value for the given red, green and blue */ -gulong e_color_alloc (gushort red, gushort green, gushort blue); -void e_color_alloc_name (GtkWidget *widget, const char *name, GdkColor *color); -void e_color_alloc_gdk (GtkWidget *widget, GdkColor *color); - -extern GdkColor e_white, e_dark_gray, e_black; - -G_END_DECLS - -#endif /* GNOME_APP_LIBS_COLOR_H */ diff --git a/glabels2/src/mygal/e-marshal.list b/glabels2/src/mygal/e-marshal.list deleted file mode 100644 index 92496dbd..00000000 --- a/glabels2/src/mygal/e-marshal.list +++ /dev/null @@ -1,51 +0,0 @@ -BOOLEAN:INT,INT,OBJECT,INT,INT,UINT -BOOLEAN:INT,POINTER,INT,OBJECT,INT,INT,UINT -BOOLEAN:NONE -BOOLEAN:OBJECT -BOOLEAN:OBJECT,DOUBLE,DOUBLE,BOOLEAN -BOOLEAN:POINTER,POINTER,INT,INT,INT -BOOLEAN:POINTER,POINTER,POINTER,INT,INT,INT -BOOLEAN:STRING,INT -DOUBLE:OBJECT,DOUBLE,DOUBLE,BOOLEAN -INT:BOXED -INT:INT -INT:INT,INT,BOXED -INT:INT,POINTER,INT,BOXED -INT:OBJECT,BOXED -INT:POINTER -NONE:BOXED -NONE:BOXED,INT -NONE:BOXED,INT,INT -NONE:DOUBLE -NONE:INT -NONE:INT,INT -NONE:INT,INT,BOXED -NONE:INT,INT,OBJECT -NONE:INT,INT,OBJECT,BOXED,UINT,UINT -NONE:INT,INT,OBJECT,INT,INT,BOXED,UINT,UINT -NONE:INT,INT,OBJECT,POINTER,UINT,UINT -NONE:INT,INT,OBJECT,UINT -NONE:INT,INT,STRING,STRING -NONE:INT,INT,STRING,STRING,POINTER -NONE:INT,POINTER -NONE:INT,POINTER,INT,BOXED -NONE:INT,POINTER,INT,OBJECT -NONE:INT,POINTER,INT,OBJECT,BOXED,UINT,UINT -NONE:INT,POINTER,INT,OBJECT,INT,INT,BOXED,UINT,UINT -NONE:INT,POINTER,INT,OBJECT,UINT -NONE:INT,STRING -NONE:NONE -NONE:OBJECT -NONE:OBJECT,OBJECT -NONE:OBJECT,DOUBLE,DOUBLE,BOOLEAN -NONE:POINTER -NONE:POINTER,BOOLEAN -NONE:POINTER,BOOLEAN,BOOLEAN,BOOLEAN -NONE:POINTER,INT -NONE:POINTER,INT,INT -NONE:POINTER,INT,INT,INT -NONE:POINTER,INT,OBJECT -NONE:POINTER,POINTER -NONE:POINTER,POINTER,INT -OBJECT:OBJECT,DOUBLE,DOUBLE,BOOLEAN -POINTER:NONE diff --git a/glabels2/src/mygal/e-util.h b/glabels2/src/mygal/e-util.h deleted file mode 100644 index 7bc39783..00000000 --- a/glabels2/src/mygal/e-util.h +++ /dev/null @@ -1,234 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * e-util.h - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Chris Lahey - * - * Modified for gLabels by: - * Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef _E_UTIL_H_ -#define _E_UTIL_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include "e-marshal.h" - -#define E_MAKE_TYPE(l,str,t,ci,i,parent) \ -GType l##_get_type(void)\ -{\ - static GType type = 0; \ - if (!type){ \ - static GTypeInfo const object_info = { \ - sizeof (t##Class), \ - \ - (GBaseInitFunc) NULL, \ - (GBaseFinalizeFunc) NULL, \ - \ - (GClassInitFunc) ci, \ - (GClassFinalizeFunc) NULL, \ - NULL, /* class_data */ \ - \ - sizeof (t), \ - 0, /* n_preallocs */ \ - (GInstanceInitFunc) i, \ - }; \ - type = g_type_register_static (parent, str, &object_info, 0); \ - } \ - return type; \ -} - - -#define E_MAKE_X_TYPE(l,str,t,ci,i,parent,poa_init,offset) \ -GtkType l##_get_type(void) \ -{ \ - static GtkType type = 0; \ - if (!type){ \ - GTypeInfo info = { \ - sizeof (t##Class), \ - \ - (GBaseInitFunc) NULL, \ - (GBaseFinalizeFunc) NULL, \ - \ - (GClassInitFunc) ci, \ - (GClassFinalizeFunc) NULL, \ - \ - NULL, /* class_data */ \ - \ - sizeof (t), \ - 0, /* n_preallocs */ \ - (GInstanceInitFunc) i, \ - }; \ - type = bonobo_x_type_unique ( \ - parent, poa_init, NULL, \ - offset, &info, str); \ - } \ - return type; \ -} - -#define GET_STRING_ARRAY_FROM_ELLIPSIS(labels, first_string) \ - { \ - va_list args; \ - int i; \ - char *s; \ - \ - va_start (args, (first_string)); \ - \ - i = 0; \ - for (s = (first_string); s; s = va_arg (args, char *)) \ - i++; \ - va_end (args); \ - \ - (labels) = g_new (char *, i + 1); \ - \ - va_start (args, (first_string)); \ - i = 0; \ - for (s = (first_string); s; s = va_arg (args, char *)) \ - (labels)[i++] = s; \ - \ - va_end (args); \ - (labels)[i] = NULL; \ - } - - -#define GET_DUPLICATED_STRING_ARRAY_FROM_ELLIPSIS(labels, first_string) \ - { \ - int i; \ - GET_STRING_ARRAY_FROM_ELLIPSIS ((labels), (first_string)); \ - for (i = 0; labels[i]; i++) \ - labels[i] = g_strdup (labels[i]); \ - } - - -#if 0 -# define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last) \ - gtk_object_class_add_signals (oc, sigs, last) -# define E_OBJECT_CLASS_TYPE(oc) (oc)->type -#else -# define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last) -# define E_OBJECT_CLASS_TYPE(oc) G_TYPE_FROM_CLASS (oc) -#endif - - -typedef enum { - E_FOCUS_NONE, - E_FOCUS_CURRENT, - E_FOCUS_START, - E_FOCUS_END -} EFocus; -int g_str_compare (const void *x, - const void *y); -int g_collate_compare (const void *x, - const void *y); -int g_int_compare (const void *x, - const void *y); -char *e_strdup_strip (const char *string); -void e_free_object_list (GList *list); -void e_free_object_slist (GSList *list); -void e_free_string_list (GList *list); -void e_free_string_slist (GSList *list); -char *e_read_file (const char *filename); -int e_write_file (const char *filename, - const char *data, - int flags); -int e_write_file_mkstemp (char *filename, - const char *data); -int e_mkdir_hier (const char *path, - mode_t mode); - -gchar **e_strsplit (const gchar *string, - const gchar *delimiter, - gint max_tokens); -gchar *e_strstrcase (const gchar *haystack, - const gchar *needle); -/* This only makes a filename safe for usage as a filename. It still may have shell meta-characters in it. */ -void e_filename_make_safe (gchar *string); -gchar *e_format_number (gint number); -gchar *e_format_number_float (gfloat number); -gboolean e_create_directory (gchar *directory); -gchar **e_strdupv (const gchar **str_array); - - -typedef int (*ESortCompareFunc) (const void *first, - const void *second, - gpointer closure); -void e_sort (void *base, - size_t nmemb, - size_t size, - ESortCompareFunc compare, - gpointer closure); -void e_bsearch (const void *key, - const void *base, - size_t nmemb, - size_t size, - ESortCompareFunc compare, - gpointer closure, - size_t *start, - size_t *end); -size_t e_strftime_fix_am_pm (char *s, - size_t max, - const char *fmt, - const struct tm *tm); - -size_t e_strftime (char *s, - size_t max, - const char *fmt, - const struct tm *tm); - -size_t e_utf8_strftime_fix_am_pm (char *s, - size_t max, - const char *fmt, - const struct tm *tm); - -size_t e_utf8_strftime (char *s, - size_t max, - const char *fmt, - const struct tm *tm); - -/* String to/from double conversion functions */ -gdouble e_flexible_strtod (const gchar *nptr, - gchar **endptr); - -/* 29 bytes should enough for all possible values that - * g_ascii_dtostr can produce with the %.17g format. - * Then add 10 for good measure */ -#define E_ASCII_DTOSTR_BUF_SIZE (DBL_DIG + 12 + 10) -gchar *e_ascii_dtostr (gchar *buffer, - gint buf_len, - const gchar *format, - gdouble d); - -/* Alternating char * and int arguments with a NULL char * to end. - Less than 0 for the int means copy the whole string. */ -gchar *e_strdup_append_strings (gchar *first_string, - ...); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _E_UTIL_H_ */ diff --git a/glabels2/src/mygal/mygal-combo-box.c b/glabels2/src/mygal/mygal-combo-box.c deleted file mode 100644 index adf1c648..00000000 --- a/glabels2/src/mygal/mygal-combo-box.c +++ /dev/null @@ -1,837 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * mygal-combo-box.c - a customizable combobox - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Miguel de Icaza (miguel@gnu.org) - * Adrian E Feiguin (feiguin@ifir.edu.ar) - * Paolo Molnaro (lupus@debian.org). - * Jon K Hellan (hellan@acm.org) - * - * Modified for gLabels by: - * Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "mygal-combo-box.h" -#include "e-util.h" - -#define PARENT_TYPE GTK_TYPE_HBOX -static GObjectClass *mygal_combo_box_parent_class; - -static int mygal_combo_toggle_pressed (GtkToggleButton *tbutton, - MygalComboBox *combo_box); -static void mygal_combo_popup_tear_off (MygalComboBox *combo, - gboolean set_position); -static void mygal_combo_set_tearoff_state (MygalComboBox *combo, - gboolean torn_off); -static void mygal_combo_popup_reparent (GtkWidget *popup, GtkWidget *new_parent, - gboolean unrealize); -static gboolean cb_popup_delete (GtkWidget *w, GdkEventAny *event, - MygalComboBox *combo); -static void mygal_combo_tearoff_bg_copy (MygalComboBox *combo); - -enum { - POP_DOWN_WIDGET, - POP_DOWN_DONE, - PRE_POP_DOWN, - POST_POP_HIDE, - LAST_SIGNAL -}; - -static guint mygal_combo_box_signals [LAST_SIGNAL] = { 0, }; - -struct _MygalComboBoxPrivate { - GtkWidget *pop_down_widget; - GtkWidget *display_widget; - - /* - * Internal widgets used to implement the ComboBox - */ - GtkWidget *frame; - GtkWidget *arrow_button; - - GtkWidget *toplevel; /* Popup's toplevel when not torn off */ - GtkWidget *tearoff_window; /* Popup's toplevel when torn off */ - guint torn_off; - - GtkWidget *tearable; /* The tearoff "button" */ - GtkWidget *popup; /* Popup */ - - /* - * Closure for invoking the callbacks above - */ - void *closure; -}; - -static void -mygal_combo_box_finalize (GObject *object) -{ - MygalComboBox *combo_box = MYGAL_COMBO_BOX (object); - - g_free (combo_box->priv); - - mygal_combo_box_parent_class->finalize (object); -} - -static void -mygal_combo_box_destroy (GtkObject *object) -{ - GtkObjectClass *klass = (GtkObjectClass *)mygal_combo_box_parent_class; - MygalComboBox *combo_box = MYGAL_COMBO_BOX (object); - - if (combo_box->priv->toplevel) { - gtk_object_destroy (GTK_OBJECT (combo_box->priv->toplevel)); - combo_box->priv->toplevel = NULL; - } - - if (combo_box->priv->tearoff_window) { - gtk_object_destroy (GTK_OBJECT (combo_box->priv->tearoff_window)); - combo_box->priv->tearoff_window = NULL; - } - - if (klass->destroy) - klass->destroy (object); -} - -static gboolean -mygal_combo_box_mnemonic_activate (GtkWidget *w, gboolean group_cycling) -{ - MygalComboBox *combo_box = MYGAL_COMBO_BOX (w); - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON (combo_box->priv->arrow_button), TRUE); - return TRUE; -} - -static void -mygal_combo_box_class_init (GObjectClass *object_class) -{ - GtkWidgetClass *widget_class = (GtkWidgetClass *)object_class; - mygal_combo_box_parent_class = g_type_class_peek_parent (object_class); - - object_class->finalize = mygal_combo_box_finalize; - widget_class->mnemonic_activate = mygal_combo_box_mnemonic_activate; - ((GtkObjectClass *)object_class)->destroy = mygal_combo_box_destroy; - - mygal_combo_box_signals [POP_DOWN_WIDGET] = g_signal_new ( - "pop_down_widget", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (MygalComboBoxClass, pop_down_widget), - NULL, NULL, - e_marshal_POINTER__NONE, - G_TYPE_POINTER, 0, G_TYPE_NONE); - - mygal_combo_box_signals [POP_DOWN_DONE] = g_signal_new ( - "pop_down_done", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (MygalComboBoxClass, pop_down_done), - NULL, NULL, - e_marshal_BOOLEAN__OBJECT, - G_TYPE_BOOLEAN, 1, G_TYPE_OBJECT); - - mygal_combo_box_signals [PRE_POP_DOWN] = g_signal_new ( - "pre_pop_down", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (MygalComboBoxClass, pre_pop_down), - NULL, NULL, - e_marshal_NONE__NONE, - G_TYPE_NONE, 0); - - mygal_combo_box_signals [POST_POP_HIDE] = g_signal_new ( - "post_pop_hide", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (MygalComboBoxClass, post_pop_hide), - NULL, NULL, - e_marshal_NONE__NONE, - G_TYPE_NONE, 0); -} - -static void -deactivate_arrow (MygalComboBox *combo_box) -{ - GtkToggleButton *arrow; - - arrow = GTK_TOGGLE_BUTTON (combo_box->priv->arrow_button); - g_signal_handlers_block_matched (arrow, - G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, - 0, 0, NULL, - mygal_combo_toggle_pressed, combo_box); - - gtk_toggle_button_set_active (arrow, FALSE); - - g_signal_handlers_unblock_matched (arrow, - G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, - 0, 0, NULL, - mygal_combo_toggle_pressed, combo_box); -} - -/** - * mygal_combo_box_popup_hide_unconditional - * @combo_box: Combo box - * - * Hide popup, whether or not it is torn off. - */ -static void -mygal_combo_box_popup_hide_unconditional (MygalComboBox *combo_box) -{ - gboolean popup_info_destroyed = FALSE; - - g_return_if_fail (combo_box != NULL); - g_return_if_fail (MYGAL_IS_COMBO_BOX (combo_box)); - - gtk_widget_hide (combo_box->priv->toplevel); - gtk_widget_hide (combo_box->priv->popup); - if (combo_box->priv->torn_off) { - GTK_TEAROFF_MENU_ITEM (combo_box->priv->tearable)->torn_off - = FALSE; - mygal_combo_set_tearoff_state (combo_box, FALSE); - } - - gtk_grab_remove (combo_box->priv->toplevel); - gdk_pointer_ungrab (GDK_CURRENT_TIME); - - g_object_ref (combo_box->priv->pop_down_widget); - g_signal_emit (combo_box, - mygal_combo_box_signals [POP_DOWN_DONE], 0, - combo_box->priv->pop_down_widget, &popup_info_destroyed); - - if (popup_info_destroyed){ - gtk_container_remove ( - GTK_CONTAINER (combo_box->priv->frame), - combo_box->priv->pop_down_widget); - combo_box->priv->pop_down_widget = NULL; - } - g_object_unref (combo_box->priv->pop_down_widget); - deactivate_arrow (combo_box); - - g_signal_emit (combo_box, mygal_combo_box_signals [POST_POP_HIDE], 0); -} - -/** - * mygal_combo_box_popup_hide: - * @combo_box: Combo box - * - * Hide popup, but not when it is torn off. - * This is the external interface - for subclasses and apps which expect a - * regular combo which doesn't do tearoffs. - */ -void -mygal_combo_box_popup_hide (MygalComboBox *combo_box) -{ - if (!combo_box->priv->torn_off) - mygal_combo_box_popup_hide_unconditional (combo_box); - else if (GTK_WIDGET_VISIBLE (combo_box->priv->toplevel)) { - /* Both popup and tearoff window present. Get rid of just - the popup shell. */ - mygal_combo_popup_tear_off (combo_box, FALSE); - deactivate_arrow (combo_box); - } -} - -/* - * Find best location for displaying - */ -void -mygal_combo_box_get_pos (MygalComboBox *combo_box, int *x, int *y) -{ - GtkWidget *wcombo = GTK_WIDGET (combo_box); - int ph, pw; - - gdk_window_get_origin (wcombo->window, x, y); - *y += wcombo->allocation.height + wcombo->allocation.y; - *x += wcombo->allocation.x; - - ph = combo_box->priv->popup->allocation.height; - pw = combo_box->priv->popup->allocation.width; - - if ((*y + ph) > gdk_screen_height ()) - *y = gdk_screen_height () - ph; - - if ((*x + pw) > gdk_screen_width ()) - *x = gdk_screen_width () - pw; -} - -static void -mygal_combo_box_popup_display (MygalComboBox *combo_box) -{ - int x, y; - - g_return_if_fail (combo_box != NULL); - g_return_if_fail (MYGAL_IS_COMBO_BOX (combo_box)); - - /* - * If we have no widget to display on the popdown, - * create it - */ - if (!combo_box->priv->pop_down_widget){ - GtkWidget *pw = NULL; - - g_signal_emit (combo_box, - mygal_combo_box_signals [POP_DOWN_WIDGET], 0, &pw); - g_assert (pw != NULL); - combo_box->priv->pop_down_widget = pw; - gtk_container_add (GTK_CONTAINER (combo_box->priv->frame), pw); - } - - g_signal_emit (combo_box, mygal_combo_box_signals [PRE_POP_DOWN], 0); - - if (combo_box->priv->torn_off) { - /* To give the illusion that tearoff still displays the - * popup, we copy the image in the popup window to the - * background. Thus, it won't be blank after reparenting */ - mygal_combo_tearoff_bg_copy (combo_box); - - /* We force an unrealize here so that we don't trigger - * redrawing/ clearing code - we just want to reveal our - * backing pixmap. - */ - mygal_combo_popup_reparent (combo_box->priv->popup, - combo_box->priv->toplevel, TRUE); - } - - mygal_combo_box_get_pos (combo_box, &x, &y); - - gtk_widget_set_uposition (combo_box->priv->toplevel, x, y); - gtk_widget_realize (combo_box->priv->popup); - gtk_widget_show (combo_box->priv->popup); - gtk_widget_realize (combo_box->priv->toplevel); - gtk_widget_show (combo_box->priv->toplevel); - - gtk_grab_add (combo_box->priv->toplevel); - gdk_pointer_grab (combo_box->priv->toplevel->window, TRUE, - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_POINTER_MOTION_MASK, - NULL, NULL, GDK_CURRENT_TIME); -} - -static int -mygal_combo_toggle_pressed (GtkToggleButton *tbutton, MygalComboBox *combo_box) -{ - if (tbutton->active) - mygal_combo_box_popup_display (combo_box); - else - mygal_combo_box_popup_hide_unconditional (combo_box); - - return TRUE; -} - -static gint -mygal_combo_box_button_press (GtkWidget *widget, GdkEventButton *event, MygalComboBox *combo_box) -{ - GtkWidget *child; - - child = gtk_get_event_widget ((GdkEvent *) event); - if (child != widget){ - while (child){ - if (child == widget) - return FALSE; - child = child->parent; - } - } - - mygal_combo_box_popup_hide (combo_box); - return TRUE; -} - -/** - * mygal_combo_box_key_press - * @widget: Widget - * @event: Event - * @combo_box: Combo box - * - * Key press handler which dismisses popup on escape. - * Popup is dismissed whether or not popup is torn off. - */ -static gint -mygal_combo_box_key_press (GtkWidget *widget, GdkEventKey *event, - MygalComboBox *combo_box) -{ - if (event->keyval == GDK_Escape) { - mygal_combo_box_popup_hide_unconditional (combo_box); - return TRUE; - } else - return FALSE; -} - -static void -cb_state_change (GtkWidget *widget, GtkStateType old_state, MygalComboBox *combo_box) -{ - GtkStateType const new_state = GTK_WIDGET_STATE(widget); - gtk_widget_set_state (combo_box->priv->display_widget, new_state); -} - -static void -mygal_combo_box_init (MygalComboBox *combo_box) -{ - GtkWidget *arrow; - GdkCursor *cursor; - - combo_box->priv = g_new0 (MygalComboBoxPrivate, 1); - - /* - * Create the arrow - */ - combo_box->priv->arrow_button = gtk_toggle_button_new (); - gtk_button_set_relief (GTK_BUTTON (combo_box->priv->arrow_button), GTK_RELIEF_NONE); - GTK_WIDGET_UNSET_FLAGS (combo_box->priv->arrow_button, GTK_CAN_FOCUS); - - arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN); - gtk_container_add (GTK_CONTAINER (combo_box->priv->arrow_button), arrow); - gtk_box_pack_end (GTK_BOX (combo_box), combo_box->priv->arrow_button, FALSE, FALSE, 0); - g_signal_connect (combo_box->priv->arrow_button, "toggled", - G_CALLBACK (mygal_combo_toggle_pressed), combo_box); - gtk_widget_show_all (combo_box->priv->arrow_button); - - /* - * prelight the display widget when mousing over the arrow. - */ - g_signal_connect (combo_box->priv->arrow_button, "state-changed", - G_CALLBACK (cb_state_change), combo_box); - - /* - * The pop-down container - */ - - combo_box->priv->toplevel = gtk_window_new (GTK_WINDOW_POPUP); - gtk_widget_ref (combo_box->priv->toplevel); - gtk_object_sink (GTK_OBJECT (combo_box->priv->toplevel)); - gtk_window_set_policy (GTK_WINDOW (combo_box->priv->toplevel), - FALSE, TRUE, FALSE); - - combo_box->priv->popup = gtk_event_box_new (); - gtk_container_add (GTK_CONTAINER (combo_box->priv->toplevel), - combo_box->priv->popup); - gtk_widget_show (combo_box->priv->popup); - - gtk_widget_realize (combo_box->priv->popup); - cursor = gdk_cursor_new (GDK_TOP_LEFT_ARROW); - gdk_window_set_cursor (combo_box->priv->popup->window, cursor); - gdk_cursor_unref (cursor); - - combo_box->priv->torn_off = FALSE; - combo_box->priv->tearoff_window = NULL; - - combo_box->priv->frame = gtk_frame_new (NULL); - gtk_container_add (GTK_CONTAINER (combo_box->priv->popup), - combo_box->priv->frame); - gtk_frame_set_shadow_type (GTK_FRAME (combo_box->priv->frame), GTK_SHADOW_OUT); - - g_signal_connect (combo_box->priv->toplevel, "button_press_event", - G_CALLBACK (mygal_combo_box_button_press), combo_box); - g_signal_connect (combo_box->priv->toplevel, "key_press_event", - G_CALLBACK (mygal_combo_box_key_press), combo_box); -} - -E_MAKE_TYPE (mygal_combo_box, - "MygalComboBox", - MygalComboBox, - mygal_combo_box_class_init, - mygal_combo_box_init, - PARENT_TYPE) - -/** - * mygal_combo_box_set_display: - * @combo_box: the Combo Box to modify - * @display_widget: The widget to be displayed - - * Sets the displayed widget for the @combo_box to be @display_widget - */ -void -mygal_combo_box_set_display (MygalComboBox *combo_box, GtkWidget *display_widget) -{ - g_return_if_fail (combo_box != NULL); - g_return_if_fail (MYGAL_IS_COMBO_BOX (combo_box)); - g_return_if_fail (display_widget != NULL); - g_return_if_fail (GTK_IS_WIDGET (display_widget)); - - if (combo_box->priv->display_widget && - combo_box->priv->display_widget != display_widget) - gtk_container_remove (GTK_CONTAINER (combo_box), - combo_box->priv->display_widget); - - combo_box->priv->display_widget = display_widget; - - gtk_box_pack_start (GTK_BOX (combo_box), display_widget, TRUE, TRUE, 0); -} - -static gboolean -cb_tearable_enter_leave (GtkWidget *w, GdkEventCrossing *event, gpointer data) -{ - gboolean const flag = GPOINTER_TO_INT(data); - gtk_widget_set_state (w, flag ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL); - return FALSE; -} - -/** - * mygal_combo_popup_tear_off - * @combo: Combo box - * @set_position: Set to position of popup shell if true - * - * Tear off the popup - * - * FIXME: - * Gtk popup menus are toplevel windows, not dialogs. I think this is wrong, - * and make the popups dialogs. But may be there should be a way to make - * them toplevel. We can do this after creating: - * GTK_WINDOW (tearoff)->type = GTK_WINDOW_TOPLEVEL; - */ -static void -mygal_combo_popup_tear_off (MygalComboBox *combo, gboolean set_position) -{ - int x, y; - - if (!combo->priv->tearoff_window) { - GtkWidget *tearoff; - gchar *title; - - /* FIXME: made this a toplevel, not a dialog ! */ - tearoff = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_ref (tearoff); - gtk_object_sink (GTK_OBJECT (tearoff)); - combo->priv->tearoff_window = tearoff; - gtk_widget_set_app_paintable (tearoff, TRUE); - g_signal_connect (tearoff, "key_press_event", - G_CALLBACK (mygal_combo_box_key_press), - combo); - gtk_widget_realize (tearoff); - title = g_object_get_data (G_OBJECT (combo), - "gtk-combo-title"); - if (title) - gdk_window_set_title (tearoff->window, title); - gtk_window_set_policy (GTK_WINDOW (tearoff), - FALSE, TRUE, FALSE); - gtk_window_set_transient_for - (GTK_WINDOW (tearoff), - GTK_WINDOW (gtk_widget_get_toplevel - GTK_WIDGET (combo))); - } - - if (GTK_WIDGET_VISIBLE (combo->priv->popup)) { - gtk_widget_hide (combo->priv->toplevel); - - gtk_grab_remove (combo->priv->toplevel); - gdk_pointer_ungrab (GDK_CURRENT_TIME); - } - - mygal_combo_popup_reparent (combo->priv->popup, - combo->priv->tearoff_window, FALSE); - - /* It may have got confused about size */ - gtk_widget_queue_resize (GTK_WIDGET (combo->priv->popup)); - - if (set_position) { - mygal_combo_box_get_pos (combo, &x, &y); - gtk_widget_set_uposition (combo->priv->tearoff_window, x, y); - } - gtk_widget_show (GTK_WIDGET (combo->priv->popup)); - gtk_widget_show (combo->priv->tearoff_window); - -} - -/** - * mygal_combo_set_tearoff_state - * @combo_box: Combo box - * @torn_off: TRUE: Tear off. FALSE: Pop down and reattach - * - * Set the tearoff state of the popup - * - * Compare with gtk_menu_set_tearoff_state in gtk/gtkmenu.c - */ -static void -mygal_combo_set_tearoff_state (MygalComboBox *combo, - gboolean torn_off) -{ - g_return_if_fail (combo != NULL); - g_return_if_fail (MYGAL_IS_COMBO_BOX (combo)); - - if (combo->priv->torn_off != torn_off) { - combo->priv->torn_off = torn_off; - - if (combo->priv->torn_off) { - mygal_combo_popup_tear_off (combo, TRUE); - deactivate_arrow (combo); - } else { - gtk_widget_hide (combo->priv->tearoff_window); - mygal_combo_popup_reparent (combo->priv->popup, - combo->priv->toplevel, - FALSE); - } - } -} - -/** - * mygal_combo_tearoff_bg_copy - * @combo_box: Combo box - * - * Copy popup window image to the tearoff window. - */ -static void -mygal_combo_tearoff_bg_copy (MygalComboBox *combo) -{ - GdkPixmap *pixmap; - GdkGC *gc; - GdkGCValues gc_values; - - GtkWidget *widget = combo->priv->popup; - - if (combo->priv->torn_off) { - gc_values.subwindow_mode = GDK_INCLUDE_INFERIORS; - gc = gdk_gc_new_with_values (widget->window, - &gc_values, GDK_GC_SUBWINDOW); - - pixmap = gdk_pixmap_new (widget->window, - widget->allocation.width, - widget->allocation.height, - -1); - - gdk_draw_drawable (pixmap, gc, - widget->window, - 0, 0, 0, 0, -1, -1); - gdk_gc_unref (gc); - - gtk_widget_set_usize (combo->priv->tearoff_window, - widget->allocation.width, - widget->allocation.height); - - gdk_window_set_back_pixmap - (combo->priv->tearoff_window->window, pixmap, FALSE); - gdk_drawable_unref (pixmap); - } -} - -/** - * mygal_combo_popup_reparent - * @popup: Popup - * @new_parent: New parent - * @unrealize: Unrealize popup if TRUE. - * - * Reparent the popup, taking care of the refcounting - * - * Compare with gtk_menu_reparent in gtk/gtkmenu.c - */ -static void -mygal_combo_popup_reparent (GtkWidget *popup, - GtkWidget *new_parent, - gboolean unrealize) -{ - GtkObject *object = GTK_OBJECT (popup); - gboolean was_floating = GTK_OBJECT_FLOATING (object); - - g_object_ref (object); - gtk_object_sink (object); - - if (unrealize) { - g_object_ref (object); - gtk_container_remove (GTK_CONTAINER (popup->parent), popup); - gtk_container_add (GTK_CONTAINER (new_parent), popup); - g_object_unref (object); - } - else - gtk_widget_reparent (GTK_WIDGET (popup), new_parent); - gtk_widget_set_usize (new_parent, -1, -1); - - if (was_floating) - GTK_OBJECT_SET_FLAGS (object, GTK_FLOATING); - else - g_object_unref (object); -} - -/** - * cb_tearable_button_release - * @w: Widget - * @event: Event - * @combo: Combo box - * - * Toggle tearoff state. - */ -static gboolean -cb_tearable_button_release (GtkWidget *w, GdkEventButton *event, - MygalComboBox *combo) -{ - GtkTearoffMenuItem *tearable; - - g_return_val_if_fail (w != NULL, FALSE); - g_return_val_if_fail (GTK_IS_TEAROFF_MENU_ITEM (w), FALSE); - - tearable = GTK_TEAROFF_MENU_ITEM (w); - tearable->torn_off = !tearable->torn_off; - - if (!combo->priv->torn_off) { - gboolean need_connect; - - need_connect = (!combo->priv->tearoff_window); - mygal_combo_set_tearoff_state (combo, TRUE); - if (need_connect) - g_signal_connect (combo->priv->tearoff_window, - "delete_event", - G_CALLBACK (cb_popup_delete), - combo); - } else - mygal_combo_box_popup_hide_unconditional (combo); - - return TRUE; -} - -static gboolean -cb_popup_delete (GtkWidget *w, GdkEventAny *event, MygalComboBox *combo) -{ - mygal_combo_box_popup_hide_unconditional (combo); - return TRUE; -} - -void -mygal_combo_box_construct (MygalComboBox *combo_box, GtkWidget *display_widget, GtkWidget *pop_down_widget) -{ - GtkWidget *tearable; - GtkWidget *vbox; - - g_return_if_fail (combo_box != NULL); - g_return_if_fail (MYGAL_IS_COMBO_BOX (combo_box)); - g_return_if_fail (display_widget != NULL); - g_return_if_fail (GTK_IS_WIDGET (display_widget)); - - GTK_BOX (combo_box)->spacing = 0; - GTK_BOX (combo_box)->homogeneous = FALSE; - - combo_box->priv->pop_down_widget = pop_down_widget; - combo_box->priv->display_widget = NULL; - - vbox = gtk_vbox_new (FALSE, 5); - tearable = gtk_tearoff_menu_item_new (); - g_signal_connect (tearable, "enter-notify-event", - G_CALLBACK (cb_tearable_enter_leave), - GINT_TO_POINTER (TRUE)); - g_signal_connect (tearable, "leave-notify-event", - G_CALLBACK (cb_tearable_enter_leave), - GINT_TO_POINTER (FALSE)); - g_signal_connect (tearable, "button-release-event", - G_CALLBACK (cb_tearable_button_release), - (gpointer) combo_box); - gtk_box_pack_start (GTK_BOX (vbox), tearable, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), pop_down_widget, TRUE, TRUE, 0); - combo_box->priv->tearable = tearable; - - /* - * Finish setup - */ - mygal_combo_box_set_display (combo_box, display_widget); - - gtk_container_add (GTK_CONTAINER (combo_box->priv->frame), vbox); - gtk_widget_show_all (combo_box->priv->frame); -} - -GtkWidget * -mygal_combo_box_new (GtkWidget *display_widget, GtkWidget *optional_popdown) -{ - MygalComboBox *combo_box; - - g_return_val_if_fail (display_widget != NULL, NULL); - g_return_val_if_fail (GTK_IS_WIDGET (display_widget), NULL); - - combo_box = g_object_new (MYGAL_COMBO_BOX_TYPE, NULL); - mygal_combo_box_construct (combo_box, display_widget, optional_popdown); - return GTK_WIDGET (combo_box); -} - -void -mygal_combo_box_set_arrow_relief (MygalComboBox *cc, GtkReliefStyle relief) -{ - g_return_if_fail (cc != NULL); - g_return_if_fail (MYGAL_IS_COMBO_BOX (cc)); - - gtk_button_set_relief (GTK_BUTTON (cc->priv->arrow_button), relief); -} - -/** - * mygal_combo_box_set_title - * @combo: Combo box - * @title: Title - * - * Set a title to display over the tearoff window. - * - * FIXME: - * - * This should really change the title even when the popup is already torn off. - * I guess the tearoff window could attach a listener to title change or - * something. But I don't think we need the functionality, so I didn't bother - * to investigate. - */ -void -mygal_combo_box_set_title (MygalComboBox *combo, - const gchar *title) -{ - g_return_if_fail (combo != NULL); - g_return_if_fail (MYGAL_IS_COMBO_BOX (combo)); - - g_object_set_data_full (G_OBJECT (combo), "gtk-combo-title", - g_strdup (title), (GDestroyNotify) g_free); -} - -/** - * mygal_combo_box_set_arrow_sensitive - * @combo: Combo box - * @sensitive: Sensitivity value - * - * Toggle the sensitivity of the arrow button - */ - -void -mygal_combo_box_set_arrow_sensitive (MygalComboBox *combo, - gboolean sensitive) -{ - g_return_if_fail (combo != NULL); - - gtk_widget_set_sensitive (combo->priv->arrow_button, sensitive); -} - -/** - * mygal_combo_box_set_tearable: - * @combo: Combo box - * @tearable: whether to allow the @combo to be tearable - * - * controls whether the combo box's pop up widget can be torn off. - */ -void -mygal_combo_box_set_tearable (MygalComboBox *combo, gboolean tearable) -{ - g_return_if_fail (combo != NULL); - g_return_if_fail (MYGAL_IS_COMBO_BOX (combo)); - - if (tearable){ - gtk_widget_show (combo->priv->tearable); - } else { - mygal_combo_set_tearoff_state (combo, FALSE); - gtk_widget_hide (combo->priv->tearable); - } -} diff --git a/glabels2/src/mygal/mygal-combo-box.h b/glabels2/src/mygal/mygal-combo-box.h deleted file mode 100644 index e1785f2d..00000000 --- a/glabels2/src/mygal/mygal-combo-box.h +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * mygal-combo-box.h - a customizable combobox - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Miguel de Icaza - * - * Modified for gLabels by: - * Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef _MYGAL_COMBO_BOX_H_ -#define _MYGAL_COMBO_BOX_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define MYGAL_COMBO_BOX_TYPE (mygal_combo_box_get_type()) -#define MYGAL_COMBO_BOX(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, mygal_combo_box_get_type (), MygalComboBox) -#define MYGAL_COMBO_BOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, mygal_combo_box_get_type (), MygalComboBoxClass) -#define MYGAL_IS_COMBO_BOX(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, mygal_combo_box_get_type ()) - -typedef struct _MygalComboBox MygalComboBox; -typedef struct _MygalComboBoxPrivate MygalComboBoxPrivate; -typedef struct _MygalComboBoxClass MygalComboBoxClass; - -struct _MygalComboBox { - GtkHBox hbox; - MygalComboBoxPrivate *priv; -}; - -struct _MygalComboBoxClass { - GtkHBoxClass parent_class; - - GtkWidget *(*pop_down_widget) (MygalComboBox *cbox); - - /* - * invoked when the popup has been hidden, if the signal - * returns TRUE, it means it should be killed from the - */ - gboolean *(*pop_down_done) (MygalComboBox *cbox, GtkWidget *); - - /* - * Notification signals. - */ - void (*pre_pop_down) (MygalComboBox *cbox); - void (*post_pop_hide) (MygalComboBox *cbox); -}; - -GtkType mygal_combo_box_get_type (void); -void mygal_combo_box_construct (MygalComboBox *combo_box, - GtkWidget *display_widget, - GtkWidget *optional_pop_down_widget); -void mygal_combo_box_get_pos (MygalComboBox *combo_box, int *x, int *y); - -GtkWidget *mygal_combo_box_new (GtkWidget *display_widget, - GtkWidget *optional_pop_down_widget); -void mygal_combo_box_popup_hide (MygalComboBox *combo_box); - -void mygal_combo_box_set_display (MygalComboBox *combo_box, - GtkWidget *display_widget); - -void mygal_combo_box_set_title (MygalComboBox *combo, - const gchar *title); - -void mygal_combo_box_set_tearable (MygalComboBox *combo, - gboolean tearable); -void mygal_combo_box_set_arrow_sensitive (MygalComboBox *combo, - gboolean sensitive); -void mygal_combo_box_set_arrow_relief (MygalComboBox *cc, - GtkReliefStyle relief); -#ifdef __cplusplus -}; -#endif /* __cplusplus */ - -#endif /* _MYGAL_COMBO_BOX_H_ */ diff --git a/glabels2/src/mygal/widget-color-combo.c b/glabels2/src/mygal/widget-color-combo.c deleted file mode 100644 index 8f365456..00000000 --- a/glabels2/src/mygal/widget-color-combo.c +++ /dev/null @@ -1,338 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * widget-color-combo.c - A color selector combo box - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Miguel de Icaza (miguel@kernel.org) - * Dom Lachowicz (dominicl@seas.upenn.edu) - * - * Reworked and split up into a separate ColorPalette object: - * Michael Levy (mlevy@genoscope.cns.fr) - * - * And later revised and polished by: - * Almer S. Tigelaar (almer@gnome.org) - * - * Modified for gLabels by: - * Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#include - -#include -#include -#include -#include "e-util.h" -#include "e-colors.h" -#include "widget-color-combo.h" - -enum { - CHANGED, - LAST_SIGNAL -}; - -static guint color_combo_signals [LAST_SIGNAL] = { 0, }; - -#define PARENT_TYPE MYGAL_COMBO_BOX_TYPE -static GObjectClass *color_combo_parent_class; - -#define make_color(CC,COL) (((COL) != NULL) ? (COL) : ((CC) ? ((CC)->default_color) : NULL)) -#define RGBA_TO_UINT(r,g,b,a) ((((guint)(r))<<24)|(((guint)(g))<<16)|(((guint)(b))<<8)|(guint)(a)) -#define GDK_TO_UINT(c) RGBA_TO_UINT(((c).red>>8), ((c).green>>8), ((c).blue>>8), 0xff) - -#define PREVIEW_SIZE 20 - -static void -color_combo_set_color_internal (ColorCombo *cc, GdkColor *color) -{ - guint color_y, color_height; - guint height, width; - GdkPixbuf *pixbuf; - GdkPixbuf *color_pixbuf; - GdkColor *new_color; - GdkColor *outline_color; - - new_color = make_color (cc,color); - /* If the new and the default are NULL draw an outline */ - outline_color = (new_color) ? new_color : &e_dark_gray; - - pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (cc->preview_image)); - - if (!pixbuf) - return; - - width = gdk_pixbuf_get_width (pixbuf); - height = gdk_pixbuf_get_height (pixbuf); - - if (cc->preview_is_icon) { - color_y = height - 4; - color_height = 4; - } - else { - color_y = 0; - color_height = height; - } - - color_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, - TRUE, 8, - width, - color_height); - gdk_pixbuf_fill (color_pixbuf, GDK_TO_UINT (*outline_color)); - gdk_pixbuf_copy_area (color_pixbuf, 0, 0, width, color_height, - pixbuf, 0, color_y); - - if (new_color != NULL) - gdk_pixbuf_fill (color_pixbuf, GDK_TO_UINT (*new_color)); - else - gdk_pixbuf_fill (color_pixbuf, 0xffffff00); - gdk_pixbuf_copy_area (color_pixbuf, 0, 0, width - 2, color_height -2, - pixbuf, 1, color_y + 1); - - g_object_unref (color_pixbuf); - - gtk_widget_queue_draw (GTK_WIDGET (cc)); -} - -static void -color_combo_class_init (GObjectClass *object_class) -{ - color_combo_parent_class = g_type_class_ref (PARENT_TYPE); - - color_combo_signals [CHANGED] = - g_signal_new ("color_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ColorComboClass, color_changed), - NULL, NULL, - e_marshal_NONE__POINTER_BOOLEAN_BOOLEAN_BOOLEAN, - G_TYPE_NONE, 4, G_TYPE_POINTER, - G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); -} - -E_MAKE_TYPE (color_combo, - "ColorCombo", - ColorCombo, - color_combo_class_init, - NULL, - PARENT_TYPE) - -/* - * Fires signal "color_changed" with the current color as its param - */ -static void -emit_color_changed (ColorCombo *cc, GdkColor *color, - gboolean is_custom, gboolean by_user, gboolean is_default) -{ - g_signal_emit (cc, - color_combo_signals [CHANGED], 0, - color, is_custom, by_user, is_default); - mygal_combo_box_popup_hide (MYGAL_COMBO_BOX (cc)); -} - -static void -cb_palette_color_changed (ColorPalette *P, GdkColor *color, - gboolean custom, gboolean by_user, gboolean is_default, - ColorCombo *cc) -{ - color_combo_set_color_internal (cc, color); - emit_color_changed (cc, color, custom, by_user, is_default); -} - -static void -preview_clicked (GtkWidget *button, ColorCombo *cc) -{ - gboolean is_default; - GdkColor *color = color_palette_get_current_color (cc->palette, &is_default); - emit_color_changed (cc, color, FALSE, TRUE, is_default); - if (color) - gdk_color_free (color); -} - -static void -cb_cust_color_clicked (GtkWidget *widget, ColorCombo *cc) -{ - mygal_combo_box_popup_hide (MYGAL_COMBO_BOX (cc)); -} - -/* - * Creates the color table - */ -static void -color_table_setup (ColorCombo *cc, - char const *no_color_label, ColorGroup *color_group) -{ - g_return_if_fail (cc != NULL); - - /* Tell the palette that we will be changing it's custom colors */ - cc->palette = - COLOR_PALETTE (color_palette_new (no_color_label, - cc->default_color, - color_group)); - - { - GtkWidget *picker = color_palette_get_color_picker (cc->palette); - g_signal_connect (picker, "clicked", - G_CALLBACK (cb_cust_color_clicked), cc); - } - - g_signal_connect (cc->palette, "color_changed", - G_CALLBACK (cb_palette_color_changed), cc); - - gtk_widget_show_all (GTK_WIDGET (cc->palette)); - - return; -} - -void -color_combo_box_set_preview_relief (ColorCombo *cc, GtkReliefStyle relief) -{ - g_return_if_fail (cc != NULL); - g_return_if_fail (IS_COLOR_COMBO (cc)); - - gtk_button_set_relief (GTK_BUTTON (cc->preview_button), relief); -} - -/* - * Where the actual construction goes on - */ -static void -color_combo_construct (ColorCombo *cc, GdkPixbuf *icon, - char const *no_color_label, - ColorGroup *color_group) -{ - GdkColor *color; - GdkPixbuf *pixbuf = NULL; - - g_return_if_fail (cc != NULL); - g_return_if_fail (IS_COLOR_COMBO (cc)); - - /* - * Our button with the gtk_image preview - */ - cc->preview_button = gtk_button_new (); - cc->preview_is_icon = FALSE; - - if (icon) - /* use icon only if size > 4*4 */ - if ((gdk_pixbuf_get_width (icon) > 4) && - (gdk_pixbuf_get_height (icon) > 4)) - { - cc->preview_is_icon = TRUE; - pixbuf = gdk_pixbuf_copy (icon); - } - - if (pixbuf == NULL) - pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, - TRUE, 8, - PREVIEW_SIZE, - PREVIEW_SIZE); - - cc->preview_image = gtk_image_new_from_pixbuf (pixbuf); - g_object_unref (pixbuf); - - gtk_button_set_relief (GTK_BUTTON (cc->preview_button), GTK_RELIEF_NONE); - gtk_widget_show (cc->preview_image); - - gtk_container_add (GTK_CONTAINER (cc->preview_button), cc->preview_image); - g_signal_connect (cc->preview_button, "clicked", - G_CALLBACK (preview_clicked), cc); - - color_table_setup (cc, no_color_label, color_group); - - gtk_widget_show_all (cc->preview_button); - - mygal_combo_box_construct (MYGAL_COMBO_BOX (cc), - cc->preview_button, - GTK_WIDGET (cc->palette)); - - mygal_combo_box_set_tearable (MYGAL_COMBO_BOX (cc), FALSE); - - color = color_palette_get_current_color (cc->palette, NULL); - color_combo_set_color_internal (cc, color); - if (color) gdk_color_free (color); -} - -/* color_combo_get_color: - * - * Return current color, result must be freed with gdk_color_free ! - */ -GdkColor * -color_combo_get_color (ColorCombo *cc, gboolean *is_default) -{ - return color_palette_get_current_color (cc->palette, is_default); -} - -/** - * color_combo_set_color - * @cc The combo - * @color The color - * - * Set the color of the combo to the given color. Causes the color_changed - * signal to be emitted. - */ -void -color_combo_set_color (ColorCombo *cc, GdkColor *color) -{ - /* This will change the color on the palette than it will invoke - * cb_palette_color_changed which will call emit_color_changed and - * set_color_internal which will change the color on our preview and - * will let the users of the combo know that the current color has - * changed - */ - if (color != NULL) - gdk_rgb_find_color (gtk_widget_get_colormap (GTK_WIDGET (cc)), color); - color_palette_set_current_color (cc->palette, color); -} - -/** - * color_combo_set_color_to_default - * @cc The combo - * - * Set the color of the combo to the default color. Causes the color_changed - * signal to be emitted. - */ -void -color_combo_set_color_to_default (ColorCombo *cc) -{ - color_palette_set_color_to_default (cc->palette); -} - -/** - * color_combo_new : - * icon : optionally NULL. - * , const char *no_color_label, - * Default constructor. Pass an optional icon and an optional label for the - * no/auto color button. - */ -GtkWidget * -color_combo_new (GdkPixbuf *icon, char const *no_color_label, - GdkColor *default_color, - ColorGroup *color_group) -{ - ColorCombo *cc; - - cc = g_object_new (COLOR_COMBO_TYPE, NULL); - - if ( default_color ) - { - cc->default_color = gdk_color_copy (default_color); - } - - color_combo_construct (cc, icon, no_color_label, color_group); - - return GTK_WIDGET (cc); -} diff --git a/glabels2/src/mygal/widget-color-combo.h b/glabels2/src/mygal/widget-color-combo.h deleted file mode 100644 index 3fb283c7..00000000 --- a/glabels2/src/mygal/widget-color-combo.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * widget-color-combo.h - A color selector combo box - * Copyright 2000, 2001, Ximian, Inc. - * - * Authors: - * Miguel de Icaza (miguel@kernel.org) - * Dom Lachowicz (dominicl@seas.upenn.edu) - * - * Reworked and split up into a separate ColorPalette object: - * Michael Levy (mlevy@genoscope.cns.fr) - * - * And later revised and polished by: - * Almer S. Tigelaar (almer@gnome.org) - * - * Modified for gLabels by: - * Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License, version 2, as published by the Free Software Foundation. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef GNUMERIC_WIDGET_COLOR_COMBO_H -#define GNUMERIC_WIDGET_COLOR_COMBO_H - -#include -#include "mygal-combo-box.h" -#include "color-palette.h" - -G_BEGIN_DECLS - -typedef struct _ColorCombo { - MygalComboBox combo_box; - - /* - * GtkImage where we display - */ - GtkWidget *preview_button; - GtkWidget *preview_image; - gboolean preview_is_icon; - - ColorPalette *palette; - - GdkColor *default_color; - gboolean trigger; -} ColorCombo; - -typedef struct { - MygalComboBoxClass parent_class; - - /* Signals emited by this widget */ - void (* color_changed) (ColorCombo *color_combo, GdkColor *color, - gboolean custom, gboolean by_user, gboolean is_default); -} ColorComboClass; - -#define COLOR_COMBO_TYPE (color_combo_get_type ()) -#define COLOR_COMBO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), COLOR_COMBO_TYPE, ColorCombo)) -#define COLOR_COMBO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST(k), COLOR_COMBO_TYPE) -#define IS_COLOR_COMBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), COLOR_COMBO_TYPE)) - -GtkType color_combo_get_type (void); -GtkWidget *color_combo_new (GdkPixbuf *icon, - char const *no_color_label, - GdkColor *default_color, - ColorGroup *color_group); -void color_combo_set_color (ColorCombo *cc, - GdkColor *color); -void color_combo_set_color_to_default (ColorCombo *cc); -GdkColor *color_combo_get_color (ColorCombo *cc, gboolean *is_default); - -void color_combo_box_set_preview_relief (ColorCombo *cc, GtkReliefStyle relief); - -G_END_DECLS - -#endif /* GNUMERIC_WIDGET_COLOR_COMBO_H */ diff --git a/glabels2/src/new-label-dialog.c b/glabels2/src/new-label-dialog.c deleted file mode 100644 index 038ed43b..00000000 --- a/glabels2/src/new-label-dialog.c +++ /dev/null @@ -1,289 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * new-label-dialog.c: New label dialog module - * - * Copyright (C) 2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "new-label-dialog.h" - -#include -#include -#include -#include - -#include "hig.h" -#include "wdgt-media-select.h" -#include "wdgt-rotate-label.h" - -#include "debug.h" - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -struct _glNewLabelDialogPrivate { - - GtkWidget *media_select; - GtkWidget *rotate_label; - -}; - - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_new_label_dialog_finalize (GObject *object); - -static void gl_new_label_dialog_construct (glNewLabelDialog *dialog, - GtkWindow *win); - -static void template_changed_cb (glWdgtMediaSelect *select, - gpointer data); - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glNewLabelDialog, gl_new_label_dialog, GTK_TYPE_DIALOG); - -static void -gl_new_label_dialog_class_init (glNewLabelDialogClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_FILE, ""); - - gl_new_label_dialog_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_new_label_dialog_finalize; -} - -static void -gl_new_label_dialog_init (glNewLabelDialog *dialog) -{ - gl_debug (DEBUG_FILE, "START"); - - g_return_if_fail (GL_IS_NEW_LABEL_DIALOG (dialog)); - - dialog->priv = g_new0 (glNewLabelDialogPrivate, 1); - - gtk_container_set_border_width (GTK_CONTAINER(dialog), GL_HIG_PAD2); - - gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE); - gtk_dialog_add_buttons (GTK_DIALOG(dialog), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); - gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); - gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); - - gl_debug (DEBUG_FILE, "END"); -} - -static void -gl_new_label_dialog_finalize (GObject *object) -{ - glNewLabelDialog* dialog = GL_NEW_LABEL_DIALOG (object);; - - gl_debug (DEBUG_FILE, "START"); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_NEW_LABEL_DIALOG (dialog)); - g_return_if_fail (dialog->priv != NULL); - - g_free (dialog->priv); - - G_OBJECT_CLASS (gl_new_label_dialog_parent_class)->finalize (object); - - gl_debug (DEBUG_FILE, "END"); - -} - -/*****************************************************************************/ -/* NEW object properties dialog. */ -/*****************************************************************************/ -GtkWidget * -gl_new_label_dialog_new (GtkWindow *win) -{ - GtkWidget *dialog; - - gl_debug (DEBUG_FILE, ""); - - dialog = GTK_WIDGET (g_object_new (GL_TYPE_NEW_LABEL_DIALOG, NULL)); - - gl_new_label_dialog_construct (GL_NEW_LABEL_DIALOG(dialog), win); - - return dialog; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct dialog. */ -/*--------------------------------------------------------------------------*/ -static void -gl_new_label_dialog_construct (glNewLabelDialog *dialog, - GtkWindow *win) -{ - GladeXML *gui; - GtkWidget *vbox, *media_select_vbox, *rotate_label_vbox; - gchar *name; - - gl_debug (DEBUG_FILE, "START"); - - gtk_window_set_transient_for (GTK_WINDOW (dialog), win); - - gui = glade_xml_new (GLABELS_GLADE_DIR "new-label-dialog.glade", - "new_label_dialog_vbox", NULL); - - if (!gui) { - g_critical ("Could not open new-label-dialog.glade. gLabels may not be installed correctly!"); - return; - } - - vbox = glade_xml_get_widget (gui, "new_label_dialog_vbox"); - gtk_box_pack_start (GTK_BOX( GTK_DIALOG (dialog)->vbox), vbox, FALSE, FALSE, 0); - - media_select_vbox = glade_xml_get_widget (gui, "media_select_vbox"); - rotate_label_vbox = glade_xml_get_widget (gui, "rotate_label_vbox"); - - g_object_unref (gui); - - dialog->priv->media_select = gl_wdgt_media_select_new (); - gtk_box_pack_start (GTK_BOX (media_select_vbox), - dialog->priv->media_select, FALSE, FALSE, 0); - - dialog->priv->rotate_label = gl_wdgt_rotate_label_new (); - gtk_box_pack_start (GTK_BOX (rotate_label_vbox), - dialog->priv->rotate_label, FALSE, FALSE, 0); - - /* Sync template name from media select with rotate widget. */ - name = gl_wdgt_media_select_get_name (GL_WDGT_MEDIA_SELECT (dialog->priv->media_select)); - gl_wdgt_rotate_label_set_template_name (GL_WDGT_ROTATE_LABEL (dialog->priv->rotate_label), - name); - - g_signal_connect (G_OBJECT (dialog->priv->media_select), "changed", - G_CALLBACK (template_changed_cb), dialog); - - gl_debug (DEBUG_FILE, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. New template changed callback. */ -/*---------------------------------------------------------------------------*/ -static void -template_changed_cb (glWdgtMediaSelect *select, - gpointer data) -{ - glNewLabelDialog *dialog = GL_NEW_LABEL_DIALOG (data); - gchar *name; - - gl_debug (DEBUG_FILE, "START"); - - name = gl_wdgt_media_select_get_name (GL_WDGT_MEDIA_SELECT (select)); - - gl_wdgt_rotate_label_set_template_name (GL_WDGT_ROTATE_LABEL (dialog->priv->rotate_label), - name); - - gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), - GTK_RESPONSE_OK, - (name != NULL)); - - g_free (name); - - gl_debug (DEBUG_FILE, "END"); -} - -/*****************************************************************************/ -/* Get template name. */ -/*****************************************************************************/ -gchar * -gl_new_label_dialog_get_template_name (glNewLabelDialog *dialog) -{ - gchar *name; - - name = gl_wdgt_media_select_get_name (GL_WDGT_MEDIA_SELECT (dialog->priv->media_select)); - - return name; -} - -/*****************************************************************************/ -/* Set template name. */ -/*****************************************************************************/ -void -gl_new_label_dialog_set_template_name (glNewLabelDialog *dialog, - gchar *name) -{ - gl_wdgt_media_select_set_name (GL_WDGT_MEDIA_SELECT (dialog->priv->media_select), name); -} - -/*****************************************************************************/ -/* Get current filter parameters. */ -/*****************************************************************************/ -void -gl_new_label_dialog_get_filter_parameters (glNewLabelDialog *dialog, - gchar **page_size_id, - gchar **category_id) -{ - gl_wdgt_media_select_get_filter_parameters ( - GL_WDGT_MEDIA_SELECT (dialog->priv->media_select), - page_size_id, category_id); -} - -/*****************************************************************************/ -/* Set current filter parameters. */ -/*****************************************************************************/ -void -gl_new_label_dialog_set_filter_parameters (glNewLabelDialog *dialog, - const gchar *page_size_id, - const gchar *category_id) -{ - gl_wdgt_media_select_set_filter_parameters ( - GL_WDGT_MEDIA_SELECT (dialog->priv->media_select), - page_size_id, category_id); -} - -/*****************************************************************************/ -/* Get rotate state. */ -/*****************************************************************************/ -gboolean -gl_new_label_dialog_get_rotate_state (glNewLabelDialog *dialog) -{ - return gl_wdgt_rotate_label_get_state ( - GL_WDGT_ROTATE_LABEL (dialog->priv->rotate_label)); -} - -/*****************************************************************************/ -/* Set rotate state. */ -/*****************************************************************************/ -void -gl_new_label_dialog_set_rotate_state (glNewLabelDialog *dialog, - gboolean state) -{ - gl_wdgt_rotate_label_set_state ( - GL_WDGT_ROTATE_LABEL (dialog->priv->rotate_label), state); -} - diff --git a/glabels2/src/new-label-dialog.h b/glabels2/src/new-label-dialog.h deleted file mode 100644 index a38a48d9..00000000 --- a/glabels2/src/new-label-dialog.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * new-label-dialog.h: New label dialog module header file - * - * Copyright (C) 2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __NEW_LABEL_DIALOG_H__ -#define __NEW_LABEL_DIALOG_H__ - -#include -#include - -G_BEGIN_DECLS - -#define GL_TYPE_NEW_LABEL_DIALOG (gl_new_label_dialog_get_type ()) -#define GL_NEW_LABEL_DIALOG(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_NEW_LABEL_DIALOG, glNewLabelDialog)) -#define GL_NEW_LABEL_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_NEW_LABEL_DIALOG, glNewLabelDialogClass)) -#define GL_IS_NEW_LABEL_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_NEW_LABEL_DIALOG)) -#define GL_IS_NEW_LABEL_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_NEW_LABEL_DIALOG)) -#define GL_NEW_LABEL_DIALOG_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_NEW_LABEL_DIALOG, glNewLabelDialogClass)) - - -typedef struct _glNewLabelDialog glNewLabelDialog; -typedef struct _glNewLabelDialogClass glNewLabelDialogClass; - -typedef struct _glNewLabelDialogPrivate glNewLabelDialogPrivate; - -struct _glNewLabelDialog -{ - GtkDialog parent_instance; - - glNewLabelDialogPrivate *priv; - -}; - -struct _glNewLabelDialogClass -{ - GtkDialogClass parent_class; -}; - - -GType gl_new_label_dialog_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_new_label_dialog_new (GtkWindow *win); - -gchar *gl_new_label_dialog_get_template_name (glNewLabelDialog *dialog); - -void gl_new_label_dialog_set_template_name (glNewLabelDialog *dialog, - gchar *name); - -void gl_new_label_dialog_get_filter_parameters (glNewLabelDialog *dialog, - gchar **page_size_id, - gchar **category_id); - -void gl_new_label_dialog_set_filter_parameters (glNewLabelDialog *dialog, - const gchar *page_size_id, - const gchar *category_id); - -gboolean gl_new_label_dialog_get_rotate_state (glNewLabelDialog *dialog); - -void gl_new_label_dialog_set_rotate_state (glNewLabelDialog *dialog, - gboolean state); - - -G_END_DECLS - -#endif diff --git a/glabels2/src/object-editor-bc-page.c b/glabels2/src/object-editor-bc-page.c deleted file mode 100644 index 464029e0..00000000 --- a/glabels2/src/object-editor-bc-page.c +++ /dev/null @@ -1,426 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include -#include -#include - -#include "prefs.h" -#include "mygal/widget-color-combo.h" -#include "color.h" -#include "util.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void style_changed_cb (glObjectEditor *editor); -static void bc_radio_toggled_cb (glObjectEditor *editor); - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare size page. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_prepare_bc_page (glObjectEditor *editor) -{ - GList *styles = NULL; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Extract widgets from XML tree. */ - editor->priv->bc_page_vbox = - glade_xml_get_widget (editor->priv->gui, "bc_page_vbox"); - editor->priv->bc_style_combo = - glade_xml_get_widget (editor->priv->gui, "bc_style_combo"); - editor->priv->bc_text_check = - glade_xml_get_widget (editor->priv->gui, "bc_text_check"); - editor->priv->bc_cs_check = - glade_xml_get_widget (editor->priv->gui, "bc_cs_check"); - editor->priv->bc_color_combo = - glade_xml_get_widget (editor->priv->gui, "bc_color_combo"); - editor->priv->bc_key_combo = - glade_xml_get_widget (editor->priv->gui, "bc_key_combo"); - editor->priv->bc_key_radio = - glade_xml_get_widget (editor->priv->gui, "bc_key_radio"); - editor->priv->bc_color_radio = - glade_xml_get_widget (editor->priv->gui, "bc_color_radio"); - editor->priv->data_format_label = - glade_xml_get_widget (editor->priv->gui, "data_format_label"); - editor->priv->data_ex_label = - glade_xml_get_widget (editor->priv->gui, "data_ex_label"); - editor->priv->data_digits_label = - glade_xml_get_widget (editor->priv->gui, "data_digits_label"); - editor->priv->data_digits_spin = - glade_xml_get_widget (editor->priv->gui, "data_digits_spin"); - - editor->priv->data_format_fixed_flag = FALSE; - - gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->bc_style_combo)); - gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->bc_key_combo)); - - /* Load barcode styles */ - styles = gl_barcode_get_styles_list (); - gl_util_combo_box_set_strings (GTK_COMBO_BOX(editor->priv->bc_style_combo), - styles); - gl_barcode_free_styles_list (styles); - - /* Modify widgets */ - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->bc_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->bc_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->bc_key_combo, FALSE); - - /* Un-hide */ - gtk_widget_show_all (editor->priv->bc_page_vbox); - - /* Connect signals */ - g_signal_connect_swapped (G_OBJECT (editor->priv->bc_style_combo), - "changed", - G_CALLBACK (style_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->bc_text_check), - "toggled", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->bc_cs_check), - "toggled", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->bc_color_combo), - "color_changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->bc_key_combo), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->bc_color_radio), - "toggled", - G_CALLBACK (bc_radio_toggled_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->bc_key_radio), - "toggled", - G_CALLBACK (bc_radio_toggled_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->data_digits_spin), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Callback for when style has changed. */ -/*--------------------------------------------------------------------------*/ -static void -style_changed_cb (glObjectEditor *editor) -{ - gchar *style_string = NULL; - const gchar *id; - gchar *ex_string = NULL; - guint digits; - - if (editor->priv->stop_signals) return; - - style_string = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_style_combo)); - - /* Don't emit if entry is empty. */ - if ( *style_string != 0 ) { - id = gl_barcode_name_to_id (style_string); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(editor->priv->bc_text_check), - gl_barcode_can_text (id)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(editor->priv->bc_cs_check), - gl_barcode_can_csum (id)); - - gtk_widget_set_sensitive (editor->priv->bc_text_check, - gl_barcode_text_optional (id)); - gtk_widget_set_sensitive (editor->priv->bc_cs_check, - gl_barcode_csum_optional (id)); - - editor->priv->data_format_fixed_flag = !gl_barcode_can_freeform (id); - digits = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->data_digits_spin)); - if (editor->priv->data_format_fixed_flag) { - digits = gl_barcode_get_prefered_n(id); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->data_digits_spin), - digits); - } - - ex_string = gl_barcode_default_digits (id, digits); - gtk_label_set_text (GTK_LABEL(editor->priv->data_ex_label), ex_string); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) { - gtk_widget_set_sensitive (editor->priv->data_format_label, FALSE); - gtk_widget_set_sensitive (editor->priv->data_ex_label, FALSE); - gtk_widget_set_sensitive (editor->priv->data_digits_label, FALSE); - gtk_widget_set_sensitive (editor->priv->data_digits_spin, FALSE); - } else { - gtk_widget_set_sensitive (editor->priv->data_format_label, TRUE); - gtk_widget_set_sensitive (editor->priv->data_ex_label, TRUE); - gtk_widget_set_sensitive (editor->priv->data_digits_label, - !editor->priv->data_format_fixed_flag); - gtk_widget_set_sensitive (editor->priv->data_digits_spin, - !editor->priv->data_format_fixed_flag); - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - } - - g_free (style_string); - g_free (ex_string); -} - -/*****************************************************************************/ -/* Set barcode style. */ -/*****************************************************************************/ -void -gl_object_editor_set_bc_style (glObjectEditor *editor, - gchar *id, - gboolean text_flag, - gboolean checksum_flag, - guint format_digits) -{ - const gchar *style_string; - gchar *ex_string; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - style_string = gl_barcode_id_to_name (id); - - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->bc_style_combo), - style_string); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->bc_text_check), - text_flag); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->bc_cs_check), - checksum_flag); - - gtk_widget_set_sensitive (editor->priv->bc_text_check, - gl_barcode_text_optional (id)); - gtk_widget_set_sensitive (editor->priv->bc_cs_check, - gl_barcode_csum_optional (id)); - - editor->priv->data_format_fixed_flag = !gl_barcode_can_freeform (id); - - if (editor->priv->data_format_fixed_flag) { - format_digits = gl_barcode_get_prefered_n (id); - } - - ex_string = gl_barcode_default_digits (id, format_digits); - gtk_label_set_text (GTK_LABEL(editor->priv->data_ex_label), ex_string); - g_free (ex_string); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->data_digits_spin), - format_digits); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) { - gtk_widget_set_sensitive (editor->priv->data_format_label, FALSE); - gtk_widget_set_sensitive (editor->priv->data_ex_label, FALSE); - gtk_widget_set_sensitive (editor->priv->data_digits_label, FALSE); - gtk_widget_set_sensitive (editor->priv->data_digits_spin, FALSE); - } else { - gtk_widget_set_sensitive (editor->priv->data_format_label, TRUE); - gtk_widget_set_sensitive (editor->priv->data_ex_label, TRUE); - gtk_widget_set_sensitive (editor->priv->data_digits_label, - !editor->priv->data_format_fixed_flag); - gtk_widget_set_sensitive (editor->priv->data_digits_spin, - !editor->priv->data_format_fixed_flag); - } - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query barcode style. */ -/*****************************************************************************/ -void -gl_object_editor_get_bc_style (glObjectEditor *editor, - gchar **id, - gboolean *text_flag, - gboolean *checksum_flag, - guint *format_digits) -{ - gchar *style_string; - - gl_debug (DEBUG_EDITOR, "START"); - - style_string = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_style_combo)); - *id = g_strdup (gl_barcode_name_to_id (style_string)); - - *text_flag = - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->bc_text_check)); - - *checksum_flag = - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->bc_cs_check)); - - - *format_digits = - gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->data_digits_spin)); - - g_free (style_string); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set bc color. */ -/*****************************************************************************/ -void -gl_object_editor_set_bc_color (glObjectEditor *editor, - gboolean merge_flag, - glColorNode *color_node) -{ - GdkColor *gdk_color; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_widget_set_sensitive (editor->priv->bc_key_radio, merge_flag); - - if ( color_node->color == GL_COLOR_NONE ) { - - color_combo_set_color_to_default (COLOR_COMBO(editor->priv->bc_color_combo)); - - } else { - - gdk_color = gl_color_to_gdk_color (color_node->color); - color_combo_set_color (COLOR_COMBO(editor->priv->bc_color_combo), - gdk_color); - g_free (gdk_color); - } - - if (!color_node->field_flag) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->bc_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->bc_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->bc_key_combo, FALSE); - - } else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->bc_key_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->bc_color_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->bc_key_combo, TRUE); - - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->bc_key_combo), - color_node->key); - } - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query bc color. */ -/*****************************************************************************/ -glColorNode* -gl_object_editor_get_bc_color (glObjectEditor *editor) -{ - GdkColor *gdk_color; - glColorNode *color_node; - gboolean is_default; - - gl_debug (DEBUG_EDITOR, "START"); - - color_node = gl_color_node_new_default (); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->bc_key_radio))) { - color_node->field_flag = TRUE; - color_node->color = gl_prefs->default_line_color; - color_node->key = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_key_combo)); - } else { - color_node->field_flag = FALSE; - color_node->key = NULL; - gdk_color = color_combo_get_color (COLOR_COMBO(editor->priv->bc_color_combo), - &is_default); - - if (is_default) { - color_node->color = gl_prefs->default_line_color; - } else { - color_node->color = gl_color_from_gdk_color (gdk_color); - } - } - - gl_debug (DEBUG_EDITOR, "END"); - - return color_node; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. barcode color radio callback. */ -/*--------------------------------------------------------------------------*/ -static void -bc_radio_toggled_cb (glObjectEditor *editor) -{ - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->bc_color_radio))) { - gtk_widget_set_sensitive (editor->priv->bc_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->bc_key_combo, FALSE); - } else { - gtk_widget_set_sensitive (editor->priv->bc_color_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->bc_key_combo, TRUE); - - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - - gl_debug (DEBUG_EDITOR, "END"); -} diff --git a/glabels2/src/object-editor-data-page.c b/glabels2/src/object-editor-data-page.c deleted file mode 100644 index 449d3e28..00000000 --- a/glabels2/src/object-editor-data-page.c +++ /dev/null @@ -1,232 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include -#include -#include - -#include "prefs.h" -#include "util.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void data_radio_toggled_cb (glObjectEditor *editor); - - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare data page. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_prepare_data_page (glObjectEditor *editor) -{ - gl_debug (DEBUG_EDITOR, "START"); - - /* Extract widgets from XML tree. */ - editor->priv->data_page_vbox = glade_xml_get_widget (editor->priv->gui, - "data_page_vbox"); - editor->priv->data_literal_radio = glade_xml_get_widget (editor->priv->gui, - "data_literal_radio"); - editor->priv->data_key_radio = glade_xml_get_widget (editor->priv->gui, - "data_key_radio"); - editor->priv->data_text_entry = glade_xml_get_widget (editor->priv->gui, - "data_text_entry"); - editor->priv->data_key_combo = glade_xml_get_widget (editor->priv->gui, - "data_key_combo"); - - gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->data_key_combo)); - - /* Un-hide */ - gtk_widget_show_all (editor->priv->data_page_vbox); - - /* Connect signals */ - g_signal_connect_swapped (G_OBJECT (editor->priv->data_text_entry), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->data_key_combo), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->data_literal_radio), - "toggled", - G_CALLBACK (data_radio_toggled_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->data_key_radio), - "toggled", - G_CALLBACK (data_radio_toggled_cb), - G_OBJECT (editor)); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. data radio callback. */ -/*--------------------------------------------------------------------------*/ -static void -data_radio_toggled_cb (glObjectEditor *editor) -{ - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_WDGT, "START"); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) { - gtk_widget_set_sensitive (editor->priv->data_text_entry, TRUE); - gtk_widget_set_sensitive (editor->priv->data_key_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->data_format_label, FALSE); - gtk_widget_set_sensitive (editor->priv->data_ex_label, FALSE); - gtk_widget_set_sensitive (editor->priv->data_digits_label, FALSE); - gtk_widget_set_sensitive (editor->priv->data_digits_spin, FALSE); - } else { - gtk_widget_set_sensitive (editor->priv->data_text_entry, FALSE); - gtk_widget_set_sensitive (editor->priv->data_key_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->data_format_label, TRUE); - gtk_widget_set_sensitive (editor->priv->data_ex_label, TRUE); - gtk_widget_set_sensitive (editor->priv->data_digits_label, - !editor->priv->data_format_fixed_flag); - gtk_widget_set_sensitive (editor->priv->data_digits_spin, - !editor->priv->data_format_fixed_flag); - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - - gl_debug (DEBUG_WDGT, "END"); -} - -/*****************************************************************************/ -/* Set data. */ -/*****************************************************************************/ -void -gl_object_editor_set_data (glObjectEditor *editor, - gboolean merge_flag, - glTextNode *text_node) -{ - gint pos; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_widget_set_sensitive (editor->priv->data_key_radio, merge_flag); - - if (!text_node->field_flag) { - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->data_literal_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->data_text_entry, TRUE); - gtk_widget_set_sensitive (editor->priv->data_key_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->data_format_label, FALSE); - gtk_widget_set_sensitive (editor->priv->data_ex_label, FALSE); - gtk_widget_set_sensitive (editor->priv->data_digits_spin, FALSE); - gtk_widget_set_sensitive (editor->priv->data_digits_label, FALSE); - - gtk_editable_delete_text (GTK_EDITABLE (editor->priv->data_text_entry), 0, -1); - pos = 0; - if (text_node->data != NULL ) { - gtk_editable_insert_text (GTK_EDITABLE (editor->priv->data_text_entry), - text_node->data, - strlen (text_node->data), - &pos); - } - - } else { - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->data_key_radio), TRUE); - - gtk_widget_set_sensitive (editor->priv->data_text_entry, FALSE); - gtk_widget_set_sensitive (editor->priv->data_key_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->data_format_label, TRUE); - gtk_widget_set_sensitive (editor->priv->data_ex_label, TRUE); - gtk_widget_set_sensitive (editor->priv->data_digits_label, - !editor->priv->data_format_fixed_flag); - gtk_widget_set_sensitive (editor->priv->data_digits_spin, - !editor->priv->data_format_fixed_flag); - - - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->data_key_combo), - text_node->data); - } - - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query data. */ -/*****************************************************************************/ -glTextNode * -gl_object_editor_get_data (glObjectEditor *editor) -{ - glTextNode *text_node; - - gl_debug (DEBUG_EDITOR, "START"); - - text_node = g_new0(glTextNode,1); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) { - text_node->field_flag = FALSE; - text_node->data = - gtk_editable_get_chars (GTK_EDITABLE (editor->priv->data_text_entry), - 0, -1); - } else { - text_node->field_flag = TRUE; - text_node->data = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->data_key_combo)); - } - - gl_debug (DEBUG_EDITOR, "text_node: field_flag=%d, data=%s", - text_node->field_flag, text_node->data); - - gl_debug (DEBUG_EDITOR, "END"); - - return text_node; -} diff --git a/glabels2/src/object-editor-edit-page.c b/glabels2/src/object-editor-edit-page.c deleted file mode 100644 index 0a21e8d6..00000000 --- a/glabels2/src/object-editor-edit-page.c +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include - -#include "prefs.h" -#include "mygal/widget-color-combo.h" -#include "color.h" -#include "util.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void insert_button_cb (glObjectEditor *editor); - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare size page. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_prepare_edit_page (glObjectEditor *editor) -{ - gl_debug (DEBUG_EDITOR, "START"); - - /* Extract widgets from XML tree. */ - editor->priv->edit_page_vbox = - glade_xml_get_widget (editor->priv->gui, "edit_page_vbox"); - editor->priv->edit_text_view = - glade_xml_get_widget (editor->priv->gui, "edit_text_view"); - editor->priv->edit_key_label = - glade_xml_get_widget (editor->priv->gui, "edit_key_label"); - editor->priv->edit_key_combo = - glade_xml_get_widget (editor->priv->gui, "edit_key_combo"); - editor->priv->edit_insert_field_button = - glade_xml_get_widget (editor->priv->gui, "edit_insert_field_button"); - - gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->edit_key_combo)); - - /* Un-hide */ - gtk_widget_show_all (editor->priv->edit_page_vbox); - - /* Connect signals */ - g_signal_connect_swapped (G_OBJECT (editor->priv->edit_insert_field_button), - "clicked", - G_CALLBACK (insert_button_cb), - G_OBJECT (editor)); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Alignment togglebutton callback. */ -/*--------------------------------------------------------------------------*/ -static void -insert_button_cb (glObjectEditor *editor) -{ - GtkTextBuffer *buffer; - gchar *key, *field; - - gl_debug (DEBUG_EDITOR, "START"); - - key = gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->edit_key_combo)); - field = g_strdup_printf ("${%s}", key); - gl_debug (DEBUG_WDGT, "Inserting %s", field); - - buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (editor->priv->edit_text_view)); - gtk_text_buffer_insert_at_cursor (buffer, field, -1); - - g_free (field); - g_free (key); - - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set text buffer as model for text view/editor. */ -/*****************************************************************************/ -void -gl_object_editor_set_text_buffer (glObjectEditor *editor, - GtkTextBuffer *buffer) -{ - gl_debug (DEBUG_EDITOR, "START"); - - gtk_text_view_set_buffer (GTK_TEXT_VIEW(editor->priv->edit_text_view), buffer); - - gl_debug (DEBUG_EDITOR, "END"); -} - diff --git a/glabels2/src/object-editor-fill-page.c b/glabels2/src/object-editor-fill-page.c deleted file mode 100644 index c40f8a17..00000000 --- a/glabels2/src/object-editor-fill-page.c +++ /dev/null @@ -1,224 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include - -#include "prefs.h" -#include "mygal/widget-color-combo.h" -#include "color.h" -#include "util.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void fill_radio_toggled_cb (glObjectEditor *editor); - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare fill page. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_prepare_fill_page (glObjectEditor *editor) -{ - GdkColor *gdk_color; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Extract widgets from XML tree. */ - editor->priv->fill_page_vbox = glade_xml_get_widget (editor->priv->gui, - "fill_page_vbox"); - editor->priv->fill_color_combo = glade_xml_get_widget (editor->priv->gui, - "fill_color_combo"); - editor->priv->fill_key_combo = glade_xml_get_widget (editor->priv->gui, - "fill_key_combo"); - editor->priv->fill_key_radio = glade_xml_get_widget (editor->priv->gui, - "fill_key_radio"); - editor->priv->fill_color_radio = glade_xml_get_widget (editor->priv->gui, - "fill_color_radio"); - - - gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->fill_key_combo)); - - /* Modify widgets based on configuration */ - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->fill_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE); - gdk_color = gl_color_to_gdk_color (gl_prefs->default_fill_color); - color_combo_set_color (COLOR_COMBO(editor->priv->fill_color_combo), gdk_color); - g_free (gdk_color); - - /* Un-hide */ - gtk_widget_show_all (editor->priv->fill_page_vbox); - - /* Connect signals */ - g_signal_connect_swapped (G_OBJECT (editor->priv->fill_color_combo), - "color_changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->fill_key_combo), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->fill_color_radio), - "toggled", - G_CALLBACK (fill_radio_toggled_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->fill_key_radio), - "toggled", - G_CALLBACK (fill_radio_toggled_cb), - G_OBJECT (editor)); - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set fill color. */ -/*****************************************************************************/ -void -gl_object_editor_set_fill_color (glObjectEditor *editor, - gboolean merge_flag, - glColorNode *color_node) -{ - GdkColor *gdk_color; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_widget_set_sensitive (editor->priv->fill_key_radio, merge_flag); - - if ( color_node->color == GL_COLOR_NONE ) { - - color_combo_set_color_to_default (COLOR_COMBO(editor->priv->fill_color_combo)); - - } else { - - gdk_color = gl_color_to_gdk_color (color_node->color); - color_combo_set_color (COLOR_COMBO(editor->priv->fill_color_combo), - gdk_color); - g_free (gdk_color); - - } - - if (!color_node->field_flag) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->fill_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE); - - } else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->fill_key_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->fill_color_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->fill_key_combo, TRUE); - - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->fill_key_combo), - color_node->key); - } - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query fill color. */ -/*****************************************************************************/ -glColorNode* -gl_object_editor_get_fill_color (glObjectEditor *editor) -{ - GdkColor *gdk_color; - gboolean is_default; - glColorNode *color_node; - - gl_debug (DEBUG_EDITOR, "START"); - - color_node = gl_color_node_new_default (); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->fill_key_radio))) { - color_node->field_flag = TRUE; - color_node->key = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->fill_key_combo)); - } else { - color_node->field_flag = FALSE; - color_node->key = NULL; - gdk_color = color_combo_get_color (COLOR_COMBO(editor->priv->fill_color_combo), - &is_default); - - if (!is_default) { - color_node->color = gl_color_from_gdk_color (gdk_color); - } - } - - gl_debug (DEBUG_EDITOR, "END"); - - return color_node; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. fill radio callback. */ -/*--------------------------------------------------------------------------*/ -static void -fill_radio_toggled_cb (glObjectEditor *editor) -{ - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->fill_color_radio))) { - gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE); - } else { - gtk_widget_set_sensitive (editor->priv->fill_color_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->fill_key_combo, TRUE); - - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - - gl_debug (DEBUG_EDITOR, "END"); -} diff --git a/glabels2/src/object-editor-image-page.c b/glabels2/src/object-editor-image-page.c deleted file mode 100644 index a975ab29..00000000 --- a/glabels2/src/object-editor-image-page.c +++ /dev/null @@ -1,350 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include -#include -#include - -#include "prefs.h" -#include "util.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void img_radio_toggled_cb (glObjectEditor *editor); - -static void update_preview_cb (GtkFileChooser *file_chooser, - gpointer data); -static void add_image_filters_to_chooser (GtkFileChooser *file_chooser); - -static void img_selection_changed_cb (glObjectEditor *editor); - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare image page. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_prepare_image_page (glObjectEditor *editor) -{ - GtkWidget *preview; - - - gl_debug (DEBUG_EDITOR, "START"); - - /* Extract widgets from XML tree. */ - editor->priv->img_page_vbox = glade_xml_get_widget (editor->priv->gui, - "img_page_vbox"); - editor->priv->img_file_radio = glade_xml_get_widget (editor->priv->gui, - "img_file_radio"); - editor->priv->img_key_radio = glade_xml_get_widget (editor->priv->gui, - "img_key_radio"); - editor->priv->img_file_button = glade_xml_get_widget (editor->priv->gui, - "img_file_button"); - editor->priv->img_key_combo = glade_xml_get_widget (editor->priv->gui, - "img_key_combo"); - - gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->img_key_combo)); - - /* Modify file button properties. */ - add_image_filters_to_chooser (GTK_FILE_CHOOSER (editor->priv->img_file_button)); - preview = gtk_image_new (); - gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (editor->priv->img_file_button), preview); - g_signal_connect (G_OBJECT (editor->priv->img_file_button), - "update-preview", - G_CALLBACK (update_preview_cb), preview); - - /* Un-hide */ - gtk_widget_show_all (editor->priv->img_page_vbox); - - /* Connect signals */ - g_signal_connect_swapped (G_OBJECT (editor->priv->img_file_button), - "selection-changed", - G_CALLBACK (img_selection_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->img_key_combo), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->img_file_radio), - "toggled", - G_CALLBACK (img_radio_toggled_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->img_key_radio), - "toggled", - G_CALLBACK (img_radio_toggled_cb), - G_OBJECT (editor)); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. image radio callback. */ -/*--------------------------------------------------------------------------*/ -static void -img_radio_toggled_cb (glObjectEditor *editor) -{ - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_WDGT, "START"); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio))) { - gtk_widget_set_sensitive (editor->priv->img_file_button, TRUE); - gtk_widget_set_sensitive (editor->priv->img_key_combo, FALSE); - } else { - gtk_widget_set_sensitive (editor->priv->img_file_button, FALSE); - gtk_widget_set_sensitive (editor->priv->img_key_combo, TRUE); - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - - gl_debug (DEBUG_WDGT, "END"); -} - -/*****************************************************************************/ -/* Set image. */ -/*****************************************************************************/ -void -gl_object_editor_set_image (glObjectEditor *editor, - gboolean merge_flag, - glTextNode *text_node) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_widget_set_sensitive (editor->priv->img_key_radio, merge_flag); - - if (!text_node->field_flag) { - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->img_file_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->img_file_button, TRUE); - gtk_widget_set_sensitive (editor->priv->img_key_combo, FALSE); - - if (text_node->data != NULL ) { - gtk_file_chooser_set_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button), - text_node->data); - } else { - gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER(editor->priv->img_file_button)); - } - } else { - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->img_key_radio), TRUE); - - gtk_widget_set_sensitive (editor->priv->img_file_button, FALSE); - gtk_widget_set_sensitive (editor->priv->img_key_combo, TRUE); - - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->img_key_combo), - text_node->data); - } - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query image. */ -/*****************************************************************************/ -glTextNode * -gl_object_editor_get_image (glObjectEditor *editor) -{ - glTextNode *text_node; - - gl_debug (DEBUG_EDITOR, "START"); - - text_node = g_new0(glTextNode,1); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio))) { - text_node->field_flag = FALSE; - text_node->data = - gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button)); - } else { - text_node->field_flag = TRUE; - text_node->data = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->img_key_combo)); - } - - gl_debug (DEBUG_EDITOR, "text_node: field_flag=%d, data=%s", - text_node->field_flag, text_node->data); - - gl_debug (DEBUG_EDITOR, "END"); - - return text_node; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Update preview image. */ -/*--------------------------------------------------------------------------*/ -static void -update_preview_cb (GtkFileChooser *file_chooser, gpointer data) -{ - GtkWidget *preview; - char *filename; - GdkPixbuf *pixbuf; - gboolean have_preview; - - preview = GTK_WIDGET (data); - filename = gtk_file_chooser_get_preview_filename (file_chooser); - - if (filename) { - pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL); - have_preview = (pixbuf != NULL); - g_free (filename); - - gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf); - if (pixbuf) - gdk_pixbuf_unref (pixbuf); - - gtk_file_chooser_set_preview_widget_active (file_chooser, - have_preview); - } else { - gtk_file_chooser_set_preview_widget_active (file_chooser, FALSE); - } -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add filters to file chooser. */ -/* Based on eog's eog_file_selection_add_filter(). */ -/*--------------------------------------------------------------------------*/ -static void -add_image_filters_to_chooser (GtkFileChooser *chooser) -{ - GtkFileFilter *all_file_filter; - GtkFileFilter *all_img_filter; - GSList *formats; - GSList *it; - GtkFileFilter *filter; - GSList *filters = NULL; - gchar **mime_types, **pattern, *tmp; - int i; - - /* All Files Filter */ - all_file_filter = gtk_file_filter_new (); - gtk_file_filter_set_name (all_file_filter, _("All Files")); - gtk_file_filter_add_pattern (all_file_filter, "*"); - - /* All Image Filter */ - all_img_filter = gtk_file_filter_new (); - gtk_file_filter_set_name (all_img_filter, _("All Images")); - - /* Individual image filters */ - formats = gdk_pixbuf_get_formats (); - for (it = formats; it != NULL; it = it->next) { - gchar *filter_name; - GdkPixbufFormat *format; - filter = gtk_file_filter_new (); - gchar *description, *name; - - format = (GdkPixbufFormat*) it->data; - - /* Filter name: First description then file extension, eg. "The PNG-Format (*.png)".*/ - description = gdk_pixbuf_format_get_description (format); - name = gdk_pixbuf_format_get_name (format); - filter_name = g_strdup_printf (_("%s (*.%s)"), description, name); - g_free (description); - g_free (name); - gtk_file_filter_set_name (filter, filter_name); - g_free (filter_name); - - mime_types = gdk_pixbuf_format_get_mime_types ((GdkPixbufFormat *) it->data); - for (i = 0; mime_types[i] != NULL; i++) { - gtk_file_filter_add_mime_type (filter, mime_types[i]); - gtk_file_filter_add_mime_type (all_img_filter, mime_types[i]); - } - g_strfreev (mime_types); - - pattern = gdk_pixbuf_format_get_extensions ((GdkPixbufFormat *) it->data); - for (i = 0; pattern[i] != NULL; i++) { - tmp = g_strconcat ("*.", pattern[i], NULL); - gtk_file_filter_add_pattern (filter, tmp); - gtk_file_filter_add_pattern (all_img_filter, tmp); - g_free (tmp); - } - g_strfreev (pattern); - - filters = g_slist_prepend (filters, filter); - } - g_slist_free (formats); - - /* Add filter to filechooser */ - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), all_file_filter); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), all_img_filter); - gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser), all_img_filter); - - for (it = filters; it != NULL; it = it->next) { - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), - GTK_FILE_FILTER (it->data)); - } - g_slist_free (filters); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Selection changed callback. */ -/*--------------------------------------------------------------------------*/ -static void -img_selection_changed_cb (glObjectEditor *editor) -{ - gchar *filename; - - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button)); - if (filename != NULL) - { - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - } - g_free (filename); - - gl_debug (DEBUG_EDITOR, "END"); -} - diff --git a/glabels2/src/object-editor-line-page.c b/glabels2/src/object-editor-line-page.c deleted file mode 100644 index a9daf766..00000000 --- a/glabels2/src/object-editor-line-page.c +++ /dev/null @@ -1,271 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include -#include -#include - -#include "prefs.h" -#include "mygal/widget-color-combo.h" -#include "color.h" -#include "util.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ -static void line_radio_toggled_cb (glObjectEditor *editor); - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare line page. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_prepare_line_page (glObjectEditor *editor) -{ - GdkColor *gdk_color; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Extract widgets from XML tree. */ - editor->priv->line_page_vbox = glade_xml_get_widget (editor->priv->gui, - "line_page_vbox"); - editor->priv->line_width_spin = glade_xml_get_widget (editor->priv->gui, - "line_width_spin"); - editor->priv->line_color_combo = glade_xml_get_widget (editor->priv->gui, - "line_color_combo"); - editor->priv->line_key_combo = glade_xml_get_widget (editor->priv->gui, - "line_key_combo"); - editor->priv->line_key_radio = glade_xml_get_widget (editor->priv->gui, - "line_key_radio"); - editor->priv->line_color_radio = glade_xml_get_widget (editor->priv->gui, - "line_color_radio"); - - gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->line_key_combo)); - - /* Modify widgets based on configuration */ - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->line_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->line_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->line_key_combo, FALSE); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->line_width_spin), - gl_prefs->default_line_width); - gdk_color = gl_color_to_gdk_color (gl_prefs->default_line_color); - color_combo_set_color (COLOR_COMBO(editor->priv->line_color_combo), gdk_color); - g_free (gdk_color); - - /* Un-hide */ - gtk_widget_show_all (editor->priv->line_page_vbox); - - /* Connect signals */ - g_signal_connect_swapped (G_OBJECT (editor->priv->line_width_spin), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->line_color_combo), - "color_changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->line_key_combo), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->line_color_radio), - "toggled", - G_CALLBACK (line_radio_toggled_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->line_key_radio), - "toggled", - G_CALLBACK (line_radio_toggled_cb), - G_OBJECT (editor)); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set line width. */ -/*****************************************************************************/ -void -gl_object_editor_set_line_width (glObjectEditor *editor, - gdouble width) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - /* Set widget values */ - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->line_width_spin), - width); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query line width. */ -/*****************************************************************************/ -gdouble -gl_object_editor_get_line_width (glObjectEditor *editor) -{ - gdouble w; - - gl_debug (DEBUG_EDITOR, "START"); - - w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->line_width_spin)); - - gl_debug (DEBUG_EDITOR, "END"); - - return w; -} - -/*****************************************************************************/ -/* Set line color. */ -/*****************************************************************************/ -void -gl_object_editor_set_line_color (glObjectEditor *editor, - gboolean merge_flag, - glColorNode *color_node) -{ - GdkColor *gdk_color; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gl_debug (DEBUG_EDITOR, "color field %s(%d) / %X", color_node->key, color_node->field_flag, color_node->color); - gtk_widget_set_sensitive (editor->priv->line_key_radio, merge_flag); - - if ( color_node->color == GL_COLOR_NONE ) { - - color_combo_set_color_to_default (COLOR_COMBO(editor->priv->line_color_combo)); - - } else { - - gdk_color = gl_color_to_gdk_color (color_node->color); - color_combo_set_color (COLOR_COMBO(editor->priv->line_color_combo), - gdk_color); - g_free (gdk_color); - - } - - if (!color_node->field_flag) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->line_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->line_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->line_key_combo, FALSE); - - } else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->line_key_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->line_color_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->line_key_combo, TRUE); - - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->line_key_combo), - color_node->key); - } - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query line color. */ -/*****************************************************************************/ -glColorNode* -gl_object_editor_get_line_color (glObjectEditor *editor) -{ - GdkColor *gdk_color; - gboolean is_default; - glColorNode *color_node; - - gl_debug (DEBUG_EDITOR, "START"); - - color_node = gl_color_node_new_default (); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->line_key_radio))) { - color_node->field_flag = TRUE; - color_node->key = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->line_key_combo)); - } else { - color_node->field_flag = FALSE; - color_node->key = NULL; - gdk_color = color_combo_get_color (COLOR_COMBO(editor->priv->line_color_combo), - &is_default); - - if (!is_default) { - color_node->color = gl_color_from_gdk_color (gdk_color); - } - } - - gl_debug (DEBUG_EDITOR, "END"); - - return color_node; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. line color radio callback. */ -/*--------------------------------------------------------------------------*/ -static void -line_radio_toggled_cb (glObjectEditor *editor) -{ - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->line_color_radio))) { - gtk_widget_set_sensitive (editor->priv->line_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->line_key_combo, FALSE); - } else { - gtk_widget_set_sensitive (editor->priv->line_color_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->line_key_combo, TRUE); - - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - - gl_debug (DEBUG_EDITOR, "END"); -} diff --git a/glabels2/src/object-editor-lsize-page.c b/glabels2/src/object-editor-lsize-page.c deleted file mode 100644 index d87c2470..00000000 --- a/glabels2/src/object-editor-lsize-page.c +++ /dev/null @@ -1,259 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include - -#include "prefs.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -#define LENGTH(x,y) sqrt( (x)*(x) + (y)*(y) ) -#define ANGLE(x,y) ( (180.0/G_PI)*atan2( -(y), (x) ) ) -#define COMP_X(l,a) ( (l) * cos( (G_PI/180.0)*(a) ) ) -#define COMP_Y(l,a) ( -(l) * sin( (G_PI/180.0)*(a) ) ) - - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare line size page. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_prepare_lsize_page (glObjectEditor *editor) -{ - const gchar *units_string; - gdouble climb_rate; - gint digits; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Extract widgets from XML tree. */ - editor->priv->lsize_page_vbox = - glade_xml_get_widget (editor->priv->gui, "lsize_page_vbox"); - editor->priv->lsize_r_spin = - glade_xml_get_widget (editor->priv->gui, "lsize_r_spin"); - editor->priv->lsize_theta_spin = - glade_xml_get_widget (editor->priv->gui, "lsize_theta_spin"); - editor->priv->lsize_r_units_label = - glade_xml_get_widget (editor->priv->gui, "lsize_r_units_label"); - - /* Get configuration information */ - units_string = gl_prefs_get_units_string (); - editor->priv->units_per_point = gl_prefs_get_units_per_point (); - climb_rate = gl_prefs_get_units_step_size (); - digits = gl_prefs_get_units_precision (); - - /* Modify widgets based on configuration */ - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), - climb_rate, 10.0*climb_rate); - gtk_label_set_text (GTK_LABEL(editor->priv->lsize_r_units_label), units_string); - - /* Un-hide */ - gtk_widget_show_all (editor->priv->lsize_page_vbox); - - /* Connect signals */ - g_signal_connect_swapped (G_OBJECT (editor->priv->lsize_r_spin), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->lsize_theta_spin), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set line size. */ -/*****************************************************************************/ -void -gl_object_editor_set_lsize (glObjectEditor *editor, - gdouble dx, - gdouble dy) -{ - gdouble r, theta; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - /* save a copy in internal units */ - editor->priv->dx = dx; - editor->priv->dy = dy; - - /* convert internal units to displayed units */ - gl_debug (DEBUG_EDITOR, "internal dx,dy = %g, %g", dx, dy); - dx *= editor->priv->units_per_point; - dy *= editor->priv->units_per_point; - gl_debug (DEBUG_EDITOR, "display dx,dy = %g, %g", dx, dy); - - r = LENGTH (dx, dy); - theta = ANGLE (dx, dy); - - /* Set widget values */ - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin), r); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_theta_spin), - theta); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set maximum line size. */ -/*****************************************************************************/ -void -gl_object_editor_set_max_lsize (glObjectEditor *editor, - gdouble dx_max, - gdouble dy_max) -{ - gdouble tmp; - - gl_debug (DEBUG_EDITOR, "START"); - - if (editor->priv->lsize_page_vbox) - { - - editor->priv->stop_signals = TRUE; - - /* save a copy in internal units */ - editor->priv->dx_max = dx_max; - editor->priv->dy_max = dy_max; - - /* convert internal units to displayed units */ - gl_debug (DEBUG_EDITOR, "internal dx_max,dy_max = %g, %g", dx_max, dy_max); - dx_max *= editor->priv->units_per_point; - dy_max *= editor->priv->units_per_point; - gl_debug (DEBUG_EDITOR, "display dx_max,dy_max = %g, %g", dx_max, dy_max); - - /* Set widget values */ - tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin)); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin), - 0.0, 2.0*LENGTH (dx_max, dy_max)); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin), tmp); - - editor->priv->stop_signals = FALSE; - - } - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query line size. */ -/*****************************************************************************/ -void -gl_object_editor_get_lsize (glObjectEditor *editor, - gdouble *dx, - gdouble *dy) -{ - gdouble r, theta; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Get values from widgets */ - r = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin)); - theta = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->lsize_theta_spin)); - - /* convert everything back to our internal units (points) */ - r /= editor->priv->units_per_point; - - *dx = COMP_X (r, theta); - *dy = COMP_Y (r, theta); - - /* save a copy in internal units */ - editor->priv->dx = *dx; - editor->priv->dy = *dy; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* PRIVATE. Prefs changed callback. Update units related items. */ -/*****************************************************************************/ -void -lsize_prefs_changed_cb (glObjectEditor *editor) -{ - const gchar *units_string; - gdouble climb_rate; - gint digits; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Get new configuration information */ - units_string = gl_prefs_get_units_string (); - editor->priv->units_per_point = gl_prefs_get_units_per_point (); - climb_rate = gl_prefs_get_units_step_size (); - digits = gl_prefs_get_units_precision (); - - /* Update characteristics of r_spin */ - editor->priv->stop_signals = TRUE; - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), - digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), - climb_rate, 10.0*climb_rate); - editor->priv->stop_signals = FALSE; - - /* Update r_units_label */ - gtk_label_set_text (GTK_LABEL(editor->priv->lsize_r_units_label), - units_string); - - /* Update values of r_spin/theta_spin */ - gl_object_editor_set_lsize (editor, - editor->priv->dx, - editor->priv->dy); - gl_object_editor_set_max_lsize (editor, - editor->priv->dx_max, - editor->priv->dy_max); - - gl_debug (DEBUG_EDITOR, "END"); -} - diff --git a/glabels2/src/object-editor-position-page.c b/glabels2/src/object-editor-position-page.c deleted file mode 100644 index e72036e0..00000000 --- a/glabels2/src/object-editor-position-page.c +++ /dev/null @@ -1,253 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include - -#include "prefs.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare position page. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_prepare_position_page (glObjectEditor *editor) -{ - const gchar *units_string; - gdouble climb_rate; - gint digits; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Extract widgets from XML tree. */ - editor->priv->pos_page_vbox = glade_xml_get_widget (editor->priv->gui, - "pos_page_vbox"); - editor->priv->pos_x_spin = glade_xml_get_widget (editor->priv->gui, - "pos_x_spin"); - editor->priv->pos_y_spin = glade_xml_get_widget (editor->priv->gui, - "pos_y_spin"); - editor->priv->pos_x_units_label = glade_xml_get_widget (editor->priv->gui, - "pos_x_units_label"); - editor->priv->pos_y_units_label = glade_xml_get_widget (editor->priv->gui, - "pos_y_units_label"); - - /* Get configuration information */ - units_string = gl_prefs_get_units_string (); - editor->priv->units_per_point = gl_prefs_get_units_per_point (); - climb_rate = gl_prefs_get_units_step_size (); - digits = gl_prefs_get_units_precision (); - - /* Modify widgets based on configuration */ - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_x_spin), digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_x_spin), - climb_rate, 10.0*climb_rate); - gtk_label_set_text (GTK_LABEL(editor->priv->pos_x_units_label), units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_y_spin), digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_y_spin), - climb_rate, 10.0*climb_rate); - gtk_label_set_text (GTK_LABEL(editor->priv->pos_y_units_label), units_string); - - /* Un-hide */ - gtk_widget_show_all (editor->priv->pos_page_vbox); - - /* Connect signals */ - g_signal_connect_swapped (G_OBJECT (editor->priv->pos_x_spin), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->pos_y_spin), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set position. */ -/*****************************************************************************/ -void -gl_object_editor_set_position (glObjectEditor *editor, - gdouble x, - gdouble y) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - /* save a copy in internal units */ - editor->priv->x = x; - editor->priv->y = y; - - /* convert internal units to displayed units */ - gl_debug (DEBUG_EDITOR, "internal x,y = %g, %g", x, y); - x *= editor->priv->units_per_point; - y *= editor->priv->units_per_point; - gl_debug (DEBUG_EDITOR, "display x,y = %g, %g", x, y); - - /* Set widget values */ - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), x); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), y); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set maximum position. */ -/*****************************************************************************/ -void -gl_object_editor_set_max_position (glObjectEditor *editor, - gdouble x_max, - gdouble y_max) -{ - gdouble tmp; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - /* save a copy in internal units */ - editor->priv->x_max = x_max; - editor->priv->y_max = y_max; - - /* convert internal units to displayed units */ - gl_debug (DEBUG_EDITOR, "internal x_max,y_max = %g, %g", x_max, y_max); - x_max *= editor->priv->units_per_point; - y_max *= editor->priv->units_per_point; - gl_debug (DEBUG_EDITOR, "display x_max,y_max = %g, %g", x_max, y_max); - - /* Set widget values */ - tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin)); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), - -x_max, 2.0*x_max); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), tmp); - tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin)); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), - -y_max, 2.0*y_max); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), tmp); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query position. */ -/*****************************************************************************/ -void -gl_object_editor_get_position (glObjectEditor *editor, - gdouble *x, - gdouble *y) -{ - gl_debug (DEBUG_EDITOR, "START"); - - /* Get values from widgets */ - *x = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin)); - *y = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin)); - - /* convert everything back to our internal units (points) */ - *x /= editor->priv->units_per_point; - *y /= editor->priv->units_per_point; - - /* save a copy in internal units */ - editor->priv->x = *x; - editor->priv->y = *y; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* PRIVATE. Prefs changed callback. Update units related items. */ -/*****************************************************************************/ -void -position_prefs_changed_cb (glObjectEditor *editor) -{ - const gchar *units_string; - gdouble climb_rate; - gint digits; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Get new configuration information */ - units_string = gl_prefs_get_units_string (); - editor->priv->units_per_point = gl_prefs_get_units_per_point (); - climb_rate = gl_prefs_get_units_step_size (); - digits = gl_prefs_get_units_precision (); - - /* Update characteristics of x_spin/y_spin */ - editor->priv->stop_signals = TRUE; - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_x_spin), - digits); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_y_spin), - digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_x_spin), - climb_rate, 10.0*climb_rate); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_y_spin), - climb_rate, 10.0*climb_rate); - editor->priv->stop_signals = FALSE; - - /* Update units_labels */ - gtk_label_set_text (GTK_LABEL(editor->priv->pos_x_units_label), - units_string); - gtk_label_set_text (GTK_LABEL(editor->priv->pos_y_units_label), - units_string); - - /* Update values of x_spin/y_spin */ - gl_object_editor_set_position (editor, - editor->priv->x, - editor->priv->y); - gl_object_editor_set_max_position (editor, - editor->priv->x_max, - editor->priv->y_max); - - gl_debug (DEBUG_EDITOR, "END"); -} - diff --git a/glabels2/src/object-editor-private.h b/glabels2/src/object-editor-private.h deleted file mode 100644 index e83759ad..00000000 --- a/glabels2/src/object-editor-private.h +++ /dev/null @@ -1,204 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor-private.h: object properties editor module private header file - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __OBJECT_EDITOR_PRIVATE_H__ -#define __OBJECT_EDITOR_PRIVATE_H__ - -#include -#include - -G_BEGIN_DECLS - -struct _glObjectEditorPrivate { - - GladeXML *gui; - GtkWidget *editor_vbox; - - glLabel *label; - - gdouble units_per_point; - - GtkWidget *title_image; - GtkWidget *title_label; - GtkWidget *notebook; - - GtkWidget *pos_page_vbox; - GtkWidget *pos_x_spin; - GtkWidget *pos_y_spin; - GtkWidget *pos_x_units_label; - GtkWidget *pos_y_units_label; - gdouble x; - gdouble y; - gdouble x_max; - gdouble y_max; - - GtkWidget *size_page_vbox; - GtkWidget *size_w_spin; - GtkWidget *size_h_spin; - GtkWidget *size_w_units_label; - GtkWidget *size_h_units_label; - GtkWidget *size_aspect_checkbutton; - GtkWidget *size_reset_image_button; - gdouble size_aspect_ratio; - gdouble w; - gdouble h; - gdouble w_max; - gdouble h_max; - gdouble w_base; - gdouble h_base; - - GtkWidget *lsize_page_vbox; - GtkWidget *lsize_r_spin; - GtkWidget *lsize_theta_spin; - GtkWidget *lsize_r_units_label; - gdouble dx; - gdouble dy; - gdouble dx_max; - gdouble dy_max; - - GtkWidget *fill_page_vbox; - GtkWidget *fill_color_combo; - GtkWidget *fill_key_combo; - GtkWidget *fill_key_radio; - GtkWidget *fill_color_radio; - - GtkWidget *line_page_vbox; - GtkWidget *line_width_spin; - GtkWidget *line_color_radio; - GtkWidget *line_color_combo; - GtkWidget *line_key_radio; - GtkWidget *line_key_combo; - - GtkWidget *img_page_vbox; - GtkWidget *img_file_radio; - GtkWidget *img_key_radio; - GtkWidget *img_file_button; - GtkWidget *img_key_combo; - - GtkWidget *text_page_vbox; - GtkWidget *text_family_combo; - GtkWidget *text_size_spin; - GtkWidget *text_bold_toggle; - GtkWidget *text_italic_toggle; - GtkWidget *text_color_radio; - GtkWidget *text_color_combo; - GtkWidget *text_color_key_radio; - GtkWidget *text_color_key_combo; - GtkWidget *text_left_toggle; - GtkWidget *text_center_toggle; - GtkWidget *text_right_toggle; - GtkWidget *text_line_spacing_spin; - GtkWidget *text_auto_shrink_check; - - GtkWidget *edit_page_vbox; - GtkWidget *edit_text_view; - GtkWidget *edit_key_label; - GtkWidget *edit_key_combo; - GtkWidget *edit_insert_field_button; - - GtkWidget *bc_page_vbox; - GtkWidget *bc_style_combo; - GtkWidget *bc_text_check; - GtkWidget *bc_cs_check; - GtkWidget *bc_color_radio; - GtkWidget *bc_color_combo; - GtkWidget *bc_key_radio; - GtkWidget *bc_key_combo; - - GtkWidget *data_page_vbox; - GtkWidget *data_literal_radio; - GtkWidget *data_key_radio; - GtkWidget *data_text_entry; - GtkWidget *data_key_combo; - GtkWidget *data_format_label; - GtkWidget *data_ex_label; - GtkWidget *data_digits_label; - GtkWidget *data_digits_spin; - gboolean data_format_fixed_flag; - - GtkWidget *shadow_page_vbox; - GtkWidget *shadow_enable_check; - GtkWidget *shadow_controls_table; - GtkWidget *shadow_x_spin; - GtkWidget *shadow_y_spin; - GtkWidget *shadow_x_units_label; - GtkWidget *shadow_y_units_label; - GtkWidget *shadow_color_radio; - GtkWidget *shadow_key_radio; - GtkWidget *shadow_color_combo; - GtkWidget *shadow_key_combo; - GtkWidget *shadow_opacity_spin; - gdouble shadow_x; - gdouble shadow_y; - gdouble shadow_x_max; - gdouble shadow_y_max; - - /* Prevent recursion */ - gboolean stop_signals; -}; - -enum { - CHANGED, - SIZE_CHANGED, - LAST_SIGNAL -}; - -extern gint gl_object_editor_signals[LAST_SIGNAL]; - - - -void gl_object_editor_prepare_position_page (glObjectEditor *editor); - -void gl_object_editor_prepare_size_page (glObjectEditor *editor, - glObjectEditorOption option); - -void gl_object_editor_prepare_lsize_page (glObjectEditor *editor); - -void gl_object_editor_prepare_fill_page (glObjectEditor *editor); - -void gl_object_editor_prepare_line_page (glObjectEditor *editor); - -void gl_object_editor_prepare_image_page (glObjectEditor *editor); - -void gl_object_editor_prepare_text_page (glObjectEditor *editor); - -void gl_object_editor_prepare_edit_page (glObjectEditor *editor); - -void gl_object_editor_prepare_bc_page (glObjectEditor *editor); - -void gl_object_editor_prepare_data_page (glObjectEditor *editor); - -void gl_object_editor_prepare_shadow_page (glObjectEditor *editor); - - -void gl_object_editor_changed_cb (glObjectEditor *editor); -void gl_object_editor_size_changed_cb (glObjectEditor *editor); - -void lsize_prefs_changed_cb (glObjectEditor *editor); -void size_prefs_changed_cb (glObjectEditor *editor); -void position_prefs_changed_cb (glObjectEditor *editor); -void shadow_prefs_changed_cb (glObjectEditor *editor); - -G_END_DECLS - -#endif diff --git a/glabels2/src/object-editor-shadow-page.c b/glabels2/src/object-editor-shadow-page.c deleted file mode 100644 index 4be309e9..00000000 --- a/glabels2/src/object-editor-shadow-page.c +++ /dev/null @@ -1,494 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include -#include -#include - -#include "prefs.h" -#include "mygal/widget-color-combo.h" -#include "color.h" -#include "util.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void shadow_enable_check_toggled_cb (glObjectEditor *editor); -static void shadow_color_radio_toggled_cb (glObjectEditor *editor); - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare shadow page. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_prepare_shadow_page (glObjectEditor *editor) -{ - const gchar *units_string; - gdouble climb_rate; - gint digits; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Extract widgets from XML tree. */ - editor->priv->shadow_page_vbox - = glade_xml_get_widget (editor->priv->gui, "shadow_page_vbox"); - editor->priv->shadow_enable_check - = glade_xml_get_widget (editor->priv->gui, "shadow_enable_check"); - editor->priv->shadow_controls_table - = glade_xml_get_widget (editor->priv->gui, "shadow_controls_table"); - editor->priv->shadow_x_spin - = glade_xml_get_widget (editor->priv->gui, "shadow_x_spin"); - editor->priv->shadow_y_spin - = glade_xml_get_widget (editor->priv->gui, "shadow_y_spin"); - editor->priv->shadow_x_units_label - = glade_xml_get_widget (editor->priv->gui, "shadow_x_units_label"); - editor->priv->shadow_y_units_label - = glade_xml_get_widget (editor->priv->gui, "shadow_y_units_label"); - editor->priv->shadow_color_radio - = glade_xml_get_widget (editor->priv->gui, "shadow_color_radio"); - editor->priv->shadow_key_radio - = glade_xml_get_widget (editor->priv->gui, "shadow_key_radio"); - editor->priv->shadow_color_combo - = glade_xml_get_widget (editor->priv->gui, "shadow_color_combo"); - editor->priv->shadow_key_combo - = glade_xml_get_widget (editor->priv->gui, "shadow_key_combo"); - editor->priv->shadow_opacity_spin - = glade_xml_get_widget (editor->priv->gui, "shadow_opacity_spin"); - - gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->shadow_key_combo)); - - /* Get configuration information */ - units_string = gl_prefs_get_units_string (); - editor->priv->units_per_point = gl_prefs_get_units_per_point (); - climb_rate = gl_prefs_get_units_step_size (); - digits = gl_prefs_get_units_precision (); - - /* Modify widgets based on configuration */ - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_x_spin), digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->shadow_x_spin), - climb_rate, 10.0*climb_rate); - gtk_label_set_text (GTK_LABEL(editor->priv->shadow_x_units_label), units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin), digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin), - climb_rate, 10.0*climb_rate); - gtk_label_set_text (GTK_LABEL(editor->priv->shadow_y_units_label), units_string); - - /* Un-hide */ - gtk_widget_show_all (editor->priv->shadow_page_vbox); - - /* Connect signals */ - g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_enable_check), - "toggled", - G_CALLBACK (shadow_enable_check_toggled_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_x_spin), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_y_spin), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_color_combo), - "color_changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_key_combo), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_color_radio), - "toggled", - G_CALLBACK (shadow_color_radio_toggled_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_key_radio), - "toggled", - G_CALLBACK (shadow_color_radio_toggled_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_opacity_spin), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set shadow parameters. */ -/*****************************************************************************/ -void -gl_object_editor_set_shadow_state (glObjectEditor *editor, - gboolean state) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check), - state); - gtk_widget_set_sensitive (editor->priv->shadow_controls_table, state); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -void -gl_object_editor_set_shadow_offset (glObjectEditor *editor, - gdouble x, - gdouble y) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - /* save a copy in internal units */ - editor->priv->shadow_x = x; - editor->priv->shadow_y = y; - - /* convert internal units to displayed units */ - gl_debug (DEBUG_EDITOR, "internal x,y = %g, %g", x, y); - x *= editor->priv->units_per_point; - y *= editor->priv->units_per_point; - gl_debug (DEBUG_EDITOR, "display x,y = %g, %g", x, y); - - /* Set widget values */ - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), x); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), y); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -void -gl_object_editor_set_shadow_color (glObjectEditor *editor, - gboolean merge_flag, - glColorNode *color_node) -{ - GdkColor *gdk_color; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_widget_set_sensitive (editor->priv->shadow_key_radio, merge_flag); - - if ( color_node->color == GL_COLOR_NONE ) { - - color_combo_set_color_to_default (COLOR_COMBO(editor->priv->shadow_color_combo)); - - } else { - - gdk_color = gl_color_to_gdk_color (color_node->color); - color_combo_set_color (COLOR_COMBO(editor->priv->shadow_color_combo), - gdk_color); - g_free (gdk_color); - - } - - if (!color_node->field_flag) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->shadow_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->shadow_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->shadow_key_combo, FALSE); - - } else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->shadow_key_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->shadow_color_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->shadow_key_combo, TRUE); - - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->shadow_key_combo), - color_node->key); - } - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -void -gl_object_editor_set_shadow_opacity (glObjectEditor *editor, - gdouble alpha) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_opacity_spin), - alpha * 100.0); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - - -/*****************************************************************************/ -/* Set maximum shadow offset. */ -/*****************************************************************************/ -void -gl_object_editor_set_max_shadow_offset (glObjectEditor *editor, - gdouble x_max, - gdouble y_max) -{ - gdouble tmp; - - gl_debug (DEBUG_EDITOR, "START"); - - if (editor->priv->shadow_page_vbox) - { - - editor->priv->stop_signals = TRUE; - - /* save a copy in internal units */ - editor->priv->shadow_x_max = x_max; - editor->priv->shadow_y_max = y_max; - - /* convert internal units to displayed units */ - gl_debug (DEBUG_EDITOR, "internal x_max,y_max = %g, %g", x_max, y_max); - x_max *= editor->priv->units_per_point; - y_max *= editor->priv->units_per_point; - gl_debug (DEBUG_EDITOR, "display x_max,y_max = %g, %g", x_max, y_max); - - /* Set widget values */ - tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin)); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), - -x_max, x_max); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), tmp); - tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin)); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), - -y_max, y_max); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), tmp); - - editor->priv->stop_signals = FALSE; - - } - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query shadow parameters. */ -/*****************************************************************************/ -gboolean -gl_object_editor_get_shadow_state (glObjectEditor *editor) -{ - gboolean state; - - gl_debug (DEBUG_EDITOR, "START"); - - state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check)); - - gl_debug (DEBUG_EDITOR, "END"); - - return state; -} - -void -gl_object_editor_get_shadow_offset (glObjectEditor *editor, - gdouble *x, - gdouble *y) -{ - gl_debug (DEBUG_EDITOR, "START"); - - /* Get values from widgets */ - *x = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin)); - *y = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin)); - - /* convert everything back to our internal units (points) */ - *x /= editor->priv->units_per_point; - *y /= editor->priv->units_per_point; - - /* save a copy in internal units */ - editor->priv->shadow_x = *x; - editor->priv->shadow_y = *y; - - gl_debug (DEBUG_EDITOR, "END"); -} - -glColorNode* -gl_object_editor_get_shadow_color (glObjectEditor *editor) -{ - GdkColor *gdk_color; - gboolean is_default; - glColorNode *color_node; - - gl_debug (DEBUG_EDITOR, "START"); - - color_node = gl_color_node_new_default (); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_key_radio))) { - color_node->field_flag = TRUE; - color_node->key = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->shadow_key_combo)); - } else { - color_node->field_flag = FALSE; - color_node->key = NULL; - gdk_color = color_combo_get_color (COLOR_COMBO(editor->priv->shadow_color_combo), - &is_default); - - if (!is_default) { - color_node->color = gl_color_from_gdk_color (gdk_color); - } - } - - gl_debug (DEBUG_EDITOR, "END"); - - return color_node; -} - -gdouble -gl_object_editor_get_shadow_opacity (glObjectEditor *editor) -{ - gdouble alpha; - - gl_debug (DEBUG_EDITOR, "START"); - - alpha = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_opacity_spin)); - - gl_debug (DEBUG_EDITOR, "END"); - - return alpha / 100.0; -} - - -/*****************************************************************************/ -/* PRIVATE. Prefs changed callback. Update units related items. */ -/*****************************************************************************/ -void -shadow_prefs_changed_cb (glObjectEditor *editor) -{ - const gchar *units_string; - gdouble climb_rate; - gint digits; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Get new configuration information */ - units_string = gl_prefs_get_units_string (); - editor->priv->units_per_point = gl_prefs_get_units_per_point (); - climb_rate = gl_prefs_get_units_step_size (); - digits = gl_prefs_get_units_precision (); - - /* Update characteristics of x_spin/y_spin */ - editor->priv->stop_signals = TRUE; - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_x_spin), - digits); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin), - digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->shadow_x_spin), - climb_rate, 10.0*climb_rate); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin), - climb_rate, 10.0*climb_rate); - editor->priv->stop_signals = FALSE; - - /* Update units_labels */ - gtk_label_set_text (GTK_LABEL(editor->priv->shadow_x_units_label), - units_string); - gtk_label_set_text (GTK_LABEL(editor->priv->shadow_y_units_label), - units_string); - - /* Update values of x_spin/y_spin */ - gl_object_editor_set_shadow_offset (editor, - editor->priv->shadow_x, - editor->priv->shadow_y); - gl_object_editor_set_max_shadow_offset (editor, - editor->priv->shadow_x_max, - editor->priv->shadow_y_max); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. shadow enable check callback. */ -/*--------------------------------------------------------------------------*/ -static void -shadow_enable_check_toggled_cb (glObjectEditor *editor) -{ - gboolean state; - - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check)); - - gtk_widget_set_sensitive (editor->priv->shadow_controls_table, state); - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - - gl_debug (DEBUG_EDITOR, "END"); -} - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. shadow color radio callback. */ -/*--------------------------------------------------------------------------*/ -static void -shadow_color_radio_toggled_cb (glObjectEditor *editor) -{ - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_color_radio))) { - gtk_widget_set_sensitive (editor->priv->shadow_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->shadow_key_combo, FALSE); - } else { - gtk_widget_set_sensitive (editor->priv->shadow_color_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->shadow_key_combo, TRUE); - - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - - gl_debug (DEBUG_EDITOR, "END"); -} diff --git a/glabels2/src/object-editor-size-page.c b/glabels2/src/object-editor-size-page.c deleted file mode 100644 index 58cec074..00000000 --- a/glabels2/src/object-editor-size-page.c +++ /dev/null @@ -1,453 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include - -#include "prefs.h" -#include "wdgt-chain-button.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void aspect_toggle_cb (glObjectEditor *editor); -static void size_reset_cb (glObjectEditor *editor); -static void w_spin_cb (glObjectEditor *editor); -static void h_spin_cb (glObjectEditor *editor); - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare size page. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_prepare_size_page (glObjectEditor *editor, - glObjectEditorOption option) -{ - const gchar *units_string; - gdouble climb_rate; - gint digits; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Extract widgets from XML tree. */ - editor->priv->size_page_vbox = - glade_xml_get_widget (editor->priv->gui, "size_page_vbox"); - editor->priv->size_w_spin = - glade_xml_get_widget (editor->priv->gui, "size_w_spin"); - editor->priv->size_h_spin = - glade_xml_get_widget (editor->priv->gui, "size_h_spin"); - editor->priv->size_w_units_label = - glade_xml_get_widget (editor->priv->gui, "size_w_units_label"); - editor->priv->size_h_units_label = - glade_xml_get_widget (editor->priv->gui, "size_h_units_label"); - editor->priv->size_aspect_checkbutton = - glade_xml_get_widget (editor->priv->gui, "size_aspect_checkbutton"); - editor->priv->size_reset_image_button = - glade_xml_get_widget (editor->priv->gui, "size_reset_image_button"); - - /* Get configuration information */ - units_string = gl_prefs_get_units_string (); - editor->priv->units_per_point = gl_prefs_get_units_per_point (); - climb_rate = gl_prefs_get_units_step_size (); - digits = gl_prefs_get_units_precision (); - - /* Modify widgets based on configuration */ - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_w_spin), digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_w_spin), - climb_rate, 10.0*climb_rate); - gtk_label_set_text (GTK_LABEL(editor->priv->size_w_units_label), units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_h_spin), digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_h_spin), - climb_rate, 10.0*climb_rate); - gtk_label_set_text (GTK_LABEL(editor->priv->size_h_units_label), units_string); - - /* Un-hide */ - gtk_widget_show_all (editor->priv->size_page_vbox); - if (option != GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE) { - gtk_widget_hide (editor->priv->size_reset_image_button); - } - - /* Connect signals */ - g_signal_connect_swapped (G_OBJECT (editor->priv->size_aspect_checkbutton), - "toggled", - G_CALLBACK (aspect_toggle_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->size_w_spin), - "changed", - G_CALLBACK (w_spin_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->size_h_spin), - "changed", - G_CALLBACK (h_spin_cb), - G_OBJECT (editor)); - - if (option == GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE) { - g_signal_connect_swapped (G_OBJECT (editor->priv->size_reset_image_button), - "clicked", - G_CALLBACK (size_reset_cb), - G_OBJECT (editor)); - } - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Maintain aspect ratio checkbox callback. */ -/*--------------------------------------------------------------------------*/ -static void -aspect_toggle_cb (glObjectEditor *editor) -{ - glWdgtChainButton *toggle; - gdouble w, h; - - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton); - - if (gl_wdgt_chain_button_get_active (toggle)) { - - w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->size_w_spin)); - h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->size_h_spin)); - - editor->priv->size_aspect_ratio = h / w; - - } - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. W spin button changed callback. */ -/*--------------------------------------------------------------------------*/ -static void -w_spin_cb (glObjectEditor *editor) -{ - gdouble w, h; - glWdgtChainButton *toggle; - - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton); - - if (gl_wdgt_chain_button_get_active (toggle)) { - - w = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin)); - - h = w * editor->priv->size_aspect_ratio; - - /* Update our sibling control, blocking recursion. */ - editor->priv->stop_signals = TRUE; - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), h); - editor->priv->stop_signals = FALSE; - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[SIZE_CHANGED], 0); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. H spin button changed callback. */ -/*--------------------------------------------------------------------------*/ -static void -h_spin_cb (glObjectEditor *editor) -{ - gdouble w, h; - glWdgtChainButton *toggle; - - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton); - - if (gl_wdgt_chain_button_get_active (toggle)) { - - h = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin)); - - w = h / editor->priv->size_aspect_ratio; - - /* Update our sibling control, blocking recursion. */ - editor->priv->stop_signals = TRUE; - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), w); - editor->priv->stop_signals = FALSE; - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[SIZE_CHANGED], 0); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Reset image size callback. */ -/*--------------------------------------------------------------------------*/ -static void -size_reset_cb (glObjectEditor *editor) -{ - gdouble w_base, h_base; - gdouble w_max, h_max, wh_max; - gdouble aspect_ratio; - - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - w_base = editor->priv->w_base; - h_base = editor->priv->h_base; - - w_max = editor->priv->w_max; - h_max = editor->priv->h_max; - wh_max = MAX( w_max, h_max ); - - if ( (w_base > wh_max) || (h_base > wh_max) ) { - - aspect_ratio = h_base / w_base; - - if ( aspect_ratio < 1.0 ) { - w_base = wh_max; - h_base = wh_max * aspect_ratio; - - } else { - w_base = wh_max / aspect_ratio; - h_base = wh_max; - } - } - - w_base *= editor->priv->units_per_point; - h_base *= editor->priv->units_per_point; - - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), - w_base); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), - h_base); - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[SIZE_CHANGED], 0); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set size. */ -/*****************************************************************************/ -void -gl_object_editor_set_size (glObjectEditor *editor, - gdouble w, - gdouble h) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - /* save a copy in internal units */ - editor->priv->w = w; - editor->priv->h = h; - - /* convert internal units to displayed units */ - gl_debug (DEBUG_EDITOR, "internal w,h = %g, %g", w, h); - w *= editor->priv->units_per_point; - h *= editor->priv->units_per_point; - gl_debug (DEBUG_EDITOR, "display w,h = %g, %g", w, h); - - /* Set widget values */ - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), w); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), h); - - /* Update aspect ratio */ - editor->priv->size_aspect_ratio = h / w; - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set maximum size. */ -/*****************************************************************************/ -void -gl_object_editor_set_max_size (glObjectEditor *editor, - gdouble w_max, - gdouble h_max) -{ - gdouble tmp; - gdouble wh_max; - - gl_debug (DEBUG_EDITOR, "START"); - - if (editor->priv->size_page_vbox) - { - - editor->priv->stop_signals = TRUE; - - /* save a copy in internal units */ - editor->priv->w_max = w_max; - editor->priv->h_max = h_max; - - /* convert internal units to displayed units */ - gl_debug (DEBUG_EDITOR, "internal w_max,h_max = %g, %g", w_max, h_max); - w_max *= editor->priv->units_per_point; - h_max *= editor->priv->units_per_point; - wh_max = MAX( w_max, h_max ); - gl_debug (DEBUG_EDITOR, "display w_max,h_max = %g, %g", w_max, h_max); - - /* Set widget values */ - tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin)); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_w_spin), - 0.0, 2.0*wh_max); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), tmp); - tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin)); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_h_spin), - 0.0, 2.0*wh_max); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), tmp); - - editor->priv->stop_signals = FALSE; - - } - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set base or natural size of image. */ -/*****************************************************************************/ -void -gl_object_editor_set_base_size (glObjectEditor *editor, - gdouble w_base, - gdouble h_base) -{ - gl_debug (DEBUG_EDITOR, "Setting w_base = %g", w_base); - gl_debug (DEBUG_EDITOR, "Setting h_base = %g", h_base); - - editor->priv->w_base = w_base; - editor->priv->h_base = h_base; -} - -/*****************************************************************************/ -/* Query size. */ -/*****************************************************************************/ -void -gl_object_editor_get_size (glObjectEditor *editor, - gdouble *w, - gdouble *h) -{ - gl_debug (DEBUG_EDITOR, "START"); - - - /* Get values from widgets */ - *w = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin)); - *h = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin)); - - /* convert everything back to our internal units (points) */ - *w /= editor->priv->units_per_point; - *h /= editor->priv->units_per_point; - - /* save a copy in internal units */ - editor->priv->w = *w; - editor->priv->h = *h; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* PRIVATE. Prefs changed callback. Update units related items. */ -/*****************************************************************************/ -void -size_prefs_changed_cb (glObjectEditor *editor) -{ - const gchar *units_string; - gdouble climb_rate; - gint digits; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Get new configuration information */ - units_string = gl_prefs_get_units_string (); - editor->priv->units_per_point = gl_prefs_get_units_per_point (); - climb_rate = gl_prefs_get_units_step_size (); - digits = gl_prefs_get_units_precision (); - - /* Update characteristics of w_spin/h_spin */ - editor->priv->stop_signals = TRUE; - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_w_spin), - digits); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_h_spin), - digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_w_spin), - climb_rate, 10.0*climb_rate); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_h_spin), - climb_rate, 10.0*climb_rate); - editor->priv->stop_signals = FALSE; - - /* Update units_labels */ - gtk_label_set_text (GTK_LABEL(editor->priv->size_w_units_label), - units_string); - gtk_label_set_text (GTK_LABEL(editor->priv->size_h_units_label), - units_string); - - /* Update values of w_spin/h_spin */ - gl_object_editor_set_size (editor, - editor->priv->w, - editor->priv->h); - gl_object_editor_set_max_size (editor, - editor->priv->w_max, - editor->priv->h_max); - - gl_debug (DEBUG_EDITOR, "END"); -} - diff --git a/glabels2/src/object-editor-text-page.c b/glabels2/src/object-editor-text-page.c deleted file mode 100644 index e8a463da..00000000 --- a/glabels2/src/object-editor-text-page.c +++ /dev/null @@ -1,636 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include -#include - -#include "prefs.h" -#include "mygal/widget-color-combo.h" -#include "color.h" -#include "util.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void align_toggle_cb (GtkToggleButton *toggle, - glObjectEditor *editor); -static void text_radio_toggled_cb (glObjectEditor *editor); - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare size page. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_prepare_text_page (glObjectEditor *editor) -{ - GList *family_names = NULL; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Extract widgets from XML tree. */ - editor->priv->text_page_vbox = - glade_xml_get_widget (editor->priv->gui, "text_page_vbox"); - editor->priv->text_family_combo = - glade_xml_get_widget (editor->priv->gui, "text_family_combo"); - editor->priv->text_size_spin = - glade_xml_get_widget (editor->priv->gui, "text_size_spin"); - editor->priv->text_bold_toggle = - glade_xml_get_widget (editor->priv->gui, "text_bold_toggle"); - editor->priv->text_italic_toggle = - glade_xml_get_widget (editor->priv->gui, "text_italic_toggle"); - editor->priv->text_color_combo = - glade_xml_get_widget (editor->priv->gui, "text_color_combo"); - editor->priv->text_color_radio = - glade_xml_get_widget (editor->priv->gui, "text_color_radio"); - editor->priv->text_color_key_radio = - glade_xml_get_widget (editor->priv->gui, "text_color_key_radio"); - editor->priv->text_color_key_combo = - glade_xml_get_widget (editor->priv->gui, "text_color_key_combo"); - editor->priv->text_left_toggle = - glade_xml_get_widget (editor->priv->gui, "text_left_toggle"); - editor->priv->text_center_toggle = - glade_xml_get_widget (editor->priv->gui, "text_center_toggle"); - editor->priv->text_right_toggle = - glade_xml_get_widget (editor->priv->gui, "text_right_toggle"); - editor->priv->text_line_spacing_spin = - glade_xml_get_widget (editor->priv->gui, "text_line_spacing_spin"); - editor->priv->text_auto_shrink_check = - glade_xml_get_widget (editor->priv->gui, "text_auto_shrink_check"); - - gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->text_family_combo)); - gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->text_color_key_combo)); - - /* Load family names */ - family_names = gl_util_get_font_family_list (); - gl_util_combo_box_set_strings (GTK_COMBO_BOX(editor->priv->text_family_combo), - family_names); - - /* Modify widgets */ - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE); - - /* Un-hide */ - gtk_widget_show_all (editor->priv->text_page_vbox); - - /* Connect signals */ - g_signal_connect_swapped (G_OBJECT (editor->priv->text_family_combo), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->text_size_spin), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->text_bold_toggle), - "toggled", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->text_italic_toggle), - "toggled", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->text_color_combo), - "color_changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->text_color_key_combo), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->text_color_radio), - "toggled", - G_CALLBACK (text_radio_toggled_cb), - G_OBJECT (editor)); - g_signal_connect_swapped (G_OBJECT (editor->priv->text_color_key_radio), - "toggled", - G_CALLBACK (text_radio_toggled_cb), - G_OBJECT (editor)); - - g_signal_connect (G_OBJECT (editor->priv->text_left_toggle), - "toggled", - G_CALLBACK (align_toggle_cb), - G_OBJECT (editor)); - g_signal_connect (G_OBJECT (editor->priv->text_center_toggle), - "toggled", - G_CALLBACK (align_toggle_cb), - G_OBJECT (editor)); - g_signal_connect (G_OBJECT (editor->priv->text_right_toggle), - "toggled", - G_CALLBACK (align_toggle_cb), - G_OBJECT (editor)); - - g_signal_connect_swapped (G_OBJECT (editor->priv->text_line_spacing_spin), - "changed", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - - g_signal_connect_swapped (G_OBJECT (editor->priv->text_auto_shrink_check), - "toggled", - G_CALLBACK (gl_object_editor_changed_cb), - G_OBJECT (editor)); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Alignment togglebutton callback. */ -/*--------------------------------------------------------------------------*/ -static void -align_toggle_cb (GtkToggleButton *toggle, - glObjectEditor *editor) -{ - if (editor->priv->stop_signals) return; - - if (gtk_toggle_button_get_active (toggle)) { - - if (GTK_WIDGET (toggle) == GTK_WIDGET (editor->priv->text_left_toggle)) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->text_center_toggle), - FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->text_right_toggle), - FALSE); - } else if (GTK_WIDGET (toggle) == - GTK_WIDGET (editor->priv->text_center_toggle)) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->text_left_toggle), - FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->text_right_toggle), - FALSE); - } else if (GTK_WIDGET (toggle) == - GTK_WIDGET (editor->priv->text_right_toggle)) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->text_left_toggle), - FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->text_center_toggle), - FALSE); - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - } - -} - -/*****************************************************************************/ -/* Set font family. */ -/*****************************************************************************/ -void -gl_object_editor_set_font_family (glObjectEditor *editor, - const gchar *font_family) -{ - GList *family_names; - gchar *old_font_family; - gchar *good_font_family; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - old_font_family = gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->text_family_combo)); - - if ( !old_font_family || g_utf8_collate( old_font_family, font_family ) ) - { - - /* Make sure we have a valid font family. if not provide a good default. */ - family_names = gl_util_get_font_family_list (); - if (g_list_find_custom (family_names, font_family, (GCompareFunc)g_utf8_collate)) { - good_font_family = g_strdup (font_family); - } else { - if (family_names != NULL) { - good_font_family = g_strdup (family_names->data); /* 1st entry */ - } else { - good_font_family = NULL; - } - } - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->text_family_combo), good_font_family); - g_free (good_font_family); - } - - g_free (old_font_family); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query font family. */ -/*****************************************************************************/ -gchar * -gl_object_editor_get_font_family (glObjectEditor *editor) -{ - gchar *font_family; - - gl_debug (DEBUG_EDITOR, "START"); - - font_family = gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->text_family_combo)); - - gl_debug (DEBUG_EDITOR, "END"); - - return font_family; -} - -/*****************************************************************************/ -/* Set font size. */ -/*****************************************************************************/ -void -gl_object_editor_set_font_size (glObjectEditor *editor, - gdouble font_size) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->text_size_spin), - font_size); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query font size. */ -/*****************************************************************************/ -gdouble -gl_object_editor_get_font_size (glObjectEditor *editor) -{ - gdouble font_size; - - gl_debug (DEBUG_EDITOR, "START"); - - font_size = - gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->text_size_spin)); - - gl_debug (DEBUG_EDITOR, "END"); - - return font_size; -} - -/*****************************************************************************/ -/* Set font weight. */ -/*****************************************************************************/ -void -gl_object_editor_set_font_weight (glObjectEditor *editor, - PangoWeight font_weight) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_bold_toggle), - (font_weight == PANGO_WEIGHT_BOLD)); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query font weight. */ -/*****************************************************************************/ -PangoWeight -gl_object_editor_get_font_weight (glObjectEditor *editor) -{ - PangoWeight font_weight; - - gl_debug (DEBUG_EDITOR, "START"); - - if (gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON (editor->priv->text_bold_toggle))) { - font_weight = PANGO_WEIGHT_BOLD; - } else { - font_weight = PANGO_WEIGHT_NORMAL; - } - - gl_debug (DEBUG_EDITOR, "END"); - - return font_weight; -} - -/*****************************************************************************/ -/* Set font italic flag. */ -/*****************************************************************************/ -void -gl_object_editor_set_font_italic_flag (glObjectEditor *editor, - gboolean font_italic_flag) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_italic_toggle), - font_italic_flag); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query font italic flag. */ -/*****************************************************************************/ -gboolean -gl_object_editor_get_font_italic_flag (glObjectEditor *editor) -{ - gboolean italic_flag; - - gl_debug (DEBUG_EDITOR, "START"); - - italic_flag = - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON - (editor->priv->text_italic_toggle)); - - gl_debug (DEBUG_EDITOR, "END"); - - return italic_flag; -} - -/*****************************************************************************/ -/* Set text alignment. */ -/*****************************************************************************/ -void -gl_object_editor_set_text_alignment (glObjectEditor *editor, - PangoAlignment align) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_left_toggle), - (align == PANGO_ALIGN_LEFT)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_center_toggle), - (align == PANGO_ALIGN_CENTER)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_right_toggle), - (align == PANGO_ALIGN_RIGHT)); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query text alignment. */ -/*****************************************************************************/ -PangoAlignment -gl_object_editor_get_text_alignment (glObjectEditor *editor) -{ - PangoAlignment align; - - gl_debug (DEBUG_EDITOR, "START"); - - if (gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON (editor->priv->text_left_toggle))) { - align = PANGO_ALIGN_LEFT; - } else - if (gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON (editor->priv->text_right_toggle))) { - align = PANGO_ALIGN_RIGHT; - } else - if (gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON (editor->priv->text_center_toggle))) { - align = PANGO_ALIGN_CENTER; - } else { - align = PANGO_ALIGN_LEFT; /* Should not happen. */ - } - - gl_debug (DEBUG_EDITOR, "END"); - - return align; -} - -/*****************************************************************************/ -/* Set text color. */ -/*****************************************************************************/ -void -gl_object_editor_set_text_color (glObjectEditor *editor, - gboolean merge_flag, - glColorNode *text_color_node) -{ - GdkColor *gdk_color; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gl_debug (DEBUG_EDITOR, "color field %s(%d) / %X", text_color_node->key, text_color_node->field_flag, text_color_node->color); - - gtk_widget_set_sensitive (editor->priv->text_color_key_radio, merge_flag); - - if ( text_color_node->color == GL_COLOR_NONE ) { - - color_combo_set_color_to_default (COLOR_COMBO(editor->priv->text_color_combo)); - - } else { - - gdk_color = gl_color_to_gdk_color (text_color_node->color); - color_combo_set_color (COLOR_COMBO(editor->priv->text_color_combo), gdk_color); - g_free (gdk_color); - } - - if (!text_color_node->field_flag) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->text_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE); - gl_debug (DEBUG_EDITOR, "color field false 0"); - gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE); - - } else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (editor->priv->text_color_key_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->text_color_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->text_color_key_combo, TRUE); - - gl_debug (DEBUG_EDITOR, "color field true 1"); - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->text_color_key_combo), ""); - gl_debug (DEBUG_EDITOR, "color field true 2"); - } - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query text color. */ -/*****************************************************************************/ -glColorNode* -gl_object_editor_get_text_color (glObjectEditor *editor) -{ - GdkColor *gdk_color; - glColorNode *color_node; - gboolean is_default; - - gl_debug (DEBUG_EDITOR, "START"); - - color_node = gl_color_node_new_default (); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_key_radio))) { - color_node->field_flag = TRUE; - color_node->color = gl_prefs->default_text_color; - color_node->key = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->text_color_key_combo)); - } else { - color_node->field_flag = FALSE; - color_node->key = NULL; - gdk_color = color_combo_get_color (COLOR_COMBO(editor->priv->text_color_combo), - &is_default); - - if (is_default) { - color_node->color = gl_prefs->default_text_color; - } else { - color_node->color = gl_color_from_gdk_color (gdk_color); - } - } - - gl_debug (DEBUG_EDITOR, "END"); - - return color_node; -} - - -/*****************************************************************************/ -/* Set text line spacing. */ -/*****************************************************************************/ -void -gl_object_editor_set_text_line_spacing (glObjectEditor *editor, - gdouble text_line_spacing) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->text_line_spacing_spin), - text_line_spacing); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query text line spacing. */ -/*****************************************************************************/ -gdouble -gl_object_editor_get_text_line_spacing (glObjectEditor *editor) -{ - gdouble text_line_spacing; - - gl_debug (DEBUG_EDITOR, "START"); - - text_line_spacing = - gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->text_line_spacing_spin)); - - gl_debug (DEBUG_EDITOR, "END"); - - return text_line_spacing; -} - -/*****************************************************************************/ -/* Set auto shrink checkbox. */ -/*****************************************************************************/ -void -gl_object_editor_set_text_auto_shrink (glObjectEditor *editor, - gboolean auto_shrink) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->stop_signals = TRUE; - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_auto_shrink_check), - auto_shrink); - - editor->priv->stop_signals = FALSE; - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Query auto shrink checkbox. */ -/*****************************************************************************/ -gboolean gl_object_editor_get_text_auto_shrink (glObjectEditor *editor) -{ - gboolean auto_shrink; - - gl_debug (DEBUG_EDITOR, "START"); - - auto_shrink = - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->text_auto_shrink_check)); - - gl_debug (DEBUG_EDITOR, "END"); - - return auto_shrink; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. color radio callback. */ -/*--------------------------------------------------------------------------*/ -static void -text_radio_toggled_cb (glObjectEditor *editor) -{ - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_radio))) { - gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE); - } else { - gtk_widget_set_sensitive (editor->priv->text_color_combo, FALSE); - gtk_widget_set_sensitive (editor->priv->text_color_key_combo, TRUE); - - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - - gl_debug (DEBUG_EDITOR, "END"); -} diff --git a/glabels2/src/object-editor.c b/glabels2/src/object-editor.c deleted file mode 100644 index 02a153d6..00000000 --- a/glabels2/src/object-editor.c +++ /dev/null @@ -1,693 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/** - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.c: object properties editor module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "object-editor.h" - -#include -#include -#include -#include -#include -#include - -#include - -#include "prefs.h" -#include "mygal/widget-color-combo.h" -#include "color.h" -#include "wdgt-chain-button.h" -#include "marshal.h" -#include "util.h" - -#include "object-editor-private.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros */ -/*===========================================*/ - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -typedef void (*ChangedSignal) (GObject * object, gpointer data); - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -gint gl_object_editor_signals[LAST_SIGNAL] = { 0 }; - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_object_editor_finalize (GObject *object); - -static void gl_object_notebook_construct_valist (glObjectEditor *editor, - glLabel *label, - glObjectEditorOption first_option, - va_list args); - -static void prefs_changed_cb (glObjectEditor *editor); - -static void label_changed_cb (glLabel *label, - glObjectEditor *editor); - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glObjectEditor, gl_object_editor, GTK_TYPE_VBOX); - -static void -gl_object_editor_class_init (glObjectEditorClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_EDITOR, "START"); - - gl_object_editor_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_object_editor_finalize; - - gl_object_editor_signals[CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glObjectEditorClass, changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - gl_object_editor_signals[SIZE_CHANGED] = - g_signal_new ("size_changed", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glObjectEditorClass, size_changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - gl_debug (DEBUG_EDITOR, "END"); -} - -static void -gl_object_editor_init (glObjectEditor *editor) -{ - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv = g_new0 (glObjectEditorPrivate, 1); - - editor->priv->gui = glade_xml_new (GLABELS_GLADE_DIR "object-editor.glade", - "editor_vbox", - NULL); - - if (!editor->priv->gui) { - g_critical ("Could not open object-editor.glade. gLabels may not be installed correctly!"); - return; - } - - editor->priv->editor_vbox = glade_xml_get_widget (editor->priv->gui, - "editor_vbox"); - gtk_box_pack_start (GTK_BOX(editor), - editor->priv->editor_vbox, - FALSE, FALSE, 0); - - editor->priv->title_image = glade_xml_get_widget (editor->priv->gui, - "title_image"); - editor->priv->title_label = glade_xml_get_widget (editor->priv->gui, - "title_label"); - editor->priv->notebook = glade_xml_get_widget (editor->priv->gui, - "notebook"); - - gtk_widget_show_all (GTK_WIDGET(editor)); - - /* Hide all notebook pages to start with. */ - gtk_widget_hide_all (editor->priv->notebook); - gtk_widget_set_no_show_all (editor->priv->notebook, TRUE); - - gl_debug (DEBUG_EDITOR, "END"); -} - -static void -gl_object_editor_finalize (GObject *object) -{ - glObjectEditor* editor = GL_OBJECT_EDITOR (object);; - - gl_debug (DEBUG_EDITOR, "START"); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_OBJECT_EDITOR (editor)); - g_return_if_fail (editor->priv != NULL); - - g_signal_handlers_disconnect_by_func (G_OBJECT(gl_prefs), - prefs_changed_cb, editor); - g_signal_handlers_disconnect_by_func (G_OBJECT(editor->priv->label), - label_changed_cb, editor); - - g_object_unref (editor->priv->gui); - g_free (editor->priv); - - G_OBJECT_CLASS (gl_object_editor_parent_class)->finalize (object); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* NEW object editor. */ -/*****************************************************************************/ -GtkWidget* -gl_object_editor_new (gchar *image, - gchar *title, - glLabel *label, - glObjectEditorOption first_option, ...) -{ - glObjectEditor *editor; - va_list args; - - gl_debug (DEBUG_EDITOR, "START"); - - editor = GL_OBJECT_EDITOR (g_object_new (GL_TYPE_OBJECT_EDITOR, NULL)); - - if (image) { - gtk_image_set_from_stock (GTK_IMAGE(editor->priv->title_image), - image, - GTK_ICON_SIZE_LARGE_TOOLBAR); - } - - if (title) { - gchar *s; - - s = g_strdup_printf ("%s", - title); - gtk_label_set_text (GTK_LABEL(editor->priv->title_label), s); - g_free (s); - - gtk_label_set_use_markup (GTK_LABEL(editor->priv->title_label), TRUE); - - } - - gtk_notebook_set_homogeneous_tabs (GTK_NOTEBOOK(editor->priv->notebook), TRUE); - - va_start (args, first_option); - gl_object_notebook_construct_valist (editor, label, first_option, args); - va_end (args); - - gl_debug (DEBUG_EDITOR, "END"); - - return GTK_WIDGET(editor); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct notebook. */ -/*--------------------------------------------------------------------------*/ -static void -gl_object_notebook_construct_valist (glObjectEditor *editor, - glLabel *label, - glObjectEditorOption first_option, - va_list args) -{ - glObjectEditorOption option; - gint pages = 0; - - gl_debug (DEBUG_EDITOR, "START"); - - editor->priv->label = label; - - option = first_option; - - for ( option=first_option; option; option=va_arg (args, glObjectEditorOption) ) { - - switch (option) { - - case GL_OBJECT_EDITOR_EMPTY: - gtk_widget_set_sensitive (editor->priv->title_image, FALSE); - gtk_widget_set_sensitive (editor->priv->title_label, FALSE); - break; - - case GL_OBJECT_EDITOR_POSITION_PAGE: - gl_object_editor_prepare_position_page (editor); - pages++; - break; - - case GL_OBJECT_EDITOR_SIZE_PAGE: - case GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE: - gl_object_editor_prepare_size_page (editor, option); - pages++; - break; - - case GL_OBJECT_EDITOR_SIZE_LINE_PAGE: - gl_object_editor_prepare_lsize_page (editor); - pages++; - break; - - case GL_OBJECT_EDITOR_FILL_PAGE: - gl_object_editor_prepare_fill_page (editor); - pages++; - break; - - case GL_OBJECT_EDITOR_LINE_PAGE: - gl_object_editor_prepare_line_page (editor); - pages++; - break; - - case GL_OBJECT_EDITOR_IMAGE_PAGE: - gl_object_editor_prepare_image_page (editor); - pages++; - break; - - case GL_OBJECT_EDITOR_TEXT_PAGE: - gl_object_editor_prepare_text_page (editor); - pages++; - break; - - case GL_OBJECT_EDITOR_EDIT_PAGE: - gl_object_editor_prepare_edit_page (editor); - pages++; - break; - - case GL_OBJECT_EDITOR_BC_PAGE: - gl_object_editor_prepare_bc_page (editor); - pages++; - break; - - case GL_OBJECT_EDITOR_DATA_PAGE: - gl_object_editor_prepare_data_page (editor); - pages++; - break; - - case GL_OBJECT_EDITOR_SHADOW_PAGE: - gl_object_editor_prepare_shadow_page (editor); - pages++; - break; - - default: - g_message ("option = %d", option); - g_assert_not_reached (); - } - - } - if (pages) { - gtk_widget_show (editor->priv->notebook); - } - - g_signal_connect_swapped (G_OBJECT (gl_prefs), "changed", - G_CALLBACK (prefs_changed_cb), - editor); - if (label) - { - label_changed_cb (label, editor); - g_signal_connect (G_OBJECT (label), "size_changed", - G_CALLBACK (label_changed_cb), - editor); - g_signal_connect (G_OBJECT (label), "merge_changed", - G_CALLBACK (label_changed_cb), - editor); - } - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Widget changed callback. Emit our "changed" signal. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_changed_cb (glObjectEditor *editor) -{ - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Widget size changed callback. Emit our "size-changed" signal. */ -/*--------------------------------------------------------------------------*/ -void -gl_object_editor_size_changed_cb (glObjectEditor *editor) -{ - if (editor->priv->stop_signals) return; - - gl_debug (DEBUG_EDITOR, "START"); - - /* Emit our "size_changed" signal */ - g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[SIZE_CHANGED], 0); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Set possible key names from merge object. */ -/*****************************************************************************/ -void -gl_object_editor_set_key_names (glObjectEditor *editor, - glMerge *merge) -{ - GList *keys; - GtkWidget *combo; - gboolean fixed_flag; - gboolean state; - - gl_debug (DEBUG_EDITOR, "START"); - - if (editor->priv->edit_key_label) { - gtk_widget_set_sensitive (editor->priv->edit_key_label, merge != NULL); - } - - if (editor->priv->edit_key_combo) { - gtk_widget_set_sensitive (editor->priv->edit_key_combo, merge != NULL); - } - - if (editor->priv->text_auto_shrink_check) { - gtk_widget_set_sensitive (editor->priv->text_auto_shrink_check, - merge != NULL); - } - - if (editor->priv->text_page_vbox) { - gtk_widget_set_sensitive (editor->priv->text_color_key_radio, merge != NULL); - if (merge == NULL) { - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(editor->priv->text_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE); - } else { - state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->text_color_key_radio)); - gtk_widget_set_sensitive (editor->priv->text_color_combo, !state); - gtk_widget_set_sensitive (editor->priv->text_color_key_combo, state); - - } - } - - if (editor->priv->edit_insert_field_button) { - gtk_widget_set_sensitive (editor->priv->edit_insert_field_button, - merge != NULL); - } - - if (editor->priv->img_key_combo) { - gtk_widget_set_sensitive (editor->priv->img_key_combo, merge != NULL); - } - - if (editor->priv->img_key_radio) { - gtk_widget_set_sensitive (editor->priv->img_key_radio, merge != NULL); - if (merge == NULL) { - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(editor->priv->img_file_radio), TRUE); - } - } - - if (editor->priv->data_key_combo) { - gtk_widget_set_sensitive (editor->priv->data_key_combo, merge != NULL); - } - - if (editor->priv->data_key_radio) { - gtk_widget_set_sensitive (editor->priv->data_key_radio, merge != NULL); - if (merge == NULL) { - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(editor->priv->data_literal_radio), TRUE); - } - } - - fixed_flag = editor->priv->data_format_fixed_flag; - if (editor->priv->data_format_label) { - gtk_widget_set_sensitive (editor->priv->data_format_label, - (merge != NULL)); - } - if (editor->priv->data_ex_label) { - gtk_widget_set_sensitive (editor->priv->data_ex_label, - (merge != NULL)); - } - if (editor->priv->data_digits_label) { - gtk_widget_set_sensitive (editor->priv->data_digits_label, - (merge != NULL) && !fixed_flag); - } - if (editor->priv->data_digits_spin) { - gtk_widget_set_sensitive (editor->priv->data_digits_spin, - (merge != NULL) && !fixed_flag); - } - - if (editor->priv->fill_page_vbox) { - gtk_widget_set_sensitive (editor->priv->fill_key_radio, merge != NULL); - if (merge == NULL) { - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(editor->priv->fill_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE); - } else { - state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->fill_key_radio)); - gtk_widget_set_sensitive (editor->priv->fill_color_combo, !state); - gtk_widget_set_sensitive (editor->priv->fill_key_combo, state); - - } - } - - if (editor->priv->line_page_vbox) { - gtk_widget_set_sensitive (editor->priv->line_key_radio, merge != NULL); - if (merge == NULL) { - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(editor->priv->line_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->line_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->line_key_combo, FALSE); - } else { - state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->line_key_radio)); - gtk_widget_set_sensitive (editor->priv->line_color_combo, !state); - gtk_widget_set_sensitive (editor->priv->line_key_combo, state); - - } - } - - if (editor->priv->bc_page_vbox) { - gtk_widget_set_sensitive (editor->priv->bc_key_radio, merge != NULL); - if (merge == NULL) { - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(editor->priv->bc_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->bc_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->bc_key_combo, FALSE); - } else { - state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->bc_key_radio)); - gtk_widget_set_sensitive (editor->priv->bc_color_combo, !state); - gtk_widget_set_sensitive (editor->priv->bc_key_combo, state); - - } - } - - if (editor->priv->shadow_page_vbox) { - gtk_widget_set_sensitive (editor->priv->shadow_key_radio, merge != NULL); - if (merge == NULL) { - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(editor->priv->shadow_color_radio), TRUE); - gtk_widget_set_sensitive (editor->priv->shadow_color_combo, TRUE); - gtk_widget_set_sensitive (editor->priv->shadow_key_combo, FALSE); - } else { - state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->shadow_key_radio)); - gtk_widget_set_sensitive (editor->priv->shadow_color_combo, !state); - gtk_widget_set_sensitive (editor->priv->shadow_key_combo, state); - - } - } - - keys = gl_merge_get_key_list (merge); - if ( keys == NULL ) { - keys = g_list_append (keys, g_strdup ("")); - } - - combo = editor->priv->img_key_combo; - if (combo) { - gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); - } - - combo = editor->priv->edit_key_combo; - if (combo) { - gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); - } - - combo = editor->priv->data_key_combo; - if (combo) { - gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); - } - - combo = editor->priv->fill_key_combo; - if (combo) { - gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); - } - - combo = editor->priv->text_color_key_combo; - if (combo) { - gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); - } - - combo = editor->priv->line_key_combo; - if (combo) { - gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); - } - - combo = editor->priv->bc_key_combo; - if (combo) { - gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); - } - - combo = editor->priv->shadow_key_combo; - if (combo) { - gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); - } - - gl_merge_free_key_list (&keys); - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*****************************************************************************/ -/* Construct color combo "Custom widget". */ -/*****************************************************************************/ -GtkWidget * -gl_object_editor_construct_color_combo (gchar *name, - gchar *string1, - gchar *string2, - gint int1, - gint int2) -{ - GtkWidget *color_combo; - ColorGroup *cg; - gchar *cg_name; - GdkColor *gdk_color; - gchar *no_color; - - switch (int1) { - - case 3: - cg_name = "shadow_color_group"; - gdk_color = gl_color_to_gdk_color (GL_COLOR_SHADOW_DEFAULT); - no_color = _("Default"); - break; - - case 2: - cg_name = "text_color_group"; - gdk_color = gl_color_to_gdk_color (gl_prefs->default_text_color); - no_color = _("Default"); - break; - - case 1: - cg_name = "line_color_group"; - gdk_color = NULL; - no_color = _("No line"); - break; - - case 0: - default: - cg_name = "fill_color_group"; - gdk_color = NULL; - no_color = _("No fill"); - break; - - } - - cg = color_group_fetch (cg_name, NULL); - color_combo = color_combo_new (NULL, no_color, gdk_color, cg); - g_free (gdk_color); - - color_combo_box_set_preview_relief (COLOR_COMBO(color_combo), GTK_RELIEF_NORMAL); - - return color_combo; -} - -/*****************************************************************************/ -/* Construct chain button "Custom widget". */ -/*****************************************************************************/ -GtkWidget * -gl_object_editor_construct_chain_button (gchar *name, - gchar *string1, - gchar *string2, - gint int1, - gint int2) -{ - GtkWidget *chain_button; - - chain_button = gl_wdgt_chain_button_new (GL_WDGT_CHAIN_RIGHT); - gl_wdgt_chain_button_set_active (GL_WDGT_CHAIN_BUTTON(chain_button), TRUE); - - return chain_button; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prefs changed callback. Update units related items. */ -/*--------------------------------------------------------------------------*/ -static void -prefs_changed_cb (glObjectEditor *editor) -{ - - gl_debug (DEBUG_EDITOR, "START"); - - if (editor->priv->lsize_r_spin) { - lsize_prefs_changed_cb (editor); - } - - if (editor->priv->size_w_spin) { - size_prefs_changed_cb (editor); - } - - if (editor->priv->pos_x_spin) { - position_prefs_changed_cb (editor); - } - - if (editor->priv->shadow_x_spin) { - shadow_prefs_changed_cb (editor); - } - - gl_debug (DEBUG_EDITOR, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -label_changed_cb (glLabel *label, - glObjectEditor *editor) -{ - gdouble label_width, label_height; - glMerge *merge; - - gl_debug (DEBUG_EDITOR, "START"); - - gl_label_get_size (label, &label_width, &label_height); - gl_object_editor_set_max_position (GL_OBJECT_EDITOR (editor), - label_width, label_height); - gl_object_editor_set_max_size (GL_OBJECT_EDITOR (editor), - label_width, label_height); - gl_object_editor_set_max_lsize (GL_OBJECT_EDITOR (editor), - label_width, label_height); - gl_object_editor_set_max_shadow_offset (GL_OBJECT_EDITOR (editor), - label_width, label_height); - - merge = gl_label_get_merge (label); - gl_object_editor_set_key_names (editor, merge); - - gl_debug (DEBUG_EDITOR, "END"); -} - diff --git a/glabels2/src/object-editor.h b/glabels2/src/object-editor.h deleted file mode 100644 index fe3bbe56..00000000 --- a/glabels2/src/object-editor.h +++ /dev/null @@ -1,302 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * object-editor.h: object properties editor module header file - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __OBJECT_EDITOR_H__ -#define __OBJECT_EDITOR_H__ - -#include -#include - -#include "text-node.h" -#include "label.h" -#include "merge.h" -#include "bc.h" -#include "color.h" - -G_BEGIN_DECLS - -typedef enum { - GL_OBJECT_EDITOR_EMPTY = 1, - GL_OBJECT_EDITOR_POSITION_PAGE, - GL_OBJECT_EDITOR_SIZE_PAGE, - GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE, - GL_OBJECT_EDITOR_SIZE_LINE_PAGE, - GL_OBJECT_EDITOR_FILL_PAGE, - GL_OBJECT_EDITOR_LINE_PAGE, - GL_OBJECT_EDITOR_IMAGE_PAGE, - GL_OBJECT_EDITOR_TEXT_PAGE, - GL_OBJECT_EDITOR_EDIT_PAGE, - GL_OBJECT_EDITOR_BC_PAGE, - GL_OBJECT_EDITOR_DATA_PAGE, - GL_OBJECT_EDITOR_SHADOW_PAGE, -} glObjectEditorOption; - -#define GL_TYPE_OBJECT_EDITOR (gl_object_editor_get_type ()) -#define GL_OBJECT_EDITOR(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_OBJECT_EDITOR, glObjectEditor)) -#define GL_OBJECT_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_OBJECT_EDITOR, glObjectEditorClass)) -#define GL_IS_OBJECT_EDITOR(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_OBJECT_EDITOR)) -#define GL_IS_OBJECT_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_OBJECT_EDITOR)) -#define GL_OBJECT_EDITOR_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_OBJECT_EDITOR, glObjectEditorClass)) - - -typedef struct _glObjectEditor glObjectEditor; -typedef struct _glObjectEditorClass glObjectEditorClass; - -typedef struct _glObjectEditorPrivate glObjectEditorPrivate; - -struct _glObjectEditor -{ - GtkVBox parent_instance; - - glObjectEditorPrivate *priv; - -}; - -struct _glObjectEditorClass -{ - GtkVBoxClass parent_class; - - void (*changed) (glObjectEditor *editor, gpointer user_data); - void (*size_changed) (glObjectEditor *editor, gpointer user_data); -}; - - - - -GtkType gl_object_editor_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_object_editor_new (gchar *image, - gchar *title, - glLabel *label, - glObjectEditorOption first_option, ...); - -void gl_object_editor_set_key_names (glObjectEditor *editor, - glMerge *merge); - - -/* - * Position Page - */ -void gl_object_editor_set_position (glObjectEditor *editor, - gdouble x, - gdouble y); - -void gl_object_editor_set_max_position (glObjectEditor *editor, - gdouble x_max, - gdouble y_max); - -void gl_object_editor_get_position (glObjectEditor *editor, - gdouble *x, - gdouble *y); - -/* - * Size Page - */ -void gl_object_editor_set_size (glObjectEditor *editor, - gdouble w, - gdouble h); - -void gl_object_editor_set_max_size (glObjectEditor *editor, - gdouble w_max, - gdouble h_max); - -void gl_object_editor_set_base_size (glObjectEditor *editor, - gdouble w_max, - gdouble h_max); - -void gl_object_editor_get_size (glObjectEditor *editor, - gdouble *w, - gdouble *h); - - -/* - * Line Size Page - */ -void gl_object_editor_set_lsize (glObjectEditor *editor, - gdouble dx, - gdouble dy); - -void gl_object_editor_set_max_lsize (glObjectEditor *editor, - gdouble dx_max, - gdouble dy_max); - -void gl_object_editor_get_lsize (glObjectEditor *editor, - gdouble *dx, - gdouble *dy); - - -/* - * Fill Page - */ -void gl_object_editor_set_fill_color (glObjectEditor *editor, - gboolean merge_flag, - glColorNode *color_node); - -glColorNode* gl_object_editor_get_fill_color (glObjectEditor *editor); - - -/* - * Line/Outline Page - */ -void gl_object_editor_set_line_color (glObjectEditor *editor, - gboolean merge_flag, - glColorNode *color_node); - -glColorNode* gl_object_editor_get_line_color (glObjectEditor *editor); - -void gl_object_editor_set_line_width (glObjectEditor *editor, - gdouble width); - -gdouble gl_object_editor_get_line_width (glObjectEditor *editor); - - -/* - * Image Page - */ -void gl_object_editor_set_image (glObjectEditor *editor, - gboolean merge_flag, - glTextNode *text_node); - -glTextNode *gl_object_editor_get_image (glObjectEditor *editor); - - -/* - * Text Page - */ -void gl_object_editor_set_font_family (glObjectEditor *editor, - const gchar *font_family); - -gchar *gl_object_editor_get_font_family (glObjectEditor *editor); - -void gl_object_editor_set_font_size (glObjectEditor *editor, - gdouble font_size); - -gdouble gl_object_editor_get_font_size (glObjectEditor *editor); - -void gl_object_editor_set_font_weight (glObjectEditor *editor, - PangoWeight font_weight); - -PangoWeight gl_object_editor_get_font_weight (glObjectEditor *editor); - -void gl_object_editor_set_font_italic_flag (glObjectEditor *editor, - gboolean font_italic_flag); - -gboolean gl_object_editor_get_font_italic_flag (glObjectEditor *editor); - -void gl_object_editor_set_text_alignment (glObjectEditor *editor, - PangoAlignment text_alignment); - -PangoAlignment gl_object_editor_get_text_alignment (glObjectEditor *editor); - -void gl_object_editor_set_text_line_spacing (glObjectEditor *editor, - gdouble text_line_spacing); - -gdouble gl_object_editor_get_text_line_spacing (glObjectEditor *editor); - -void gl_object_editor_set_text_color (glObjectEditor *editor, - gboolean merge_flag, - glColorNode *text_color_node); - -glColorNode* gl_object_editor_get_text_color (glObjectEditor *editor); - -void gl_object_editor_set_text_auto_shrink (glObjectEditor *editor, - gboolean auto_shrink); - -gboolean gl_object_editor_get_text_auto_shrink (glObjectEditor *editor); - - -/* - * Edit Text Page - */ -void gl_object_editor_set_text_buffer (glObjectEditor *editor, - GtkTextBuffer *buffer); - -/* - * Barcode Page - */ -void gl_object_editor_set_bc_style (glObjectEditor *editor, - gchar *id, - gboolean text_flag, - gboolean checksum_flag, - guint format_digits); - -void gl_object_editor_get_bc_style (glObjectEditor *editor, - gchar **id, - gboolean *text_flag, - gboolean *checksum_flag, - guint *format_digits); - -void gl_object_editor_set_bc_color (glObjectEditor *editor, - gboolean merge_flag, - glColorNode *color_node); - -glColorNode* gl_object_editor_get_bc_color (glObjectEditor *editor); - - -/* - * Barcode Data Page - */ -void gl_object_editor_set_data (glObjectEditor *editor, - gboolean merge_flag, - glTextNode *text_node); - -glTextNode *gl_object_editor_get_data (glObjectEditor *editor); - - -/* - * Shadow Page - */ -void gl_object_editor_set_shadow_state (glObjectEditor *editor, - gboolean state); - -void gl_object_editor_set_shadow_offset (glObjectEditor *editor, - gdouble x, - gdouble y); - -void gl_object_editor_set_shadow_color (glObjectEditor *editor, - gboolean merge_flag, - glColorNode *color_node); - -void gl_object_editor_set_shadow_opacity (glObjectEditor *editor, - gdouble alpha); - -void gl_object_editor_set_max_shadow_offset(glObjectEditor *editor, - gdouble x_max, - gdouble y_max); - - -gboolean gl_object_editor_get_shadow_state (glObjectEditor *editor); - -void gl_object_editor_get_shadow_offset (glObjectEditor *editor, - gdouble *x, - gdouble *y); - -glColorNode* gl_object_editor_get_shadow_color (glObjectEditor *editor); - -gdouble gl_object_editor_get_shadow_opacity (glObjectEditor *editor); - - - -G_END_DECLS - -#endif diff --git a/glabels2/src/pixbuf-cache.c b/glabels2/src/pixbuf-cache.c deleted file mode 100644 index df676047..00000000 --- a/glabels2/src/pixbuf-cache.c +++ /dev/null @@ -1,254 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * pixbuf-cache.c: GLabels pixbuf cache module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "pixbuf-cache.h" - -#include "debug.h" - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -typedef struct { - gchar *key; - guint references; - GdkPixbuf *pixbuf; -} CacheRecord; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void record_destroy (gpointer val); - -static void add_name_to_list (gpointer key, - gpointer val, - gpointer user_data); - - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Destroy cache record. */ -/*---------------------------------------------------------------------------*/ -static void -record_destroy (gpointer val) -{ - CacheRecord *record = (CacheRecord *)val; - - g_return_if_fail (record); - - g_free (record->key); - g_object_unref (record->pixbuf); - g_free (record); -} - -/*****************************************************************************/ -/* Create a new hash table to keep track of cached pixbufs. */ -/*****************************************************************************/ -GHashTable * -gl_pixbuf_cache_new (void) -{ - GHashTable *pixbuf_cache; - - gl_debug (DEBUG_PIXBUF_CACHE, "START"); - - pixbuf_cache = g_hash_table_new_full (g_str_hash, - g_str_equal, - NULL, - record_destroy); - - gl_debug (DEBUG_PIXBUF_CACHE, "END pixbuf_cache=%p", pixbuf_cache); - - return pixbuf_cache; -} - -/*****************************************************************************/ -/* Free up previously allocated hash table and its contents. */ -/*****************************************************************************/ -void -gl_pixbuf_cache_free (GHashTable *pixbuf_cache) -{ - gl_debug (DEBUG_PIXBUF_CACHE, "START"); - - g_hash_table_destroy (pixbuf_cache); - - gl_debug (DEBUG_PIXBUF_CACHE, "END"); -} - -/*****************************************************************************/ -/* Add pixbuf to cache explicitly (not a reference). */ -/*****************************************************************************/ -void -gl_pixbuf_cache_add_pixbuf (GHashTable *pixbuf_cache, - gchar *name, - GdkPixbuf *pixbuf) -{ - CacheRecord *test_record, *record; - - gl_debug (DEBUG_PIXBUF_CACHE, "START"); - - test_record = g_hash_table_lookup (pixbuf_cache, name); - if (test_record != NULL) { - /* pixbuf is already in the cache. */ - gl_debug (DEBUG_PIXBUF_CACHE, "END already in cache"); - return; - } - - record = g_new0 (CacheRecord, 1); - record->key = g_strdup (name); - record->references = 0; /* Nobody has referenced it yet. */ - record->pixbuf = g_object_ref (G_OBJECT (pixbuf)); - - g_hash_table_insert (pixbuf_cache, record->key, record); - - gl_debug (DEBUG_PIXBUF_CACHE, "END"); -} - -/*****************************************************************************/ -/* Get pixbuf. If not in cache, read it and add to cache. */ -/*****************************************************************************/ -GdkPixbuf * -gl_pixbuf_cache_get_pixbuf (GHashTable *pixbuf_cache, - gchar *name) -{ - CacheRecord *record; - GdkPixbuf *pixbuf; - - gl_debug (DEBUG_PIXBUF_CACHE, "START pixbuf_cache=%p", pixbuf_cache); - - record = g_hash_table_lookup (pixbuf_cache, name); - - if (record != NULL) { - record->references++; - gl_debug (DEBUG_PIXBUF_CACHE, "references=%d", record->references); - gl_debug (DEBUG_PIXBUF_CACHE, "END cached"); - return record->pixbuf; - } - - - pixbuf = gdk_pixbuf_new_from_file (name, NULL); - if ( pixbuf != NULL) { - record = g_new0 (CacheRecord, 1); - record->key = g_strdup (name); - record->references = 1; - record->pixbuf = pixbuf; - - g_hash_table_insert (pixbuf_cache, record->key, record); - } - - gl_debug (DEBUG_PIXBUF_CACHE, "END"); - - return pixbuf; -} - -/*****************************************************************************/ -/* Remove pixbuf, but only if no references left. */ -/*****************************************************************************/ -void -gl_pixbuf_cache_remove_pixbuf (GHashTable *pixbuf_cache, - gchar *name) -{ - CacheRecord *record; - - if (name == NULL) return; - - gl_debug (DEBUG_PIXBUF_CACHE, "START"); - - record = g_hash_table_lookup (pixbuf_cache, name); - if (record == NULL) { - gl_debug (DEBUG_PIXBUF_CACHE, "END not in cache"); - return; - } - - record->references--; - - if ( record->references == 0 ) { - g_hash_table_remove (pixbuf_cache, name); - } - - gl_debug (DEBUG_PIXBUF_CACHE, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Add a name to a GList while iterating over cache. */ -/*---------------------------------------------------------------------------*/ -static void -add_name_to_list (gpointer key, - gpointer val, - gpointer user_data) -{ - gchar *name = (gchar *)key; - GList **name_list = (GList **)user_data; - - gl_debug (DEBUG_PIXBUF_CACHE, "START"); - - gl_debug (DEBUG_PIXBUF_CACHE, "adding name=%s", name); - - *name_list = g_list_append (*name_list, g_strdup(name)); - - gl_debug (DEBUG_PIXBUF_CACHE, "END"); -} - -/*****************************************************************************/ -/* Return a list of names for all pixbufs in the cache. */ -/*****************************************************************************/ -GList * -gl_pixbuf_cache_get_name_list (GHashTable *pixbuf_cache) -{ - GList *name_list = NULL; - - gl_debug (DEBUG_PIXBUF_CACHE, "START"); - - g_hash_table_foreach (pixbuf_cache, add_name_to_list, &name_list); - - gl_debug (DEBUG_PIXBUF_CACHE, "END"); - - return name_list; -} - -/*****************************************************************************/ -/* Free up a list of pixbuf names. */ -/*****************************************************************************/ -void -gl_pixbuf_cache_free_name_list (GList *name_list) -{ - GList *p_name; - - gl_debug (DEBUG_PIXBUF_CACHE, "START"); - - for (p_name = name_list; p_name != NULL; p_name = p_name->next) { - g_free (p_name->data); - p_name->data = NULL; - } - - g_list_free (name_list); - - gl_debug (DEBUG_PIXBUF_CACHE, "END"); -} - - diff --git a/glabels2/src/pixbuf-cache.h b/glabels2/src/pixbuf-cache.h deleted file mode 100644 index 5fe8a80c..00000000 --- a/glabels2/src/pixbuf-cache.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * pixbuf-cache.h: GLabels pixbuf cache module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __PIXBUF_CACHE_H__ -#define __PIXBUF_CACHE_H__ - -#include -#include -#include - -G_BEGIN_DECLS - -GHashTable *gl_pixbuf_cache_new (void); - -void gl_pixbuf_cache_free (GHashTable *pixbuf_cache); - -void gl_pixbuf_cache_add_pixbuf (GHashTable *pixbuf_cache, - gchar *name, - GdkPixbuf *pixbuf); - -GdkPixbuf *gl_pixbuf_cache_get_pixbuf (GHashTable *pixbuf_cache, - gchar *name); - -void gl_pixbuf_cache_remove_pixbuf (GHashTable *pixbuf_cache, - gchar *name); - -GList *gl_pixbuf_cache_get_name_list (GHashTable *pixbuf_cache); - -void gl_pixbuf_cache_free_name_list (GList *name_list); - -G_END_DECLS - -#endif /*__PIXBUF_CACHE_H__ */ diff --git a/glabels2/src/pixmaps/Makefile.am b/glabels2/src/pixmaps/Makefile.am deleted file mode 100644 index 5b192860..00000000 --- a/glabels2/src/pixmaps/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ - -EXTRA_DIST = \ - collate.xpm \ - nocollate.xpm \ - checkerboard.xpm \ - cursor_text.xbm \ - cursor_text_mask.xbm \ - cursor_box.xbm \ - cursor_box_mask.xbm \ - cursor_line.xbm \ - cursor_line_mask.xbm \ - cursor_ellipse.xbm \ - cursor_ellipse_mask.xbm \ - cursor_image.xbm \ - cursor_image_mask.xbm \ - cursor_barcode.xbm \ - cursor_barcode_mask.xbm - diff --git a/glabels2/src/pixmaps/checkerboard.xpm b/glabels2/src/pixmaps/checkerboard.xpm deleted file mode 100644 index 33ab7b57..00000000 --- a/glabels2/src/pixmaps/checkerboard.xpm +++ /dev/null @@ -1,29 +0,0 @@ -/* XPM */ -static char * checkerboard_xpm[] = { -"24 24 2 1", -" c #CCCCCC", -". c #000000", -".. .. .. .. .. .. ", -".. .. .. .. .. .. ", -" .. .. .. .. .. ..", -" .. .. .. .. .. ..", -".. .. .. .. .. .. ", -".. .. .. .. .. .. ", -" .. .. .. .. .. ..", -" .. .. .. .. .. ..", -".. .. .. .. .. .. ", -".. .. .. .. .. .. ", -" .. .. .. .. .. ..", -" .. .. .. .. .. ..", -".. .. .. .. .. .. ", -".. .. .. .. .. .. ", -" .. .. .. .. .. ..", -" .. .. .. .. .. ..", -".. .. .. .. .. .. ", -".. .. .. .. .. .. ", -" .. .. .. .. .. ..", -" .. .. .. .. .. ..", -".. .. .. .. .. .. ", -".. .. .. .. .. .. ", -" .. .. .. .. .. ..", -" .. .. .. .. .. .."}; diff --git a/glabels2/src/pixmaps/collate.xpm b/glabels2/src/pixmaps/collate.xpm deleted file mode 100644 index a781151a..00000000 --- a/glabels2/src/pixmaps/collate.xpm +++ /dev/null @@ -1,34 +0,0 @@ -/* XPM */ -static char *collate_xpm[]={ -"58 28 3 1", -". c None", -"# c #000000", -"a c #ffffff", -"..........................................................", -".###################..###################.................", -".#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.................", -".#aaaaaaaa#aaaaaaaa#..#aaaaaaa##aaaaaaaa#.................", -".#aaaaaaa##aaaaaaaa#..#aaaaaa#aa#aaaaaaa#.................", -".#aaaaaaaa#aaaaaaaa#..#aaaaaaaaa#aaaaaaa#..##..##..##.....", -".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#..##..##..##.....", -".#aaaaaaaa#aaaaaaaa#..#aaaaaaa#aaaaaaaaa#.................", -".#aaaaaaaa#aaaaaaaa#..#aaaaaa#aaaaaaaaaa#.................", -".#aaaaaaa###aaaaaaa#..#aaaaaa####aaaaaaa#.................", -".#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.................", -".###################..###################.................", -"..........................................................", -"..........................................................", -"..........................................................", -".................###################..###################.", -".................#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.", -".................#aaaaaaaa#aaaaaaaa#..#aaaaaaa##aaaaaaaa#.", -".................#aaaaaaa##aaaaaaaa#..#aaaaaa#aa#aaaaaaa#.", -"....##..##..##...#aaaaaaaa#aaaaaaaa#..#aaaaaaaaa#aaaaaaa#.", -"....##..##..##...#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#.", -".................#aaaaaaaa#aaaaaaaa#..#aaaaaaa#aaaaaaaaa#.", -".................#aaaaaaaa#aaaaaaaa#..#aaaaaa#aaaaaaaaaa#.", -".................#aaaaaaa###aaaaaaa#..#aaaaaa####aaaaaaa#.", -".................#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.", -".................###################..###################.", -"..........................................................", -".........................................................."}; diff --git a/glabels2/src/pixmaps/cursor_barcode.xbm b/glabels2/src/pixmaps/cursor_barcode.xbm deleted file mode 100644 index 6e8d1d62..00000000 --- a/glabels2/src/pixmaps/cursor_barcode.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_barcode_width 32 -#define cursor_barcode_height 32 -#define cursor_barcode_x_hot 7 -#define cursor_barcode_y_hot 7 -static unsigned char cursor_barcode_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, - 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, - 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, - 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, - 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, - 0x00, 0xa0, 0xad, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/glabels2/src/pixmaps/cursor_barcode_mask.xbm b/glabels2/src/pixmaps/cursor_barcode_mask.xbm deleted file mode 100644 index 52ed3ba2..00000000 --- a/glabels2/src/pixmaps/cursor_barcode_mask.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_barcode_mask_width 32 -#define cursor_barcode_mask_height 32 -#define cursor_barcode_mask_x_hot 7 -#define cursor_barcode_mask_y_hot 7 -static unsigned char cursor_barcode_mask_bits[] = { - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xc0, 0xf1, 0xff, 0xff, 0xc0, 0xf1, 0xff, 0xff, 0xc0, 0xf1, 0xff, 0xff, - 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, - 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, - 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, - 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, - 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/glabels2/src/pixmaps/cursor_box.xbm b/glabels2/src/pixmaps/cursor_box.xbm deleted file mode 100644 index 48ae4ea2..00000000 --- a/glabels2/src/pixmaps/cursor_box.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_box_width 32 -#define cursor_box_height 32 -#define cursor_box_x_hot 7 -#define cursor_box_y_hot 7 -static unsigned char cursor_box_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x80, 0xff, 0x7f, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x80, 0x01, 0x60, - 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, - 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, - 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, - 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0xff, 0x7f, - 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00}; diff --git a/glabels2/src/pixmaps/cursor_box_mask.xbm b/glabels2/src/pixmaps/cursor_box_mask.xbm deleted file mode 100644 index b41e0559..00000000 --- a/glabels2/src/pixmaps/cursor_box_mask.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_box_mask_width 32 -#define cursor_box_mask_height 32 -#define cursor_box_mask_x_hot 7 -#define cursor_box_mask_y_hot 7 -static unsigned char cursor_box_mask_bits[] = { - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0xc1, 0xff, 0xff, - 0x00, 0xc0, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, - 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, - 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, - 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, - 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, - 0x00, 0xc0, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff}; diff --git a/glabels2/src/pixmaps/cursor_ellipse.xbm b/glabels2/src/pixmaps/cursor_ellipse.xbm deleted file mode 100644 index 946af9ac..00000000 --- a/glabels2/src/pixmaps/cursor_ellipse.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_ellipse_width 32 -#define cursor_ellipse_height 32 -#define cursor_ellipse_x_hot 7 -#define cursor_ellipse_y_hot 7 -static unsigned char cursor_ellipse_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x7c, 0x00, 0x80, 0x00, 0xef, 0x01, 0x00, 0x80, 0x01, 0x03, - 0x00, 0xc0, 0x00, 0x06, 0x00, 0x60, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x08, - 0x00, 0x30, 0x00, 0x18, 0x00, 0x30, 0x00, 0x18, 0x00, 0x10, 0x00, 0x10, - 0x00, 0x30, 0x00, 0x18, 0x00, 0x30, 0x00, 0x18, 0x00, 0x20, 0x00, 0x08, - 0x00, 0x60, 0x00, 0x0c, 0x00, 0xc0, 0x00, 0x06, 0x00, 0x80, 0x01, 0x03, - 0x00, 0x00, 0xef, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/glabels2/src/pixmaps/cursor_ellipse_mask.xbm b/glabels2/src/pixmaps/cursor_ellipse_mask.xbm deleted file mode 100644 index 22fb5442..00000000 --- a/glabels2/src/pixmaps/cursor_ellipse_mask.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_ellipse_mask_width 32 -#define cursor_ellipse_mask_height 32 -#define cursor_ellipse_mask_x_hot 7 -#define cursor_ellipse_mask_y_hot 7 -static unsigned char cursor_ellipse_mask_bits[] = { - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0xfe, 0x00, - 0xc0, 0x81, 0xff, 0x03, 0xc0, 0xc1, 0xff, 0x07, 0xc0, 0xe1, 0xff, 0x0f, - 0x00, 0xf0, 0x83, 0x1f, 0x00, 0xf0, 0x01, 0x1f, 0x00, 0xf8, 0x00, 0x3e, - 0x00, 0x78, 0x00, 0x3c, 0x00, 0x78, 0x00, 0x3c, 0x00, 0x78, 0x00, 0x3c, - 0x00, 0x78, 0x00, 0x3c, 0x00, 0x78, 0x00, 0x3c, 0x00, 0xf8, 0x00, 0x3e, - 0x00, 0xf0, 0x01, 0x1f, 0x00, 0xf0, 0x83, 0x1f, 0x00, 0xe0, 0xff, 0x0f, - 0x00, 0xc0, 0xff, 0x07, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0xfe, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/glabels2/src/pixmaps/cursor_image.xbm b/glabels2/src/pixmaps/cursor_image.xbm deleted file mode 100644 index 32308360..00000000 --- a/glabels2/src/pixmaps/cursor_image.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_image_width 32 -#define cursor_image_height 32 -#define cursor_image_x_hot 7 -#define cursor_image_y_hot 7 -static unsigned char cursor_image_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0xf0, 0xff, 0x7f, 0x80, 0x10, 0x00, 0x40, 0x00, 0x10, 0x00, 0x40, - 0x00, 0x10, 0x00, 0x4c, 0x00, 0x10, 0x00, 0x52, 0x00, 0x10, 0x08, 0x4c, - 0x00, 0x10, 0x14, 0x40, 0x00, 0x10, 0x22, 0x40, 0x00, 0x10, 0x41, 0x40, - 0x00, 0x90, 0xc1, 0x40, 0x00, 0x10, 0x41, 0x40, 0x00, 0xf0, 0xc1, 0x7f, - 0x00, 0x10, 0x41, 0x40, 0x00, 0x10, 0x41, 0x40, 0x00, 0x10, 0x41, 0x40, - 0x00, 0x10, 0x7f, 0x40, 0x00, 0x10, 0x00, 0x40, 0x00, 0x10, 0x00, 0x40, - 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00}; diff --git a/glabels2/src/pixmaps/cursor_image_mask.xbm b/glabels2/src/pixmaps/cursor_image_mask.xbm deleted file mode 100644 index 9c79e82e..00000000 --- a/glabels2/src/pixmaps/cursor_image_mask.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_image_mask_width 32 -#define cursor_image_mask_height 32 -#define cursor_image_mask_x_hot 7 -#define cursor_image_mask_y_hot 7 -static unsigned char cursor_image_mask_bits[] = { - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0xf9, 0xff, 0xff, - 0xc0, 0xf9, 0xff, 0xff, 0xc0, 0xf9, 0xff, 0xff, 0xc0, 0xf9, 0xff, 0xff, - 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, - 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, - 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, - 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, - 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, - 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff}; diff --git a/glabels2/src/pixmaps/cursor_line.xbm b/glabels2/src/pixmaps/cursor_line.xbm deleted file mode 100644 index f5e2636e..00000000 --- a/glabels2/src/pixmaps/cursor_line.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_line_width 32 -#define cursor_line_height 32 -#define cursor_line_x_hot 7 -#define cursor_line_y_hot 7 -static unsigned char cursor_line_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x08, - 0x80, 0x00, 0x00, 0x0c, 0x80, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x60, 0x00, - 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0c, 0x00, - 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0xc0, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, - 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/glabels2/src/pixmaps/cursor_line_mask.xbm b/glabels2/src/pixmaps/cursor_line_mask.xbm deleted file mode 100644 index a9359d55..00000000 --- a/glabels2/src/pixmaps/cursor_line_mask.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_line_mask_width 32 -#define cursor_line_mask_height 32 -#define cursor_line_mask_x_hot 7 -#define cursor_line_mask_y_hot 7 -static unsigned char cursor_line_mask_bits[] = { - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x08, 0xc0, 0x01, 0x00, 0x1c, - 0xc0, 0x01, 0x00, 0x1e, 0xc0, 0x01, 0x00, 0x0f, 0xc0, 0x01, 0x80, 0x07, - 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x00, - 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x1e, 0x00, - 0x00, 0x00, 0x0f, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0x00, - 0x00, 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, - 0x00, 0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/glabels2/src/pixmaps/cursor_text.xbm b/glabels2/src/pixmaps/cursor_text.xbm deleted file mode 100644 index 4378c1a6..00000000 --- a/glabels2/src/pixmaps/cursor_text.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_text_width 32 -#define cursor_text_height 32 -#define cursor_text_x_hot 7 -#define cursor_text_y_hot 7 -static unsigned char cursor_text_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, - 0x00, 0xc0, 0x9c, 0x01, 0x00, 0x40, 0x1c, 0x01, 0x00, 0x00, 0x1c, 0x00, - 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, - 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, - 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/glabels2/src/pixmaps/cursor_text_mask.xbm b/glabels2/src/pixmaps/cursor_text_mask.xbm deleted file mode 100644 index 543c2b7f..00000000 --- a/glabels2/src/pixmaps/cursor_text_mask.xbm +++ /dev/null @@ -1,16 +0,0 @@ -#define cursor_text_mask_width 32 -#define cursor_text_mask_height 32 -#define cursor_text_mask_x_hot 7 -#define cursor_text_mask_y_hot 7 -static unsigned char cursor_text_mask_bits[] = { - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, - 0xc0, 0x01, 0x00, 0x00, 0xc0, 0xe1, 0xff, 0x03, 0xc0, 0xe1, 0xff, 0x03, - 0x00, 0xe0, 0xff, 0x03, 0x00, 0xe0, 0xbe, 0x03, 0x00, 0x60, 0x3e, 0x03, - 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, - 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, - 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x7f, 0x00, - 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/glabels2/src/pixmaps/nocollate.xpm b/glabels2/src/pixmaps/nocollate.xpm deleted file mode 100644 index a67cc13c..00000000 --- a/glabels2/src/pixmaps/nocollate.xpm +++ /dev/null @@ -1,34 +0,0 @@ -/* XPM */ -static char *nocollate_xpm[]={ -"58 28 3 1", -". c None", -"# c #000000", -"a c #ffffff", -"..........................................................", -".###################..###################.................", -".#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.................", -".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#.................", -".#aaaaaaa##aaaaaaaa#..#aaaaaaa##aaaaaaaa#.................", -".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#..##..##..##.....", -".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#..##..##..##.....", -".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#.................", -".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#.................", -".#aaaaaaa###aaaaaaa#..#aaaaaaa###aaaaaaa#.................", -".#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.................", -".###################..###################.................", -"..........................................................", -"..........................................................", -"..........................................................", -".................###################..###################.", -".................#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.", -".................#aaaaaaaa##aaaaaaa#..#aaaaaaaa##aaaaaaa#.", -".................#aaaaaaa#aa#aaaaaa#..#aaaaaaa#aa#aaaaaa#.", -"....##..##..##...#aaaaaaaaaa#aaaaaa#..#aaaaaaaaaa#aaaaaa#.", -"....##..##..##...#aaaaaaaaa#aaaaaaa#..#aaaaaaaaa#aaaaaaa#.", -".................#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#.", -".................#aaaaaaa#aaaaaaaaa#..#aaaaaaa#aaaaaaaaa#.", -".................#aaaaaaa####aaaaaa#..#aaaaaaa####aaaaaa#.", -".................#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.", -".................###################..###################.", -"..........................................................", -".........................................................."}; diff --git a/glabels2/src/prefs-dialog.c b/glabels2/src/prefs-dialog.c deleted file mode 100644 index 0a095231..00000000 --- a/glabels2/src/prefs-dialog.c +++ /dev/null @@ -1,692 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * prefs-dialog.c: Preferences dialog module - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "prefs-dialog.h" - -#include -#include -#include -#include -#include -#include - -#include "prefs.h" -#include "hig.h" -#include "mygal/widget-color-combo.h" -#include "color.h" -#include "util.h" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -#define US_LETTER_ID "US-Letter" -#define A4_ID "A4" - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glPrefsDialogPrivate -{ - GladeXML *gui; - - /* Units properties */ - GtkWidget *units_points_radio; - GtkWidget *units_inches_radio; - GtkWidget *units_mm_radio; - - /* Page size properties */ - GtkWidget *page_size_us_letter_radio; - GtkWidget *page_size_a4_radio; - - /* Default text properties */ - GtkWidget *text_family_combo; - GtkWidget *text_size_spin; - GtkWidget *text_bold_toggle; - GtkWidget *text_italic_toggle; - GtkWidget *text_color_combo; - GtkWidget *text_left_toggle; - GtkWidget *text_center_toggle; - GtkWidget *text_right_toggle; - GtkWidget *text_line_spacing_spin; - - /* Default line properties */ - GtkWidget *line_width_spin; - GtkWidget *line_color_combo; - - /* Default fill properties */ - GtkWidget *fill_color_combo; - - /* Prevent recursion */ - gboolean stop_signals; -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_prefs_dialog_finalize (GObject *object); -static void gl_prefs_dialog_construct (glPrefsDialog *dialog); - -static void response_cb (glPrefsDialog *dialog, - gint response, - gpointer user_data); - -static void construct_locale_page (glPrefsDialog *dialog); -static void construct_object_page (glPrefsDialog *dialog); - -static void align_toggle_cb (GtkToggleButton *toggle, - glPrefsDialog *dialog); - -static void update_locale_page_from_prefs (glPrefsDialog *dialog); -static void update_object_page_from_prefs (glPrefsDialog *dialog); - -static void update_prefs_from_locale_page (glPrefsDialog *dialog); -static void update_prefs_from_object_page (glPrefsDialog *dialog); - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glPrefsDialog, gl_prefs_dialog, GTK_TYPE_DIALOG); - -static void -gl_prefs_dialog_class_init (glPrefsDialogClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_PREFS, ""); - - gl_prefs_dialog_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_prefs_dialog_finalize; -} - -static void -gl_prefs_dialog_init (glPrefsDialog *dialog) -{ - gl_debug (DEBUG_PREFS, "START"); - - dialog->priv = g_new0 (glPrefsDialogPrivate, 1); - - dialog->priv->gui = glade_xml_new (GLABELS_GLADE_DIR "prefs-dialog.glade", - "prefs_notebook", - NULL); - - if (!dialog->priv->gui) - { - g_critical ("Could not open prefs-dialog.glade. gLabels may not be installed correctly!"); - return; - } - - gtk_container_set_border_width (GTK_CONTAINER(dialog), GL_HIG_PAD2); - - gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE); - gtk_dialog_add_button (GTK_DIALOG(dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); - gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); - - g_signal_connect(G_OBJECT (dialog), "response", - G_CALLBACK (response_cb), NULL); - - gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); - gtk_window_set_title (GTK_WINDOW (dialog), _("gLabels Preferences")); - gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); - - gl_debug (DEBUG_PREFS, "END"); -} - -static void -gl_prefs_dialog_finalize (GObject *object) -{ - glPrefsDialog* dialog = GL_PREFS_DIALOG (object); - - gl_debug (DEBUG_PREFS, "START"); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_PREFS_DIALOG (dialog)); - g_return_if_fail (dialog->priv != NULL); - - if (dialog->priv->gui) - { - g_object_unref (G_OBJECT (dialog->priv->gui)); - } - g_free (dialog->priv); - - G_OBJECT_CLASS (gl_prefs_dialog_parent_class)->finalize (object); - - gl_debug (DEBUG_PREFS, "END"); -} - -/*****************************************************************************/ -/* NEW preferences dialog. */ -/*****************************************************************************/ -GtkWidget* -gl_prefs_dialog_new (GtkWindow *parent) -{ - GtkWidget *dialog; - - gl_debug (DEBUG_PREFS, "START"); - gl_debug (DEBUG_PREFS, "page size = \"%s\"", gl_prefs->default_page_size); - - dialog = GTK_WIDGET (g_object_new (GL_TYPE_PREFS_DIALOG, NULL)); - - if (parent) - gtk_window_set_transient_for (GTK_WINDOW (dialog), parent); - - gl_prefs_dialog_construct (GL_PREFS_DIALOG(dialog)); - - - gl_debug (DEBUG_PREFS, "END"); - - return dialog; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Construct composite widget. */ -/*---------------------------------------------------------------------------*/ -static void -gl_prefs_dialog_construct (glPrefsDialog *dialog) -{ - GtkWidget *notebook; - - g_return_if_fail (GL_IS_PREFS_DIALOG (dialog)); - g_return_if_fail (dialog->priv != NULL); - - notebook = glade_xml_get_widget (dialog->priv->gui, "prefs_notebook"); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, FALSE, FALSE, 0); - - construct_locale_page (dialog); - construct_object_page (dialog); - - update_locale_page_from_prefs (dialog); - update_object_page_from_prefs (dialog); - - gtk_widget_show_all (GTK_DIALOG (dialog)->vbox); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. "Response" callback. */ -/*---------------------------------------------------------------------------*/ -static void -response_cb (glPrefsDialog *dialog, - gint response, - gpointer user_data) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail(dialog != NULL); - g_return_if_fail(GTK_IS_DIALOG(dialog)); - - switch(response) { - case GTK_RESPONSE_CLOSE: - gtk_widget_hide (GTK_WIDGET(dialog)); - break; - case GTK_RESPONSE_DELETE_EVENT: - break; - default: - g_print ("response = %d", response); - g_assert_not_reached (); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Build Locale Properties Notebook Tab */ -/*--------------------------------------------------------------------------*/ -static void -construct_locale_page (glPrefsDialog *dialog) -{ - - dialog->priv->units_points_radio = - glade_xml_get_widget (dialog->priv->gui, "units_points_radio"); - - dialog->priv->units_inches_radio = - glade_xml_get_widget (dialog->priv->gui, "units_inches_radio"); - - dialog->priv->units_mm_radio = - glade_xml_get_widget (dialog->priv->gui, "units_mm_radio"); - - dialog->priv->page_size_us_letter_radio = - glade_xml_get_widget (dialog->priv->gui, "page_size_us_letter_radio"); - - dialog->priv->page_size_a4_radio = - glade_xml_get_widget (dialog->priv->gui, "page_size_a4_radio"); - - g_signal_connect_swapped ( - G_OBJECT(dialog->priv->units_points_radio), - "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog)); - g_signal_connect_swapped ( - G_OBJECT(dialog->priv->units_inches_radio), - "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog)); - g_signal_connect_swapped ( - G_OBJECT(dialog->priv->units_mm_radio), - "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog)); - g_signal_connect_swapped ( - G_OBJECT(dialog->priv->page_size_us_letter_radio), - "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog)); - g_signal_connect_swapped ( - G_OBJECT(dialog->priv->page_size_a4_radio), - "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog)); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Build Default Object Properties Notebook Tab */ -/*--------------------------------------------------------------------------*/ -static void -construct_object_page (glPrefsDialog *dialog) -{ - GList *family_names; - - dialog->priv->text_family_combo = - glade_xml_get_widget (dialog->priv->gui, "text_family_combo"); - dialog->priv->text_size_spin = - glade_xml_get_widget (dialog->priv->gui, "text_size_spin"); - dialog->priv->text_bold_toggle = - glade_xml_get_widget (dialog->priv->gui, "text_bold_toggle"); - dialog->priv->text_italic_toggle = - glade_xml_get_widget (dialog->priv->gui, "text_italic_toggle"); - dialog->priv->text_color_combo = - glade_xml_get_widget (dialog->priv->gui, "text_color_combo"); - dialog->priv->text_left_toggle = - glade_xml_get_widget (dialog->priv->gui, "text_left_toggle"); - dialog->priv->text_center_toggle = - glade_xml_get_widget (dialog->priv->gui, "text_center_toggle"); - dialog->priv->text_right_toggle = - glade_xml_get_widget (dialog->priv->gui, "text_right_toggle"); - dialog->priv->text_line_spacing_spin = - glade_xml_get_widget (dialog->priv->gui, "text_line_spacing_spin"); - - dialog->priv->line_width_spin = - glade_xml_get_widget (dialog->priv->gui, "line_width_spin"); - dialog->priv->line_color_combo = - glade_xml_get_widget (dialog->priv->gui, "line_color_combo"); - - dialog->priv->fill_color_combo = - glade_xml_get_widget (dialog->priv->gui, "fill_color_combo"); - - gl_util_combo_box_add_text_model (GTK_COMBO_BOX (dialog->priv->text_family_combo)); - - /* Load family names */ - family_names = gl_util_get_font_family_list (); - gl_util_combo_box_set_strings (GTK_COMBO_BOX (dialog->priv->text_family_combo), - family_names); - - - g_signal_connect_swapped (G_OBJECT(dialog->priv->text_family_combo), - "changed", - G_CALLBACK(update_prefs_from_object_page), - G_OBJECT(dialog)); - g_signal_connect_swapped (G_OBJECT(dialog->priv->text_size_spin), - "changed", - G_CALLBACK(update_prefs_from_object_page), - G_OBJECT(dialog)); - g_signal_connect_swapped (G_OBJECT(dialog->priv->text_bold_toggle), - "toggled", - G_CALLBACK(update_prefs_from_object_page), - G_OBJECT(dialog)); - g_signal_connect_swapped (G_OBJECT(dialog->priv->text_italic_toggle), - "toggled", - G_CALLBACK(update_prefs_from_object_page), - G_OBJECT(dialog)); - g_signal_connect_swapped (G_OBJECT(dialog->priv->text_color_combo), - "color_changed", - G_CALLBACK(update_prefs_from_object_page), - G_OBJECT(dialog)); - - g_signal_connect (G_OBJECT(dialog->priv->text_left_toggle), - "toggled", - G_CALLBACK(align_toggle_cb), - G_OBJECT(dialog)); - g_signal_connect (G_OBJECT(dialog->priv->text_center_toggle), - "toggled", - G_CALLBACK(align_toggle_cb), - G_OBJECT(dialog)); - g_signal_connect (G_OBJECT(dialog->priv->text_right_toggle), - "toggled", - G_CALLBACK(align_toggle_cb), - G_OBJECT(dialog)); - - g_signal_connect_swapped (G_OBJECT(dialog->priv->text_line_spacing_spin), - "changed", - G_CALLBACK(update_prefs_from_object_page), - G_OBJECT(dialog)); - - g_signal_connect_swapped (G_OBJECT(dialog->priv->line_width_spin), - "changed", - G_CALLBACK(update_prefs_from_object_page), - G_OBJECT(dialog)); - g_signal_connect_swapped (G_OBJECT(dialog->priv->line_color_combo), - "color_changed", - G_CALLBACK(update_prefs_from_object_page), - G_OBJECT(dialog)); - - g_signal_connect_swapped (G_OBJECT(dialog->priv->fill_color_combo), - "color_changed", - G_CALLBACK(update_prefs_from_object_page), - G_OBJECT(dialog)); -} - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Alignment togglebutton callback. */ -/*--------------------------------------------------------------------------*/ -static void -align_toggle_cb (GtkToggleButton *toggle, - glPrefsDialog *dialog) -{ - if (gtk_toggle_button_get_active (toggle)) - { - - if (GTK_WIDGET (toggle) == GTK_WIDGET (dialog->priv->text_left_toggle)) - { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (dialog->priv->text_center_toggle), - FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (dialog->priv->text_right_toggle), - FALSE); - } - else if (GTK_WIDGET (toggle) == GTK_WIDGET (dialog->priv->text_center_toggle)) - { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (dialog->priv->text_left_toggle), - FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (dialog->priv->text_right_toggle), - FALSE); - } - else if (GTK_WIDGET (toggle) == GTK_WIDGET (dialog->priv->text_right_toggle)) - { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (dialog->priv->text_left_toggle), - FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (dialog->priv->text_center_toggle), - FALSE); - } - - update_prefs_from_object_page (dialog); - } - -} - - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Update locale page widgets from current prefs. */ -/*--------------------------------------------------------------------------*/ -static void -update_locale_page_from_prefs (glPrefsDialog *dialog) -{ - dialog->priv->stop_signals = TRUE; - - switch (gl_prefs->units) { - case LGL_UNITS_POINT: - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(dialog->priv->units_points_radio), - TRUE); - break; - case LGL_UNITS_INCH: - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(dialog->priv->units_inches_radio), - TRUE); - break; - case LGL_UNITS_MM: - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(dialog->priv->units_mm_radio), - TRUE); - break; - default: - g_message ("Illegal units"); /* Should not happen */ - break; - } - - if ( g_strcasecmp(gl_prefs->default_page_size, US_LETTER_ID) == 0) - { - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(dialog->priv->page_size_us_letter_radio), TRUE); - } - else if ( g_strcasecmp(gl_prefs->default_page_size, A4_ID) == 0) - { - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON(dialog->priv->page_size_a4_radio), TRUE); - } - else - { - g_message ("Unknown default page size"); /* Shouldn't happen */ - } - - dialog->priv->stop_signals = FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Update object page widgets from current prefs. */ -/*--------------------------------------------------------------------------*/ -static void -update_object_page_from_prefs (glPrefsDialog *dialog) -{ - GList *family_names; - gchar *good_font_family; - GdkColor *gdk_color; - - dialog->priv->stop_signals = TRUE; - - - /* Make sure we have a valid font family. if not provide a good default. */ - family_names = gl_util_get_font_family_list (); - if (g_list_find_custom (family_names, - gl_prefs->default_font_family, - (GCompareFunc)g_utf8_collate)) - { - good_font_family = g_strdup (gl_prefs->default_font_family); - } - else - { - if (family_names != NULL) - { - good_font_family = g_strdup (family_names->data); /* 1st entry */ - } - else - { - good_font_family = NULL; - } - } - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (dialog->priv->text_family_combo), - good_font_family); - g_free (good_font_family); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->text_size_spin), - gl_prefs->default_font_size); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_bold_toggle), - (gl_prefs->default_font_weight == PANGO_WEIGHT_BOLD)); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_italic_toggle), - gl_prefs->default_font_italic_flag); - - gdk_color = gl_color_to_gdk_color (gl_prefs->default_text_color); - color_combo_set_color (COLOR_COMBO(dialog->priv->text_color_combo), gdk_color); - g_free (gdk_color); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_left_toggle), - (gl_prefs->default_text_alignment == GTK_JUSTIFY_LEFT)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_center_toggle), - (gl_prefs->default_text_alignment == GTK_JUSTIFY_CENTER)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_right_toggle), - (gl_prefs->default_text_alignment == GTK_JUSTIFY_RIGHT)); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->text_line_spacing_spin), - gl_prefs->default_text_line_spacing); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->line_width_spin), - gl_prefs->default_line_width); - - gdk_color = gl_color_to_gdk_color (gl_prefs->default_line_color); - color_combo_set_color (COLOR_COMBO(dialog->priv->line_color_combo), gdk_color); - g_free (gdk_color); - - - gdk_color = gl_color_to_gdk_color (gl_prefs->default_fill_color); - color_combo_set_color (COLOR_COMBO(dialog->priv->fill_color_combo), gdk_color); - g_free (gdk_color); - - - dialog->priv->stop_signals = FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Update prefs from current state of locale page widgets. */ -/*--------------------------------------------------------------------------*/ -static void -update_prefs_from_locale_page (glPrefsDialog *dialog) -{ - if (dialog->priv->stop_signals) return; - - if (gtk_toggle_button_get_active ( - GTK_TOGGLE_BUTTON(dialog->priv->units_points_radio))) - { - gl_prefs->units = LGL_UNITS_POINT; - } - if (gtk_toggle_button_get_active ( - GTK_TOGGLE_BUTTON(dialog->priv->units_inches_radio))) - { - gl_prefs->units = LGL_UNITS_INCH; - } - if (gtk_toggle_button_get_active ( - GTK_TOGGLE_BUTTON(dialog->priv->units_mm_radio))) - { - gl_prefs->units = LGL_UNITS_MM; - } - - if (gtk_toggle_button_get_active ( - GTK_TOGGLE_BUTTON(dialog->priv->page_size_us_letter_radio))) - { - g_free (gl_prefs->default_page_size); - gl_prefs->default_page_size = g_strdup (US_LETTER_ID); - } - if (gtk_toggle_button_get_active ( - GTK_TOGGLE_BUTTON(dialog->priv->page_size_a4_radio))) - { - g_free (gl_prefs->default_page_size); - gl_prefs->default_page_size = g_strdup (A4_ID); - } - - gl_prefs_model_save_settings (gl_prefs); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Update prefs from current state of object page widgets. */ -/*--------------------------------------------------------------------------*/ -static void -update_prefs_from_object_page (glPrefsDialog *dialog) -{ - GdkColor *gdk_color; - gboolean is_default; - - if (dialog->priv->stop_signals) return; - - g_free (gl_prefs->default_font_family); - gl_prefs->default_font_family = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->text_family_combo)); - gl_prefs->default_font_size = - gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->text_size_spin)); - - if (gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON (dialog->priv->text_bold_toggle))) - { - gl_prefs->default_font_weight = PANGO_WEIGHT_BOLD; - } - else - { - gl_prefs->default_font_weight = PANGO_WEIGHT_NORMAL; - } - - gl_prefs->default_font_italic_flag = - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON - (dialog->priv->text_italic_toggle)); - - gdk_color = color_combo_get_color (COLOR_COMBO(dialog->priv->text_color_combo), - &is_default); - if (!is_default) - { - gl_prefs->default_text_color = gl_color_from_gdk_color (gdk_color); - } - - if (gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON (dialog->priv->text_left_toggle))) - { - gl_prefs->default_text_alignment = GTK_JUSTIFY_LEFT; - } - else if (gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON (dialog->priv->text_right_toggle))) - { - gl_prefs->default_text_alignment = GTK_JUSTIFY_RIGHT; - } - else if (gtk_toggle_button_get_active - (GTK_TOGGLE_BUTTON (dialog->priv->text_center_toggle))) - { - gl_prefs->default_text_alignment = GTK_JUSTIFY_CENTER; - } - else - { - /* Should not happen. */ - gl_prefs->default_text_alignment = GTK_JUSTIFY_LEFT; - } - - - gl_prefs->default_text_line_spacing = - gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->text_line_spacing_spin)); - - gl_prefs->default_line_width = - gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->line_width_spin)); - - gdk_color = color_combo_get_color (COLOR_COMBO(dialog->priv->line_color_combo), - &is_default); - if (!is_default) - { - gl_prefs->default_line_color = gl_color_from_gdk_color (gdk_color); - } - - - gdk_color = color_combo_get_color (COLOR_COMBO(dialog->priv->fill_color_combo), - &is_default); - if (!is_default) - { - gl_prefs->default_fill_color = gl_color_from_gdk_color (gdk_color); - } - - gl_prefs_model_save_settings (gl_prefs); -} - - - diff --git a/glabels2/src/prefs-dialog.h b/glabels2/src/prefs-dialog.h deleted file mode 100644 index 8ec8e929..00000000 --- a/glabels2/src/prefs-dialog.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * prefs-dialog.h: Preferences dialog module header file - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __PREFS_DIALOG_H__ -#define __PREFS_DIALOG_H__ - -#include -#include - -G_BEGIN_DECLS - -#define GL_TYPE_PREFS_DIALOG (gl_prefs_dialog_get_type ()) -#define GL_PREFS_DIALOG(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_PREFS_DIALOG, glPrefsDialog)) -#define GL_PREFS_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_PREFS_DIALOG, glPrefsDialogClass)) -#define GL_IS_PREFS_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_PREFS_DIALOG)) -#define GL_IS_PREFS_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_PREFS_DIALOG)) -#define GL_PREFS_DIALOG_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_PREFS_DIALOG, glPrefsDialogClass)) - - -typedef struct _glPrefsDialog glPrefsDialog; -typedef struct _glPrefsDialogClass glPrefsDialogClass; - -typedef struct _glPrefsDialogPrivate glPrefsDialogPrivate; - -struct _glPrefsDialog -{ - GtkDialog parent_instance; - - glPrefsDialogPrivate *priv; - -}; - -struct _glPrefsDialogClass -{ - GtkDialogClass parent_class; -}; - -GType gl_prefs_dialog_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_prefs_dialog_new (GtkWindow *parent); - -G_END_DECLS - -#endif /* __PREFS_DIALOG_H__ */ diff --git a/glabels2/src/prefs-model.c b/glabels2/src/prefs-model.c deleted file mode 100644 index 72b61792..00000000 --- a/glabels2/src/prefs-model.c +++ /dev/null @@ -1,736 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * prefs-model.c: Application preferences model module - * - * Copyright (C) 2001-2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "prefs-model.h" - -#include -#include - -#include "marshal.h" -#include "util.h" -#include "color.h" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -/* GConf keys */ -#define BASE_KEY "/apps/glabels" - -#define PREF_UNITS "/units" -#define PREF_DEFAULT_PAGE_SIZE "/default-page-size" - -#define PREF_DEFAULT_FONT_FAMILY "/default-font-family" -#define PREF_DEFAULT_FONT_SIZE "/default-font-size" -#define PREF_DEFAULT_FONT_WEIGHT "/default-font-weight" -#define PREF_DEFAULT_FONT_ITALIC_FLAG "/default-font-italic-flag" -#define PREF_DEFAULT_TEXT_COLOR "/default-text-color" -#define PREF_DEFAULT_TEXT_ALIGNMENT "/default-text-alignment" -#define PREF_DEFAULT_TEXT_LINE_SPACING "/default-text-line-spacing" - -#define PREF_DEFAULT_LINE_WIDTH "/default-line-width" -#define PREF_DEFAULT_LINE_COLOR "/default-line-color" - -#define PREF_DEFAULT_FILL_COLOR "/default-fill-color" - -#define PREF_MAIN_TOOLBAR_VISIBLE "/main-toolbar-visible" -#define PREF_MAIN_TOOLBAR_BUTTONS_STYLE "/main-toolbar-buttons-style" -#define PREF_MAIN_TOOLBAR_VIEW_TOOLTIPS "/main-toolbar-view-tooltips" - -#define PREF_DRAWING_TOOLBAR_VISIBLE "/drawing-toolbar-visible" -#define PREF_DRAWING_TOOLBAR_VIEW_TOOLTIPS "/drawing-toolbar-view-tooltips" - -#define PREF_PROPERTY_TOOLBAR_VISIBLE "/property-toolbar-visible" -#define PREF_PROPERTY_TOOLBAR_VIEW_TOOLTIPS "/property-toolbar-view-tooltips" - -#define PREF_GRID_VISIBLE "/grid-visible" -#define PREF_MARKUP_VISIBLE "/markup-visible" - -#define PREF_MAX_RECENTS "/max-recents" - -#define PREF_RECENT_TEMPLATES "/recent-templates" -#define PREF_MAX_RECENT_TEMPLATES "/max-recent-templates" - -/* Default values */ -#define DEFAULT_UNITS_STRING units_to_string (LGL_UNITS_INCH) -#define DEFAULT_PAGE_SIZE "US-Letter" - -#define DEFAULT_FONT_FAMILY "Sans" -#define DEFAULT_FONT_SIZE 14.0 -#define DEFAULT_FONT_WEIGHT_STRING gl_util_weight_to_string (PANGO_WEIGHT_NORMAL) -#define DEFAULT_FONT_ITALIC_FLAG FALSE -#define DEFAULT_TEXT_ALIGN_STRING gl_util_align_to_string (PANGO_ALIGN_LEFT) -#define DEFAULT_TEXT_COLOR GL_COLOR (0,0,0) -#define DEFAULT_TEXT_LINE_SPACING 1.0 - -#define DEFAULT_LINE_WIDTH 1.0 -#define DEFAULT_LINE_COLOR GL_COLOR_A (0, 0, 0, 255) - -#define DEFAULT_FILL_COLOR GL_COLOR_A (0, 255, 0, 255) - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -enum { - CHANGED, - LAST_SIGNAL -}; - - - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -static guint signals[LAST_SIGNAL] = {0}; - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_prefs_model_finalize (GObject *object); - -static void notify_cb (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - glPrefsModel *prefs_model); - -static gchar *get_string (GConfClient *client, - const gchar *key, - const gchar *def); - -static gboolean get_bool (GConfClient *client, - const gchar *key, - gboolean def); - -static gint get_int (GConfClient *client, - const gchar *key, - gint def); - -static gdouble get_float (GConfClient *client, - const gchar *key, - gdouble def); - -static lglUnitsType string_to_units (const gchar *string); -static const gchar *units_to_string (lglUnitsType units); - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glPrefsModel, gl_prefs_model, G_TYPE_OBJECT); - -static void -gl_prefs_model_class_init (glPrefsModelClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_PREFS, "START"); - - gl_prefs_model_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_prefs_model_finalize; - - signals[CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glPrefsModelClass, changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - gl_debug (DEBUG_PREFS, "END"); -} - -static void -gl_prefs_model_init (glPrefsModel *prefs_model) -{ - gl_debug (DEBUG_PREFS, "START"); - - prefs_model->gconf_client = gconf_client_get_default (); - - g_return_if_fail (prefs_model->gconf_client != NULL); - - gconf_client_add_dir (prefs_model->gconf_client, - BASE_KEY, - GCONF_CLIENT_PRELOAD_ONELEVEL, - NULL); - - gconf_client_notify_add (prefs_model->gconf_client, - BASE_KEY, - (GConfClientNotifyFunc)notify_cb, prefs_model, - NULL, NULL); - - gl_debug (DEBUG_PREFS, "END"); -} - -static void -gl_prefs_model_finalize (GObject *object) -{ - glPrefsModel *prefs_model = GL_PREFS_MODEL (object); - - gl_debug (DEBUG_PREFS, "START"); - - g_return_if_fail (object && GL_IS_PREFS_MODEL (object)); - - g_object_unref (G_OBJECT(prefs_model->gconf_client)); - g_free (prefs_model->default_page_size); - g_free (prefs_model->default_font_family); - - G_OBJECT_CLASS (gl_prefs_model_parent_class)->finalize (object); - - gl_debug (DEBUG_PREFS, "END"); -} - -/*****************************************************************************/ -/* New prefs_model object. */ -/*****************************************************************************/ -glPrefsModel * -gl_prefs_model_new (void) -{ - glPrefsModel *prefs_model; - - gl_debug (DEBUG_PREFS, "START"); - - prefs_model = GL_PREFS_MODEL (g_object_new (gl_prefs_model_get_type(), NULL)); - - gl_debug (DEBUG_PREFS, "END"); - - return prefs_model; -} - - - -/*****************************************************************************/ -/* Save all settings. */ -/*****************************************************************************/ -void -gl_prefs_model_save_settings (glPrefsModel *prefs_model) -{ - gl_debug (DEBUG_PREFS, "START"); - - g_return_if_fail (prefs_model && GL_IS_PREFS_MODEL(prefs_model)); - g_return_if_fail (prefs_model->gconf_client != NULL); - - /* We are saving settings because presumably some of them have been changed. */ - g_signal_emit (G_OBJECT(prefs_model), signals[CHANGED], 0); - - /* Units */ - gconf_client_set_string (prefs_model->gconf_client, - BASE_KEY PREF_UNITS, - units_to_string(prefs_model->units), - NULL); - lgl_xml_set_default_units (prefs_model->units); - - /* Default page size */ - gconf_client_set_string (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_PAGE_SIZE, - prefs_model->default_page_size, - NULL); - - - /* Text properties */ - gconf_client_set_string (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_FONT_FAMILY, - prefs_model->default_font_family, - NULL); - - gconf_client_set_float (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_FONT_SIZE, - prefs_model->default_font_size, - NULL); - - gconf_client_set_string (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_FONT_WEIGHT, - gl_util_weight_to_string(prefs_model->default_font_weight), - NULL); - - gconf_client_set_int (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_TEXT_COLOR, - prefs_model->default_text_color, - NULL); - - gconf_client_set_string (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_TEXT_ALIGNMENT, - gl_util_align_to_string(prefs_model->default_text_alignment), - NULL); - - gconf_client_set_float (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_TEXT_LINE_SPACING, - prefs_model->default_text_line_spacing, - NULL); - - /* Line properties */ - gconf_client_set_float (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_LINE_WIDTH, - prefs_model->default_line_width, - NULL); - - gconf_client_set_int (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_LINE_COLOR, - prefs_model->default_line_color, - NULL); - - - /* Fill properties */ - gconf_client_set_int (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_FILL_COLOR, - prefs_model->default_fill_color, - NULL); - - - /* Main Toolbar */ - gconf_client_set_bool (prefs_model->gconf_client, - BASE_KEY PREF_MAIN_TOOLBAR_VISIBLE, - prefs_model->main_toolbar_visible, - NULL); - - gconf_client_set_int (prefs_model->gconf_client, - BASE_KEY PREF_MAIN_TOOLBAR_BUTTONS_STYLE, - prefs_model->main_toolbar_buttons_style, - NULL); - - gconf_client_set_bool (prefs_model->gconf_client, - BASE_KEY PREF_MAIN_TOOLBAR_VIEW_TOOLTIPS, - prefs_model->main_toolbar_view_tooltips, - NULL); - - /* Drawing Toolbar */ - gconf_client_set_bool (prefs_model->gconf_client, - BASE_KEY PREF_DRAWING_TOOLBAR_VISIBLE, - prefs_model->drawing_toolbar_visible, - NULL); - - gconf_client_set_bool (prefs_model->gconf_client, - BASE_KEY PREF_DRAWING_TOOLBAR_VIEW_TOOLTIPS, - prefs_model->drawing_toolbar_view_tooltips, - NULL); - - /* Property Toolbar */ - gconf_client_set_bool (prefs_model->gconf_client, - BASE_KEY PREF_PROPERTY_TOOLBAR_VISIBLE, - prefs_model->property_toolbar_visible, - NULL); - - gconf_client_set_bool (prefs_model->gconf_client, - BASE_KEY PREF_PROPERTY_TOOLBAR_VIEW_TOOLTIPS, - prefs_model->property_toolbar_view_tooltips, - NULL); - - /* View properties */ - gconf_client_set_bool (prefs_model->gconf_client, - BASE_KEY PREF_GRID_VISIBLE, - prefs_model->grid_visible, - NULL); - - gconf_client_set_bool (prefs_model->gconf_client, - BASE_KEY PREF_MARKUP_VISIBLE, - prefs_model->markup_visible, - NULL); - - /* Recent files */ - gconf_client_set_int (prefs_model->gconf_client, - BASE_KEY PREF_MAX_RECENTS, - prefs_model->max_recents, - NULL); - - /* Recent templates */ - gconf_client_set_list (prefs_model->gconf_client, - BASE_KEY PREF_RECENT_TEMPLATES, - GCONF_VALUE_STRING, - prefs_model->recent_templates, - NULL); - gconf_client_set_int (prefs_model->gconf_client, - BASE_KEY PREF_MAX_RECENT_TEMPLATES, - prefs_model->max_recent_templates, - NULL); - - - gconf_client_suggest_sync (prefs_model->gconf_client, NULL); - - gl_debug (DEBUG_PREFS, "END"); -} - -/*****************************************************************************/ -/* Load all settings. */ -/*****************************************************************************/ -void -gl_prefs_model_load_settings (glPrefsModel *prefs_model) -{ - gchar *string; - lglPaper *paper; - GSList *p, *p_next; - - gl_debug (DEBUG_PREFS, "START"); - - g_return_if_fail (prefs_model && GL_IS_PREFS_MODEL(prefs_model)); - g_return_if_fail (prefs_model->gconf_client != NULL); - - /* Units */ - string = - get_string (prefs_model->gconf_client, - BASE_KEY PREF_UNITS, - DEFAULT_UNITS_STRING); - prefs_model->units = string_to_units( string ); - g_free( string ); - lgl_xml_set_default_units (prefs_model->units); - - - /* Page size */ - g_free (prefs_model->default_page_size); - prefs_model->default_page_size = - get_string (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_PAGE_SIZE, - DEFAULT_PAGE_SIZE); - - /* Text properties */ - g_free (prefs_model->default_font_family); - prefs_model->default_font_family = - get_string (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_FONT_FAMILY, - DEFAULT_FONT_FAMILY); - - prefs_model->default_font_size = - get_float (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_FONT_SIZE, - DEFAULT_FONT_SIZE); - - string = - get_string (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_FONT_WEIGHT, - DEFAULT_FONT_WEIGHT_STRING); - prefs_model->default_font_weight = gl_util_string_to_weight( string ); - g_free( string ); - - prefs_model->default_text_color = - get_int (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_TEXT_COLOR, - DEFAULT_TEXT_COLOR); - - string = - get_string (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_TEXT_ALIGNMENT, - DEFAULT_TEXT_ALIGN_STRING); - prefs_model->default_text_alignment = gl_util_string_to_align( string ); - g_free( string ); - - prefs_model->default_text_line_spacing = - get_float (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_TEXT_LINE_SPACING, - DEFAULT_TEXT_LINE_SPACING); - - gl_debug (DEBUG_PREFS, "text_line_spacing = %f", prefs_model->default_text_line_spacing); - - /* Line properties */ - prefs_model->default_line_width = - get_float (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_LINE_WIDTH, - DEFAULT_LINE_WIDTH); - prefs_model->default_line_color = - get_int (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_LINE_COLOR, - DEFAULT_LINE_COLOR); - - /* Fill properties */ - prefs_model->default_fill_color = - get_int (prefs_model->gconf_client, - BASE_KEY PREF_DEFAULT_FILL_COLOR, - DEFAULT_FILL_COLOR); - - - /* User Inferface/Main Toolbar */ - prefs_model->main_toolbar_visible = - get_bool (prefs_model->gconf_client, - BASE_KEY PREF_MAIN_TOOLBAR_VISIBLE, - TRUE); - - prefs_model->main_toolbar_buttons_style = - get_int (prefs_model->gconf_client, - BASE_KEY PREF_MAIN_TOOLBAR_BUTTONS_STYLE, - GL_TOOLBAR_SYSTEM); - - prefs_model->main_toolbar_view_tooltips = - get_bool (prefs_model->gconf_client, - BASE_KEY PREF_MAIN_TOOLBAR_VIEW_TOOLTIPS, - TRUE); - - /* User Inferface/Drawing Toolbar */ - prefs_model->drawing_toolbar_visible = - get_bool (prefs_model->gconf_client, - BASE_KEY PREF_DRAWING_TOOLBAR_VISIBLE, - TRUE); - - prefs_model->drawing_toolbar_view_tooltips = - get_bool (prefs_model->gconf_client, - BASE_KEY PREF_DRAWING_TOOLBAR_VIEW_TOOLTIPS, - TRUE); - - /* User Inferface/Property Toolbar */ - prefs_model->property_toolbar_visible = - get_bool (prefs_model->gconf_client, - BASE_KEY PREF_PROPERTY_TOOLBAR_VISIBLE, - TRUE); - - prefs_model->property_toolbar_view_tooltips = - get_bool (prefs_model->gconf_client, - BASE_KEY PREF_PROPERTY_TOOLBAR_VIEW_TOOLTIPS, - TRUE); - - - /* View properties */ - prefs_model->grid_visible = - get_bool (prefs_model->gconf_client, - BASE_KEY PREF_GRID_VISIBLE, - TRUE); - - prefs_model->markup_visible = - get_bool (prefs_model->gconf_client, - BASE_KEY PREF_MARKUP_VISIBLE, - TRUE); - - /* Recent files */ - prefs_model->max_recents = - get_int (prefs_model->gconf_client, - BASE_KEY PREF_MAX_RECENTS, - -1); - - /* Recent templates */ - for (p=prefs_model->recent_templates; p != NULL; p=p->next) - { - g_free (p->data); - } - g_slist_free (prefs_model->recent_templates); - prefs_model->recent_templates = - gconf_client_get_list (prefs_model->gconf_client, - BASE_KEY PREF_RECENT_TEMPLATES, - GCONF_VALUE_STRING, - NULL); - prefs_model->max_recent_templates = - get_int (prefs_model->gconf_client, - BASE_KEY PREF_MAX_RECENT_TEMPLATES, - 5); - - - /* Proof read the default page size -- it must be a valid id. */ - /* (For compatability with older versions.) */ - paper = lgl_db_lookup_paper_from_id (prefs_model->default_page_size); - if ( paper == NULL ) { - prefs_model->default_page_size = g_strdup (DEFAULT_PAGE_SIZE); - } else { - lgl_paper_free (paper); - paper = NULL; - } - - /* Proof read the recent templates list. Make sure the template names */ - /* are valid. Remove from list if not. */ - for (p=prefs_model->recent_templates; p != NULL; p=p_next) - { - p_next = p->next; - - if ( !lgl_db_does_template_name_exist (p->data) ) - { - g_free (p->data); - prefs_model->recent_templates = g_slist_delete_link (prefs_model->recent_templates, p); - } - } - - gl_debug (DEBUG_PREFS, "max_recents = %d", prefs_model->max_recents); - - - g_signal_emit (G_OBJECT(prefs_model), signals[CHANGED], 0); - - gl_debug (DEBUG_PREFS, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Key changed callback. */ -/*---------------------------------------------------------------------------*/ -static void -notify_cb (GConfClient *client, - guint cnxn_id, - GConfEntry *entry, - glPrefsModel *prefs_model) -{ - gl_debug (DEBUG_PREFS, "Key was changed: %s", entry->key); - - gl_prefs_model_load_settings (prefs_model); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Utilities to get values with defaults. */ -/*---------------------------------------------------------------------------*/ -static gchar* -get_string (GConfClient *client, - const gchar *key, - const gchar *def) -{ - gchar* val; - - val = gconf_client_get_string (client, key, NULL); - - if (val != NULL) { - - return val; - - } else { - - return def ? g_strdup (def) : NULL; - - } -} - -static gboolean -get_bool (GConfClient *client, - const gchar *key, - gboolean def) -{ - GConfValue* val; - gboolean retval; - - val = gconf_client_get (client, key, NULL); - - if (val != NULL) { - - if ( val->type == GCONF_VALUE_BOOL ) { - retval = gconf_value_get_bool (val); - } else { - retval = def; - } - - gconf_value_free (val); - - return retval; - - } else { - - return def; - - } -} - -static gint -get_int (GConfClient *client, - const gchar *key, - gint def) -{ - GConfValue* val; - gint retval; - - val = gconf_client_get (client, key, NULL); - - if (val != NULL) { - - if ( val->type == GCONF_VALUE_INT) { - retval = gconf_value_get_int(val); - } else { - retval = def; - } - - gconf_value_free (val); - - return retval; - - } else { - - return def; - - } -} - -static gdouble -get_float (GConfClient *client, - const gchar *key, - gdouble def) -{ - GConfValue* val; - gdouble retval; - - val = gconf_client_get (client, key, NULL); - - if (val != NULL) { - - if ( val->type == GCONF_VALUE_FLOAT ) { - retval = gconf_value_get_float(val); - } else { - retval = def; - } - - gconf_value_free (val); - - return retval; - - } else { - return def; - - } -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Utilities to deal with units. */ -/*---------------------------------------------------------------------------*/ -static lglUnitsType -string_to_units (const gchar *string) -{ - lglUnitsType units; - - if (g_strcasecmp (string, "Points") == 0) { - units = LGL_UNITS_POINT; - } else if (g_strcasecmp (string, "Inches") == 0) { - units = LGL_UNITS_INCH; - } else if (g_strcasecmp (string, "Millimeters") == 0) { - units = LGL_UNITS_MM; - } else { - units = LGL_UNITS_INCH; - } - - return units; -} - -static const -gchar *units_to_string (lglUnitsType units) -{ - switch (units) { - case LGL_UNITS_POINT: - return "Points"; - break; - case LGL_UNITS_INCH: - return "Inches"; - break; - case LGL_UNITS_MM: - return "Millimeters"; - break; - default: - return "Inches"; - break; - } -} - - diff --git a/glabels2/src/prefs-model.h b/glabels2/src/prefs-model.h deleted file mode 100644 index b2cc1cbd..00000000 --- a/glabels2/src/prefs-model.h +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * prefs-model.h: Application preferences model module header file - * - * Copyright (C) 2001-2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __PREFS_MODEL_H__ -#define __PREFS_MODEL_H__ - -#include -#include -#include -#include - -G_BEGIN_DECLS - -typedef enum { - GL_TOOLBAR_SYSTEM = 0, - GL_TOOLBAR_ICONS, - GL_TOOLBAR_ICONS_AND_TEXT -} glToolbarSetting; - -#define GL_TYPE_PREFS_MODEL (gl_prefs_model_get_type ()) -#define GL_PREFS_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_PREFS_MODEL, glPrefsModel)) -#define GL_PREFS_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_PREFS_MODEL, glPrefsModelClass)) -#define GL_IS_PREFS_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_PREFS_MODEL)) -#define GL_IS_PREFS_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_PREFS_MODEL)) -#define GL_PREFS_MODEL_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_PREFS_MODEL, glPrefsModelClass)) - - -typedef struct _glPrefsModel glPrefsModel; -typedef struct _glPrefsModelClass glPrefsModelClass; - -typedef struct _glPrefsModelPrivate glPrefsModelPrivate; - - -struct _glPrefsModel { - GObject *object; - - GConfClient *gconf_client; - - /* Units */ - lglUnitsType units; - - /* Page size */ - gchar *default_page_size; - - /* Text properties */ - gchar *default_font_family; - gdouble default_font_size; - PangoWeight default_font_weight; - gboolean default_font_italic_flag; - guint default_text_color; - PangoAlignment default_text_alignment; - gdouble default_text_line_spacing; - - /* Line properties */ - gdouble default_line_width; - guint default_line_color; - - /* Fill properties */ - guint default_fill_color; - - /* User Interface/Main Toolbar */ - gboolean main_toolbar_visible; - glToolbarSetting main_toolbar_buttons_style; - gboolean main_toolbar_view_tooltips; - - /* User Interface/Drawing Toolbar */ - gboolean drawing_toolbar_visible; - gboolean drawing_toolbar_view_tooltips; - - /* User Interface/Property Toolbar */ - gboolean property_toolbar_visible; - gboolean property_toolbar_view_tooltips; - - /* View properties */ - gboolean grid_visible; - gboolean markup_visible; - - /* Recent files */ - gint max_recents; - - /* Recent templates */ - GSList *recent_templates; - gint max_recent_templates; -}; - -struct _glPrefsModelClass { - GObjectClass parent_class; - - void (*changed) (glPrefsModel *prefs_model, gpointer user_data); -}; - - -GType gl_prefs_model_get_type (void) G_GNUC_CONST; - -glPrefsModel *gl_prefs_model_new (void); - -void gl_prefs_model_save_settings (glPrefsModel *prefs_model); - -void gl_prefs_model_load_settings (glPrefsModel *prefs_model); - -G_END_DECLS - -#endif /* __PREFS_MODEL_H__ */ - diff --git a/glabels2/src/prefs.c b/glabels2/src/prefs.c deleted file mode 100644 index 32011b79..00000000 --- a/glabels2/src/prefs.c +++ /dev/null @@ -1,214 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * prefs.c: Application preferences module - * - * Copyright (C) 2001-2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "prefs.h" - -#include -#include - -#include "debug.h" - -glPrefsModel *gl_prefs = NULL; - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - - - -/*****************************************************************************/ -/* Initialize preferences module. */ -/*****************************************************************************/ -void -gl_prefs_init (void) -{ - gl_debug (DEBUG_PREFS, "START"); - - gl_prefs = gl_prefs_model_new (); - - gl_prefs_model_load_settings (gl_prefs); - - gl_debug (DEBUG_PREFS, "END"); -} - - -/****************************************************************************/ -/* Get string representing desired units. */ -/****************************************************************************/ -const gchar * -gl_prefs_get_page_size (void) -{ - return (gl_prefs->default_page_size); -} - -/****************************************************************************/ -/* Get desired units. */ -/****************************************************************************/ -lglUnitsType -gl_prefs_get_units (void) -{ - return gl_prefs->units; -} - -/****************************************************************************/ -/* Get desired units per point. */ -/****************************************************************************/ -gdouble -gl_prefs_get_units_per_point (void) -{ - - switch (gl_prefs->units) { - case LGL_UNITS_POINT: - return 1.0; /* points */ - case LGL_UNITS_INCH: - return 1.0 / 72.0; /* inches */ - case LGL_UNITS_MM: - return 0.35277778; /* mm */ - default: - g_message ("Illegal units"); /* Should not happen */ - return 1.0; - } -} - -/****************************************************************************/ -/* Get precision for desired units. */ -/****************************************************************************/ -gint -gl_prefs_get_units_precision (void) -{ - - switch (gl_prefs->units) { - case LGL_UNITS_POINT: - return 1; /* points */ - case LGL_UNITS_INCH: - return 3; /* inches */ - case LGL_UNITS_MM: - return 1; /* mm */ - default: - g_message ("Illegal units"); /* Should not happen */ - return 1.0; - } -} - -/****************************************************************************/ -/* Get step size for desired units. */ -/****************************************************************************/ -gdouble -gl_prefs_get_units_step_size (void) -{ - - switch (gl_prefs->units) { - case LGL_UNITS_POINT: - return 0.1; /* points */ - case LGL_UNITS_INCH: - return 0.001; /* inches */ - case LGL_UNITS_MM: - return 0.1; /* mm */ - default: - g_message ("Illegal units"); /* Should not happen */ - return 1.0; - } -} - -/****************************************************************************/ -/* Get string representing desired units. */ -/****************************************************************************/ -const gchar * -gl_prefs_get_units_string (void) -{ - - switch (gl_prefs->units) { - case LGL_UNITS_POINT: - return _("points"); - case LGL_UNITS_INCH: - return _("inches"); - case LGL_UNITS_MM: - return _("mm"); - default: - g_message ("Illegal units"); /* Should not happen */ - return _("points"); - } -} - -/****************************************************************************/ -/* Add template to recent template list. */ -/****************************************************************************/ -void -gl_prefs_add_recent_template (const gchar *name) -{ - GSList *p; - - /* - * If already in list, remove that entry. - */ - p = g_slist_find_custom (gl_prefs->recent_templates, - name, - (GCompareFunc)lgl_str_utf8_casecmp); - if (p) - { - gl_prefs->recent_templates = - g_slist_remove_link (gl_prefs->recent_templates, p); - g_free (p->data); - g_slist_free_1 (p); - } - - /* - * Now prepend to list. - */ - gl_prefs->recent_templates = - g_slist_prepend (gl_prefs->recent_templates, g_strdup (name)); - - /* - * Truncate list to maximum size - */ - while (g_slist_length (gl_prefs->recent_templates) > gl_prefs->max_recent_templates) - { - p = g_slist_last (gl_prefs->recent_templates); - gl_prefs->recent_templates = - g_slist_remove_link (gl_prefs->recent_templates, p); - g_free (p->data); - g_slist_free_1 (p); - } - - /* - * Sync to disk. - */ - gl_prefs_model_save_settings (gl_prefs); -} diff --git a/glabels2/src/prefs.h b/glabels2/src/prefs.h deleted file mode 100644 index 98474f5c..00000000 --- a/glabels2/src/prefs.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * prefs.h: Application preferences module header file - * - * Copyright (C) 2001-2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __PREFS_H__ -#define __PREFS_H__ - -#include "prefs-model.h" - -G_BEGIN_DECLS - - - -extern glPrefsModel *gl_prefs; - - - -void gl_prefs_init (void); - -const gchar *gl_prefs_get_page_size (void); - -lglUnitsType gl_prefs_get_units (void); - -const gchar *gl_prefs_get_units_string (void); - -gdouble gl_prefs_get_units_per_point (void); - -gdouble gl_prefs_get_units_step_size (void); - -gint gl_prefs_get_units_precision (void); - -void gl_prefs_add_recent_template (const gchar *name); - -G_END_DECLS - -#endif /* __PREFS_H__ */ - diff --git a/glabels2/src/print-op.c b/glabels2/src/print-op.c deleted file mode 100644 index 2b2cd4a7..00000000 --- a/glabels2/src/print-op.c +++ /dev/null @@ -1,690 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * print-op.c: Print operation module - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "print-op.h" - -#include -#include -#include -#include -#include -#include - -#include -#include "print.h" -#include "label.h" - -#include "wdgt-print-copies.h" -#include "wdgt-print-merge.h" - -#include "debug.h" - -/*===========================================*/ -/* Private data types */ -/*===========================================*/ - -struct _glPrintOpPrivate { - - glLabel *label; - - GtkWidget *simple_frame; - GtkWidget *copies_vbox; - GtkWidget *copies; - - GtkWidget *merge_frame; - GtkWidget *prmerge_vbox; - GtkWidget *prmerge; - - GtkWidget *outline_check; - GtkWidget *reverse_check; - GtkWidget *crop_marks_check; - - gboolean force_outline_flag; - - gchar *filename; - - gboolean outline_flag; - gboolean reverse_flag; - gboolean crop_marks_flag; - gboolean merge_flag; - gboolean collate_flag; - - gint first; - gint last; - gint n_sheets; - gint n_copies; - - glPrintState state; -}; - -struct _glPrintOpSettings -{ - - GtkPrintSettings *gtk_settings; - - gboolean outline_flag; - gboolean reverse_flag; - gboolean crop_marks_flag; - gboolean collate_flag; - - gint first; - gint last; - gint n_sheets; - gint n_copies; - -}; - - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_print_op_finalize (GObject *object); - -static void gl_print_op_construct (glPrintOp *op, - glLabel *label); - -static void gl_print_op_construct_batch (glPrintOp *op, - glLabel *label, - gchar *filename, - gint n_sheets, - gint n_copies, - gint first, - gboolean outline_flag, - gboolean reverse_flag, - gboolean crop_marks_flag); - - -static void set_page_size (glPrintOp *op, - glLabel *label); - -static GObject *create_custom_widget_cb (GtkPrintOperation *operation, - gpointer user_data); - -static void custom_widget_apply_cb (GtkPrintOperation *operation, - GtkWidget *widget, - gpointer user_data); - -static void begin_print_cb (GtkPrintOperation *operation, - GtkPrintContext *context, - gpointer user_data); - -static void draw_page_cb (GtkPrintOperation *operation, - GtkPrintContext *context, - int page_nr, - gpointer user_data); - - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glPrintOp, gl_print_op, GTK_TYPE_PRINT_OPERATION); - -static void -gl_print_op_class_init (glPrintOpClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_PRINT, ""); - - gl_print_op_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_print_op_finalize; -} - -static void -gl_print_op_init (glPrintOp *op) -{ - gl_debug (DEBUG_PRINT, ""); - - gtk_print_operation_set_use_full_page (GTK_PRINT_OPERATION (op), TRUE); - - gtk_print_operation_set_unit (GTK_PRINT_OPERATION (op), GTK_UNIT_POINTS); - - op->priv = g_new0 (glPrintOpPrivate, 1); - -} - -static void -gl_print_op_finalize (GObject *object) -{ - glPrintOp* op = GL_PRINT_OP (object); - - gl_debug (DEBUG_PRINT, ""); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_PRINT_OP (op)); - g_return_if_fail (op->priv != NULL); - - if (op->priv->label) { - g_object_unref (G_OBJECT(op->priv->label)); - } - g_free (op->priv->filename); - g_free (op->priv); - - G_OBJECT_CLASS (gl_print_op_parent_class)->finalize (object); - - g_free (op->priv); -} - -/*****************************************************************************/ -/* NEW print op. */ -/*****************************************************************************/ -glPrintOp * -gl_print_op_new (glLabel *label) -{ - glPrintOp *op; - - gl_debug (DEBUG_PRINT, ""); - - op = GL_PRINT_OP (g_object_new (GL_TYPE_PRINT_OP, NULL)); - - gl_print_op_construct (GL_PRINT_OP(op), label); - - return op; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct op. */ -/*--------------------------------------------------------------------------*/ -static void -gl_print_op_construct (glPrintOp *op, - glLabel *label) -{ - const lglTemplateFrame *frame; - - op->priv->label = label; - op->priv->force_outline_flag = FALSE; - - frame = (lglTemplateFrame *)label->template->frames->data; - - op->priv->n_sheets = 1; - op->priv->first = 1; - op->priv->last = lgl_template_frame_get_n_labels (frame); - op->priv->n_copies = 1; - - set_page_size (op, label); - - gtk_print_operation_set_custom_tab_label ( GTK_PRINT_OPERATION (op), - _("Labels")); - - g_signal_connect (G_OBJECT (op), "create-custom-widget", - G_CALLBACK (create_custom_widget_cb), label); - - g_signal_connect (G_OBJECT (op), "custom-widget-apply", - G_CALLBACK (custom_widget_apply_cb), label); - - g_signal_connect (G_OBJECT (op), "begin-print", - G_CALLBACK (begin_print_cb), label); - - g_signal_connect (G_OBJECT (op), "draw-page", - G_CALLBACK (draw_page_cb), label); -} - -/*****************************************************************************/ -/* NEW batch print operation. */ -/*****************************************************************************/ -glPrintOp * -gl_print_op_new_batch (glLabel *label, - gchar *filename, - gint n_sheets, - gint n_copies, - gint first, - gboolean outline_flag, - gboolean reverse_flag, - gboolean crop_marks_flag) -{ - glPrintOp *op; - - gl_debug (DEBUG_PRINT, ""); - - op = GL_PRINT_OP (g_object_new (GL_TYPE_PRINT_OP, NULL)); - - gl_print_op_construct_batch (GL_PRINT_OP(op), - label, - filename, - n_sheets, - n_copies, - first, - outline_flag, - reverse_flag, - crop_marks_flag); - - return op; -} - -/*****************************************************************************/ -/* Get print operation settings. */ -/*****************************************************************************/ -glPrintOpSettings * -gl_print_op_get_settings (glPrintOp *print_op) -{ - glPrintOpSettings *settings; - - settings = g_new0 (glPrintOpSettings, 1); - - if ( settings ) - { - settings->gtk_settings = - gtk_print_operation_get_print_settings (GTK_PRINT_OPERATION (print_op)); - - settings->outline_flag = print_op->priv->outline_flag; - settings->reverse_flag = print_op->priv->reverse_flag; - settings->crop_marks_flag = print_op->priv->crop_marks_flag; - settings->collate_flag = print_op->priv->collate_flag; - - settings->first = print_op->priv->first; - settings->last = print_op->priv->last; - settings->n_sheets = print_op->priv->n_sheets; - settings->n_copies = print_op->priv->n_copies; - } - - return settings; -} - -/*****************************************************************************/ -/* Set print operation settings. */ -/*****************************************************************************/ -void -gl_print_op_set_settings (glPrintOp *print_op, - glPrintOpSettings *settings) -{ - - if ( settings ) - { - gtk_print_operation_set_print_settings (GTK_PRINT_OPERATION (print_op), - settings->gtk_settings); - - print_op->priv->outline_flag = settings->outline_flag; - print_op->priv->reverse_flag = settings->reverse_flag; - print_op->priv->crop_marks_flag = settings->crop_marks_flag; - print_op->priv->collate_flag = settings->collate_flag; - - print_op->priv->first = settings->first; - print_op->priv->last = settings->last; - print_op->priv->n_sheets = settings->n_sheets; - print_op->priv->n_copies = settings->n_copies; - } - - } - -/*****************************************************************************/ -/* Free print operation settings structure. */ -/*****************************************************************************/ -void -gl_print_op_free_settings(glPrintOpSettings *settings) -{ - - if ( settings ) - { - if ( settings->gtk_settings ) - { - g_object_unref (settings->gtk_settings); - } - - g_free (settings); - } -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct op. */ -/*--------------------------------------------------------------------------*/ -static void -gl_print_op_construct_batch (glPrintOp *op, - glLabel *label, - gchar *filename, - gint n_sheets, - gint n_copies, - gint first, - gboolean outline_flag, - gboolean reverse_flag, - gboolean crop_marks_flag) - -{ - glMerge *merge = NULL; - const lglTemplateFrame *frame = NULL; - - op->priv->label = label; - op->priv->force_outline_flag = FALSE; - op->priv->filename = g_strdup (filename); - op->priv->n_sheets = n_sheets; - op->priv->n_copies = n_copies; - op->priv->first = first; - op->priv->outline_flag = outline_flag; - op->priv->reverse_flag = reverse_flag; - op->priv->crop_marks_flag = crop_marks_flag; - - merge = gl_label_get_merge (label); - - frame = (lglTemplateFrame *)label->template->frames->data; - if (merge == NULL) - { - op->priv->merge_flag = FALSE; - - op->priv->last = lgl_template_frame_get_n_labels (frame); - - } - else - { - op->priv->merge_flag = TRUE; - - op->priv->n_sheets = - ceil ((double)(first-1 + n_copies * gl_merge_get_record_count(merge)) - / lgl_template_frame_get_n_labels (frame));; - - g_object_unref (G_OBJECT(merge)); - - } - - set_page_size (op, label); - - gtk_print_operation_set_export_filename (GTK_PRINT_OPERATION (op), - filename); - - g_signal_connect (G_OBJECT (op), "begin-print", - G_CALLBACK (begin_print_cb), label); - - g_signal_connect (G_OBJECT (op), "draw-page", - G_CALLBACK (draw_page_cb), label); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Set page size. */ -/*--------------------------------------------------------------------------*/ -static void -set_page_size (glPrintOp *op, - glLabel *label) -{ - GtkPaperSize *psize; - GtkPageSetup *su; - lglPaper *paper; - - gl_debug (DEBUG_PRINT, "begin"); - - paper = lgl_db_lookup_paper_from_id (label->template->paper_id); - - if (!paper) - { - const gchar *name; - - name = gtk_paper_size_get_default (); - psize = gtk_paper_size_new (name); - - gl_debug (DEBUG_PRINT, "Using default size = \"%s\"", name); - } - else if (lgl_db_is_paper_id_other (paper->id)) - { - psize = gtk_paper_size_new_custom (paper->id, - paper->name, - label->template->page_width, - label->template->page_height, - GTK_UNIT_POINTS); - gl_debug (DEBUG_PRINT, "Using custom size = %g x %g points", - label->template->page_width, - label->template->page_height); - - } - else - { - psize = gtk_paper_size_new (paper->pwg_size); - gl_debug (DEBUG_PRINT, "Using PWG size \"%s\"", paper->pwg_size); - } - lgl_paper_free (paper); - - su = gtk_page_setup_new (); - gtk_page_setup_set_paper_size (su, psize); - gtk_print_operation_set_default_page_setup (GTK_PRINT_OPERATION (op), su); - g_object_unref (su); - - gtk_paper_size_free (psize); - - gl_debug (DEBUG_PRINT, "end"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. "Create custom widget" callback */ -/*--------------------------------------------------------------------------*/ -static GObject * -create_custom_widget_cb (GtkPrintOperation *operation, - gpointer user_data) -{ - GladeXML *gui; - glPrintOp *op = GL_PRINT_OP (operation); - glLabel *label = GL_LABEL (user_data); - GtkWidget *vbox; - glMerge *merge = NULL; - - gui = glade_xml_new (GLABELS_GLADE_DIR "print-custom-widget.glade", - "print_custom_widget_vbox", NULL); - - if (!gui) { - g_warning ("Could not open print-op.glade, reinstall glabels!"); - return NULL; - } - - vbox = glade_xml_get_widget (gui, "print_custom_widget_vbox"); - - /* ----- Simple print control ----- */ - op->priv->simple_frame = glade_xml_get_widget (gui, "simple_frame"); - op->priv->copies_vbox = glade_xml_get_widget (gui, "copies_vbox"); - op->priv->copies = gl_wdgt_print_copies_new (label); - gtk_box_pack_start (GTK_BOX(op->priv->copies_vbox), - op->priv->copies, FALSE, FALSE, 0); - - /* ----- Merge print control ----- */ - op->priv->merge_frame = glade_xml_get_widget (gui, "merge_frame"); - op->priv->prmerge_vbox = glade_xml_get_widget (gui, "prmerge_vbox"); - op->priv->prmerge = gl_wdgt_print_merge_new (label); - gtk_box_pack_start (GTK_BOX(op->priv->prmerge_vbox), - op->priv->prmerge, FALSE, FALSE, 0); - - /* ----- Options ----------------- */ - op->priv->outline_check = glade_xml_get_widget (gui, "outline_check"); - op->priv->reverse_check = glade_xml_get_widget (gui, "reverse_check"); - op->priv->crop_marks_check = glade_xml_get_widget (gui, "crop_marks_check"); - - g_object_unref (gui); - - /* ---- Activate either simple or merge print control widgets. ---- */ - merge = gl_label_get_merge (op->priv->label); - if (merge == NULL) { - - gl_wdgt_print_copies_set_range (GL_WDGT_PRINT_COPIES (op->priv->copies), - op->priv->n_sheets, - op->priv->first, - op->priv->last); - - gtk_widget_show_all (op->priv->simple_frame); - gtk_widget_hide_all (op->priv->merge_frame); - - } else { - - gint n_records = gl_merge_get_record_count( merge ); - gl_wdgt_print_merge_set_copies (GL_WDGT_PRINT_MERGE (op->priv->prmerge), - op->priv->n_copies, - op->priv->first, - n_records, - op->priv->collate_flag); - g_object_unref (G_OBJECT(merge)); - - gtk_widget_hide_all (op->priv->simple_frame); - gtk_widget_show_all (op->priv->merge_frame); - } - - /* --- Set options --- */ - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (op->priv->outline_check), - op->priv->outline_flag); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (op->priv->reverse_check), - op->priv->reverse_flag); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (op->priv->crop_marks_check), - op->priv->crop_marks_flag); - - /* --- Do we need to force the outline flag --- */ - if (op->priv->force_outline_flag) - { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(op->priv->outline_check), - TRUE); - - gtk_widget_set_sensitive (op->priv->outline_check, FALSE); - gtk_widget_set_sensitive (op->priv->reverse_check, FALSE); - gtk_widget_set_sensitive (op->priv->crop_marks_check, FALSE); - } - - return G_OBJECT (vbox); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. "Custom widget apply" callback */ -/*--------------------------------------------------------------------------*/ -static void -custom_widget_apply_cb (GtkPrintOperation *operation, - GtkWidget *widget, - gpointer user_data) -{ - glPrintOp *op = GL_PRINT_OP (operation); - glMerge *merge = NULL; - - - op->priv->outline_flag = - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON - (op->priv->outline_check)); - op->priv->reverse_flag = - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON - (op->priv->reverse_check)); - op->priv->crop_marks_flag = - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON - (op->priv->crop_marks_check)); - - merge = gl_label_get_merge (op->priv->label); - - if (merge == NULL) - { - - op->priv->merge_flag = FALSE; - gl_wdgt_print_copies_get_range (GL_WDGT_PRINT_COPIES (op->priv->copies), - &op->priv->n_sheets, - &op->priv->first, - &op->priv->last); - } - else - { - - op->priv->merge_flag = TRUE; - gl_wdgt_print_merge_get_copies (GL_WDGT_PRINT_MERGE (op->priv->prmerge), - &op->priv->n_copies, - &op->priv->first, - &op->priv->collate_flag, - &op->priv->n_sheets); - g_object_unref (G_OBJECT(merge)); - } - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. "Begin print" callback */ -/*--------------------------------------------------------------------------*/ -static void -begin_print_cb (GtkPrintOperation *operation, - GtkPrintContext *context, - gpointer user_data) -{ - glPrintOp *op = GL_PRINT_OP (operation); - - gtk_print_operation_set_n_pages (operation, op->priv->n_sheets); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. "Draw page" callback. */ -/*--------------------------------------------------------------------------*/ -static void -draw_page_cb (GtkPrintOperation *operation, - GtkPrintContext *context, - int page_nr, - gpointer user_data) -{ - glPrintOp *op = GL_PRINT_OP (operation); - cairo_t *cr; - - cr = gtk_print_context_get_cairo_context (context); - - if (!op->priv->merge_flag) - { - gl_print_simple_sheet (op->priv->label, - cr, - page_nr, - op->priv->n_sheets, - op->priv->first, - op->priv->last, - op->priv->outline_flag, - op->priv->reverse_flag, - op->priv->crop_marks_flag); - } - else - { - if (op->priv->collate_flag) - { - gl_print_collated_merge_sheet (op->priv->label, - cr, - page_nr, - op->priv->n_copies, - op->priv->first, - op->priv->outline_flag, - op->priv->reverse_flag, - op->priv->crop_marks_flag, - &op->priv->state); - } - else - { - gl_print_uncollated_merge_sheet (op->priv->label, - cr, - page_nr, - op->priv->n_copies, - op->priv->first, - op->priv->outline_flag, - op->priv->reverse_flag, - op->priv->crop_marks_flag, - &op->priv->state); - } - } -} - - -/*****************************************************************************/ -/* Set outline flag/checkbox. */ -/*****************************************************************************/ -void -gl_print_op_force_outline_flag (glPrintOp *op) -{ - op->priv->force_outline_flag = TRUE; -} - - diff --git a/glabels2/src/print-op.h b/glabels2/src/print-op.h deleted file mode 100644 index 75c893c5..00000000 --- a/glabels2/src/print-op.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * print-op.h: Print operation module header file - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __PRINT_OP_H__ -#define __PRINT_OP_H__ - -#include -#include "label.h" - -G_BEGIN_DECLS - -#define GL_TYPE_PRINT_OP (gl_print_op_get_type ()) -#define GL_PRINT_OP(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_PRINT_OP, glPrintOp)) -#define GL_PRINT_OP_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_PRINT_OP, glPrintOpClass)) -#define GL_IS_PRINT_OP(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_PRINT_OP)) -#define GL_IS_PRINT_OP_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_PRINT_OP)) -#define GL_PRINT_OP_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_PRINT_OP, glPrintOpClass)) - - -typedef struct _glPrintOp glPrintOp; -typedef struct _glPrintOpClass glPrintOpClass; - -typedef struct _glPrintOpPrivate glPrintOpPrivate; - -struct _glPrintOp -{ - GtkPrintOperation parent_instance; - - glPrintOpPrivate *priv; - -}; - -struct _glPrintOpClass -{ - GtkPrintOperationClass parent_class; -}; - - -typedef struct _glPrintOpSettings glPrintOpSettings; - - - -GType gl_print_op_get_type (void) G_GNUC_CONST; - -glPrintOp *gl_print_op_new (glLabel *label); - -void gl_print_op_force_outline_flag (glPrintOp *print_op); - -glPrintOpSettings *gl_print_op_get_settings (glPrintOp *print_op); -void gl_print_op_set_settings (glPrintOp *print_op, - glPrintOpSettings *settings); -void gl_print_op_free_settings (glPrintOpSettings *settings); - -/* - * Batch print operation - */ -glPrintOp *gl_print_op_new_batch (glLabel *label, - gchar *filename, - gint n_sheets, - gint n_copies, - gint first, - gboolean outline_flag, - gboolean reverse_flag, - gboolean crop_marks_flag); - -G_END_DECLS - -#endif diff --git a/glabels2/src/print.c b/glabels2/src/print.c deleted file mode 100644 index a33e3ad1..00000000 --- a/glabels2/src/print.c +++ /dev/null @@ -1,575 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * print.c: Print module - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "print.h" - -#include -#include -#include -#include - -#include "label.h" -#include -#include "cairo-label-path.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros and constants. */ -/*===========================================*/ - -#define OUTLINE_RGB_ARGS 0.0, 0.0, 0.0 - -#define OUTLINE_WIDTH 0.25 - -#define TICK_OFFSET 2.25 -#define TICK_LENGTH 18.0 - -/*=========================================================================*/ -/* Private types. */ -/*=========================================================================*/ - -typedef struct _PrintInfo { - cairo_t *cr; - - /* gLabels Template */ - lglTemplate *template; - gboolean label_rotate_flag; - - /* page size */ - gdouble page_width; - gdouble page_height; - -} PrintInfo; - - -/*=========================================================================*/ -/* Private function prototypes. */ -/*=========================================================================*/ -static PrintInfo *print_info_new (cairo_t *cr, - glLabel *label); - -static void print_info_free (PrintInfo **pi); - -static void print_crop_marks (PrintInfo *pi); - -static void print_label (PrintInfo *pi, - glLabel *label, - gdouble x, - gdouble y, - glMergeRecord *record, - gboolean outline_flag, - gboolean reverse_flag); - - -static void draw_outline (PrintInfo *pi, - glLabel *label); - -static void clip_to_outline (PrintInfo *pi, - glLabel *label); - - - -/*****************************************************************************/ -/* Print simple sheet (no merge data) command. */ -/*****************************************************************************/ -void -gl_print_simple_sheet (glLabel *label, - cairo_t *cr, - gint page, - gint n_sheets, - gint first, - gint last, - gboolean outline_flag, - gboolean reverse_flag, - gboolean crop_marks_flag) -{ - PrintInfo *pi; - const lglTemplateFrame *frame; - gint i_label; - lglTemplateOrigin *origins; - - gl_debug (DEBUG_PRINT, "START"); - - pi = print_info_new (cr, label); - - frame = (lglTemplateFrame *)pi->template->frames->data; - origins = lgl_template_frame_get_origins (frame); - - if (crop_marks_flag) { - print_crop_marks (pi); - } - - for (i_label = first - 1; i_label < last; i_label++) { - - print_label (pi, label, - origins[i_label].x, origins[i_label].y, - NULL, outline_flag, reverse_flag); - - } - - g_free (origins); - - print_info_free (&pi); - - gl_debug (DEBUG_PRINT, "END"); -} - -/*****************************************************************************/ -/* Print collated merge sheet command */ -/*****************************************************************************/ -void -gl_print_collated_merge_sheet (glLabel *label, - cairo_t *cr, - gint page, - gint n_copies, - gint first, - gboolean outline_flag, - gboolean reverse_flag, - gboolean crop_marks_flag, - glPrintState *state) -{ - glMerge *merge; - const GList *record_list; - PrintInfo *pi; - const lglTemplateFrame *frame; - gint i_label, n_labels_per_page, i_copy; - glMergeRecord *record; - GList *p; - lglTemplateOrigin *origins; - - gl_debug (DEBUG_PRINT, "START"); - - merge = gl_label_get_merge (label); - record_list = gl_merge_get_record_list (merge); - - pi = print_info_new (cr, label); - frame = (lglTemplateFrame *)pi->template->frames->data; - - n_labels_per_page = lgl_template_frame_get_n_labels (frame); - origins = lgl_template_frame_get_origins (frame); - - if (crop_marks_flag) { - print_crop_marks (pi); - } - - if (page == 0) - { - state->i_copy = 0; - state->p_record = (GList *)record_list; - - i_label = first - 1; - } - else - { - i_label = 0; - } - - - for ( p=(GList *)state->p_record; p!=NULL; p=p->next ) { - record = (glMergeRecord *)p->data; - - if ( record->select_flag ) { - for (i_copy = state->i_copy; i_copy < n_copies; i_copy++) { - - print_label (pi, label, - origins[i_label].x, - origins[i_label].y, - record, - outline_flag, reverse_flag); - - i_label++; - if (i_label == n_labels_per_page) - { - g_free (origins); - print_info_free (&pi); - - state->i_copy = (i_copy+1) % n_copies; - if (state->i_copy == 0) - { - state->p_record = p->next; - } - else - { - state->p_record = p; - } - return; - } - } - state->i_copy = 0; - } - } - - g_free (origins); - print_info_free (&pi); - - gl_debug (DEBUG_PRINT, "END"); -} - -/*****************************************************************************/ -/* Print uncollated merge sheet command */ -/*****************************************************************************/ -void -gl_print_uncollated_merge_sheet (glLabel *label, - cairo_t *cr, - gint page, - gint n_copies, - gint first, - gboolean outline_flag, - gboolean reverse_flag, - gboolean crop_marks_flag, - glPrintState *state) -{ - glMerge *merge; - const GList *record_list; - PrintInfo *pi; - const lglTemplateFrame *frame; - gint i_label, n_labels_per_page, i_copy; - glMergeRecord *record; - GList *p; - lglTemplateOrigin *origins; - - gl_debug (DEBUG_PRINT, "START"); - - merge = gl_label_get_merge (label); - record_list = gl_merge_get_record_list (merge); - - pi = print_info_new (cr, label); - frame = (lglTemplateFrame *)pi->template->frames->data; - - n_labels_per_page = lgl_template_frame_get_n_labels (frame); - origins = lgl_template_frame_get_origins (frame); - - if (crop_marks_flag) { - print_crop_marks (pi); - } - - if (page == 0) - { - state->i_copy = 0; - state->p_record = (GList *)record_list; - - i_label = first - 1; - } - else - { - i_label = 0; - } - - for (i_copy = state->i_copy; i_copy < n_copies; i_copy++) { - - for ( p=state->p_record; p!=NULL; p=p->next ) { - record = (glMergeRecord *)p->data; - - if ( record->select_flag ) { - - print_label (pi, label, - origins[i_label].x, - origins[i_label].y, - record, - outline_flag, reverse_flag); - - i_label++; - if (i_label == n_labels_per_page) - { - g_free (origins); - print_info_free (&pi); - - state->p_record = p->next; - if (state->p_record == NULL) - { - state->p_record = (GList *)record_list; - state->i_copy = i_copy + 1; - } - else - { - state->i_copy = i_copy; - } - return; - } - } - } - state->p_record = (GList *)record_list; - - } - - g_free (origins); - print_info_free (&pi); - - gl_debug (DEBUG_PRINT, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. new print info structure */ -/*---------------------------------------------------------------------------*/ -static PrintInfo * -print_info_new (cairo_t *cr, - glLabel *label) -{ - PrintInfo *pi = g_new0 (PrintInfo, 1); - - gl_debug (DEBUG_PRINT, "START"); - - g_return_val_if_fail (label && GL_IS_LABEL (label), NULL); - - g_return_val_if_fail (label->template, NULL); - g_return_val_if_fail (label->template->paper_id, NULL); - g_return_val_if_fail (label->template->page_width > 0, NULL); - g_return_val_if_fail (label->template->page_height > 0, NULL); - - pi->cr = cr; - - gl_debug (DEBUG_PRINT, - "setting page size = \"%s\"", label->template->paper_id); - - pi->page_width = label->template->page_width; - pi->page_height = label->template->page_height; - - pi->template = label->template; - pi->label_rotate_flag = label->rotate_flag; - - gl_debug (DEBUG_PRINT, "END"); - - return pi; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. free print info structure */ -/*---------------------------------------------------------------------------*/ -static void -print_info_free (PrintInfo **pi) -{ - gl_debug (DEBUG_PRINT, "START"); - - - g_free (*pi); - *pi = NULL; - - gl_debug (DEBUG_PRINT, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Print crop tick marks. */ -/*---------------------------------------------------------------------------*/ -static void -print_crop_marks (PrintInfo *pi) -{ - const lglTemplateFrame *frame; - gdouble w, h, page_w, page_h; - GList *p; - lglTemplateLayout *layout; - gdouble xmin, ymin, xmax, ymax, dx, dy; - gdouble x1, y1, x2, y2, x3, y3, x4, y4; - gint ix, iy, nx, ny; - - gl_debug (DEBUG_PRINT, "START"); - - frame = (lglTemplateFrame *)pi->template->frames->data; - - lgl_template_frame_get_size (frame, &w, &h); - - page_w = pi->page_width; - page_h = pi->page_height; - - cairo_save (pi->cr); - - cairo_set_source_rgb (pi->cr, OUTLINE_RGB_ARGS); - cairo_set_line_width (pi->cr, OUTLINE_WIDTH); - - for (p=frame->all.layouts; p != NULL; p=p->next) { - - layout = (lglTemplateLayout *)p->data; - - xmin = layout->x0; - ymin = layout->y0; - xmax = layout->x0 + layout->dx*(layout->nx - 1) + w; - ymax = layout->y0 + layout->dy*(layout->ny - 1) + h; - - dx = layout->dx; - dy = layout->dy; - - nx = layout->nx; - ny = layout->ny; - - for (ix=0; ix < nx; ix++) { - - x1 = xmin + ix*dx; - x2 = x1 + w; - - y1 = MAX((ymin - TICK_OFFSET), 0.0); - y2 = MAX((y1 - TICK_LENGTH), 0.0); - - y3 = MIN((ymax + TICK_OFFSET), page_h); - y4 = MIN((y3 + TICK_LENGTH), page_h); - - cairo_move_to (pi->cr, x1, y1); - cairo_line_to (pi->cr, x1, y2); - cairo_stroke (pi->cr); - - cairo_move_to (pi->cr, x2, y1); - cairo_line_to (pi->cr, x2, y2); - cairo_stroke (pi->cr); - - cairo_move_to (pi->cr, x1, y3); - cairo_line_to (pi->cr, x1, y4); - cairo_stroke (pi->cr); - - cairo_move_to (pi->cr, x2, y3); - cairo_line_to (pi->cr, x2, y4); - cairo_stroke (pi->cr); - - } - - for (iy=0; iy < ny; iy++) { - - y1 = ymin + iy*dy; - y2 = y1 + h; - - x1 = MAX((xmin - TICK_OFFSET), 0.0); - x2 = MAX((x1 - TICK_LENGTH), 0.0); - - x3 = MIN((xmax + TICK_OFFSET), page_w); - x4 = MIN((x3 + TICK_LENGTH), page_w); - - cairo_move_to (pi->cr, x1, y1); - cairo_line_to (pi->cr, x2, y1); - cairo_stroke (pi->cr); - - cairo_move_to (pi->cr, x1, y2); - cairo_line_to (pi->cr, x2, y2); - cairo_stroke (pi->cr); - - cairo_move_to (pi->cr, x3, y1); - cairo_line_to (pi->cr, x4, y1); - cairo_stroke (pi->cr); - - cairo_move_to (pi->cr, x3, y2); - cairo_line_to (pi->cr, x4, y2); - cairo_stroke (pi->cr); - - } - - } - - cairo_restore (pi->cr); - - gl_debug (DEBUG_PRINT, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Print i'th label. */ -/*---------------------------------------------------------------------------*/ -static void -print_label (PrintInfo *pi, - glLabel *label, - gdouble x, - gdouble y, - glMergeRecord *record, - gboolean outline_flag, - gboolean reverse_flag) -{ - const lglTemplateFrame *frame; - gdouble width, height; - - gl_debug (DEBUG_PRINT, "START"); - - frame = (lglTemplateFrame *)pi->template->frames->data; - - gl_label_get_size (label, &width, &height); - - cairo_save (pi->cr); - - /* Transform coordinate system to be relative to upper corner */ - /* of the current label */ - cairo_translate (pi->cr, x, y); - - clip_to_outline (pi, label); - - cairo_save (pi->cr); - - /* Special transformations. */ - if (label->rotate_flag) { - gl_debug (DEBUG_PRINT, "Rotate flag set"); - cairo_rotate (pi->cr, -M_PI/2.0); - cairo_translate (pi->cr, -width, 0.0); - } - if ( reverse_flag ) { - cairo_translate (pi->cr, width, 0.0); - cairo_scale (pi->cr, -1.0, 1.0); - } - - gl_label_draw (label, pi->cr, FALSE, record); - - cairo_restore (pi->cr); /* From special transformations. */ - - if (outline_flag) { - draw_outline (pi, label); - } - - cairo_restore (pi->cr); /* From translation. */ - - gl_debug (DEBUG_PRINT, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw outline. */ -/*---------------------------------------------------------------------------*/ -static void -draw_outline (PrintInfo *pi, - glLabel *label) -{ - gl_debug (DEBUG_PRINT, "START"); - - cairo_save (pi->cr); - - cairo_set_source_rgb (pi->cr, OUTLINE_RGB_ARGS); - cairo_set_line_width (pi->cr, OUTLINE_WIDTH); - - gl_cairo_label_path (pi->cr, label->template, FALSE, FALSE); - - cairo_stroke (pi->cr); - - cairo_restore (pi->cr); - - gl_debug (DEBUG_PRINT, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Clip to outline. */ -/*---------------------------------------------------------------------------*/ -static void -clip_to_outline (PrintInfo *pi, - glLabel *label) -{ - gl_debug (DEBUG_PRINT, "START"); - - gl_cairo_label_path (pi->cr, label->template, FALSE, TRUE); - - cairo_set_fill_rule (pi->cr, CAIRO_FILL_RULE_EVEN_ODD); - cairo_clip (pi->cr); - - gl_debug (DEBUG_PRINT, "END"); -} - diff --git a/glabels2/src/print.h b/glabels2/src/print.h deleted file mode 100644 index b4f46a1f..00000000 --- a/glabels2/src/print.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * print.h: Print module header file - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __PRINT_H__ -#define __PRINT_H__ - -#include - -#include "label.h" - -G_BEGIN_DECLS - -typedef struct { - gint i_copy; - GList *p_record; -} glPrintState; - -void gl_print_simple_sheet (glLabel *label, - cairo_t *cr, - gint page, - gint n_sheets, - gint first, - gint last, - gboolean outline_flag, - gboolean reverse_flag, - gboolean crop_marks_flag); - -void gl_print_collated_merge_sheet (glLabel *label, - cairo_t *cr, - gint page, - gint n_copies, - gint first, - gboolean outline_flag, - gboolean reverse_flag, - gboolean crop_marks_flag, - glPrintState *state); - -void gl_print_uncollated_merge_sheet (glLabel *label, - cairo_t *cr, - gint page, - gint n_copies, - gint first, - gboolean outline_flag, - gboolean reverse_flag, - gboolean crop_marks_flag, - glPrintState *state); - -G_END_DECLS - -#endif diff --git a/glabels2/src/recent.c b/glabels2/src/recent.c deleted file mode 100644 index f713fcb4..00000000 --- a/glabels2/src/recent.c +++ /dev/null @@ -1,155 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * recent.c: gLabels recent files module - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "recent.h" - -#include -#include - -#include "prefs.h" -#include "debug.h" - -#define GLABELS_MIME_TYPE "application/x-glabels" - -static GtkRecentManager *model; - - - -/*****************************************************************************/ -/* Initialize recent files model. */ -/*****************************************************************************/ -void -gl_recent_init (void) -{ - gl_debug (DEBUG_RECENT, "START"); - - model = gtk_recent_manager_get_default (); - - gl_debug (DEBUG_RECENT, "END"); -} - - -/*****************************************************************************/ -/* Get UTF8 filename from GtkRecentInfo structure. */ -/*****************************************************************************/ -gchar * -gl_recent_get_utf8_filename (GtkRecentInfo *item) -{ - const gchar *uri; - gchar *filename; - gchar *utf8_filename = NULL; - - gl_debug (DEBUG_RECENT, "START"); - - uri = gtk_recent_info_get_uri (item); - - filename = g_filename_from_uri (uri, NULL, NULL); - if ( filename != NULL ) - { - utf8_filename = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL); - g_free (filename); - } - - return utf8_filename; - gl_debug (DEBUG_RECENT, "END"); -} - -/*****************************************************************************/ -/* Add file by UTF8 filename to recent model. */ -/*****************************************************************************/ -void -gl_recent_add_utf8_filename (gchar *utf8_filename) -{ - GtkRecentData *recent_data; - gchar *filename; - gchar *uri; - - static gchar *groups[2] = { - "glabels", - NULL - }; - - gl_debug (DEBUG_RECENT, "START"); - - recent_data = g_slice_new (GtkRecentData); - - recent_data->display_name = NULL; - recent_data->description = NULL; - recent_data->mime_type = GLABELS_MIME_TYPE; - recent_data->app_name = (gchar *) g_get_application_name (); - recent_data->app_exec = g_strjoin (" ", g_get_prgname (), "%f", NULL); - recent_data->groups = groups; - recent_data->is_private = FALSE; - - filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); - if ( filename != NULL ) - { - - uri = g_filename_to_uri (filename, NULL, NULL); - if ( uri != NULL ) - { - - gtk_recent_manager_add_full (model, uri, recent_data); - g_free (uri); - - } - g_free (filename); - - } - - g_free (recent_data->app_exec); - g_slice_free (GtkRecentData, recent_data); - - gl_debug (DEBUG_RECENT, "END"); -} - - -/*****************************************************************************/ -/* Create a menu of recent files. */ -/*****************************************************************************/ -GtkWidget * -gl_recent_create_menu (void) -{ - GtkWidget *recent_menu; - GtkRecentFilter *recent_filter; - - gl_debug (DEBUG_RECENT, "START"); - - recent_menu = - gtk_recent_chooser_menu_new_for_manager (model); - gtk_recent_chooser_menu_set_show_numbers (GTK_RECENT_CHOOSER_MENU (recent_menu), FALSE); - gtk_recent_chooser_set_show_icons (GTK_RECENT_CHOOSER (recent_menu), TRUE); - gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (recent_menu), gl_prefs->max_recents); - gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (recent_menu), GTK_RECENT_SORT_MRU); - gtk_recent_chooser_set_local_only (GTK_RECENT_CHOOSER (recent_menu), TRUE); - - recent_filter = gtk_recent_filter_new (); - gtk_recent_filter_add_mime_type (recent_filter, GLABELS_MIME_TYPE); - gtk_recent_chooser_set_filter (GTK_RECENT_CHOOSER (recent_menu), recent_filter); - - gl_debug (DEBUG_RECENT, "END"); - return recent_menu; -} diff --git a/glabels2/src/recent.h b/glabels2/src/recent.h deleted file mode 100644 index 9a1b36c4..00000000 --- a/glabels2/src/recent.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * recent.h: gLabels recent files module header file - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __RECENT_H__ -#define __RECENT_H__ - -#include -#include - -G_BEGIN_DECLS - -void gl_recent_init (void); - -gchar *gl_recent_get_utf8_filename (GtkRecentInfo *item); - -void gl_recent_add_utf8_filename (gchar *utf8_filename); - -GtkWidget *gl_recent_create_menu (void); - - -G_END_DECLS - -#endif /*__RECENT_H__*/ - diff --git a/glabels2/src/stock-pixmaps/Makefile.am b/glabels2/src/stock-pixmaps/Makefile.am deleted file mode 100644 index 5e34a955..00000000 --- a/glabels2/src/stock-pixmaps/Makefile.am +++ /dev/null @@ -1,95 +0,0 @@ - -IMAGES = \ - stock_arrow_24.png \ - stock_arrow_16.png \ - stock_barcode_24.png \ - stock_barcode_16.png \ - stock_box_24.png \ - stock_box_16.png \ - stock_ellipse_24.png \ - stock_ellipse_16.png \ - stock_image_24.png \ - stock_image_16.png \ - stock_line_24.png \ - stock_line_16.png \ - stock_merge_24.png \ - stock_merge_16.png \ - stock_properties_24.png \ - stock_properties_16.png \ - stock_text_24.png \ - stock_text_16.png \ - stock_order_top_16.png \ - stock_order_bottom_16.png \ - stock_rotate_left_16.png \ - stock_rotate_right_16.png \ - stock_flip_horiz_16.png \ - stock_flip_vert_16.png \ - stock_align_left_16.png \ - stock_align_right_16.png \ - stock_align_hcenter_16.png \ - stock_align_top_16.png \ - stock_align_bottom_16.png \ - stock_align_vcenter_16.png \ - stock_center_horiz_16.png \ - stock_center_vert_16.png \ - stock_bucket_fill_16.png \ - stock_bucket_fill_24.png \ - stock_pencil_16.png \ - stock_pencil_24.png \ - stock_hchain_24.png \ - stock_hchain_broken_24.png \ - stock_vchain_24.png \ - stock_vchain_broken_24.png - -VARIABLES1 = \ - stock_arrow_24 $(srcdir)/stock_arrow_24.png \ - stock_arrow_16 $(srcdir)/stock_arrow_16.png \ - stock_barcode_24 $(srcdir)/stock_barcode_24.png \ - stock_barcode_16 $(srcdir)/stock_barcode_16.png \ - stock_box_24 $(srcdir)/stock_box_24.png \ - stock_box_16 $(srcdir)/stock_box_16.png \ - stock_ellipse_24 $(srcdir)/stock_ellipse_24.png \ - stock_ellipse_16 $(srcdir)/stock_ellipse_16.png \ - stock_image_24 $(srcdir)/stock_image_24.png \ - stock_image_16 $(srcdir)/stock_image_16.png \ - stock_line_24 $(srcdir)/stock_line_24.png \ - stock_line_16 $(srcdir)/stock_line_16.png \ - stock_merge_24 $(srcdir)/stock_merge_24.png \ - stock_merge_16 $(srcdir)/stock_merge_16.png \ - stock_properties_24 $(srcdir)/stock_properties_24.png \ - stock_properties_16 $(srcdir)/stock_properties_16.png \ - stock_text_24 $(srcdir)/stock_text_24.png \ - stock_text_16 $(srcdir)/stock_text_16.png \ - stock_order_top_16 $(srcdir)/stock_order_top_16.png \ - stock_order_bottom_16 $(srcdir)/stock_order_bottom_16.png \ - stock_rotate_left_16 $(srcdir)/stock_rotate_left_16.png \ - stock_rotate_right_16 $(srcdir)/stock_rotate_right_16.png \ - stock_flip_horiz_16 $(srcdir)/stock_flip_horiz_16.png \ - stock_flip_vert_16 $(srcdir)/stock_flip_vert_16.png \ - stock_align_left_16 $(srcdir)/stock_align_left_16.png \ - stock_align_right_16 $(srcdir)/stock_align_right_16.png \ - stock_align_hcenter_16 $(srcdir)/stock_align_hcenter_16.png \ - stock_align_top_16 $(srcdir)/stock_align_top_16.png \ - stock_align_bottom_16 $(srcdir)/stock_align_bottom_16.png \ - stock_align_vcenter_16 $(srcdir)/stock_align_vcenter_16.png \ - stock_center_horiz_16 $(srcdir)/stock_center_horiz_16.png \ - stock_center_vert_16 $(srcdir)/stock_center_vert_16.png \ - stock_bucket_fill_16 $(srcdir)/stock_bucket_fill_16.png \ - stock_bucket_fill_24 $(srcdir)/stock_bucket_fill_24.png \ - stock_pencil_16 $(srcdir)/stock_pencil_16.png \ - stock_pencil_24 $(srcdir)/stock_pencil_24.png \ - stock_hchain_24 $(srcdir)/stock_hchain_24.png \ - stock_hchain_broken_24 $(srcdir)/stock_hchain_broken_24.png \ - stock_vchain_24 $(srcdir)/stock_vchain_24.png \ - stock_vchain_broken_24 $(srcdir)/stock_vchain_broken_24.png - - -noinst_DATA = stockpixbufs.h -CLEANFILES = $(noinst_DATA) - -stockpixbufs.h: $(IMAGES) - gdk-pixbuf-csource \ - --raw --build-list $(VARIABLES1) > $(srcdir)/stockpixbufs.h || \ - ( rm -f $(srcdir)/stockpixbufs.h && false ) - -EXTRA_DIST = $(IMAGES) stockpixbufs.h diff --git a/glabels2/src/stock-pixmaps/stock_align_bottom_16.png b/glabels2/src/stock-pixmaps/stock_align_bottom_16.png deleted file mode 100644 index da901bc4..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_align_bottom_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_align_hcenter_16.png b/glabels2/src/stock-pixmaps/stock_align_hcenter_16.png deleted file mode 100644 index 684c1259..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_align_hcenter_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_align_left_16.png b/glabels2/src/stock-pixmaps/stock_align_left_16.png deleted file mode 100644 index 1cdcf9bc..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_align_left_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_align_right_16.png b/glabels2/src/stock-pixmaps/stock_align_right_16.png deleted file mode 100644 index 2b4872b0..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_align_right_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_align_top_16.png b/glabels2/src/stock-pixmaps/stock_align_top_16.png deleted file mode 100644 index 5bda931c..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_align_top_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_align_vcenter_16.png b/glabels2/src/stock-pixmaps/stock_align_vcenter_16.png deleted file mode 100644 index a51293f0..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_align_vcenter_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_arrow_16.png b/glabels2/src/stock-pixmaps/stock_arrow_16.png deleted file mode 100644 index 0ae5f368..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_arrow_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_arrow_24.png b/glabels2/src/stock-pixmaps/stock_arrow_24.png deleted file mode 100644 index 6e0e26af..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_arrow_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_barcode_16.png b/glabels2/src/stock-pixmaps/stock_barcode_16.png deleted file mode 100644 index 6e0e2890..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_barcode_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_barcode_24.png b/glabels2/src/stock-pixmaps/stock_barcode_24.png deleted file mode 100644 index 9699c8dd..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_barcode_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_box_16.png b/glabels2/src/stock-pixmaps/stock_box_16.png deleted file mode 100644 index c141c9d5..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_box_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_box_24.png b/glabels2/src/stock-pixmaps/stock_box_24.png deleted file mode 100644 index 9f8e06f8..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_box_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_bucket_fill_16.png b/glabels2/src/stock-pixmaps/stock_bucket_fill_16.png deleted file mode 100644 index 2be70def..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_bucket_fill_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_bucket_fill_24.png b/glabels2/src/stock-pixmaps/stock_bucket_fill_24.png deleted file mode 100644 index 1ee5993e..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_bucket_fill_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_center_horiz_16.png b/glabels2/src/stock-pixmaps/stock_center_horiz_16.png deleted file mode 100644 index fce3e909..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_center_horiz_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_center_vert_16.png b/glabels2/src/stock-pixmaps/stock_center_vert_16.png deleted file mode 100644 index 08b19af0..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_center_vert_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_ellipse_16.png b/glabels2/src/stock-pixmaps/stock_ellipse_16.png deleted file mode 100644 index 9652562e..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_ellipse_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_ellipse_24.png b/glabels2/src/stock-pixmaps/stock_ellipse_24.png deleted file mode 100644 index 12f0468f..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_ellipse_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_flip_horiz_16.png b/glabels2/src/stock-pixmaps/stock_flip_horiz_16.png deleted file mode 100644 index e4770685..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_flip_horiz_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_flip_vert_16.png b/glabels2/src/stock-pixmaps/stock_flip_vert_16.png deleted file mode 100644 index 93027c93..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_flip_vert_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_hchain_24.png b/glabels2/src/stock-pixmaps/stock_hchain_24.png deleted file mode 100644 index 5bc2eedc..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_hchain_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_hchain_broken_24.png b/glabels2/src/stock-pixmaps/stock_hchain_broken_24.png deleted file mode 100644 index 2e961a3e..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_hchain_broken_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_image_16.png b/glabels2/src/stock-pixmaps/stock_image_16.png deleted file mode 100644 index ee9ed3d2..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_image_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_image_24.png b/glabels2/src/stock-pixmaps/stock_image_24.png deleted file mode 100644 index 093c8ad9..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_image_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_line_16.png b/glabels2/src/stock-pixmaps/stock_line_16.png deleted file mode 100644 index cf0e0406..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_line_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_line_24.png b/glabels2/src/stock-pixmaps/stock_line_24.png deleted file mode 100644 index 7bb65234..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_line_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_merge_16.png b/glabels2/src/stock-pixmaps/stock_merge_16.png deleted file mode 100644 index 2a3bfe8b..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_merge_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_merge_24.png b/glabels2/src/stock-pixmaps/stock_merge_24.png deleted file mode 100644 index af612006..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_merge_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_order_bottom_16.png b/glabels2/src/stock-pixmaps/stock_order_bottom_16.png deleted file mode 100644 index f6ed2d00..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_order_bottom_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_order_top_16.png b/glabels2/src/stock-pixmaps/stock_order_top_16.png deleted file mode 100644 index 0884bc1e..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_order_top_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_pencil_16.png b/glabels2/src/stock-pixmaps/stock_pencil_16.png deleted file mode 100644 index 83a14936..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_pencil_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_pencil_24.png b/glabels2/src/stock-pixmaps/stock_pencil_24.png deleted file mode 100644 index a36ce930..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_pencil_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_properties_16.png b/glabels2/src/stock-pixmaps/stock_properties_16.png deleted file mode 100644 index ab42b19c..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_properties_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_properties_24.png b/glabels2/src/stock-pixmaps/stock_properties_24.png deleted file mode 100644 index f5926060..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_properties_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_rotate_left_16.png b/glabels2/src/stock-pixmaps/stock_rotate_left_16.png deleted file mode 100644 index 157884e5..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_rotate_left_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_rotate_right_16.png b/glabels2/src/stock-pixmaps/stock_rotate_right_16.png deleted file mode 100644 index cc5dc49a..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_rotate_right_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_text_16.png b/glabels2/src/stock-pixmaps/stock_text_16.png deleted file mode 100644 index c539bf1e..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_text_16.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_text_24.png b/glabels2/src/stock-pixmaps/stock_text_24.png deleted file mode 100644 index b9e5511a..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_text_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_vchain_24.png b/glabels2/src/stock-pixmaps/stock_vchain_24.png deleted file mode 100644 index 7dc2031f..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_vchain_24.png and /dev/null differ diff --git a/glabels2/src/stock-pixmaps/stock_vchain_broken_24.png b/glabels2/src/stock-pixmaps/stock_vchain_broken_24.png deleted file mode 100644 index 8ef1363c..00000000 Binary files a/glabels2/src/stock-pixmaps/stock_vchain_broken_24.png and /dev/null differ diff --git a/glabels2/src/stock.c b/glabels2/src/stock.c deleted file mode 100644 index 72f1c25c..00000000 --- a/glabels2/src/stock.c +++ /dev/null @@ -1,221 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * stock.h: Stock image module header file - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "stock.h" - -#include -#include -#include -#include - -#include "stock-pixmaps/stockpixbufs.h" - - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void add_icons (GtkIconFactory *factory, - const gchar *stock_id, - const guchar *inline_24, - const guchar *inline_16); - -static void add_button_icon (GtkIconFactory *factory, - const gchar *stock_id, - const guchar *inline_24); - - -/****************************************************************************/ -/* Initialize our stock icons. */ -/****************************************************************************/ -void -gl_stock_init (void) -{ - GtkIconFactory *factory; - - static GtkStockItem items[] = { - { GL_STOCK_ARROW, N_("_Select Mode"), 0, 0, NULL }, - { GL_STOCK_TEXT, N_("_Text"), 0, 0, NULL }, - { GL_STOCK_LINE, N_("_Line"), 0, 0, NULL }, - { GL_STOCK_BOX, N_("_Box"), 0, 0, NULL }, - { GL_STOCK_ELLIPSE, N_("_Ellipse"), 0, 0, NULL }, - { GL_STOCK_IMAGE, N_("_Image"), 0, 0, NULL }, - { GL_STOCK_BARCODE, N_("Bar_code"), 0, 0, NULL }, - { GL_STOCK_MERGE, N_("_Merge Properties"), 0, 0, NULL }, - { GL_STOCK_PROPERTIES, N_("Object _Properties"), 0, 0, NULL }, - { GL_STOCK_ORDER_TOP, N_("Bring to _Front"), 0, 0, NULL }, - { GL_STOCK_ORDER_BOTTOM, N_("Send to _Back"), 0, 0, NULL }, - { GL_STOCK_ROTATE_LEFT, N_("Rotate _Left"), 0, 0, NULL }, - { GL_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), 0, 0, NULL }, - { GL_STOCK_FLIP_HORIZ, N_("Flip _Horizontally"), 0, 0, NULL }, - { GL_STOCK_FLIP_VERT, N_("Flip _Vertically"), 0, 0, NULL }, - { GL_STOCK_ALIGN_LEFT, N_("_Lefts"), 0, 0, NULL }, - { GL_STOCK_ALIGN_RIGHT, N_("_Rights"), 0, 0, NULL }, - { GL_STOCK_ALIGN_HCENTER, N_("_Centers"), 0, 0, NULL }, - { GL_STOCK_ALIGN_TOP, N_("_Tops"), 0, 0, NULL }, - { GL_STOCK_ALIGN_BOTTOM, N_("Bottoms"), 0, 0, NULL }, - { GL_STOCK_ALIGN_VCENTER, N_("Centers"), 0, 0, NULL }, - { GL_STOCK_CENTER_HORIZ, N_("Label Ce_nter"), 0, 0, NULL }, - { GL_STOCK_CENTER_VERT, N_("Label Ce_nter"), 0, 0, NULL }, - { GL_STOCK_BUCKET_FILL, N_("Fill color"), 0, 0, NULL }, - { GL_STOCK_PENCIL, N_("Line color"), 0, 0, NULL }, - { GL_STOCK_HCHAIN, N_("Linked"), 0, 0, NULL }, - { GL_STOCK_HCHAIN_BROKEN, N_("Not Linked"), 0, 0, NULL }, - { GL_STOCK_VCHAIN, N_("Linked"), 0, 0, NULL }, - { GL_STOCK_VCHAIN_BROKEN, N_("Not Linked"), 0, 0, NULL }, - }; - - gtk_stock_add (items, G_N_ELEMENTS (items)); - - factory = gtk_icon_factory_new (); - gtk_icon_factory_add_default (factory); - - add_icons (factory, GL_STOCK_ARROW, stock_arrow_24, stock_arrow_16); - add_icons (factory, GL_STOCK_TEXT, stock_text_24, stock_text_16); - add_icons (factory, GL_STOCK_LINE, stock_line_24, stock_line_16); - add_icons (factory, GL_STOCK_BOX, stock_box_24, stock_box_16); - add_icons (factory, GL_STOCK_ELLIPSE, stock_ellipse_24, stock_ellipse_16); - add_icons (factory, GL_STOCK_IMAGE, stock_image_24, stock_image_16); - add_icons (factory, GL_STOCK_BARCODE, stock_barcode_24, stock_barcode_16); - add_icons (factory, GL_STOCK_MERGE, stock_merge_24, stock_merge_16); - - add_icons (factory, GL_STOCK_PROPERTIES, - stock_properties_24, - stock_properties_16); - - add_icons (factory, GL_STOCK_ORDER_TOP, NULL, stock_order_top_16); - add_icons (factory, GL_STOCK_ORDER_BOTTOM, NULL, stock_order_bottom_16); - add_icons (factory, GL_STOCK_ROTATE_LEFT, NULL, stock_rotate_left_16); - add_icons (factory, GL_STOCK_ROTATE_RIGHT, NULL, stock_rotate_right_16); - add_icons (factory, GL_STOCK_FLIP_HORIZ, NULL, stock_flip_horiz_16); - add_icons (factory, GL_STOCK_FLIP_VERT, NULL, stock_flip_vert_16); - add_icons (factory, GL_STOCK_ALIGN_LEFT, NULL, stock_align_left_16); - add_icons (factory, GL_STOCK_ALIGN_RIGHT, NULL, stock_align_right_16); - add_icons (factory, GL_STOCK_ALIGN_HCENTER, NULL, stock_align_hcenter_16); - add_icons (factory, GL_STOCK_ALIGN_TOP, NULL, stock_align_top_16); - add_icons (factory, GL_STOCK_ALIGN_BOTTOM, NULL, stock_align_bottom_16); - add_icons (factory, GL_STOCK_ALIGN_VCENTER, NULL, stock_align_vcenter_16); - add_icons (factory, GL_STOCK_CENTER_HORIZ, NULL, stock_center_horiz_16); - add_icons (factory, GL_STOCK_CENTER_VERT, NULL, stock_center_vert_16); - - add_icons (factory, GL_STOCK_BUCKET_FILL, stock_bucket_fill_24, stock_bucket_fill_16); - add_icons (factory, GL_STOCK_PENCIL, stock_pencil_24, stock_pencil_16); - - add_button_icon (factory, GL_STOCK_HCHAIN, stock_hchain_24); - add_button_icon (factory, GL_STOCK_HCHAIN_BROKEN, stock_hchain_broken_24); - add_button_icon (factory, GL_STOCK_VCHAIN, stock_vchain_24); - add_button_icon (factory, GL_STOCK_VCHAIN_BROKEN, stock_vchain_broken_24); - - g_object_unref (G_OBJECT(factory)); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Unpack and associate given icons with stock_id. */ -/*--------------------------------------------------------------------------*/ -static void -add_icons (GtkIconFactory *factory, - const gchar *stock_id, - const guchar *inline_24, - const guchar *inline_16) -{ - GdkPixbuf *pixbuf; - GtkIconSet *icon_set; - GtkIconSource *icon_source; - - if ( inline_24 != NULL ) { - /* Create icon set with default image */ - pixbuf = gdk_pixbuf_new_from_inline (-1, inline_24, FALSE, NULL); - icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); - g_object_unref (G_OBJECT(pixbuf)); - } else { - /* Create an empty icon set */ - icon_set = gtk_icon_set_new (); - } - - if ( inline_16 != NULL ) { - /* Add 16x16 icon for menus to icon set */ - icon_source = gtk_icon_source_new (); - pixbuf = gdk_pixbuf_new_from_inline (-1, inline_16, - FALSE, NULL); - gtk_icon_source_set_pixbuf (icon_source, pixbuf); - g_object_unref (G_OBJECT(pixbuf)); - gtk_icon_source_set_size_wildcarded (icon_source, FALSE); - gtk_icon_source_set_size (icon_source, GTK_ICON_SIZE_MENU); - gtk_icon_set_add_source (icon_set, icon_source); - g_free (icon_source); - } - - /* Now associate icon set with stock id */ - gtk_icon_factory_add (factory, stock_id, icon_set); - gtk_icon_set_unref (icon_set); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Unpack and associate given button icon with stock_id. */ -/*--------------------------------------------------------------------------*/ -static void -add_button_icon (GtkIconFactory *factory, - const gchar *stock_id, - const guchar *inline_24) -{ - GtkIconSet *icon_set; - GdkPixbuf *pixbuf; - GtkIconSource *icon_source; - - icon_set = gtk_icon_set_new (); - - icon_source = gtk_icon_source_new (); - pixbuf = gdk_pixbuf_new_from_inline (-1, inline_24, FALSE, NULL); - gtk_icon_source_set_pixbuf (icon_source, pixbuf); - g_object_unref (G_OBJECT(pixbuf)); - gtk_icon_source_set_size_wildcarded (icon_source, FALSE); - gtk_icon_source_set_size (icon_source, GTK_ICON_SIZE_BUTTON); - gtk_icon_set_add_source (icon_set, icon_source); - g_free (icon_source); - - /* Now associate icon set with stock id */ - gtk_icon_factory_add (factory, stock_id, icon_set); - gtk_icon_set_unref (icon_set); -} - - - - - - - diff --git a/glabels2/src/stock.h b/glabels2/src/stock.h deleted file mode 100644 index 14fb907a..00000000 --- a/glabels2/src/stock.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * stock.h: Stock image module header file - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __STOCK_H__ -#define __STOCK_H__ - -#include - -G_BEGIN_DECLS - -/* Stock names */ - -#define GL_STOCK_ARROW "gl_stock_arrow" -#define GL_STOCK_TEXT "gl_stock_text" -#define GL_STOCK_LINE "gl_stock_line" -#define GL_STOCK_BOX "gl_stock_box" -#define GL_STOCK_ELLIPSE "gl_stock_ellipse" -#define GL_STOCK_IMAGE "gl_stock_image" -#define GL_STOCK_BARCODE "gl_stock_barcode" -#define GL_STOCK_MERGE "gl_stock_merge" -#define GL_STOCK_PROPERTIES "gl_stock_properties" -#define GL_STOCK_ORDER_TOP "gl_stock_order_top" -#define GL_STOCK_ORDER_BOTTOM "gl_stock_order_bottom" -#define GL_STOCK_ROTATE_LEFT "gl_stock_rotate_left" -#define GL_STOCK_ROTATE_RIGHT "gl_stock_rotate_right" -#define GL_STOCK_FLIP_HORIZ "gl_stock_flip_horiz" -#define GL_STOCK_FLIP_VERT "gl_stock_flip_vert" -#define GL_STOCK_ALIGN_LEFT "gl_stock_align_left" -#define GL_STOCK_ALIGN_RIGHT "gl_stock_align_right" -#define GL_STOCK_ALIGN_HCENTER "gl_stock_align_hcenter" -#define GL_STOCK_ALIGN_TOP "gl_stock_align_top" -#define GL_STOCK_ALIGN_BOTTOM "gl_stock_align_bottom" -#define GL_STOCK_ALIGN_VCENTER "gl_stock_align_vcenter" -#define GL_STOCK_CENTER_HORIZ "gl_stock_center_horiz" -#define GL_STOCK_CENTER_VERT "gl_stock_center_vert" -#define GL_STOCK_BUCKET_FILL "gl_stock_bucket_fill" -#define GL_STOCK_PENCIL "gl_stock_pencil" -#define GL_STOCK_HCHAIN "gl_stock_hchain" -#define GL_STOCK_HCHAIN_BROKEN "gl_stock_hchain_broken" -#define GL_STOCK_VCHAIN "gl_stock_vchain" -#define GL_STOCK_VCHAIN_BROKEN "gl_stock_vchain_broken" - -void gl_stock_init (void); - -G_END_DECLS - -#endif diff --git a/glabels2/src/template-designer.c b/glabels2/src/template-designer.c deleted file mode 100644 index 60ffe576..00000000 --- a/glabels2/src/template-designer.c +++ /dev/null @@ -1,1758 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * template-designer.c: Template designer module - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "template-designer.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "prefs.h" -#include -#include "wdgt-mini-preview.h" -#include "mini-preview-pixbuf-cache.h" -#include "print-op.h" -#include "util.h" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ -#define ICON_PIXMAP (GLABELS_ICON_DIR "glabels.png") - -#define EX_RECT_IMAGE (GLABELS_PIXMAP_DIR "ex-rect-size.png") -#define EX_ROUND_IMAGE (GLABELS_PIXMAP_DIR "ex-round-size.png") -#define EX_CD_IMAGE (GLABELS_PIXMAP_DIR "ex-cd-size.png") -#define EX_NLAYOUTS_IMAGE1 (GLABELS_PIXMAP_DIR "ex-1layout.png") -#define EX_NLAYOUTS_IMAGE2 (GLABELS_PIXMAP_DIR "ex-2layouts.png") - -#define DEFAULT_MARGIN 9.0 - -#define DEFAULT_RECT_W 252.0 -#define DEFAULT_RECT_H 144.0 -#define DEFAULT_RECT_R 0.0 -#define DEFAULT_RECT_WASTE 0.0 /* Should never exceed 1/2 the distance between items. */ - -#define DEFAULT_ROUND_R 72.0 -#define DEFAULT_ROUND_WASTE 0.0 /* Should never exceed 1/2 the distance between items. */ - -#define DEFAULT_CD_RADIUS 166.5 -#define DEFAULT_CD_HOLE 58.5 -#define DEFAULT_CD_WASTE 9.0 /* Should never exceed 1/2 the distance between items. */ - -#define DELTA 0.01 -#define MAX_PAGE_DIM_POINTS 5000.0 - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glTemplateDesignerPrivate -{ - /* Assistant pages */ - GtkWidget *start_page; - GtkWidget *name_page; - GtkWidget *pg_size_page; - GtkWidget *shape_page; - GtkWidget *rect_size_page; - GtkWidget *round_size_page; - GtkWidget *cd_size_page; - GtkWidget *nlayouts_page; - GtkWidget *layout_page; - GtkWidget *finish_page; - - /* Name page controls */ - GtkWidget *brand_entry; - GtkWidget *part_num_entry; - GtkWidget *name_warning_image; - GtkWidget *name_warning_label; - GtkWidget *description_entry; - - /* Page size page controls */ - GtkWidget *pg_size_combo; - GtkWidget *pg_w_spin; - GtkWidget *pg_h_spin; - GtkWidget *pg_w_units_label; - GtkWidget *pg_h_units_label; - - /* Shape page controls */ - GtkWidget *shape_rect_radio; - GtkWidget *shape_round_radio; - GtkWidget *shape_cd_radio; - - /* Label size (rectangular) page controls */ - GtkWidget *rect_image; - GtkWidget *rect_w_spin; - GtkWidget *rect_h_spin; - GtkWidget *rect_r_spin; - GtkWidget *rect_x_waste_spin; - GtkWidget *rect_y_waste_spin; - GtkWidget *rect_margin_spin; - GtkWidget *rect_w_units_label; - GtkWidget *rect_h_units_label; - GtkWidget *rect_r_units_label; - GtkWidget *rect_x_waste_units_label; - GtkWidget *rect_y_waste_units_label; - GtkWidget *rect_margin_units_label; - - /* Label size (round) page controls */ - GtkWidget *round_image; - GtkWidget *round_r_spin; - GtkWidget *round_waste_spin; - GtkWidget *round_margin_spin; - GtkWidget *round_r_units_label; - GtkWidget *round_waste_units_label; - GtkWidget *round_margin_units_label; - - /* Label size (cd) page controls */ - GtkWidget *cd_image; - GtkWidget *cd_radius_spin; - GtkWidget *cd_hole_spin; - GtkWidget *cd_w_spin; - GtkWidget *cd_h_spin; - GtkWidget *cd_waste_spin; - GtkWidget *cd_margin_spin; - GtkWidget *cd_radius_units_label; - GtkWidget *cd_hole_units_label; - GtkWidget *cd_w_units_label; - GtkWidget *cd_h_units_label; - GtkWidget *cd_waste_units_label; - GtkWidget *cd_margin_units_label; - - /* Number of layouts controls */ - GtkWidget *nlayouts_image1; - GtkWidget *nlayouts_image2; - GtkWidget *nlayouts_spin; - - /* Layout page controls */ - GtkWidget *layout1_head_label; - GtkWidget *layout1_nx_spin; - GtkWidget *layout1_ny_spin; - GtkWidget *layout1_x0_spin; - GtkWidget *layout1_y0_spin; - GtkWidget *layout1_dx_spin; - GtkWidget *layout1_dy_spin; - GtkWidget *layout2_head_label; - GtkWidget *layout2_nx_spin; - GtkWidget *layout2_ny_spin; - GtkWidget *layout2_x0_spin; - GtkWidget *layout2_y0_spin; - GtkWidget *layout2_dx_spin; - GtkWidget *layout2_dy_spin; - GtkWidget *layout_x0_units_label; - GtkWidget *layout_y0_units_label; - GtkWidget *layout_dx_units_label; - GtkWidget *layout_dy_units_label; - GtkWidget *layout_mini_preview; - GtkWidget *layout_test_button; - - /* Units related stuff */ - const gchar *units_string; - gdouble units_per_point; - gdouble climb_rate; - gint digits; - - /* Prevent recursion */ - gboolean stop_signals; -}; - -/* Page numbers for traversing GtkAssistant */ -enum { - START_PAGE_NUM = 0, - NAME_PAGE_NUM, - PG_SIZE_PAGE_NUM, - SHAPE_PAGE_NUM, - RECT_SIZE_PAGE_NUM, - ROUND_SIZE_PAGE_NUM, - CD_SIZE_PAGE_NUM, - NLAYOUTS_PAGE_NUM, - LAYOUT_PAGE_NUM, - FINISH_PAGE_NUM -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_template_designer_finalize (GObject *object); -static void gl_template_designer_construct (glTemplateDesigner *dialog); - -static void construct_start_page (glTemplateDesigner *dialog, - GdkPixbuf *logo); - -static void construct_name_page (glTemplateDesigner *dialog, - GdkPixbuf *logo); - -static void construct_pg_size_page (glTemplateDesigner *dialog, - GdkPixbuf *logo); - -static void construct_shape_page (glTemplateDesigner *dialog, - GdkPixbuf *logo); - -static void construct_rect_size_page (glTemplateDesigner *dialog, - GdkPixbuf *logo); - -static void construct_round_size_page (glTemplateDesigner *dialog, - GdkPixbuf *logo); - -static void construct_cd_size_page (glTemplateDesigner *dialog, - GdkPixbuf *logo); - -static void construct_nlayouts_page (glTemplateDesigner *dialog, - GdkPixbuf *logo); - -static void construct_layout_page (glTemplateDesigner *dialog, - GdkPixbuf *logo); - -static void construct_finish_page (glTemplateDesigner *dialog, - GdkPixbuf *logo); - -static void cancel_cb (glTemplateDesigner *dialog); -static void apply_cb (glTemplateDesigner *dialog); -static void close_cb (glTemplateDesigner *dialog); -static void prepare_cb (glTemplateDesigner *dialog, - GtkWidget *page); - -static gint forward_page_function (gint current_page, - gpointer data); - -static void name_page_changed_cb (glTemplateDesigner *dialog); - -static void pg_size_page_changed_cb (glTemplateDesigner *dialog); - -static void rect_size_page_prepare_cb (glTemplateDesigner *dialog); - -static void round_size_page_prepare_cb (glTemplateDesigner *dialog); - -static void cd_size_page_prepare_cb (glTemplateDesigner *dialog); - -static void layout_page_prepare_cb (glTemplateDesigner *dialog); - -static void layout_page_changed_cb (glTemplateDesigner *dialog); - -static void print_test_cb (glTemplateDesigner *dialog); - -static lglTemplate *build_template (glTemplateDesigner *dialog); - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glTemplateDesigner, gl_template_designer, GTK_TYPE_ASSISTANT); - -static void -gl_template_designer_class_init (glTemplateDesignerClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_TEMPLATE, ""); - - gl_template_designer_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_template_designer_finalize; -} - -static void -gl_template_designer_init (glTemplateDesigner *dialog) -{ - gl_debug (DEBUG_TEMPLATE, "START"); - - dialog->priv = g_new0 (glTemplateDesignerPrivate, 1); - - gl_debug (DEBUG_TEMPLATE, "END"); - - return; -} - -static void -gl_template_designer_finalize (GObject *object) -{ - glTemplateDesigner* dialog = GL_TEMPLATE_DESIGNER (object); - - gl_debug (DEBUG_TEMPLATE, "START"); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_TEMPLATE_DESIGNER (dialog)); - g_return_if_fail (dialog->priv != NULL); - - g_free (dialog->priv); - - G_OBJECT_CLASS (gl_template_designer_parent_class)->finalize (object); - - gl_debug (DEBUG_TEMPLATE, "END"); -} - -/*****************************************************************************/ -/* NEW preferences dialog. */ -/*****************************************************************************/ -GtkWidget* -gl_template_designer_new (GtkWindow *parent) -{ - GtkWidget *dialog; - - gl_debug (DEBUG_TEMPLATE, "START"); - - dialog = GTK_WIDGET (g_object_new (GL_TYPE_TEMPLATE_DESIGNER, NULL)); - - if (parent) - gtk_window_set_transient_for (GTK_WINDOW (dialog), parent); - - gl_template_designer_construct (GL_TEMPLATE_DESIGNER(dialog)); - - - gl_debug (DEBUG_TEMPLATE, "END"); - - return dialog; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Construct composite widget. */ -/*---------------------------------------------------------------------------*/ -static void -gl_template_designer_construct (glTemplateDesigner *dialog) -{ - GdkPixbuf *logo; - - g_return_if_fail (dialog && GL_IS_TEMPLATE_DESIGNER (dialog)); - g_return_if_fail (dialog->priv != NULL); - - /* Initialize units stuff from prefs */ - dialog->priv->units_string = gl_prefs_get_units_string (); - dialog->priv->units_per_point = gl_prefs_get_units_per_point (); - dialog->priv->climb_rate = gl_prefs_get_units_step_size (); - dialog->priv->digits = gl_prefs_get_units_precision (); - - gtk_window_set_title (GTK_WINDOW(dialog), _("gLabels Template Designer")); - - logo = gdk_pixbuf_new_from_file (ICON_PIXMAP, NULL); - - /* Costruct and append pages (must be same order as PAGE_NUM enums. */ - construct_start_page (dialog, logo); - construct_name_page (dialog, logo); - construct_pg_size_page (dialog, logo); - construct_shape_page (dialog, logo); - construct_rect_size_page (dialog, logo); - construct_round_size_page (dialog, logo); - construct_cd_size_page (dialog, logo); - construct_nlayouts_page (dialog, logo); - construct_layout_page (dialog, logo); - construct_finish_page (dialog, logo); - - gtk_assistant_set_forward_page_func (GTK_ASSISTANT (dialog), - forward_page_function, - dialog, - NULL); - - /* signals */ - g_signal_connect_swapped (G_OBJECT(dialog), "cancel", - G_CALLBACK(cancel_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog), "apply", - G_CALLBACK(apply_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog), "close", - G_CALLBACK(close_cb), dialog); - g_signal_connect (G_OBJECT(dialog), "prepare", - G_CALLBACK(prepare_cb), NULL); - - gtk_widget_show_all (GTK_WIDGET(dialog)); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct start page. */ -/*--------------------------------------------------------------------------*/ -static void -construct_start_page (glTemplateDesigner *dialog, - GdkPixbuf *logo) -{ - GladeXML *gui; - - gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", - "start_page", NULL); - if (!gui) - { - g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); - return; - } - - dialog->priv->start_page = glade_xml_get_widget (gui, "start_page"); - - g_object_unref (gui); - - - gtk_assistant_append_page (GTK_ASSISTANT (dialog), - dialog->priv->start_page); - - gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), - dialog->priv->start_page, - _("Welcome")); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), - dialog->priv->start_page, - logo); - gtk_assistant_set_page_type (GTK_ASSISTANT (dialog), - dialog->priv->start_page, - GTK_ASSISTANT_PAGE_INTRO); - gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), - dialog->priv->start_page, - TRUE); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct name page. */ -/*--------------------------------------------------------------------------*/ -static void -construct_name_page (glTemplateDesigner *dialog, - GdkPixbuf *logo) -{ - GladeXML *gui; - - gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", - "name_page", NULL); - if (!gui) - { - g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); - return; - } - - dialog->priv->name_page = glade_xml_get_widget (gui, "name_page"); - dialog->priv->brand_entry = glade_xml_get_widget (gui, "brand_entry"); - dialog->priv->part_num_entry = glade_xml_get_widget (gui, "part_num_entry"); - dialog->priv->name_warning_image = glade_xml_get_widget (gui, "name_warning_image"); - dialog->priv->name_warning_label = glade_xml_get_widget (gui, "name_warning_label"); - dialog->priv->description_entry = glade_xml_get_widget (gui, "description_entry"); - - g_object_unref (gui); - - - gtk_assistant_append_page (GTK_ASSISTANT (dialog), - dialog->priv->name_page); - - gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), - dialog->priv->name_page, - _("Name and Description")); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), - dialog->priv->name_page, - logo); - - /* Connect a handler that listens for changes in these widgets */ - /* This controls whether we can progress to the next page. */ - g_signal_connect_swapped (G_OBJECT(dialog->priv->brand_entry), "changed", - G_CALLBACK(name_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->part_num_entry), "changed", - G_CALLBACK(name_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->description_entry), "changed", - G_CALLBACK(name_page_changed_cb), dialog); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct page size page. */ -/*--------------------------------------------------------------------------*/ -static void -construct_pg_size_page (glTemplateDesigner *dialog, - GdkPixbuf *logo) -{ - GladeXML *gui; - GList *page_sizes; - const gchar *default_page_size_id; - gchar *default_page_size_name; - - gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", - "pg_size_page", NULL); - if (!gui) - { - g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); - return; - } - - dialog->priv->pg_size_page = glade_xml_get_widget (gui, "pg_size_page"); - dialog->priv->pg_size_combo = glade_xml_get_widget (gui, "pg_size_combo"); - dialog->priv->pg_w_spin = glade_xml_get_widget (gui, "pg_w_spin"); - dialog->priv->pg_h_spin = glade_xml_get_widget (gui, "pg_h_spin"); - dialog->priv->pg_w_units_label = glade_xml_get_widget (gui, "pg_w_units_label"); - dialog->priv->pg_h_units_label = glade_xml_get_widget (gui, "pg_h_units_label"); - - g_object_unref (gui); - - - gl_util_combo_box_add_text_model (GTK_COMBO_BOX (dialog->priv->pg_size_combo)); - - gtk_assistant_append_page (GTK_ASSISTANT (dialog), - dialog->priv->pg_size_page); - - gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), - dialog->priv->pg_size_page, - _("Page Size")); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), - dialog->priv->pg_size_page, - logo); - gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), - dialog->priv->pg_size_page, - TRUE); - - /* Load page size combo */ - page_sizes = lgl_db_get_paper_name_list (); - gl_util_combo_box_set_strings (GTK_COMBO_BOX (dialog->priv->pg_size_combo), page_sizes); - lgl_db_free_paper_name_list (page_sizes); - default_page_size_id = gl_prefs_get_page_size (); - default_page_size_name = lgl_db_lookup_paper_name_from_id (default_page_size_id); - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (dialog->priv->pg_size_combo), default_page_size_name); - g_free (default_page_size_name); - - /* Apply units to spinbuttons and units labels. */ - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->pg_w_units_label), - dialog->priv->units_string); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->pg_w_spin), - 0.0, MAX_PAGE_DIM_POINTS*dialog->priv->units_per_point); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->pg_h_units_label), - dialog->priv->units_string); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->pg_h_spin), - 0.0, MAX_PAGE_DIM_POINTS*dialog->priv->units_per_point); - - /* Connect a handler that listens for changes in these widgets */ - /* This controls sensitivity of related widgets. */ - g_signal_connect_swapped (G_OBJECT(dialog->priv->pg_size_combo), "changed", - G_CALLBACK(pg_size_page_changed_cb), dialog); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct shape page. */ -/*--------------------------------------------------------------------------*/ -static void -construct_shape_page (glTemplateDesigner *dialog, - GdkPixbuf *logo) -{ - GladeXML *gui; - - gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", - "shape_page", NULL); - if (!gui) - { - g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); - return; - } - - dialog->priv->shape_page = glade_xml_get_widget (gui, "shape_page"); - dialog->priv->shape_rect_radio = glade_xml_get_widget (gui, "shape_rect_radio"); - dialog->priv->shape_round_radio = glade_xml_get_widget (gui, "shape_round_radio"); - dialog->priv->shape_cd_radio = glade_xml_get_widget (gui, "shape_cd_radio"); - - g_object_unref (gui); - - - gtk_assistant_append_page (GTK_ASSISTANT (dialog), - dialog->priv->shape_page); - - gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), - dialog->priv->shape_page, - _("Label or Card Shape")); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), - dialog->priv->shape_page, - logo); - gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), - dialog->priv->shape_page, - TRUE); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct rect size page. */ -/*--------------------------------------------------------------------------*/ -static void -construct_rect_size_page (glTemplateDesigner *dialog, - GdkPixbuf *logo) -{ - GladeXML *gui; - GdkPixbuf *pixbuf; - - gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", - "rect_size_page", NULL); - if (!gui) - { - g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); - return; - } - - dialog->priv->rect_size_page = glade_xml_get_widget (gui, "rect_size_page"); - dialog->priv->rect_image = glade_xml_get_widget (gui, "rect_image"); - dialog->priv->rect_w_spin = glade_xml_get_widget (gui, "rect_w_spin"); - dialog->priv->rect_h_spin = glade_xml_get_widget (gui, "rect_h_spin"); - dialog->priv->rect_r_spin = glade_xml_get_widget (gui, "rect_r_spin"); - dialog->priv->rect_x_waste_spin = glade_xml_get_widget (gui, "rect_x_waste_spin"); - dialog->priv->rect_y_waste_spin = glade_xml_get_widget (gui, "rect_y_waste_spin"); - dialog->priv->rect_margin_spin = glade_xml_get_widget (gui, "rect_margin_spin"); - dialog->priv->rect_w_units_label = glade_xml_get_widget (gui, "rect_w_units_label"); - dialog->priv->rect_h_units_label = glade_xml_get_widget (gui, "rect_h_units_label"); - dialog->priv->rect_r_units_label = glade_xml_get_widget (gui, "rect_r_units_label"); - dialog->priv->rect_x_waste_units_label = glade_xml_get_widget (gui, "rect_x_waste_units_label"); - dialog->priv->rect_y_waste_units_label = glade_xml_get_widget (gui, "rect_y_waste_units_label"); - dialog->priv->rect_margin_units_label = glade_xml_get_widget (gui, "rect_margin_units_label"); - - g_object_unref (gui); - - - gtk_assistant_append_page (GTK_ASSISTANT (dialog), - dialog->priv->rect_size_page); - - gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), - dialog->priv->rect_size_page, - _("Label or Card Size")); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), - dialog->priv->rect_size_page, - logo); - gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), - dialog->priv->rect_size_page, - TRUE); - - /* Initialize illustration. */ - pixbuf = gdk_pixbuf_new_from_file (EX_RECT_IMAGE, NULL); - gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->rect_image), pixbuf); - - /* Apply units to spinbuttons and units labels. */ - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->rect_w_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->rect_h_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->rect_r_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->rect_x_waste_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->rect_y_waste_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->rect_margin_units_label), - dialog->priv->units_string); - - /* Load some realistic defaults. */ - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin), - DEFAULT_RECT_W * dialog->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin), - DEFAULT_RECT_H * dialog->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin), - DEFAULT_RECT_R * dialog->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin), - DEFAULT_RECT_WASTE * dialog->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin), - DEFAULT_RECT_WASTE * dialog->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin), - DEFAULT_MARGIN * dialog->priv->units_per_point); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct round size page. */ -/*--------------------------------------------------------------------------*/ -static void -construct_round_size_page (glTemplateDesigner *dialog, - GdkPixbuf *logo) -{ - GladeXML *gui; - GdkPixbuf *pixbuf; - - gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", - "round_size_page", NULL); - if (!gui) - { - g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); - return; - } - - dialog->priv->round_size_page = glade_xml_get_widget (gui, "round_size_page"); - dialog->priv->round_image = glade_xml_get_widget (gui, "round_image"); - dialog->priv->round_r_spin = glade_xml_get_widget (gui, "round_r_spin"); - dialog->priv->round_waste_spin = glade_xml_get_widget (gui, "round_waste_spin"); - dialog->priv->round_margin_spin = glade_xml_get_widget (gui, "round_margin_spin"); - dialog->priv->round_r_units_label = glade_xml_get_widget (gui, "round_r_units_label"); - dialog->priv->round_waste_units_label = glade_xml_get_widget (gui, "round_waste_units_label"); - dialog->priv->round_margin_units_label = glade_xml_get_widget (gui, "round_margin_units_label"); - - g_object_unref (gui); - - - gtk_assistant_append_page (GTK_ASSISTANT (dialog), - dialog->priv->round_size_page); - - gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), - dialog->priv->round_size_page, - _("Label Size (round)")); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), - dialog->priv->round_size_page, - logo); - gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), - dialog->priv->round_size_page, - TRUE); - - /* Initialize illustration. */ - pixbuf = gdk_pixbuf_new_from_file (EX_ROUND_IMAGE, NULL); - gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->round_image), pixbuf); - - /* Apply units to spinbuttons and units labels. */ - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->round_r_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->round_r_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->round_r_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->round_waste_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->round_margin_units_label), - dialog->priv->units_string); - - /* Load some realistic defaults. */ - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin), - DEFAULT_ROUND_R * dialog->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin), - DEFAULT_ROUND_WASTE * dialog->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin), - DEFAULT_MARGIN * dialog->priv->units_per_point); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct CD/DVD size page. */ -/*--------------------------------------------------------------------------*/ -static void -construct_cd_size_page (glTemplateDesigner *dialog, - GdkPixbuf *logo) -{ - GladeXML *gui; - GdkPixbuf *pixbuf; - - gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", - "cd_size_page", NULL); - if (!gui) - { - g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); - return; - } - - dialog->priv->cd_size_page = glade_xml_get_widget (gui, "cd_size_page"); - dialog->priv->cd_image = glade_xml_get_widget (gui, "cd_image"); - dialog->priv->cd_radius_spin = glade_xml_get_widget (gui, "cd_radius_spin"); - dialog->priv->cd_hole_spin = glade_xml_get_widget (gui, "cd_hole_spin"); - dialog->priv->cd_w_spin = glade_xml_get_widget (gui, "cd_w_spin"); - dialog->priv->cd_h_spin = glade_xml_get_widget (gui, "cd_h_spin"); - dialog->priv->cd_waste_spin = glade_xml_get_widget (gui, "cd_waste_spin"); - dialog->priv->cd_margin_spin = glade_xml_get_widget (gui, "cd_margin_spin"); - dialog->priv->cd_radius_units_label = glade_xml_get_widget (gui, "cd_radius_units_label"); - dialog->priv->cd_hole_units_label = glade_xml_get_widget (gui, "cd_hole_units_label"); - dialog->priv->cd_w_units_label = glade_xml_get_widget (gui, "cd_w_units_label"); - dialog->priv->cd_h_units_label = glade_xml_get_widget (gui, "cd_h_units_label"); - dialog->priv->cd_waste_units_label = glade_xml_get_widget (gui, "cd_waste_units_label"); - dialog->priv->cd_margin_units_label = glade_xml_get_widget (gui, "cd_margin_units_label"); - - g_object_unref (gui); - - - gtk_assistant_append_page (GTK_ASSISTANT (dialog), - dialog->priv->cd_size_page); - - gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), - dialog->priv->cd_size_page, - _("Label Size (CD/DVD)")); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), - dialog->priv->cd_size_page, - logo); - gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), - dialog->priv->cd_size_page, - TRUE); - - /* Initialize illustration. */ - pixbuf = gdk_pixbuf_new_from_file (EX_CD_IMAGE, NULL); - gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->cd_image), pixbuf); - - /* Apply units to spinbuttons and units labels. */ - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->cd_radius_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->cd_hole_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_w_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_w_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->cd_w_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_h_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_h_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->cd_h_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->cd_waste_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->cd_margin_units_label), - dialog->priv->units_string); - - /* Load some realistic defaults. */ - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin), - DEFAULT_CD_RADIUS * dialog->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin), - DEFAULT_CD_HOLE * dialog->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin), - DEFAULT_CD_WASTE * dialog->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin), - DEFAULT_MARGIN * dialog->priv->units_per_point); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct number of layouts page. */ -/*--------------------------------------------------------------------------*/ -static void -construct_nlayouts_page (glTemplateDesigner *dialog, - GdkPixbuf *logo) -{ - GladeXML *gui; - GdkPixbuf *pixbuf; - - gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", - "nlayouts_page", NULL); - if (!gui) - { - g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); - return; - } - - dialog->priv->nlayouts_page = glade_xml_get_widget (gui, "nlayouts_page"); - dialog->priv->nlayouts_image1 = glade_xml_get_widget (gui, "nlayouts_image1"); - dialog->priv->nlayouts_image2 = glade_xml_get_widget (gui, "nlayouts_image2"); - dialog->priv->nlayouts_spin = glade_xml_get_widget (gui, "nlayouts_spin"); - - g_object_unref (gui); - - - gtk_assistant_append_page (GTK_ASSISTANT (dialog), - dialog->priv->nlayouts_page); - - gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), - dialog->priv->nlayouts_page, - _("Number of Layouts")); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), - dialog->priv->nlayouts_page, - logo); - gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), - dialog->priv->nlayouts_page, - TRUE); - - /* Initialize illustrations. */ - pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE1, NULL); - gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->nlayouts_image1), pixbuf); - pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE2, NULL); - gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->nlayouts_image2), pixbuf); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct layout page. */ -/*--------------------------------------------------------------------------*/ -static void -construct_layout_page (glTemplateDesigner *dialog, - GdkPixbuf *logo) -{ - GladeXML *gui; - - gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", - "layout_page", NULL); - if (!gui) - { - g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); - return; - } - - dialog->priv->layout_page = glade_xml_get_widget (gui, "layout_page"); - dialog->priv->layout1_head_label = glade_xml_get_widget (gui, "layout1_head_label"); - dialog->priv->layout1_nx_spin = glade_xml_get_widget (gui, "layout1_nx_spin"); - dialog->priv->layout1_ny_spin = glade_xml_get_widget (gui, "layout1_ny_spin"); - dialog->priv->layout1_x0_spin = glade_xml_get_widget (gui, "layout1_x0_spin"); - dialog->priv->layout1_y0_spin = glade_xml_get_widget (gui, "layout1_y0_spin"); - dialog->priv->layout1_dx_spin = glade_xml_get_widget (gui, "layout1_dx_spin"); - dialog->priv->layout1_dy_spin = glade_xml_get_widget (gui, "layout1_dy_spin"); - dialog->priv->layout2_head_label = glade_xml_get_widget (gui, "layout2_head_label"); - dialog->priv->layout2_nx_spin = glade_xml_get_widget (gui, "layout2_nx_spin"); - dialog->priv->layout2_ny_spin = glade_xml_get_widget (gui, "layout2_ny_spin"); - dialog->priv->layout2_x0_spin = glade_xml_get_widget (gui, "layout2_x0_spin"); - dialog->priv->layout2_y0_spin = glade_xml_get_widget (gui, "layout2_y0_spin"); - dialog->priv->layout2_dx_spin = glade_xml_get_widget (gui, "layout2_dx_spin"); - dialog->priv->layout2_dy_spin = glade_xml_get_widget (gui, "layout2_dy_spin"); - dialog->priv->layout_x0_units_label = glade_xml_get_widget (gui, "layout_x0_units_label"); - dialog->priv->layout_y0_units_label = glade_xml_get_widget (gui, "layout_y0_units_label"); - dialog->priv->layout_dx_units_label = glade_xml_get_widget (gui, "layout_dx_units_label"); - dialog->priv->layout_dy_units_label = glade_xml_get_widget (gui, "layout_dy_units_label"); - dialog->priv->layout_mini_preview = glade_xml_get_widget (gui, "layout_mini_preview"); - dialog->priv->layout_test_button = glade_xml_get_widget (gui, "layout_test_button"); - - g_object_unref (gui); - - - gtk_assistant_append_page (GTK_ASSISTANT (dialog), - dialog->priv->layout_page); - - gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), - dialog->priv->layout_page, - _("Layout(s)")); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), - dialog->priv->layout_page, - logo); - gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), - dialog->priv->layout_page, - TRUE); - - /* Apply units to spinbuttons and units labels. */ - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout1_x0_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout1_x0_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout2_x0_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout2_x0_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->layout_x0_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout1_y0_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout1_y0_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout2_y0_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout2_y0_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->layout_y0_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout1_dx_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout1_dx_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout2_dx_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout2_dx_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->layout_dx_units_label), - dialog->priv->units_string); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout1_dy_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout1_dy_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout2_dy_spin), - dialog->priv->digits); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout2_dy_spin), - dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); - gtk_label_set_text (GTK_LABEL(dialog->priv->layout_dy_units_label), - dialog->priv->units_string); - - /* Connect a handler that listens for changes in these widgets */ - /* This controls sensitivity of related widgets. */ - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_nx_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_ny_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_x0_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_y0_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_dx_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_dy_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_nx_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_ny_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_x0_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_y0_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_dx_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_dy_spin), "changed", - G_CALLBACK(layout_page_changed_cb), dialog); - - - /* Print button */ - g_signal_connect_swapped (G_OBJECT(dialog->priv->layout_test_button), "clicked", - G_CALLBACK(print_test_cb), dialog); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct finish page. */ -/*--------------------------------------------------------------------------*/ -static void -construct_finish_page (glTemplateDesigner *dialog, - GdkPixbuf *logo) -{ - GladeXML *gui; - - gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", - "finish_page", NULL); - if (!gui) - { - g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); - return; - } - - dialog->priv->finish_page = glade_xml_get_widget (gui, "finish_page"); - - g_object_unref (gui); - - - gtk_assistant_append_page (GTK_ASSISTANT (dialog), - dialog->priv->finish_page); - - gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), - dialog->priv->finish_page, - _("Design Completed")); - gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), - dialog->priv->finish_page, - logo); - gtk_assistant_set_page_type (GTK_ASSISTANT (dialog), - dialog->priv->finish_page, - GTK_ASSISTANT_PAGE_CONFIRM); - gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), - dialog->priv->finish_page, - TRUE); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. cancel callback. */ -/*--------------------------------------------------------------------------*/ -static void -cancel_cb (glTemplateDesigner *dialog) -{ - - gtk_widget_destroy (GTK_WIDGET(dialog)); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. apply callback */ -/*--------------------------------------------------------------------------*/ -static void -apply_cb (glTemplateDesigner *dialog) -{ - lglTemplate *template; - gchar *name; - - template = build_template (dialog); - lgl_db_register_template (template); - name = lgl_template_get_name (template); - gl_mini_preview_pixbuf_cache_add_by_name (name); - g_free (name); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. close callback */ -/*--------------------------------------------------------------------------*/ -static void -close_cb (glTemplateDesigner *dialog) -{ - - gtk_widget_destroy (GTK_WIDGET(dialog)); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. prepare page callback */ -/*--------------------------------------------------------------------------*/ -static void -prepare_cb (glTemplateDesigner *dialog, - GtkWidget *page) -{ - gint page_num; - - page_num = gtk_assistant_get_current_page (GTK_ASSISTANT (dialog)); - - switch (page_num) - { - - case NAME_PAGE_NUM: - name_page_changed_cb (dialog); /* Use to prepare */ - break; - - case PG_SIZE_PAGE_NUM: - pg_size_page_changed_cb (dialog); /* Use to prepare */ - break; - - case RECT_SIZE_PAGE_NUM: - rect_size_page_prepare_cb (dialog); - break; - - case ROUND_SIZE_PAGE_NUM: - round_size_page_prepare_cb (dialog); - break; - - case CD_SIZE_PAGE_NUM: - cd_size_page_prepare_cb (dialog); - break; - - case LAYOUT_PAGE_NUM: - layout_page_prepare_cb (dialog); - break; - - default: - /* No preparation needed */ - break; - - } -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Handle non-linear forward traversal. */ -/*--------------------------------------------------------------------------*/ -static gint -forward_page_function (gint current_page, - gpointer data) -{ - glTemplateDesigner *dialog = GL_TEMPLATE_DESIGNER (data); - - switch (current_page) - { - case START_PAGE_NUM: - return NAME_PAGE_NUM; - - case NAME_PAGE_NUM: - return PG_SIZE_PAGE_NUM; - - case PG_SIZE_PAGE_NUM: - return SHAPE_PAGE_NUM; - - case SHAPE_PAGE_NUM: - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_rect_radio))) { - return RECT_SIZE_PAGE_NUM; - } - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_round_radio))) { - return ROUND_SIZE_PAGE_NUM; - } - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_cd_radio))) { - return CD_SIZE_PAGE_NUM; - } - break; - - case RECT_SIZE_PAGE_NUM: - case ROUND_SIZE_PAGE_NUM: - case CD_SIZE_PAGE_NUM: - return NLAYOUTS_PAGE_NUM; - - case NLAYOUTS_PAGE_NUM: - return LAYOUT_PAGE_NUM; - - case LAYOUT_PAGE_NUM: - return FINISH_PAGE_NUM; - - case FINISH_PAGE_NUM: - default: - return -1; - } - - return -1; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Widget on name page "changed" callback. */ -/*--------------------------------------------------------------------------*/ -static void -name_page_changed_cb (glTemplateDesigner *dialog) -{ - gchar *brand, *part_num, *desc; - - brand = g_strstrip (gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->brand_entry), 0, -1)); - part_num = g_strstrip (gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->part_num_entry), 0, -1)); - desc = gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->description_entry), 0, -1); - - - if (brand && brand[0] && part_num && part_num[0] && - lgl_db_does_template_exist (brand, part_num)) - { - gtk_image_set_from_stock (GTK_IMAGE (dialog->priv->name_warning_image), - GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_BUTTON); - gtk_label_set_markup (GTK_LABEL (dialog->priv->name_warning_label), - _("Brand and part# match an existing template!")); - } - else - { - gtk_image_clear (GTK_IMAGE (dialog->priv->name_warning_image)); - gtk_label_set_text (GTK_LABEL (dialog->priv->name_warning_label), ""); - } - - if (brand && brand[0] && part_num && part_num[0] && desc && desc[0] && - !lgl_db_does_template_exist (brand, part_num)) - { - - gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), - dialog->priv->name_page, - TRUE); - } - else - { - - gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), - dialog->priv->name_page, - FALSE); - } - - g_free (brand); - g_free (part_num); - g_free (desc); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Widget on page size page "changed" callback. */ -/*--------------------------------------------------------------------------*/ -static void -pg_size_page_changed_cb (glTemplateDesigner *dialog) -{ - gchar *page_size_name; - lglPaper *paper; - - - page_size_name = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->pg_size_combo)); - - if (page_size_name && strlen(page_size_name)) { - - paper = lgl_db_lookup_paper_from_name (page_size_name); - - - if ( g_strcasecmp (paper->id, "Other") == 0 ) { - gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_w_spin), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_h_spin), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_w_units_label), - TRUE); - gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_h_units_label), - TRUE); - - } else { - gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_w_spin), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_h_spin), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_w_units_label), - FALSE); - gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_h_units_label), - FALSE); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin), - paper->width * dialog->priv->units_per_point); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin), - paper->height * dialog->priv->units_per_point); - } - - lgl_paper_free (paper); - } - - g_free (page_size_name); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare rectangular size page. */ -/*--------------------------------------------------------------------------*/ -static void -rect_size_page_prepare_cb (glTemplateDesigner *dialog) -{ - gdouble max_w, max_h; - gdouble w, h, r, x_waste, y_waste, margin; - - /* Limit label size based on already chosen page size. */ - max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin)); - max_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin)); - - w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin)); - h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin)); - r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin)); - x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin)); - y_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin)); - margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin)); - - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_w_spin), - dialog->priv->climb_rate, max_w); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_h_spin), - dialog->priv->climb_rate, max_h); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_r_spin), - 0.0, MIN(max_w, max_h)/2.0); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_x_waste_spin), - 0.0, MIN(max_w, max_h)/4.0); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_y_waste_spin), - 0.0, MIN(max_w, max_h)/4.0); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_margin_spin), - 0.0, MIN(max_w, max_h)/4.0); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin), w); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin), h); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin), r); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin), x_waste); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin), y_waste); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin), margin); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare round size page. */ -/*--------------------------------------------------------------------------*/ -static void -round_size_page_prepare_cb (glTemplateDesigner *dialog) -{ - gdouble max_w, max_h; - gdouble r, waste, margin; - - /* Limit label size based on already chosen page size. */ - max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin)); - max_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin)); - - r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin)); - waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin)); - margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin)); - - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->round_r_spin), - dialog->priv->climb_rate, MIN(max_w, max_h)/2.0); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->round_waste_spin), - 0.0, MIN(max_w, max_h)/4.0); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->round_margin_spin), - 0.0, MIN(max_w, max_h)/4.0); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin), r); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin), waste); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin), margin); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare cd/dvd size page. */ -/*--------------------------------------------------------------------------*/ -static void -cd_size_page_prepare_cb (glTemplateDesigner *dialog) -{ - gdouble max_w, max_h; - gdouble radius, hole, w, h, waste, margin; - - /* Limit label size based on already chosen page size. */ - max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin)); - max_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin)); - - radius = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin)); - hole = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin)); - w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_w_spin)); - h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_h_spin)); - waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin)); - margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin)); - - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_radius_spin), - dialog->priv->climb_rate, MIN(max_w, max_h)/2.0); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_hole_spin), - dialog->priv->climb_rate, MIN(max_w, max_h)/2.0); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_w_spin), - 0.0, max_w); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_h_spin), - 0.0, max_h); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_waste_spin), - 0.0, MIN(max_w, max_h)/4.0); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_margin_spin), - 0.0, MIN(max_w, max_h)/4.0); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin), radius); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin), hole); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_w_spin), w); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_h_spin), h); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin), waste); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin), margin); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Prepare Layout page cb. */ -/*--------------------------------------------------------------------------*/ -static void -layout_page_prepare_cb (glTemplateDesigner *dialog) -{ - gdouble page_w, page_h; - gdouble w=0, h=0, x_waste=0, y_waste=0; - gint max_nx, max_ny; - gint nlayouts; - gdouble nx_1, ny_1, x0_1, y0_1, dx_1, dy_1; - gdouble nx_2, ny_2, x0_2, y0_2, dx_2, dy_2; - lglTemplate *template; - - if (dialog->priv->stop_signals) return; - dialog->priv->stop_signals = TRUE; - - - /* Limit ranges based on already chosen page and label sizes. */ - page_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin)); - page_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin)); - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_rect_radio))) { - w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin)); - h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin)); - x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin)); - y_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin)); - } - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_round_radio))) { - w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin)); - h = w; - x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin)); - y_waste = x_waste; - } - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_cd_radio))) { - w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin)); - h = w; - x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin)); - y_waste = x_waste; - } - max_nx = MAX (floor (page_w/(w + 2*x_waste) + DELTA), 1.0); - max_ny = MAX (floor (page_h/(h + 2*y_waste) + DELTA), 1.0); - - nx_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_nx_spin)); - ny_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_ny_spin)); - x0_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_x0_spin)); - y0_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_y0_spin)); - dx_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dx_spin)); - dy_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dy_spin)); - nx_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_nx_spin)); - ny_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_ny_spin)); - x0_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_x0_spin)); - y0_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_y0_spin)); - dx_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dx_spin)); - dy_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dy_spin)); - - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_nx_spin), - 1, max_nx); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_ny_spin), - 1, max_ny); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_x0_spin), - x_waste, page_w - w - x_waste); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_y0_spin), - y_waste, page_h - h - y_waste); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_dx_spin), - w + 2*x_waste, page_w - w - 2*x_waste); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_dy_spin), - h + 2*y_waste, page_h - h - 2*y_waste); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_nx_spin), - 1, max_nx); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_ny_spin), - 1, max_ny); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_x0_spin), - x_waste, page_w - w - x_waste); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_y0_spin), - y_waste, page_h - h - y_waste); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_dx_spin), - w + 2*x_waste, page_w - w - 2*x_waste); - gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_dy_spin), - h + 2*y_waste, page_h - h - 2*y_waste); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_nx_spin), nx_1); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_ny_spin), ny_1); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_x0_spin), x0_1); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_y0_spin), y0_1); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dx_spin), dx_1); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dy_spin), dy_1); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_nx_spin), nx_2); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_ny_spin), ny_2); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_x0_spin), x0_2); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_y0_spin), y0_2); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dx_spin), dx_2); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dy_spin), dy_2); - - /* Set visibility of layout2 widgets as appropriate. */ - nlayouts = gtk_spin_button_get_value (GTK_SPIN_BUTTON (dialog->priv->nlayouts_spin)); - if ( nlayouts == 1 ) - { - gtk_widget_hide (dialog->priv->layout1_head_label); - gtk_widget_hide (dialog->priv->layout2_head_label); - gtk_widget_hide (dialog->priv->layout2_nx_spin); - gtk_widget_hide (dialog->priv->layout2_ny_spin); - gtk_widget_hide (dialog->priv->layout2_x0_spin); - gtk_widget_hide (dialog->priv->layout2_y0_spin); - gtk_widget_hide (dialog->priv->layout2_dx_spin); - gtk_widget_hide (dialog->priv->layout2_dy_spin); - } - else - { - gtk_widget_show (dialog->priv->layout1_head_label); - gtk_widget_show (dialog->priv->layout2_head_label); - gtk_widget_show (dialog->priv->layout2_nx_spin); - gtk_widget_show (dialog->priv->layout2_ny_spin); - gtk_widget_show (dialog->priv->layout2_x0_spin); - gtk_widget_show (dialog->priv->layout2_y0_spin); - gtk_widget_show (dialog->priv->layout2_dx_spin); - gtk_widget_show (dialog->priv->layout2_dy_spin); - } - - template = build_template (dialog); - gl_wdgt_mini_preview_set_template (GL_WDGT_MINI_PREVIEW(dialog->priv->layout_mini_preview), - template); - lgl_template_free (template); - - - dialog->priv->stop_signals = FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Layout page widget changed cb. */ -/*--------------------------------------------------------------------------*/ -static void -layout_page_changed_cb (glTemplateDesigner *dialog) -{ - lglTemplate *template; - - if (dialog->priv->stop_signals) return; - dialog->priv->stop_signals = TRUE; - - template = build_template (dialog); - - gl_wdgt_mini_preview_set_template (GL_WDGT_MINI_PREVIEW(dialog->priv->layout_mini_preview), - template); - - lgl_template_free (template); - - dialog->priv->stop_signals = FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Print test sheet callback. */ -/*--------------------------------------------------------------------------*/ -static void -print_test_cb (glTemplateDesigner *dialog) -{ - GObject *label; - lglTemplate *template; - glPrintOp *print_op; - - label = gl_label_new (); - - template = build_template (dialog); - gl_label_set_template (GL_LABEL(label), template); - - print_op = gl_print_op_new (GL_LABEL(label)); - gl_print_op_force_outline_flag (print_op); - gtk_print_operation_run (GTK_PRINT_OPERATION (print_op), - GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, - GTK_WINDOW (dialog), - NULL); - - lgl_template_free (template); - g_object_unref (G_OBJECT(label)); -} - -/*--------------------------------------------------------------------------*/ -/* Build a template based on current assistant settings. */ -/*--------------------------------------------------------------------------*/ -static lglTemplate * -build_template (glTemplateDesigner *dialog) -{ - gdouble upp; - gchar *brand, *part_num, *desc; - gchar *page_size_name; - lglPaper *paper; - lglTemplateFrameShape shape; - lglTemplateFrame *frame=NULL; - gdouble w=0, h=0, r=0, radius=0, hole=0, waste=0, x_waste=0, y_waste=0, margin=0; - gint nlayouts; - gdouble nx_1, ny_1, x0_1, y0_1, dx_1, dy_1; - gdouble nx_2, ny_2, x0_2, y0_2, dx_2, dy_2; - lglTemplate *template; - - upp = dialog->priv->units_per_point; - - brand = g_strstrip (gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->brand_entry), 0, -1)); - part_num = g_strstrip (gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->part_num_entry), 0, -1)); - desc = gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->description_entry), 0, -1); - - page_size_name = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->pg_size_combo)); - paper = lgl_db_lookup_paper_from_name (page_size_name); - if ( g_strcasecmp (paper->id, "Other") == 0 ) { - paper->width = - gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin)) - / upp; - paper->height = - gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin)) - / upp; - } - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_rect_radio))) { - shape = LGL_TEMPLATE_FRAME_SHAPE_RECT; - w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin)); - h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin)); - r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin)); - x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin)); - y_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin)); - margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin)); - } - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_round_radio))) { - shape = LGL_TEMPLATE_FRAME_SHAPE_ROUND; - r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin)); - waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin)); - margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin)); - } - - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_cd_radio))) { - shape = LGL_TEMPLATE_FRAME_SHAPE_CD; - radius = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin)); - hole = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin)); - w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_w_spin)); - h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_h_spin)); - waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin)); - margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin)); - } - - nlayouts = gtk_spin_button_get_value (GTK_SPIN_BUTTON (dialog->priv->nlayouts_spin)); - nx_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_nx_spin)); - ny_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_ny_spin)); - x0_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_x0_spin)); - y0_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_y0_spin)); - dx_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dx_spin)); - dy_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dy_spin)); - nx_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_nx_spin)); - ny_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_ny_spin)); - x0_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_x0_spin)); - y0_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_y0_spin)); - dx_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dx_spin)); - dy_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dy_spin)); - - - template = lgl_template_new (brand, part_num, desc, paper->id, paper->width, paper->height); - - switch (shape) { - case LGL_TEMPLATE_FRAME_SHAPE_RECT: - frame = lgl_template_frame_rect_new ("0", - w/upp, h/upp, r/upp, - x_waste/upp, y_waste/upp); - break; - case LGL_TEMPLATE_FRAME_SHAPE_ROUND: - frame = lgl_template_frame_round_new ("0", r/upp, waste/upp); - break; - case LGL_TEMPLATE_FRAME_SHAPE_CD: - frame = lgl_template_frame_cd_new ("0", - radius/upp, hole/upp, - w/upp, h/upp, - waste/upp); - break; - } - lgl_template_add_frame (template, frame); - - lgl_template_frame_add_markup (frame, - lgl_template_markup_margin_new (margin/upp)); - - lgl_template_frame_add_layout (frame, - lgl_template_layout_new (nx_1, ny_1, - x0_1/upp, - y0_1/upp, - dx_1/upp, - dy_1/upp)); - if (nlayouts > 1) { - lgl_template_frame_add_layout (frame, - lgl_template_layout_new (nx_2, ny_2, - x0_2/upp, - y0_2/upp, - dx_2/upp, - dy_2/upp)); - } - - g_free (brand); - g_free (part_num); - g_free (desc); - - g_free (page_size_name); - lgl_paper_free (paper); - - return template; -} - -/*****************************************************************************/ -/* Construct mini preview widget. */ -/*****************************************************************************/ -GtkWidget * -gl_template_designer_construct_mini_preview (gchar *name, - gchar *string1, - gchar *string2, - gint int1, - gint int2) -{ - gint width = int1; - gint height = int2; - - return gl_wdgt_mini_preview_new (height, width); -} - diff --git a/glabels2/src/template-designer.h b/glabels2/src/template-designer.h deleted file mode 100644 index bf5086ae..00000000 --- a/glabels2/src/template-designer.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * template-designer.h: Template designer module header file - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TEMPLATE_DESIGNER_H__ -#define __TEMPLATE_DESIGNER_H__ - -#include -#include - -G_BEGIN_DECLS - -#define GL_TYPE_TEMPLATE_DESIGNER (gl_template_designer_get_type ()) -#define GL_TEMPLATE_DESIGNER(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_TEMPLATE_DESIGNER, glTemplateDesigner)) -#define GL_TEMPLATE_DESIGNER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_TEMPLATE_DESIGNER, glTemplateDesignerClass)) -#define GL_IS_TEMPLATE_DESIGNER(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_TEMPLATE_DESIGNER)) -#define GL_IS_TEMPLATE_DESIGNER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_TEMPLATE_DESIGNER)) -#define GL_TEMPLATE_DESIGNER_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_TEMPLATE_DESIGNER, glTemplateDesignerClass)) - - -typedef struct _glTemplateDesigner glTemplateDesigner; -typedef struct _glTemplateDesignerClass glTemplateDesignerClass; - -typedef struct _glTemplateDesignerPrivate glTemplateDesignerPrivate; - -struct _glTemplateDesigner -{ - GtkAssistant parent_instance; - - glTemplateDesignerPrivate *priv; - -}; - -struct _glTemplateDesignerClass -{ - GtkAssistantClass parent_class; -}; - -GType gl_template_designer_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_template_designer_new (GtkWindow *parent); - -/* Semi-public, for use by libglade: */ -GtkWidget *gl_template_designer_construct_mini_preview (gchar *name, - gchar *string1, - gchar *string2, - gint int1, - gint int2); - - -G_END_DECLS - -#endif /* __TEMPLATE_DESIGNER_H__ */ diff --git a/glabels2/src/text-node.c b/glabels2/src/text-node.c deleted file mode 100644 index 7a77fbd6..00000000 --- a/glabels2/src/text-node.c +++ /dev/null @@ -1,356 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * text_node.c: text node module - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "text-node.h" - -#include - -#include "merge.h" - -#include "debug.h" - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static glTextNode *extract_text_node (gchar *text, - gint *n); - -static gboolean is_empty_field (glTextNode *text_node, - glMergeRecord *record); - - -/****************************************************************************/ -/* Expand single node into representative string. */ -/****************************************************************************/ -gchar * -gl_text_node_expand (glTextNode *text_node, - glMergeRecord *record) -{ - gchar *text; - - if (text_node->field_flag) { - if (record == NULL) { - return g_strdup_printf ("${%s}", text_node->data); - } else { - text = gl_merge_eval_key (record, text_node->data); - if (text != NULL) { - return text; - } else { - return g_strdup_printf ("%s", ""); - } - } - } else { - return g_strdup (text_node->data); - } -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Is node a field that evaluates empty? */ -/*--------------------------------------------------------------------------*/ -static gboolean -is_empty_field (glTextNode *text_node, - glMergeRecord *record) -{ - gchar *text; - gboolean ret = FALSE; - - if ( (record != NULL) && text_node->field_flag) { - text = gl_merge_eval_key (record, text_node->data); - if ( (text == NULL) || (text[0] == 0) ) { - ret = TRUE; - } - g_free (text); - } - - return ret; -} - -/****************************************************************************/ -/* Create a single text node from given text. */ -/****************************************************************************/ -glTextNode * -gl_text_node_new_from_text (gchar *text) -{ - gint n; - - return extract_text_node (text, &n); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Create a single text node from given text. n = characters used */ -/*--------------------------------------------------------------------------*/ -static glTextNode * -extract_text_node (gchar *text, - gint *n) -{ - glTextNode *text_node; - gchar *p; - gint m; - - text_node = g_new0 (glTextNode, 1); - - if (strncmp (text, "${", strlen ("${")) == 0) { - /* We are at the beginning of a "FIELD" node */ - text_node->field_flag = TRUE; - *n = strlen ("${"); - text += *n; - for (p = text, m = 0; *p != 0; p++, m++, (*n)++) { - if (*p == '}') { - (*n)++; - break; - } - } - text_node->data = g_strndup (text, m); - } else { - /* We are at the beginning of a literal node */ - text_node->field_flag = FALSE; - for (p = text, *n = 0; *p != 0; p++, (*n)++) { - if (strncmp (p, "${", strlen ("${")) == 0) - break; - if (*p == '\n') - break; - } - text_node->data = g_strndup (text, *n); - } - - return text_node; -} - -/****************************************************************************/ -/* Copy a single text node. */ -/****************************************************************************/ -glTextNode * -gl_text_node_dup (glTextNode *src) -{ - glTextNode *dst; - - if ( src == NULL ) return NULL; - - dst = g_new0 (glTextNode, 1); - - dst->field_flag = src->field_flag; - dst->data = g_strdup (src->data); - - return dst; -} - -/****************************************************************************/ -/* Free a single text node. */ -/****************************************************************************/ -void -gl_text_node_free (glTextNode **text_node) -{ - if ( *text_node == NULL ) return; - - g_free ((*text_node)->data); - (*text_node)->data = NULL; - g_free (*text_node); - *text_node = NULL; -} - -/****************************************************************************/ -/* Compare 2 text nodes for equality. */ -/****************************************************************************/ -gboolean -gl_text_node_equal (glTextNode *text_node1, - glTextNode *text_node2) -{ - /* First take care of the case of either or both being NULL. */ - if ( text_node1 == NULL ) { - return ( text_node2 == NULL ); - } else { - if ( text_node2 == NULL ) { - return FALSE; - } - } - - /* Bail if field flags differ. */ - if ( text_node1->field_flag != text_node2->field_flag ) { - return FALSE; - } - - /* Now take care of the case of either or both data fields being NULL. */ - if ( text_node1->data == NULL ) { - return ( text_node2->data == NULL ); - } else { - if ( text_node2->data == NULL ) { - return FALSE; - } - } - - /* Field flags are identical, so now compare the data. */ - return (strcmp (text_node1->data, text_node2->data) == 0); -} - -/****************************************************************************/ -/* Expand text lines into single string. */ -/****************************************************************************/ -gchar * -gl_text_node_lines_expand (GList *lines, - glMergeRecord *record) -{ - GList *p_line, *p_node; - glTextNode *text_node; - gchar *text, *old_text, *expanded_node; - - text = g_strdup (""); /* prime pointer for concatenation */ - for (p_line = lines; p_line != NULL; p_line = p_line->next) { - - /* special case: something like ${ADDRESS2} = "" on line by itself. */ - /* in such circumstances ignore the line completely. */ - p_node = (GList *)p_line->data; - if (p_node && p_node->next == NULL) { - text_node = (glTextNode *) p_node->data; - if ( is_empty_field (text_node, record) ) { - continue; - } - } - - /* expand each node */ - for (p_node = (GList *) p_line->data; p_node != NULL; - p_node = p_node->next) { - text_node = (glTextNode *) p_node->data; - old_text = text; - expanded_node = gl_text_node_expand (text_node, record); - text = g_strconcat (text, expanded_node, NULL); - g_free (old_text); - g_free (expanded_node); - } - - /* append newline to each line, except last. */ - if ( p_line->next != NULL ) { - old_text = text; - text = g_strconcat (text, "\n", NULL); - g_free (old_text); - } - } - - return text; -} - -/****************************************************************************/ -/* Parse a string back into text lines. */ -/****************************************************************************/ -GList * -gl_text_node_lines_new_from_text (gchar *text) -{ - GList *lines, *nodes; - glTextNode *text_node; - gchar *p; - gint n; - - lines = NULL; - nodes = NULL; - for (p = text; *p != 0; p += n) { - if (*p != '\n') { - text_node = extract_text_node (p, &n); - nodes = g_list_append (nodes, text_node); - } else { - n = 1; - lines = g_list_append (lines, nodes); - nodes = NULL; - } - } - if (*(p - 1) != '\n') { - lines = g_list_append (lines, nodes); - } - - return lines; -} - -/****************************************************************************/ -/* Copy a list of text lines. */ -/****************************************************************************/ -GList * -gl_text_node_lines_dup (GList *src_lines) -{ - GList *dst_lines=NULL; - GList *p_line, *line, *p_node; - glTextNode *node; - - for (p_line = src_lines; p_line != NULL; p_line = p_line->next) - { - line = NULL; - for (p_node = (GList *) p_line->data; p_node != NULL; p_node = p_node->next) - { - node = gl_text_node_dup ((glTextNode *)p_node->data); - line = g_list_append (line, node); - } - dst_lines = g_list_append (dst_lines, line); - } - - return dst_lines; -} - -/****************************************************************************/ -/* Free a list of text lines. */ -/****************************************************************************/ -void -gl_text_node_lines_free (GList **lines) -{ - GList *p_line, *p_node; - glTextNode *text_node; - - for (p_line = *lines; p_line != NULL; p_line = p_line->next) - { - for (p_node = (GList *) p_line->data; p_node != NULL; p_node = p_node->next) - { - text_node = (glTextNode *)p_node->data; - p_node->data = NULL; - gl_text_node_free ( &text_node ); - } - g_list_free ((GList *) p_line->data); - p_line->data = NULL; - } - - g_list_free (*lines); - *lines = NULL; -} - -/****************************************************************************/ -/* For debugging: descend and print lines list. */ -/****************************************************************************/ -void -gl_text_node_lines_print (GList * lines ) -{ - GList *p_line, *p_node; - glTextNode *text_node; - gint i_line, i_node; - - for (p_line=lines, i_line=0; p_line != NULL; p_line=p_line->next, i_line++) { - for (p_node = (GList *) p_line->data, i_node=0; p_node != NULL; - p_node = p_node->next, i_node++) { - text_node = (glTextNode *) p_node->data; - g_print( "LINE[%d], NODE[%d] = { %d, \"%s\" }\n", - i_line, i_node, - text_node->field_flag, text_node->data ); - - } - } - -} - diff --git a/glabels2/src/text-node.h b/glabels2/src/text-node.h deleted file mode 100644 index 4a9bd228..00000000 --- a/glabels2/src/text-node.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * text_node.h: text node module header file - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __TEXT_NODE_H__ -#define __TEXT_NODE_H__ - -#include -#include -#include "merge.h" - -G_BEGIN_DECLS - -typedef struct { - gboolean field_flag; - gchar *data; -} glTextNode; - -gchar *gl_text_node_expand (glTextNode *text_node, - glMergeRecord *record); -glTextNode *gl_text_node_new_from_text (gchar *text); -glTextNode *gl_text_node_dup (glTextNode *text_node); -void gl_text_node_free (glTextNode **text_node); - -gboolean gl_text_node_equal (glTextNode *text_node1, - glTextNode *text_node2); - -gchar *gl_text_node_lines_expand (GList *lines, - glMergeRecord *record); -GList *gl_text_node_lines_new_from_text (gchar *text); -GList *gl_text_node_lines_dup (GList *lines); -void gl_text_node_lines_free (GList **lines); - -/* debug function */ -void gl_text_node_lines_print (GList *lines); - -G_END_DECLS - -#endif diff --git a/glabels2/src/ui-commands.c b/glabels2/src/ui-commands.c deleted file mode 100644 index 9a06936f..00000000 --- a/glabels2/src/ui-commands.c +++ /dev/null @@ -1,1168 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * ui-commands.c: GLabels UI commands module - * - * Copyright (C) 2001-2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "ui-commands.h" - -#include -#include -#include -#include - -#include "view.h" -#include "file.h" -#include "template-designer.h" -#include "print-op.h" -#include "prefs.h" -#include "prefs-dialog.h" -#include "recent.h" -#include "debug.h" - - - -/****************************************************************************/ -/** File/New command. */ -/****************************************************************************/ -void -gl_ui_cmd_file_new (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_file_new (window); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** File/Properties command. */ -/****************************************************************************/ -void -gl_ui_cmd_file_properties (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_file_properties (GL_VIEW(window->view)->label, window); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** File/Template-Designer command. */ -/****************************************************************************/ -void -gl_ui_cmd_file_template_designer (GtkAction *action, - glWindow *window) -{ - GtkWidget *dialog; - - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - dialog = gl_template_designer_new (GTK_WINDOW(window)); - - gtk_widget_show (dialog); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** File/Open command. */ -/****************************************************************************/ -void -gl_ui_cmd_file_open (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_file_open (window); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** File/Open-Recent command. */ -/****************************************************************************/ -void -gl_ui_cmd_file_open_recent (GtkRecentChooser *chooser, - glWindow *window) -{ - GtkRecentInfo *item; - gchar *utf8_filename; - - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (chooser && GTK_IS_RECENT_CHOOSER(chooser)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - item = gtk_recent_chooser_get_current_item (chooser); - if (!item) - return; - - utf8_filename = gl_recent_get_utf8_filename (item); - - gl_debug (DEBUG_COMMANDS, "Selected %s\n", utf8_filename); - gl_file_open_recent (utf8_filename, window); - - gtk_recent_info_unref (item); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** File/Save command. */ -/****************************************************************************/ -void -gl_ui_cmd_file_save (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_file_save (GL_VIEW(window->view)->label, window); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** File/Save-as command. */ -/****************************************************************************/ -void -gl_ui_cmd_file_save_as (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_file_save_as (GL_VIEW(window->view)->label, window); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** File/Print command. */ -/****************************************************************************/ -void -gl_ui_cmd_file_print (GtkAction *action, - glWindow *window) -{ - glPrintOp *op; - GtkPrintOperationResult result; - - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - op = gl_print_op_new (GL_VIEW(window->view)->label); - - if (window->print_settings) - { - gl_print_op_set_settings (op, window->print_settings); - } - - result = gtk_print_operation_run (GTK_PRINT_OPERATION (op), - GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, - GTK_WINDOW (window), - NULL); - - if ( result == GTK_PRINT_OPERATION_RESULT_APPLY ) - { - gl_print_op_free_settings (window->print_settings); - window->print_settings = gl_print_op_get_settings (op); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** File/Close command. */ -/****************************************************************************/ -void -gl_ui_cmd_file_close (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_file_close (window); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** File/Quit command. */ -/****************************************************************************/ -void -gl_ui_cmd_file_quit (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_file_exit (); - - gl_debug (DEBUG_COMMANDS, "END"); -} - - -/****************************************************************************/ -/** Edit/Cut command. */ -/****************************************************************************/ -void -gl_ui_cmd_edit_cut (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_view_cut (GL_VIEW(window->view)); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** Edit/Copy command. */ -/****************************************************************************/ -void -gl_ui_cmd_edit_copy (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_view_copy (GL_VIEW(window->view)); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** Edit/Paste command. */ -/****************************************************************************/ -void -gl_ui_cmd_edit_paste (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_view_paste (GL_VIEW(window->view)); - - gl_debug (DEBUG_COMMANDS, "END"); -} - - -/****************************************************************************/ -/** Edit/Delete command. */ -/****************************************************************************/ -void -gl_ui_cmd_edit_delete (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_view_delete_selection (GL_VIEW(window->view)); - - gl_debug (DEBUG_COMMANDS, "END"); -} - - -/****************************************************************************/ -/** Edit/Select-all command. */ -/****************************************************************************/ -void -gl_ui_cmd_edit_select_all (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_view_select_all (GL_VIEW(window->view)); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** Edit/Unselect-all command. */ -/****************************************************************************/ -void -gl_ui_cmd_edit_unselect_all (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gl_view_unselect_all (GL_VIEW(window->view)); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** Edit/Preferences command. */ -/****************************************************************************/ -void -gl_ui_cmd_edit_preferences (GtkAction *action, - glWindow *window) -{ - static GtkWidget *dialog = NULL; - - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (dialog != NULL) - { - gtk_window_present (GTK_WINDOW (dialog)); - gtk_window_set_transient_for (GTK_WINDOW (dialog), - GTK_WINDOW(window)); - - } else { - - dialog = gl_prefs_dialog_new (GTK_WINDOW(window)); - - g_signal_connect (G_OBJECT (dialog), "destroy", - G_CALLBACK (gtk_widget_destroyed), &dialog); - - gtk_widget_show (dialog); - - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** View/Property-bar-toggle command. */ -/*****************************************************************************/ -void -gl_ui_cmd_view_property_bar_toggle (GtkToggleAction *action, - glWindow *window) -{ - gboolean state; - - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_TOGGLE_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - state = gtk_toggle_action_get_active (action); - - gl_prefs->property_toolbar_visible = state; - if (state) { - gtk_widget_show (GTK_WIDGET (window->property_bar)); - } else { - gtk_widget_hide (GTK_WIDGET (window->property_bar)); - } - gl_prefs_model_save_settings (gl_prefs); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** View/Property-bar-tooltips-toggle command. */ -/*****************************************************************************/ -void -gl_ui_cmd_view_property_bar_tips_toggle (GtkToggleAction *action, - glWindow *window) -{ - gboolean state; - - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_TOGGLE_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - state = gtk_toggle_action_get_active (action); - - gl_prefs->property_toolbar_view_tooltips = state; - gl_ui_property_bar_set_tooltips (window->property_bar, state); - gl_prefs_model_save_settings (gl_prefs); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** View/Grid-toggle command. */ -/*****************************************************************************/ -void -gl_ui_cmd_view_grid_toggle (GtkToggleAction *action, - glWindow *window) -{ - gboolean state; - - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_TOGGLE_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - state = gtk_toggle_action_get_active (action); - - if (window->view != NULL) - { - if (state) { - gl_view_show_grid (GL_VIEW(window->view)); - } else { - gl_view_hide_grid (GL_VIEW(window->view)); - } - } - - gl_prefs->grid_visible = state; - gl_prefs_model_save_settings (gl_prefs); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** View/Markup-toggle command. */ -/*****************************************************************************/ -void -gl_ui_cmd_view_markup_toggle (GtkToggleAction *action, - glWindow *window) -{ - gboolean state; - - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_TOGGLE_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - state = gtk_toggle_action_get_active (action); - - if (window->view != NULL) - { - if (state) { - gl_view_show_markup (GL_VIEW(window->view)); - } else { - gl_view_hide_markup (GL_VIEW(window->view)); - } - } - - gl_prefs->markup_visible = state; - gl_prefs_model_save_settings (gl_prefs); - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** View/Zoom-in command. */ -/*****************************************************************************/ -void -gl_ui_cmd_view_zoomin (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_zoom_in (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** View/Zoom-out command. */ -/*****************************************************************************/ -void -gl_ui_cmd_view_zoomout (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_zoom_out (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** View/Zoom-1:1 command. */ -/*****************************************************************************/ -void -gl_ui_cmd_view_zoom1to1 (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_set_zoom (GL_VIEW(window->view), 1.0); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** View/Zoom-to-fit command. */ -/*****************************************************************************/ -void -gl_ui_cmd_view_zoom_to_fit (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_zoom_to_fit (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Arrow-mode command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_arrow_mode (GtkAction *action, - glWindow *window) -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_arrow_mode (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Create-text object command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_create_text (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_object_create_mode (GL_VIEW(window->view), - GL_LABEL_OBJECT_TEXT); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Create-box object command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_create_box (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_object_create_mode (GL_VIEW(window->view), - GL_LABEL_OBJECT_BOX); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Create-line object command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_create_line (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_object_create_mode (GL_VIEW(window->view), - GL_LABEL_OBJECT_LINE); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Create-ellipse object command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_create_ellipse (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_object_create_mode (GL_VIEW(window->view), - GL_LABEL_OBJECT_ELLIPSE); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Create-image object command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_create_image (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_object_create_mode (GL_VIEW(window->view), - GL_LABEL_OBJECT_IMAGE); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Create-barcode object command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_create_barcode (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_object_create_mode (GL_VIEW(window->view), - GL_LABEL_OBJECT_BARCODE); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Raise command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_raise (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_raise_selection (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Lower command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_lower (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_lower_selection (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Rotate-left-90-degrees command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_rotate_left (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_rotate_selection_left (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Rotate-right-90-degrees command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_rotate_right (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_rotate_selection_right (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Flip-horizontally command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_flip_horiz (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_flip_selection_horiz (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Flip-vertically command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_flip_vert (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_flip_selection_vert (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Align-left command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_align_left (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_align_selection_left (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Align-right command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_align_right (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_align_selection_right (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Align-horizontal-center command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_align_hcenter (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_align_selection_hcenter (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Align-top command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_align_top (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_align_selection_top (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Align-bottom command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_align_bottom (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_align_selection_bottom (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Align-vertical center command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_align_vcenter (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_align_selection_vcenter (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Center-horizontally command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_center_horiz (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_center_selection_horiz (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Center-vertically command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_center_vert (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->view != NULL) { - gl_view_center_selection_vert (GL_VIEW(window->view)); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/*****************************************************************************/ -/** Objects/Edit- merge-properties command. */ -/*****************************************************************************/ -void -gl_ui_cmd_objects_merge_properties (GtkAction *action, - glWindow *window) - -{ - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (window->merge_dialog) { - - gtk_window_present (GTK_WINDOW(window->merge_dialog)); - gtk_window_set_transient_for (GTK_WINDOW (window->merge_dialog), - GTK_WINDOW (window)); - - } else { - - window->merge_dialog = - g_object_ref ( - gl_merge_properties_dialog_new (GL_VIEW(window->view)->label, - GTK_WINDOW(window)) ); - - g_signal_connect (G_OBJECT(window->merge_dialog), "destroy", - G_CALLBACK (gtk_widget_destroyed), - &window->merge_dialog); - - gtk_widget_show (GTK_WIDGET (window->merge_dialog)); - - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - -/****************************************************************************/ -/** Help/Contents command. */ -/****************************************************************************/ -void -gl_ui_cmd_help_contents (GtkAction *action, - glWindow *window) -{ - GError *error = NULL; - - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - gnome_help_display_with_doc_id (NULL, NULL, "glabels.xml", NULL, &error); - - if (error != NULL) - { - g_message ("%s", error->message); - - g_error_free (error); - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - - -/****************************************************************************/ -/** Help/About command. */ -/****************************************************************************/ -void -gl_ui_cmd_help_about (GtkAction *action, - glWindow *window) -{ - static GtkWidget *about = NULL; - - GdkPixbuf *pixbuf = NULL; - - const gchar *authors[] = { - "Jim Evins", - " ", - _("Glabels includes contributions from:"), - "Frederic Ruaudel", - "Wayne Schuller", - "Emmanuel Pacaud", - "Austin Henry", - " ", - _("See the file AUTHORS for additional credits,"), - _("or visit http://glabels.sourceforge.net/"), - NULL - }; - - const gchar *artists[] = { - "Nestor Di", - "Jim Evins", - NULL - }; - - const gchar *copy_text = "Copyright \xc2\xa9 2001-2009 Jim Evins"; - - const gchar *about_text = _("A label and business card creation program.\n"); - - const gchar *url = "http://glabels.sourceforge.net"; - - const gchar *translator_credits = _("translator-credits"); - - const gchar *license = _( - "Glabels is free software; you can redistribute it and/or modify it\n" - "under the terms of the GNU General Public License as published by\n" - "the Free Software Foundation; either version 2 of the License, or\n" - "(at your option) any later version.\n" "\n" - "This program is distributed in the hope that it will be useful, but\n" - "WITHOUT ANY WARRANTY; without even the implied warranty of\n" - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See\n" - "the GNU General Public License for more details.\n"); - - gl_debug (DEBUG_COMMANDS, "START"); - - g_return_if_fail (action && GTK_IS_ACTION(action)); - g_return_if_fail (window && GL_IS_WINDOW(window)); - - if (about != NULL) - { - - gtk_window_present (GTK_WINDOW (about)); - gtk_window_set_transient_for (GTK_WINDOW (about), - GTK_WINDOW (window)); - - } else { - - pixbuf = gdk_pixbuf_new_from_file (GLABELS_PIXMAP_DIR "glabels-splash.png", NULL); - - about = gtk_about_dialog_new (); - gtk_about_dialog_set_name (GTK_ABOUT_DIALOG(about), _("glabels")); - gtk_about_dialog_set_version (GTK_ABOUT_DIALOG(about), VERSION); - gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG(about), copy_text); - gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG(about), about_text); - gtk_about_dialog_set_website (GTK_ABOUT_DIALOG(about), url); - gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG(about), pixbuf); - - gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG(about), authors); - gtk_about_dialog_set_artists (GTK_ABOUT_DIALOG(about), artists); - gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG(about), - translator_credits); - gtk_about_dialog_set_license (GTK_ABOUT_DIALOG(about), license); - - gtk_window_set_destroy_with_parent (GTK_WINDOW (about), TRUE); - - g_signal_connect (G_OBJECT (about), "response", - G_CALLBACK (gtk_widget_destroy), NULL); - g_signal_connect (G_OBJECT (about), "destroy", - G_CALLBACK (gtk_widget_destroyed), &about); - - gtk_window_set_transient_for (GTK_WINDOW (about), - GTK_WINDOW (window)); - - gtk_window_present (GTK_WINDOW (about)); - - if (pixbuf != NULL) - g_object_unref (pixbuf); - - } - - gl_debug (DEBUG_COMMANDS, "END"); -} - diff --git a/glabels2/src/ui-commands.h b/glabels2/src/ui-commands.h deleted file mode 100644 index fc8a3db9..00000000 --- a/glabels2/src/ui-commands.h +++ /dev/null @@ -1,203 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * ui-commands.h: GLabels UI commands module header file - * - * Copyright (C) 2001-2005 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __COMMANDS_H__ -#define __COMMANDS_H__ - -#include -#include -#include -#include "window.h" - -G_BEGIN_DECLS - -void gl_ui_cmd_file_new (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_file_properties (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_file_template_designer (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_file_open (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_file_open_recent (GtkRecentChooser *chooser, - glWindow *window); - -void gl_ui_cmd_file_save (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_file_save_as (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_file_print (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_file_print_preview (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_file_close (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_file_quit (GtkAction *action, - glWindow *window); - - - -void gl_ui_cmd_edit_undo (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_edit_redo (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_edit_cut (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_edit_copy (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_edit_paste (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_edit_delete (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_edit_select_all (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_edit_unselect_all (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_edit_preferences (GtkAction *action, - glWindow *window); - - - -void gl_ui_cmd_view_property_bar_toggle (GtkToggleAction *action, - glWindow *window); - -void gl_ui_cmd_view_property_bar_tips_toggle (GtkToggleAction *action, - glWindow *window); - -void gl_ui_cmd_view_grid_toggle (GtkToggleAction *action, - glWindow *window); - -void gl_ui_cmd_view_markup_toggle (GtkToggleAction *action, - glWindow *window); - - - -void gl_ui_cmd_view_zoomin (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_view_zoomout (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_view_zoom1to1 (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_view_zoom_to_fit (GtkAction *action, - glWindow *window); - - - -void gl_ui_cmd_objects_arrow_mode (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_create_text (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_create_box (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_create_line (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_create_ellipse (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_create_image (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_create_barcode (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_raise (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_lower (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_rotate_left (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_rotate_right (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_flip_horiz (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_flip_vert (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_align_left (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_align_right (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_align_hcenter (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_align_top (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_align_bottom (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_align_vcenter (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_center_horiz (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_center_vert (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_objects_merge_properties (GtkAction *action, - glWindow *window); - - - -void gl_ui_cmd_help_contents (GtkAction *action, - glWindow *window); - -void gl_ui_cmd_help_about (GtkAction *action, - glWindow *window); - -G_END_DECLS - -#endif /* __COMMANDS_H__ */ diff --git a/glabels2/src/ui-property-bar.c b/glabels2/src/ui-property-bar.c deleted file mode 100644 index 005c8380..00000000 --- a/glabels2/src/ui-property-bar.c +++ /dev/null @@ -1,1331 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/** - * (GLABELS) Label and Business Card Creation program for GNOME - * - * property-bar.c: gLabels property bar - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "ui-property-bar.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "util.h" -#include "mygal/widget-color-combo.h" -#include "stock-pixmaps/stockpixbufs.h" -#include "prefs.h" -#include "color.h" - -#include "debug.h" - -/*===========================================================================*/ -/* Private macros and constants. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Private data types */ -/*===========================================================================*/ - -struct _glUIPropertyBarPrivate { - - glView *view; - - GladeXML *gui; - - GtkWidget *tool_bar; - - /* Font selection */ - GtkWidget *font_family_combo; - GtkWidget *font_size_spin; - GtkWidget *font_bold_toggle; - GtkWidget *font_italic_toggle; - - /* Text alignemnt radios */ - GtkWidget *text_align_left_radio; - GtkWidget *text_align_center_radio; - GtkWidget *text_align_right_radio; - - /* Color combos */ - GtkWidget *text_color_combo; - GtkWidget *fill_color_combo; - GtkWidget *line_color_combo; - - /* Line width */ - GtkWidget *line_width_spin; - - /* Prevent recursion */ - gboolean stop_signals; -}; - - -/*===========================================================================*/ -/* Private globals */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Local function prototypes */ -/*===========================================================================*/ - -static void gl_ui_property_bar_finalize (GObject *object); - -static void gl_ui_property_bar_construct (glUIPropertyBar *property_bar); - -static void selection_changed_cb (glUIPropertyBar *property_bar); - -static void font_family_changed_cb (GtkComboBox *combo, - glUIPropertyBar *property_bar); - -static void font_size_changed_cb (GtkSpinButton *spin, - glUIPropertyBar *property_bar); - -static void text_color_changed_cb (ColorCombo *cc, - GdkColor *gdk_color, - gboolean custom, - gboolean by_user, - gboolean is_default, - glUIPropertyBar *property_bar); - -static void fill_color_changed_cb (ColorCombo *cc, - GdkColor *gdk_color, - gboolean custom, - gboolean by_user, - gboolean is_default, - glUIPropertyBar *property_bar); - -static void line_color_changed_cb (ColorCombo *cc, - GdkColor *gdk_color, - gboolean custom, - gboolean by_user, - gboolean is_default, - glUIPropertyBar *property_bar); - -static void line_width_changed_cb (GtkSpinButton *spin, - glUIPropertyBar *property_bar); - -static void font_bold_toggled_cb (GtkToggleToolButton *toggle, - glUIPropertyBar *property_bar); - -static void font_italic_toggled_cb (GtkToggleToolButton *toggle, - glUIPropertyBar *property_bar); - -static void text_align_toggled_cb (GtkToggleToolButton *toggle, - glUIPropertyBar *property_bar); - -static void set_doc_items_sensitive (glUIPropertyBar *property_bar, - gboolean state); - -static void set_text_items_sensitive (glUIPropertyBar *property_bar, - gboolean state); - -static void set_fill_items_sensitive (glUIPropertyBar *property_bar, - gboolean state); - -static void set_line_color_items_sensitive (glUIPropertyBar *property_bar, - gboolean state); - -static void set_line_width_items_sensitive (glUIPropertyBar *property_bar, - gboolean state); - - -/****************************************************************************/ -/* Boilerplate Object stuff. */ -/****************************************************************************/ -G_DEFINE_TYPE (glUIPropertyBar, gl_ui_property_bar, GTK_TYPE_HBOX); - -static void -gl_ui_property_bar_class_init (glUIPropertyBarClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - gl_ui_property_bar_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_ui_property_bar_finalize; - - gl_debug (DEBUG_PROPERTY_BAR, "END"); -} - -static void -gl_ui_property_bar_init (glUIPropertyBar *property_bar) -{ - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - property_bar->priv = g_new0 (glUIPropertyBarPrivate, 1); - - gl_debug (DEBUG_PROPERTY_BAR, "END"); -} - -static void -gl_ui_property_bar_finalize (GObject *object) -{ - glUIPropertyBar *property_bar = GL_UI_PROPERTY_BAR (object); - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_UI_PROPERTY_BAR (object)); - - if (property_bar->priv->view) - { - g_object_unref (G_OBJECT(property_bar->priv->view)); - } - if (property_bar->priv->gui) - { - g_object_unref (G_OBJECT(property_bar->priv->gui)); - } - g_free (property_bar->priv); - - G_OBJECT_CLASS (gl_ui_property_bar_parent_class)->finalize (object); - - gl_debug (DEBUG_PROPERTY_BAR, "END"); -} - -/****************************************************************************/ -/* Create a NEW property_bar. */ -/****************************************************************************/ -GtkWidget * -gl_ui_property_bar_new (void) -{ - glUIPropertyBar *property_bar; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - property_bar = g_object_new (GL_TYPE_UI_PROPERTY_BAR, NULL); - - gl_ui_property_bar_construct (property_bar); - - gl_debug (DEBUG_PROPERTY_BAR, "END"); - - return GTK_WIDGET (property_bar); -} - -/******************************************************************************/ -/* Initialize property toolbar. */ -/******************************************************************************/ -static void -gl_ui_property_bar_construct (glUIPropertyBar *property_bar) -{ - GladeXML *gui; - GList *family_names = NULL; - GList *family_node; - GdkColor *gdk_color; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - property_bar->priv->stop_signals = TRUE; - - gui = glade_xml_new (GLABELS_GLADE_DIR "property-bar.glade", - "property_toolbar", NULL); - - if (!gui) - { - g_critical ("Could not open property-bar.glade. gLabels may not be installed correctly!"); - return; - } - - property_bar->priv->tool_bar = glade_xml_get_widget (gui, "property_toolbar"); - gtk_container_add (GTK_CONTAINER (property_bar), property_bar->priv->tool_bar); - - property_bar->priv->font_family_combo = - glade_xml_get_widget (gui, "font_family_combo"); - property_bar->priv->font_size_spin = - glade_xml_get_widget (gui, "font_size_spin"); - property_bar->priv->font_bold_toggle = - glade_xml_get_widget (gui, "font_bold_toggle"); - property_bar->priv->font_italic_toggle = - glade_xml_get_widget (gui, "font_italic_toggle"); - property_bar->priv->text_align_left_radio = - glade_xml_get_widget (gui, "text_align_left_radio"); - property_bar->priv->text_align_center_radio = - glade_xml_get_widget (gui, "text_align_center_radio"); - property_bar->priv->text_align_right_radio = - glade_xml_get_widget (gui, "text_align_right_radio"); - property_bar->priv->text_color_combo = - glade_xml_get_widget (gui, "text_color_combo"); - property_bar->priv->fill_color_combo = - glade_xml_get_widget (gui, "fill_color_combo"); - property_bar->priv->line_color_combo = - glade_xml_get_widget (gui, "line_color_combo"); - property_bar->priv->line_width_spin = - glade_xml_get_widget (gui, "line_width_spin"); - - /* Save reference to gui tree so we don't lose tooltips */ - property_bar->priv->gui = gui; - - set_doc_items_sensitive (property_bar, FALSE); - - /* Font family entry widget */ - gl_util_combo_box_add_text_model (GTK_COMBO_BOX (property_bar->priv->font_family_combo)); - family_names = gl_util_get_font_family_list (); - gl_util_combo_box_set_strings (GTK_COMBO_BOX (property_bar->priv->font_family_combo), - family_names); - gtk_widget_set_size_request (property_bar->priv->font_family_combo, 200, -1); - - /* Make sure we have a valid font. if not provide a good default. */ - family_node = g_list_find_custom (family_names, - gl_prefs->default_font_family, - (GCompareFunc)g_utf8_collate); - if (family_node) - { - gtk_combo_box_set_active (GTK_COMBO_BOX (property_bar->priv->font_family_combo), - g_list_position (family_names, - family_node)); - } - else - { - gtk_combo_box_set_active (GTK_COMBO_BOX (property_bar->priv->font_family_combo), 0); - } - - g_signal_connect (G_OBJECT (property_bar->priv->font_family_combo), - "changed", G_CALLBACK (font_family_changed_cb), property_bar); - - /* Font size entry widget */ - gtk_spin_button_set_value (GTK_SPIN_BUTTON(property_bar->priv->font_size_spin), - gl_prefs->default_font_size); - - g_signal_connect (G_OBJECT (property_bar->priv->font_size_spin), - "changed", G_CALLBACK (font_size_changed_cb), property_bar); - - - /* Bold and Italic toggles */ - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_bold_toggle), - (gl_prefs->default_font_weight == PANGO_WEIGHT_BOLD)); - g_signal_connect (G_OBJECT (property_bar->priv->font_bold_toggle), - "toggled", G_CALLBACK (font_bold_toggled_cb), property_bar); - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_italic_toggle), - gl_prefs->default_font_italic_flag); - g_signal_connect (G_OBJECT (property_bar->priv->font_italic_toggle), - "toggled", G_CALLBACK (font_italic_toggled_cb), property_bar); - - - /* Text alignment radio group */ - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_left_radio), - (gl_prefs->default_text_alignment == PANGO_ALIGN_LEFT)); - g_signal_connect (G_OBJECT (property_bar->priv->text_align_left_radio), - "toggled", G_CALLBACK (text_align_toggled_cb), property_bar); - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_center_radio), - (gl_prefs->default_text_alignment == PANGO_ALIGN_CENTER)); - g_signal_connect (G_OBJECT (property_bar->priv->text_align_center_radio), - "toggled", G_CALLBACK (text_align_toggled_cb), property_bar); - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_right_radio), - (gl_prefs->default_text_alignment == PANGO_ALIGN_RIGHT)); - g_signal_connect (G_OBJECT (property_bar->priv->text_align_right_radio), - "toggled", G_CALLBACK (text_align_toggled_cb), property_bar); - - /* Text color widget */ - gdk_color = gl_color_to_gdk_color (gl_prefs->default_text_color); - color_combo_set_color (COLOR_COMBO (property_bar->priv->text_color_combo), gdk_color); - g_free (gdk_color); - g_signal_connect (G_OBJECT (property_bar->priv->text_color_combo), - "color_changed", - G_CALLBACK (text_color_changed_cb), property_bar); - - /* Fill color widget */ - gdk_color = gl_color_to_gdk_color (gl_prefs->default_fill_color); - color_combo_set_color (COLOR_COMBO (property_bar->priv->fill_color_combo), gdk_color); - g_free (gdk_color); - g_signal_connect (G_OBJECT (property_bar->priv->fill_color_combo), - "color_changed", - G_CALLBACK (fill_color_changed_cb), property_bar); - - /* Line color widget */ - gdk_color = gl_color_to_gdk_color (gl_prefs->default_line_color); - color_combo_set_color (COLOR_COMBO (property_bar->priv->line_color_combo), gdk_color); - g_free (gdk_color); - g_signal_connect (G_OBJECT (property_bar->priv->line_color_combo), - "color_changed", - G_CALLBACK (line_color_changed_cb), property_bar); - - /* Line width entry widget */ - g_signal_connect (G_OBJECT (property_bar->priv->line_width_spin), - "changed", - G_CALLBACK (line_width_changed_cb), property_bar); - - property_bar->priv->stop_signals = FALSE; - - gl_debug (DEBUG_PROPERTY_BAR, "END"); -} - -/****************************************************************************/ -/* Fill widgets with default values. */ -/****************************************************************************/ -static void -reset_to_default_properties (glView *view, - glUIPropertyBar *property_bar) -{ - GList *family_names; - gchar *good_font_family; - GdkColor *gdk_color; - - /* Make sure we have a valid font. if not provide a good default. */ - family_names = gl_util_get_font_family_list (); - if (g_list_find_custom (family_names, - view->default_font_family, - (GCompareFunc)g_utf8_collate)) - { - good_font_family = g_strdup (view->default_font_family); - } - else - { - if (family_names != NULL) - { - good_font_family = g_strdup (family_names->data); /* 1st entry */ - } - else - { - good_font_family = NULL; - } - } - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (property_bar->priv->font_family_combo), - good_font_family); - g_free (good_font_family); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON(property_bar->priv->font_size_spin), - view->default_font_size); - - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_bold_toggle), - (view->default_font_weight == PANGO_WEIGHT_BOLD)); - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_italic_toggle), - view->default_font_italic_flag); - - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_left_radio), - (view->default_text_alignment == PANGO_ALIGN_LEFT)); - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_center_radio), - (view->default_text_alignment == PANGO_ALIGN_CENTER)); - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_right_radio), - (view->default_text_alignment == PANGO_ALIGN_RIGHT)); - - gdk_color = gl_color_to_gdk_color (view->default_text_color); - color_combo_set_color (COLOR_COMBO(property_bar->priv->text_color_combo), gdk_color); - g_free (gdk_color); - - gdk_color = gl_color_to_gdk_color (view->default_fill_color); - color_combo_set_color (COLOR_COMBO(property_bar->priv->fill_color_combo), gdk_color); - g_free (gdk_color); - - gdk_color = gl_color_to_gdk_color (view->default_line_color); - color_combo_set_color (COLOR_COMBO(property_bar->priv->line_color_combo), gdk_color); - g_free (gdk_color); - - gtk_spin_button_set_value (GTK_SPIN_BUTTON(property_bar->priv->line_width_spin), - view->default_line_width); -} - -/****************************************************************************/ -/* Set view associated with property_bar. */ -/****************************************************************************/ -void -gl_ui_property_bar_set_view (glUIPropertyBar *property_bar, - glView *view) -{ - glLabel *label; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - label = view->label; - g_return_if_fail (label && GL_IS_LABEL (label)); - - set_doc_items_sensitive (property_bar, TRUE); - - property_bar->priv->view = GL_VIEW (g_object_ref (G_OBJECT (view))); - - reset_to_default_properties (view, property_bar); - - g_signal_connect_swapped (G_OBJECT(view), "selection_changed", - G_CALLBACK(selection_changed_cb), property_bar); - - g_signal_connect_swapped (G_OBJECT(view->label), "changed", - G_CALLBACK(selection_changed_cb), property_bar); - - gl_debug (DEBUG_PROPERTY_BAR, "END"); -} - -/****************************************************************************/ -/** Set visiblity of property bar's tooltips. */ -/****************************************************************************/ -void -gl_ui_property_bar_set_tooltips (glUIPropertyBar *property_bar, - gboolean state) -{ - GtkTooltipsData *data; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - g_return_if_fail (property_bar && GL_IS_UI_PROPERTY_BAR(property_bar)); - - /* HACK: peek into one of our widgets to get the tooltips group created by libglade. */ - data = gtk_tooltips_data_get (property_bar->priv->font_size_spin); - g_return_if_fail (data); - - if (state) - { - gtk_tooltips_enable (data->tooltips); - } - else - { - gtk_tooltips_disable (data->tooltips); - } - - gl_debug (DEBUG_PROPERTY_BAR, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. View "selection state changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_text_properties (glView *view, - glUIPropertyBar *property_bar) -{ - gboolean can_text, is_first_object; - gboolean is_same_font_family, is_same_font_size; - gboolean is_same_text_color, is_same_is_italic; - gboolean is_same_is_bold, is_same_align; - GList *p; - glLabelObject *object; - gchar *selection_font_family, *font_family; - gdouble selection_font_size, font_size; - guint selection_text_color, text_color; - glColorNode *text_color_node; - gboolean selection_is_italic, is_italic; - gboolean selection_is_bold, is_bold; - PangoAlignment selection_align, align; - GdkColor *gdk_color; - - can_text = gl_view_can_selection_text (view); - set_text_items_sensitive (property_bar, can_text); - - if (!can_text) - return; - - is_same_is_italic = - is_same_is_bold = - is_same_align = - is_same_text_color = - is_same_font_size = - is_same_font_family = TRUE; - selection_font_family = NULL; - selection_font_size = -1; - selection_align = PANGO_ALIGN_LEFT; - selection_is_italic = TRUE; - selection_is_bold = TRUE; - selection_text_color = 0; - - is_first_object = TRUE; - - for (p = view->selected_object_list; p != NULL; p = p->next) - { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - if (!gl_label_object_can_text (object)) - continue; - - font_family = gl_label_object_get_font_family (object); - if (font_family != NULL) - { - if (selection_font_family == NULL) - { - selection_font_family = g_strdup (font_family); - } - else - { - if (strcmp (font_family, selection_font_family) != 0) - { - is_same_font_family = FALSE; - } - } - g_free (font_family); - } - - font_size = gl_label_object_get_font_size (object); - - text_color_node = gl_label_object_get_text_color (object); - if (text_color_node->field_flag) - { - /* If a merge field is set we use the default color for merged color*/ - text_color = GL_COLOR_MERGE_DEFAULT; - - } - else - { - text_color = text_color_node->color; - } - gl_color_node_free (&text_color_node); - - is_italic = gl_label_object_get_font_italic_flag (object); - is_bold = gl_label_object_get_font_weight (object) == PANGO_WEIGHT_BOLD; - align = gl_label_object_get_text_alignment (object); - - if (is_first_object) - { - selection_font_size = font_size; - selection_text_color = text_color; - selection_is_italic = is_italic; - selection_is_bold = is_bold; - selection_align = align; - } - else - { - if (font_size != selection_font_size) - is_same_font_size = FALSE; - if (text_color != selection_text_color) - is_same_text_color = FALSE; - if (is_italic != selection_is_italic) - is_same_is_italic = FALSE; - if (is_bold != selection_is_bold) - is_same_is_bold = FALSE; - if (align != selection_align) - is_same_align = FALSE; - } - is_first_object = FALSE; - } - - if (is_same_font_family && (selection_font_family != NULL)) - gl_debug (DEBUG_PROPERTY_BAR, "same font family = %s", - selection_font_family); - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (property_bar->priv->font_family_combo), - is_same_font_family?selection_font_family:""); - g_free (selection_font_family); - - if (is_same_font_size) - { - gl_debug (DEBUG_PROPERTY_BAR, "same font size = %g", - selection_font_size); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (property_bar->priv->font_size_spin), - selection_font_size); - } - else - { - gtk_entry_set_text (GTK_ENTRY (property_bar->priv->font_size_spin), ""); - } - - if (is_same_text_color) - { - gl_debug (DEBUG_PROPERTY_BAR, "same text color = %08x", selection_text_color); - gdk_color = gl_color_to_gdk_color (selection_text_color); - color_combo_set_color (COLOR_COMBO (property_bar->priv->text_color_combo), - gdk_color); - g_free (gdk_color); - } - - if (is_same_is_italic) - { - gl_debug (DEBUG_PROPERTY_BAR, "same italic flag = %d", - selection_is_italic); - } - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_italic_toggle), - selection_is_italic && is_same_is_italic); - - if (is_same_is_bold) - { - gl_debug (DEBUG_PROPERTY_BAR, "same bold flag = %d", - selection_is_bold); - } - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_bold_toggle), - selection_is_bold && is_same_is_bold); - - if (is_same_align) - gl_debug (DEBUG_PROPERTY_BAR, "same align"); - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_left_radio), - (selection_align == PANGO_ALIGN_LEFT) && - is_same_align); - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_center_radio), - (selection_align == PANGO_ALIGN_CENTER) && - is_same_align); - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_right_radio), - (selection_align == PANGO_ALIGN_RIGHT) && - is_same_align); -} - -static void -update_fill_color (glView *view, - glUIPropertyBar *property_bar) -{ - gboolean can, is_first_object; - gboolean is_same_fill_color; - GList *p; - glLabelObject *object; - guint selection_fill_color, fill_color; - GdkColor *gdk_color; - glColorNode *fill_color_node; - - can = gl_view_can_selection_fill (view); - set_fill_items_sensitive (property_bar, can); - - if (!can) - return; - - is_same_fill_color = TRUE; - is_first_object = TRUE; - selection_fill_color = 0; - - for (p = view->selected_object_list; p != NULL; p = p->next) - { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - if (!gl_label_object_can_fill (object)) - continue; - - fill_color_node = gl_label_object_get_fill_color (object); - if (fill_color_node->field_flag) - { - /* If a merge field is set we use the default color for merged color*/ - fill_color = GL_COLOR_FILL_MERGE_DEFAULT; - - } - else - { - fill_color = fill_color_node->color; - } - gl_color_node_free (&fill_color_node); - - if (is_first_object) - { - selection_fill_color = fill_color; - } - else - { - if (fill_color != selection_fill_color) - { - is_same_fill_color = FALSE; - } - } - is_first_object = FALSE; - } - - if (is_same_fill_color) - { - gl_debug (DEBUG_PROPERTY_BAR, "same fill color = %08x", selection_fill_color); - gdk_color = gl_color_to_gdk_color (selection_fill_color); - color_combo_set_color (COLOR_COMBO (property_bar->priv->fill_color_combo), - gdk_color); - g_free (gdk_color); - } -} - -static void -update_line_color (glView *view, - glUIPropertyBar *property_bar) -{ - gboolean can, is_first_object; - gboolean is_same_line_color; - GList *p; - glLabelObject *object; - guint selection_line_color, line_color; - glColorNode *line_color_node; - GdkColor *gdk_color; - - can = gl_view_can_selection_line_color (view); - set_line_color_items_sensitive (property_bar, can); - - if (!can) - return; - - is_same_line_color = TRUE; - is_first_object = TRUE; - selection_line_color = 0; - - for (p = view->selected_object_list; p != NULL; p = p->next) - { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - if (!gl_label_object_can_line_color (object)) - continue; - - line_color_node = gl_label_object_get_line_color (object); - if (line_color_node->field_flag) - { - /* If a merge field is set we use the default color for merged color*/ - line_color = GL_COLOR_MERGE_DEFAULT; - - } - else - { - line_color = line_color_node->color; - } - gl_color_node_free (&line_color_node); - - if (is_first_object) - { - selection_line_color = line_color; - } - else - { - if (line_color != selection_line_color) - { - is_same_line_color = FALSE; - } - } - is_first_object = FALSE; - } - - if (is_same_line_color) - { - gl_debug (DEBUG_PROPERTY_BAR, "same line color = %08x", selection_line_color); - gdk_color = gl_color_to_gdk_color (selection_line_color); - color_combo_set_color (COLOR_COMBO (property_bar->priv->line_color_combo), - gdk_color); - g_free (gdk_color); - } -} - -static void -update_line_width (glView *view, - glUIPropertyBar *property_bar) -{ - gboolean can, is_first_object; - gboolean is_same_line_width; - GList *p; - glLabelObject *object; - gdouble selection_line_width, line_width; - - can = gl_view_can_selection_line_width (view); - set_line_width_items_sensitive (property_bar, can); - - if (!can) - return; - - is_same_line_width = TRUE; - is_first_object = TRUE; - selection_line_width = 0; - - for (p = view->selected_object_list; p != NULL; p = p->next) - { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - if (!gl_label_object_can_line_width (object)) - continue; - - line_width = gl_label_object_get_line_width (object); - - if (is_first_object) - { - selection_line_width = line_width; - } - else - { - if (line_width != selection_line_width) - { - is_same_line_width = FALSE; - } - } - is_first_object = FALSE; - } - - if (is_same_line_width) - { - gl_debug (DEBUG_PROPERTY_BAR, "same line width = %g", selection_line_width); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (property_bar->priv->line_width_spin), - selection_line_width); - } - else - { - gtk_entry_set_text (GTK_ENTRY (property_bar->priv->line_width_spin), ""); - } -} - -static void -selection_changed_cb (glUIPropertyBar *property_bar) -{ - glView *view = property_bar->priv->view; - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (property_bar && GL_IS_UI_PROPERTY_BAR (property_bar)); - - if (property_bar->priv->stop_signals) return; - property_bar->priv->stop_signals = TRUE; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - if (gl_view_is_selection_empty (view)) - { - /* No selection: make all controls active. */ - reset_to_default_properties (view, property_bar); - set_doc_items_sensitive (property_bar, TRUE); - } - else - { - update_text_properties (view, property_bar); - update_fill_color (view, property_bar); - update_line_color (view, property_bar); - update_line_width (view, property_bar); - } - - gl_debug (DEBUG_PROPERTY_BAR, "END"); - - property_bar->priv->stop_signals = FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Font family entry changed. */ -/*--------------------------------------------------------------------------*/ -static void -font_family_changed_cb (GtkComboBox *combo, - glUIPropertyBar *property_bar) -{ - gchar *font_family; - - if (property_bar->priv->stop_signals) return; - property_bar->priv->stop_signals = TRUE; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - font_family = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo)); - if ( strlen(font_family) ) - { - gl_view_set_selection_font_family (property_bar->priv->view, - font_family); - gl_view_set_default_font_family (property_bar->priv->view, - font_family); - } - g_free (font_family); - - gl_debug (DEBUG_PROPERTY_BAR, "END"); - - property_bar->priv->stop_signals = FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Font size spin button changed. */ -/*--------------------------------------------------------------------------*/ -static void -font_size_changed_cb (GtkSpinButton *spin, - glUIPropertyBar *property_bar) -{ - gdouble font_size; - - if (property_bar->priv->stop_signals) return; - property_bar->priv->stop_signals = TRUE; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - font_size = gtk_spin_button_get_value (spin); - - gl_view_set_selection_font_size (property_bar->priv->view, - font_size); - gl_view_set_default_font_size (property_bar->priv->view, - font_size); - - gl_debug (DEBUG_PROPERTY_BAR, "END"); - - property_bar->priv->stop_signals = FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Text color combo changed. */ -/*--------------------------------------------------------------------------*/ -static void -text_color_changed_cb (ColorCombo *cc, - GdkColor *gdk_color, - gboolean custom, - gboolean by_user, - gboolean is_default, - glUIPropertyBar *property_bar) -{ - glColorNode *text_color_node; - - g_return_if_fail (property_bar && GL_IS_UI_PROPERTY_BAR (property_bar)); - - if (property_bar->priv->stop_signals) return; - property_bar->priv->stop_signals = TRUE; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - text_color_node = gl_color_node_new_default (); - text_color_node->color = gl_color_from_gdk_color (gdk_color); - - gl_debug (DEBUG_PROPERTY_BAR, "Color=%08x, Custom=%d, By_User=%d, Is_default=%d", - text_color_node->color, custom, by_user, is_default); - - if (is_default) - { - text_color_node->color = gl_prefs->default_text_color; - gl_view_set_selection_text_color (property_bar->priv->view, - text_color_node); - gl_view_set_default_text_color (property_bar->priv->view, - gl_prefs->default_text_color); - } - else - { - gl_view_set_selection_text_color (property_bar->priv->view, - text_color_node); - gl_view_set_default_text_color (property_bar->priv->view, - text_color_node->color); - } - - gl_color_node_free (&text_color_node); - - gl_debug (DEBUG_PROPERTY_BAR, "END"); - - property_bar->priv->stop_signals = FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Fill color combo changed. */ -/*--------------------------------------------------------------------------*/ -static void -fill_color_changed_cb (ColorCombo *cc, - GdkColor *gdk_color, - gboolean custom, - gboolean by_user, - gboolean is_default, - glUIPropertyBar *property_bar) -{ - glColorNode *fill_color_node; - - g_return_if_fail (property_bar && GL_IS_UI_PROPERTY_BAR (property_bar)); - - if (property_bar->priv->stop_signals) return; - property_bar->priv->stop_signals = TRUE; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - fill_color_node = gl_color_node_new_default (); - - fill_color_node->color = gl_color_from_gdk_color (gdk_color); - - gl_debug (DEBUG_PROPERTY_BAR, "Color=%08x, Custom=%d, By_User=%d, Is_default=%d", - fill_color_node->color, custom, by_user, is_default); - - if (is_default) - { - - fill_color_node->color = GL_COLOR_NONE; - gl_view_set_selection_fill_color (property_bar->priv->view, - fill_color_node); - gl_view_set_default_fill_color (property_bar->priv->view, - fill_color_node->color); - } - else - { - gl_view_set_selection_fill_color (property_bar->priv->view, - fill_color_node); - gl_view_set_default_fill_color (property_bar->priv->view, - fill_color_node->color); - } - gl_color_node_free (&fill_color_node); - - gl_debug (DEBUG_PROPERTY_BAR, "END"); - - property_bar->priv->stop_signals = FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Line color combo changed. */ -/*--------------------------------------------------------------------------*/ -static void -line_color_changed_cb (ColorCombo *cc, - GdkColor *gdk_color, - gboolean custom, - gboolean by_user, - gboolean is_default, - glUIPropertyBar *property_bar) -{ - glColorNode *line_color_node; - - g_return_if_fail (property_bar && GL_IS_UI_PROPERTY_BAR (property_bar)); - - if (property_bar->priv->stop_signals) return; - property_bar->priv->stop_signals = TRUE; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - line_color_node = gl_color_node_new_default (); - line_color_node->color = gl_color_from_gdk_color (gdk_color); - - gl_debug (DEBUG_PROPERTY_BAR, "Color=%08x, Custom=%d, By_User=%d, Is_default=%d", - line_color_node->color, custom, by_user, is_default); - - if (is_default) - { - line_color_node->color = GL_COLOR_NONE; - gl_view_set_selection_line_color (property_bar->priv->view, - line_color_node); - gl_view_set_default_line_color (property_bar->priv->view, - line_color_node->color); - } - else - { - gl_view_set_selection_line_color (property_bar->priv->view, - line_color_node); - gl_view_set_default_line_color (property_bar->priv->view, - line_color_node->color); - } - gl_color_node_free (&line_color_node); - - gl_debug (DEBUG_PROPERTY_BAR, "END"); - - property_bar->priv->stop_signals = FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Line width spin button changed. */ -/*--------------------------------------------------------------------------*/ -static void -line_width_changed_cb (GtkSpinButton *spin, - glUIPropertyBar *property_bar) -{ - gdouble line_width; - - if (property_bar->priv->stop_signals) return; - property_bar->priv->stop_signals = TRUE; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - if (property_bar->priv->view) - { - line_width = gtk_spin_button_get_value (spin); - - gl_view_set_selection_line_width (property_bar->priv->view, - line_width); - gl_view_set_default_line_width (property_bar->priv->view, - line_width); - } - - gl_debug (DEBUG_PROPERTY_BAR, "END"); - - property_bar->priv->stop_signals = FALSE; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Font bold toggled callback. */ -/*---------------------------------------------------------------------------*/ -static void -font_bold_toggled_cb (GtkToggleToolButton *toggle, - glUIPropertyBar *property_bar) -{ - gboolean state; - PangoWeight weight; - - - if (property_bar->priv->stop_signals) return; - property_bar->priv->stop_signals = TRUE; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - state = gtk_toggle_tool_button_get_active (toggle); - - weight = state ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL; - - gl_view_set_selection_font_weight (property_bar->priv->view, weight); - gl_view_set_default_font_weight (property_bar->priv->view, weight); - - gl_debug (DEBUG_PROPERTY_BAR, "END"); - - property_bar->priv->stop_signals = FALSE; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Font italic toggled callback. */ -/*---------------------------------------------------------------------------*/ -static void -font_italic_toggled_cb (GtkToggleToolButton *toggle, - glUIPropertyBar *property_bar) -{ - gboolean state; - - if (property_bar->priv->stop_signals) return; - property_bar->priv->stop_signals = TRUE; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - state = gtk_toggle_tool_button_get_active (toggle); - - gl_view_set_selection_font_italic_flag (property_bar->priv->view, state); - gl_view_set_default_font_italic_flag (property_bar->priv->view, state); - - gl_debug (DEBUG_PROPERTY_BAR, "END"); - - property_bar->priv->stop_signals = FALSE; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Text align toggled callback. */ -/*---------------------------------------------------------------------------*/ -static void -text_align_toggled_cb (GtkToggleToolButton *toggle, - glUIPropertyBar *property_bar) -{ - if (property_bar->priv->stop_signals) return; - property_bar->priv->stop_signals = TRUE; - - gl_debug (DEBUG_PROPERTY_BAR, "START"); - - if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_left_radio))) - { - gl_view_set_selection_text_alignment (property_bar->priv->view, - PANGO_ALIGN_LEFT); - gl_view_set_default_text_alignment (property_bar->priv->view, - PANGO_ALIGN_LEFT); - } - - if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_center_radio))) - { - gl_view_set_selection_text_alignment (property_bar->priv->view, - PANGO_ALIGN_CENTER); - gl_view_set_default_text_alignment (property_bar->priv->view, - PANGO_ALIGN_CENTER); - } - - if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_right_radio))) - { - gl_view_set_selection_text_alignment (property_bar->priv->view, - PANGO_ALIGN_RIGHT); - gl_view_set_default_text_alignment (property_bar->priv->view, - PANGO_ALIGN_RIGHT); - } - - gl_debug (DEBUG_PROPERTY_BAR, "END"); - - property_bar->priv->stop_signals = FALSE; -} - - -/*****************************************************************************/ -/* Construct color combo "Custom widget". */ -/*****************************************************************************/ -GtkWidget * -gl_ui_property_bar_construct_color_combo (gchar *name, - gchar *string1, - gchar *string2, - gint int1, - gint int2) -{ - GtkWidget *color_combo; - ColorGroup *cg; - gchar *cg_name; - GdkColor *gdk_color; - gchar *no_color; - GdkPixbuf *pixbuf = NULL; - - switch (int1) { - - case 0: - cg_name = "text_color_group"; - gdk_color = gl_color_to_gdk_color (gl_prefs->default_text_color); - no_color = _("Default"); - pixbuf = gdk_pixbuf_new_from_inline (-1, stock_text_24, FALSE, NULL); - break; - - case 2: - cg_name = "line_color_group"; - gdk_color = NULL; - no_color = _("No line"); - pixbuf = gdk_pixbuf_new_from_inline (-1, stock_pencil_24, FALSE, NULL); - break; - - case 1: - default: - cg_name = "fill_color_group"; - gdk_color = NULL; - no_color = _("No fill"); - pixbuf = gdk_pixbuf_new_from_inline (-1, stock_bucket_fill_24, FALSE, NULL); - break; - - } - - cg = color_group_fetch (cg_name, NULL); - color_combo = color_combo_new (pixbuf, no_color, gdk_color, cg); - g_free (gdk_color); - - color_combo_box_set_preview_relief (COLOR_COMBO(color_combo), GTK_RELIEF_NORMAL); - - g_object_unref (G_OBJECT (pixbuf)); - - return color_combo; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set sensitivity of doc controls. */ -/*---------------------------------------------------------------------------*/ -static void -set_doc_items_sensitive (glUIPropertyBar *property_bar, - gboolean state) -{ - gtk_widget_set_sensitive (property_bar->priv->font_family_combo, state); - gtk_widget_set_sensitive (property_bar->priv->font_size_spin, state); - gtk_widget_set_sensitive (property_bar->priv->font_bold_toggle, state); - gtk_widget_set_sensitive (property_bar->priv->font_italic_toggle, state); - gtk_widget_set_sensitive (property_bar->priv->text_align_left_radio, state); - gtk_widget_set_sensitive (property_bar->priv->text_align_center_radio, state); - gtk_widget_set_sensitive (property_bar->priv->text_align_right_radio, state); - gtk_widget_set_sensitive (property_bar->priv->text_color_combo, state); - gtk_widget_set_sensitive (property_bar->priv->fill_color_combo, state); - gtk_widget_set_sensitive (property_bar->priv->line_color_combo, state); - gtk_widget_set_sensitive (property_bar->priv->line_width_spin, state); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set sensitivity of text related controls. */ -/*---------------------------------------------------------------------------*/ -static void -set_text_items_sensitive (glUIPropertyBar *property_bar, - gboolean state) -{ - gtk_widget_set_sensitive (property_bar->priv->font_family_combo, state); - gtk_widget_set_sensitive (property_bar->priv->font_size_spin, state); - gtk_widget_set_sensitive (property_bar->priv->font_bold_toggle, state); - gtk_widget_set_sensitive (property_bar->priv->font_italic_toggle, state); - gtk_widget_set_sensitive (property_bar->priv->text_align_left_radio, state); - gtk_widget_set_sensitive (property_bar->priv->text_align_center_radio, state); - gtk_widget_set_sensitive (property_bar->priv->text_align_right_radio, state); - gtk_widget_set_sensitive (property_bar->priv->text_color_combo, state); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set sensitivity of fill related controls. */ -/*---------------------------------------------------------------------------*/ -static void -set_fill_items_sensitive (glUIPropertyBar *property_bar, - gboolean state) -{ - gtk_widget_set_sensitive (property_bar->priv->fill_color_combo, state); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set sensitivity of line color related controls. */ -/*---------------------------------------------------------------------------*/ -static void -set_line_color_items_sensitive (glUIPropertyBar *property_bar, - gboolean state) -{ - gtk_widget_set_sensitive (property_bar->priv->line_color_combo, state); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set sensitivity of line width related controls. */ -/*---------------------------------------------------------------------------*/ -static void -set_line_width_items_sensitive (glUIPropertyBar *property_bar, - gboolean state) -{ - gtk_widget_set_sensitive (property_bar->priv->line_width_spin, state); -} - - diff --git a/glabels2/src/ui-property-bar.h b/glabels2/src/ui-property-bar.h deleted file mode 100644 index e2af1912..00000000 --- a/glabels2/src/ui-property-bar.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/** - * (GLABELS) Label and Business Card Creation program for GNOME - * - * ui-property-bar.h: Property toolbar header file - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __UI_PROPERTY_BAR_H__ -#define __UI_PROPERTY_BAR_H__ - -#include - -#include "view.h" - -G_BEGIN_DECLS - -#define GL_TYPE_UI_PROPERTY_BAR (gl_ui_property_bar_get_type ()) -#define GL_UI_PROPERTY_BAR(obj) \ - (GTK_CHECK_CAST((obj), GL_TYPE_UI_PROPERTY_BAR, glUIPropertyBar )) -#define GL_UI_PROPERTY_BAR_CLASS(klass) \ - (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_UI_PROPERTY_BAR, glUIPropertyBarClass)) -#define GL_IS_UI_PROPERTY_BAR(obj) \ - (GTK_CHECK_TYPE ((obj), GL_TYPE_UI_PROPERTY_BAR)) -#define GL_IS_UI_PROPERTY_BAR_CLASS(klass) \ - (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_UI_PROPERTY_BAR)) - -typedef struct _glUIPropertyBar glUIPropertyBar; -typedef struct _glUIPropertyBarClass glUIPropertyBarClass; - -typedef struct _glUIPropertyBarPrivate glUIPropertyBarPrivate; - -struct _glUIPropertyBar { - GtkHBox parent_widget; - - glUIPropertyBarPrivate *priv; - -}; - -struct _glUIPropertyBarClass { - GtkHBoxClass parent_class; -}; - -GType gl_ui_property_bar_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_ui_property_bar_new (void); - -void gl_ui_property_bar_set_view (glUIPropertyBar *property_bar, - glView *view); - -void gl_ui_property_bar_set_tooltips (glUIPropertyBar *property_bar, - gboolean state); - - - -G_END_DECLS - -#endif /* __UI_PROPERTY_BAR_H__ */ diff --git a/glabels2/src/ui-sidebar.c b/glabels2/src/ui-sidebar.c deleted file mode 100644 index f8c398f4..00000000 --- a/glabels2/src/ui-sidebar.c +++ /dev/null @@ -1,217 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/** - * (GLABELS) Label and Business Card Creation program for GNOME - * - * ui-sidebar.c: Object property sidebar - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "ui-sidebar.h" - -#include - -#include "ui-util.h" -#include "object-editor.h" -#include "stock.h" - -#include "debug.h" - -/*===========================================================================*/ -/* Private macros and constants. */ -/*===========================================================================*/ - -#define DEFAULT_SIDEBAR_WIDTH 340 - -/*===========================================================================*/ -/* Private data types */ -/*===========================================================================*/ - -struct _glUISidebarPrivate { - - glView *view; - - GtkWidget *child; - GtkWidget *empty_child; -}; - -/*===========================================================================*/ -/* Private globals */ -/*===========================================================================*/ - - -/*===========================================================================*/ -/* Local function prototypes */ -/*===========================================================================*/ - -static void gl_ui_sidebar_finalize (GObject *object); - -static void gl_ui_sidebar_construct (glUISidebar *sidebar); - -static void selection_changed_cb (glView *view, - glUISidebar *sidebar); - - - -/****************************************************************************/ -/* Boilerplate Object stuff. */ -/****************************************************************************/ -G_DEFINE_TYPE (glUISidebar, gl_ui_sidebar, GTK_TYPE_VBOX); - -static void -gl_ui_sidebar_class_init (glUISidebarClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_UI, "START"); - - gl_ui_sidebar_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_ui_sidebar_finalize; - - gl_debug (DEBUG_UI, "END"); -} - -static void -gl_ui_sidebar_init (glUISidebar *sidebar) -{ - gl_debug (DEBUG_UI, "START"); - - sidebar->priv = g_new0 (glUISidebarPrivate, 1); - - gl_debug (DEBUG_UI, "END"); -} - -static void -gl_ui_sidebar_finalize (GObject *object) -{ - glUISidebar *sidebar = GL_UI_SIDEBAR (object); - - gl_debug (DEBUG_UI, "START"); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_UI_SIDEBAR (object)); - - if (sidebar->priv->view) { - g_object_unref (G_OBJECT(sidebar->priv->view)); - } - g_free (sidebar->priv); - - G_OBJECT_CLASS (gl_ui_sidebar_parent_class)->finalize (object); - - gl_debug (DEBUG_UI, "END"); -} - -/****************************************************************************/ -/* Create a NEW sidebar. */ -/****************************************************************************/ -GtkWidget * -gl_ui_sidebar_new (void) -{ - glUISidebar *sidebar; - - gl_debug (DEBUG_UI, "START"); - - sidebar = g_object_new (gl_ui_sidebar_get_type (), NULL); - - gtk_widget_set_size_request (GTK_WIDGET (sidebar), DEFAULT_SIDEBAR_WIDTH, -1); - - gl_ui_sidebar_construct (sidebar); - - gl_debug (DEBUG_UI, "END"); - - return GTK_WIDGET(sidebar); -} - -/******************************************************************************/ -/* Initialize property toolbar. */ -/******************************************************************************/ -static void -gl_ui_sidebar_construct (glUISidebar *sidebar) -{ - gl_debug (DEBUG_UI, "START"); - - sidebar->priv->empty_child = gl_object_editor_new (GL_STOCK_PROPERTIES, - _("Object properties"), - NULL, - GL_OBJECT_EDITOR_EMPTY, - NULL); - - sidebar->priv->child = gtk_widget_ref (sidebar->priv->empty_child); - gtk_widget_show (sidebar->priv->child); - gtk_container_add (GTK_CONTAINER(sidebar), sidebar->priv->child); - - gtk_widget_set_sensitive (GTK_WIDGET (sidebar), FALSE); - - gl_debug (DEBUG_UI, "END"); -} - -/****************************************************************************/ -/* Set view associated with sidebar. */ -/****************************************************************************/ -void -gl_ui_sidebar_set_view (glUISidebar *sidebar, - glView *view) -{ - gl_debug (DEBUG_UI, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - gtk_widget_set_sensitive (GTK_WIDGET (sidebar), TRUE); - - sidebar->priv->view = GL_VIEW (g_object_ref (G_OBJECT (view))); - - g_signal_connect (G_OBJECT(view), "selection_changed", - G_CALLBACK(selection_changed_cb), sidebar); - - gl_debug (DEBUG_UI, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. View "selection state changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -selection_changed_cb (glView *view, - glUISidebar *sidebar) -{ - gl_debug (DEBUG_UI, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (sidebar && GL_IS_UI_SIDEBAR (sidebar)); - - gtk_container_remove (GTK_CONTAINER(sidebar), sidebar->priv->child); - - if (gl_view_is_selection_empty (view) || !gl_view_is_selection_atomic (view)) { - - sidebar->priv->child = gtk_widget_ref (sidebar->priv->empty_child); - - } else { - - sidebar->priv->child = gtk_widget_ref (gl_view_get_editor (view)); - - } - - gtk_widget_show (sidebar->priv->child); - - gtk_box_pack_start (GTK_BOX(sidebar), sidebar->priv->child, TRUE, TRUE, 0); - - gl_debug (DEBUG_UI, "END"); -} - diff --git a/glabels2/src/ui-sidebar.h b/glabels2/src/ui-sidebar.h deleted file mode 100644 index 9ec1264d..00000000 --- a/glabels2/src/ui-sidebar.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/** - * (GLABELS) Label and Business Card Creation program for GNOME - * - * ui-sidebar.h: Object property sidebar header file - * - * Copyright (C) 2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __UI_SIDEBAR_H__ -#define __UI_SIDEBAR_H__ - -#include - -#include "view.h" - -G_BEGIN_DECLS - -#define GL_TYPE_UI_SIDEBAR (gl_ui_sidebar_get_type ()) -#define GL_UI_SIDEBAR(obj) \ - (GTK_CHECK_CAST((obj), GL_TYPE_UI_SIDEBAR, glUISidebar )) -#define GL_UI_SIDEBAR_CLASS(klass) \ - (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_UI_SIDEBAR, glUISidebarClass)) -#define GL_IS_UI_SIDEBAR(obj) \ - (GTK_CHECK_TYPE ((obj), GL_TYPE_UI_SIDEBAR)) -#define GL_IS_UI_SIDEBAR_CLASS(klass) \ - (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_UI_SIDEBAR)) - -typedef struct _glUISidebar glUISidebar; -typedef struct _glUISidebarClass glUISidebarClass; - -typedef struct _glUISidebarPrivate glUISidebarPrivate; - -struct _glUISidebar { - GtkVBox parent_widget; - - glUISidebarPrivate *priv; -}; - -struct _glUISidebarClass { - GtkVBoxClass parent_class; -}; - -GType gl_ui_sidebar_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_ui_sidebar_new (void); - -void gl_ui_sidebar_set_view (glUISidebar *sidebar, - glView *view); - - -G_END_DECLS - -#endif /* __UI_SIDEBAR_H__ */ diff --git a/glabels2/src/ui-util.c b/glabels2/src/ui-util.c deleted file mode 100644 index 3a0539df..00000000 --- a/glabels2/src/ui-util.c +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * ui-util.c: GLabels ui utilities module - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "ui-util.h" - -#include -#include - -#include "debug.h" - -/*==========================================================================*/ -/* Private macros and constants. */ -/*==========================================================================*/ - -/*==========================================================================*/ -/* Private types. */ -/*==========================================================================*/ - -/*==========================================================================*/ -/* Private globals */ -/*==========================================================================*/ - -/*==========================================================================*/ -/* Local function prototypes */ -/*==========================================================================*/ - - - -/*****************************************************************************/ -/** Set sensitivity of verb. */ -/*****************************************************************************/ -void -gl_ui_util_set_verb_sensitive (GtkUIManager *ui, - gchar *cname, - gboolean sensitive) -{ - GtkAction *action; - - gl_debug (DEBUG_UI, "START"); - - g_return_if_fail (cname != NULL); - g_return_if_fail (GTK_IS_UI_MANAGER (ui)); - - action = gtk_ui_manager_get_action (ui, cname); - - if (action) { - gl_debug (DEBUG_UI, "Set action \"%s\" sensitive = %d", cname, sensitive); - gtk_action_set_sensitive (action, sensitive); - } - - gl_debug (DEBUG_UI, "END"); -} - -/*****************************************************************************/ -/** Set sensitivity of a list of verbs. */ -/*****************************************************************************/ -void -gl_ui_util_set_verb_list_sensitive (GtkUIManager *ui, - gchar **vlist, - gboolean sensitive) -{ - GtkAction *action; - - gl_debug (DEBUG_UI, "START"); - - g_return_if_fail (vlist != NULL); - g_return_if_fail (GTK_IS_UI_MANAGER (ui)); - - for ( ; *vlist; ++vlist) - { - action = gtk_ui_manager_get_action (ui, *vlist); - - if (action) { - gtk_action_set_sensitive (action, sensitive); - } - } - - gl_debug (DEBUG_UI, "END"); -} - -/*****************************************************************************/ -/** Set state of a verb. */ -/*****************************************************************************/ -void -gl_ui_util_set_verb_state (GtkUIManager *ui, - gchar *cname, - gboolean state) -{ - GtkToggleAction *action; - - gl_debug (DEBUG_UI, "START"); - - g_return_if_fail (cname != NULL); - g_return_if_fail (GTK_IS_UI_MANAGER (ui)); - - action = GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui, cname)); - - if (action) { - gtk_toggle_action_set_active (action, state); - } - - gl_debug (DEBUG_UI, "END"); -} - diff --git a/glabels2/src/ui-util.h b/glabels2/src/ui-util.h deleted file mode 100644 index ffa2653e..00000000 --- a/glabels2/src/ui-util.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * ui-util.h: GLabels UI utilities module header file - * - * Copyright (C) 2001-2003 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __GL_UI_UTIL_H__ -#define __GL_UI_UTIL_H__ - -#include - -G_BEGIN_DECLS - -void gl_ui_util_set_verb_sensitive (GtkUIManager *ui, - gchar *cname, - gboolean sensitive); - -void gl_ui_util_set_verb_list_sensitive (GtkUIManager *ui, - gchar **vlist, - gboolean sensitive); - -void gl_ui_util_set_verb_state (GtkUIManager *ui, - gchar *cname, - gboolean state); - -G_END_DECLS - -#endif /* __GL_UI_UTIL_H__ */ diff --git a/glabels2/src/ui.c b/glabels2/src/ui.c deleted file mode 100644 index f8cbd128..00000000 --- a/glabels2/src/ui.c +++ /dev/null @@ -1,1179 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * ui.c: GLabels ui module - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "ui.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ui-util.h" -#include "ui-commands.h" -#include "file.h" -#include "prefs.h" -#include "stock.h" -#include "window.h" -#include "recent.h" - -#include "debug.h" - -/*==========================================================================*/ -/* Private macros and constants. */ -/*==========================================================================*/ - -/*==========================================================================*/ -/* Private types. */ -/*==========================================================================*/ - - -/*==========================================================================*/ -/* Local function prototypes */ -/*==========================================================================*/ - -static void view_ui_item_toggled_cb (GtkToggleAction *action, - GtkUIManager *ui); - -static void set_app_main_toolbar_style (GtkUIManager *ui); - -static void set_app_drawing_toolbar_style (GtkUIManager *ui); - -static void set_view_style (GtkUIManager *ui); - -static void connect_proxy_cb (GtkUIManager *ui, - GtkAction *action, - GtkWidget *proxy, - glWindow *window); - -static void disconnect_proxy_cb (GtkUIManager *ui, - GtkAction *action, - GtkWidget *proxy, - glWindow *window); - -static void menu_item_select_cb (GtkMenuItem *proxy, - glWindow *window); - -static void menu_item_deselect_cb (GtkMenuItem *proxy, - glWindow *window); - - -/*==========================================================================*/ -/* Private globals */ -/*==========================================================================*/ - -static GtkActionEntry entries[] = { - - /* Menu entries. */ - { "FileMenu", NULL, N_("_File") }, - { "FileRecentsMenu", NULL, N_("Open Recent _Files") }, - { "EditMenu", NULL, N_("_Edit") }, - { "ViewMenu", NULL, N_("_View") }, - { "ViewMainToolBarMenu", NULL, N_("Customize Main Toolbar") }, - { "ViewDrawingToolBarMenu", NULL, N_("Customize Drawing Toolbar") }, - { "ViewPropertyToolBarMenu", NULL, N_("Customize Properties Toolbar") }, - { "ObjectsMenu", NULL, N_("_Objects") }, - { "ObjectsCreateMenu", NULL, N_("_Create") }, - { "ObjectsOrderMenu", NULL, N_("_Order") }, - { "ObjectsRotateFlipMenu", NULL, N_("_Rotate/Flip") }, - { "ObjectsAlignHorizMenu", NULL, N_("Align _Horizontal") }, - { "ObjectsAlignVertMenu", NULL, N_("Align _Vertical") }, - { "HelpMenu", NULL, N_("_Help") }, - - /* Popup entries. */ - { "ContextMenu", NULL, N_("Context Menu") }, - { "EmptySelectionContextMenu", NULL, N_("Context Menu") }, - - /* File action entries. */ - { "FileNew", - GTK_STOCK_NEW, - N_("_New"), - "N", - N_("Create a new file"), - G_CALLBACK (gl_ui_cmd_file_new) }, - - { "FileOpen", - GTK_STOCK_OPEN, - N_("_Open..."), - "O", - N_("Open a file"), - G_CALLBACK (gl_ui_cmd_file_open) }, - - { "FileSave", - GTK_STOCK_SAVE, - N_("_Save"), - "S", - N_("Save current file"), - G_CALLBACK (gl_ui_cmd_file_save) }, - - { "FileSaveAs", - GTK_STOCK_SAVE, - N_("Save _As..."), - "S", - N_("Save the current file to a different name"), - G_CALLBACK (gl_ui_cmd_file_save_as) }, - - { "FilePrint", - GTK_STOCK_PRINT, - N_("_Print..."), - "P", - N_("Print the current file"), - G_CALLBACK (gl_ui_cmd_file_print) }, - - { "FileProperties", - GTK_STOCK_PROPERTIES, - N_("Properties..."), - NULL, - N_("Modify document properties"), - G_CALLBACK (gl_ui_cmd_file_properties) }, - - { "FileTemplateDesigner", - NULL, - N_("Template _Designer..."), - NULL, - N_("Create a custom template"), - G_CALLBACK (gl_ui_cmd_file_template_designer) }, - - { "FileClose", - GTK_STOCK_CLOSE, - N_("_Close"), - "F4", - N_("Close the current file"), - G_CALLBACK (gl_ui_cmd_file_close) }, - - { "FileQuit", - GTK_STOCK_QUIT, - N_("_Quit"), - "Q", - N_("Quit the program"), - G_CALLBACK (gl_ui_cmd_file_quit) }, - - - /* Edit action entries. */ - { "EditCut", - GTK_STOCK_CUT, - N_("Cut"), - "X", - N_("Cut the selection"), - G_CALLBACK (gl_ui_cmd_edit_cut) }, - - { "EditCopy", - GTK_STOCK_COPY, - N_("Copy"), - "C", - N_("Copy the selection"), - G_CALLBACK (gl_ui_cmd_edit_copy) }, - - { "EditPaste", - GTK_STOCK_PASTE, - N_("Paste"), - "V", - N_("Paste the clipboard"), - G_CALLBACK (gl_ui_cmd_edit_paste) }, - - { "EditDelete", - NULL, - N_("Delete"), - NULL, - N_("Delete the selected objects"), - G_CALLBACK (gl_ui_cmd_edit_delete) }, - - { "EditSelectAll", - NULL, - N_("Select All"), - "A", - N_("Select all objects"), - G_CALLBACK (gl_ui_cmd_edit_select_all) }, - - { "EditUnSelectAll", - NULL, - N_("Un-select All"), - NULL, - N_("Remove all selections"), - G_CALLBACK (gl_ui_cmd_edit_unselect_all) }, - - { "EditPreferences", - GTK_STOCK_PREFERENCES, - N_("Preferences"), - NULL, - N_("Configure the application"), - G_CALLBACK (gl_ui_cmd_edit_preferences) }, - - - /* View action entries. */ - { "ViewZoomIn", - GTK_STOCK_ZOOM_IN, - N_("Zoom in"), - NULL, - N_("Increase magnification"), - G_CALLBACK (gl_ui_cmd_view_zoomin) }, - - { "ViewZoomOut", - GTK_STOCK_ZOOM_OUT, - N_("Zoom out"), - NULL, - N_("Decrease magnification"), - G_CALLBACK (gl_ui_cmd_view_zoomout) }, - - { "ViewZoom1to1", - GTK_STOCK_ZOOM_100, - N_("Zoom 1 to 1"), - NULL, - N_("Restore scale to 100%"), - G_CALLBACK (gl_ui_cmd_view_zoom1to1) }, - - { "ViewZoomToFit", - GTK_STOCK_ZOOM_FIT, - N_("Zoom to fit"), - NULL, - N_("Set scale to fit window"), - G_CALLBACK (gl_ui_cmd_view_zoom_to_fit) }, - - - /* Objects action entries. */ - { "ObjectsArrowMode", - GL_STOCK_ARROW, - N_("Select Mode"), - NULL, - N_("Select, move and modify objects"), - G_CALLBACK (gl_ui_cmd_objects_arrow_mode) }, - - { "ObjectsCreateText", - GL_STOCK_TEXT, - N_("Text"), - NULL, - N_("Create text object"), - G_CALLBACK (gl_ui_cmd_objects_create_text) }, - - { "ObjectsCreateBox", - GL_STOCK_BOX, - N_("Box"), - NULL, - N_("Create box/rectangle object"), - G_CALLBACK (gl_ui_cmd_objects_create_box) }, - - { "ObjectsCreateLine", - GL_STOCK_LINE, - N_("Line"), - NULL, - N_("Create line object"), - G_CALLBACK (gl_ui_cmd_objects_create_line) }, - - { "ObjectsCreateEllipse", - GL_STOCK_ELLIPSE, - N_("Ellipse"), - NULL, - N_("Create ellipse/circle object"), - G_CALLBACK (gl_ui_cmd_objects_create_ellipse) }, - - { "ObjectsCreateImage", - GL_STOCK_IMAGE, - N_("Image"), - NULL, - N_("Create image object"), - G_CALLBACK (gl_ui_cmd_objects_create_image) }, - - { "ObjectsCreateBarcode", - GL_STOCK_BARCODE, - N_("Barcode"), - NULL, - N_("Create barcode object"), - G_CALLBACK (gl_ui_cmd_objects_create_barcode) }, - - { "ObjectsRaise", - GL_STOCK_ORDER_TOP, - N_("Bring to front"), - NULL, - N_("Raise object to top"), - G_CALLBACK (gl_ui_cmd_objects_raise) }, - - { "ObjectsLower", - GL_STOCK_ORDER_BOTTOM, - N_("Send to back"), - NULL, - N_("Lower object to bottom"), - G_CALLBACK (gl_ui_cmd_objects_lower) }, - - { "ObjectsRotateLeft", - GL_STOCK_ROTATE_LEFT, - N_("Rotate left"), - NULL, - N_("Rotate object 90 degrees counter-clockwise"), - G_CALLBACK (gl_ui_cmd_objects_rotate_left) }, - - { "ObjectsRotateRight", - GL_STOCK_ROTATE_RIGHT, - N_("Rotate right"), - NULL, - N_("Rotate object 90 degrees clockwise"), - G_CALLBACK (gl_ui_cmd_objects_rotate_right) }, - - { "ObjectsFlipHorizontal", - GL_STOCK_FLIP_HORIZ, - N_("Flip horizontally"), - NULL, - N_("Flip object horizontally"), - G_CALLBACK (gl_ui_cmd_objects_flip_horiz) }, - - { "ObjectsFlipVertical", - GL_STOCK_FLIP_VERT, - N_("Flip vertically"), - NULL, - N_("Flip object vertically"), - G_CALLBACK (gl_ui_cmd_objects_flip_vert) }, - - { "ObjectsAlignLeft", - GL_STOCK_ALIGN_LEFT, - N_("Align left"), - NULL, - N_("Align objects to left edges"), - G_CALLBACK (gl_ui_cmd_objects_align_left) }, - - { "ObjectsAlignRight", - GL_STOCK_ALIGN_RIGHT, - N_("Align right"), - NULL, - N_("Align objects to right edges"), - G_CALLBACK (gl_ui_cmd_objects_align_right) }, - - { "ObjectsAlignHCenter", - GL_STOCK_ALIGN_HCENTER, - N_("Align horizontal center"), - NULL, - N_("Align objects to horizontal centers"), - G_CALLBACK (gl_ui_cmd_objects_align_hcenter) }, - - { "ObjectsAlignTop", - GL_STOCK_ALIGN_TOP, - N_("Align tops"), - NULL, - N_("Align objects to top edges"), - G_CALLBACK (gl_ui_cmd_objects_align_top) }, - - { "ObjectsAlignBottom", - GL_STOCK_ALIGN_BOTTOM, - N_("Align bottoms"), - NULL, - N_("Align objects to bottom edges"), - G_CALLBACK (gl_ui_cmd_objects_align_bottom) }, - - { "ObjectsAlignVCenter", - GL_STOCK_ALIGN_VCENTER, - N_("Align vertical center"), - NULL, - N_("Align objects to vertical centers"), - G_CALLBACK (gl_ui_cmd_objects_align_vcenter) }, - - { "ObjectsCenterHorizontal", - GL_STOCK_CENTER_HORIZ, - N_("Center horizontally"), - NULL, - N_("Center objects to horizontal label center"), - G_CALLBACK (gl_ui_cmd_objects_center_horiz) }, - - { "ObjectsCenterVertical", - GL_STOCK_CENTER_VERT, - N_("Center vertically"), - NULL, - N_("Center objects to vertical label center"), - G_CALLBACK (gl_ui_cmd_objects_center_vert) }, - - { "ObjectsMergeProperties", - GL_STOCK_MERGE, - N_("Merge properties"), - NULL, - N_("Edit merge properties"), - G_CALLBACK (gl_ui_cmd_objects_merge_properties) }, - - - /* Help actions entries. */ - { "HelpContents", - GTK_STOCK_HELP, - N_("Contents"), - "F1", - N_("Open glabels manual"), - G_CALLBACK (gl_ui_cmd_help_contents) }, - - { "HelpAbout", - GTK_STOCK_ABOUT, - N_("About..."), - NULL, - N_("About glabels"), - G_CALLBACK (gl_ui_cmd_help_about) }, - -}; -static guint n_entries = G_N_ELEMENTS (entries); - -static GtkToggleActionEntry toggle_entries[] = { - - { "ViewPropertyToolBar", - NULL, - N_("Property toolbar"), - NULL, - N_("Change the visibility of the property toolbar in the current window"), - G_CALLBACK (gl_ui_cmd_view_property_bar_toggle), - TRUE }, - - { "ViewPropertyToolBarToolTips", - NULL, - N_("Show tooltips"), - NULL, - N_("Show tooltips for property toolbar"), - G_CALLBACK (gl_ui_cmd_view_property_bar_tips_toggle), - TRUE }, - - { "ViewGrid", - NULL, - N_("Grid"), - NULL, - N_("Change the visibility of the grid in the current window"), - G_CALLBACK (gl_ui_cmd_view_grid_toggle), - TRUE }, - - { "ViewMarkup", - NULL, - N_("Markup"), - NULL, - N_("Change the visibility of markup lines in the current window"), - G_CALLBACK (gl_ui_cmd_view_markup_toggle), - TRUE }, - -}; -static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries); - -static GtkToggleActionEntry ui_toggle_entries[] = { - - { "ViewMainToolBar", - NULL, - N_("Main toolbar"), - NULL, - N_("Change the visibility of the main toolbar in the current window"), - G_CALLBACK (view_ui_item_toggled_cb), - TRUE }, - - { "ViewDrawingToolBar", - NULL, - N_("Drawing toolbar"), - NULL, - N_("Change the visibility of the drawing toolbar in the current window"), - G_CALLBACK (view_ui_item_toggled_cb), - TRUE }, - - { "ViewMainToolBarToolTips", - NULL, - N_("Show tooltips"), - NULL, - N_("Show tooltips for main toolbar"), - G_CALLBACK (view_ui_item_toggled_cb), - TRUE }, - - { "ViewDrawingToolBarToolTips", - NULL, - N_("Show tooltips"), - NULL, - N_("Show tooltips for drawing toolbar"), - G_CALLBACK (view_ui_item_toggled_cb), - TRUE }, - -}; -static guint n_ui_toggle_entries = G_N_ELEMENTS (ui_toggle_entries); - -static const gchar *ui_info = -"" -"" -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -"" -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -"" -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -"" -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -"" -" " -" " -" " -"" -""; - - -static gchar* doc_verbs [] = { - "/ui/MenuBar/FileMenu/FileProperties", - "/ui/MenuBar/FileMenu/FileSave", - "/ui/MenuBar/FileMenu/FileSaveAs", - "/ui/MenuBar/FileMenu/FilePrint", - "/ui/MenuBar/FileMenu/FileClose", - "/ui/MenuBar/EditMenu/EditCut", - "/ui/MenuBar/EditMenu/EditCopy", - "/ui/MenuBar/EditMenu/EditPaste", - "/ui/MenuBar/EditMenu/EditDelete", - "/ui/MenuBar/EditMenu/EditSelectAll", - "/ui/MenuBar/EditMenu/EditUnSelectAll", - "/ui/MenuBar/ViewMenu/ViewZoomIn", - "/ui/MenuBar/ViewMenu/ViewZoomOut", - "/ui/MenuBar/ViewMenu/ViewZoom1to1", - "/ui/MenuBar/ViewMenu/ViewZoomToFit", - "/ui/MenuBar/ViewMenu/ViewGrid", - "/ui/MenuBar/ViewMenu/ViewMarkup", - "/ui/MenuBar/ObjectsMenu/ObjectsArrowMode", - "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateText", - "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateLine", - "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateBox", - "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateEllipse", - "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateImage", - "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateBarcode", - "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsRaise", - "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsLower", - "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateLeft", - "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateRight", - "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipHorizontal", - "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipVertical", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignLeft", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignRight", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignHCenter", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsCenterHorizontal", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignTop", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignBottom", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignVCenter", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsCenterVertical", - "/ui/MenuBar/ObjectsMenu/ObjectsMergeProperties", - - NULL -}; - -static gchar* doc_modified_verbs [] = { - "/ui/MenuBar/FileMenu/FileSave", - - NULL -}; - -static gchar* selection_verbs [] = { - "/ui/MenuBar/EditMenu/EditCut", - "/ui/MenuBar/EditMenu/EditCopy", - "/ui/MenuBar/EditMenu/EditDelete", - "/ui/MenuBar/EditMenu/EditUnSelectAll", - "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsRaise", - "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsLower", - "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateLeft", - "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateRight", - "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipHorizontal", - "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipVertical", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsCenterHorizontal", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsCenterVertical", - - NULL -}; - -static gchar* atomic_selection_verbs [] = { - - NULL -}; - -static gchar* multi_selection_verbs [] = { - "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignLeft", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignRight", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignHCenter", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignTop", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignBottom", - "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignVCenter", - - NULL -}; - - -/*****************************************************************************/ -/** Initialize UI component for given window. */ -/*****************************************************************************/ -GtkUIManager * -gl_ui_new (glWindow *window) -{ - GtkUIManager *ui; - GtkActionGroup *actions; - GError *error = NULL; - GtkWidget *recent_menu; - - gl_debug (DEBUG_UI, "START"); - - g_return_val_if_fail (window && GL_IS_WINDOW (window), NULL); - - gl_debug (DEBUG_UI, "window = %p", window); - - ui = gtk_ui_manager_new (); - - g_signal_connect (ui, "connect_proxy", - G_CALLBACK (connect_proxy_cb), window); - g_signal_connect (ui, "disconnect_proxy", - G_CALLBACK (disconnect_proxy_cb), window); - - actions = gtk_action_group_new ("Actions"); - gtk_action_group_set_translation_domain (actions, NULL); - gtk_action_group_add_actions (actions, entries, n_entries, GTK_WINDOW (window)); - gtk_action_group_add_toggle_actions (actions, - toggle_entries, n_toggle_entries, - window); - gtk_action_group_add_toggle_actions (actions, - ui_toggle_entries, n_ui_toggle_entries, - ui); - - gtk_ui_manager_insert_action_group (ui, actions, 0); - gtk_window_add_accel_group (GTK_WINDOW (window), gtk_ui_manager_get_accel_group (ui)); - - gl_debug (DEBUG_UI, "Creating ui from string"); - if (!gtk_ui_manager_add_ui_from_string (ui, ui_info, strlen (ui_info), &error)) { - g_message ("building menus failed: %s", error->message); - g_error_free (error); - } - - /* Set the toolbar styles according to prefs */ - set_app_main_toolbar_style (ui); - set_app_drawing_toolbar_style (ui); - - /* Set view grid and markup visibility according to prefs */ - set_view_style (ui); - - /* add an Open Recents Submenu */ - recent_menu = gl_recent_create_menu (); - g_signal_connect (G_OBJECT (recent_menu), "item-activated", - G_CALLBACK (gl_ui_cmd_file_open_recent), window); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (gtk_ui_manager_get_widget (ui, "/MenuBar/FileMenu/FileRecentsMenu")), - recent_menu); - - - gl_ui_util_set_verb_list_sensitive (ui, doc_verbs, FALSE); - - gl_debug (DEBUG_UI, "END"); - - return ui; -} - -/*****************************************************************************/ -/** Unref wrapper. */ -/*****************************************************************************/ -void -gl_ui_unref (GtkUIManager *ui) -{ - gl_debug (DEBUG_UI, "START"); - - g_object_unref(ui); - - gl_debug (DEBUG_UI, "END"); -} - -/*****************************************************************************/ -/** Update all verbs of given UI component. */ -/*****************************************************************************/ -void -gl_ui_update_all (GtkUIManager *ui, - glView *view) -{ - glLabel *label; - - gl_debug (DEBUG_UI, "START"); - - gl_ui_util_set_verb_list_sensitive (ui, doc_verbs, TRUE); - - label = view->label; - g_return_if_fail (label != NULL); - - gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditUndo", - gl_label_can_undo (label)); - gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditRedo", - gl_label_can_redo (label)); - - gl_ui_util_set_verb_list_sensitive (ui, doc_modified_verbs, - gl_label_is_modified (label)); - - gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomIn", - !gl_view_is_zoom_max (view)); - gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomOut", - !gl_view_is_zoom_min (view)); - - gl_ui_util_set_verb_list_sensitive (ui, selection_verbs, - !gl_view_is_selection_empty (view)); - - gl_ui_util_set_verb_list_sensitive (ui, atomic_selection_verbs, - gl_view_is_selection_atomic (view)); - - gl_ui_util_set_verb_list_sensitive (ui, multi_selection_verbs, - !gl_view_is_selection_empty (view) - && !gl_view_is_selection_atomic (view)); - - gl_debug (DEBUG_UI, "END"); -} - -/*****************************************************************************/ -/** Update all verbs of given UI component to "no document" state. */ -/*****************************************************************************/ -void -gl_ui_update_nodoc (GtkUIManager *ui) -{ - gl_debug (DEBUG_UI, "START"); - - gl_ui_util_set_verb_list_sensitive (ui, doc_verbs, FALSE); - - gl_debug (DEBUG_UI, "END"); -} - -/*****************************************************************************/ -/** Update label modified verbs of given UI component. */ -/*****************************************************************************/ -void -gl_ui_update_modified_verbs (GtkUIManager *ui, - glLabel *label) -{ - gl_debug (DEBUG_UI, "START"); - - gl_ui_util_set_verb_list_sensitive (ui, - doc_modified_verbs, - gl_label_is_modified (label)); - - gl_debug (DEBUG_UI, "END"); -} - -/*****************************************************************************/ -/** Update verbs associated with selection state of given UI component. */ -/*****************************************************************************/ -void -gl_ui_update_selection_verbs (GtkUIManager *ui, - glView *view) -{ - gl_debug (DEBUG_UI, "START"); - - gl_ui_util_set_verb_list_sensitive (ui, selection_verbs, - !gl_view_is_selection_empty (view)); - - gl_ui_util_set_verb_list_sensitive (ui, atomic_selection_verbs, - gl_view_is_selection_atomic (view)); - - gl_ui_util_set_verb_list_sensitive (ui, multi_selection_verbs, - !gl_view_is_selection_empty (view) - && !gl_view_is_selection_atomic (view)); - - gl_debug (DEBUG_UI, "END"); -} - -/*****************************************************************************/ -/** Update verbs associated with zoom level of given UI component. */ -/*****************************************************************************/ -void -gl_ui_update_zoom_verbs (GtkUIManager *ui, - glView *view) -{ - gl_debug (DEBUG_UI, "START"); - - gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomIn", - !gl_view_is_zoom_max (view)); - gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomOut", - !gl_view_is_zoom_min (view)); - - gl_debug (DEBUG_UI, "END"); -} - -/*****************************************************************************/ -/** Update undo/redo verbs of given UI component. */ -/*****************************************************************************/ -void -gl_ui_update_undo_redo_verbs (GtkUIManager *ui, - glLabel *label) -{ - gl_debug (DEBUG_UI, "START"); - - gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditUndo", - gl_label_can_undo (label)); - - gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditRedo", - gl_label_can_redo (label)); - - gl_debug (DEBUG_UI, "END"); -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. View menu item toggled callback. */ -/*---------------------------------------------------------------------------*/ -static void -view_ui_item_toggled_cb (GtkToggleAction *action, - GtkUIManager *ui) -{ - const gchar *name; - gboolean state; - - gl_debug (DEBUG_UI, "START"); - - g_return_if_fail (action && GTK_IS_TOGGLE_ACTION (action)); - - name = gtk_action_get_name (GTK_ACTION (action)); - state = gtk_toggle_action_get_active (action); - - gl_debug (DEBUG_UI, "Action = %s, State = %d", name, state); - - if (strcmp (name, "ViewMainToolBar") == 0) - { - gl_prefs->main_toolbar_visible = state; - set_app_main_toolbar_style (ui); - gl_prefs_model_save_settings (gl_prefs); - } - - if (strcmp (name, "ViewMainToolBarToolTips") == 0) - { - gl_prefs->main_toolbar_view_tooltips = state; - set_app_main_toolbar_style (ui); - gl_prefs_model_save_settings (gl_prefs); - } - - if (strcmp (name, "ViewDrawingToolBar") == 0) - { - gl_prefs->drawing_toolbar_visible = state; - set_app_drawing_toolbar_style (ui); - gl_prefs_model_save_settings (gl_prefs); - } - - if (strcmp (name, "ViewDrawingToolBarToolTips") == 0) - { - gl_prefs->drawing_toolbar_view_tooltips = state; - set_app_drawing_toolbar_style (ui); - gl_prefs_model_save_settings (gl_prefs); - } - - gl_debug (DEBUG_UI, ""); -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. Set main toolbar style. */ -/*---------------------------------------------------------------------------*/ -static void -set_app_main_toolbar_style (GtkUIManager *ui) -{ - GtkWidget *toolbar; - - gl_debug (DEBUG_UI, "START"); - - g_return_if_fail (ui && GTK_IS_UI_MANAGER (ui)); - - /* Updated view menu */ - gl_ui_util_set_verb_state (ui, "/ui/ViewMenu/ViewMainToolBar", - gl_prefs->main_toolbar_visible); - - gl_ui_util_set_verb_sensitive (ui, "/ui/ViewMenu/ViewMainToolBarToolTips", - gl_prefs->main_toolbar_visible); - - gl_ui_util_set_verb_state (ui, "/ui/ViewMenu/ViewMainToolBarToolTips", - gl_prefs->main_toolbar_view_tooltips); - - - toolbar = gtk_ui_manager_get_widget (ui, "/MainToolBar"); - - gtk_toolbar_set_tooltips (GTK_TOOLBAR (toolbar), - gl_prefs->main_toolbar_view_tooltips); - - if (gl_prefs->main_toolbar_visible) { - gtk_widget_show_all (toolbar); - } else { - gtk_widget_hide (toolbar); - } - - gl_debug (DEBUG_UI, "END"); -} - - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. Set drawing toolbar style. */ -/*---------------------------------------------------------------------------*/ -static void -set_app_drawing_toolbar_style (GtkUIManager *ui) -{ - GtkWidget *toolbar; - - gl_debug (DEBUG_UI, "START"); - - g_return_if_fail (ui && GTK_IS_UI_MANAGER (ui)); - - /* Updated view menu */ - gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenu/ViewDrawingToolBar", - gl_prefs->drawing_toolbar_visible); - - gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewDrawingToolBarToolTips", - gl_prefs->drawing_toolbar_visible); - - gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenuDrawingToolBarToolTips", - gl_prefs->drawing_toolbar_view_tooltips); - - - toolbar = gtk_ui_manager_get_widget (ui, "/DrawingToolBar"); - - gtk_toolbar_set_tooltips (GTK_TOOLBAR (toolbar), - gl_prefs->drawing_toolbar_view_tooltips); - - gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS); - - if (gl_prefs->drawing_toolbar_visible) { - gtk_widget_show_all (toolbar); - } else { - gtk_widget_hide (toolbar); - } - - gl_debug (DEBUG_UI, "END"); -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. Set visibility of grid and markup. */ -/*---------------------------------------------------------------------------*/ -static void -set_view_style (GtkUIManager *ui) -{ - gl_debug (DEBUG_UI, "START"); - - g_return_if_fail (ui && GTK_IS_UI_MANAGER(ui)); - - gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenu/ViewGrid", - gl_prefs->grid_visible); - - gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenu/ViewMarkup", - gl_prefs->markup_visible); - - gl_debug (DEBUG_UI, "END"); -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. Connect proxy callback. */ -/*---------------------------------------------------------------------------*/ -static void -connect_proxy_cb (GtkUIManager *ui, - GtkAction *action, - GtkWidget *proxy, - glWindow *window) -{ - if (GTK_IS_MENU_ITEM (proxy)) - { - g_signal_connect (proxy, "select", - G_CALLBACK (menu_item_select_cb), window); - g_signal_connect (proxy, "deselect", - G_CALLBACK (menu_item_deselect_cb), window); - } -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. Disconnect proxy callback. */ -/*---------------------------------------------------------------------------*/ -static void -disconnect_proxy_cb (GtkUIManager *ui, - GtkAction *action, - GtkWidget *proxy, - glWindow *window) -{ - if (GTK_IS_MENU_ITEM (proxy)) - { - g_signal_handlers_disconnect_by_func - (proxy, G_CALLBACK (menu_item_select_cb), window); - g_signal_handlers_disconnect_by_func - (proxy, G_CALLBACK (menu_item_deselect_cb), window); - } -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. Menu item select callback. */ -/*---------------------------------------------------------------------------*/ -static void -menu_item_select_cb (GtkMenuItem *proxy, - glWindow *window) -{ - GtkAction *action; - char *message; - - g_return_if_fail (window && GL_IS_WINDOW (window)); - g_return_if_fail (window->status_bar && GTK_IS_STATUSBAR (window->status_bar)); - - action = g_object_get_data (G_OBJECT (proxy), "gtk-action"); - g_return_if_fail (action != NULL); - - g_object_get (G_OBJECT (action), "tooltip", &message, NULL); - if (message) - { - gtk_statusbar_push (GTK_STATUSBAR (window->status_bar), - window->menu_tips_context_id, message); - g_free (message); - } -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. Menu item deselect callback. */ -/*---------------------------------------------------------------------------*/ -static void -menu_item_deselect_cb (GtkMenuItem *proxy, - glWindow *window) -{ - g_return_if_fail (window && GL_IS_WINDOW (window)); - g_return_if_fail (window->status_bar && GTK_IS_STATUSBAR (window->status_bar)); - - gtk_statusbar_pop (GTK_STATUSBAR (window->status_bar), - window->menu_tips_context_id); -} - diff --git a/glabels2/src/ui.h b/glabels2/src/ui.h deleted file mode 100644 index 19135d53..00000000 --- a/glabels2/src/ui.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * ui.h: GLabels UI module header file - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __GL_UI_H__ -#define __GL_UI_H__ - -#include - -#include "window.h" -#include "view.h" - -G_BEGIN_DECLS - -GtkUIManager *gl_ui_new (glWindow *window); - -void gl_ui_unref (GtkUIManager *ui); - -void gl_ui_update_all (GtkUIManager *ui, - glView *view); - -void gl_ui_update_nodoc (GtkUIManager *ui); - -void gl_ui_update_modified_verbs (GtkUIManager *ui, - glLabel *label); - -void gl_ui_update_selection_verbs (GtkUIManager *ui, - glView *view); - -void gl_ui_update_zoom_verbs (GtkUIManager *ui, - glView *view); - -void gl_ui_update_undo_redo_verbs (GtkUIManager *ui, - glLabel *label); - -G_END_DECLS - -#endif /* __GL_UI_H__ */ diff --git a/glabels2/src/util.c b/glabels2/src/util.c deleted file mode 100644 index 1e852eca..00000000 --- a/glabels2/src/util.c +++ /dev/null @@ -1,345 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * util.c: various small utility functions - * - * Copyright (C) 2001 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "util.h" - -#include -#include -#include -#include -#include -#include -#include - -#define FRAC_EPSILON 0.00005 - - -/****************************************************************************/ -/* Append ".glabels" extension to filename if needed. */ -/****************************************************************************/ -gchar * -gl_util_add_extension (const gchar *orig_filename) -{ - gchar *new_filename, *extension; - - extension = strrchr (orig_filename, '.'); - if (extension == NULL) { - new_filename = g_strconcat (orig_filename, ".glabels", NULL); - } else { - if (g_strcasecmp (extension, ".glabels") != 0) { - new_filename = - g_strconcat (orig_filename, ".glabels", NULL); - } else { - new_filename = g_strdup (orig_filename); - } - } - - return new_filename; -} - -/****************************************************************************/ -/* Remove ".glabels" extension from filename if needed. */ -/****************************************************************************/ -gchar * -gl_util_remove_extension (const gchar *orig_filename) -{ - gchar *new_filename, *extension; - - new_filename = g_strdup (orig_filename); - - extension = strrchr (new_filename, '.'); - if (extension != NULL) { - if (g_strcasecmp (extension, ".glabels") == 0) { - *extension = 0; /* truncate string, rm extension */ - } - } - - return new_filename; -} - -/****************************************************************************/ -/* Make sure we have an absolute path to filename. */ -/****************************************************************************/ -gchar * -gl_util_make_absolute (const gchar *filename) -{ - gchar *pwd, *absolute_filename; - - if (g_path_is_absolute (filename)) { - absolute_filename = g_strdup (filename); - } else { - pwd = g_get_current_dir (); - absolute_filename = g_build_filename (pwd, filename, NULL); - g_free (pwd); - } - - return absolute_filename; -} - -/****************************************************************************/ -/* Create fractional representation of number, if possible. */ -/****************************************************************************/ -gchar * -gl_util_fraction (gdouble x) -{ - static gdouble denom[] = { 1., 2., 3., 4., 8., 16., 32., 0. }; - gint i; - gdouble product, remainder; - gint n, d; - - for ( i=0; denom[i] != 0.0; i++ ) { - product = x * denom[i]; - remainder = fabs(product - ((gint)(product+0.5))); - if ( remainder < FRAC_EPSILON ) break; - } - - if ( denom[i] == 0.0 ) { - /* None of our denominators work. */ - return g_strdup_printf ("%.5g", x); - } - if ( denom[i] == 1.0 ) { - /* Simple integer. */ - return g_strdup_printf ("%d", (gint)x); - } - n = (gint)( x * denom[i] + 0.5 ); - d = (gint)denom[i]; - if ( n > d ) { - return g_strdup_printf ("%d_%d/%d", (n/d), (n%d), d); - } else { - return g_strdup_printf ("%d/%d", (n%d), d); - } -} - -/****************************************************************************/ -/* Utilities to deal with PangoAlignment types. */ -/****************************************************************************/ -const gchar * -gl_util_align_to_string (PangoAlignment align) -{ - switch (align) { - case PANGO_ALIGN_LEFT: - return "Left"; - case PANGO_ALIGN_CENTER: - return "Center"; - case PANGO_ALIGN_RIGHT: - return "Right"; - default: - return "?"; - } -} - -PangoAlignment -gl_util_string_to_align (const gchar *string) -{ - - if (g_strcasecmp (string, "Left") == 0) { - return PANGO_ALIGN_LEFT; - } else if (g_strcasecmp (string, "Center") == 0) { - return PANGO_ALIGN_CENTER; - } else if (g_strcasecmp (string, "Right") == 0) { - return PANGO_ALIGN_RIGHT; - } else { - return PANGO_ALIGN_LEFT; - } - -} - -/****************************************************************************/ -/* Utilities to deal with PangoWeight types */ -/****************************************************************************/ -const gchar * -gl_util_weight_to_string (PangoWeight weight) -{ - switch (weight) { - case PANGO_WEIGHT_NORMAL: - return "Regular"; - case PANGO_WEIGHT_BOLD: - return "Bold"; - default: - return "?"; - } -} - -PangoWeight -gl_util_string_to_weight (const gchar *string) -{ - - if (g_strcasecmp (string, "Regular") == 0) { - return PANGO_WEIGHT_NORMAL; - } else if (g_strcasecmp (string, "Bold") == 0) { - return PANGO_WEIGHT_BOLD; - } else { - return PANGO_WEIGHT_NORMAL; - } - -} - -/****************************************************************************/ -/* Convienience function to set strings in a text combo_box from a GList */ -/****************************************************************************/ -void -gl_util_combo_box_set_strings (GtkComboBox *combo, - GList *list) -{ - GtkTreeModel *model; - GList *p; - - g_return_if_fail (list); - - model = gtk_combo_box_get_model(combo); - gtk_list_store_clear (GTK_LIST_STORE (model)); - - for (p=list; p!=NULL; p=p->next) { - if (p->data) { - gtk_combo_box_append_text (combo, p->data); - } - } -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. gl_util_combo_box_set_active_text support. */ -/*---------------------------------------------------------------------------*/ - -typedef struct { - const gchar *text; - GtkTreeIter iter; - gboolean found; -} TextSearchData; - -static gboolean -search_text_func (GtkTreeModel *model, - GtkTreePath *path, - GtkTreeIter *iter, - gpointer data) -{ - TextSearchData *search_data = (TextSearchData *)data; - gchar *text = NULL; - - gtk_tree_model_get (model, iter, 0, &text, -1); - - if (strcmp (text,search_data->text) == 0) { - search_data->found = TRUE; - search_data->iter = *iter; - } - - g_free (text); - - return FALSE; -} - -/****************************************************************************/ -/* Convienience function to set active text in a text combo_box from text */ -/****************************************************************************/ -void -gl_util_combo_box_set_active_text (GtkComboBox *combo, - const gchar *text) -{ - GtkTreeModel *model = gtk_combo_box_get_model(combo); - - g_return_if_fail (GTK_IS_LIST_STORE (model)); - - if (!text) { - - gtk_combo_box_set_active (combo, -1); - - } else { - TextSearchData search_data; - - search_data.text = text; - search_data.found = FALSE; - - gtk_tree_model_foreach (model, search_text_func, &search_data); - if (search_data.found) { - gtk_combo_box_set_active_iter (combo, - &search_data.iter); - } else { - gtk_combo_box_set_active (combo, -1); - } - - } - -} - -/****************************************************************************/ -/* Convienience function to add a simple text model to an existing */ -/* combo_box. This is needed since combo_boxes created with glade do not */ -/* use the gtk_combo_box_new_text() constructor. */ -/****************************************************************************/ -void -gl_util_combo_box_add_text_model (GtkComboBox *combo) -{ - GtkCellRenderer *cell; - GtkListStore *store; - - store = gtk_list_store_new (1, G_TYPE_STRING); - gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store)); - g_object_unref (store); - - cell = gtk_cell_renderer_text_new (); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, - "text", 0, - NULL); -} - - -/****************************************************************************/ -/* Get list of available font families. */ -/****************************************************************************/ -GList * -gl_util_get_font_family_list (void) -{ - static GList *list = NULL; - PangoFontMap *fontmap; - PangoContext *context; - PangoFontFamily **families; - gint n; - gint i; - gchar *name; - - if ( !list ) - { - fontmap = pango_cairo_font_map_new (); - context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap)); - - pango_context_list_families (context, &families, &n); - - for ( i=0; i. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __UTIL_H__ -#define __UTIL_H__ - -#include -#include -#include - -G_BEGIN_DECLS - -gchar *gl_util_add_extension (const gchar *orig_filename); -gchar *gl_util_remove_extension (const gchar *orig_filename); - -gchar *gl_util_make_absolute (const gchar *filename); - -gchar *gl_util_fraction (gdouble x); - -const gchar *gl_util_align_to_string (PangoAlignment align); -PangoAlignment gl_util_string_to_align (const gchar *string); - -const gchar *gl_util_weight_to_string (PangoWeight weight); -PangoWeight gl_util_string_to_weight (const gchar *string); - -void gl_util_combo_box_set_strings (GtkComboBox *combo, - GList *list); -void gl_util_combo_box_set_active_text (GtkComboBox *combo, - const gchar *text); -void gl_util_combo_box_add_text_model (GtkComboBox *combo); - -GList *gl_util_get_font_family_list (void); - -G_END_DECLS - -#endif /* __UTIL_H__ */ diff --git a/glabels2/src/view-barcode.c b/glabels2/src/view-barcode.c deleted file mode 100644 index 522d334c..00000000 --- a/glabels2/src/view-barcode.c +++ /dev/null @@ -1,424 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_barcode.c: GLabels label barcode object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "view-barcode.h" - -#include -#include - -#include "color.h" -#include "object-editor.h" -#include "stock.h" - -#include "pixmaps/cursor_barcode.xbm" -#include "pixmaps/cursor_barcode_mask.xbm" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glViewBarcodePrivate { -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_view_barcode_finalize (GObject *object); - -static GtkWidget *construct_properties_editor (glViewObject *view_object); - -static void update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object); - -static void update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor); - -static void update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor); - -static gboolean object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y); - - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glViewBarcode, gl_view_barcode, GL_TYPE_VIEW_OBJECT); - - -static void -gl_view_barcode_class_init (glViewBarcodeClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); - - gl_debug (DEBUG_VIEW, "START"); - - gl_view_barcode_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_view_barcode_finalize; - - view_object_class->construct_editor = construct_properties_editor; - view_object_class->object_at = object_at; - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_barcode_init (glViewBarcode *view_barcode) -{ - gl_debug (DEBUG_VIEW, "START"); - - view_barcode->priv = g_new0 (glViewBarcodePrivate, 1); - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_barcode_finalize (GObject *object) -{ - glViewBarcode *view_barcode = GL_VIEW_BARCODE (object); - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (object && GL_IS_VIEW_BARCODE (object)); - - g_free (view_barcode->priv); - - G_OBJECT_CLASS (gl_view_barcode_parent_class)->finalize (object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* NEW barcode object view. */ -/*****************************************************************************/ -glViewObject * -gl_view_barcode_new (glLabelBarcode *object, - glView *view) -{ - glViewBarcode *view_barcode; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_BARCODE (object), NULL); - g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); - - view_barcode = g_object_new (gl_view_barcode_get_type(), NULL); - - gl_view_object_set_object (GL_VIEW_OBJECT(view_barcode), - GL_LABEL_OBJECT(object), - GL_VIEW_OBJECT_HANDLES_BOX); - gl_view_object_set_view (GL_VIEW_OBJECT(view_barcode), view); - - gl_debug (DEBUG_VIEW, "END"); - - return GL_VIEW_OBJECT (view_barcode); -} - -/*****************************************************************************/ -/* Create a properties dialog for a barcode object. */ -/*****************************************************************************/ -static GtkWidget * -construct_properties_editor (glViewObject *view_object) -{ - GtkWidget *editor; - glViewBarcode *view_bc = (glViewBarcode *)view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - object = gl_view_object_get_object (GL_VIEW_OBJECT(view_bc)); - - /* Build editor. */ - editor = gl_object_editor_new (GL_STOCK_BARCODE, _("Barcode object properties"), - object->parent, - GL_OBJECT_EDITOR_POSITION_PAGE, - GL_OBJECT_EDITOR_SIZE_PAGE, - GL_OBJECT_EDITOR_BC_PAGE, - GL_OBJECT_EDITOR_DATA_PAGE, - 0); - - /* Update */ - update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); - update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); - - /* Connect signals. */ - g_signal_connect (G_OBJECT (editor), "changed", - G_CALLBACK(update_object_from_editor_cb), object); - g_signal_connect (G_OBJECT (object), "changed", - G_CALLBACK (update_editor_from_object_cb), editor); - g_signal_connect (G_OBJECT (object), "moved", - G_CALLBACK (update_editor_from_move_cb), editor); - - gl_debug (DEBUG_VIEW, "END"); - - return editor; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. editor "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object) -{ - gdouble x, y, w, h; - glTextNode *text_node; - gchar *id; - gboolean text_flag, cs_flag; - glColorNode *color_node; - guint format_digits; - - gl_debug (DEBUG_VIEW, "START"); - - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - - gl_object_editor_get_position (editor, &x, &y); - gl_label_object_set_position (object, x, y); - - gl_object_editor_get_size (editor, &w, &h); - gl_label_object_set_size (object, w, h); - - text_node = gl_object_editor_get_data (editor); - gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node); - gl_text_node_free (&text_node); - - gl_object_editor_get_bc_style (editor, &id, &text_flag, &cs_flag, &format_digits); - color_node = gl_object_editor_get_bc_color (editor); - gl_label_barcode_set_props (GL_LABEL_BARCODE(object), - id, text_flag, cs_flag, format_digits); - gl_label_object_set_line_color (object, color_node); - gl_color_node_free (&color_node); - g_free (id); - - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor) -{ - gdouble w, h; - glTextNode *text_node; - gchar *id; - gboolean text_flag, cs_flag; - glColorNode *color_node; - glMerge *merge; - guint format_digits; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_size (object, &w, &h); - gl_object_editor_set_size (editor, w, h); - - merge = gl_label_get_merge (GL_LABEL(object->parent)); - - gl_label_barcode_get_props (GL_LABEL_BARCODE(object), - &id, &text_flag, &cs_flag, &format_digits); - color_node = gl_label_object_get_line_color (object); - gl_object_editor_set_bc_style (editor, id, text_flag, cs_flag, format_digits); - gl_object_editor_set_bc_color (editor, (merge != NULL), color_node); - gl_color_node_free (&color_node); - g_free (id); - - text_node = gl_label_barcode_get_data (GL_LABEL_BARCODE(object)); - gl_object_editor_set_data (editor, (merge != NULL), text_node); - gl_text_node_free (&text_node); - - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "moved" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor) -{ - gdouble x, y; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_position (object, &x, &y); - gl_object_editor_set_position (editor, x, y); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Is object at (x,y)? */ -/*****************************************************************************/ -static gboolean -object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y) -{ - glLabelObject *object; - gdouble w, h; - - object = gl_view_object_get_object (view_object); - - gl_label_object_get_size (object, &w, &h); - - cairo_rectangle (cr, 0.0, 0.0, w, h); - - if (cairo_in_fill (cr, x, y)) - { - return TRUE; - } - - return FALSE; -} - - -/*****************************************************************************/ -/* Return apropos cursor for create object mode. */ -/*****************************************************************************/ -GdkCursor * -gl_view_barcode_get_create_cursor (void) -{ - GdkCursor *cursor = NULL; - GdkPixmap *pixmap_data, *pixmap_mask; - GdkColor fg = { 0, 0, 0, 0 }; - GdkColor bg = { 0, 65535, 65535, 65535 }; - - gl_debug (DEBUG_VIEW, "START"); - - pixmap_data = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_barcode_bits, - cursor_barcode_width, - cursor_barcode_height); - pixmap_mask = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_barcode_mask_bits, - cursor_barcode_mask_width, - cursor_barcode_mask_height); - cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, - &bg, cursor_barcode_x_hot, - cursor_barcode_y_hot); - - gl_debug (DEBUG_VIEW, "END"); - - return cursor; -} - -/*****************************************************************************/ -/* Object creation handler: button press event. */ -/*****************************************************************************/ -void -gl_view_barcode_create_button_press_event (glView *view, - gdouble x, - gdouble y) -{ - GObject *object; - glTextNode *text_node; - glColorNode *line_color_node; - - gl_view_unselect_all (view); - - line_color_node = gl_color_node_new_default (); - - object = gl_label_barcode_new (view->label); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - text_node = gl_text_node_new_from_text ("123456789"); - gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node); - line_color_node->color = gl_color_set_opacity (gl_view_get_default_line_color(view), 0.5); - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), - line_color_node); - - gl_color_node_free (&line_color_node); - - view->create_object = GL_LABEL_OBJECT (object); - view->create_x0 = x; - view->create_y0 = y; -} - -/*****************************************************************************/ -/* Object creation handler: motion event. */ -/*****************************************************************************/ -void -gl_view_barcode_create_motion_event (glView *view, - gdouble x, - gdouble y) -{ - gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), x, y); -} - -/*****************************************************************************/ -/* Object creation handler: button relesase event. */ -/*****************************************************************************/ -void -gl_view_barcode_create_button_release_event (glView *view, - gdouble x, - gdouble y) -{ - glColorNode *line_color_node; - - line_color_node = gl_color_node_new_default (); - - gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), x, y); - line_color_node->color = gl_view_get_default_line_color(view); - gl_label_object_set_line_color (GL_LABEL_OBJECT(view->create_object), line_color_node); - gl_color_node_free (&line_color_node); -} - diff --git a/glabels2/src/view-barcode.h b/glabels2/src/view-barcode.h deleted file mode 100644 index 1587f195..00000000 --- a/glabels2/src/view-barcode.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_barcode.h: GLabels label barcode object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __VIEW_BARCODE_H__ -#define __VIEW_BARCODE_H__ - -#include "view-object.h" -#include "label-barcode.h" - -G_BEGIN_DECLS - - -#define GL_TYPE_VIEW_BARCODE (gl_view_barcode_get_type ()) -#define GL_VIEW_BARCODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_BARCODE, glViewBarcode)) -#define GL_VIEW_BARCODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_BARCODE, glViewBarcodeClass)) -#define GL_IS_VIEW_BARCODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_BARCODE)) -#define GL_IS_VIEW_BARCODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_BARCODE)) - -typedef struct _glViewBarcode glViewBarcode; -typedef struct _glViewBarcodeClass glViewBarcodeClass; - -typedef struct _glViewBarcodePrivate glViewBarcodePrivate; - -struct _glViewBarcode { - glViewObject parent_object; - - glViewBarcodePrivate *priv; -}; - -struct _glViewBarcodeClass { - glViewObjectClass parent_class; -}; - - -GType gl_view_barcode_get_type (void) G_GNUC_CONST; - -glViewObject *gl_view_barcode_new (glLabelBarcode *object, - glView *view); - - -/* cursor for creating barcode objects */ -GdkCursor *gl_view_barcode_get_create_cursor (void); - -/* Object creation handlers. */ -void gl_view_barcode_create_button_press_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_barcode_create_motion_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_barcode_create_button_release_event (glView *view, - gdouble x, - gdouble y); - - -G_END_DECLS - -#endif /* __VIEW_BARCODE_H__ */ diff --git a/glabels2/src/view-box.c b/glabels2/src/view-box.c deleted file mode 100644 index 42f39803..00000000 --- a/glabels2/src/view-box.c +++ /dev/null @@ -1,486 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_box.c: GLabels label box object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "view-box.h" - -#include -#include - -#include "color.h" -#include "object-editor.h" -#include "stock.h" - -#include "pixmaps/cursor_box.xbm" -#include "pixmaps/cursor_box_mask.xbm" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glViewBoxPrivate { -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_view_box_finalize (GObject *object); - -static GtkWidget *construct_properties_editor (glViewObject *view_object); - -static void update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object); - -static void update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor); - -static void update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor); - -static gboolean object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y); - - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glViewBox, gl_view_box, GL_TYPE_VIEW_OBJECT); - - -static void -gl_view_box_class_init (glViewBoxClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); - - gl_debug (DEBUG_VIEW, "START"); - - gl_view_box_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_view_box_finalize; - - view_object_class->construct_editor = construct_properties_editor; - view_object_class->object_at = object_at; - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_box_init (glViewBox *view_box) -{ - gl_debug (DEBUG_VIEW, "START"); - - view_box->priv = g_new0 (glViewBoxPrivate, 1); - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_box_finalize (GObject *object) -{ - glViewBox *view_box = GL_VIEW_BOX (object); - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (object && GL_IS_VIEW_BOX (object)); - - g_free (view_box->priv); - - G_OBJECT_CLASS (gl_view_box_parent_class)->finalize (object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* NEW box object view. */ -/*****************************************************************************/ -glViewObject * -gl_view_box_new (glLabelBox *object, - glView *view) -{ - glViewBox *view_box; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_BOX (object), NULL); - g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); - - view_box = g_object_new (gl_view_box_get_type(), NULL); - - gl_view_object_set_object (GL_VIEW_OBJECT(view_box), - GL_LABEL_OBJECT(object), - GL_VIEW_OBJECT_HANDLES_BOX); - gl_view_object_set_view (GL_VIEW_OBJECT(view_box), view); - - gl_debug (DEBUG_VIEW, "END"); - - return GL_VIEW_OBJECT (view_box); -} - -/*****************************************************************************/ -/* Create a properties dialog for a box object. */ -/*****************************************************************************/ -static GtkWidget * -construct_properties_editor (glViewObject *view_object) -{ - GtkWidget *editor; - glViewBox *view_box = (glViewBox *)view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - object = gl_view_object_get_object (GL_VIEW_OBJECT(view_box)); - - /* Build editor. */ - editor = gl_object_editor_new (GL_STOCK_BOX, _("Box object properties"), - object->parent, - GL_OBJECT_EDITOR_SHADOW_PAGE, - GL_OBJECT_EDITOR_POSITION_PAGE, - GL_OBJECT_EDITOR_SIZE_PAGE, - GL_OBJECT_EDITOR_FILL_PAGE, - GL_OBJECT_EDITOR_LINE_PAGE, - 0); - - /* Update */ - update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); - update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); - - /* Connect signals. */ - g_signal_connect (G_OBJECT (editor), "changed", - G_CALLBACK(update_object_from_editor_cb), object); - g_signal_connect (G_OBJECT (object), "changed", - G_CALLBACK (update_editor_from_object_cb), editor); - g_signal_connect (G_OBJECT (object), "moved", - G_CALLBACK (update_editor_from_move_cb), editor); - - gl_debug (DEBUG_VIEW, "END"); - - return editor; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. editor "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object) -{ - gdouble x, y, w, h; - glColorNode *line_color_node; - gdouble line_width; - glColorNode *fill_color_node; - gboolean shadow_state; - gdouble shadow_x, shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - - - gl_debug (DEBUG_VIEW, "START"); - - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_object_editor_get_position (editor, &x, &y); - gl_label_object_set_position (object, x, y); - - gl_object_editor_get_size (editor, &w, &h); - gl_label_object_set_size (object, w, h); - - fill_color_node = gl_object_editor_get_fill_color (editor); - gl_label_object_set_fill_color (object, fill_color_node); - gl_color_node_free (&fill_color_node); - - line_color_node = gl_object_editor_get_line_color (editor); - gl_label_object_set_line_color (object, line_color_node); - gl_color_node_free (&line_color_node); - - line_width = gl_object_editor_get_line_width (editor); - gl_label_object_set_line_width (object, line_width); - - shadow_state = gl_object_editor_get_shadow_state (editor); - gl_label_object_set_shadow_state (object, shadow_state); - - gl_object_editor_get_shadow_offset (editor, &shadow_x, &shadow_y); - gl_label_object_set_shadow_offset (object, shadow_x, shadow_y); - - shadow_color_node = gl_object_editor_get_shadow_color (editor); - gl_label_object_set_shadow_color (object, shadow_color_node); - gl_color_node_free (&shadow_color_node); - - shadow_opacity = gl_object_editor_get_shadow_opacity (editor); - gl_label_object_set_shadow_opacity (object, shadow_opacity); - - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor) -{ - gdouble w, h; - glColorNode *line_color_node; - gdouble line_width; - glColorNode *fill_color_node; - gboolean shadow_state; - gdouble shadow_x, shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - glMerge *merge; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_size (object, &w, &h); - gl_object_editor_set_size (editor, w, h); - merge = gl_label_get_merge (GL_LABEL(object->parent)); - - fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object)); - gl_object_editor_set_fill_color (editor, (merge != NULL), fill_color_node); - gl_color_node_free (&fill_color_node); - - line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); - gl_object_editor_set_line_color (editor, (merge != NULL), line_color_node); - gl_color_node_free (&line_color_node); - - line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); - gl_object_editor_set_line_width (editor, line_width); - - shadow_state = gl_label_object_get_shadow_state (object); - gl_object_editor_set_shadow_state (editor, shadow_state); - - gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); - gl_object_editor_set_shadow_offset (editor, shadow_x, shadow_y); - - shadow_color_node = gl_label_object_get_shadow_color (object); - gl_object_editor_set_shadow_color (editor, (merge != NULL), shadow_color_node); - gl_color_node_free (&shadow_color_node); - - shadow_opacity = gl_label_object_get_shadow_opacity (object); - gl_object_editor_set_shadow_opacity (editor, shadow_opacity); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "moved" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor) -{ - gdouble x, y; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_position (object, &x, &y); - gl_object_editor_set_position (editor, x, y); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Is object at (x,y)? */ -/*****************************************************************************/ -static gboolean -object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y) -{ - glLabelObject *object; - gdouble w, h; - gdouble line_width; - - object = gl_view_object_get_object (view_object); - - gl_label_object_get_size (object, &w, &h); - - cairo_rectangle (cr, 0.0, 0.0, w, h); - - if (cairo_in_fill (cr, x, y)) - { - return TRUE; - } - - line_width = gl_label_object_get_line_width (object); - cairo_set_line_width (cr, line_width); - if (cairo_in_stroke (cr, x, y)) - { - return TRUE; - } - - return FALSE; -} - - -/*****************************************************************************/ -/* Return apropos cursor for create object mode. */ -/*****************************************************************************/ -GdkCursor * -gl_view_box_get_create_cursor (void) -{ - GdkCursor *cursor = NULL; - GdkPixmap *pixmap_data, *pixmap_mask; - GdkColor fg = { 0, 0, 0, 0 }; - GdkColor bg = { 0, 65535, 65535, 65535 }; - - gl_debug (DEBUG_VIEW, "START"); - - pixmap_data = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_box_bits, - cursor_box_width, - cursor_box_height); - pixmap_mask = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_box_mask_bits, - cursor_box_mask_width, - cursor_box_mask_height); - cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, - &bg, cursor_box_x_hot, - cursor_box_y_hot); - - gl_debug (DEBUG_VIEW, "END"); - - return cursor; -} - -/*****************************************************************************/ -/* Object creation handler: button press event. */ -/*****************************************************************************/ -void -gl_view_box_create_button_press_event (glView *view, - gdouble x, - gdouble y) -{ - GObject *object; - glColorNode *fill_color_node; - glColorNode *line_color_node; - - gl_view_unselect_all (view); - - fill_color_node = gl_color_node_new_default (); - line_color_node = gl_color_node_new_default (); - - object = gl_label_box_new (view->label); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - gl_label_object_set_size (GL_LABEL_OBJECT(object), 0.0, 0.0); - line_color_node->color = gl_color_set_opacity (gl_view_get_default_line_color(view), 0.5); - fill_color_node->color = gl_color_set_opacity (gl_view_get_default_fill_color(view), 0.5); - gl_label_object_set_line_width (GL_LABEL_OBJECT(object), - gl_view_get_default_line_width(view)); - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), - line_color_node); - gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), - fill_color_node); - - gl_color_node_free (&fill_color_node); - gl_color_node_free (&line_color_node); - - view->create_object = GL_LABEL_OBJECT (object); - view->create_x0 = x; - view->create_y0 = y; -} - -/*****************************************************************************/ -/* Object creation handler: motion event. */ -/*****************************************************************************/ -void -gl_view_box_create_motion_event (glView *view, - gdouble x, - gdouble y) -{ - gdouble w, h; - - gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), - MIN (x, view->create_x0), MIN (y, view->create_y0)); - w = MAX (x, view->create_x0) - MIN (x, view->create_x0); - h = MAX (y, view->create_y0) - MIN (y, view->create_y0); - gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); -} - -/*****************************************************************************/ -/* Object creation handler: button relesase event. */ -/*****************************************************************************/ -void -gl_view_box_create_button_release_event (glView *view, - gdouble x, - gdouble y) -{ - glColorNode *fill_color_node; - glColorNode *line_color_node; - gdouble w, h; - - fill_color_node = gl_color_node_new_default (); - line_color_node = gl_color_node_new_default (); - - if ((view->create_x0 == x) && (view->create_y0 == y)) { - x = view->create_x0 + 36.0; - y = view->create_y0 + 36.0; - } - gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), - MIN (x, view->create_x0), MIN (y, view->create_y0)); - w = MAX (x, view->create_x0) - MIN (x, view->create_x0); - h = MAX (y, view->create_y0) - MIN (y, view->create_y0); - gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); - line_color_node->color = gl_view_get_default_line_color(view); - gl_label_object_set_line_color (GL_LABEL_OBJECT(view->create_object), line_color_node); - fill_color_node->color = gl_view_get_default_fill_color(view); - gl_label_object_set_fill_color (GL_LABEL_OBJECT(view->create_object), fill_color_node); - gl_color_node_free (&fill_color_node); - gl_color_node_free (&line_color_node); -} - diff --git a/glabels2/src/view-box.h b/glabels2/src/view-box.h deleted file mode 100644 index f2ebb058..00000000 --- a/glabels2/src/view-box.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_box.h: GLabels label box object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __VIEW_BOX_H__ -#define __VIEW_BOX_H__ - -#include "view-object.h" -#include "label-box.h" - -G_BEGIN_DECLS - - -#define GL_TYPE_VIEW_BOX (gl_view_box_get_type ()) -#define GL_VIEW_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_BOX, glViewBox)) -#define GL_VIEW_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_BOX, glViewBoxClass)) -#define GL_IS_VIEW_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_BOX)) -#define GL_IS_VIEW_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_BOX)) - -typedef struct _glViewBox glViewBox; -typedef struct _glViewBoxClass glViewBoxClass; - -typedef struct _glViewBoxPrivate glViewBoxPrivate; - -struct _glViewBox { - glViewObject parent_object; - - glViewBoxPrivate *priv; -}; - -struct _glViewBoxClass { - glViewObjectClass parent_class; -}; - - -GType gl_view_box_get_type (void) G_GNUC_CONST; - -glViewObject *gl_view_box_new (glLabelBox *object, - glView *view); - - -/* cursor for creating box objects */ -GdkCursor *gl_view_box_get_create_cursor (void); - -/* Object creation handlers. */ -void gl_view_box_create_button_press_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_box_create_motion_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_box_create_button_release_event (glView *view, - gdouble x, - gdouble y); - - -G_END_DECLS - -#endif /* __VIEW_BOX_H__ */ diff --git a/glabels2/src/view-ellipse.c b/glabels2/src/view-ellipse.c deleted file mode 100644 index 85474704..00000000 --- a/glabels2/src/view-ellipse.c +++ /dev/null @@ -1,486 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_ellipse.c: GLabels label ellipse object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "view-ellipse.h" - -#include -#include -#include - -#include "cairo-ellipse-path.h" -#include "color.h" -#include "object-editor.h" -#include "stock.h" - -#include "pixmaps/cursor_ellipse.xbm" -#include "pixmaps/cursor_ellipse_mask.xbm" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glViewEllipsePrivate { -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_view_ellipse_finalize (GObject *object); - -static GtkWidget *construct_properties_editor (glViewObject *view_object); - -static void update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object); - -static void update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor); - -static void update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor); - -static gboolean object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y); - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glViewEllipse, gl_view_ellipse, GL_TYPE_VIEW_OBJECT); - - -static void -gl_view_ellipse_class_init (glViewEllipseClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); - - gl_debug (DEBUG_VIEW, "START"); - - gl_view_ellipse_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_view_ellipse_finalize; - - view_object_class->construct_editor = construct_properties_editor; - view_object_class->object_at = object_at; - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_ellipse_init (glViewEllipse *view_ellipse) -{ - gl_debug (DEBUG_VIEW, "START"); - - view_ellipse->priv = g_new0 (glViewEllipsePrivate, 1); - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_ellipse_finalize (GObject *object) -{ - glViewEllipse *view_ellipse = GL_VIEW_ELLIPSE (object); - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (object && GL_IS_VIEW_ELLIPSE (object)); - - g_free (view_ellipse->priv); - - G_OBJECT_CLASS (gl_view_ellipse_parent_class)->finalize (object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* NEW ellipse object view. */ -/*****************************************************************************/ -glViewObject * -gl_view_ellipse_new (glLabelEllipse *object, - glView *view) -{ - glViewEllipse *view_ellipse; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_ELLIPSE (object), NULL); - g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); - - view_ellipse = g_object_new (gl_view_ellipse_get_type(), NULL); - - gl_view_object_set_object (GL_VIEW_OBJECT(view_ellipse), - GL_LABEL_OBJECT(object), - GL_VIEW_OBJECT_HANDLES_BOX); - gl_view_object_set_view (GL_VIEW_OBJECT(view_ellipse), view); - - gl_debug (DEBUG_VIEW, "END"); - - return GL_VIEW_OBJECT (view_ellipse); -} - -/*****************************************************************************/ -/* Create a properties dialog for a ellipse object. */ -/*****************************************************************************/ -static GtkWidget * -construct_properties_editor (glViewObject *view_object) -{ - GtkWidget *editor; - glViewEllipse *view_ellipse = (glViewEllipse *)view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - object = gl_view_object_get_object (GL_VIEW_OBJECT(view_ellipse)); - - /* Build editor. */ - editor = gl_object_editor_new (GL_STOCK_ELLIPSE, _("Ellipse object properties"), - object->parent, - GL_OBJECT_EDITOR_SHADOW_PAGE, - GL_OBJECT_EDITOR_POSITION_PAGE, - GL_OBJECT_EDITOR_SIZE_PAGE, - GL_OBJECT_EDITOR_FILL_PAGE, - GL_OBJECT_EDITOR_LINE_PAGE, - 0); - - /* Update */ - update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); - update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); - - /* Connect signals. */ - g_signal_connect (G_OBJECT (editor), "changed", - G_CALLBACK(update_object_from_editor_cb), object); - g_signal_connect (G_OBJECT (object), "changed", - G_CALLBACK (update_editor_from_object_cb), editor); - g_signal_connect (G_OBJECT (object), "moved", - G_CALLBACK (update_editor_from_move_cb), editor); - - gl_debug (DEBUG_VIEW, "END"); - - return editor; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. editor "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object) -{ - gdouble x, y, w, h; - glColorNode *line_color_node; - gdouble line_width; - glColorNode *fill_color_node; - gboolean shadow_state; - gdouble shadow_x, shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - - - gl_debug (DEBUG_VIEW, "START"); - - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_object_editor_get_position (editor, &x, &y); - gl_label_object_set_position (object, x, y); - - gl_object_editor_get_size (editor, &w, &h); - gl_label_object_set_size (object, w, h); - - fill_color_node = gl_object_editor_get_fill_color (editor); - gl_label_object_set_fill_color (object, fill_color_node); - gl_color_node_free (&fill_color_node); - - line_color_node = gl_object_editor_get_line_color (editor); - gl_label_object_set_line_color (object, line_color_node); - gl_color_node_free (&line_color_node); - - line_width = gl_object_editor_get_line_width (editor); - gl_label_object_set_line_width (object, line_width); - - shadow_state = gl_object_editor_get_shadow_state (editor); - gl_label_object_set_shadow_state (object, shadow_state); - - gl_object_editor_get_shadow_offset (editor, &shadow_x, &shadow_y); - gl_label_object_set_shadow_offset (object, shadow_x, shadow_y); - - shadow_color_node = gl_object_editor_get_shadow_color (editor); - gl_label_object_set_shadow_color (object, shadow_color_node); - gl_color_node_free (&shadow_color_node); - - shadow_opacity = gl_object_editor_get_shadow_opacity (editor); - gl_label_object_set_shadow_opacity (object, shadow_opacity); - - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor) -{ - gdouble w, h; - glColorNode *line_color_node; - gdouble line_width; - glColorNode *fill_color_node; - gboolean shadow_state; - gdouble shadow_x, shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - glMerge *merge; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_size (object, &w, &h); - gl_object_editor_set_size (editor, w, h); - merge = gl_label_get_merge (GL_LABEL(object->parent)); - - fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object)); - gl_object_editor_set_fill_color (editor, (merge != NULL), fill_color_node); - gl_color_node_free (&fill_color_node); - - line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); - gl_object_editor_set_line_color (editor, (merge != NULL), line_color_node); - gl_color_node_free (&line_color_node); - - line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); - gl_object_editor_set_line_width (editor, line_width); - - shadow_state = gl_label_object_get_shadow_state (object); - gl_object_editor_set_shadow_state (editor, shadow_state); - - gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); - gl_object_editor_set_shadow_offset (editor, shadow_x, shadow_y); - - shadow_color_node = gl_label_object_get_shadow_color (object); - gl_object_editor_set_shadow_color (editor, (merge != NULL), shadow_color_node); - gl_color_node_free (&shadow_color_node); - - shadow_opacity = gl_label_object_get_shadow_opacity (object); - gl_object_editor_set_shadow_opacity (editor, shadow_opacity); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "moved" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor) -{ - gdouble x, y; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_position (object, &x, &y); - gl_object_editor_set_position (editor, x, y); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Is object at (x,y)? */ -/*****************************************************************************/ -static gboolean -object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y) -{ - glLabelObject *object; - gdouble w, h; - gdouble line_width; - - object = gl_view_object_get_object (view_object); - - gl_label_object_get_size (object, &w, &h); - - gl_cairo_ellipse_path (cr, w/2, h/2); - - if (cairo_in_fill (cr, x, y)) - { - return TRUE; - } - - line_width = gl_label_object_get_line_width (object); - cairo_set_line_width (cr, line_width); - if (cairo_in_stroke (cr, x, y)) - { - return TRUE; - } - - return FALSE; -} - - -/*****************************************************************************/ -/* Return apropos cursor for create object mode. */ -/*****************************************************************************/ -GdkCursor * -gl_view_ellipse_get_create_cursor (void) -{ - GdkCursor *cursor = NULL; - GdkPixmap *pixmap_data, *pixmap_mask; - GdkColor fg = { 0, 0, 0, 0 }; - GdkColor bg = { 0, 65535, 65535, 65535 }; - - gl_debug (DEBUG_VIEW, "START"); - - pixmap_data = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_ellipse_bits, - cursor_ellipse_width, - cursor_ellipse_height); - pixmap_mask = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_ellipse_mask_bits, - cursor_ellipse_mask_width, - cursor_ellipse_mask_height); - cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, - &bg, cursor_ellipse_x_hot, - cursor_ellipse_y_hot); - - gl_debug (DEBUG_VIEW, "END"); - - return cursor; -} - -/*****************************************************************************/ -/* Object creation handler: button press event. */ -/*****************************************************************************/ -void -gl_view_ellipse_create_button_press_event (glView *view, - gdouble x, - gdouble y) -{ - GObject *object; - glColorNode *fill_color_node; - glColorNode *line_color_node; - - gl_view_unselect_all (view); - - fill_color_node = gl_color_node_new_default (); - line_color_node = gl_color_node_new_default (); - - object = gl_label_ellipse_new (view->label); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - gl_label_object_set_size (GL_LABEL_OBJECT(object), 0.0, 0.0); - line_color_node->color = gl_color_set_opacity (gl_view_get_default_line_color(view), 0.5); - fill_color_node->color = gl_color_set_opacity (gl_view_get_default_fill_color(view), 0.5); - gl_label_object_set_line_width (GL_LABEL_OBJECT(object), - gl_view_get_default_line_width(view)); - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), - line_color_node); - gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), - fill_color_node); - - gl_color_node_free (&fill_color_node); - gl_color_node_free (&line_color_node); - - view->create_object = GL_LABEL_OBJECT (object); - view->create_x0 = x; - view->create_y0 = y; -} - -/*****************************************************************************/ -/* Object creation handler: motion event. */ -/*****************************************************************************/ -void -gl_view_ellipse_create_motion_event (glView *view, - gdouble x, - gdouble y) -{ - gdouble w, h; - - gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), - MIN (x, view->create_x0), MIN (y, view->create_y0)); - w = MAX (x, view->create_x0) - MIN (x, view->create_x0); - h = MAX (y, view->create_y0) - MIN (y, view->create_y0); - gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); -} - -/*****************************************************************************/ -/* Object creation handler: button relesase event. */ -/*****************************************************************************/ -void -gl_view_ellipse_create_button_release_event (glView *view, - gdouble x, - gdouble y) -{ - glColorNode *fill_color_node; - glColorNode *line_color_node; - gdouble w, h; - - fill_color_node = gl_color_node_new_default (); - line_color_node = gl_color_node_new_default (); - - if ((view->create_x0 == x) && (view->create_y0 == y)) { - x = view->create_x0 + 36.0; - y = view->create_y0 + 36.0; - } - gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), - MIN (x, view->create_x0), MIN (y, view->create_y0)); - w = MAX (x, view->create_x0) - MIN (x, view->create_x0); - h = MAX (y, view->create_y0) - MIN (y, view->create_y0); - gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); - line_color_node->color = gl_view_get_default_line_color(view); - gl_label_object_set_line_color (GL_LABEL_OBJECT(view->create_object), line_color_node); - fill_color_node->color = gl_view_get_default_fill_color(view); - gl_label_object_set_fill_color (GL_LABEL_OBJECT(view->create_object), fill_color_node); - gl_color_node_free (&fill_color_node); - gl_color_node_free (&line_color_node); -} - diff --git a/glabels2/src/view-ellipse.h b/glabels2/src/view-ellipse.h deleted file mode 100644 index b6d6aae2..00000000 --- a/glabels2/src/view-ellipse.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_ellipse.h: GLabels label ellipse object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __VIEW_ELLIPSE_H__ -#define __VIEW_ELLIPSE_H__ - -#include "view-object.h" -#include "label-ellipse.h" - -G_BEGIN_DECLS - - -#define GL_TYPE_VIEW_ELLIPSE (gl_view_ellipse_get_type ()) -#define GL_VIEW_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_ELLIPSE, glViewEllipse)) -#define GL_VIEW_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_ELLIPSE, glViewEllipseClass)) -#define GL_IS_VIEW_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_ELLIPSE)) -#define GL_IS_VIEW_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_ELLIPSE)) - -typedef struct _glViewEllipse glViewEllipse; -typedef struct _glViewEllipseClass glViewEllipseClass; - -typedef struct _glViewEllipsePrivate glViewEllipsePrivate; - -struct _glViewEllipse { - glViewObject parent_object; - - glViewEllipsePrivate *priv; -}; - -struct _glViewEllipseClass { - glViewObjectClass parent_class; -}; - - -GType gl_view_ellipse_get_type (void) G_GNUC_CONST; - -glViewObject *gl_view_ellipse_new (glLabelEllipse *object, - glView *view); - - -/* cursor for creating ellipse objects */ -GdkCursor *gl_view_ellipse_get_create_cursor (void); - -/* Object creation handlers. */ -void gl_view_ellipse_create_button_press_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_ellipse_create_motion_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_ellipse_create_button_release_event (glView *view, - gdouble x, - gdouble y); - - -G_END_DECLS - -#endif /* __VIEW_ELLIPSE_H__ */ diff --git a/glabels2/src/view-image.c b/glabels2/src/view-image.c deleted file mode 100644 index 7612284d..00000000 --- a/glabels2/src/view-image.c +++ /dev/null @@ -1,420 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_image.c: GLabels label image object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "view-image.h" - -#include -#include - -#include "color.h" -#include "object-editor.h" -#include "stock.h" - -#include "pixmaps/cursor_image.xbm" -#include "pixmaps/cursor_image_mask.xbm" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glViewImagePrivate { -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_view_image_finalize (GObject *object); - -static GtkWidget *construct_properties_editor (glViewObject *view_object); - -static void update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object); - -static void update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor); - -static void update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor); - -static gboolean object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y); - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glViewImage, gl_view_image, GL_TYPE_VIEW_OBJECT); - - -static void -gl_view_image_class_init (glViewImageClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); - - gl_debug (DEBUG_VIEW, "START"); - - gl_view_image_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_view_image_finalize; - - view_object_class->construct_editor = construct_properties_editor; - view_object_class->object_at = object_at; - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_image_init (glViewImage *view_image) -{ - gl_debug (DEBUG_VIEW, "START"); - - view_image->priv = g_new0 (glViewImagePrivate, 1); - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_image_finalize (GObject *object) -{ - glViewImage *view_image = GL_VIEW_IMAGE (object); - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (object && GL_IS_VIEW_IMAGE (object)); - - g_free (view_image->priv); - - G_OBJECT_CLASS (gl_view_image_parent_class)->finalize (object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* NEW image object view. */ -/*****************************************************************************/ -glViewObject * -gl_view_image_new (glLabelImage *object, - glView *view) -{ - glViewImage *view_image; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_IMAGE (object), NULL); - g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); - - view_image = g_object_new (gl_view_image_get_type(), NULL); - - gl_view_object_set_object (GL_VIEW_OBJECT(view_image), - GL_LABEL_OBJECT(object), - GL_VIEW_OBJECT_HANDLES_BOX); - gl_view_object_set_view (GL_VIEW_OBJECT(view_image), view); - - gl_debug (DEBUG_VIEW, "END"); - - return GL_VIEW_OBJECT (view_image); -} - -/*****************************************************************************/ -/* Create a properties dialog for a image object. */ -/*****************************************************************************/ -static GtkWidget * -construct_properties_editor (glViewObject *view_object) -{ - GtkWidget *editor; - glViewImage *view_image = (glViewImage *)view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - object = gl_view_object_get_object (GL_VIEW_OBJECT(view_image)); - - /* Build editor. */ - editor = gl_object_editor_new (GL_STOCK_IMAGE, _("Image object properties"), - object->parent, - GL_OBJECT_EDITOR_POSITION_PAGE, - GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE, - GL_OBJECT_EDITOR_IMAGE_PAGE, - 0); - - /* Update */ - update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); - update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); - - /* Connect signals. */ - g_signal_connect (G_OBJECT (editor), "changed", - G_CALLBACK(update_object_from_editor_cb), object); - g_signal_connect (G_OBJECT (object), "changed", - G_CALLBACK (update_editor_from_object_cb), editor); - g_signal_connect (G_OBJECT (object), "moved", - G_CALLBACK (update_editor_from_move_cb), editor); - - gl_debug (DEBUG_VIEW, "END"); - - return editor; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. editor "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object) -{ - gdouble x, y, w, h; - glTextNode *filename; - const GdkPixbuf *pixbuf; - gdouble image_w, image_h; - gdouble new_w, new_h; - - gl_debug (DEBUG_VIEW, "START"); - - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - - gl_object_editor_get_position (editor, &x, &y); - gl_label_object_set_position (object, x, y); - - gl_object_editor_get_size (editor, &w, &h); - gl_label_object_set_size (object, w, h); - - filename = gl_object_editor_get_image (editor); - gl_label_image_set_filename (GL_LABEL_IMAGE(object), filename); - gl_text_node_free (&filename); - - /* Setting filename may have modified the size. */ - gl_label_object_get_size (object, &new_w, &new_h); - if ( (new_w != w) || (new_h != h) ) - { - gl_object_editor_set_size (editor, new_w, new_h); - } - - /* It may also have a new base size. */ - pixbuf = gl_label_image_get_pixbuf (GL_LABEL_IMAGE(object), NULL); - image_w = gdk_pixbuf_get_width (pixbuf); - image_h = gdk_pixbuf_get_height (pixbuf); - gl_object_editor_set_base_size (editor, image_w, image_h); - - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor) -{ - gdouble w, h; - const GdkPixbuf *pixbuf; - gdouble image_w, image_h; - glTextNode *filename; - glMerge *merge; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_size (object, &w, &h); - gl_object_editor_set_size (editor, w, h); - - pixbuf = gl_label_image_get_pixbuf (GL_LABEL_IMAGE(object), NULL); - image_w = gdk_pixbuf_get_width (pixbuf); - image_h = gdk_pixbuf_get_height (pixbuf); - gl_object_editor_set_base_size (editor, image_w, image_h); - - filename = gl_label_image_get_filename (GL_LABEL_IMAGE(object)); - merge = gl_label_get_merge (GL_LABEL(object->parent)); - if ( filename != NULL ) { - gl_object_editor_set_image (editor, (merge != NULL), filename); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "moved" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor) -{ - gdouble x, y; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_position (object, &x, &y); - gl_object_editor_set_position (editor, x, y); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Is object at (x,y)? */ -/*****************************************************************************/ -static gboolean -object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y) -{ - glLabelObject *object; - gdouble w, h; - - object = gl_view_object_get_object (view_object); - - gl_label_object_get_size (object, &w, &h); - - cairo_rectangle (cr, 0.0, 0.0, w, h); - - if (cairo_in_fill (cr, x, y)) - { - return TRUE; - } - - return FALSE; -} - - -/*****************************************************************************/ -/* Return apropos cursor for create object mode. */ -/*****************************************************************************/ -GdkCursor * -gl_view_image_get_create_cursor (void) -{ - GdkCursor *cursor = NULL; - GdkPixmap *pixmap_data, *pixmap_mask; - GdkColor fg = { 0, 0, 0, 0 }; - GdkColor bg = { 0, 65535, 65535, 65535 }; - - gl_debug (DEBUG_VIEW, "START"); - - pixmap_data = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_image_bits, - cursor_image_width, - cursor_image_height); - pixmap_mask = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_image_mask_bits, - cursor_image_mask_width, - cursor_image_mask_height); - cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, - &bg, cursor_image_x_hot, - cursor_image_y_hot); - - gl_debug (DEBUG_VIEW, "END"); - - return cursor; -} - -/*****************************************************************************/ -/* Object creation handler: button press event. */ -/*****************************************************************************/ -void -gl_view_image_create_button_press_event (glView *view, - gdouble x, - gdouble y) -{ - GObject *object; - - gl_view_unselect_all (view); - - object = gl_label_image_new (view->label); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - gl_label_object_set_size (GL_LABEL_OBJECT(object), 0.0, 0.0); - - view->create_object = GL_LABEL_OBJECT (object); - view->create_x0 = x; - view->create_y0 = y; -} - -/*****************************************************************************/ -/* Object creation handler: motion event. */ -/*****************************************************************************/ -void -gl_view_image_create_motion_event (glView *view, - gdouble x, - gdouble y) -{ - gdouble w, h; - - gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), - MIN (x, view->create_x0), MIN (y, view->create_y0)); - w = MAX (x, view->create_x0) - MIN (x, view->create_x0); - h = MAX (y, view->create_y0) - MIN (y, view->create_y0); - gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); -} - -/*****************************************************************************/ -/* Object creation handler: button relesase event. */ -/*****************************************************************************/ -void -gl_view_image_create_button_release_event (glView *view, - gdouble x, - gdouble y) -{ - gdouble w, h; - - if ((view->create_x0 == x) && (view->create_y0 == y)) { - x = view->create_x0 + 36.0; - y = view->create_y0 + 36.0; - } - gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), - MIN (x, view->create_x0), MIN (y, view->create_y0)); - w = MAX (x, view->create_x0) - MIN (x, view->create_x0); - h = MAX (y, view->create_y0) - MIN (y, view->create_y0); - gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); -} - diff --git a/glabels2/src/view-image.h b/glabels2/src/view-image.h deleted file mode 100644 index 7bb3ce10..00000000 --- a/glabels2/src/view-image.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_image.h: GLabels label image object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __VIEW_IMAGE_H__ -#define __VIEW_IMAGE_H__ - -#include "view-object.h" -#include "label-image.h" - -G_BEGIN_DECLS - - -#define GL_TYPE_VIEW_IMAGE (gl_view_image_get_type ()) -#define GL_VIEW_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_IMAGE, glViewImage)) -#define GL_VIEW_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_IMAGE, glViewImageClass)) -#define GL_IS_VIEW_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_IMAGE)) -#define GL_IS_VIEW_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_IMAGE)) - -typedef struct _glViewImage glViewImage; -typedef struct _glViewImageClass glViewImageClass; - -typedef struct _glViewImagePrivate glViewImagePrivate; - -struct _glViewImage { - glViewObject parent_object; - - glViewImagePrivate *priv; -}; - -struct _glViewImageClass { - glViewObjectClass parent_class; -}; - - -GType gl_view_image_get_type (void) G_GNUC_CONST; - -glViewObject *gl_view_image_new (glLabelImage *object, - glView *view); - - -/* cursor for creating image objects */ -GdkCursor *gl_view_image_get_create_cursor (void); - -/* Object creation handlers. */ -void gl_view_image_create_button_press_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_image_create_motion_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_image_create_button_release_event (glView *view, - gdouble x, - gdouble y); - - -G_END_DECLS - -#endif /* __VIEW_IMAGE_H__ */ diff --git a/glabels2/src/view-line.c b/glabels2/src/view-line.c deleted file mode 100644 index 12f29a41..00000000 --- a/glabels2/src/view-line.c +++ /dev/null @@ -1,455 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_line.c: GLabels label line object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "view-line.h" - -#include -#include - -#include "color.h" -#include "object-editor.h" -#include "stock.h" - -#include "pixmaps/cursor_line.xbm" -#include "pixmaps/cursor_line_mask.xbm" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glViewLinePrivate { -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_view_line_finalize (GObject *object); - -static GtkWidget *construct_properties_editor (glViewObject *view_object); - -static void update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object); - -static void update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor); - -static void update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor); - -static gboolean object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y); - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glViewLine, gl_view_line, GL_TYPE_VIEW_OBJECT); - - -static void -gl_view_line_class_init (glViewLineClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); - - gl_debug (DEBUG_VIEW, "START"); - - gl_view_line_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_view_line_finalize; - - view_object_class->construct_editor = construct_properties_editor; - view_object_class->object_at = object_at; - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_line_init (glViewLine *view_line) -{ - gl_debug (DEBUG_VIEW, "START"); - - view_line->priv = g_new0 (glViewLinePrivate, 1); - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_line_finalize (GObject *object) -{ - glViewLine *view_line = GL_VIEW_LINE (object); - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (object && GL_IS_VIEW_LINE (object)); - - g_free (view_line->priv); - - G_OBJECT_CLASS (gl_view_line_parent_class)->finalize (object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* NEW line object view. */ -/*****************************************************************************/ -glViewObject * -gl_view_line_new (glLabelLine *object, - glView *view) -{ - glViewLine *view_line; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_LINE (object), NULL); - g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); - - view_line = g_object_new (gl_view_line_get_type(), NULL); - - gl_view_object_set_object (GL_VIEW_OBJECT(view_line), - GL_LABEL_OBJECT(object), - GL_VIEW_OBJECT_HANDLES_LINE); - gl_view_object_set_view (GL_VIEW_OBJECT(view_line), view); - - gl_debug (DEBUG_VIEW, "END"); - - return GL_VIEW_OBJECT (view_line); -} - -/*****************************************************************************/ -/* Create a properties dialog for a line object. */ -/*****************************************************************************/ -static GtkWidget * -construct_properties_editor (glViewObject *view_object) -{ - GtkWidget *editor; - glViewLine *view_line = (glViewLine *)view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - object = gl_view_object_get_object (GL_VIEW_OBJECT(view_line)); - - /* Build editor. */ - editor = gl_object_editor_new (GL_STOCK_LINE, _("Line object properties"), - object->parent, - GL_OBJECT_EDITOR_SHADOW_PAGE, - GL_OBJECT_EDITOR_POSITION_PAGE, - GL_OBJECT_EDITOR_SIZE_LINE_PAGE, - GL_OBJECT_EDITOR_LINE_PAGE, - 0); - - /* Update */ - update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); - update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); - - /* Connect signals. */ - g_signal_connect (G_OBJECT (editor), "changed", - G_CALLBACK(update_object_from_editor_cb), object); - g_signal_connect (G_OBJECT (object), "changed", - G_CALLBACK (update_editor_from_object_cb), editor); - g_signal_connect (G_OBJECT (object), "moved", - G_CALLBACK (update_editor_from_move_cb), editor); - - gl_debug (DEBUG_VIEW, "END"); - - return editor; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. editor "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object) -{ - gdouble x, y, w, h; - glColorNode *line_color_node; - gdouble line_width; - gboolean shadow_state; - gdouble shadow_x, shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - - - gl_debug (DEBUG_VIEW, "START"); - - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_object_editor_get_position (editor, &x, &y); - gl_label_object_set_position (object, x, y); - - gl_object_editor_get_lsize (editor, &w, &h); - gl_label_object_set_size (object, w, h); - - line_color_node = gl_object_editor_get_line_color (editor); - gl_label_object_set_line_color (object, line_color_node); - gl_color_node_free (&line_color_node); - - line_width = gl_object_editor_get_line_width (editor); - gl_label_object_set_line_width (object, line_width); - - shadow_state = gl_object_editor_get_shadow_state (editor); - gl_label_object_set_shadow_state (object, shadow_state); - - gl_object_editor_get_shadow_offset (editor, &shadow_x, &shadow_y); - gl_label_object_set_shadow_offset (object, shadow_x, shadow_y); - - shadow_color_node = gl_object_editor_get_shadow_color (editor); - gl_label_object_set_shadow_color (object, shadow_color_node); - gl_color_node_free (&shadow_color_node); - - shadow_opacity = gl_object_editor_get_shadow_opacity (editor); - gl_label_object_set_shadow_opacity (object, shadow_opacity); - - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor) -{ - gdouble w, h; - glColorNode *line_color_node; - gdouble line_width; - gboolean shadow_state; - gdouble shadow_x, shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - glMerge *merge; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_size (object, &w, &h); - gl_object_editor_set_lsize (editor, w, h); - merge = gl_label_get_merge (GL_LABEL(object->parent)); - - line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); - gl_object_editor_set_line_color (editor, (merge != NULL), line_color_node); - gl_color_node_free (&line_color_node); - - line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); - gl_object_editor_set_line_width (editor, line_width); - - shadow_state = gl_label_object_get_shadow_state (object); - gl_object_editor_set_shadow_state (editor, shadow_state); - - gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); - gl_object_editor_set_shadow_offset (editor, shadow_x, shadow_y); - - shadow_color_node = gl_label_object_get_shadow_color (object); - gl_object_editor_set_shadow_color (editor, (merge != NULL), shadow_color_node); - gl_color_node_free (&shadow_color_node); - - shadow_opacity = gl_label_object_get_shadow_opacity (object); - gl_object_editor_set_shadow_opacity (editor, shadow_opacity); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "moved" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor) -{ - gdouble x, y; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_position (object, &x, &y); - gl_object_editor_set_position (editor, x, y); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Is object at (x,y)? */ -/*****************************************************************************/ -static gboolean -object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y) -{ - glLabelObject *object; - gdouble w, h; - gdouble line_width; - - object = gl_view_object_get_object (view_object); - - gl_label_object_get_size (object, &w, &h); - - cairo_move_to (cr, 0.0, 0.0); - cairo_line_to (cr, w, h); - - line_width = gl_label_object_get_line_width (object); - cairo_set_line_width (cr, line_width); - if (cairo_in_stroke (cr, x, y)) - { - return TRUE; - } - - return FALSE; -} - - -/*****************************************************************************/ -/* Return apropos cursor for create object mode. */ -/*****************************************************************************/ -GdkCursor * -gl_view_line_get_create_cursor (void) -{ - GdkCursor *cursor = NULL; - GdkPixmap *pixmap_data, *pixmap_mask; - GdkColor fg = { 0, 0, 0, 0 }; - GdkColor bg = { 0, 65535, 65535, 65535 }; - - gl_debug (DEBUG_VIEW, "START"); - - pixmap_data = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_line_bits, - cursor_line_width, - cursor_line_height); - pixmap_mask = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_line_mask_bits, - cursor_line_mask_width, - cursor_line_mask_height); - cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, - &bg, cursor_line_x_hot, - cursor_line_y_hot); - - gl_debug (DEBUG_VIEW, "END"); - - return cursor; -} - -/*****************************************************************************/ -/* Object creation handler: button press event. */ -/*****************************************************************************/ -void -gl_view_line_create_button_press_event (glView *view, - gdouble x, - gdouble y) -{ - GObject *object; - glColorNode *line_color_node; - - gl_view_unselect_all (view); - - line_color_node = gl_color_node_new_default (); - - object = gl_label_line_new (view->label); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - gl_label_object_set_size (GL_LABEL_OBJECT(object), 0.0, 0.0); - line_color_node->color = gl_color_set_opacity (gl_view_get_default_line_color(view), 0.5); - gl_label_object_set_line_width (GL_LABEL_OBJECT(object), - gl_view_get_default_line_width(view)); - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), - line_color_node); - - gl_color_node_free (&line_color_node); - - view->create_object = GL_LABEL_OBJECT (object); - view->create_x0 = x; - view->create_y0 = y; -} - -/*****************************************************************************/ -/* Object creation handler: motion event. */ -/*****************************************************************************/ -void -gl_view_line_create_motion_event (glView *view, - gdouble x, - gdouble y) -{ - gdouble w, h; - - w = x - view->create_x0; - h = y - view->create_y0; - gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); -} - -/*****************************************************************************/ -/* Object creation handler: button relesase event. */ -/*****************************************************************************/ -void -gl_view_line_create_button_release_event (glView *view, - gdouble x, - gdouble y) -{ - glColorNode *line_color_node; - gdouble w, h; - - line_color_node = gl_color_node_new_default (); - - if ((view->create_x0 == x) && (view->create_y0 == y)) { - x = view->create_x0 + 36.0; - y = view->create_y0 + 36.0; - } - w = x - view->create_x0; - h = y - view->create_y0; - gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); - line_color_node->color = gl_view_get_default_line_color(view); - gl_label_object_set_line_color (GL_LABEL_OBJECT(view->create_object), line_color_node); - gl_color_node_free (&line_color_node); -} - diff --git a/glabels2/src/view-line.h b/glabels2/src/view-line.h deleted file mode 100644 index a938a115..00000000 --- a/glabels2/src/view-line.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_line.h: GLabels label line object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __VIEW_LINE_H__ -#define __VIEW_LINE_H__ - -#include "view-object.h" -#include "label-line.h" - -G_BEGIN_DECLS - - -#define GL_TYPE_VIEW_LINE (gl_view_line_get_type ()) -#define GL_VIEW_LINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_LINE, glViewLine)) -#define GL_VIEW_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_LINE, glViewLineClass)) -#define GL_IS_VIEW_LINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_LINE)) -#define GL_IS_VIEW_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_LINE)) - -typedef struct _glViewLine glViewLine; -typedef struct _glViewLineClass glViewLineClass; - -typedef struct _glViewLinePrivate glViewLinePrivate; - -struct _glViewLine { - glViewObject parent_object; - - glViewLinePrivate *priv; -}; - -struct _glViewLineClass { - glViewObjectClass parent_class; -}; - - -GType gl_view_line_get_type (void) G_GNUC_CONST; - -glViewObject *gl_view_line_new (glLabelLine *object, - glView *view); - - -/* cursor for creating line objects */ -GdkCursor *gl_view_line_get_create_cursor (void); - -/* Object creation handlers. */ -void gl_view_line_create_button_press_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_line_create_motion_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_line_create_button_release_event (glView *view, - gdouble x, - gdouble y); - - -G_END_DECLS - -#endif /* __VIEW_LINE_H__ */ diff --git a/glabels2/src/view-object.c b/glabels2/src/view-object.c deleted file mode 100644 index 394735a3..00000000 --- a/glabels2/src/view-object.c +++ /dev/null @@ -1,765 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_object.c: GLabels label object base class - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "view-object.h" - -#include - -#include "debug.h" - -/*========================================================*/ -/* Private constants and macros. */ -/*========================================================*/ - -#define HANDLE_FILL_RGBA_ARGS 0.0, 0.75, 0.0, 0.4 -#define HANDLE_OUTLINE_RGBA_ARGS 0.0, 0.0, 0.0, 0.8 - -#define HANDLE_OUTLINE_WIDTH_PIXELS 1.0 -#define HANDLE_PIXELS 7 - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glViewObjectPrivate { - - glLabelObject *object; - - glView *view; - glViewObjectHandlesStyle handles_style; - - GtkWidget *property_editor; -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_view_object_finalize (GObject *object); - -static void object_removed_cb (glViewObject *view_object, - glLabelObject *object); - -static void object_top_cb (glViewObject *view_object, - glLabelObject *object); - -static void object_bottom_cb (glViewObject *view_object, - glLabelObject *object); - - - - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glViewObject, gl_view_object, G_TYPE_OBJECT); - -static void -gl_view_object_class_init (glViewObjectClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_VIEW, "START"); - - gl_view_object_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_view_object_finalize; - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_object_init (glViewObject *view_object) -{ - gl_debug (DEBUG_VIEW, "START"); - - view_object->priv = g_new0 (glViewObjectPrivate, 1); - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_object_finalize (GObject *object) -{ - glViewObject *view_object = GL_VIEW_OBJECT (object); - glView *view; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (object && GL_IS_VIEW_OBJECT (object)); - - view = view_object->priv->view; - view->object_list = g_list_remove (view->object_list, object); - view->selected_object_list = - g_list_remove (view->selected_object_list, object); - - g_object_unref (view_object->priv->object); - if (view_object->priv->property_editor) { - gl_debug (DEBUG_VIEW, "Destroy editor"); - g_object_unref (G_OBJECT(view_object->priv->property_editor)); - } - g_free (view_object->priv); - - G_OBJECT_CLASS (gl_view_object_parent_class)->finalize (object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* NEW object view. */ -/*****************************************************************************/ -GObject * -gl_view_object_new (void) -{ - glViewObject *view_object; - - gl_debug (DEBUG_VIEW, "START"); - - view_object = g_object_new (gl_view_object_get_type(), NULL); - - gl_debug (DEBUG_VIEW, "END"); - - return G_OBJECT (view_object); -} - -/*****************************************************************************/ -/* Set parent view to which this object view belongs. */ -/*****************************************************************************/ -void -gl_view_object_set_view (glViewObject *view_object, - glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); - g_return_if_fail (view && GL_IS_VIEW (view)); - - view_object->priv->view = view; - - view->object_list = g_list_append (view->object_list, view_object); - - g_signal_connect_swapped (G_OBJECT (view_object->priv->object), "changed", - G_CALLBACK (gl_view_update), view); - g_signal_connect_swapped (G_OBJECT (view_object->priv->object), "moved", - G_CALLBACK (gl_view_update), view); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Set Label object to follow. */ -/*****************************************************************************/ -void -gl_view_object_set_object (glViewObject *view_object, - glLabelObject *object, - glViewObjectHandlesStyle style) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - view_object->priv->object = g_object_ref (G_OBJECT (object)); - view_object->priv->handles_style = style; - - g_signal_connect_swapped (G_OBJECT (object), "removed", - G_CALLBACK (object_removed_cb), view_object); - g_signal_connect_swapped (G_OBJECT (object), "top", - G_CALLBACK (object_top_cb), view_object); - g_signal_connect_swapped (G_OBJECT (object), "bottom", - G_CALLBACK (object_bottom_cb), view_object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Handle object "removed" signal. */ -/*---------------------------------------------------------------------------*/ -static void -object_removed_cb (glViewObject *view_object, - glLabelObject *object) -{ - glView *view; - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - view = gl_view_object_get_view (view_object); - view->object_list = g_list_remove (view->object_list, view_object); - g_object_unref (G_OBJECT (view_object)); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Handle object "top" signal. */ -/*---------------------------------------------------------------------------*/ -static void -object_top_cb (glViewObject *view_object, - glLabelObject *object) -{ - glView *view; - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - view = gl_view_object_get_view (view_object); - - /* Move to end of list, representing front most object */ - view->object_list = g_list_remove (view->object_list, view_object); - view->object_list = g_list_append (view->object_list, view_object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Handle object "removed" signal. */ -/*---------------------------------------------------------------------------*/ -static void -object_bottom_cb (glViewObject *view_object, - glLabelObject *object) -{ - glView *view; - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - view = gl_view_object_get_view (view_object); - - /* Move to front of list, representing rear most object */ - view->object_list = g_list_remove (view->object_list, view_object); - view->object_list = g_list_prepend (view->object_list, view_object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Return parent view associated with this view. */ -/*****************************************************************************/ -glView * -gl_view_object_get_view (glViewObject *view_object) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object), NULL); - - gl_debug (DEBUG_VIEW, "END"); - - return view_object->priv->view; -} - -/*****************************************************************************/ -/* Return label object that we are following. */ -/*****************************************************************************/ -glLabelObject * -gl_view_object_get_object (glViewObject *view_object) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object), NULL); - - gl_debug (DEBUG_VIEW, "END"); - - return view_object->priv->object; -} - -/*****************************************************************************/ -/* Get property editor. */ -/*****************************************************************************/ -GtkWidget * -gl_view_object_get_editor (glViewObject *view_object) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object), NULL); - - if ( GL_VIEW_OBJECT_GET_CLASS(view_object)->construct_editor != NULL ) { - - if (view_object->priv->property_editor == NULL) { - view_object->priv->property_editor = - GL_VIEW_OBJECT_GET_CLASS(view_object)->construct_editor (view_object); - } - g_signal_connect (G_OBJECT (view_object->priv->property_editor), - "destroy", - G_CALLBACK (gtk_widget_destroyed), - &view_object->priv->property_editor); - - gtk_widget_show (view_object->priv->property_editor); - - } - - - gl_debug (DEBUG_VIEW, "END"); - - return view_object->priv->property_editor; -} - - -/*****************************************************************************/ -/* Select object. */ -/*****************************************************************************/ -void -gl_view_object_select (glViewObject *view_object) -{ - gl_debug (DEBUG_VIEW, "START"); - - gl_view_select_object(view_object->priv->view, view_object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Is object at (x,y)? */ -/*****************************************************************************/ -gboolean -gl_view_object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y) -{ - glLabelObject *object = view_object->priv->object; - gdouble x0, y0; - cairo_matrix_t matrix; - gboolean return_val = FALSE; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object), FALSE); - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); - - gl_label_object_get_position (object, &x0, &y0); - gl_label_object_get_matrix (object, &matrix); - - cairo_save (cr); - cairo_translate (cr, x0, y0); - cairo_transform (cr, &matrix); - - cairo_device_to_user (cr, &x, &y); - - if ( GL_VIEW_OBJECT_GET_CLASS(view_object)->object_at != NULL ) { - - return_val = GL_VIEW_OBJECT_GET_CLASS(view_object)->object_at (view_object, cr, x, y); - - } - - cairo_restore (cr); - - return return_val; - - gl_debug (DEBUG_VIEW, "END"); -} - - -/*--------------------------------------------------------------------------*/ -/* Create handle path */ -/*--------------------------------------------------------------------------*/ -static void -create_handle_path (cairo_t *cr, - glLabelObject *object, - gdouble scale, - gdouble x_handle, - gdouble y_handle) -{ - gl_debug (DEBUG_VIEW, "START"); - - cairo_rectangle (cr, - x_handle - HANDLE_PIXELS/scale/2, y_handle - HANDLE_PIXELS/scale/2, - HANDLE_PIXELS/scale, HANDLE_PIXELS/scale); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Draw object handles */ -/*****************************************************************************/ -void -gl_view_object_draw_handles (glViewObject *view_object, - cairo_t *cr) -{ - glLabelObject *object = view_object->priv->object; - gdouble x0, y0; - cairo_matrix_t matrix; - gdouble scale; - gdouble w, h; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - scale = view_object->priv->view->home_scale * view_object->priv->view->zoom; - - gl_label_object_get_position (object, &x0, &y0); - gl_label_object_get_matrix (object, &matrix); - - gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h); - - cairo_save (cr); - - cairo_translate (cr, x0, y0); - cairo_transform (cr, &matrix); - - switch (view_object->priv->handles_style) - { - case GL_VIEW_OBJECT_HANDLES_BOX: - - /* North */ - cairo_new_path (cr); - create_handle_path (cr, object, scale, w/2, 0); - - /* North East */ - cairo_new_sub_path (cr); - create_handle_path (cr, object, scale, w, 0); - - /* East */ - cairo_new_sub_path (cr); - create_handle_path (cr, object, scale, w, h/2); - - /* South East */ - cairo_new_sub_path (cr); - create_handle_path (cr, object, scale, w, h); - - /* South */ - cairo_new_sub_path (cr); - create_handle_path (cr, object, scale, w/2, h); - - /* South West */ - cairo_new_sub_path (cr); - create_handle_path (cr, object, scale, 0, h); - - /* West */ - cairo_new_sub_path (cr); - create_handle_path (cr, object, scale, 0, h/2); - - /* North West */ - cairo_new_sub_path (cr); - create_handle_path (cr, object, scale, 0, 0); - - break; - - case GL_VIEW_OBJECT_HANDLES_LINE: - /* P1 */ - cairo_new_path (cr); - create_handle_path (cr, object, scale, 0, 0); - - /* P2 */ - cairo_new_sub_path (cr); - create_handle_path (cr, object, scale, w, h); - - break; - } - - cairo_set_source_rgba (cr, HANDLE_FILL_RGBA_ARGS); - cairo_fill_preserve (cr); - - cairo_set_line_width (cr, HANDLE_OUTLINE_WIDTH_PIXELS/scale); - cairo_set_source_rgba (cr, HANDLE_OUTLINE_RGBA_ARGS); - cairo_stroke (cr); - - cairo_restore (cr); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Is there an object handle at (x,y). */ -/*****************************************************************************/ -glViewObjectHandle -gl_view_object_handle_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y) -{ - glLabelObject *object = view_object->priv->object; - gdouble x0, y0; - cairo_matrix_t matrix; - gdouble scale; - gdouble w, h; - glViewObjectHandle handle = GL_VIEW_OBJECT_HANDLE_NONE; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object), handle); - g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), handle); - - scale = view_object->priv->view->home_scale * view_object->priv->view->zoom; - - gl_label_object_get_position (object, &x0, &y0); - gl_label_object_get_matrix (object, &matrix); - - gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h); - - cairo_save (cr); - - cairo_translate (cr, x0, y0); - cairo_transform (cr, &matrix); - - cairo_device_to_user (cr, &x, &y); - - switch (view_object->priv->handles_style) - { - case GL_VIEW_OBJECT_HANDLES_BOX: - - /* South East */ - create_handle_path (cr, object, scale, w, h); - if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_SE; break;} - - /* South West */ - create_handle_path (cr, object, scale, 0, h); - if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_SW; break;} - - /* North East */ - create_handle_path (cr, object, scale, w, 0); - if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_NE; break;} - - /* North West */ - create_handle_path (cr, object, scale, 0, 0); - if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_NW; break;} - - /* East */ - create_handle_path (cr, object, scale, w, h/2); - if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_E; break;} - - /* South */ - create_handle_path (cr, object, scale, w/2, h); - if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_S; break;} - - /* West */ - create_handle_path (cr, object, scale, 0, h/2); - if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_W; break;} - - /* North */ - create_handle_path (cr, object, scale, w/2, 0); - if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_N; break;} - - break; - - case GL_VIEW_OBJECT_HANDLES_LINE: - /* P2 */ - create_handle_path (cr, object, scale, w, h); - if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_P2; break;} - - /* P1 */ - create_handle_path (cr, object, scale, 0, 0); - if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_P1; break;} - - break; - - } - - cairo_restore (cr); - - return handle; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Resize object. */ -/*---------------------------------------------------------------------------*/ -void -gl_view_object_resize_event (glViewObject *view_object, - glViewObjectHandle handle, - gboolean honor_aspect, - cairo_t *cr, - gdouble x, - gdouble y) -{ - glLabelObject *object; - cairo_matrix_t matrix; - gdouble x0, y0, x1, y1, x2, y2; - gdouble w, h; - gdouble dx=0, dy=0; - - gl_debug (DEBUG_VIEW, "x,y world = %g, %g", x, y); - - object = view_object->priv->object; - - /* - * Change to item relative coordinates - */ - cairo_save (cr); - gl_label_object_get_position (object, &x0, &y0); - cairo_translate (cr, x0, y0); - gl_label_object_get_matrix (object, &matrix); - cairo_transform (cr, &matrix); - - /* - * Initialize origin and 2 corners in object relative coordinates. - */ - x0 = 0.0; - y0 = 0.0; - - x1 = 0.0; - y1 = 0.0; - - gl_label_object_get_size (object, &x2, &y2); - - gl_debug (DEBUG_VIEW, "x0,y0 object = %g, %g", x0, y0); - gl_debug (DEBUG_VIEW, "x1,y1 object = %g, %g", x1, y1); - gl_debug (DEBUG_VIEW, "x2,y2 object = %g, %g", x2, y2); - - /* - * Translate x,y into object relative coordinates. - */ - cairo_device_to_user (cr, &x, &y); - - gl_debug (DEBUG_VIEW, "x,y object = %g, %g", x, y); - - /* - * Get new size - */ - switch (handle) - { - - case GL_VIEW_OBJECT_HANDLE_NW: - w = MAX (x2 - x, 0); - h = MAX (y2 - y, 0); - break; - - case GL_VIEW_OBJECT_HANDLE_N: - w = x2 - x1; - h = MAX (y2 - y, 0); - break; - - case GL_VIEW_OBJECT_HANDLE_NE: - w = MAX (x - x1, 0); - h = MAX (y2 - y, 0); - break; - - case GL_VIEW_OBJECT_HANDLE_E: - w = MAX (x - x1, 0); - h = y2 - y1; - break; - - case GL_VIEW_OBJECT_HANDLE_SE: - w = MAX (x - x1, 0); - h = MAX (y - y1, 0); - break; - - case GL_VIEW_OBJECT_HANDLE_S: - w = x2 - x1; - h = MAX (y - y1, 0); - break; - - case GL_VIEW_OBJECT_HANDLE_SW: - w = MAX (x2 - x, 0); - h = MAX (y - y1, 0); - break; - - case GL_VIEW_OBJECT_HANDLE_W: - w = MAX (x2 - x, 0); - h = y2 - y1; - break; - case GL_VIEW_OBJECT_HANDLE_P1: - x1 = x; - y1 = y; - dx = (x2 - x); - dy = (y2 - y); - x0 = x0 + x1; - y0 = y0 + y1; - break; - - case GL_VIEW_OBJECT_HANDLE_P2: - dx = x - x1; - dy = y - y1; - x0 = x0 + x1; - y0 = y0 + y1; - break; - - default: - g_print ("Invalid handle.\n"); /* Should not happen! */ - - } - if ( (handle != GL_VIEW_OBJECT_HANDLE_P1) && (handle != GL_VIEW_OBJECT_HANDLE_P2) ) - { - if ( honor_aspect ) - { - gl_label_object_set_size_honor_aspect (object, w, h); - } - else - { - gl_label_object_set_size (object, w, h); - } - - /* - * Query the new size in case it was constrained. - */ - gl_label_object_get_size (object, &w, &h); - - /* - * Get new position - */ - switch (handle) - { - - case GL_VIEW_OBJECT_HANDLE_NW: - x0 += x2 - w; - y0 += y2 - h; - break; - - case GL_VIEW_OBJECT_HANDLE_N: - case GL_VIEW_OBJECT_HANDLE_NE: - /* x unchanged */ - y0 += y2 - h; - break; - - case GL_VIEW_OBJECT_HANDLE_E: - case GL_VIEW_OBJECT_HANDLE_SE: - case GL_VIEW_OBJECT_HANDLE_S: - /* unchanged */ - break; - - case GL_VIEW_OBJECT_HANDLE_SW: - case GL_VIEW_OBJECT_HANDLE_W: - x0 += x2 - w; - /* y unchanged */ - break; - - default: - g_print ("Invalid handle.\n"); /* Should not happen! */ - } - } - else - { - gl_label_object_set_size (object, dx, dy); - } - - /* - * Put new origin back into world coordinates and set. - */ - cairo_user_to_device (cr, &x0, &y0); - cairo_restore (cr); - cairo_device_to_user (cr, &x0, &y0); - gl_label_object_set_position (object, x0, y0); -} diff --git a/glabels2/src/view-object.h b/glabels2/src/view-object.h deleted file mode 100644 index 2ae9f84f..00000000 --- a/glabels2/src/view-object.h +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_object.h: GLabels canvas item wrapper widget - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __VIEW_OBJECT_H__ -#define __VIEW_OBJECT_H__ - -#include -#include "label-object.h" - -typedef enum { - GL_VIEW_OBJECT_HANDLES_BOX, - GL_VIEW_OBJECT_HANDLES_LINE, -} glViewObjectHandlesStyle; - -typedef enum { - GL_VIEW_OBJECT_HANDLE_NONE = 0, - GL_VIEW_OBJECT_HANDLE_N, - GL_VIEW_OBJECT_HANDLE_E, - GL_VIEW_OBJECT_HANDLE_W, - GL_VIEW_OBJECT_HANDLE_S, - GL_VIEW_OBJECT_HANDLE_NW, - GL_VIEW_OBJECT_HANDLE_NE, - GL_VIEW_OBJECT_HANDLE_SE, - GL_VIEW_OBJECT_HANDLE_SW, - GL_VIEW_OBJECT_HANDLE_P1, - GL_VIEW_OBJECT_HANDLE_P2, -} glViewObjectHandle; - - -#define GL_TYPE_VIEW_OBJECT (gl_view_object_get_type ()) -#define GL_VIEW_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_OBJECT, glViewObject)) -#define GL_VIEW_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_OBJECT, glViewObjectClass)) -#define GL_IS_VIEW_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_OBJECT)) -#define GL_IS_VIEW_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_OBJECT)) -#define GL_VIEW_OBJECT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_VIEW_OBJECT, glViewObjectClass)) - -typedef struct _glViewObject glViewObject; -typedef struct _glViewObjectClass glViewObjectClass; - -typedef struct _glViewObjectPrivate glViewObjectPrivate; - - -#include "view.h" - -#include "cairo.h" - -struct _glViewObject { - GObject parent_object; - - glViewObjectPrivate *priv; -}; - -struct _glViewObjectClass { - GObjectClass parent_class; - - /* - * Methods - */ - - GtkWidget * (*construct_editor) (glViewObject *view_object); - - gboolean (*object_at) (glViewObject *view_object, - cairo_t *cr, - gdouble x_device, - gdouble y_device); -}; - - - - -G_BEGIN_DECLS - -GType gl_view_object_get_type (void) G_GNUC_CONST; - -GObject *gl_view_object_new (void); - - -void gl_view_object_set_view (glViewObject *view_object, - glView *view); - -void gl_view_object_set_object (glViewObject *view_object, - glLabelObject *object, - glViewObjectHandlesStyle style); - -gboolean gl_view_object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y); - -void gl_view_object_draw_handles (glViewObject *view_object, - cairo_t *cr); - -glViewObjectHandle gl_view_object_handle_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y); - -glView *gl_view_object_get_view (glViewObject *view_object); - -glLabelObject *gl_view_object_get_object (glViewObject *view_object); - -GtkWidget *gl_view_object_get_editor (glViewObject *view_object); - -void gl_view_object_select (glViewObject *view_object); - -void gl_view_object_resize_event (glViewObject *view_object, - glViewObjectHandle handle, - gboolean honor_aspect, - cairo_t *cr, - gdouble x, - gdouble y); - - -G_END_DECLS - -#endif /* __VIEW_OBJECT_H__ */ diff --git a/glabels2/src/view-text.c b/glabels2/src/view-text.c deleted file mode 100644 index ca930129..00000000 --- a/glabels2/src/view-text.c +++ /dev/null @@ -1,530 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_text.c: GLabels label text object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -#include "view-text.h" - -#include -#include - -#include "color.h" -#include "object-editor.h" -#include "stock.h" - -#include "pixmaps/cursor_text.xbm" -#include "pixmaps/cursor_text_mask.xbm" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -struct _glViewTextPrivate { -}; - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static void gl_view_text_finalize (GObject *object); - -static GtkWidget *construct_properties_editor (glViewObject *view_object); - -static void update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object); - -static void update_object_from_editor_size_cb (glObjectEditor *editor, - glLabelObject *object); - -static void update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor); - -static void update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor); - -static gboolean object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y); - - - - -/*****************************************************************************/ -/* Boilerplate object stuff. */ -/*****************************************************************************/ -G_DEFINE_TYPE (glViewText, gl_view_text, GL_TYPE_VIEW_OBJECT); - - -static void -gl_view_text_class_init (glViewTextClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); - - gl_debug (DEBUG_VIEW, "START"); - - gl_view_text_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_view_text_finalize; - - view_object_class->construct_editor = construct_properties_editor; - view_object_class->object_at = object_at; - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_text_init (glViewText *view_text) -{ - gl_debug (DEBUG_VIEW, "START"); - - view_text->priv = g_new0 (glViewTextPrivate, 1); - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_text_finalize (GObject *object) -{ - glViewText *view_text = GL_VIEW_TEXT (object); - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (object && GL_IS_VIEW_TEXT (object)); - - g_free (view_text->priv); - - G_OBJECT_CLASS (gl_view_text_parent_class)->finalize (object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* NEW text object view. */ -/*****************************************************************************/ -glViewObject * -gl_view_text_new (glLabelText *object, - glView *view) -{ - glViewText *view_text; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (object && GL_IS_LABEL_TEXT (object), NULL); - g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); - - view_text = g_object_new (gl_view_text_get_type(), NULL); - - gl_view_object_set_object (GL_VIEW_OBJECT(view_text), - GL_LABEL_OBJECT(object), - GL_VIEW_OBJECT_HANDLES_BOX); - gl_view_object_set_view (GL_VIEW_OBJECT(view_text), view); - - gl_debug (DEBUG_VIEW, "END"); - - return GL_VIEW_OBJECT (view_text); -} - -/*****************************************************************************/ -/* Create a properties dialog for a text object. */ -/*****************************************************************************/ -static GtkWidget * -construct_properties_editor (glViewObject *view_object) -{ - GtkWidget *editor; - glViewText *view_text = (glViewText *)view_object; - glLabelObject *object; - GtkTextBuffer *buffer; - - gl_debug (DEBUG_VIEW, "START"); - - object = gl_view_object_get_object (GL_VIEW_OBJECT(view_text)); - - /* Build editor. */ - editor = gl_object_editor_new (GL_STOCK_TEXT, _("Text object properties"), - object->parent, - GL_OBJECT_EDITOR_SHADOW_PAGE, - GL_OBJECT_EDITOR_POSITION_PAGE, - GL_OBJECT_EDITOR_SIZE_PAGE, - GL_OBJECT_EDITOR_TEXT_PAGE, - GL_OBJECT_EDITOR_EDIT_PAGE, - 0); - - buffer = gl_label_text_get_buffer (GL_LABEL_TEXT(object)); - gl_object_editor_set_text_buffer (GL_OBJECT_EDITOR(editor), buffer); - - /* Update */ - update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); - update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); - - /* Connect signals. */ - g_signal_connect (G_OBJECT (editor), "changed", - G_CALLBACK(update_object_from_editor_cb), object); - g_signal_connect (G_OBJECT (editor), "size_changed", - G_CALLBACK(update_object_from_editor_size_cb), object); - g_signal_connect (G_OBJECT (object), "changed", - G_CALLBACK (update_editor_from_object_cb), editor); - g_signal_connect (G_OBJECT (object), "moved", - G_CALLBACK (update_editor_from_move_cb), editor); - - gl_debug (DEBUG_VIEW, "END"); - - return editor; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. editor "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_object_from_editor_cb (glObjectEditor *editor, - glLabelObject *object) -{ - gdouble x, y; - gchar *font_family; - gdouble font_size; - PangoWeight font_weight; - gboolean font_italic_flag; - glColorNode *color_node; - PangoAlignment align; - gdouble text_line_spacing; - gboolean auto_shrink; - gboolean shadow_state; - gdouble shadow_x, shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - - gl_debug (DEBUG_VIEW, "START"); - - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_object_editor_get_position (editor, &x, &y); - font_family = gl_object_editor_get_font_family (editor); - font_size = gl_object_editor_get_font_size (editor); - font_weight = gl_object_editor_get_font_weight (editor); - font_italic_flag = gl_object_editor_get_font_italic_flag (editor); - color_node = gl_object_editor_get_text_color (editor); - align = gl_object_editor_get_text_alignment (editor); - text_line_spacing = gl_object_editor_get_text_line_spacing (editor); - auto_shrink = gl_object_editor_get_text_auto_shrink (editor); - - gl_label_object_set_position (object, x, y); - gl_label_object_set_font_family (object, font_family); - gl_label_object_set_font_size (object, font_size); - gl_label_object_set_font_weight (object, font_weight); - gl_label_object_set_font_italic_flag (object, font_italic_flag); - gl_label_object_set_text_color (object, color_node); - gl_label_object_set_text_alignment (object, align); - gl_label_object_set_text_line_spacing (object, text_line_spacing); - gl_label_text_set_auto_shrink (GL_LABEL_TEXT (object), auto_shrink); - - gl_color_node_free (&color_node); - g_free (font_family); - - shadow_state = gl_object_editor_get_shadow_state (editor); - gl_label_object_set_shadow_state (object, shadow_state); - - gl_object_editor_get_shadow_offset (editor, &shadow_x, &shadow_y); - gl_label_object_set_shadow_offset (object, shadow_x, shadow_y); - - shadow_color_node = gl_object_editor_get_shadow_color (editor); - gl_label_object_set_shadow_color (object, shadow_color_node); - gl_color_node_free (&shadow_color_node); - - shadow_opacity = gl_object_editor_get_shadow_opacity (editor); - gl_label_object_set_shadow_opacity (object, shadow_opacity); - - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. editor "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_object_from_editor_size_cb (glObjectEditor *editor, - glLabelObject *object) -{ - gdouble w, h; - - gl_debug (DEBUG_VIEW, "START"); - - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_block_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_object_editor_get_size (editor, &w, &h); - - gl_label_object_set_size (object, w, h); - - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_object_cb, - editor); - g_signal_handlers_unblock_by_func (G_OBJECT(object), - update_editor_from_move_cb, - editor); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_object_cb (glLabelObject *object, - glObjectEditor *editor) -{ - gdouble w, h; - gchar *font_family; - gdouble font_size; - PangoWeight font_weight; - gboolean font_italic_flag; - glColorNode *color_node; - PangoAlignment align; - gdouble text_line_spacing; - gboolean auto_shrink; - gboolean shadow_state; - gdouble shadow_x, shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - glMerge *merge; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_size (object, &w, &h); - gl_object_editor_set_size (editor, w, h); - merge = gl_label_get_merge (GL_LABEL(object->parent)); - - font_family = gl_label_object_get_font_family (object); - font_size = gl_label_object_get_font_size (object); - font_weight = gl_label_object_get_font_weight (object); - font_italic_flag = gl_label_object_get_font_italic_flag (object); - color_node = gl_label_object_get_text_color (object); - align = gl_label_object_get_text_alignment (object); - text_line_spacing = gl_label_object_get_text_line_spacing (object); - auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); - - gl_object_editor_set_font_family (editor, font_family); - gl_object_editor_set_font_size (editor, font_size); - gl_object_editor_set_font_weight (editor, font_weight); - gl_object_editor_set_font_italic_flag (editor, font_italic_flag); - gl_object_editor_set_text_color (editor, (merge != NULL), color_node); - gl_object_editor_set_text_alignment (editor, align); - gl_object_editor_set_text_line_spacing (editor, text_line_spacing); - gl_object_editor_set_text_auto_shrink (editor, auto_shrink); - - gl_color_node_free (&color_node); - g_free (font_family); - - shadow_state = gl_label_object_get_shadow_state (object); - gl_object_editor_set_shadow_state (editor, shadow_state); - - gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); - gl_object_editor_set_shadow_offset (editor, shadow_x, shadow_y); - - shadow_color_node = gl_label_object_get_shadow_color (object); - gl_object_editor_set_shadow_color (editor, (merge != NULL), shadow_color_node); - gl_color_node_free (&shadow_color_node); - - shadow_opacity = gl_label_object_get_shadow_opacity (object); - gl_object_editor_set_shadow_opacity (editor, shadow_opacity); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. label object "moved" callback. */ -/*---------------------------------------------------------------------------*/ -static void -update_editor_from_move_cb (glLabelObject *object, - gdouble dx, - gdouble dy, - glObjectEditor *editor) -{ - gdouble x, y; - - gl_debug (DEBUG_VIEW, "START"); - - gl_label_object_get_position (object, &x, &y); - gl_object_editor_set_position (editor, x, y); - - gl_debug (DEBUG_VIEW, "END"); -} - - -/*****************************************************************************/ -/* Is object at (x,y)? */ -/*****************************************************************************/ -static gboolean -object_at (glViewObject *view_object, - cairo_t *cr, - gdouble x, - gdouble y) -{ - glLabelObject *object; - gdouble w, h; - - object = gl_view_object_get_object (view_object); - - gl_label_object_get_size (object, &w, &h); - - cairo_rectangle (cr, 0.0, 0.0, w, h); - - if (cairo_in_fill (cr, x, y)) - { - return TRUE; - } - - return FALSE; -} - - -/*****************************************************************************/ -/* Return apropos cursor for create object mode. */ -/*****************************************************************************/ -GdkCursor * -gl_view_text_get_create_cursor (void) -{ - GdkCursor *cursor = NULL; - GdkPixmap *pixmap_data, *pixmap_mask; - GdkColor fg = { 0, 0, 0, 0 }; - GdkColor bg = { 0, 65535, 65535, 65535 }; - - gl_debug (DEBUG_VIEW, "START"); - - pixmap_data = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_text_bits, - cursor_text_width, - cursor_text_height); - pixmap_mask = gdk_bitmap_create_from_data (NULL, - (gchar *)cursor_text_mask_bits, - cursor_text_mask_width, - cursor_text_mask_height); - cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, - &bg, cursor_text_x_hot, - cursor_text_y_hot); - - gl_debug (DEBUG_VIEW, "END"); - - return cursor; -} - -/*****************************************************************************/ -/* Object creation handler: button press event. */ -/*****************************************************************************/ -void -gl_view_text_create_button_press_event (glView *view, - gdouble x, - gdouble y) -{ - GObject *object; - GList *lines; - gchar *family; - glColorNode *color_node; - - gl_view_unselect_all (view); - - object = gl_label_text_new (view->label); - color_node = gl_color_node_new_default (); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - family = gl_view_get_default_font_family (view); - gl_label_object_set_font_family (GL_LABEL_OBJECT(object), family); - gl_label_object_set_font_size (GL_LABEL_OBJECT(object), - gl_view_get_default_font_size (view)); - gl_label_object_set_font_weight (GL_LABEL_OBJECT(object), - gl_view_get_default_font_weight (view)); - gl_label_object_set_font_italic_flag (GL_LABEL_OBJECT(object), - gl_view_get_default_font_italic_flag (view)); - - color_node->color = gl_color_set_opacity (gl_view_get_default_text_color (view), 0.5); - gl_label_object_set_text_color (GL_LABEL_OBJECT(object), - color_node); - gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object), - gl_view_get_default_text_alignment (view)); - gl_label_object_set_text_line_spacing (GL_LABEL_OBJECT(object), gl_view_get_default_text_line_spacing (view)); - - g_free (family); - lines = gl_text_node_lines_new_from_text (_("Text")); - gl_label_text_set_lines (GL_LABEL_TEXT(object), lines); - gl_color_node_free (&color_node); - - view->create_object = GL_LABEL_OBJECT (object); - view->create_x0 = x; - view->create_y0 = y; -} - -/*****************************************************************************/ -/* Object creation handler: motion event. */ -/*****************************************************************************/ -void -gl_view_text_create_motion_event (glView *view, - gdouble x, - gdouble y) -{ - gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), x, y); -} - -/*****************************************************************************/ -/* Object creation handler: button relesase event. */ -/*****************************************************************************/ -void -gl_view_text_create_button_release_event (glView *view, - gdouble x, - gdouble y) -{ - glColorNode *color_node; - - color_node = gl_color_node_new_default (); - gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), x, y); - color_node->color = gl_view_get_default_text_color(view); - gl_label_object_set_text_color (GL_LABEL_OBJECT(view->create_object), color_node); - gl_color_node_free (&color_node); -} - diff --git a/glabels2/src/view-text.h b/glabels2/src/view-text.h deleted file mode 100644 index bb28c90b..00000000 --- a/glabels2/src/view-text.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view_text.h: GLabels label text object view - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __VIEW_TEXT_H__ -#define __VIEW_TEXT_H__ - -#include "view-object.h" -#include "label-text.h" - -G_BEGIN_DECLS - - -#define GL_TYPE_VIEW_TEXT (gl_view_text_get_type ()) -#define GL_VIEW_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_TEXT, glViewText)) -#define GL_VIEW_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_TEXT, glViewTextClass)) -#define GL_IS_VIEW_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_TEXT)) -#define GL_IS_VIEW_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_TEXT)) - -typedef struct _glViewText glViewText; -typedef struct _glViewTextClass glViewTextClass; - -typedef struct _glViewTextPrivate glViewTextPrivate; - -struct _glViewText { - glViewObject parent_object; - - glViewTextPrivate *priv; -}; - -struct _glViewTextClass { - glViewObjectClass parent_class; -}; - - -GType gl_view_text_get_type (void) G_GNUC_CONST; - -glViewObject *gl_view_text_new (glLabelText *object, - glView *view); - - -/* cursor for creating text objects */ -GdkCursor *gl_view_text_get_create_cursor (void); - -/* Object creation handlers. */ -void gl_view_text_create_button_press_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_text_create_motion_event (glView *view, - gdouble x, - gdouble y); - -void gl_view_text_create_button_release_event (glView *view, - gdouble x, - gdouble y); - - -G_END_DECLS - -#endif /* __VIEW_TEXT_H__ */ diff --git a/glabels2/src/view.c b/glabels2/src/view.c deleted file mode 100644 index f7ad1850..00000000 --- a/glabels2/src/view.c +++ /dev/null @@ -1,3642 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view.c: GLabels View module - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "view.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "label.h" -#include "cairo-label-path.h" -#include "cairo-markup-path.h" -#include "view-object.h" -#include "view-box.h" -#include "view-ellipse.h" -#include "view-line.h" -#include "view-image.h" -#include "view-text.h" -#include "view-barcode.h" -#include "xml-label.h" -#include "color.h" -#include "prefs.h" -#include "marshal.h" - -#include "debug.h" - -/*==========================================================================*/ -/* Private macros and constants. */ -/*==========================================================================*/ - -#define BG_COLOR GL_COLOR (192, 192, 192) - -#define PAPER_RGB_ARGS 1.0, 1.0, 1.0 -#define GRID_RGB_ARGS 0.753, 0.753, 0.753 -#define MARKUP_RGB_ARGS 0.94, 0.39, 0.39 -#define OUTLINE_RGB_ARGS 0.68, 0.85, 0.90 -#define SELECT_LINE_RGBA_ARGS 0.0, 0.0, 1.0, 0.5 -#define SELECT_FILL_RGBA_ARGS 0.75, 0.75, 1.0, 0.5 - -#define GRID_LINE_WIDTH_PIXELS 1.0 -#define MARKUP_LINE_WIDTH_PIXELS 1.0 -#define OUTLINE_WIDTH_PIXELS 3.0 -#define SELECT_LINE_WIDTH_PIXELS 3.0 - -#define ZOOMTOFIT_PAD 16 - -#define POINTS_PER_MM 2.83464566929 - -/*==========================================================================*/ -/* Private types. */ -/*==========================================================================*/ - -enum { - SELECTION_CHANGED, - CONTEXT_MENU_ACTIVATE, - ZOOM_CHANGED, - POINTER_MOVED, - POINTER_EXIT, - MODE_CHANGED, - LAST_SIGNAL -}; - - -/*==========================================================================*/ -/* Private globals */ -/*==========================================================================*/ - -static guint signals[LAST_SIGNAL] = {0}; - -/* "CLIPBOARD" selection */ -static GdkAtom clipboard_atom = GDK_NONE; - -static gdouble zooms[] = { - 8.00, - 6.00, - 4.00, - 3.00, - 2.00, - 1.50, - 1.00, - 0.75, - 0.67, - 0.50, - 0.33, - 0.25, - 0.20, - 0.15, - 0.10, -}; -#define N_ZOOMS G_N_ELEMENTS(zooms) - - -/*==========================================================================*/ -/* Local function prototypes */ -/*==========================================================================*/ - -static void gl_view_finalize (GObject *object); - -static void gl_view_construct (glView *view, - glLabel *label); - -static gdouble get_home_scale (glView *view); - -static gboolean expose_cb (glView *view, - GdkEventExpose *event); - -static void realize_cb (glView *view); - -static void size_allocate_cb (glView *view, - GtkAllocation *allocation); - -static void screen_changed_cb (glView *view); - -static void label_changed_cb (glView *view); - -static void label_resized_cb (glView *view); - -static void label_object_added_cb (glView *view, - glLabelObject *object); - -static void draw_layers (glView *view, - cairo_t *cr); - -static void draw_bg_layer (glView *view, - cairo_t *cr); -static void draw_grid_layer (glView *view, - cairo_t *cr); -static void draw_markup_layer (glView *view, - cairo_t *cr); -static void draw_objects_layer (glView *view, - cairo_t *cr); -static void draw_fg_layer (glView *view, - cairo_t *cr); -static void draw_highlight_layer (glView *view, - cairo_t *cr); -static void draw_select_region_layer (glView *view, - cairo_t *cr); - -static void select_object_real (glView *view, - glViewObject *view_object); -static void unselect_object_real (glView *view, - glViewObject *view_object); - -static glViewObject *view_view_object_at (glView *view, - cairo_t *cr, - gdouble x, - gdouble y); - -static void set_zoom_real (glView *view, - gdouble zoom, - gboolean scale_to_fit_flag); - -static void selection_clear_cb (GtkWidget *widget, - GdkEventSelection *event, - glView *view); - -static void selection_get_cb (GtkWidget *widget, - GtkSelectionData *selection_data, - guint info, - guint time, - glView *view); - -static void selection_received_cb (GtkWidget *widget, - GtkSelectionData *selection_data, - guint time, - glView *view); - -static gboolean focus_in_event_cb (glView *view, - GdkEventFocus *event); - -static gboolean focus_out_event_cb (glView *view, - GdkEventFocus *event); - -static gboolean enter_notify_event_cb (glView *view, - GdkEventCrossing *event); - -static gboolean leave_notify_event_cb (glView *view, - GdkEventCrossing *event); - -static gboolean motion_notify_event_cb (glView *view, - GdkEventMotion *event); - -static gboolean button_press_event_cb (glView *view, - GdkEventButton *event); - -static gboolean button_release_event_cb (glView *view, - GdkEventButton *event); - -static gboolean key_press_event_cb (glView *view, - GdkEventKey *event); - - -/****************************************************************************/ -/* Boilerplate Object stuff. */ -/****************************************************************************/ -G_DEFINE_TYPE (glView, gl_view, GTK_TYPE_VBOX); - -static void -gl_view_class_init (glViewClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_VIEW, "START"); - - gl_view_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_view_finalize; - - signals[SELECTION_CHANGED] = - g_signal_new ("selection_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glViewClass, selection_changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - signals[CONTEXT_MENU_ACTIVATE] = - g_signal_new ("context_menu_activate", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glViewClass, context_menu_activate), - NULL, NULL, - gl_marshal_VOID__INT_UINT, - G_TYPE_NONE, - 2, G_TYPE_INT, G_TYPE_UINT); - - signals[ZOOM_CHANGED] = - g_signal_new ("zoom_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glViewClass, zoom_changed), - NULL, NULL, - gl_marshal_VOID__DOUBLE, - G_TYPE_NONE, - 1, G_TYPE_DOUBLE); - - signals[POINTER_MOVED] = - g_signal_new ("pointer_moved", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glViewClass, pointer_moved), - NULL, NULL, - gl_marshal_VOID__DOUBLE_DOUBLE, - G_TYPE_NONE, - 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE); - - signals[POINTER_EXIT] = - g_signal_new ("pointer_exit", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glViewClass, pointer_exit), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - signals[MODE_CHANGED] = - g_signal_new ("mode_changed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glViewClass, mode_changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, - 0); - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_init (glView *view) -{ - GtkWidget *wscroll; - GdkColor *bg_color; - - gl_debug (DEBUG_VIEW, "START"); - - view->label = NULL; - view->grid_visible = TRUE; - view->grid_spacing = 9; - view->markup_visible = TRUE; - view->default_font_family = NULL; - view->mode = GL_VIEW_MODE_ARROW; - view->object_list = NULL; - view->selected_object_list = NULL; - view->zoom = 1.0; - view->home_scale = get_home_scale (view); - - /* - * Canvas - */ - view->canvas = gtk_layout_new (NULL, NULL); - wscroll = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (wscroll), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - gtk_box_pack_start (GTK_BOX (view), wscroll, TRUE, TRUE, 0); - gtk_container_add (GTK_CONTAINER (wscroll), view->canvas); - - bg_color = gl_color_to_gdk_color (BG_COLOR); - gtk_widget_modify_bg (GTK_WIDGET (view->canvas), GTK_STATE_NORMAL, bg_color); - g_free (bg_color); - - GTK_WIDGET_SET_FLAGS (GTK_WIDGET (view->canvas), GTK_CAN_FOCUS); - - gtk_widget_add_events (GTK_WIDGET (view->canvas), - (GDK_FOCUS_CHANGE_MASK | - GDK_ENTER_NOTIFY_MASK | - GDK_LEAVE_NOTIFY_MASK | - GDK_POINTER_MOTION_MASK | - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_KEY_PRESS_MASK)); - - g_signal_connect_swapped (G_OBJECT (view->canvas), "expose-event", - G_CALLBACK (expose_cb), view); - g_signal_connect_swapped (G_OBJECT (view->canvas), "realize", - G_CALLBACK (realize_cb), view); - g_signal_connect_swapped (G_OBJECT (view->canvas), "size-allocate", - G_CALLBACK (size_allocate_cb), view); - g_signal_connect_swapped (G_OBJECT (view->canvas), "screen-changed", - G_CALLBACK (screen_changed_cb), view); - g_signal_connect_swapped (G_OBJECT (view->canvas), "focus-in-event", - G_CALLBACK (focus_in_event_cb), view); - g_signal_connect_swapped (G_OBJECT (view->canvas), "focus-out-event", - G_CALLBACK (focus_out_event_cb), view); - g_signal_connect_swapped (G_OBJECT (view->canvas), "enter-notify-event", - G_CALLBACK (enter_notify_event_cb), view); - g_signal_connect_swapped (G_OBJECT (view->canvas), "leave-notify-event", - G_CALLBACK (leave_notify_event_cb), view); - g_signal_connect_swapped (G_OBJECT (view->canvas), "motion-notify-event", - G_CALLBACK (motion_notify_event_cb), view); - g_signal_connect_swapped (G_OBJECT (view->canvas), "button-press-event", - G_CALLBACK (button_press_event_cb), view); - g_signal_connect_swapped (G_OBJECT (view->canvas), "button-release-event", - G_CALLBACK (button_release_event_cb), view); - g_signal_connect_swapped (G_OBJECT (view->canvas), "key-press-event", - G_CALLBACK (key_press_event_cb), view); - - /* - * Clipboard - */ - view->have_selection = FALSE; - view->selection_data = NULL; - view->invisible = gtk_invisible_new (); - if (!clipboard_atom) { - clipboard_atom = gdk_atom_intern ("GLABELS_CLIPBOARD", FALSE); - } - gtk_selection_add_target (view->invisible, - clipboard_atom, GDK_SELECTION_TYPE_STRING, 1); - g_signal_connect (G_OBJECT (view->invisible), - "selection_clear_event", - G_CALLBACK (selection_clear_cb), view); - g_signal_connect (G_OBJECT (view->invisible), "selection_get", - G_CALLBACK (selection_get_cb), view); - g_signal_connect (G_OBJECT (view->invisible), - "selection_received", - G_CALLBACK (selection_received_cb), view); - - /* - * Defaults from preferences - */ - gl_view_set_default_font_family (view, gl_prefs->default_font_family); - gl_view_set_default_font_size (view, gl_prefs->default_font_size); - gl_view_set_default_font_weight (view, gl_prefs->default_font_weight); - gl_view_set_default_font_italic_flag (view, gl_prefs->default_font_italic_flag); - gl_view_set_default_text_color (view, gl_prefs->default_text_color); - gl_view_set_default_text_alignment (view, gl_prefs->default_text_alignment); - gl_view_set_default_text_line_spacing (view, gl_prefs->default_text_line_spacing); - gl_view_set_default_line_width (view, gl_prefs->default_line_width); - gl_view_set_default_line_color (view, gl_prefs->default_line_color); - gl_view_set_default_fill_color (view, gl_prefs->default_fill_color); - - gl_debug (DEBUG_VIEW, "END"); -} - -static void -gl_view_finalize (GObject *object) -{ - glView *view = GL_VIEW (object); - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_VIEW (object)); - - if (view->default_font_family) { - g_free (view->default_font_family); - } - - G_OBJECT_CLASS (gl_view_parent_class)->finalize (object); - - gl_debug (DEBUG_VIEW, "END"); -} - -/****************************************************************************/ -/* NEW view object. */ -/****************************************************************************/ -GtkWidget * -gl_view_new (glLabel *label) -{ - glView *view; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (label && GL_IS_LABEL (label), NULL); - - view = g_object_new (GL_TYPE_VIEW, NULL); - - gl_view_construct (view, label); - - gl_debug (DEBUG_VIEW, "END"); - - return GTK_WIDGET (view); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Construct composite widget. */ -/*---------------------------------------------------------------------------*/ -static void -gl_view_construct (glView *view, - glLabel *label) -{ - GList *p_obj; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (GL_IS_VIEW (view)); - - view->label = label; - - for (p_obj = label->objects; p_obj != NULL; p_obj = p_obj->next) - { - object = GL_LABEL_OBJECT (p_obj->data); - - if (GL_IS_LABEL_BOX (object)) { - gl_view_box_new (GL_LABEL_BOX(object), view); - } else if (GL_IS_LABEL_ELLIPSE (object)) { - gl_view_ellipse_new (GL_LABEL_ELLIPSE(object), view); - } else if (GL_IS_LABEL_LINE (object)) { - gl_view_line_new (GL_LABEL_LINE(object), view); - } else if (GL_IS_LABEL_IMAGE (object)) { - gl_view_image_new (GL_LABEL_IMAGE(object), view); - } else if (GL_IS_LABEL_TEXT (object)) { - gl_view_text_new (GL_LABEL_TEXT(object), view); - } else if (GL_IS_LABEL_BARCODE (object)) { - gl_view_barcode_new (GL_LABEL_BARCODE(object), view); - } else { - /* Should not happen! */ - g_message ("Invalid label object type."); - } - } - - g_signal_connect_swapped (G_OBJECT (view->label), "changed", - G_CALLBACK (label_changed_cb), view); - g_signal_connect_swapped (G_OBJECT (view->label), "size_changed", - G_CALLBACK (label_resized_cb), view); - g_signal_connect_swapped (G_OBJECT (view->label), "object_added", - G_CALLBACK (label_object_added_cb), view); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIAVTE. Calculate 1:1 scale for screen. */ -/*---------------------------------------------------------------------------*/ -static gdouble -get_home_scale (glView *view) -{ - GdkScreen *screen; - gdouble screen_width_pixels; - gdouble screen_width_mm; - gdouble screen_height_pixels; - gdouble screen_height_mm; - gdouble x_pixels_per_mm; - gdouble y_pixels_per_mm; - gdouble scale; - - if (view->canvas == NULL) return 1.0; - - if (!gtk_widget_has_screen (GTK_WIDGET (view->canvas))) return 1.0; - - screen = gtk_widget_get_screen (GTK_WIDGET (view->canvas)); - - gl_debug (DEBUG_VIEW, "Screen = %p", screen); - - screen_width_pixels = gdk_screen_get_width (screen); - screen_width_mm = gdk_screen_get_width_mm (screen); - screen_height_pixels = gdk_screen_get_height (screen); - screen_height_mm = gdk_screen_get_height_mm (screen); - - x_pixels_per_mm = screen_width_pixels / screen_width_mm; - y_pixels_per_mm = screen_height_pixels / screen_height_mm; - - gl_debug (DEBUG_VIEW, "Horizontal dot pitch: %g pixels/mm (%g dpi)", - x_pixels_per_mm, x_pixels_per_mm * 25.4); - gl_debug (DEBUG_VIEW, "Vertical dot pitch: %g pixels/mm (%g dpi)", - y_pixels_per_mm, y_pixels_per_mm * 25.4); - - scale = (x_pixels_per_mm + y_pixels_per_mm) / 2.0; - - gl_debug (DEBUG_VIEW, "Average dot pitch: %g pixels/mm (%g dpi)", - scale, scale * 25.4); - - scale /= POINTS_PER_MM; - - gl_debug (DEBUG_VIEW, "Scale = %g pixels/point", scale); - - /* Make sure scale is somewhat sane. */ - if ( (scale < 0.25) || (scale > 4.0) ) return 1.0; - - return scale; -} - -/*---------------------------------------------------------------------------*/ -/* Schedule canvas update. */ -/*---------------------------------------------------------------------------*/ -void -gl_view_update (glView *view) -{ - GtkWidget *widget; - GdkRegion *region; - - gl_debug (DEBUG_VIEW, "START"); - - widget = GTK_WIDGET (view->canvas); - - if (!widget->window) return; - - if ( !view->update_scheduled_flag ) - { - view->update_scheduled_flag = TRUE; - - region = gdk_drawable_get_clip_region (widget->window); - /* redraw the cairo canvas completely by exposing it */ - gdk_window_invalidate_region (widget->window, region, TRUE); - gdk_region_destroy (region); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* Schedule canvas region update. */ -/*---------------------------------------------------------------------------*/ -void -gl_view_update_region (glView *view, - cairo_t *cr, - glLabelRegion *region) -{ - GtkWidget *widget; - GdkRectangle rect; - gdouble x, y, w, h; - - gl_debug (DEBUG_VIEW, "START"); - - widget = GTK_WIDGET (view->canvas); - - if (!widget->window) return; - - x = MIN (region->x1, region->x2); - y = MIN (region->y1, region->y2); - w = fabs (region->x2 - region->x1); - h = fabs (region->y2 - region->y1); - - cairo_user_to_device (cr, &x, &y); - cairo_user_to_device_distance (cr, &w, &h); - - rect.x = x - 3; - rect.y = y - 3; - rect.width = w + 6; - rect.height = h + 6; - - gdk_window_invalidate_rect (widget->window, &rect, TRUE); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Expose handler. */ -/*---------------------------------------------------------------------------*/ -static gboolean -expose_cb (glView *view, - GdkEventExpose *event) -{ - cairo_t *cr; - - gl_debug (DEBUG_VIEW, "START"); - - view->update_scheduled_flag = FALSE; - - /* get a cairo_t */ - cr = gdk_cairo_create (GTK_LAYOUT (view->canvas)->bin_window); - - cairo_rectangle (cr, - event->area.x, event->area.y, - event->area.width, event->area.height); - cairo_clip (cr); - - draw_layers (view, cr); - - cairo_destroy (cr); - - gl_debug (DEBUG_VIEW, "END"); - - return FALSE; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Realize handler. */ -/*---------------------------------------------------------------------------*/ -static void -realize_cb (glView *view) -{ - g_return_if_fail (view && GL_IS_VIEW (view)); - - gl_debug (DEBUG_VIEW, "START"); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Size allocation changed callback. */ -/*---------------------------------------------------------------------------*/ -static void -size_allocate_cb (glView *view, - GtkAllocation *allocation) -{ - gl_debug (DEBUG_VIEW, "START"); - - GTK_LAYOUT (view->canvas)->hadjustment->page_size = allocation->width; - GTK_LAYOUT (view->canvas)->hadjustment->page_increment = allocation->width / 2; - - GTK_LAYOUT (view->canvas)->vadjustment->page_size = allocation->height; - GTK_LAYOUT (view->canvas)->vadjustment->page_increment = allocation->height / 2; - - g_signal_emit_by_name (GTK_LAYOUT (view->canvas)->hadjustment, "changed"); - g_signal_emit_by_name (GTK_LAYOUT (view->canvas)->vadjustment, "changed"); - - if (view->zoom_to_fit_flag) { - /* Maintain best fit zoom */ - gl_view_zoom_to_fit (view); - } - - gl_debug (DEBUG_VIEW, "END"); -} - - - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Screen changed callback. */ -/*---------------------------------------------------------------------------*/ -static void -screen_changed_cb (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - if (gtk_widget_has_screen (GTK_WIDGET (view->canvas))) { - - view->home_scale = get_home_scale (view); - - if (view->zoom_to_fit_flag) { - /* Maintain best fit zoom */ - gl_view_zoom_to_fit (view); - } - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Handle label changed event. */ -/*---------------------------------------------------------------------------*/ -static void -label_changed_cb (glView *view) -{ - g_return_if_fail (view && GL_IS_VIEW (view)); - - gl_debug (DEBUG_VIEW, "START"); - - gl_view_update (view); - - gl_debug (DEBUG_VIEW, "END"); -} - - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Handle label resize event. */ -/*---------------------------------------------------------------------------*/ -static void -label_resized_cb (glView *view) -{ - g_return_if_fail (view && GL_IS_VIEW (view)); - - gl_debug (DEBUG_VIEW, "START"); - - g_signal_emit_by_name (GTK_LAYOUT (view->canvas)->hadjustment, "changed"); - g_signal_emit_by_name (GTK_LAYOUT (view->canvas)->vadjustment, "changed"); - - gl_view_update (view); - - gl_debug (DEBUG_VIEW, "END"); -} - - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Handle new label object. */ -/*---------------------------------------------------------------------------*/ -static void -label_object_added_cb (glView *view, - glLabelObject *object) -{ - glViewObject *view_object; - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); - - if (GL_IS_LABEL_BOX (object)) { - view_object = gl_view_box_new (GL_LABEL_BOX(object), view); - } else if (GL_IS_LABEL_ELLIPSE (object)) { - view_object = gl_view_ellipse_new (GL_LABEL_ELLIPSE(object), view); - } else if (GL_IS_LABEL_LINE (object)) { - view_object = gl_view_line_new (GL_LABEL_LINE(object), view); - } else if (GL_IS_LABEL_IMAGE (object)) { - view_object = gl_view_image_new (GL_LABEL_IMAGE(object), view); - } else if (GL_IS_LABEL_TEXT (object)) { - view_object = gl_view_text_new (GL_LABEL_TEXT(object), view); - } else if (GL_IS_LABEL_BARCODE (object)) { - view_object = gl_view_barcode_new (GL_LABEL_BARCODE(object), view); - } else { - /* Should not happen! */ - view_object = NULL; - g_message ("Invalid label object type."); - } - - gl_view_select_object (view, view_object); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Create, draw and order layers. */ -/*---------------------------------------------------------------------------*/ -static void -draw_layers (glView *view, - cairo_t *cr) -{ - gdouble scale; - gdouble w, h; - gint canvas_w, canvas_h; - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (view->label && GL_IS_LABEL (view->label)); - - gl_debug (DEBUG_VIEW, "START"); - - scale = view->zoom * view->home_scale; - - gl_label_get_size (view->label, &w, &h); - - scale = view->home_scale * view->zoom; - gtk_layout_set_size (GTK_LAYOUT (view->canvas), w*scale+8, h*scale+8); - - gdk_drawable_get_size (GTK_LAYOUT (view->canvas)->bin_window, &canvas_w, &canvas_h); - - view->x0 = (canvas_w/scale - w) / 2.0; - view->y0 = (canvas_h/scale - h) / 2.0; - view->w = w; - view->h = h; - - cairo_save (cr); - - cairo_scale (cr, scale, scale); - cairo_translate (cr, view->x0, view->y0); - - draw_bg_layer (view, cr); - draw_grid_layer (view, cr); - draw_markup_layer (view, cr); - draw_objects_layer (view, cr); - draw_fg_layer (view, cr); - draw_highlight_layer (view, cr); - draw_select_region_layer (view, cr); - - cairo_restore (cr); - - gl_debug (DEBUG_VIEW, "END"); - -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw background */ -/*---------------------------------------------------------------------------*/ -static void -draw_bg_layer (glView *view, - cairo_t *cr) -{ - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (view->label && GL_IS_LABEL (view->label)); - - gl_cairo_label_path (cr, view->label->template, view->label->rotate_flag, FALSE); - - cairo_set_source_rgb (cr, PAPER_RGB_ARGS); - cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); - cairo_fill (cr); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw grid lines. */ -/*---------------------------------------------------------------------------*/ -static void -draw_grid_layer (glView *view, - cairo_t *cr) -{ - gdouble w, h; - gdouble x, y; - gdouble x0, y0; - const lglTemplateFrame *frame; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (view->label && GL_IS_LABEL(view->label)); - - if (view->grid_visible) - { - - frame = (lglTemplateFrame *)view->label->template->frames->data; - - gl_label_get_size (view->label, &w, &h); - - if (frame->shape == LGL_TEMPLATE_FRAME_SHAPE_RECT) { - x0 = 0.0; - y0 = 0.0; - } else { - /* round labels, adjust grid to line up with center of label. */ - x0 = fmod (w/2.0, view->grid_spacing); - y0 = fmod (h/2.0, view->grid_spacing); - } - - - cairo_save (cr); - - cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); - cairo_set_line_width (cr, GRID_LINE_WIDTH_PIXELS/(view->home_scale * view->zoom)); - cairo_set_source_rgb (cr, GRID_RGB_ARGS); - - for ( x=x0+view->grid_spacing; x < w; x += view->grid_spacing ) - { - cairo_move_to (cr, x, 0); - cairo_line_to (cr, x, h); - cairo_stroke (cr); - } - - for ( y=y0+view->grid_spacing; y < h; y += view->grid_spacing ) - { - cairo_move_to (cr, 0, y); - cairo_line_to (cr, w, y); - cairo_stroke (cr); - } - - cairo_restore (cr); - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw markup layer. */ -/*---------------------------------------------------------------------------*/ -static void -draw_markup_layer (glView *view, - cairo_t *cr) -{ - glLabel *label; - const lglTemplateFrame *frame; - GList *p; - lglTemplateMarkup *markup; - gdouble width, height; - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (view->label && GL_IS_LABEL (view->label)); - - if (view->markup_visible) - { - - label = view->label; - frame = (lglTemplateFrame *)view->label->template->frames->data; - - cairo_save (cr); - - if (label->rotate_flag) - { - lgl_template_frame_get_size (frame, &width, &height); - cairo_rotate (cr, -M_PI/2.0); - cairo_translate (cr, -width, 0.0); - } - - cairo_set_line_width (cr, MARKUP_LINE_WIDTH_PIXELS/(view->home_scale * view->zoom)); - cairo_set_source_rgb (cr, MARKUP_RGB_ARGS); - - for ( p=frame->all.markups; p != NULL; p=p->next ) - { - markup = (lglTemplateMarkup *)p->data; - - gl_cairo_markup_path (cr, markup, label); - - cairo_stroke (cr); - } - - cairo_restore (cr); - } - -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw objects layer. */ -/*---------------------------------------------------------------------------*/ -static void -draw_objects_layer (glView *view, - cairo_t *cr) -{ - gl_label_draw (view->label, cr, TRUE, NULL); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw foreground */ -/*---------------------------------------------------------------------------*/ -static void -draw_fg_layer (glView *view, - cairo_t *cr) -{ - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (view->label && GL_IS_LABEL (view->label)); - - gl_cairo_label_path (cr, view->label->template, view->label->rotate_flag, FALSE); - - cairo_set_line_width (cr, OUTLINE_WIDTH_PIXELS/(view->home_scale * view->zoom)); - cairo_set_source_rgb (cr, OUTLINE_RGB_ARGS); - cairo_stroke (cr); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Create highlight layer. */ -/*---------------------------------------------------------------------------*/ -static void -draw_highlight_layer (glView *view, - cairo_t *cr) -{ - GList *p_obj; - glViewObject *view_object; - - g_return_if_fail (view && GL_IS_VIEW (view)); - - cairo_save (cr); - - cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); - - for (p_obj = view->selected_object_list; p_obj != NULL; p_obj = p_obj->next) - { - view_object = GL_VIEW_OBJECT (p_obj->data); - - gl_view_object_draw_handles (view_object, cr); - } - - cairo_restore (cr); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Draw select region layer. */ -/*---------------------------------------------------------------------------*/ -static void -draw_select_region_layer (glView *view, - cairo_t *cr) -{ - gdouble x1, y1; - gdouble w, h; - - g_return_if_fail (view && GL_IS_VIEW (view)); - - if (view->select_region_visible) - { - x1 = MIN (view->select_region.x1, view->select_region.x2); - y1 = MIN (view->select_region.y1, view->select_region.y2); - w = fabs (view->select_region.x2 - view->select_region.x1); - h = fabs (view->select_region.y2 - view->select_region.y1); - - cairo_save (cr); - - cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); - - cairo_rectangle (cr, x1, y1, w, h); - - cairo_set_source_rgba (cr, SELECT_FILL_RGBA_ARGS); - cairo_fill_preserve (cr); - - cairo_set_line_width (cr, SELECT_LINE_WIDTH_PIXELS/(view->home_scale * view->zoom)); - cairo_set_source_rgba (cr, SELECT_LINE_RGBA_ARGS); - cairo_stroke (cr); - - cairo_restore (cr); - } -} - -/*****************************************************************************/ -/* Show grid. */ -/*****************************************************************************/ -void -gl_view_show_grid (glView *view) -{ - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->grid_visible = TRUE; - gl_view_update (view); -} - -/*****************************************************************************/ -/* Hide grid. */ -/*****************************************************************************/ -void -gl_view_hide_grid (glView *view) -{ - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->grid_visible = FALSE; - gl_view_update (view); -} - -/*****************************************************************************/ -/* Set grid spacing. */ -/*****************************************************************************/ -void -gl_view_set_grid_spacing (glView *view, - gdouble spacing) -{ - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->grid_spacing = spacing; - gl_view_update (view); -} - -/*****************************************************************************/ -/* Show markup. */ -/*****************************************************************************/ -void -gl_view_show_markup (glView *view) -{ - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->markup_visible = TRUE; - gl_view_update (view); -} - -/*****************************************************************************/ -/* Hide markup. */ -/*****************************************************************************/ -void -gl_view_hide_markup (glView *view) -{ - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->markup_visible = FALSE; - gl_view_update (view); -} - -/*****************************************************************************/ -/* Set arrow mode. */ -/*****************************************************************************/ -void -gl_view_arrow_mode (glView *view) -{ - GdkCursor *cursor; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - cursor = gdk_cursor_new (GDK_LEFT_PTR); - gdk_window_set_cursor (view->canvas->window, cursor); - gdk_cursor_unref (cursor); - - view->mode = GL_VIEW_MODE_ARROW; - view->state = GL_VIEW_IDLE; - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Set create text object mode. */ -/*****************************************************************************/ -void -gl_view_object_create_mode (glView *view, - glLabelObjectType type) -{ - GdkCursor *cursor = NULL; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - switch (type) - { - case GL_LABEL_OBJECT_BOX: - cursor = gl_view_box_get_create_cursor (); - break; - case GL_LABEL_OBJECT_ELLIPSE: - cursor = gl_view_ellipse_get_create_cursor (); - break; - case GL_LABEL_OBJECT_LINE: - cursor = gl_view_line_get_create_cursor (); - break; - case GL_LABEL_OBJECT_IMAGE: - cursor = gl_view_image_get_create_cursor (); - break; - case GL_LABEL_OBJECT_TEXT: - cursor = gl_view_text_get_create_cursor (); - break; - case GL_LABEL_OBJECT_BARCODE: - cursor = gl_view_barcode_get_create_cursor (); - break; - default: - g_message ("Invalid label object type.");/*Should not happen!*/ - break; - } - - gdk_window_set_cursor (view->canvas->window, cursor); - gdk_cursor_unref (cursor); - - view->mode = GL_VIEW_MODE_OBJECT_CREATE; - view->state = GL_VIEW_IDLE; - view->create_type = type; - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Select given object (adding to current selection). */ -/*****************************************************************************/ -void -gl_view_select_object (glView *view, - glViewObject *view_object) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - select_object_real (view, view_object); - - g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Unselect given object (removing from current selection). */ -/*****************************************************************************/ -void -gl_view_unselect_object (glView *view, - glViewObject *view_object) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - unselect_object_real (view, view_object); - - g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Select all items. */ -/*****************************************************************************/ -void -gl_view_select_all (glView *view) -{ - GList *p, *p_next; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - /* 1st unselect anything already selected. */ - for (p = view->selected_object_list; p != NULL; p = p_next) { - p_next = p->next; - unselect_object_real (view, GL_VIEW_OBJECT (p->data)); - } - - /* Finally select all objects. */ - for (p = view->object_list; p != NULL; p = p->next) { - select_object_real (view, GL_VIEW_OBJECT (p->data)); - } - - g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Remove all selections */ -/*****************************************************************************/ -void -gl_view_unselect_all (glView *view) -{ - GList *p; - GList *p_next; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p_next) { - p_next = p->next; - unselect_object_real (view, GL_VIEW_OBJECT (p->data)); - } - - g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Select all objects within given rectangular region (adding to selection). */ -/*****************************************************************************/ -void -gl_view_select_region (glView *view, - glLabelRegion *region) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - gdouble r_x1, r_y1; - gdouble r_x2, r_y2; - glLabelRegion obj_extent; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - r_x1 = MIN (region->x1, region->x2); - r_y1 = MIN (region->y1, region->y2); - r_x2 = MAX (region->x1, region->x2); - r_y2 = MAX (region->y1, region->y2); - - for (p = view->object_list; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT(p->data); - if (!gl_view_is_object_selected (view, view_object)) - { - - object = gl_view_object_get_object (view_object); - - gl_label_object_get_extent (object, &obj_extent); - if ((obj_extent.x1 >= r_x1) && - (obj_extent.x2 <= r_x2) && - (obj_extent.y1 >= r_y1) && - (obj_extent.y2 <= r_y2)) - { - select_object_real (view, view_object); - } - - } - } - - g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Select an object. */ -/*---------------------------------------------------------------------------*/ -static void -select_object_real (glView *view, - glViewObject *view_object) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (GL_IS_VIEW_OBJECT (view_object)); - - if (!gl_view_is_object_selected (view, view_object)) { - view->selected_object_list = - g_list_append (view->selected_object_list, view_object); - } - gtk_widget_grab_focus (GTK_WIDGET (view->canvas)); - - gl_view_update (view); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Un-select object. */ -/*---------------------------------------------------------------------------*/ -static void -unselect_object_real (glView *view, - glViewObject *view_object) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (GL_IS_VIEW_OBJECT (view_object)); - - view->selected_object_list = - g_list_remove (view->selected_object_list, view_object); - - gl_view_update (view); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Return object at (x,y). */ -/*---------------------------------------------------------------------------*/ -static glViewObject * -view_view_object_at (glView *view, - cairo_t *cr, - gdouble x, - gdouble y) -{ - GList *p_obj; - glViewObject *view_object; - - g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); - - for (p_obj = g_list_last (view->object_list); p_obj != NULL; p_obj = p_obj->prev) - { - - view_object = GL_VIEW_OBJECT (p_obj->data); - - if (gl_view_object_at (view_object, cr, x, y)) - { - return view_object; - } - - } - - return NULL; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Return object handle at (x,y). */ -/*---------------------------------------------------------------------------*/ -static glViewObject * -view_handle_at (glView *view, - cairo_t *cr, - gdouble x, - gdouble y, - glViewObjectHandle *handle) -{ - GList *p_obj; - glViewObject *view_object; - - g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); - - for (p_obj = g_list_last (view->selected_object_list); p_obj != NULL; p_obj = p_obj->prev) - { - - view_object = GL_VIEW_OBJECT (p_obj->data); - - if ((*handle = gl_view_object_handle_at (view_object, cr, x, y))) - { - return view_object; - } - - } - - return NULL; -} - -/*****************************************************************************/ -/* Is the object in our current selection? */ -/*****************************************************************************/ -gboolean -gl_view_is_object_selected (glView *view, - glViewObject *view_object) -{ - gl_debug (DEBUG_VIEW, ""); - - g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); - g_return_val_if_fail (GL_IS_VIEW_OBJECT (view_object), FALSE); - - if (g_list_find (view->selected_object_list, view_object) == NULL) { - return FALSE; - } - return TRUE; -} - -/*****************************************************************************/ -/* Is our current selection empty? */ -/*****************************************************************************/ -gboolean -gl_view_is_selection_empty (glView *view) -{ - gl_debug (DEBUG_VIEW, ""); - - g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); - - if (view->selected_object_list == NULL) { - return TRUE; - } else { - return FALSE; - } -} - -/*****************************************************************************/ -/* Is our current selection atomic? I.e. only one item selected. */ -/*****************************************************************************/ -gboolean -gl_view_is_selection_atomic (glView *view) -{ - gl_debug (DEBUG_VIEW, ""); - - g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); - - if (view->selected_object_list == NULL) - return FALSE; - if (view->selected_object_list->next == NULL) - return TRUE; - return FALSE; -} - -/*****************************************************************************/ -/* Delete selected objects. (Bypass clipboard) */ -/*****************************************************************************/ -void -gl_view_delete_selection (glView *view) -{ - GList *object_list; - GList *p; - GList *p_next; - glViewObject *view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - object_list = view->selected_object_list; - view->selected_object_list = NULL; - g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); - - for (p = object_list; p != NULL; p = p_next) { - p_next = p->next; - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_remove (object); - } - - g_list_free (object_list); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Get object property editor of first selected object. */ -/*****************************************************************************/ -GtkWidget * -gl_view_get_editor (glView *view) -{ - glViewObject *view_object; - GtkWidget *editor = NULL; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); - - if (!gl_view_is_selection_empty (view)) { - - view_object = GL_VIEW_OBJECT(view->selected_object_list->data); - editor = gl_view_object_get_editor (view_object); - - } - - gl_debug (DEBUG_VIEW, "END"); - - return editor; -} - -/*****************************************************************************/ -/* Raise selected items to top. */ -/*****************************************************************************/ -void -gl_view_raise_selection (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_raise_to_top (object); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Lower selected items to bottom. */ -/*****************************************************************************/ -void -gl_view_lower_selection (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_lower_to_bottom (object); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Rotate selected objects by given angle. */ -/*****************************************************************************/ -void -gl_view_rotate_selection (glView *view, - gdouble theta_degs) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_rotate (object, theta_degs); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Rotate selected objects 90 degrees left. */ -/*****************************************************************************/ -void -gl_view_rotate_selection_left (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_rotate (object, -90.0); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Rotate selected objects 90 degrees right. */ -/*****************************************************************************/ -void -gl_view_rotate_selection_right (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_rotate (object, 90.0); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Flip selected objects horizontally. */ -/*****************************************************************************/ -void -gl_view_flip_selection_horiz (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_flip_horiz (object); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Flip selected objects vertically. */ -/*****************************************************************************/ -void -gl_view_flip_selection_vert (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_flip_vert (object); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Align selected objects to left most edge. */ -/*****************************************************************************/ -void -gl_view_align_selection_left (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - gdouble dx, x1_min; - glLabelRegion obj_extent; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - g_return_if_fail (!gl_view_is_selection_empty (view) && - !gl_view_is_selection_atomic (view)); - - /* find left most edge */ - p = view->selected_object_list; - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - x1_min = obj_extent.x1; - for (p = p->next; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - if ( obj_extent.x1 < x1_min ) x1_min = obj_extent.x1; - } - - /* now adjust the object positions to line up the left edges */ - for (p = view->selected_object_list; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - dx = x1_min - obj_extent.x1; - gl_label_object_set_position_relative (object, dx, 0.0); - } - - gl_debug (DEBUG_VIEW, "END"); -} - - -/*****************************************************************************/ -/* Align selected objects to right most edge. */ -/*****************************************************************************/ -void -gl_view_align_selection_right (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - gdouble dx, x2_max; - glLabelRegion obj_extent; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - g_return_if_fail (!gl_view_is_selection_empty (view) && - !gl_view_is_selection_atomic (view)); - - /* find right most edge */ - p = view->selected_object_list; - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - x2_max = obj_extent.x2; - for (p = p->next; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - if ( obj_extent.x2 > x2_max ) x2_max = obj_extent.x2; - } - - /* now adjust the object positions to line up the right edges */ - for (p = view->selected_object_list; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - dx = x2_max - obj_extent.x2; - gl_label_object_set_position_relative (object, dx, 0.0); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Align selected objects to horizontal center of objects. */ -/*****************************************************************************/ -void -gl_view_align_selection_hcenter (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - gdouble dx; - gdouble dxmin; - gdouble xsum, xavg; - glLabelRegion obj_extent; - gdouble xcenter; - gint n; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - g_return_if_fail (!gl_view_is_selection_empty (view) && - !gl_view_is_selection_atomic (view)); - - /* find average center of objects */ - xsum = 0.0; - n = 0; - for (p = view->selected_object_list; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - xsum += (obj_extent.x1 + obj_extent.x2) / 2.0; - n++; - } - xavg = xsum / n; - - /* find center of object closest to average center */ - p = view->selected_object_list; - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - dxmin = fabs (xavg - (obj_extent.x1 + obj_extent.x2)/2.0); - xcenter = (obj_extent.x1 + obj_extent.x2)/2.0; - for (p = p->next; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - dx = fabs (xavg - (obj_extent.x1 + obj_extent.x2)/2.0); - if ( dx < dxmin ) - { - dxmin = dx; - xcenter = (obj_extent.x1 + obj_extent.x2)/2.0; - } - } - - /* now adjust the object positions to line up this center */ - for (p = view->selected_object_list; p != NULL; p = p->next) { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - dx = xcenter - (obj_extent.x1 + obj_extent.x2)/2.0; - gl_label_object_set_position_relative (object, dx, 0.0); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Align selected objects to top most edge. */ -/*****************************************************************************/ -void -gl_view_align_selection_top (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - gdouble dy, y1_min; - glLabelRegion obj_extent; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - g_return_if_fail (!gl_view_is_selection_empty (view) && - !gl_view_is_selection_atomic (view)); - - /* find top most edge */ - p = view->selected_object_list; - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - y1_min = obj_extent.y1; - for (p = p->next; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - if ( obj_extent.y1 < y1_min ) y1_min = obj_extent.y1; - } - - /* now adjust the object positions to line up the top edges */ - for (p = view->selected_object_list; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - dy = y1_min - obj_extent.y1; - gl_label_object_set_position_relative (object, 0.0, dy); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Align selected objects to bottom most edge. */ -/*****************************************************************************/ -void -gl_view_align_selection_bottom (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - gdouble dy, y2_max; - glLabelRegion obj_extent; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - g_return_if_fail (!gl_view_is_selection_empty (view) && - !gl_view_is_selection_atomic (view)); - - /* find bottom most edge */ - p = view->selected_object_list; - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - y2_max = obj_extent.y2; - for (p = p->next; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - if ( obj_extent.y2 > y2_max ) y2_max = obj_extent.y2; - } - - /* now adjust the object positions to line up the bottom edges */ - for (p = view->selected_object_list; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - dy = y2_max - obj_extent.y2; - gl_label_object_set_position_relative (object, 0.0, dy); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Align selected objects to viertical center of objects. */ -/*****************************************************************************/ -void -gl_view_align_selection_vcenter (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - gdouble dy; - gdouble dymin; - gdouble ysum, yavg; - glLabelRegion obj_extent; - gdouble ycenter; - gint n; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - g_return_if_fail (!gl_view_is_selection_empty (view) && - !gl_view_is_selection_atomic (view)); - - /* find average center of objects */ - ysum = 0.0; - n = 0; - for (p = view->selected_object_list; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - ysum += (obj_extent.y1 + obj_extent.y2) / 2.0; - n++; - } - yavg = ysum / n; - - /* find center of object closest to average center */ - p = view->selected_object_list; - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - dymin = fabs (yavg - (obj_extent.y1 + obj_extent.y2)/2.0); - ycenter = (obj_extent.y1 + obj_extent.y2)/2.0; - for (p = p->next; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - dy = fabs (yavg - (obj_extent.y1 + obj_extent.y2)/2.0); - if ( dy < dymin ) - { - dymin = dy; - ycenter = (obj_extent.y1 + obj_extent.y2)/2.0; - } - } - - /* now adjust the object positions to line up this center */ - for (p = view->selected_object_list; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - dy = ycenter - (obj_extent.y1 + obj_extent.y2)/2.0; - gl_label_object_set_position_relative (object, 0.0, dy); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Center selected objects to in center of label. */ -/*****************************************************************************/ -void -gl_view_center_selection_horiz (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - gdouble dx; - gdouble x_label_center; - gdouble x_obj_center; - glLabelRegion obj_extent; - gdouble w, h; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - g_return_if_fail (!gl_view_is_selection_empty (view)); - - gl_label_get_size (view->label, &w, &h); - x_label_center = w / 2.0; - - /* adjust the object positions */ - for (p = view->selected_object_list; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - x_obj_center = (obj_extent.x1 + obj_extent.x2) / 2.0; - dx = x_label_center - x_obj_center; - gl_label_object_set_position_relative (object, dx, 0.0); - } - - gl_debug (DEBUG_VIEW, "END"); -} - - -/*****************************************************************************/ -/* Center selected objects to in center of label. */ -/*****************************************************************************/ -void -gl_view_center_selection_vert (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - gdouble dy; - gdouble y_label_center; - gdouble y_obj_center; - glLabelRegion obj_extent; - gdouble w, h; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - g_return_if_fail (!gl_view_is_selection_empty (view)); - - gl_label_get_size (view->label, &w, &h); - y_label_center = h / 2.0; - - /* adjust the object positions */ - for (p = view->selected_object_list; p != NULL; p = p->next) - { - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - gl_label_object_get_extent (object, &obj_extent); - y_obj_center = (obj_extent.y1 + obj_extent.y2) / 2.0; - dy = y_label_center - y_obj_center; - gl_label_object_set_position_relative (object, 0.0, dy); - } - - gl_debug (DEBUG_VIEW, "END"); -} - - -/*****************************************************************************/ -/* Move selected objects */ -/*****************************************************************************/ -void -gl_view_move_selection (glView *view, - gdouble dx, - gdouble dy) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) - { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - gl_label_object_set_position_relative (object, dx, dy); - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Can text properties be set for selection? */ -/*****************************************************************************/ -gboolean -gl_view_can_selection_text (glView *view) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, ""); - - g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); - - for (p = view->selected_object_list; p != NULL; p = p->next) - { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - if (gl_label_object_can_text (object)) - { - return TRUE; - } - - } - - return FALSE; -} - -/*****************************************************************************/ -/* Set font family for all text contained in selected objects. */ -/*****************************************************************************/ -void -gl_view_set_selection_font_family (glView *view, - const gchar *font_family) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - gl_label_object_set_font_family (object, font_family); - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Set font size for all text contained in selected objects. */ -/*****************************************************************************/ -void -gl_view_set_selection_font_size (glView *view, - gdouble font_size) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - gl_label_object_set_font_size (object, font_size); - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Set font weight for all text contained in selected objects. */ -/*****************************************************************************/ -void -gl_view_set_selection_font_weight (glView *view, - PangoWeight font_weight) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - gl_label_object_set_font_weight (object, font_weight); - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Set font italic flag for all text contained in selected objects. */ -/*****************************************************************************/ -void -gl_view_set_selection_font_italic_flag (glView *view, - gboolean font_italic_flag) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - gl_label_object_set_font_italic_flag (object, font_italic_flag); - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Set text alignment for all text contained in selected objects. */ -/*****************************************************************************/ -void -gl_view_set_selection_text_alignment (glView *view, - PangoAlignment text_alignment) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - gl_label_object_set_text_alignment (object, text_alignment); - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Set text line spacing for all text contained in selected objects. */ -/*****************************************************************************/ -void -gl_view_set_selection_text_line_spacing (glView *view, - gdouble text_line_spacing) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - gl_label_object_set_text_line_spacing (object, text_line_spacing); - - } - - gl_debug (DEBUG_VIEW, "END"); -} -/*****************************************************************************/ -/* Set text color for all text contained in selected objects. */ -/*****************************************************************************/ -void -gl_view_set_selection_text_color (glView *view, - glColorNode *text_color_node) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - gl_label_object_set_text_color (object, text_color_node); - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Can fill properties be set for selection? */ -/*****************************************************************************/ -gboolean -gl_view_can_selection_fill (glView *view) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, ""); - - g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - if (gl_label_object_can_fill (object)) { - return TRUE; - } - - } - - return FALSE; -} - -/*****************************************************************************/ -/* Set fill color for all selected objects. */ -/*****************************************************************************/ -void -gl_view_set_selection_fill_color (glView *view, - glColorNode *fill_color_node) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - gl_label_object_set_fill_color (object, fill_color_node); - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Can line color properties be set for selection? */ -/*****************************************************************************/ -gboolean -gl_view_can_selection_line_color (glView *view) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, ""); - - g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - if (gl_label_object_can_line_color (object)) { - return TRUE; - } - - } - - return FALSE; -} - -/*****************************************************************************/ -/* Set line color for all selected objects. */ -/*****************************************************************************/ -void -gl_view_set_selection_line_color (glView *view, - glColorNode *line_color_node) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - gl_label_object_set_line_color (object, line_color_node); - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Can line width properties be set for selection? */ -/*****************************************************************************/ -gboolean -gl_view_can_selection_line_width (glView *view) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, ""); - - g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - if (gl_label_object_can_line_width (object)) { - return TRUE; - } - - } - - return FALSE; -} - -/*****************************************************************************/ -/* Set line width for all selected objects. */ -/*****************************************************************************/ -void -gl_view_set_selection_line_width (glView *view, - gdouble line_width) -{ - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); - gl_label_object_set_line_width (object, line_width); - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* "Cut" selected items and place in clipboard selections. */ -/*****************************************************************************/ -void -gl_view_cut (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - gl_view_copy (view); - gl_view_delete_selection (view); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* "Copy" selected items to clipboard selections. */ -/*****************************************************************************/ -void -gl_view_copy (glView *view) -{ - GList *p; - glViewObject *view_object; - glLabelObject *object; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - if (view->selected_object_list) { - - if ( view->selection_data ) { - g_object_unref (view->selection_data); - } - view->selection_data = GL_LABEL(gl_label_new ()); - gl_label_set_template (view->selection_data, view->label->template); - gl_label_set_rotate_flag (view->selection_data, view->label->rotate_flag); - - for (p = view->selected_object_list; p != NULL; p = p->next) { - - view_object = GL_VIEW_OBJECT (p->data); - object = gl_view_object_get_object (view_object); - - gl_label_object_dup (object, view->selection_data); - - } - - gtk_selection_owner_set (view->invisible, - clipboard_atom, GDK_CURRENT_TIME); - view->have_selection = TRUE; - - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* "Paste" from private clipboard selection. */ -/*****************************************************************************/ -void -gl_view_paste (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - gtk_selection_convert (GTK_WIDGET (view->invisible), - clipboard_atom, GDK_SELECTION_TYPE_STRING, - GDK_CURRENT_TIME); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Zoom in one "notch" */ -/*****************************************************************************/ -void -gl_view_zoom_in (glView *view) -{ - gint i, i_min; - gdouble dist, dist_min; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - /* Find index of current scale (or best match) */ - i_min = 1; /* start with 2nd largest scale */ - dist_min = fabs (zooms[1] - view->zoom); - for (i = 2; i < N_ZOOMS; i++) { - dist = fabs (zooms[i] - view->zoom); - if (dist < dist_min) { - i_min = i; - dist_min = dist; - } - } - - /* zoom in one "notch" */ - i = MAX (0, i_min - 1); - gl_debug (DEBUG_VIEW, "zoom[%d] = %g", i, zooms[i]); - set_zoom_real (view, zooms[i], FALSE); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Zoom out one "notch" */ -/*****************************************************************************/ -void -gl_view_zoom_out (glView *view) -{ - gint i, i_min; - gdouble dist, dist_min; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - /* Find index of current scale (or best match) */ - i_min = 0; /* start with largest scale */ - dist_min = fabs (zooms[0] - view->zoom); - for (i = 1; i < N_ZOOMS; i++) { - dist = fabs (zooms[i] - view->zoom); - if (dist < dist_min) { - i_min = i; - dist_min = dist; - } - } - - /* zoom out one "notch" */ - if (i_min >= N_ZOOMS) - return; - i = i_min + 1; - if (i >= N_ZOOMS) - return; - set_zoom_real (view, zooms[i], FALSE); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*****************************************************************************/ -/* Set zoom to best fit. */ -/*****************************************************************************/ -void -gl_view_zoom_to_fit (glView *view) -{ - gint w_view, h_view; - gdouble w_label, h_label; - gdouble x_scale, y_scale, scale; - - gl_debug (DEBUG_VIEW, ""); - - if ( ! GTK_WIDGET_VISIBLE(view)) { - set_zoom_real (view, 1.0, TRUE); - return; - } - - w_view = GTK_WIDGET(view)->allocation.width; - h_view = GTK_WIDGET(view)->allocation.height; - - gl_label_get_size (GL_LABEL(view->label), &w_label, &h_label); - - gl_debug (DEBUG_VIEW, "View size: %d, %d", w_view, h_view); - gl_debug (DEBUG_VIEW, "Label size: %g, %g", w_label, h_label); - - /* Calculate best scale */ - x_scale = (double)(w_view - ZOOMTOFIT_PAD) / w_label; - y_scale = (double)(h_view - ZOOMTOFIT_PAD) / h_label; - scale = MIN (x_scale, y_scale); - gl_debug (DEBUG_VIEW, "Candidate zooms: %g, %g => %g", x_scale, y_scale, scale); - - /* Limit */ - gl_debug (DEBUG_VIEW, "Scale: %g", scale); - scale = MIN (scale, zooms[0]*view->home_scale); - scale = MAX (scale, zooms[N_ZOOMS-1]*view->home_scale); - gl_debug (DEBUG_VIEW, "Limitted scale: %g", scale); - - set_zoom_real (view, scale/view->home_scale, TRUE); -} - -/*****************************************************************************/ -/* Set current zoom factor to explicit value. */ -/*****************************************************************************/ -void -gl_view_set_zoom (glView *view, - gdouble zoom) -{ - gl_debug (DEBUG_VIEW, "START"); - - set_zoom_real (view, zoom, FALSE); - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Set canvas scale. */ -/*---------------------------------------------------------------------------*/ -static void -set_zoom_real (glView *view, - gdouble zoom, - gboolean zoom_to_fit_flag) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (zoom > 0.0); - - /* Limit, if needed */ - gl_debug (DEBUG_VIEW, "Zoom requested: %g", zoom); - zoom = MIN (zoom, zooms[0]); - zoom = MAX (zoom, zooms[N_ZOOMS-1]); - gl_debug (DEBUG_VIEW, "Limitted zoom: %g", zoom); - - if ( zoom != view->zoom ) { - - view->zoom = zoom; - view->zoom_to_fit_flag = zoom_to_fit_flag; - - gl_view_update (view); - - g_signal_emit (G_OBJECT(view), signals[ZOOM_CHANGED], 0, zoom); - - } - - gl_debug (DEBUG_VIEW, "END"); - -} - - -/*****************************************************************************/ -/* Get current zoom factor. */ -/*****************************************************************************/ -gdouble -gl_view_get_zoom (glView *view) -{ - gl_debug (DEBUG_VIEW, ""); - - g_return_val_if_fail (view && GL_IS_VIEW (view), 1.0); - - return view->zoom; -} - -/*****************************************************************************/ -/* Is this the maximum zoom level. */ -/*****************************************************************************/ -gboolean -gl_view_is_zoom_max (glView *view) -{ - gl_debug (DEBUG_VIEW, ""); - - g_return_val_if_fail (GL_IS_VIEW (view), FALSE); - - return view->zoom >= zooms[0]; -} - -/*****************************************************************************/ -/* Is this the minimum zoom level. */ -/*****************************************************************************/ -gboolean -gl_view_is_zoom_min (glView *view) -{ - gl_debug (DEBUG_VIEW, ""); - - g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); - - return view->zoom <= zooms[N_ZOOMS-1]; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Handle "selection-clear" signal. */ -/*---------------------------------------------------------------------------*/ -static void -selection_clear_cb (GtkWidget *widget, - GdkEventSelection *event, - glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->have_selection = FALSE; - g_object_unref (view->selection_data); - view->selection_data = NULL; - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Handle "selection-get" signal. */ -/*---------------------------------------------------------------------------*/ -static void -selection_get_cb (GtkWidget *widget, - GtkSelectionData *selection_data, - guint info, - guint time, - glView *view) -{ - gchar *buffer; - glXMLLabelStatus status; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - if (view->have_selection) { - - buffer = gl_xml_label_save_buffer (view->selection_data, - &status); - gtk_selection_data_set (selection_data, - GDK_SELECTION_TYPE_STRING, 8, - (guchar *)buffer, strlen (buffer)); - g_free (buffer); - } - - gl_debug (DEBUG_VIEW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Handle "selection-received" signal. (Result of Paste) */ -/*---------------------------------------------------------------------------*/ -static void -selection_received_cb (GtkWidget *widget, - GtkSelectionData *selection_data, - guint time, - glView *view) -{ - glLabel *label = NULL; - glXMLLabelStatus status; - GList *p, *p_next; - glLabelObject *object, *newobject; - - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - if (selection_data->length < 0) { - return; - } - if (selection_data->type != GDK_SELECTION_TYPE_STRING) { - return; - } - - gl_view_unselect_all (view); - - label = gl_xml_label_open_buffer ((gchar *)selection_data->data, &status); - for (p = label->objects; p != NULL; p = p_next) { - p_next = p->next; - - object = (glLabelObject *) p->data; - newobject = gl_label_object_dup (object, view->label); - - gl_debug (DEBUG_VIEW, "object pasted"); - } - g_object_unref (label); - - gl_debug (DEBUG_VIEW, "END"); -} - -/****************************************************************************/ -/* Set default font family. */ -/****************************************************************************/ -void -gl_view_set_default_font_family (glView *view, - const gchar *font_family) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - if (view->default_font_family) { - g_free (view->default_font_family); - } - view->default_font_family = g_strdup (font_family); - - gl_debug (DEBUG_VIEW, "END"); -} - - -/****************************************************************************/ -/* Set default font size. */ -/****************************************************************************/ -void -gl_view_set_default_font_size (glView *view, - gdouble font_size) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->default_font_size = font_size; - - gl_debug (DEBUG_VIEW, "END"); -} - - -/****************************************************************************/ -/* Set default font weight. */ -/****************************************************************************/ -void -gl_view_set_default_font_weight (glView *view, - PangoWeight font_weight) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->default_font_weight = font_weight; - - gl_debug (DEBUG_VIEW, "END"); -} - - -/****************************************************************************/ -/* Set default font italic flag. */ -/****************************************************************************/ -void -gl_view_set_default_font_italic_flag (glView *view, - gboolean font_italic_flag) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->default_font_italic_flag = font_italic_flag; - - gl_debug (DEBUG_VIEW, "END"); -} - - -/****************************************************************************/ -/* Set default text color. */ -/****************************************************************************/ -void -gl_view_set_default_text_color (glView *view, - guint text_color) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->default_text_color = text_color; - - gl_debug (DEBUG_VIEW, "END"); -} - - -/****************************************************************************/ -/* Set default text alignment. */ -/****************************************************************************/ -void -gl_view_set_default_text_alignment (glView *view, - PangoAlignment text_alignment) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->default_text_alignment = text_alignment; - gl_debug (DEBUG_VIEW, "END"); -} - -/****************************************************************************/ -/* Set default text line spacing. */ -/****************************************************************************/ -void -gl_view_set_default_text_line_spacing (glView *view, - gdouble text_line_spacing) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->default_text_line_spacing = text_line_spacing; - - gl_debug (DEBUG_VIEW, "END"); -} - - -/****************************************************************************/ -/* Set default line width. */ -/****************************************************************************/ -void -gl_view_set_default_line_width (glView *view, - gdouble line_width) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->default_line_width = line_width; - - gl_debug (DEBUG_VIEW, "END"); -} - - -/****************************************************************************/ -/* Set default line color. */ -/****************************************************************************/ -void -gl_view_set_default_line_color (glView *view, - guint line_color) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->default_line_color = line_color; - - gl_debug (DEBUG_VIEW, "END"); -} - - -/****************************************************************************/ -/* Set default fill color. */ -/****************************************************************************/ -void -gl_view_set_default_fill_color (glView *view, - guint fill_color) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - - view->default_fill_color = fill_color; - - gl_debug (DEBUG_VIEW, "END"); -} - - - -/****************************************************************************/ -/* Get default font family. */ -/****************************************************************************/ -gchar * -gl_view_get_default_font_family (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); - - gl_debug (DEBUG_VIEW, "END"); - - return g_strdup (view->default_font_family); -} - - -/****************************************************************************/ -/* Get default font size. */ -/****************************************************************************/ -gdouble -gl_view_get_default_font_size (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view && GL_IS_VIEW (view), 12.0); - - gl_debug (DEBUG_VIEW, "END"); - - return view->default_font_size; -} - - -/****************************************************************************/ -/* Get default font weight. */ -/****************************************************************************/ -PangoWeight -gl_view_get_default_font_weight (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view && GL_IS_VIEW (view), PANGO_WEIGHT_NORMAL); - - gl_debug (DEBUG_VIEW, "END"); - - return view->default_font_weight; -} - - -/****************************************************************************/ -/* Get default font italic flag. */ -/****************************************************************************/ -gboolean -gl_view_get_default_font_italic_flag (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); - - gl_debug (DEBUG_VIEW, "END"); - - return view->default_font_italic_flag; -} - - -/****************************************************************************/ -/* Get default text color. */ -/****************************************************************************/ -guint -gl_view_get_default_text_color (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view && GL_IS_VIEW (view), 0); - - gl_debug (DEBUG_VIEW, "END"); - - return view->default_text_color; -} - - -/****************************************************************************/ -/* Get default text alignment. */ -/****************************************************************************/ -PangoAlignment -gl_view_get_default_text_alignment (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view && GL_IS_VIEW (view), PANGO_ALIGN_LEFT); - - gl_debug (DEBUG_VIEW, "END"); - - return view->default_text_alignment; -} - -/****************************************************************************/ -/* Get default text line spacing. */ -/****************************************************************************/ -gdouble -gl_view_get_default_text_line_spacing (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view && GL_IS_VIEW (view), 1.0); - - gl_debug (DEBUG_VIEW, "END"); - - return view->default_text_line_spacing; -} - - - -/****************************************************************************/ -/* Get default line width. */ -/****************************************************************************/ -gdouble -gl_view_get_default_line_width (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view && GL_IS_VIEW (view), 1.0); - - gl_debug (DEBUG_VIEW, "END"); - - return view->default_line_width; -} - - -/****************************************************************************/ -/* Get default line color. */ -/****************************************************************************/ -guint -gl_view_get_default_line_color (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view && GL_IS_VIEW (view), 0); - - gl_debug (DEBUG_VIEW, "END"); - - return view->default_line_color; -} - - -/****************************************************************************/ -/* Get default fill color. */ -/****************************************************************************/ -guint -gl_view_get_default_fill_color (glView *view) -{ - gl_debug (DEBUG_VIEW, "START"); - - g_return_val_if_fail (view && GL_IS_VIEW (view), 0); - - gl_debug (DEBUG_VIEW, "END"); - - return view->default_fill_color; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Focus in event handler. */ -/*---------------------------------------------------------------------------*/ -static gboolean -focus_in_event_cb (glView *view, - GdkEventFocus *event) -{ - GTK_WIDGET_SET_FLAGS (GTK_WIDGET (view->canvas), GTK_HAS_FOCUS); - - return FALSE; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Focus out event handler. */ -/*---------------------------------------------------------------------------*/ -static gboolean -focus_out_event_cb (glView *view, - GdkEventFocus *event) -{ - GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (view->canvas), GTK_HAS_FOCUS); - - return FALSE; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Enter notify event handler. */ -/*---------------------------------------------------------------------------*/ -static gboolean -enter_notify_event_cb (glView *view, - GdkEventCrossing *event) -{ - gtk_widget_grab_focus(GTK_WIDGET (view->canvas)); - - return FALSE; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Leave notify event handler. */ -/*---------------------------------------------------------------------------*/ -static gboolean -leave_notify_event_cb (glView *view, - GdkEventCrossing *event) -{ - - g_signal_emit (G_OBJECT(view), signals[POINTER_EXIT], 0); - - return FALSE; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Motion notify event handler. */ -/*---------------------------------------------------------------------------*/ -static gboolean -motion_notify_event_cb (glView *view, - GdkEventMotion *event) -{ - gboolean return_value = FALSE; - cairo_t *cr; - gdouble scale; - gdouble x, y; - GdkCursor *cursor; - glViewObjectHandle handle; - - cr = gdk_cairo_create (GTK_LAYOUT (view->canvas)->bin_window); - - /* - * Translate to label coordinates - */ - scale = view->zoom * view->home_scale; - cairo_scale (cr, scale, scale); - cairo_translate (cr, view->x0, view->y0); - - x = event->x; - y = event->y; - cairo_device_to_user (cr, &x, &y); - - /* - * Emit signal regardless of mode - */ - g_signal_emit (G_OBJECT(view), signals[POINTER_MOVED], 0, x, y); - - /* - * Handle event as appropriate for mode - */ - switch (view->mode) - { - - case GL_VIEW_MODE_ARROW: - switch (view->state) - { - - case GL_VIEW_IDLE: - if ( gl_view_is_selection_atomic (view) && - view_handle_at (view, cr, event->x, event->y, &handle) ) - { - cursor = gdk_cursor_new (GDK_CROSSHAIR); - } - else if (view_view_object_at (view, cr, event->x, event->y)) - { - cursor = gdk_cursor_new (GDK_FLEUR); - } - else - { - cursor = gdk_cursor_new (GDK_LEFT_PTR); - } - gdk_window_set_cursor (view->canvas->window, cursor); - gdk_cursor_unref (cursor); - break; - - case GL_VIEW_ARROW_SELECT_REGION: -#ifdef CLIP_UPDATES - gl_view_update_region (view, cr, &view->select_region); -#endif - view->select_region.x2 = x; - view->select_region.y2 = y; -#ifdef CLIP_UPDATES - gl_view_update_region (view, cr, &view->select_region); -#else - gl_view_update (view); -#endif - break; - - case GL_VIEW_ARROW_MOVE: - gl_view_move_selection (view, - (x - view->move_last_x), - (y - view->move_last_y)); - view->move_last_x = x; - view->move_last_y = y; - break; - - case GL_VIEW_ARROW_RESIZE: - gl_view_object_resize_event (view->resize_object, - view->resize_handle, - view->resize_honor_aspect, - cr, - event->x, - event->y); - break; - - default: - g_message ("Invalid arrow state."); /*Should not happen!*/ - } - return_value = TRUE; - break; - - - case GL_VIEW_MODE_OBJECT_CREATE: - if (view->state != GL_VIEW_IDLE) - { - switch (view->create_type) - { - case GL_LABEL_OBJECT_BOX: - gl_view_box_create_motion_event (view, x, y); - break; - case GL_LABEL_OBJECT_ELLIPSE: - gl_view_ellipse_create_motion_event (view, x, y); - break; - case GL_LABEL_OBJECT_LINE: - gl_view_line_create_motion_event (view, x, y); - break; - case GL_LABEL_OBJECT_IMAGE: - gl_view_image_create_motion_event (view, x, y); - break; - case GL_LABEL_OBJECT_TEXT: - gl_view_text_create_motion_event (view, x, y); - break; - case GL_LABEL_OBJECT_BARCODE: - gl_view_barcode_create_motion_event (view, x, y); - break; - default: - g_message ("Invalid create type."); /*Should not happen!*/ - } - } - break; - - - default: - g_message ("Invalid view mode."); /*Should not happen!*/ - - } - - cairo_destroy (cr); - - /* - * FIXME: we re-establish grabs here if the grab has been lost. We seem to be - * losing grabs when we emit signals that lead to the manipulation of - * the GtkUIManager. Needs more investigation - */ - if (view->grabbed_flag && !gdk_pointer_is_grabbed ()) - { - gdk_pointer_grab (GTK_LAYOUT (view->canvas)->bin_window, - FALSE, - (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK), - NULL, - NULL, - event->time); - } - - return return_value; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Button press event handler. */ -/*---------------------------------------------------------------------------*/ -static gboolean -button_press_event_cb (glView *view, - GdkEventButton *event) -{ - gboolean return_value = FALSE; - cairo_t *cr; - gdouble scale; - gdouble x, y; - glViewObject *view_object; - glViewObjectHandle handle; - - cr = gdk_cairo_create (GTK_LAYOUT (view->canvas)->bin_window); - - /* - * Translate to label coordinates - */ - scale = view->zoom * view->home_scale; - cairo_scale (cr, scale, scale); - cairo_translate (cr, view->x0, view->y0); - - x = event->x; - y = event->y; - cairo_device_to_user (cr, &x, &y); - - switch (event->button) - { - - case 1: - /* - * Handle event as appropriate for mode - */ - switch (view->mode) - { - case GL_VIEW_MODE_ARROW: - if ( gl_view_is_selection_atomic (view) && - (view_object = view_handle_at (view, cr, event->x, event->y, &handle)) ) - { - view->resize_object = view_object; - view->resize_handle = handle; - view->resize_honor_aspect = event->state & GDK_CONTROL_MASK; - - view->state = GL_VIEW_ARROW_RESIZE; - } - else if ((view_object = view_view_object_at (view, cr, event->x, event->y))) - { - if (event->state & GDK_CONTROL_MASK) - { - if (gl_view_is_object_selected (view, view_object)) - { - /* Un-selecting a selected item */ - gl_view_unselect_object (view, view_object); - } else { - /* Add to current selection */ - gl_view_select_object (view, view_object); - } - } - else - { - if (!gl_view_is_object_selected (view, view_object)) - { - /* remove any selections before adding */ - gl_view_unselect_all (view); - /* Add to current selection */ - gl_view_select_object (view, view_object); - } - } - view->move_last_x = x; - view->move_last_y = y; - - view->state = GL_VIEW_ARROW_MOVE; - } - else - { - if (!(event->state & GDK_CONTROL_MASK)) - { - gl_view_unselect_all (view); - } - - view->select_region_visible = TRUE; - view->select_region.x1 = x; - view->select_region.y1 = y; - view->select_region.x2 = x; - view->select_region.y2 = y; - - view->state = GL_VIEW_ARROW_SELECT_REGION; - } - - - return_value = TRUE; - break; - - case GL_VIEW_MODE_OBJECT_CREATE: - switch (view->create_type) - { - case GL_LABEL_OBJECT_BOX: - gl_view_box_create_button_press_event (view, x, y); - break; - case GL_LABEL_OBJECT_ELLIPSE: - gl_view_ellipse_create_button_press_event (view, x, y); - break; - case GL_LABEL_OBJECT_LINE: - gl_view_line_create_button_press_event (view, x, y); - break; - case GL_LABEL_OBJECT_IMAGE: - gl_view_image_create_button_press_event (view, x, y); - break; - case GL_LABEL_OBJECT_TEXT: - gl_view_text_create_button_press_event (view, x, y); - break; - case GL_LABEL_OBJECT_BARCODE: - gl_view_barcode_create_button_press_event (view, x, y); - break; - default: - g_message ("Invalid create type."); /*Should not happen!*/ - } - view->state = GL_VIEW_CREATE_DRAG; - return_value = TRUE; - break; - - default: - g_message ("Invalid view mode."); /*Should not happen!*/ - } - - view->grabbed_flag = TRUE; - gdk_pointer_grab (GTK_LAYOUT (view->canvas)->bin_window, - FALSE, - (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK), - NULL, - NULL, - event->time); - break; - - case 3: - g_signal_emit (G_OBJECT (view), - signals[CONTEXT_MENU_ACTIVATE], 0, - event->button, event->time); - return_value = TRUE; - break; - - } - - cairo_destroy (cr); - - return return_value; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Button release event handler. */ -/*---------------------------------------------------------------------------*/ -static gboolean -button_release_event_cb (glView *view, - GdkEventButton *event) -{ - gboolean return_value = FALSE; - cairo_t *cr; - gdouble scale; - gdouble x, y; - GdkCursor *cursor; - - cr = gdk_cairo_create (GTK_LAYOUT (view->canvas)->bin_window); - - /* - * Translate to label coordinates - */ - scale = view->zoom * view->home_scale; - cairo_scale (cr, scale, scale); - cairo_translate (cr, view->x0, view->y0); - - x = event->x; - y = event->y; - cairo_device_to_user (cr, &x, &y); - - switch (event->button) - { - - case 1: - view->grabbed_flag = FALSE; - gdk_pointer_ungrab (event->time); - /* - * Handle event as appropriate for mode - */ - switch (view->mode) - { - case GL_VIEW_MODE_ARROW: - switch (view->state) - { - case GL_VIEW_ARROW_RESIZE: - view->resize_object = NULL; - - view->state = GL_VIEW_IDLE; - break; - - case GL_VIEW_ARROW_SELECT_REGION: -#ifdef CLIP_UPDATES - gl_view_update_region (view, cr, &view->select_region); -#else - gl_view_update (view); -#endif - - view->select_region_visible = FALSE; - view->select_region.x2 = x; - view->select_region.y2 = y; - - gl_view_select_region (view, &view->select_region); - - view->state = GL_VIEW_IDLE; - break; - - default: - view->state = GL_VIEW_IDLE; - break; - - } - - return_value = TRUE; - break; - - - case GL_VIEW_MODE_OBJECT_CREATE: - switch (view->create_type) - { - case GL_LABEL_OBJECT_BOX: - gl_view_box_create_button_release_event (view, x, y); - break; - case GL_LABEL_OBJECT_ELLIPSE: - gl_view_ellipse_create_button_release_event (view, x, y); - break; - case GL_LABEL_OBJECT_LINE: - gl_view_line_create_button_release_event (view, x, y); - break; - case GL_LABEL_OBJECT_IMAGE: - gl_view_image_create_button_release_event (view, x, y); - break; - case GL_LABEL_OBJECT_TEXT: - gl_view_text_create_button_release_event (view, x, y); - break; - case GL_LABEL_OBJECT_BARCODE: - gl_view_barcode_create_button_release_event (view, x, y); - break; - default: - g_message ("Invalid create type."); /*Should not happen!*/ - } - view->mode = GL_VIEW_MODE_ARROW; - view->state = GL_VIEW_IDLE; - cursor = gdk_cursor_new (GDK_LEFT_PTR); - gdk_window_set_cursor (view->canvas->window, cursor); - gdk_cursor_unref (cursor); - break; - - - default: - g_message ("Invalid view mode."); /*Should not happen!*/ - } - - } - - cairo_destroy (cr); - - return return_value; -} - -/*---------------------------------------------------------------------------*/ -/* PRIVATE. Key press event handler. */ -/*---------------------------------------------------------------------------*/ -static gboolean -key_press_event_cb (glView *view, - GdkEventKey *event) -{ - GdkCursor *cursor; - - gl_debug (DEBUG_VIEW, ""); - - if ( (view->mode == GL_VIEW_MODE_ARROW) && - (view->state == GL_VIEW_IDLE) ) - { - switch (event->keyval) { - - case GDK_Left: - case GDK_KP_Left: - gl_view_move_selection (view, -1.0 / (view->zoom), 0.0); - break; - case GDK_Up: - case GDK_KP_Up: - gl_view_move_selection (view, 0.0, -1.0 / (view->zoom)); - break; - case GDK_Right: - case GDK_KP_Right: - gl_view_move_selection (view, 1.0 / (view->zoom), 0.0); - break; - case GDK_Down: - case GDK_KP_Down: - gl_view_move_selection (view, 0.0, 1.0 / (view->zoom)); - break; - case GDK_Delete: - case GDK_KP_Delete: - gl_view_delete_selection (view); - cursor = gdk_cursor_new (GDK_LEFT_PTR); - gdk_window_set_cursor (GTK_WIDGET (view->canvas)->window -, cursor); - gdk_cursor_unref (cursor); - break; - default: - return FALSE; - - } - } - return TRUE; /* We handled this or we were dragging. */ -} - diff --git a/glabels2/src/view.h b/glabels2/src/view.h deleted file mode 100644 index 38c3ed80..00000000 --- a/glabels2/src/view.h +++ /dev/null @@ -1,357 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * view.h: GLabels View module header file - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __VIEW_H__ -#define __VIEW_H__ - -#include - -#include "label-object.h" - -typedef enum { - GL_VIEW_MODE_ARROW, - GL_VIEW_MODE_OBJECT_CREATE -} glViewMode; - -typedef enum { - GL_VIEW_IDLE = 0, - GL_VIEW_ARROW_SELECT_REGION, - GL_VIEW_ARROW_MOVE, - GL_VIEW_ARROW_RESIZE, - GL_VIEW_CREATE_DRAG, -} glViewState; - -#define GL_TYPE_VIEW (gl_view_get_type ()) -#define GL_VIEW(obj) (GTK_CHECK_CAST((obj), GL_TYPE_VIEW, glView )) -#define GL_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW, glViewClass)) -#define GL_IS_VIEW(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_VIEW)) -#define GL_IS_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW)) - -typedef struct _glView glView; -typedef struct _glViewClass glViewClass; - -#include "view-object.h" -#include "color.h" - -struct _glView { - GtkVBox parent_widget; - - glLabel *label; - - GtkWidget *canvas; - gdouble zoom; - gboolean zoom_to_fit_flag; - gdouble home_scale; - gdouble x0, y0; - gdouble w, h; - - gboolean update_scheduled_flag; - gboolean grid_visible; - gdouble grid_spacing; - - gboolean markup_visible; - - glViewMode mode; - glLabelObjectType create_type; - glViewState state; - gboolean grabbed_flag; - - /* GL_VIEW_ARROW_MOVE state */ - gdouble move_last_x; - gdouble move_last_y; - - /* GL_VIEW_ARROW_SELECT_REGION state */ - gboolean select_region_visible; - glLabelRegion select_region; - - /* GL_VIEW_ARROW_RESIZE state */ - glViewObject *resize_object; - glViewObjectHandle resize_handle; - gboolean resize_honor_aspect; - - /* GL_VIEW_CREATE_DRAG state */ - glLabelObject *create_object; - gdouble create_x0; - gdouble create_y0; - - GList *object_list; /* glViewObjects */ - GList *selected_object_list; /* glViewObjects */ - - /* Clipboard selection stuff */ - gint have_selection; - glLabel *selection_data; - GtkWidget *invisible; - - /* Default object text properties */ - gchar *default_font_family; - gdouble default_font_size; - PangoWeight default_font_weight; - gboolean default_font_italic_flag; - guint default_text_color; - PangoAlignment default_text_alignment; - gdouble default_text_line_spacing; - - /* Default object line properties */ - gdouble default_line_width; - guint default_line_color; - - /* Default object fill properties */ - guint default_fill_color; - -}; - -struct _glViewClass { - GtkVBoxClass parent_class; - - /* Selection changed signal */ - void (*selection_changed) (glView *view, - gpointer user_data); - - /* Signal to launch a context menu */ - void (*context_menu_activate) (glView *view, - gint button, - guint32 activate_time, - gpointer user_data); - - /* Signals to support a status bar */ - void (*zoom_changed) (glView *view, - gdouble zoom, - gpointer user_data); - void (*pointer_moved) (glView *view, - gdouble x, - gdouble y, - gpointer user_data); - void (*pointer_exit) (glView *view, - gpointer user_data); - void (*mode_changed) (glView *view, - gpointer user_data); -}; - -G_BEGIN_DECLS - -GType gl_view_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_view_new (glLabel *label); - - -void gl_view_update (glView *view); - -void gl_view_update_region (glView *view, - cairo_t *cr, - glLabelRegion *region); - -void gl_view_show_grid (glView *view); - -void gl_view_hide_grid (glView *view); - -void gl_view_set_grid_spacing (glView *view, - gdouble spacing); - -void gl_view_show_markup (glView *view); - -void gl_view_hide_markup (glView *view); - -void gl_view_arrow_mode (glView *view); - -void gl_view_object_create_mode (glView *view, - glLabelObjectType type); - - -void gl_view_select_object (glView *view, - glViewObject *view_object); - -void gl_view_unselect_object (glView *view, - glViewObject *view_object); - -void gl_view_select_all (glView *view); - -void gl_view_unselect_all (glView *view); - -void gl_view_select_region (glView *view, - glLabelRegion *region); - -gboolean gl_view_is_object_selected (glView *view, - glViewObject *view_object); - -gboolean gl_view_is_selection_empty (glView *view); - -gboolean gl_view_is_selection_atomic (glView *view); - -void gl_view_delete_selection (glView *view); - -GtkWidget *gl_view_get_editor (glView *view); - -void gl_view_raise_selection (glView *view); - -void gl_view_lower_selection (glView *view); - -void gl_view_rotate_selection (glView *view, - gdouble theta_degs); - -void gl_view_rotate_selection_left (glView *view); - -void gl_view_rotate_selection_right (glView *view); - -void gl_view_flip_selection_horiz (glView *view); - -void gl_view_flip_selection_vert (glView *view); - -void gl_view_align_selection_left (glView *view); - -void gl_view_align_selection_right (glView *view); - -void gl_view_align_selection_hcenter (glView *view); - -void gl_view_align_selection_top (glView *view); - -void gl_view_align_selection_bottom (glView *view); - -void gl_view_align_selection_vcenter (glView *view); - -void gl_view_center_selection_horiz (glView *view); - -void gl_view_center_selection_vert (glView *view); - -void gl_view_move_selection (glView *view, - gdouble dx, - gdouble dy); - -gboolean gl_view_can_selection_text (glView *view); - -void gl_view_set_selection_font_family (glView *view, - const gchar *font_family); - -void gl_view_set_selection_font_size (glView *view, - gdouble font_size); - -void gl_view_set_selection_font_weight (glView *view, - PangoWeight font_weight); - -void gl_view_set_selection_text_line_spacing (glView *view, - gdouble text_line_spacing); - -void gl_view_set_selection_font_italic_flag (glView *view, - gboolean font_italic_flag); - -void gl_view_set_selection_text_alignment (glView *view, - PangoAlignment text_alignment); - -void gl_view_set_selection_text_color (glView *view, - glColorNode *text_color_node); - -gboolean gl_view_can_selection_fill (glView *view); - -void gl_view_set_selection_fill_color (glView *view, - glColorNode *fill_color); - -gboolean gl_view_can_selection_line_color (glView *view); - -void gl_view_set_selection_line_color (glView *view, - glColorNode *line_color_node); - -gboolean gl_view_can_selection_line_width (glView *view); - -void gl_view_set_selection_line_width (glView *view, - gdouble line_width); - - -void gl_view_cut (glView *view); - -void gl_view_copy (glView *view); - -void gl_view_paste (glView *view); - - -void gl_view_zoom_in (glView *view); - -void gl_view_zoom_out (glView *view); - -void gl_view_zoom_to_fit (glView *view); - -void gl_view_set_zoom (glView *view, - gdouble zoom); - -gdouble gl_view_get_zoom (glView *view); - -gboolean gl_view_is_zoom_max (glView *view); - -gboolean gl_view_is_zoom_min (glView *view); - - -void gl_view_set_default_font_family (glView *view, - const gchar *font_family); - -void gl_view_set_default_font_size (glView *view, - gdouble font_size); - -void gl_view_set_default_font_weight (glView *view, - PangoWeight font_weight); - -void gl_view_set_default_font_italic_flag (glView *view, - gboolean font_italic_flag); - -void gl_view_set_default_text_color (glView *view, - guint text_color); - -void gl_view_set_default_text_alignment (glView *view, - PangoAlignment text_alignment); - -void gl_view_set_default_line_width (glView *view, - gdouble line_width); - -void gl_view_set_default_line_color (glView *view, - guint line_color); - -void gl_view_set_default_fill_color (glView *view, - guint fill_color); -void gl_view_set_default_text_line_spacing (glView *view, - gdouble text_line_spacing); - - - -gchar *gl_view_get_default_font_family (glView *view); - -gdouble gl_view_get_default_font_size (glView *view); - -PangoWeight gl_view_get_default_font_weight (glView *view); - -gboolean gl_view_get_default_font_italic_flag (glView *view); - -guint gl_view_get_default_text_color (glView *view); - -PangoAlignment gl_view_get_default_text_alignment (glView *view); - -gdouble gl_view_get_default_text_line_spacing (glView *view); - -gdouble gl_view_get_default_line_width (glView *view); - -guint gl_view_get_default_line_color (glView *view); - -guint gl_view_get_default_fill_color (glView *view); - - - -G_END_DECLS - -#endif diff --git a/glabels2/src/warning-handler.c b/glabels2/src/warning-handler.c deleted file mode 100644 index 84e32441..00000000 --- a/glabels2/src/warning-handler.c +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * warning-handler.c: non-critical error handler - * - * Copyright (C) 2005 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include - -#include "warning-handler.h" - -#include -#include -#include -#include -#include - -static void warning_handler (const gchar *log_domain, - GLogLevelFlags log_level, - const gchar *message, - gpointer user_data); - - -/***************************************************************************/ -/* Initialize error handler. */ -/***************************************************************************/ -void -gl_warning_handler_init (void) -{ - g_log_set_handler ("LibGlabels", - G_LOG_LEVEL_WARNING, - warning_handler, - "libglabels"); - - g_log_set_handler (G_LOG_DOMAIN, - G_LOG_LEVEL_WARNING, - warning_handler, - "glabels"); -} - -/*-------------------------------------------------------------------------*/ -/* PRIVATE. Actual error handler. */ -/*-------------------------------------------------------------------------*/ -static void -warning_handler (const gchar *log_domain, - GLogLevelFlags log_level, - const gchar *message, - gpointer user_data) -{ - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_CLOSE, - _("gLabels Error!")); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - "%s", message); - - gtk_dialog_run (GTK_DIALOG (dialog)); - - gtk_widget_destroy (GTK_WIDGET (dialog)); -} - diff --git a/glabels2/src/warning-handler.h b/glabels2/src/warning-handler.h deleted file mode 100644 index 911cc16a..00000000 --- a/glabels2/src/warning-handler.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * warning-handler.h: non-critical error handler header file - * - * Copyright (C) 2005 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef __WARNING_HANDLER_H__ -#define __WARNING_HANDLER_H__ - -#include - -G_BEGIN_DECLS - -void gl_warning_handler_init (void); - -G_END_DECLS - -#endif diff --git a/glabels2/src/wdgt-chain-button.c b/glabels2/src/wdgt-chain-button.c deleted file mode 100644 index 7491311f..00000000 --- a/glabels2/src/wdgt-chain-button.c +++ /dev/null @@ -1,324 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* wdgt-chain-button.c - * Modified version of gimpchainbutton.c for gLabels: - * - * LIBGIMP - The GIMP Library - * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball - * - * gimpchainbutton.c - * Copyright (C) 1999-2000 Sven Neumann - * - * Modified or gLabels by Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "wdgt-chain-button.h" - -#include -#include -#include - -#include "stock.h" - - -enum -{ - TOGGLED, - LAST_SIGNAL -}; - - -static void gl_wdgt_chain_button_clicked_callback (GtkWidget *widget, - glWdgtChainButton *button); -static gboolean gl_wdgt_chain_button_draw_lines (GtkWidget *widget, - GdkEventExpose *eevent, - glWdgtChainButton *button); - - -static const gchar *gl_wdgt_chain_stock_items[] = -{ - GL_STOCK_HCHAIN, - GL_STOCK_HCHAIN_BROKEN, - GL_STOCK_VCHAIN, - GL_STOCK_VCHAIN_BROKEN -}; - - -static guint gl_wdgt_chain_button_signals[LAST_SIGNAL] = { 0 }; - - - -G_DEFINE_TYPE (glWdgtChainButton, gl_wdgt_chain_button, GTK_TYPE_TABLE); - - -static void -gl_wdgt_chain_button_class_init (glWdgtChainButtonClass *class) -{ - gl_wdgt_chain_button_parent_class = g_type_class_peek_parent (class); - - gl_wdgt_chain_button_signals[TOGGLED] = - g_signal_new ("toggled", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (glWdgtChainButtonClass, toggled), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - class->toggled = NULL; -} - -static void -gl_wdgt_chain_button_init (glWdgtChainButton *button) -{ - button->position = GL_WDGT_CHAIN_TOP; - button->active = FALSE; - - button->line1 = gtk_drawing_area_new (); - button->line2 = gtk_drawing_area_new (); - button->image = gtk_image_new (); - - button->button = gtk_button_new (); - - gtk_button_set_relief (GTK_BUTTON (button->button), GTK_RELIEF_NONE); - gtk_container_add (GTK_CONTAINER (button->button), button->image); - gtk_widget_show (button->image); - - g_signal_connect (button->button, "clicked", - G_CALLBACK (gl_wdgt_chain_button_clicked_callback), - button); - g_signal_connect (button->line1, "expose_event", - G_CALLBACK (gl_wdgt_chain_button_draw_lines), - button); - g_signal_connect (button->line2, "expose_event", - G_CALLBACK (gl_wdgt_chain_button_draw_lines), - button); -} - - -/** - * gl_wdgt_chain_button_new: - * @position: The position you are going to use for the button - * with respect to the widgets you want to chain. - * - * Creates a new #glWdgtChainButton widget. - * - * This returns a button showing either a broken or a linked chain and - * small clamps attached to both sides that visually group the two widgets - * you want to connect. This widget looks best when attached - * to a table taking up two columns (or rows respectively) next - * to the widgets that it is supposed to connect. It may work - * for more than two widgets, but the look is optimized for two. - * - * Returns: Pointer to the new #glWdgtChainButton, which is inactive - * by default. Use gl_wdgt_chain_button_set_active() to - * change its state. - */ -GtkWidget * -gl_wdgt_chain_button_new (glWdgtChainPosition position) -{ - glWdgtChainButton *button; - - button = g_object_new (GL_WDGT_TYPE_CHAIN_BUTTON, NULL); - - button->position = position; - - gtk_image_set_from_stock - (GTK_IMAGE (button->image), - gl_wdgt_chain_stock_items[((position & GL_WDGT_CHAIN_LEFT) << 1) + ! button->active], - GTK_ICON_SIZE_BUTTON); - - if (position & GL_WDGT_CHAIN_LEFT) /* are we a vertical chainbutton? */ - { - gtk_table_resize (GTK_TABLE (button), 3, 1); - gtk_table_attach (GTK_TABLE (button), button->button, 0, 1, 1, 2, - GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_table_attach_defaults (GTK_TABLE (button), - button->line1, 0, 1, 0, 1); - gtk_table_attach_defaults (GTK_TABLE (button), - button->line2, 0, 1, 2, 3); - } - else - { - gtk_table_resize (GTK_TABLE (button), 1, 3); - gtk_table_attach (GTK_TABLE (button), button->button, 1, 2, 0, 1, - GTK_SHRINK, GTK_SHRINK, 0, 0); - gtk_table_attach_defaults (GTK_TABLE (button), - button->line1, 0, 1, 0, 1); - gtk_table_attach_defaults (GTK_TABLE (button), - button->line2, 2, 3, 0, 1); - } - - gtk_widget_show (button->button); - gtk_widget_show (button->line1); - gtk_widget_show (button->line2); - - return GTK_WIDGET (button); -} - -/** - * gl_wdgt_chain_button_set_active: - * @button: Pointer to a #glWdgtChainButton. - * @active: The new state. - * - * Sets the state of the #glWdgtChainButton to be either locked (%TRUE) or - * unlocked (%FALSE) and changes the showed pixmap to reflect the new state. - */ -void -gl_wdgt_chain_button_set_active (glWdgtChainButton *button, - gboolean active) -{ - g_return_if_fail (GL_WDGT_IS_CHAIN_BUTTON (button)); - - if (button->active != active) - { - guint num; - - button->active = active ? TRUE : FALSE; - - num = ((button->position & GL_WDGT_CHAIN_LEFT) << 1) + (active ? 0 : 1); - - gtk_image_set_from_stock (GTK_IMAGE (button->image), - gl_wdgt_chain_stock_items[num], - GTK_ICON_SIZE_BUTTON); - } -} - -/** - * gl_wdgt_chain_button_get_active - * @button: Pointer to a #glWdgtChainButton. - * - * Checks the state of the #glWdgtChainButton. - * - * Returns: %TRUE if the #glWdgtChainButton is active (locked). - */ -gboolean -gl_wdgt_chain_button_get_active (glWdgtChainButton *button) -{ - g_return_val_if_fail (GL_WDGT_IS_CHAIN_BUTTON (button), FALSE); - - return button->active; -} - -static void -gl_wdgt_chain_button_clicked_callback (GtkWidget *widget, - glWdgtChainButton *button) -{ - g_return_if_fail (GL_WDGT_IS_CHAIN_BUTTON (button)); - - gl_wdgt_chain_button_set_active (button, ! button->active); - - g_signal_emit (button, gl_wdgt_chain_button_signals[TOGGLED], 0); -} - -static gboolean -gl_wdgt_chain_button_draw_lines (GtkWidget *widget, - GdkEventExpose *eevent, - glWdgtChainButton *button) -{ - GdkPoint points[3]; - GdkPoint buf; - GtkShadowType shadow; - glWdgtChainPosition position; - gint which_line; - -#define SHORT_LINE 4 - /* don't set this too high, there's no check against drawing outside - the widgets bounds yet (and probably never will be) */ - - g_return_val_if_fail (GL_WDGT_IS_CHAIN_BUTTON (button), FALSE); - - points[0].x = widget->allocation.width / 2; - points[0].y = widget->allocation.height / 2; - - which_line = (widget == button->line1) ? 1 : -1; - - position = button->position; - - if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - switch (position) - { - case GL_WDGT_CHAIN_LEFT: - position = GL_WDGT_CHAIN_RIGHT; - break; - case GL_WDGT_CHAIN_RIGHT: - position = GL_WDGT_CHAIN_LEFT; - break; - default: - break; - } - - switch (position) - { - case GL_WDGT_CHAIN_LEFT: - points[0].x += SHORT_LINE; - points[1].x = points[0].x - SHORT_LINE; - points[1].y = points[0].y; - points[2].x = points[1].x; - points[2].y = (which_line == 1) ? widget->allocation.height - 1 : 0; - shadow = GTK_SHADOW_ETCHED_IN; - break; - case GL_WDGT_CHAIN_RIGHT: - points[0].x -= SHORT_LINE; - points[1].x = points[0].x + SHORT_LINE; - points[1].y = points[0].y; - points[2].x = points[1].x; - points[2].y = (which_line == 1) ? widget->allocation.height - 1 : 0; - shadow = GTK_SHADOW_ETCHED_OUT; - break; - case GL_WDGT_CHAIN_TOP: - points[0].y += SHORT_LINE; - points[1].x = points[0].x; - points[1].y = points[0].y - SHORT_LINE; - points[2].x = (which_line == 1) ? widget->allocation.width - 1 : 0; - points[2].y = points[1].y; - shadow = GTK_SHADOW_ETCHED_OUT; - break; - case GL_WDGT_CHAIN_BOTTOM: - points[0].y -= SHORT_LINE; - points[1].x = points[0].x; - points[1].y = points[0].y + SHORT_LINE; - points[2].x = (which_line == 1) ? widget->allocation.width - 1 : 0; - points[2].y = points[1].y; - shadow = GTK_SHADOW_ETCHED_IN; - break; - default: - return FALSE; - } - - if ( ((shadow == GTK_SHADOW_ETCHED_OUT) && (which_line == -1)) || - ((shadow == GTK_SHADOW_ETCHED_IN) && (which_line == 1)) ) - { - buf = points[0]; - points[0] = points[2]; - points[2] = buf; - } - - gtk_paint_polygon (widget->style, - widget->window, - GTK_STATE_NORMAL, - shadow, - &eevent->area, - widget, - "chainbutton", - points, - 3, - FALSE); - - return TRUE; -} diff --git a/glabels2/src/wdgt-chain-button.h b/glabels2/src/wdgt-chain-button.h deleted file mode 100644 index 382af2a4..00000000 --- a/glabels2/src/wdgt-chain-button.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* wdgt-chain-button.h - * Modified version of gimpchainbutton.h for gLabels: - * - * LIBGIMP - The GIMP Library - * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball - * - * gimpchainbutton.h - * Copyright (C) 1999-2000 Sven Neumann - * - * Modified or gLabels by Jim Evins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * This implements a widget derived from GtkTable that visualizes - * it's state with two different pixmaps showing a closed and a - * broken chain. It's intented to be used with the GimpSizeEntry - * widget. The usage is quite similar to the one the GtkToggleButton - * provides. - */ - -#ifndef __WDGT_CHAIN_BUTTON_H__ -#define __WDGT_CHAIN_BUTTON_H__ - -#include - -G_BEGIN_DECLS - - -typedef enum -{ - GL_WDGT_CHAIN_TOP, - GL_WDGT_CHAIN_LEFT, - GL_WDGT_CHAIN_BOTTOM, - GL_WDGT_CHAIN_RIGHT -} glWdgtChainPosition; - - -#define GL_WDGT_TYPE_CHAIN_BUTTON (gl_wdgt_chain_button_get_type ()) -#define GL_WDGT_CHAIN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_WDGT_TYPE_CHAIN_BUTTON, glWdgtChainButton)) -#define GL_WDGT_CHAIN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_WDGT_TYPE_CHAIN_BUTTON, glWdgtChainButtonClass)) -#define GL_WDGT_IS_CHAIN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_WDGT_TYPE_CHAIN_BUTTON)) -#define GL_WDGT_IS_CHAIN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_WDGT_TYPE_CHAIN_BUTTON)) -#define GL_WDGT_CHAIN_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GL_WDGT_TYPE_CHAIN_BUTTON, glWdgtChainButtonClass)) - - -typedef struct _glWdgtChainButton glWdgtChainButton; -typedef struct _glWdgtChainButtonClass glWdgtChainButtonClass; - -struct _glWdgtChainButton -{ - GtkTable parent_instance; - - glWdgtChainPosition position; - gboolean active; - - GtkWidget *button; - GtkWidget *line1; - GtkWidget *line2; - GtkWidget *image; -}; - -struct _glWdgtChainButtonClass -{ - GtkTableClass parent_class; - - void (* toggled) (glWdgtChainButton *button); -}; - - -GType gl_wdgt_chain_button_get_type (void) G_GNUC_CONST; - -GtkWidget * gl_wdgt_chain_button_new (glWdgtChainPosition position); - -void gl_wdgt_chain_button_set_active (glWdgtChainButton *button, - gboolean active); -gboolean gl_wdgt_chain_button_get_active (glWdgtChainButton *button); - - -G_END_DECLS - -#endif /* __WDGT_CHAIN_BUTTON_H__ */ diff --git a/glabels2/src/wdgt-media-select.c b/glabels2/src/wdgt-media-select.c deleted file mode 100644 index edb469aa..00000000 --- a/glabels2/src/wdgt-media-select.c +++ /dev/null @@ -1,878 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * wdgt_media_select.c: media selection widget module - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "wdgt-media-select.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "mini-preview-pixbuf-cache.h" -#include "prefs.h" -#include "util.h" -#include "color.h" -#include "marshal.h" -#include - -#include "debug.h" - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -enum { - NAME_COLUMN, - PREVIEW_COLUMN, - PREVIEW_COLUMN_STOCK, - PREVIEW_COLUMN_STOCK_SIZE, - DESCRIPTION_COLUMN, - N_COLUMNS -}; - -struct _glWdgtMediaSelectPrivate { - - GtkWidget *notebook; - guint current_page_num; - - gint recent_page_num; - GtkWidget *recent_tab_vbox; - GtkWidget *recent_treeview; - GtkListStore *recent_store; - - gint search_all_page_num; - GtkWidget *search_all_tab_vbox; - GtkWidget *brand_combo; - GtkWidget *page_size_combo; - GtkWidget *category_combo; - GtkWidget *search_all_treeview; - GtkListStore *search_all_store; - - /* Prevent recursion */ - gboolean stop_signals; -}; - -enum { - CHANGED, - LAST_SIGNAL -}; - -typedef void (*glWdgtMediaSelectSignal) (GObject * object, gpointer data); - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -static gint wdgt_media_select_signals[LAST_SIGNAL] = { 0 }; - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_wdgt_media_select_finalize (GObject *object); - -static void gl_wdgt_media_select_construct (glWdgtMediaSelect *media_select); - -static void filter_changed_cb (GtkComboBox *combo, - gpointer user_data); -static void selection_changed_cb (GtkTreeSelection *selection, - gpointer user_data); -static void page_changed_cb (GtkNotebook *notebook, - GtkNotebookPage *page, - guint page_num, - gpointer user_data); - -static gchar *get_layout_desc (const lglTemplate *template); -static gchar *get_label_size_desc (const lglTemplate *template); -static void load_recent_list (GtkListStore *store, - GtkTreeSelection *selection, - GSList *list); -static void load_search_all_list (GtkListStore *store, - GtkTreeSelection *selection, - GList *list); - -/****************************************************************************/ -/* Boilerplate Object stuff. */ -/****************************************************************************/ -G_DEFINE_TYPE (glWdgtMediaSelect, gl_wdgt_media_select, GTK_TYPE_VBOX); - - -static void -gl_wdgt_media_select_class_init (glWdgtMediaSelectClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - gl_wdgt_media_select_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_wdgt_media_select_finalize; - - wdgt_media_select_signals[CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glWdgtMediaSelectClass, changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - gl_debug (DEBUG_MEDIA_SELECT, "END"); -} - -static void -gl_wdgt_media_select_init (glWdgtMediaSelect *media_select) -{ - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - media_select->priv = g_new0 (glWdgtMediaSelectPrivate, 1); - - gl_debug (DEBUG_MEDIA_SELECT, "END"); -} - -static void -gl_wdgt_media_select_finalize (GObject *object) -{ - glWdgtMediaSelect *media_select = GL_WDGT_MEDIA_SELECT (object); - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_WDGT_MEDIA_SELECT (object)); - - g_object_unref (media_select->priv->recent_store); - g_object_unref (media_select->priv->search_all_store); - g_free (media_select->priv); - - G_OBJECT_CLASS (gl_wdgt_media_select_parent_class)->finalize (object); - - gl_debug (DEBUG_MEDIA_SELECT, "END"); -} - -GtkWidget * -gl_wdgt_media_select_new (void) -{ - glWdgtMediaSelect *media_select; - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - media_select = g_object_new (gl_wdgt_media_select_get_type (), NULL); - - gl_wdgt_media_select_construct (media_select); - - gl_debug (DEBUG_MEDIA_SELECT, "END"); - - return GTK_WIDGET (media_select); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct composite widget. */ -/*--------------------------------------------------------------------------*/ -static void -gl_wdgt_media_select_construct (glWdgtMediaSelect *media_select) -{ - GladeXML *gui; - GtkWidget *hbox; - GList *brands = NULL; - GList *page_sizes = NULL; - GList *categories = NULL; - GList *search_all_names = NULL; - const gchar *page_size_id; - gchar *page_size_name; - GtkCellRenderer *renderer; - GtkTreeViewColumn *column; - GtkTreeSelection *recent_selection; - GtkTreeSelection *search_all_selection; - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - g_return_if_fail (GL_IS_WDGT_MEDIA_SELECT (media_select)); - g_return_if_fail (media_select->priv != NULL); - - gui = glade_xml_new (GLABELS_GLADE_DIR "wdgt-media-select.glade", - "wdgt_media_select_hbox", NULL); - - if (!gui) { - g_critical ("Could not open wdgt-media-select.glade. gLabels may not be installed correctly!"); - return; - } - - hbox = glade_xml_get_widget (gui, "wdgt_media_select_hbox"); - gtk_container_add (GTK_CONTAINER (media_select), hbox); - - media_select->priv->notebook = - glade_xml_get_widget (gui, "notebook"); - - media_select->priv->recent_tab_vbox = - glade_xml_get_widget (gui, "recent_tab_vbox"); - media_select->priv->recent_treeview = - glade_xml_get_widget (gui, "recent_treeview"); - - media_select->priv->search_all_tab_vbox = - glade_xml_get_widget (gui, "search_all_tab_vbox"); - media_select->priv->brand_combo = - glade_xml_get_widget (gui, "brand_combo"); - media_select->priv->page_size_combo = - glade_xml_get_widget (gui, "page_size_combo"); - media_select->priv->category_combo = - glade_xml_get_widget (gui, "category_combo"); - media_select->priv->search_all_treeview = - glade_xml_get_widget (gui, "search_all_treeview"); - - g_object_unref (gui); - - media_select->priv->recent_page_num = - gtk_notebook_page_num (GTK_NOTEBOOK (media_select->priv->notebook), - media_select->priv->recent_tab_vbox); - media_select->priv->search_all_page_num = - gtk_notebook_page_num (GTK_NOTEBOOK (media_select->priv->notebook), - media_select->priv->search_all_tab_vbox); - - /* Recent templates treeview */ - media_select->priv->recent_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING); - gtk_tree_view_set_model (GTK_TREE_VIEW (media_select->priv->recent_treeview), - GTK_TREE_MODEL (media_select->priv->recent_store)); - renderer = gtk_cell_renderer_pixbuf_new (); - column = gtk_tree_view_column_new_with_attributes ("", renderer, - "pixbuf", PREVIEW_COLUMN, - "stock-id", PREVIEW_COLUMN_STOCK, - "stock-size", PREVIEW_COLUMN_STOCK_SIZE, - NULL); - gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); - gtk_tree_view_append_column (GTK_TREE_VIEW (media_select->priv->recent_treeview), column); - renderer = gtk_cell_renderer_text_new (); - column = gtk_tree_view_column_new_with_attributes ("", renderer, - "markup", DESCRIPTION_COLUMN, - NULL); - gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); - gtk_tree_view_append_column (GTK_TREE_VIEW (media_select->priv->recent_treeview), column); - recent_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->recent_treeview)); - load_recent_list (media_select->priv->recent_store, recent_selection, gl_prefs->recent_templates); - - page_size_id = gl_prefs_get_page_size (); - page_size_name = lgl_db_lookup_paper_name_from_id (page_size_id); - - /* Brand selection control */ - gl_util_combo_box_add_text_model (GTK_COMBO_BOX (media_select->priv->brand_combo)); - brands = lgl_db_get_brand_list (NULL, NULL); - brands = g_list_prepend (brands, g_strdup (_("Any"))); - gl_util_combo_box_set_strings (GTK_COMBO_BOX (media_select->priv->brand_combo), brands); - lgl_db_free_brand_list (brands); - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->brand_combo), - _("Any")); - - /* Page size selection control */ - gl_util_combo_box_add_text_model (GTK_COMBO_BOX (media_select->priv->page_size_combo)); - page_sizes = lgl_db_get_paper_name_list (); - page_sizes = g_list_prepend (page_sizes, g_strdup (_("Any"))); - gl_util_combo_box_set_strings (GTK_COMBO_BOX (media_select->priv->page_size_combo), page_sizes); - lgl_db_free_paper_name_list (page_sizes); - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->page_size_combo), - page_size_name); - - /* Category selection control */ - gl_util_combo_box_add_text_model (GTK_COMBO_BOX (media_select->priv->category_combo)); - categories = lgl_db_get_category_name_list (); - categories = g_list_prepend (categories, g_strdup (_("Any"))); - gl_util_combo_box_set_strings (GTK_COMBO_BOX (media_select->priv->category_combo), categories); - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->category_combo), - _("Any")); - lgl_db_free_category_name_list (categories); - - /* Search all treeview */ - media_select->priv->search_all_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING); - gtk_tree_view_set_model (GTK_TREE_VIEW (media_select->priv->search_all_treeview), - GTK_TREE_MODEL (media_select->priv->search_all_store)); - renderer = gtk_cell_renderer_pixbuf_new (); - column = gtk_tree_view_column_new_with_attributes ("", renderer, - "pixbuf", PREVIEW_COLUMN, - "stock-id", PREVIEW_COLUMN_STOCK, - "stock-size", PREVIEW_COLUMN_STOCK_SIZE, - NULL); - gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); - gtk_tree_view_append_column (GTK_TREE_VIEW (media_select->priv->search_all_treeview), column); - renderer = gtk_cell_renderer_text_new (); - column = gtk_tree_view_column_new_with_attributes ("", renderer, - "markup", DESCRIPTION_COLUMN, - NULL); - gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); - gtk_tree_view_append_column (GTK_TREE_VIEW (media_select->priv->search_all_treeview), column); - search_all_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->search_all_treeview)); - search_all_names = lgl_db_get_template_name_list_all (NULL, page_size_id, NULL); - load_search_all_list (media_select->priv->search_all_store, search_all_selection, search_all_names); - lgl_db_free_template_name_list (search_all_names); - - /* Connect signals to controls */ - g_signal_connect (G_OBJECT (media_select->priv->brand_combo), "changed", - G_CALLBACK (filter_changed_cb), - media_select); - g_signal_connect (G_OBJECT (media_select->priv->page_size_combo), "changed", - G_CALLBACK (filter_changed_cb), - media_select); - g_signal_connect (G_OBJECT (media_select->priv->category_combo), "changed", - G_CALLBACK (filter_changed_cb), - media_select); - g_signal_connect (G_OBJECT (recent_selection), "changed", - G_CALLBACK (selection_changed_cb), - media_select); - g_signal_connect (G_OBJECT (search_all_selection), "changed", - G_CALLBACK (selection_changed_cb), - media_select); - g_signal_connect (G_OBJECT (media_select->priv->notebook), "switch-page", - G_CALLBACK (page_changed_cb), - media_select); - - g_free (page_size_name); - - gtk_widget_show_all (GTK_WIDGET (media_select)); - if ( gl_prefs->recent_templates ) - { - gtk_notebook_set_current_page (GTK_NOTEBOOK (media_select->priv->notebook), - media_select->priv->recent_page_num); - } - else - { - gtk_notebook_set_current_page (GTK_NOTEBOOK (media_select->priv->notebook), - media_select->priv->search_all_page_num); - } - - gl_debug (DEBUG_MEDIA_SELECT, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. modify widget due to change in selection */ -/*--------------------------------------------------------------------------*/ -static void -filter_changed_cb (GtkComboBox *combo, - gpointer user_data) -{ - glWdgtMediaSelect *media_select = GL_WDGT_MEDIA_SELECT (user_data); - gchar *brand; - gchar *page_size_name, *page_size_id; - gchar *category_name, *category_id; - GList *search_all_names; - GtkTreeSelection *selection; - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - - media_select->priv->stop_signals = TRUE; - - /* Update template selections for new filter settings */ - brand = gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->brand_combo)); - page_size_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->page_size_combo)); - category_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->category_combo)); - if ( brand && strlen(brand) && - page_size_name && strlen(page_size_name) && - category_name && strlen(category_name) ) - { - gl_debug (DEBUG_MEDIA_SELECT, "brand = \"%s\"", brand); - gl_debug (DEBUG_MEDIA_SELECT, "page_size_name = \"%s\"", page_size_name); - gl_debug (DEBUG_MEDIA_SELECT, "category_name = \"%s\"", category_name); - if (!g_utf8_collate (brand, _("Any"))) - { - g_free (brand); - brand = NULL; - } - page_size_id = lgl_db_lookup_paper_id_from_name (page_size_name); - category_id = lgl_db_lookup_category_id_from_name (category_name); - gl_debug (DEBUG_MEDIA_SELECT, "page_size_id = \"%s\"", page_size_id); - gl_debug (DEBUG_MEDIA_SELECT, "category_id = \"%s\"", category_id); - search_all_names = lgl_db_get_template_name_list_all (brand, page_size_id, category_id); - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->search_all_treeview)); - load_search_all_list (media_select->priv->search_all_store, selection, search_all_names); - lgl_db_free_template_name_list (search_all_names); - g_free (page_size_id); - g_free (category_id); - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (user_data), - wdgt_media_select_signals[CHANGED], 0); - } - g_free (brand); - g_free (page_size_name); - g_free (category_name); - - - media_select->priv->stop_signals = FALSE; - - gl_debug (DEBUG_MEDIA_SELECT, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. modify widget due to change in selection */ -/*--------------------------------------------------------------------------*/ -static void -selection_changed_cb (GtkTreeSelection *selection, - gpointer user_data) -{ - glWdgtMediaSelect *media_select = GL_WDGT_MEDIA_SELECT (user_data); - - if (media_select->priv->stop_signals) return; - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (user_data), - wdgt_media_select_signals[CHANGED], 0); - - gl_debug (DEBUG_MEDIA_SELECT, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. modify widget due to change in selection */ -/*--------------------------------------------------------------------------*/ -static void -page_changed_cb (GtkNotebook *notebook, - GtkNotebookPage *page, - guint page_num, - gpointer user_data) -{ - glWdgtMediaSelect *media_select = GL_WDGT_MEDIA_SELECT (user_data); - - if (media_select->priv->stop_signals) return; - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - /* - * Store new current page, because this signal is emitted before the actual page change. - */ - media_select->priv->current_page_num = page_num; - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (user_data), - wdgt_media_select_signals[CHANGED], 0); - - gl_debug (DEBUG_MEDIA_SELECT, "END"); -} - -/****************************************************************************/ -/* query selected label template name. */ -/****************************************************************************/ -gchar * -gl_wdgt_media_select_get_name (glWdgtMediaSelect *media_select) -{ - gint page_num; - GtkTreeSelection *selection; - GtkTreeIter iter; - GtkTreeModel *model; - gchar *name; - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - page_num = media_select->priv->current_page_num; - if (page_num == media_select->priv->recent_page_num) - { - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->recent_treeview)); - } - else if (page_num == media_select->priv->search_all_page_num) - { - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->search_all_treeview)); - } - else - { - g_print ("notebook page = %d\n", page_num); - g_assert_not_reached (); - } - - if (gtk_tree_selection_get_mode (selection) == GTK_SELECTION_NONE) - { - name = NULL; - } - else - { - gtk_tree_selection_get_selected (selection, &model, &iter); - gtk_tree_model_get (model, &iter, NAME_COLUMN, &name, -1); - } - - gl_debug (DEBUG_MEDIA_SELECT, "END"); - return name; -} - -/****************************************************************************/ -/* set selected label template name. */ -/****************************************************************************/ -void -gl_wdgt_media_select_set_name (glWdgtMediaSelect *media_select, - gchar *name) -{ - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - GtkTreePath *path; - gchar *name_i; - gboolean flag; - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->search_all_treeview)); - g_return_if_fail (GTK_IS_TREE_SELECTION (selection)); - - model = GTK_TREE_MODEL (media_select->priv->search_all_store); - - for ( flag = gtk_tree_model_get_iter_first (model, &iter); - flag; - flag = gtk_tree_model_iter_next(model, &iter) ) - { - gtk_tree_model_get (model, &iter, NAME_COLUMN, &name_i, -1); - if (strcasecmp(name, name_i) == 0) - { - gtk_tree_selection_select_iter (selection, &iter); - path = gtk_tree_model_get_path (model, &iter); - gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (media_select->priv->search_all_treeview), - path, - NULL, - TRUE, 0.5, 0.0); - gtk_tree_path_free (path); - break; - } - } - - gl_debug (DEBUG_MEDIA_SELECT, "END"); -} - -/****************************************************************************/ -/* query current filter parameters. */ -/****************************************************************************/ -void -gl_wdgt_media_select_get_filter_parameters (glWdgtMediaSelect *media_select, - gchar **page_size_id, - gchar **category_id) -{ - gchar *page_size_name, *category_name; - - gl_debug (DEBUG_MEDIA_SELECT, ""); - - g_free (*page_size_id); - g_free (*category_id); - - page_size_name = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->page_size_combo)); - - *page_size_id = lgl_db_lookup_paper_id_from_name (page_size_name); - - category_name = - gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->category_combo)); - - *category_id = lgl_db_lookup_category_id_from_name (category_name); - - g_free (page_size_name); - g_free (category_name); -} - -/****************************************************************************/ -/* set filter parameters. */ -/****************************************************************************/ -void -gl_wdgt_media_select_set_filter_parameters (glWdgtMediaSelect *media_select, - const gchar *page_size_id, - const gchar *category_id) -{ - gchar *page_size_name; - gchar *category_name; - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - page_size_name = lgl_db_lookup_paper_name_from_id (page_size_id); - if (page_size_name == NULL) - { - page_size_name = g_strdup (_("Any")); - } - - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->page_size_combo), - page_size_name); - - category_name = lgl_db_lookup_category_name_from_id (category_id); - if (category_name == NULL) - { - category_name = g_strdup (_("Any")); - } - - gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->category_combo), - category_name); - g_free (page_size_name); - g_free (category_name); - - gl_debug (DEBUG_MEDIA_SELECT, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Get a description of the layout and number of labels. */ -/*--------------------------------------------------------------------------*/ -static gchar * -get_layout_desc (const lglTemplate *template) -{ - const lglTemplateFrame *frame; - gint n_labels; - gchar *string; - - frame = (lglTemplateFrame *)template->frames->data; - - n_labels = lgl_template_frame_get_n_labels (frame); - - string = g_strdup_printf (_("%d per sheet"), n_labels); - - return string; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Get label size description. */ -/*--------------------------------------------------------------------------*/ -static gchar * -get_label_size_desc (const lglTemplate *template) -{ - lglUnitsType units; - const gchar *units_string; - gdouble units_per_point; - const lglTemplateFrame *frame; - gchar *string = NULL; - - units = gl_prefs_get_units (); - units_string = gl_prefs_get_units_string (); - units_per_point = gl_prefs_get_units_per_point (); - - frame = (lglTemplateFrame *)template->frames->data; - - switch (frame->shape) { - case LGL_TEMPLATE_FRAME_SHAPE_RECT: - if ( units == LGL_UNITS_INCH ) { - gchar *xstr, *ystr; - - xstr = gl_util_fraction (frame->rect.w*units_per_point); - ystr = gl_util_fraction (frame->rect.h*units_per_point); - string = g_strdup_printf (_("%s x %s %s"), - xstr, ystr, units_string); - g_free (xstr); - g_free (ystr); - } else { - string = g_strdup_printf (_("%.5g x %.5g %s"), - frame->rect.w*units_per_point, - frame->rect.h*units_per_point, - units_string); - } - break; - case LGL_TEMPLATE_FRAME_SHAPE_ROUND: - if ( units == LGL_UNITS_INCH ) { - gchar *dstr; - - dstr = gl_util_fraction (2.0*frame->round.r*units_per_point); - string = g_strdup_printf (_("%s %s diameter"), - dstr, units_string); - g_free (dstr); - } else { - string = g_strdup_printf (_("%.5g %s diameter"), - 2.0*frame->round.r*units_per_point, - units_string); - } - break; - case LGL_TEMPLATE_FRAME_SHAPE_CD: - if ( units == LGL_UNITS_INCH ) { - gchar *dstr; - - dstr = gl_util_fraction (2.0*frame->cd.r1*units_per_point); - string = g_strdup_printf (_("%s %s diameter"), - dstr, units_string); - g_free (dstr); - } else { - string = g_strdup_printf (_("%.5g %s diameter"), - 2.0*frame->cd.r1*units_per_point, - units_string); - } - break; - default: - break; - } - - return string; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Load list store from template name list. */ -/*--------------------------------------------------------------------------*/ -static void -load_recent_list (GtkListStore *store, - GtkTreeSelection *selection, - GSList *list) -{ - GSList *p; - GtkTreeIter iter; - lglTemplate *template; - GdkPixbuf *pixbuf; - gchar *size; - gchar *layout; - gchar *description; - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - gtk_list_store_clear (store); - - if (list) - { - - for ( p=list; p!=NULL; p=p->next ) - { - - gl_debug (DEBUG_MEDIA_SELECT, "p->data = \"%s\"", p->data); - - template = lgl_db_lookup_template_from_name (p->data); - pixbuf = gl_mini_preview_pixbuf_cache_get_pixbuf (p->data); - - size = get_label_size_desc (template); - layout = get_layout_desc (template); - description = g_strdup_printf ("%s: %s\n%s\n%s", - (gchar *)p->data, - template->description, - size, - layout); - g_free (size); - g_free (layout); - - lgl_template_free (template); - - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - NAME_COLUMN, p->data, - PREVIEW_COLUMN, pixbuf, - DESCRIPTION_COLUMN, description, - -1); - - g_object_unref (G_OBJECT (pixbuf)); - g_free (description); - } - - gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); - gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter); - gtk_tree_selection_select_iter (selection, &iter); - - } - else - { - gchar *text = g_strdup_printf ("%s\n%s", - _("No recent templates found."), - _("Try selecting a template from the \"Search all templates\" page.")); - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - NAME_COLUMN, "empty", - PREVIEW_COLUMN_STOCK, GTK_STOCK_DIALOG_WARNING, - PREVIEW_COLUMN_STOCK_SIZE, GTK_ICON_SIZE_DIALOG, - DESCRIPTION_COLUMN, text, - -1); - g_free (text); - - gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE); - - } - - gl_debug (DEBUG_MEDIA_SELECT, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Load list store from template name list. */ -/*--------------------------------------------------------------------------*/ -static void -load_search_all_list (GtkListStore *store, - GtkTreeSelection *selection, - GList *list) -{ - GList *p; - GtkTreeIter iter; - lglTemplate *template; - GdkPixbuf *pixbuf; - gchar *size; - gchar *layout; - gchar *description; - - gl_debug (DEBUG_MEDIA_SELECT, "START"); - - gtk_list_store_clear (store); - - if (list) - { - - for ( p=list; p!=NULL; p=p->next ) - { - - gl_debug (DEBUG_MEDIA_SELECT, "p->data = \"%s\"", p->data); - - template = lgl_db_lookup_template_from_name (p->data); - pixbuf = gl_mini_preview_pixbuf_cache_get_pixbuf (p->data); - - size = get_label_size_desc (template); - layout = get_layout_desc (template); - description = g_strdup_printf ("%s: %s\n%s\n%s", - (gchar *)p->data, - template->description, - size, - layout); - g_free (size); - g_free (layout); - - lgl_template_free (template); - - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - NAME_COLUMN, p->data, - PREVIEW_COLUMN, pixbuf, - DESCRIPTION_COLUMN, description, - -1); - - g_object_unref (G_OBJECT (pixbuf)); - g_free (description); - } - - gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); - gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter); - gtk_tree_selection_select_iter (selection, &iter); - - } - else - { - gchar *text = g_strdup_printf ("%s\n%s", - _("No match."), - _("Try selecting a different brand, page size or category.")); - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - NAME_COLUMN, "empty", - PREVIEW_COLUMN_STOCK, GTK_STOCK_DIALOG_WARNING, - PREVIEW_COLUMN_STOCK_SIZE, GTK_ICON_SIZE_DIALOG, - DESCRIPTION_COLUMN, text, - -1); - g_free (text); - - gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE); - - } - - gl_debug (DEBUG_MEDIA_SELECT, "END"); -} - diff --git a/glabels2/src/wdgt-media-select.h b/glabels2/src/wdgt-media-select.h deleted file mode 100644 index c8e95fce..00000000 --- a/glabels2/src/wdgt-media-select.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * wdgt_media_select.h: media selection widget module header file - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __WDGT_MEDIA_SELECT_H__ -#define __WDGT_MEDIA_SELECT_H__ - -#include - -G_BEGIN_DECLS - -#define GL_TYPE_WDGT_MEDIA_SELECT (gl_wdgt_media_select_get_type ()) -#define GL_WDGT_MEDIA_SELECT(obj) \ - (GTK_CHECK_CAST((obj), GL_TYPE_WDGT_MEDIA_SELECT, glWdgtMediaSelect )) -#define GL_WDGT_MEDIA_SELECT_CLASS(klass) \ - (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WDGT_MEDIA_SELECT, glWdgtMediaSelectClass)) -#define GL_IS_WDGT_MEDIA_SELECT(obj) \ - (GTK_CHECK_TYPE ((obj), GL_TYPE_WDGT_MEDIA_SELECT)) -#define GL_IS_WDGT_MEDIA_SELECT_CLASS(klass) \ - (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WDGT_MEDIA_SELECT)) - -typedef struct _glWdgtMediaSelect glWdgtMediaSelect; -typedef struct _glWdgtMediaSelectClass glWdgtMediaSelectClass; - -typedef struct _glWdgtMediaSelectPrivate glWdgtMediaSelectPrivate; - -struct _glWdgtMediaSelect { - GtkVBox parent_widget; - - glWdgtMediaSelectPrivate *priv; -}; - -struct _glWdgtMediaSelectClass { - GtkVBoxClass parent_class; - - void (*changed) (glWdgtMediaSelect * media_select, gpointer user_data); -}; - -GType gl_wdgt_media_select_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_wdgt_media_select_new (void); - -gchar *gl_wdgt_media_select_get_name (glWdgtMediaSelect *media_select); - -void gl_wdgt_media_select_set_name (glWdgtMediaSelect *media_select, - gchar *name); - -void gl_wdgt_media_select_get_filter_parameters (glWdgtMediaSelect *media_select, - gchar **page_size_id, - gchar **category_id); - -void gl_wdgt_media_select_set_filter_parameters (glWdgtMediaSelect *media_select, - const gchar *page_size_id, - const gchar *category_id); - -G_END_DECLS - -#endif diff --git a/glabels2/src/wdgt-mini-preview.c b/glabels2/src/wdgt-mini-preview.c deleted file mode 100644 index c539e6bf..00000000 --- a/glabels2/src/wdgt-mini-preview.c +++ /dev/null @@ -1,724 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * wdgt_mini_preview.c: mini preview widget module - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "wdgt-mini-preview.h" - -#include - -#include "libglabels/db.h" -#include "cairo-label-path.h" -#include "marshal.h" -#include "color.h" - -#include "debug.h" - -/*===========================================*/ -/* Private macros and constants. */ -/*===========================================*/ - -#define PAPER_RGB_ARGS 1.0, 1.0, 1.0 -#define PAPER_OUTLINE_RGB_ARGS 0.0, 0.0, 0.0 -#define LABEL_OUTLINE_RGB_ARGS 0.5, 0.5, 0.5 - -#define SHADOW_X_OFFSET 5 -#define SHADOW_Y_OFFSET 5 - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -enum { - CLICKED, - PRESSED, - LAST_SIGNAL -}; - -typedef struct { - gdouble x; - gdouble y; -} LabelCenter; - -struct _glWdgtMiniPreviewPrivate { - - gint height; - gint width; - - lglTemplate *template; - gdouble scale; - gdouble offset_x; - gdouble offset_y; - gint labels_per_sheet; - LabelCenter *centers; - - gint highlight_first; - gint highlight_last; - - gboolean dragging; - gint first_i; - gint last_i; - gint prev_i; -}; - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -static gint wdgt_mini_preview_signals[LAST_SIGNAL] = { 0 }; - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_wdgt_mini_preview_finalize (GObject *object); - -static void gl_wdgt_mini_preview_construct (glWdgtMiniPreview *preview, - gint height, - gint width); - -static gboolean expose_event_cb (GtkWidget *widget, - GdkEventExpose *event); -static void style_set_cb (GtkWidget *widget, - GtkStyle *previous_style); -static gboolean button_press_event_cb (GtkWidget *widget, - GdkEventButton *event); -static gboolean motion_notify_event_cb (GtkWidget *widget, - GdkEventMotion *event); -static gboolean button_release_event_cb (GtkWidget *widget, - GdkEventButton *event); - - -static void redraw (GtkWidget *widget); -static void draw (glWdgtMiniPreview *preview, - cairo_t *cr); - -static void draw_shadow (glWdgtMiniPreview *preview, - cairo_t *cr, - gdouble x, - gdouble y, - gdouble width, - gdouble height); -static void draw_paper (glWdgtMiniPreview *preview, - cairo_t *cr, - gdouble width, - gdouble height, - gdouble line_width); -static void draw_labels (glWdgtMiniPreview *preview, - cairo_t *cr, - lglTemplate *template, - gdouble line_width); - -static gint find_closest_label (glWdgtMiniPreview *preview, - gdouble x, - gdouble y); - - - -/****************************************************************************/ -/* Boilerplate Object stuff. */ -/****************************************************************************/ -G_DEFINE_TYPE (glWdgtMiniPreview, gl_wdgt_mini_preview, GTK_TYPE_DRAWING_AREA); - - -static void -gl_wdgt_mini_preview_class_init (glWdgtMiniPreviewClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - gl_wdgt_mini_preview_parent_class = gtk_type_class (gtk_hbox_get_type ()); - - object_class->finalize = gl_wdgt_mini_preview_finalize; - - widget_class->expose_event = expose_event_cb; - widget_class->style_set = style_set_cb; - widget_class->button_press_event = button_press_event_cb; - widget_class->motion_notify_event = motion_notify_event_cb; - widget_class->button_release_event = button_release_event_cb; - - wdgt_mini_preview_signals[CLICKED] = - g_signal_new ("clicked", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glWdgtMiniPreviewClass, clicked), - NULL, NULL, - gl_marshal_VOID__INT, - G_TYPE_NONE, 1, G_TYPE_INT); - - wdgt_mini_preview_signals[PRESSED] = - g_signal_new ("pressed", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glWdgtMiniPreviewClass, pressed), - NULL, NULL, - gl_marshal_VOID__INT_INT, - G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -static void -gl_wdgt_mini_preview_init (glWdgtMiniPreview *preview) -{ - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - preview->priv = g_new0 (glWdgtMiniPreviewPrivate, 1); - - gtk_widget_add_events (GTK_WIDGET (preview), - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_POINTER_MOTION_MASK); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -static void -gl_wdgt_mini_preview_finalize (GObject *object) -{ - glWdgtMiniPreview *preview = GL_WDGT_MINI_PREVIEW (object); - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_WDGT_MINI_PREVIEW (object)); - - lgl_template_free (preview->priv->template); - g_free (preview->priv->centers); - g_free (preview->priv); - - G_OBJECT_CLASS (gl_wdgt_mini_preview_parent_class)->finalize (object); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -GtkWidget * -gl_wdgt_mini_preview_new (gint height, - gint width) -{ - glWdgtMiniPreview *preview; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - preview = g_object_new (gl_wdgt_mini_preview_get_type (), NULL); - - gl_wdgt_mini_preview_construct (preview, height, width); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); - - return GTK_WIDGET (preview); -} - -/*--------------------------------------------------------------------------*/ -/* Construct composite widget. */ -/*--------------------------------------------------------------------------*/ -static void -gl_wdgt_mini_preview_construct (glWdgtMiniPreview *preview, - gint height, - gint width) -{ - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - preview->priv->height = height; - preview->priv->width = width; - - gtk_widget_set_size_request (GTK_WIDGET (preview), width, height); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -/****************************************************************************/ -/* Set label for mini-preview to determine geometry. */ -/****************************************************************************/ -void gl_wdgt_mini_preview_set_label_by_name (glWdgtMiniPreview *preview, - const gchar *name) -{ - lglTemplate *template; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - /* Fetch template */ - template = lgl_db_lookup_template_from_name (name); - - gl_wdgt_mini_preview_set_template (preview, template); - - lgl_template_free (template); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -/****************************************************************************/ -/* Set label for mini-preview to determine geometry. */ -/****************************************************************************/ -void gl_wdgt_mini_preview_set_template (glWdgtMiniPreview *preview, - const lglTemplate *template) -{ - const lglTemplateFrame *frame; - lglTemplateOrigin *origins; - gdouble w, h; - gint i; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - frame = (lglTemplateFrame *)template->frames->data; - - /* - * Set template - */ - lgl_template_free (preview->priv->template); - preview->priv->template = lgl_template_dup (template); - - /* - * Set scale and offsets - */ - w = preview->priv->width - 4 - 2*SHADOW_X_OFFSET; - h = preview->priv->height - 4 - 2*SHADOW_Y_OFFSET; - if ( (w/template->page_width) > (h/template->page_height) ) { - preview->priv->scale = h / template->page_height; - } else { - preview->priv->scale = w / template->page_width; - } - preview->priv->offset_x = (preview->priv->width/preview->priv->scale - template->page_width) / 2.0; - preview->priv->offset_y = (preview->priv->height/preview->priv->scale - template->page_height) / 2.0; - - /* - * Set labels per sheet - */ - preview->priv->labels_per_sheet = lgl_template_frame_get_n_labels (frame); - - /* - * Initialize centers - */ - g_free (preview->priv->centers); - preview->priv->centers = g_new0 (LabelCenter, preview->priv->labels_per_sheet); - origins = lgl_template_frame_get_origins (frame); - lgl_template_frame_get_size (frame, &w, &h); - for ( i=0; ipriv->labels_per_sheet; i++ ) - { - preview->priv->centers[i].x = origins[i].x + w/2.0; - preview->priv->centers[i].y = origins[i].y + h/2.0; - } - g_free (origins); - - /* - * Redraw modified preview - */ - redraw( GTK_WIDGET (preview)); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -/****************************************************************************/ -/* Highlight given label outlines. */ -/****************************************************************************/ -void -gl_wdgt_mini_preview_highlight_range (glWdgtMiniPreview *preview, - gint first_label, - gint last_label) -{ - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - preview->priv->highlight_first = first_label; - preview->priv->highlight_last = last_label; - - redraw( GTK_WIDGET (preview)); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - - -/*--------------------------------------------------------------------------*/ -/* Expose event handler. */ -/*--------------------------------------------------------------------------*/ -static gboolean -expose_event_cb (GtkWidget *widget, - GdkEventExpose *event) -{ - cairo_t *cr; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - cr = gdk_cairo_create (widget->window); - - cairo_rectangle (cr, - event->area.x, event->area.y, - event->area.width, event->area.height); - cairo_clip (cr); - - draw (GL_WDGT_MINI_PREVIEW (widget), cr); - - cairo_destroy (cr); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); - return FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* Button press event handler */ -/*--------------------------------------------------------------------------*/ -static gboolean -button_press_event_cb (GtkWidget *widget, - GdkEventButton *event) -{ - glWdgtMiniPreview *preview = GL_WDGT_MINI_PREVIEW (widget); - cairo_t *cr; - gdouble x, y; - gint i; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - if ( event->button == 1 ) - { - cr = gdk_cairo_create (widget->window); - - /* Set transformation. */ - cairo_identity_matrix (cr); - cairo_scale (cr, preview->priv->scale, preview->priv->scale); - cairo_translate (cr, preview->priv->offset_x, preview->priv->offset_y); - - x = event->x; - y = event->y; - cairo_device_to_user (cr, &x, &y); - - i = find_closest_label (preview, x, y); - - g_signal_emit (G_OBJECT(preview), - wdgt_mini_preview_signals[CLICKED], - 0, i); - - preview->priv->first_i = i; - preview->priv->last_i = i; - g_signal_emit (G_OBJECT(preview), - wdgt_mini_preview_signals[PRESSED], - 0, preview->priv->first_i, preview->priv->last_i); - - preview->priv->dragging = TRUE; - preview->priv->prev_i = i; - - cairo_destroy (cr); - } - - gl_debug (DEBUG_MINI_PREVIEW, "END"); - return FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* Motion notify event handler */ -/*--------------------------------------------------------------------------*/ -static gboolean -motion_notify_event_cb (GtkWidget *widget, - GdkEventMotion *event) -{ - glWdgtMiniPreview *preview = GL_WDGT_MINI_PREVIEW (widget); - cairo_t *cr; - gdouble x, y; - gint i; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - if (preview->priv->dragging) - { - cr = gdk_cairo_create (widget->window); - - /* Set transformation. */ - cairo_identity_matrix (cr); - cairo_scale (cr, preview->priv->scale, preview->priv->scale); - cairo_translate (cr, preview->priv->offset_x, preview->priv->offset_y); - - x = event->x; - y = event->y; - cairo_device_to_user (cr, &x, &y); - - i = find_closest_label (preview, x, y); - - if ( i != preview->priv->prev_i ) - { - preview->priv->last_i = i; - - g_signal_emit (G_OBJECT(preview), - wdgt_mini_preview_signals[PRESSED], - 0, - MIN (preview->priv->first_i, preview->priv->last_i), - MAX (preview->priv->first_i, preview->priv->last_i)); - - preview->priv->prev_i = i; - } - cairo_destroy (cr); - } - - gl_debug (DEBUG_MINI_PREVIEW, "END"); - return FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* Button release event handler */ -/*--------------------------------------------------------------------------*/ -static gboolean -button_release_event_cb (GtkWidget *widget, - GdkEventButton *event) -{ - glWdgtMiniPreview *preview = GL_WDGT_MINI_PREVIEW (widget); - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - if ( event->button == 1 ) - { - preview->priv->dragging = FALSE; - - } - - gl_debug (DEBUG_MINI_PREVIEW, "END"); - return FALSE; -} - -/*--------------------------------------------------------------------------*/ -/* Style set handler (updates colors when style/theme changes). */ -/*--------------------------------------------------------------------------*/ -static void -style_set_cb (GtkWidget *widget, - GtkStyle *previous_style) -{ - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - redraw( widget ); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* Redraw. */ -/*--------------------------------------------------------------------------*/ -static void -redraw (GtkWidget *widget) -{ - GdkRegion *region; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - if (widget->window) - { - - region = gdk_drawable_get_clip_region (widget->window); - - gdk_window_invalidate_region (widget->window, region, TRUE); - gdk_window_process_updates (widget->window, TRUE); - - gdk_region_destroy (region); - } - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* Find index+1 of label closest to given coordinates. */ -/*--------------------------------------------------------------------------*/ -static gint -find_closest_label (glWdgtMiniPreview *preview, - gdouble x, - gdouble y) -{ - gint i; - gint min_i; - gdouble dx, dy, d2, min_d2; - - dx = x - preview->priv->centers[0].x; - dy = y - preview->priv->centers[0].y; - min_d2 = dx*dx + dy*dy; - min_i = 0; - - for ( i=1; ipriv->labels_per_sheet; i++ ) - { - dx = x - preview->priv->centers[i].x; - dy = y - preview->priv->centers[i].y; - d2 = dx*dx + dy*dy; - - if ( d2 < min_d2 ) - { - min_d2 = d2; - min_i = i; - } - } - - return min_i + 1; -} - -/*--------------------------------------------------------------------------*/ -/* Draw mini preview. */ -/*--------------------------------------------------------------------------*/ -static void -draw (glWdgtMiniPreview *preview, - cairo_t *cr) -{ - lglTemplate *template = preview->priv->template; - gdouble shadow_x, shadow_y; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - if (template) - { - - /* Set transformation. */ - cairo_identity_matrix (cr); - cairo_scale (cr, preview->priv->scale, preview->priv->scale); - cairo_translate (cr, preview->priv->offset_x, preview->priv->offset_y); - - - /* update shadow */ - shadow_x = SHADOW_X_OFFSET/preview->priv->scale; - shadow_y = SHADOW_Y_OFFSET/preview->priv->scale; - - draw_shadow (preview, cr, - shadow_x, shadow_y, - template->page_width, template->page_height); - - draw_paper (preview, cr, - template->page_width, template->page_height, - 1.0/preview->priv->scale); - - draw_labels (preview, cr, template, 1.0/preview->priv->scale); - - } - - gl_debug (DEBUG_MINI_PREVIEW, "END"); - -} - - -/*--------------------------------------------------------------------------*/ -/* Draw page shadow */ -/*--------------------------------------------------------------------------*/ -static void -draw_shadow (glWdgtMiniPreview *preview, - cairo_t *cr, - gdouble x, - gdouble y, - gdouble width, - gdouble height) -{ - GtkStyle *style; - guint shadow_color; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - cairo_save (cr); - - cairo_rectangle (cr, x, y, width, height); - - style = gtk_widget_get_style (GTK_WIDGET(preview)); - shadow_color = gl_color_from_gdk_color (&style->bg[GTK_STATE_ACTIVE]); - cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (shadow_color)); - - cairo_fill (cr); - - cairo_restore (cr); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* Draw page */ -/*--------------------------------------------------------------------------*/ -static void -draw_paper (glWdgtMiniPreview *preview, - cairo_t *cr, - gdouble width, - gdouble height, - gdouble line_width) -{ - cairo_save (cr); - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - cairo_rectangle (cr, 0.0, 0.0, width, height); - - cairo_set_source_rgb (cr, PAPER_RGB_ARGS); - cairo_fill_preserve (cr); - - cairo_set_source_rgb (cr, PAPER_OUTLINE_RGB_ARGS); - cairo_set_line_width (cr, line_width); - cairo_stroke (cr); - - cairo_restore (cr); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* Draw labels */ -/*--------------------------------------------------------------------------*/ -static void -draw_labels (glWdgtMiniPreview *preview, - cairo_t *cr, - lglTemplate *template, - gdouble line_width) -{ - const lglTemplateFrame *frame; - gint i, n_labels; - lglTemplateOrigin *origins; - GtkStyle *style; - guint highlight_color; - - gl_debug (DEBUG_MINI_PREVIEW, "START"); - - frame = (lglTemplateFrame *)template->frames->data; - - n_labels = lgl_template_frame_get_n_labels (frame); - origins = lgl_template_frame_get_origins (frame); - - style = gtk_widget_get_style (GTK_WIDGET(preview)); - highlight_color = gl_color_from_gdk_color (&style->base[GTK_STATE_SELECTED]); - - for ( i=0; i < n_labels; i++ ) { - - cairo_save (cr); - - cairo_translate (cr, origins[i].x, origins[i].y); - gl_cairo_label_path (cr, template, FALSE, FALSE); - - if ( ((i+1) >= preview->priv->highlight_first) && - ((i+1) <= preview->priv->highlight_last) ) - { - cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (highlight_color)); - } - else - { - cairo_set_source_rgb (cr, PAPER_RGB_ARGS); - } - cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); - cairo_fill_preserve (cr); - - cairo_set_line_width (cr, line_width); - cairo_set_source_rgb (cr, LABEL_OUTLINE_RGB_ARGS); - cairo_stroke (cr); - - cairo_restore (cr); - - } - - g_free (origins); - - gl_debug (DEBUG_MINI_PREVIEW, "END"); -} - diff --git a/glabels2/src/wdgt-mini-preview.h b/glabels2/src/wdgt-mini-preview.h deleted file mode 100644 index 8754b857..00000000 --- a/glabels2/src/wdgt-mini-preview.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * wdgt_mini_preview.h: mini-preview widget module header file - * - * Copyright (C) 2001-2007 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __WDGT_MINI_PREVIEW_H__ -#define __WDGT_MINI_PREVIEW_H__ - -#include -#include "label.h" - -G_BEGIN_DECLS - -#define GL_TYPE_WDGT_MINI_PREVIEW (gl_wdgt_mini_preview_get_type ()) -#define GL_WDGT_MINI_PREVIEW(obj) \ - (GTK_CHECK_CAST((obj), GL_TYPE_WDGT_MINI_PREVIEW, glWdgtMiniPreview )) -#define GL_WDGT_MINI_PREVIEW_CLASS(klass) \ - (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WDGT_MINI_PREVIEW, glWdgtMiniPreviewClass)) -#define GL_IS_WDGT_MINI_PREVIEW(obj) \ - (GTK_CHECK_TYPE ((obj), GL_TYPE_WDGT_MINI_PREVIEW)) -#define GL_IS_WDGT_MINI_PREVIEW_CLASS(klass) \ - (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WDGT_MINI_PREVIEW)) - -typedef struct _glWdgtMiniPreview glWdgtMiniPreview; -typedef struct _glWdgtMiniPreviewPrivate glWdgtMiniPreviewPrivate; -typedef struct _glWdgtMiniPreviewClass glWdgtMiniPreviewClass; - -struct _glWdgtMiniPreview { - GtkDrawingArea parent_widget; - - glWdgtMiniPreviewPrivate *priv; -}; - -struct _glWdgtMiniPreviewClass { - GtkDrawingAreaClass parent_class; - - void (*clicked) (glWdgtMiniPreview *preview, - gint index, - gpointer user_data); - - void (*pressed) (glWdgtMiniPreview *preview, - gint index1, - gint index2, - gpointer user_data); -}; - -GType gl_wdgt_mini_preview_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_wdgt_mini_preview_new (gint height, - gint width); - -void gl_wdgt_mini_preview_set_label_by_name (glWdgtMiniPreview *preview, - const gchar *name); - -void gl_wdgt_mini_preview_set_template (glWdgtMiniPreview *preview, - const lglTemplate *template); - -void gl_wdgt_mini_preview_highlight_range (glWdgtMiniPreview *preview, - gint first_label, - gint last_label); - -G_END_DECLS - -#endif diff --git a/glabels2/src/wdgt-print-copies.c b/glabels2/src/wdgt-print-copies.c deleted file mode 100644 index 7d2f35b1..00000000 --- a/glabels2/src/wdgt-print-copies.c +++ /dev/null @@ -1,363 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * wdgt_print_copies.c: custom print copies widget module - * - * Copyright (C) 2001 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "wdgt-print-copies.h" - -#include -#include -#include -#include -#include -#include - -#include "hig.h" -#include "wdgt-mini-preview.h" -#include "marshal.h" - -#include "debug.h" - -#define WDGT_MINI_PREVIEW_HEIGHT 175 -#define WDGT_MINI_PREVIEW_WIDTH 150 - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_wdgt_print_copies_finalize (GObject * object); - -static void gl_wdgt_print_copies_construct (glWdgtPrintCopies * copies, - glLabel * label); - -static void sheets_radio_cb (GtkToggleButton * togglebutton, - gpointer user_data); -static void first_spin_cb (GtkSpinButton * spinbutton, - gpointer user_data); -static void last_spin_cb (GtkSpinButton * spinbutton, - gpointer user_data); - -static void -preview_pressed (glWdgtMiniPreview *mini_preview, - gint first, gint last, gpointer user_data); - - -/****************************************************************************/ -/* Boilerplate Object stuff. */ -/****************************************************************************/ -G_DEFINE_TYPE (glWdgtPrintCopies, gl_wdgt_print_copies, GTK_TYPE_HBOX); - -static void -gl_wdgt_print_copies_class_init (glWdgtPrintCopiesClass * class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_wdgt_print_copies_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_wdgt_print_copies_finalize; -} - -static void -gl_wdgt_print_copies_init (glWdgtPrintCopies * copies) -{ - copies->labels_per_sheet = 0; - - copies->mini_preview = NULL; - - copies->sheets_radio = NULL; - copies->sheets_spin = NULL; - - copies->labels_radio = NULL; - copies->first_spin = NULL; - copies->last_spin = NULL; -} - -static void -gl_wdgt_print_copies_finalize (GObject * object) -{ - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_WDGT_PRINT_COPIES (object)); - - G_OBJECT_CLASS (gl_wdgt_print_copies_parent_class)->finalize (object); -} - -GtkWidget * -gl_wdgt_print_copies_new (glLabel * label) -{ - glWdgtPrintCopies *copies; - - copies = g_object_new (gl_wdgt_print_copies_get_type (), NULL); - - gl_wdgt_print_copies_construct (copies, label); - - return GTK_WIDGET (copies); -} - -/*--------------------------------------------------------------------------*/ -/* Construct composite widget. */ -/*--------------------------------------------------------------------------*/ -static void -gl_wdgt_print_copies_construct (glWdgtPrintCopies *copies, - glLabel *label) -{ - const lglTemplateFrame *frame; - GtkWidget *whbox, *wvbox, *whbox1; - GSList *radio_group = NULL; - GtkObject *adjust; - - whbox = GTK_WIDGET (copies); - - frame = (lglTemplateFrame *)label->template->frames->data; - - copies->labels_per_sheet = lgl_template_frame_get_n_labels (frame); - - /* mini_preview canvas */ - copies->mini_preview = gl_wdgt_mini_preview_new (WDGT_MINI_PREVIEW_HEIGHT, - WDGT_MINI_PREVIEW_WIDTH); - gl_wdgt_mini_preview_set_template (GL_WDGT_MINI_PREVIEW(copies->mini_preview), - label->template); - gtk_box_pack_start (GTK_BOX(whbox), copies->mini_preview, FALSE, FALSE, 0); - - wvbox = gtk_vbox_new (FALSE, GL_HIG_PAD1); - gtk_box_pack_start (GTK_BOX(whbox), wvbox, FALSE, FALSE, 0); - - /* Sheet controls */ - whbox1 = gtk_hbox_new (FALSE, GL_HIG_PAD2); - gtk_box_pack_start (GTK_BOX(wvbox), whbox1, FALSE, FALSE, 0); - copies->sheets_radio = - gtk_radio_button_new_with_label (radio_group, _("Sheets:")); - gtk_box_pack_start (GTK_BOX(whbox1), copies->sheets_radio, FALSE, FALSE, 0); - adjust = gtk_adjustment_new (1, 1.0, 100.0, 1.0, 10.0, 0.0); - copies->sheets_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust), - 1.0, 0); - gtk_box_pack_start (GTK_BOX(whbox1), copies->sheets_spin, FALSE, FALSE, 0); - gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(copies->mini_preview), - 1, copies->labels_per_sheet); - - /* Blank line */ - gtk_box_pack_start (GTK_BOX(wvbox), gtk_label_new (""), FALSE, FALSE, 0); - - /* Label controls */ - whbox1 = gtk_hbox_new (FALSE, GL_HIG_PAD2); - gtk_box_pack_start (GTK_BOX(wvbox), whbox1, FALSE, FALSE, 0); - radio_group = - gtk_radio_button_get_group (GTK_RADIO_BUTTON (copies->sheets_radio)); - copies->labels_radio = - gtk_radio_button_new_with_label (radio_group, _("Labels")); - gtk_box_pack_start (GTK_BOX(whbox1), copies->labels_radio, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX(whbox1), gtk_label_new (_("from:")), FALSE, FALSE, 0); - adjust = gtk_adjustment_new (1, 1.0, copies->labels_per_sheet, 1.0, 10.0, 0.0); - copies->first_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust), - 1.0, 0); - gtk_box_pack_start (GTK_BOX(whbox1), copies->first_spin, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX(whbox1), gtk_label_new (_("to:")), FALSE, FALSE, 0); - adjust = gtk_adjustment_new (copies->labels_per_sheet, 1.0, copies->labels_per_sheet, 1.0, 10.0, 0.0); - copies->last_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust), - 1.0, 0); - gtk_box_pack_start (GTK_BOX(whbox1), copies->last_spin, FALSE, FALSE, 0); - gtk_widget_set_sensitive (copies->first_spin, FALSE); - gtk_widget_set_sensitive (copies->last_spin, FALSE); - - /* Connect signals to controls */ - g_signal_connect (G_OBJECT (copies->mini_preview), "pressed", - G_CALLBACK (preview_pressed), copies); - g_signal_connect (G_OBJECT (copies->sheets_radio), "toggled", - G_CALLBACK (sheets_radio_cb), copies); - g_signal_connect (G_OBJECT (copies->first_spin), "changed", - G_CALLBACK (first_spin_cb), copies); - g_signal_connect (G_OBJECT (copies->last_spin), "changed", - G_CALLBACK (last_spin_cb), copies); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Enable/Disable appropriate controls due to radio button toggle.*/ -/*--------------------------------------------------------------------------*/ -static void -sheets_radio_cb (GtkToggleButton * togglebutton, - gpointer user_data) -{ - glWdgtPrintCopies *copies = GL_WDGT_PRINT_COPIES (user_data); - gint first, last; - - if (gtk_toggle_button_get_active (togglebutton)) { - - gtk_widget_set_sensitive (copies->sheets_spin, TRUE); - gtk_widget_set_sensitive (copies->first_spin, FALSE); - gtk_widget_set_sensitive (copies->last_spin, FALSE); - - gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(copies->mini_preview), - 1, copies->labels_per_sheet); - - } else { - - gtk_widget_set_sensitive (copies->sheets_spin, FALSE); - gtk_widget_set_sensitive (copies->first_spin, TRUE); - gtk_widget_set_sensitive (copies->last_spin, TRUE); - - first = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (copies->first_spin)); - last = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (copies->last_spin)); - gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(copies->mini_preview), - first, last); - - } -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. modify widget due to change of first spin button */ -/*--------------------------------------------------------------------------*/ -static void -first_spin_cb (GtkSpinButton * spinbutton, - gpointer user_data) -{ - glWdgtPrintCopies *copies = GL_WDGT_PRINT_COPIES (user_data); - gint first, last; - - first = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (copies->first_spin)); - last = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (copies->last_spin)); - - gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (copies->last_spin))->lower = first; - - gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(copies->mini_preview), - first, last); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. modify widget due to change of last spin button */ -/*--------------------------------------------------------------------------*/ -static void -last_spin_cb (GtkSpinButton * spinbutton, - gpointer user_data) -{ - glWdgtPrintCopies *copies = GL_WDGT_PRINT_COPIES (user_data); - gint first, last; - - first = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (copies->first_spin)); - last = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (copies->last_spin)); - - gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (copies->first_spin))->upper = last; - - gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(copies->mini_preview), - first, last); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Canvas event handler, select first and last items. */ -/*--------------------------------------------------------------------------*/ -static void -preview_pressed (glWdgtMiniPreview *mini_preview, - gint first, - gint last, - gpointer user_data) -{ - glWdgtPrintCopies *copies = GL_WDGT_PRINT_COPIES (user_data); - - gl_wdgt_print_copies_set_range (copies, 1, first, last); -} - -/****************************************************************************/ -/* query selected range of labels within sheet or number of sheets. */ -/****************************************************************************/ -void -gl_wdgt_print_copies_get_range (glWdgtPrintCopies * copies, - gint * n_sheets, - gint * first_label, - gint * last_label) -{ - gboolean sheets_active; - - sheets_active = - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON - (copies->sheets_radio)); - - if (sheets_active) { - *n_sheets = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (copies->sheets_spin)); - *first_label = 1; - *last_label = copies->labels_per_sheet; - } else { - *n_sheets = 1; - *first_label = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (copies->first_spin)); - *last_label = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (copies->last_spin)); - } -} - -/****************************************************************************/ -/* set range of labels within sheet or number of sheets */ -/****************************************************************************/ -void -gl_wdgt_print_copies_set_range (glWdgtPrintCopies * copies, - gint n_sheets, - gint first_label, - gint last_label) -{ - gint old_first_label; - - old_first_label = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (copies->first_spin)); - - if (first_label > old_first_label) { - gtk_spin_button_set_value (GTK_SPIN_BUTTON (copies->last_spin), - last_label); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (copies->first_spin), - first_label); - } else { - gtk_spin_button_set_value (GTK_SPIN_BUTTON (copies->first_spin), - first_label); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (copies->last_spin), - last_label); - } - if ((first_label == 1) && (last_label == copies->labels_per_sheet)) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (copies->sheets_radio), TRUE); - gtk_spin_button_set_value (GTK_SPIN_BUTTON - (copies->sheets_spin), n_sheets); - } else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (copies->labels_radio), TRUE); - gtk_spin_button_set_value (GTK_SPIN_BUTTON - (copies->sheets_spin), 1.0); - } -} diff --git a/glabels2/src/wdgt-print-copies.h b/glabels2/src/wdgt-print-copies.h deleted file mode 100644 index 7e24dee3..00000000 --- a/glabels2/src/wdgt-print-copies.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * wdgt_print_copies.h: custom print copies widget module header file - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __WDGT_PRINT_COPIES_H__ -#define __WDGT_PRINT_COPIES_H__ - -#include "label.h" -#include - -G_BEGIN_DECLS - -#define GL_TYPE_WDGT_PRINT_COPIES (gl_wdgt_print_copies_get_type ()) -#define GL_WDGT_PRINT_COPIES(obj) \ - (GTK_CHECK_CAST((obj), GL_TYPE_WDGT_PRINT_COPIES, glWdgtPrintCopies )) -#define GL_WDGT_PRINT_COPIES_CLASS(klass) \ - (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WDGT_PRINT_COPIES, glWdgtPrintCopiesClass)) -#define GL_IS_WDGT_PRINT_COPIES(obj) \ - (GTK_CHECK_TYPE ((obj), GL_TYPE_WDGT_PRINT_COPIES)) -#define GL_IS_WDGT_PRINT_COPIES_CLASS(klass) \ - (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WDGT_PRINT_COPIES)) - -typedef struct _glWdgtPrintCopies glWdgtPrintCopies; -typedef struct _glWdgtPrintCopiesClass glWdgtPrintCopiesClass; - -struct _glWdgtPrintCopies { - GtkHBox parent_widget; - - gint labels_per_sheet; - - GtkWidget *mini_preview; - - GtkWidget *sheets_radio; - GtkWidget *sheets_spin; - - GtkWidget *labels_radio; - GtkWidget *first_spin; - GtkWidget *last_spin; -}; - -struct _glWdgtPrintCopiesClass { - GtkHBoxClass parent_class; -}; - -GType gl_wdgt_print_copies_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_wdgt_print_copies_new (glLabel *label); - -void gl_wdgt_print_copies_get_range (glWdgtPrintCopies *copies, - gint *n_sheets, - gint *first_label, - gint *last_label); - -void gl_wdgt_print_copies_set_range (glWdgtPrintCopies *copies, - gint n_sheets, - gint first_label, - gint last_label); - -G_END_DECLS - -#endif diff --git a/glabels2/src/wdgt-print-merge.c b/glabels2/src/wdgt-print-merge.c deleted file mode 100644 index f05d4eda..00000000 --- a/glabels2/src/wdgt-print-merge.c +++ /dev/null @@ -1,313 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * wdgt_print_merge.c: print merge widget module - * - * Copyright (C) 2001 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "wdgt-print-merge.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "hig.h" -#include "wdgt-mini-preview.h" -#include "marshal.h" - -#include "pixmaps/collate.xpm" -#include "pixmaps/nocollate.xpm" - -#include "debug.h" - -#define WDGT_MINI_PREVIEW_HEIGHT 175 -#define WDGT_MINI_PREVIEW_WIDTH 150 - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_wdgt_print_merge_finalize (GObject * object); - -static void gl_wdgt_print_merge_construct (glWdgtPrintMerge * merge, - glLabel * label); - -static void preview_clicked (glWdgtMiniPreview *mini_preview, - gint i_label, - gpointer user_data); - -static void collate_check_cb (GtkToggleButton * togglebutton, - gpointer user_data); -static void spin_cb (GtkSpinButton * spinbutton, - gpointer user_data); - - -/****************************************************************************/ -/* Boilerplate Object stuff. */ -/****************************************************************************/ -G_DEFINE_TYPE (glWdgtPrintMerge, gl_wdgt_print_merge, GTK_TYPE_HBOX); - - -static void -gl_wdgt_print_merge_class_init (glWdgtPrintMergeClass * class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_wdgt_print_merge_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_wdgt_print_merge_finalize; -} - -static void -gl_wdgt_print_merge_init (glWdgtPrintMerge * merge) -{ - merge->mini_preview = NULL; - - merge->copies_spin = NULL; - merge->first_spin = NULL; - merge->collate_image = NULL; - merge->collate_check = NULL; -} - -static void -gl_wdgt_print_merge_finalize (GObject * object) -{ - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_WDGT_PRINT_MERGE (object)); - - G_OBJECT_CLASS (gl_wdgt_print_merge_parent_class)->finalize (object); -} - -GtkWidget * -gl_wdgt_print_merge_new (glLabel * label) -{ - glWdgtPrintMerge *merge; - - merge = g_object_new (gl_wdgt_print_merge_get_type (), NULL); - - gl_wdgt_print_merge_construct (merge, label); - - return GTK_WIDGET (merge); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Construct composite widget. */ -/*--------------------------------------------------------------------------*/ -static void -gl_wdgt_print_merge_construct (glWdgtPrintMerge * merge, - glLabel * label) -{ - const lglTemplateFrame *frame; - GtkWidget *whbox, *wvbox, *whbox1; - GtkObject *adjust; - GdkPixbuf *pixbuf; - - whbox = GTK_WIDGET (merge); - - frame = (lglTemplateFrame *)label->template->frames->data; - - merge->labels_per_sheet = lgl_template_frame_get_n_labels (frame); - - /* mini_preview canvas */ - merge->mini_preview = gl_wdgt_mini_preview_new (WDGT_MINI_PREVIEW_HEIGHT, - WDGT_MINI_PREVIEW_WIDTH); - gl_wdgt_mini_preview_set_template( GL_WDGT_MINI_PREVIEW (merge->mini_preview), - label->template ); - gtk_box_pack_start (GTK_BOX(whbox), merge->mini_preview, FALSE, FALSE, 0); - gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(merge->mini_preview), - 1, 1); - - wvbox = gtk_vbox_new (FALSE, GL_HIG_PAD1); - gtk_box_pack_start (GTK_BOX(whbox), wvbox, FALSE, FALSE, 0); - - /* First Label controls */ - whbox1 = gtk_hbox_new (FALSE, GL_HIG_PAD2); - gtk_box_pack_start (GTK_BOX(wvbox), whbox1, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX(whbox1), - gtk_label_new (_("Start on label")), FALSE, FALSE, 0); - adjust = gtk_adjustment_new (1, 1.0, merge->labels_per_sheet, 1.0, 10.0, 0.0); - merge->first_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust), 1.0, 0); - gtk_box_pack_start (GTK_BOX(whbox1), merge->first_spin, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX(whbox1), - gtk_label_new (_("on 1st sheet")), FALSE, FALSE, 0); - - /* Blank line */ - gtk_box_pack_start (GTK_BOX(wvbox), gtk_label_new (""), FALSE, FALSE, 0); - - /* Copy & collate controls*/ - whbox1 = gtk_hbox_new (FALSE, GL_HIG_PAD2); - gtk_box_pack_start (GTK_BOX(wvbox), whbox1, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX(whbox1), - gtk_label_new (_("Copies:")), FALSE, FALSE, 0); - adjust = gtk_adjustment_new (1, 1.0, 100.0, 1.0, 10.0, 0.0); - merge->copies_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust), 1.0, 0); - gtk_box_pack_start (GTK_BOX(whbox1), merge->copies_spin, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX(whbox1), gtk_label_new (" "), FALSE, FALSE, 0); - merge->collate_check = gtk_check_button_new_with_label (_("Collate")); - gtk_box_pack_start (GTK_BOX(whbox1), merge->collate_check, FALSE, FALSE, 0); - pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)nocollate_xpm); - merge->collate_image = gtk_image_new_from_pixbuf(pixbuf); - gtk_widget_set_sensitive (merge->collate_check, FALSE); - gtk_widget_set_sensitive (merge->collate_image, FALSE); - - gtk_box_pack_start (GTK_BOX(whbox1), merge->collate_image, FALSE, FALSE, 0); - - /* Connect signals to controls */ - g_signal_connect (G_OBJECT (merge->mini_preview), "clicked", - G_CALLBACK (preview_clicked), merge); - g_signal_connect (G_OBJECT (merge->collate_check), "toggled", - G_CALLBACK (collate_check_cb), merge); - g_signal_connect (G_OBJECT (merge->copies_spin), "changed", - G_CALLBACK (spin_cb), merge); - g_signal_connect (G_OBJECT (merge->first_spin), "changed", - G_CALLBACK (spin_cb), merge); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Enable/Disable appropriate controls due to radio button toggle.*/ -/*--------------------------------------------------------------------------*/ -static void -collate_check_cb (GtkToggleButton * togglebutton, - gpointer user_data) -{ - glWdgtPrintMerge *merge = GL_WDGT_PRINT_MERGE (user_data); - GdkPixbuf *pixbuf; - - if (gtk_toggle_button_get_active (togglebutton)) { - - pixbuf = - gdk_pixbuf_new_from_xpm_data ( (const char **)collate_xpm); - - } else { - - pixbuf = - gdk_pixbuf_new_from_xpm_data ( (const char **)nocollate_xpm); - - } - gtk_image_set_from_pixbuf (GTK_IMAGE (merge->collate_image), - pixbuf); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. modify widget due to change of first spin button */ -/*--------------------------------------------------------------------------*/ -static void -spin_cb (GtkSpinButton * spinbutton, - gpointer user_data) -{ - glWdgtPrintMerge *merge = GL_WDGT_PRINT_MERGE (user_data); - gint first, last, n_copies; - - first = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (merge->first_spin)); - - n_copies = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (merge->copies_spin)); - last = first + (n_copies * merge->n_records) - 1; - gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(merge->mini_preview), - first, last ); - - gtk_widget_set_sensitive (merge->collate_check, (n_copies > 1)); - gtk_widget_set_sensitive (merge->collate_image, (n_copies > 1)); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Canvas event handler, select first and last items. */ -/*--------------------------------------------------------------------------*/ -static void -preview_clicked (glWdgtMiniPreview *mini_preview, - gint first, - gpointer user_data) -{ - glWdgtPrintMerge *merge = GL_WDGT_PRINT_MERGE (user_data); - gint n_copies, last; - - gtk_spin_button_set_value (GTK_SPIN_BUTTON (merge->first_spin), - first); - - n_copies = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (merge->copies_spin)); - last = first + (n_copies * merge->n_records) - 1; - gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW (merge->mini_preview), - first, last); - -} - -/****************************************************************************/ -/* query selected range of labels within sheet or number of sheets. */ -/****************************************************************************/ -void -gl_wdgt_print_merge_get_copies (glWdgtPrintMerge *merge, - gint *n_copies, - gint *first_label, - gboolean *collate_flag, - gint *n_sheets) -{ - *n_copies = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (merge->copies_spin)); - *first_label = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (merge->first_spin)); - *collate_flag = - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON - (merge->collate_check)); - - *n_sheets = ceil ( (double)(*first_label - 1 + (*n_copies * merge->n_records))/ (double)merge->labels_per_sheet ); -} - -/****************************************************************************/ -/* set range of labels within sheet or number of sheets */ -/****************************************************************************/ -void -gl_wdgt_print_merge_set_copies (glWdgtPrintMerge * merge, - gint n_copies, - gint first_label, - gint n_records, - gboolean collate_flag) -{ - gint last_label; - - merge->n_records = n_records; - - gtk_spin_button_set_value (GTK_SPIN_BUTTON (merge->copies_spin), - n_copies); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (merge->first_spin), - first_label); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (merge->collate_check), - collate_flag); - - last_label = first_label + (n_copies * n_records) - 1; - gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW (merge->mini_preview), - first_label, last_label ); -} diff --git a/glabels2/src/wdgt-print-merge.h b/glabels2/src/wdgt-print-merge.h deleted file mode 100644 index 9e3a24da..00000000 --- a/glabels2/src/wdgt-print-merge.h +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * wdgt_print_merge.h: print merge widget module header file - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __WDGT_PRINT_MERGE_H__ -#define __WDGT_PRINT_MERGE_H__ - -#include "label.h" -#include - -G_BEGIN_DECLS - -#define GL_TYPE_WDGT_PRINT_MERGE (gl_wdgt_print_merge_get_type ()) -#define GL_WDGT_PRINT_MERGE(obj) \ - (GTK_CHECK_CAST((obj), GL_TYPE_WDGT_PRINT_MERGE, glWdgtPrintMerge )) -#define GL_WDGT_PRINT_MERGE_CLASS(klass) \ - (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WDGT_PRINT_MERGE, glWdgtPrintMergeClass)) -#define GL_IS_WDGT_PRINT_MERGE(obj) \ - (GTK_CHECK_TYPE ((obj), GL_TYPE_WDGT_PRINT_MERGE)) -#define GL_IS_WDGT_PRINT_MERGE_CLASS(klass) \ - (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WDGT_PRINT_MERGE)) - -typedef struct _glWdgtPrintMerge glWdgtPrintMerge; -typedef struct _glWdgtPrintMergeClass glWdgtPrintMergeClass; - -struct _glWdgtPrintMerge { - GtkHBox parent_widget; - - gint labels_per_sheet; - GtkWidget *mini_preview; - - gint n_records; - - GtkWidget *copies_spin; - GtkWidget *first_spin; - GtkWidget *collate_image; - GtkWidget *collate_check; -}; - -struct _glWdgtPrintMergeClass { - GtkHBoxClass parent_class; -}; - -GType gl_wdgt_print_merge_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_wdgt_print_merge_new (glLabel *label); - -void gl_wdgt_print_merge_get_copies (glWdgtPrintMerge *merge, - gint *n_copies, - gint *first_label, - gboolean *collate_flag, - gint *n_sheets); - -void gl_wdgt_print_merge_set_copies (glWdgtPrintMerge *merge, - gint n_copies, - gint first_label, - gint n_records, - gboolean collate_flag); - -G_END_DECLS - -#endif diff --git a/glabels2/src/wdgt-rotate-label.c b/glabels2/src/wdgt-rotate-label.c deleted file mode 100644 index 4edca601..00000000 --- a/glabels2/src/wdgt-rotate-label.c +++ /dev/null @@ -1,395 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * wdgt_rotate_label.c: label rotate selection widget module - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "wdgt-rotate-label.h" - -#include -#include -#include -#include -#include -#include - -#include "marshal.h" -#include "color.h" -#include -#include "cairo-label-path.h" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ -#define MINI_PREVIEW_MAX_PIXELS 48 -#define MINI_PREVIEW_CANVAS_PIXELS (MINI_PREVIEW_MAX_PIXELS + 8) - -#define LINE_COLOR GL_COLOR(0,0,0) -#define FILL_COLOR GL_COLOR(255,255,255) - -#define LINE_WIDTH_PIXELS 1.0 - -#define SHADOW_X_OFFSET 3 -#define SHADOW_Y_OFFSET 3 - - -/*===========================================*/ -/* Private types */ -/*===========================================*/ - -struct _glWdgtRotateLabelPrivate { - - GtkWidget *rotate_check; - GtkWidget *rotate_drawingarea; - - lglTemplate *template; -}; - -enum { - CHANGED, - LAST_SIGNAL -}; - -/*===========================================*/ -/* Private globals */ -/*===========================================*/ - -static gint wdgt_rotate_label_signals[LAST_SIGNAL] = { 0 }; - -/*===========================================*/ -/* Local function prototypes */ -/*===========================================*/ - -static void gl_wdgt_rotate_label_finalize (GObject *object); - -static void gl_wdgt_rotate_label_construct (glWdgtRotateLabel *rotate_label); - -static void entry_changed_cb (GtkToggleButton *toggle, - gpointer user_data); - -static void drawingarea_update (GtkDrawingArea *drawing_area, - lglTemplate *template, - gboolean rotate_flag); - -static gboolean expose_cb (GtkWidget *drawingarea, - GdkEventExpose *event, - gpointer user_data); - - -/****************************************************************************/ -/* Boilerplate Object stuff. */ -/****************************************************************************/ -G_DEFINE_TYPE (glWdgtRotateLabel, gl_wdgt_rotate_label, GTK_TYPE_VBOX); - - -static void -gl_wdgt_rotate_label_class_init (glWdgtRotateLabelClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - gl_wdgt_rotate_label_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_wdgt_rotate_label_finalize; - - wdgt_rotate_label_signals[CHANGED] = - g_signal_new ("changed", - G_OBJECT_CLASS_TYPE(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (glWdgtRotateLabelClass, changed), - NULL, NULL, - gl_marshal_VOID__VOID, - G_TYPE_NONE, 0); - -} - -static void -gl_wdgt_rotate_label_init (glWdgtRotateLabel *rotate_label) -{ - rotate_label->priv = g_new0 (glWdgtRotateLabelPrivate, 1); -} - -static void -gl_wdgt_rotate_label_finalize (GObject *object) -{ - glWdgtRotateLabel *rotate_label = GL_WDGT_ROTATE_LABEL (object); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_WDGT_ROTATE_LABEL (object)); - - if (rotate_label->priv->template) { - lgl_template_free (rotate_label->priv->template); - rotate_label->priv->template = NULL; - } - g_free (rotate_label->priv); - - G_OBJECT_CLASS (gl_wdgt_rotate_label_parent_class)->finalize (object); -} - -GtkWidget * -gl_wdgt_rotate_label_new (void) -{ - glWdgtRotateLabel *rotate_label; - - rotate_label = g_object_new (gl_wdgt_rotate_label_get_type (), NULL); - - gl_wdgt_rotate_label_construct (rotate_label); - - return GTK_WIDGET (rotate_label); -} - -/*--------------------------------------------------------------------------*/ -/* Construct composite widget. */ -/*--------------------------------------------------------------------------*/ -static void -gl_wdgt_rotate_label_construct (glWdgtRotateLabel *rotate_label) -{ - GladeXML *gui; - GtkWidget *hbox; - - g_return_if_fail (GL_IS_WDGT_ROTATE_LABEL (rotate_label)); - g_return_if_fail (rotate_label->priv != NULL); - - gui = glade_xml_new (GLABELS_GLADE_DIR "wdgt-rotate-label.glade", - "rotate_hbox", NULL); - - if (!gui) { - g_critical ("Could not open wdgt-media-select.glade. gLabels may not be installed correctly!"); - return; - } - - hbox = glade_xml_get_widget (gui, "rotate_hbox"); - gtk_container_add (GTK_CONTAINER (rotate_label), hbox); - - rotate_label->priv->rotate_check = glade_xml_get_widget (gui, "rotate_check"); - rotate_label->priv->rotate_drawingarea = glade_xml_get_widget (gui, "rotate_drawingarea"); - - g_object_unref (gui); - - - gtk_widget_set_size_request (rotate_label->priv->rotate_drawingarea, - MINI_PREVIEW_CANVAS_PIXELS, - MINI_PREVIEW_CANVAS_PIXELS); - - /* Connect signals to controls */ - g_signal_connect (G_OBJECT (rotate_label->priv->rotate_check), - "toggled", - G_CALLBACK (entry_changed_cb), rotate_label); - g_signal_connect (G_OBJECT (rotate_label->priv->rotate_drawingarea), - "expose_event", - G_CALLBACK (expose_cb), rotate_label); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. modify widget due to change of check button */ -/*--------------------------------------------------------------------------*/ -static void -entry_changed_cb (GtkToggleButton *toggle, - gpointer user_data) -{ - glWdgtRotateLabel *rotate_label = GL_WDGT_ROTATE_LABEL (user_data); - - if (rotate_label->priv->template != NULL) { - /* Update mini_preview canvas & details with template */ - drawingarea_update (GTK_DRAWING_AREA (rotate_label->priv->rotate_drawingarea), - rotate_label->priv->template, - gtk_toggle_button_get_active (toggle)); - } - - /* Emit our "changed" signal */ - g_signal_emit (G_OBJECT (user_data), - wdgt_rotate_label_signals[CHANGED], 0); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Update mini-preview from template . */ -/*--------------------------------------------------------------------------*/ -static void -drawingarea_update (GtkDrawingArea *drawing_area, - lglTemplate *template, - gboolean rotate_flag) -{ - const lglTemplateFrame *frame; - gdouble m, m_canvas, w, h, scale; - GtkStyle *style; - guint line_color, fill_color, shadow_color; - cairo_t *cr; - - if (!GTK_WIDGET_DRAWABLE (GTK_WIDGET (drawing_area))) - { - return; - } - - /* Clear surface */ - gdk_window_clear (GTK_WIDGET (drawing_area)->window); - - if (template == NULL) - { - return; - } - - frame = (lglTemplateFrame *)template->frames->data; - - if (rotate_flag) - { - lgl_template_frame_get_size (frame, &h, &w); - } - else - { - lgl_template_frame_get_size (frame, &w, &h); - } - m = MAX (w, h); - scale = MINI_PREVIEW_MAX_PIXELS / m; - m_canvas = MINI_PREVIEW_CANVAS_PIXELS / scale; - - style = gtk_widget_get_style (GTK_WIDGET (drawing_area)); - - /* Adjust sensitivity (should the canvas be grayed?) */ - if (w != h) { - line_color = LINE_COLOR; - fill_color = FILL_COLOR; - } else { - line_color = gl_color_from_gdk_color (&style->text[GTK_STATE_INSENSITIVE]); - fill_color = gl_color_from_gdk_color (&style->base[GTK_STATE_INSENSITIVE]); - } - - shadow_color = gl_color_from_gdk_color (&style->bg[GTK_STATE_ACTIVE]); - - - cr = gdk_cairo_create (GTK_WIDGET (drawing_area)->window); - - cairo_identity_matrix (cr); - cairo_translate (cr, MINI_PREVIEW_CANVAS_PIXELS/2, MINI_PREVIEW_CANVAS_PIXELS/2); - cairo_scale (cr, scale, scale); - cairo_translate (cr, -w/2.0, -h/2.0); - - /* - * Shadow - */ - cairo_save (cr); - cairo_translate (cr, SHADOW_X_OFFSET/scale, SHADOW_Y_OFFSET/scale); - gl_cairo_label_path (cr, template, rotate_flag, FALSE); - - cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (shadow_color)); - cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); - cairo_fill (cr); - cairo_restore (cr); - - /* - * Label + outline - */ - gl_cairo_label_path (cr, template, rotate_flag, FALSE); - - cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (fill_color)); - cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); - cairo_fill_preserve (cr); - - cairo_set_line_width (cr, LINE_WIDTH_PIXELS/scale); - cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (line_color)); - cairo_stroke (cr); - - - cairo_destroy (cr); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Expose handler. */ -/*--------------------------------------------------------------------------*/ -static gboolean -expose_cb (GtkWidget *drawingarea, GdkEventExpose *event, gpointer user_data) -{ - glWdgtRotateLabel *rotate_label = GL_WDGT_ROTATE_LABEL (user_data); - - drawingarea_update (GTK_DRAWING_AREA (drawingarea), - rotate_label->priv->template, - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rotate_label->priv->rotate_check))); - - return FALSE; -} - -/****************************************************************************/ -/* query state of widget. */ -/****************************************************************************/ -gboolean -gl_wdgt_rotate_label_get_state (glWdgtRotateLabel *rotate_label) -{ - return - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON - (rotate_label->priv->rotate_check)); -} - -/****************************************************************************/ -/* set state of widget. */ -/****************************************************************************/ -void -gl_wdgt_rotate_label_set_state (glWdgtRotateLabel *rotate_label, - gboolean state) -{ - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (rotate_label->priv->rotate_check), state); -} - -/****************************************************************************/ -/* set template for widget. */ -/****************************************************************************/ -void -gl_wdgt_rotate_label_set_template_name (glWdgtRotateLabel *rotate_label, - gchar *name) -{ - lglTemplate *template; - const lglTemplateFrame *frame; - gdouble raw_w, raw_h; - - if (name == NULL) - { - rotate_label->priv->template = NULL; - - gtk_widget_set_sensitive (rotate_label->priv->rotate_check, - FALSE); - - drawingarea_update (GTK_DRAWING_AREA (rotate_label->priv->rotate_drawingarea), - NULL, - FALSE); - } - else - { - template = lgl_db_lookup_template_from_name (name); - frame = (lglTemplateFrame *)template->frames->data; - - rotate_label->priv->template = template; - lgl_template_frame_get_size (frame, &raw_w, &raw_h); - - gtk_widget_set_sensitive (rotate_label->priv->rotate_check, - (raw_w != raw_h)); - - drawingarea_update (GTK_DRAWING_AREA (rotate_label->priv->rotate_drawingarea), - rotate_label->priv->template, - FALSE); - } - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (rotate_label->priv->rotate_check), FALSE); -} - diff --git a/glabels2/src/wdgt-rotate-label.h b/glabels2/src/wdgt-rotate-label.h deleted file mode 100644 index 3d8b412e..00000000 --- a/glabels2/src/wdgt-rotate-label.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * wdgt_rotate_label.h: label rotate selection widget module header file - * - * Copyright (C) 2001-2006 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __WDGT_ROTATE_LABEL_H__ -#define __WDGT_ROTATE_LABEL_H__ - -#include - -G_BEGIN_DECLS - -#define GL_TYPE_WDGT_ROTATE_LABEL (gl_wdgt_rotate_label_get_type ()) -#define GL_WDGT_ROTATE_LABEL(obj) \ - (GTK_CHECK_CAST((obj), GL_TYPE_WDGT_ROTATE_LABEL, glWdgtRotateLabel )) -#define GL_WDGT_ROTATE_LABEL_CLASS(klass) \ - (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WDGT_ROTATE_LABEL, glWdgtRotateLabelClass)) -#define GL_IS_WDGT_ROTATE_LABEL(obj) \ - (GTK_CHECK_TYPE ((obj), GL_TYPE_WDGT_ROTATE_LABEL)) -#define GL_IS_WDGT_ROTATE_LABEL_CLASS(klass) \ - (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WDGT_ROTATE_LABEL)) - -typedef struct _glWdgtRotateLabel glWdgtRotateLabel; -typedef struct _glWdgtRotateLabelClass glWdgtRotateLabelClass; - -typedef struct _glWdgtRotateLabelPrivate glWdgtRotateLabelPrivate; - -struct _glWdgtRotateLabel { - GtkVBox parent_widget; - - glWdgtRotateLabelPrivate *priv; -}; - -struct _glWdgtRotateLabelClass { - GtkVBoxClass parent_class; - - void (*changed) (glWdgtRotateLabel *wdgt_rotate_label, - gpointer user_data); -}; - -GType gl_wdgt_rotate_label_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_wdgt_rotate_label_new (void); - -gboolean gl_wdgt_rotate_label_get_state (glWdgtRotateLabel *rotate_label); - -void gl_wdgt_rotate_label_set_state (glWdgtRotateLabel *rotate_label, - gboolean state); - -void gl_wdgt_rotate_label_set_template_name (glWdgtRotateLabel *rotate_label, - gchar *name); - -G_END_DECLS - -#endif diff --git a/glabels2/src/window.c b/glabels2/src/window.c deleted file mode 100644 index 33e3b7e7..00000000 --- a/glabels2/src/window.c +++ /dev/null @@ -1,616 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * window.c: a gLabels app window - * - * Copyright (C) 2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "window.h" - -#include -#include -#include -#include -#include -#include - -#include "ui.h" -#include "ui-commands.h" -#include "util.h" -#include "xml-label.h" -#include "prefs.h" -#include "file.h" - -#include "debug.h" - -/*===========================================================================*/ -/* Private macros and constants. */ -/*===========================================================================*/ - -#define DEFAULT_WINDOW_WIDTH 788 -#define DEFAULT_WINDOW_HEIGHT 600 - -#define CURSOR_INFO_WIDTH 150 -#define ZOOM_INFO_WIDTH 50 - -/*===========================================================================*/ -/* Private globals */ -/*===========================================================================*/ - -static GList *window_list = NULL; - - -/*===========================================================================*/ -/* Local function prototypes */ -/*===========================================================================*/ - -static void gl_window_finalize (GObject *object); -static void gl_window_destroy (GtkObject *gtk_object); - -static void set_window_title (glWindow *window, - glLabel *label); - -static gboolean window_delete_event_cb (glWindow *window, - GdkEvent *event, - gpointer user_data); - -static void selection_changed_cb (glView *view, - glWindow *window); - -static void context_menu_activate_cb (glView *view, - gint button, - guint32 activate_time, - glWindow *window); - -static void zoom_changed_cb (glView *view, - gdouble zoom, - glWindow *window); - -static void pointer_moved_cb (glView *view, - gdouble x, - gdouble y, - glWindow *window); - -static void pointer_exit_cb (glView *view, - glWindow *window); - -static void name_changed_cb (glLabel *label, - glWindow *window); - -static void modified_changed_cb (glLabel *label, - glWindow *window); - - -/****************************************************************************/ -/* Boilerplate Object stuff. */ -/****************************************************************************/ -G_DEFINE_TYPE (glWindow, gl_window, GTK_TYPE_WINDOW); - - -static void -gl_window_class_init (glWindowClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (class); - - gl_debug (DEBUG_WINDOW, "START"); - - gl_window_parent_class = g_type_class_peek_parent (class); - - object_class->finalize = gl_window_finalize; - - gtk_object_class->destroy = gl_window_destroy; - - gl_debug (DEBUG_WINDOW, "END"); -} - -static void -gl_window_init (glWindow *window) -{ - GtkWidget *vbox1; - GtkUIManager *ui; - GtkWidget *status_hbox; - - gl_debug (DEBUG_WINDOW, "START"); - - vbox1 = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (window), vbox1); - - window->ui = ui = gl_ui_new (window); - gtk_box_pack_start (GTK_BOX (vbox1), - gtk_ui_manager_get_widget (ui, "/MenuBar"), - FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), - gtk_ui_manager_get_widget (ui, "/MainToolBar"), - FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), - gtk_ui_manager_get_widget (ui, "/DrawingToolBar"), - FALSE, FALSE, 0); - - window->hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), window->hbox, TRUE, TRUE, 0); - - window->sidebar = GL_UI_SIDEBAR (gl_ui_sidebar_new ()); - gtk_box_pack_end (GTK_BOX (window->hbox), GTK_WIDGET (window->sidebar), FALSE, FALSE, 0); - - window->property_bar = GL_UI_PROPERTY_BAR (gl_ui_property_bar_new ()); - gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (window->property_bar), FALSE, FALSE, 0); - - status_hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox1), status_hbox, FALSE, FALSE, 0); - - window->status_bar = gtk_statusbar_new (); - gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (window->status_bar), FALSE); - gtk_box_pack_start (GTK_BOX (status_hbox), - window->status_bar, - TRUE, TRUE, 0); - window->zoom_info = gtk_label_new (NULL); - gtk_widget_set_size_request (window->zoom_info, ZOOM_INFO_WIDTH, -1); - window->zoom_info_frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME(window->zoom_info_frame), GTK_SHADOW_IN); - gtk_container_add (GTK_CONTAINER(window->zoom_info_frame), window->zoom_info); - gtk_widget_show_all (window->zoom_info_frame); - gtk_box_pack_end (GTK_BOX (status_hbox), - window->zoom_info_frame, - FALSE, FALSE, 0); - - window->cursor_info = gtk_label_new (NULL); - gtk_widget_set_size_request (window->cursor_info, CURSOR_INFO_WIDTH, -1); - window->cursor_info_frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME(window->cursor_info_frame), GTK_SHADOW_IN); - gtk_container_add (GTK_CONTAINER(window->cursor_info_frame), window->cursor_info); - gtk_widget_show_all (window->cursor_info_frame); - gtk_box_pack_end (GTK_BOX (status_hbox), - window->cursor_info_frame, - FALSE, FALSE, 0); - - gtk_window_set_default_size (GTK_WINDOW (window), - DEFAULT_WINDOW_WIDTH, - DEFAULT_WINDOW_HEIGHT); - - g_signal_connect (G_OBJECT(window), "delete-event", - G_CALLBACK(window_delete_event_cb), NULL); - - window->menu_tips_context_id = - gtk_statusbar_get_context_id (GTK_STATUSBAR (window->status_bar), "menu_tips"); - - window->print_settings = NULL; - window->merge_dialog = NULL; - window->context_menu = GTK_MENU (gtk_ui_manager_get_widget (ui, "/ContextMenu")); - window->empty_selection_context_menu = - GTK_MENU (gtk_ui_manager_get_widget (ui, "/EmptySelectionContextMenu")); - - window->view = NULL; - - window_list = g_list_append (window_list, window); - - gl_debug (DEBUG_WINDOW, "END"); -} - -static void -gl_window_finalize (GObject *object) -{ - gl_debug (DEBUG_WINDOW, "START"); - - g_return_if_fail (object != NULL); - g_return_if_fail (GL_IS_WINDOW (object)); - - G_OBJECT_CLASS (gl_window_parent_class)->finalize (object); - - gl_debug (DEBUG_WINDOW, "END"); -} - -static void -gl_window_destroy (GtkObject *gtk_object) -{ - glWindow *window; - - gl_debug (DEBUG_WINDOW, "START"); - - g_return_if_fail (gtk_object != NULL); - g_return_if_fail (GL_IS_WINDOW (gtk_object)); - - window = GL_WINDOW (gtk_object); - window_list = g_list_remove (window_list, window); - - if (window->ui) { - gl_ui_unref(window->ui); - window->ui = NULL; - } - - if (GTK_OBJECT_CLASS (gl_window_parent_class)->destroy) { - GTK_OBJECT_CLASS (gl_window_parent_class)->destroy (gtk_object); - } - - gl_debug (DEBUG_WINDOW, "END"); -} - - -/****************************************************************************/ -/** Create a glabels window. */ -/****************************************************************************/ -GtkWidget * -gl_window_new (void) -{ - glWindow *window; - - gl_debug (DEBUG_WINDOW, "START"); - - window = g_object_new (GL_TYPE_WINDOW, - "title", _("(none) - gLabels"), - NULL); - - gl_debug (DEBUG_WINDOW, "window=%p", window); - gl_debug (DEBUG_WINDOW, "view=%p", window->view); - - gl_debug (DEBUG_WINDOW, "END"); - - return GTK_WIDGET(window); -} - -/****************************************************************************/ -/** Create a glabels window from a label. */ -/****************************************************************************/ -GtkWidget* -gl_window_new_from_label (glLabel *label) -{ - glWindow *window; - - gl_debug (DEBUG_WINDOW, "START"); - - window = GL_WINDOW (gl_window_new ()); - - gl_window_set_label (window, label); - - gl_debug (DEBUG_WINDOW, "END"); - - return GTK_WIDGET(window); -} - -/****************************************************************************/ -/** Create a glabels window from a glabels file. */ -/****************************************************************************/ -GtkWidget* -gl_window_new_from_file (const gchar *filename) -{ - glWindow *window; - glLabel *label; - gchar *abs_filename; - glXMLLabelStatus status; - - gl_debug (DEBUG_WINDOW, "START"); - - window = GL_WINDOW (gl_window_new ()); - - abs_filename = gl_util_make_absolute (filename); - label = gl_xml_label_open (abs_filename, &status); - g_free (abs_filename); - - gl_window_set_label (window, label); - - gl_debug (DEBUG_WINDOW, "END"); - - return GTK_WIDGET(window); -} - -/****************************************************************************/ -/** Is window empty? */ -/****************************************************************************/ -gboolean -gl_window_is_empty (glWindow *window) -{ - g_return_val_if_fail (GL_IS_WINDOW (window), FALSE); - - gl_debug (DEBUG_WINDOW, "return %d", (window->view == NULL) ); - return ( window->view == NULL ); -} - -/****************************************************************************/ -/** Create view from label and place in window. */ -/****************************************************************************/ -void -gl_window_set_label (glWindow *window, - glLabel *label) -{ - gchar *string; - - gl_debug (DEBUG_WINDOW, "START"); - - g_return_if_fail (GL_IS_WINDOW (window)); - g_return_if_fail (GL_IS_LABEL (label)); - - gl_label_clear_modified (label); - - set_window_title (window, label); - - if ( window->view != NULL ) { - gtk_widget_destroy (window->view); - window->view = NULL; - } - - window->view = gl_view_new (label); - gtk_box_pack_start (GTK_BOX (window->hbox), window->view,TRUE, TRUE, 0); - - gtk_widget_show_all (window->view); - - gl_view_zoom_to_fit (GL_VIEW(window->view)); - - if (gl_prefs->grid_visible) { - gl_view_show_grid (GL_VIEW(window->view)); - } else { - gl_view_hide_grid (GL_VIEW(window->view)); - } - - if (gl_prefs->markup_visible) { - gl_view_show_markup (GL_VIEW(window->view)); - } else { - gl_view_hide_markup (GL_VIEW(window->view)); - } - - gl_ui_update_all (window->ui, GL_VIEW(window->view)); - - gl_ui_property_bar_set_view (window->property_bar, GL_VIEW(window->view)); - gl_ui_sidebar_set_view (window->sidebar, GL_VIEW(window->view)); - - string = g_strdup_printf ("%3.0f%%", - 100.0*gl_view_get_zoom (GL_VIEW(window->view))); - gtk_label_set_text (GTK_LABEL(window->zoom_info), string); - g_free (string); - - g_signal_connect (G_OBJECT(window->view), "selection_changed", - G_CALLBACK(selection_changed_cb), window); - - g_signal_connect (G_OBJECT(window->view), "context_menu_activate", - G_CALLBACK(context_menu_activate_cb), window); - - g_signal_connect (G_OBJECT(window->view), "zoom_changed", - G_CALLBACK(zoom_changed_cb), window); - - g_signal_connect (G_OBJECT(window->view), "pointer_moved", - G_CALLBACK(pointer_moved_cb), window); - - g_signal_connect (G_OBJECT(window->view), "pointer_exit", - G_CALLBACK(pointer_exit_cb), window); - - g_signal_connect (G_OBJECT(label), "name_changed", - G_CALLBACK(name_changed_cb), window); - - g_signal_connect (G_OBJECT(label), "modified_changed", - G_CALLBACK(modified_changed_cb), window); - - gl_debug (DEBUG_WINDOW, "END"); -} - -/****************************************************************************/ -/** Return list of glabels windows. */ -/****************************************************************************/ -const GList * -gl_window_get_window_list (void) -{ - gl_debug (DEBUG_WINDOW, ""); - return window_list; -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. Set window title based on name and state of label. */ -/*---------------------------------------------------------------------------*/ -static void -set_window_title (glWindow *window, - glLabel *label) -{ - gchar *name, *title; - - gl_debug (DEBUG_WINDOW, "START"); - - g_return_if_fail (window && GL_IS_WINDOW (window)); - g_return_if_fail (label && GL_IS_LABEL (label)); - - name = gl_label_get_short_name (label); - g_return_if_fail (name != NULL); - - if (gl_label_is_modified (label)) { - title = g_strdup_printf ("%s %s - gLabels", - name, _("(modified)")); - } else { - title = g_strdup_printf ("%s - gLabels", name); - } - - gtk_window_set_title (GTK_WINDOW(window), title); - - g_free (name); - g_free (title); - - gl_debug (DEBUG_WINDOW, "END"); -} - -/*-------------------------------------------------------------------------*/ -/** PRIVATE. Window "delete-event" callback. */ -/*-------------------------------------------------------------------------*/ -static gboolean -window_delete_event_cb (glWindow *window, - GdkEvent *event, - gpointer user_data) -{ - gl_debug (DEBUG_WINDOW, "START"); - - g_return_val_if_fail (window && GL_IS_WINDOW (window), TRUE); - - gl_file_close (window); - - gl_debug (DEBUG_WINDOW, "END"); - - return TRUE; -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. View "selection state changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -selection_changed_cb (glView *view, - glWindow *window) -{ - gl_debug (DEBUG_WINDOW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (window && GL_IS_WINDOW (window)); - - gl_ui_update_selection_verbs (window->ui, view); - - gl_debug (DEBUG_WINDOW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. View "context menu activate" callback. */ -/*---------------------------------------------------------------------------*/ -static void -context_menu_activate_cb (glView *view, - gint button, - guint32 activate_time, - glWindow *window) -{ - gl_debug (DEBUG_WINDOW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (window && GL_IS_WINDOW (window)); - - if (gl_view_is_selection_empty (view)) { - - gtk_menu_popup (GTK_MENU (window->empty_selection_context_menu), - NULL, NULL, NULL, NULL, button, activate_time); - - } else { - - gtk_menu_popup (GTK_MENU (window->context_menu), - NULL, NULL, NULL, NULL, button, activate_time); - - } - - gl_debug (DEBUG_WINDOW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. View "zoom state changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -zoom_changed_cb (glView *view, - gdouble zoom, - glWindow *window) -{ - gchar *string; - - gl_debug (DEBUG_WINDOW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (window && GL_IS_WINDOW (window)); - - string = g_strdup_printf ("%3.0f%%", 100.0*zoom); - gtk_label_set_text (GTK_LABEL(window->zoom_info), string); - g_free (string); - - gl_ui_update_zoom_verbs (window->ui, view); - - gl_debug (DEBUG_WINDOW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. View "pointer moved" callback. */ -/*---------------------------------------------------------------------------*/ -static void -pointer_moved_cb (glView *view, - gdouble x, - gdouble y, - glWindow *window) -{ - gchar *string; - gdouble units_per_point; - gint units_precision; - - gl_debug (DEBUG_WINDOW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (window && GL_IS_WINDOW (window)); - - units_per_point = gl_prefs_get_units_per_point (); - units_precision = gl_prefs_get_units_precision (); - - string = g_strdup_printf ("%.*f, %.*f", - units_precision, x*units_per_point, - units_precision, y*units_per_point); - gtk_label_set_text (GTK_LABEL(window->cursor_info), string); - g_free (string); - - gl_debug (DEBUG_WINDOW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. View "pointer exit" callback. */ -/*---------------------------------------------------------------------------*/ -static void -pointer_exit_cb (glView *view, - glWindow *window) -{ - gl_debug (DEBUG_WINDOW, "START"); - - g_return_if_fail (view && GL_IS_VIEW (view)); - g_return_if_fail (window && GL_IS_WINDOW (window)); - - gtk_label_set_text (GTK_LABEL(window->cursor_info), ""); - - gl_debug (DEBUG_WINDOW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. Label "name changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -name_changed_cb (glLabel *label, - glWindow *window) -{ - gl_debug (DEBUG_WINDOW, "START"); - - g_return_if_fail (label && GL_IS_LABEL (label)); - g_return_if_fail (window && GL_IS_WINDOW (window)); - - set_window_title (window, label); - - gl_debug (DEBUG_WINDOW, "END"); -} - -/*---------------------------------------------------------------------------*/ -/** PRIVATE. Label "modified state changed" callback. */ -/*---------------------------------------------------------------------------*/ -static void -modified_changed_cb (glLabel *label, - glWindow *window) -{ - gl_debug (DEBUG_WINDOW, "START"); - - g_return_if_fail (label && GL_IS_LABEL (label)); - g_return_if_fail (window && GL_IS_WINDOW (window)); - - set_window_title (window, label); - - gl_ui_update_modified_verbs (window->ui, label); - - gl_debug (DEBUG_WINDOW, "END"); -} - diff --git a/glabels2/src/window.h b/glabels2/src/window.h deleted file mode 100644 index e5a63ab1..00000000 --- a/glabels2/src/window.h +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * window.h: a gLabels app window - * - * Copyright (C) 2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __WINDOW_H__ -#define __WINDOW_H__ - -#include -#include -#include - -#include "view.h" -#include "label.h" -#include "ui-property-bar.h" -#include "ui-sidebar.h" -#include "print-op.h" -#include "merge-properties-dialog.h" - -G_BEGIN_DECLS - -#define GL_TYPE_WINDOW (gl_window_get_type ()) -#define GL_WINDOW(obj) \ - (GTK_CHECK_CAST((obj), GL_TYPE_WINDOW, glWindow )) -#define GL_WINDOW_CLASS(klass) \ - (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WINDOW, glWindowClass)) -#define GL_IS_WINDOW(obj) \ - (GTK_CHECK_TYPE ((obj), GL_TYPE_WINDOW)) -#define GL_IS_WINDOW_CLASS(klass) \ - (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WINDOW)) - -typedef struct _glWindow glWindow; -typedef struct _glWindowClass glWindowClass; - -struct _glWindow { - GtkWindow parent_widget; - - GtkUIManager *ui; - - GtkWidget *view; - - GtkWidget *hbox; - - glUIPropertyBar *property_bar; - glUISidebar *sidebar; - - GtkWidget *status_bar; - GtkWidget *cursor_info; - GtkWidget *cursor_info_frame; - GtkWidget *zoom_info; - GtkWidget *zoom_info_frame; - - guint menu_tips_context_id; - - glPrintOpSettings *print_settings; - glMergePropertiesDialog *merge_dialog; - GtkMenu *context_menu; - GtkMenu *empty_selection_context_menu; -}; - -struct _glWindowClass { - GtkWindowClass parent_class; -}; - -GType gl_window_get_type (void) G_GNUC_CONST; - -GtkWidget *gl_window_new (void); - -GtkWidget *gl_window_new_from_file (const gchar *filename); - -GtkWidget *gl_window_new_from_label (glLabel *label); - -gboolean gl_window_is_empty (glWindow *window); - -void gl_window_set_label (glWindow *window, - glLabel *label); - -const GList *gl_window_get_window_list (void); - -G_END_DECLS - -#endif /* __WINDOW_H__ */ diff --git a/glabels2/src/xml-label-04.c b/glabels2/src/xml-label-04.c deleted file mode 100644 index 89a94b6b..00000000 --- a/glabels2/src/xml-label-04.c +++ /dev/null @@ -1,504 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * xml-label-04.c: GLabels xml label compat module - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "xml-label-04.h" - -#include - -#include "label-text.h" -#include "label-box.h" -#include "label-line.h" -#include "label-ellipse.h" -#include "label-image.h" -#include "label-barcode.h" -#include -#include - -#include "util.h" -#include "debug.h" - -static gboolean xml04_parse_media_description (xmlNodePtr node, - glLabel *label); -static void xml04_parse_object (xmlNodePtr node, - glLabelObject *object); -static void xml04_parse_text_props (xmlNodePtr node, - glLabelText *object); -static void xml04_parse_box_props (xmlNodePtr node, - glLabelBox *object); -static void xml04_parse_line_props (xmlNodePtr node, - glLabelLine *object); -static void xml04_parse_ellipse_props (xmlNodePtr node, - glLabelEllipse *object); -static void xml04_parse_image_props (xmlNodePtr node, - glLabelImage *object); -static void xml04_parse_barcode_props (xmlNodePtr node, - glLabelBarcode *object); -static void xml04_parse_merge_properties (xmlNodePtr node, - glLabel *label); - - -/****************************************************************************/ -/* PRIVATE. Parse xml doc structure and create label. */ -/****************************************************************************/ -glLabel *gl_xml_label_04_parse (xmlNodePtr root, - glXMLLabelStatus *status) -{ - glLabel *label; - xmlNodePtr node; - GObject *object; - gboolean rotate_flag; - - gl_debug (DEBUG_XML, "START"); - - *status = XML_LABEL_OK; - - if (!xmlStrEqual (root->name, (xmlChar *)"Label")) { - g_message (_("Bad root node = \"%s\""), root->name); - *status = XML_LABEL_ERROR_OPEN_PARSE; - return NULL; - } - - label = GL_LABEL (gl_label_new ()); - - rotate_flag = lgl_xml_get_prop_boolean (root, "rotate", FALSE); - gl_label_set_rotate_flag (label, rotate_flag); - - for (node = root->xmlChildrenNode; node != NULL; node = node->next) { - - gl_debug (DEBUG_XML, "node name = \"%s\"", node->name); - - if (!xmlNodeIsText (node)) { - if (xmlStrEqual (node->name, (xmlChar *)"Media_Type")) { - if (!xml04_parse_media_description (node, label)) { - *status = XML_LABEL_UNKNOWN_MEDIA; - } - } else if (xmlStrEqual (node->name, (xmlChar *)"Text")) { - object = gl_label_text_new (label); - xml04_parse_object (node, GL_LABEL_OBJECT(object)); - xml04_parse_text_props (node, GL_LABEL_TEXT(object)); - } else if (xmlStrEqual (node->name, (xmlChar *)"Box")) { - object = gl_label_box_new (label); - xml04_parse_object (node, GL_LABEL_OBJECT(object)); - xml04_parse_box_props (node, GL_LABEL_BOX(object)); - } else if (xmlStrEqual (node->name, (xmlChar *)"Line")) { - object = gl_label_line_new (label); - xml04_parse_object (node, GL_LABEL_OBJECT(object)); - xml04_parse_line_props (node, GL_LABEL_LINE(object)); - } else if (xmlStrEqual (node->name, (xmlChar *)"Ellipse")) { - object = gl_label_ellipse_new (label); - xml04_parse_object (node, GL_LABEL_OBJECT(object)); - xml04_parse_ellipse_props (node, - GL_LABEL_ELLIPSE(object)); - } else if (xmlStrEqual (node->name, (xmlChar *)"Image")) { - object = gl_label_image_new (label); - xml04_parse_object (node, GL_LABEL_OBJECT(object)); - xml04_parse_image_props (node, GL_LABEL_IMAGE(object)); - } else if (xmlStrEqual (node->name, (xmlChar *)"Barcode")) { - object = gl_label_barcode_new (label); - xml04_parse_object (node, GL_LABEL_OBJECT(object)); - xml04_parse_barcode_props (node, - GL_LABEL_BARCODE(object)); - } else if (xmlStrEqual (node->name, (xmlChar *)"Merge_Properties")) { - xml04_parse_merge_properties (node, label); - } else { - g_message (_("bad node = \"%s\""), node->name); - } - } - } - - gl_debug (DEBUG_XML, "END"); - - return label; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse Media Description node. */ -/*--------------------------------------------------------------------------*/ -static gboolean -xml04_parse_media_description (xmlNodePtr node, - glLabel *label) -{ - xmlChar *template_name; - lglTemplate *template; - gboolean ret; - - gl_debug (DEBUG_XML, "START"); - - template_name = xmlNodeGetContent (node); - - template = lgl_db_lookup_template_from_name ((gchar *)template_name); - if (template == NULL) { - g_message ("Undefined template \"%s\"", template_name); - /* Get a default */ - template = lgl_db_lookup_template_from_name (NULL); - ret = FALSE; - } else { - ret = TRUE; - } - - gl_label_set_template (label, template); - - lgl_template_free (template); - xmlFree (template_name); - - gl_debug (DEBUG_XML, "END"); - - return ret; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Object Node */ -/*--------------------------------------------------------------------------*/ -static void -xml04_parse_object (xmlNodePtr object_node, - glLabelObject *object) -{ - gdouble x, y; - - gl_debug (DEBUG_XML, "START"); - - x = lgl_xml_get_prop_double (object_node, "x", 0); - y = lgl_xml_get_prop_double (object_node, "y", 0); - - gl_label_object_set_position (object, x, y); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Label->Text Node Properties */ -/*--------------------------------------------------------------------------*/ -static void -xml04_parse_text_props (xmlNodePtr object_node, - glLabelText *object) -{ - xmlChar *font_family; - gdouble font_size; - PangoWeight font_weight; - gboolean font_italic_flag; - glColorNode *color_node; - PangoAlignment align; - xmlNodePtr line_node, text_node; - glTextNode *node_text; - GList *nodes, *lines; - gdouble w, h, x, y; - xmlChar *string; - - gl_debug (DEBUG_XML, "START"); - - font_family = xmlGetProp (object_node, (xmlChar *)"font_family"); - font_size = lgl_xml_get_prop_double (object_node, "font_size", 0); - string = xmlGetProp (object_node, (xmlChar *)"font_weight"); - font_weight = gl_util_string_to_weight ((gchar *)string); - xmlFree (string); - font_italic_flag = lgl_xml_get_prop_boolean (object_node, "font_italic", FALSE); - - string = xmlGetProp (object_node, (xmlChar *)"justify"); - align = gl_util_string_to_align ((gchar *)string); - xmlFree (string); - - color_node = gl_color_node_new_default (); - color_node->color = lgl_xml_get_prop_uint (object_node, "color", 0); - - gl_label_object_set_font_family (GL_LABEL_OBJECT(object), (gchar *)font_family); - gl_label_object_set_font_size (GL_LABEL_OBJECT(object), font_size); - gl_label_object_set_font_weight (GL_LABEL_OBJECT(object), font_weight); - gl_label_object_set_font_italic_flag (GL_LABEL_OBJECT(object), font_italic_flag); - gl_label_object_set_text_color (GL_LABEL_OBJECT(object), color_node); - gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object), align); - - gl_color_node_free (&color_node); - - lines = NULL; - for (line_node = object_node->xmlChildrenNode; line_node != NULL; - line_node = line_node->next) { - - if (xmlStrEqual (line_node->name, (xmlChar *)"Line")) { - - gl_debug (DEBUG_XML, "->Line node"); - - nodes = NULL; - for (text_node = line_node->xmlChildrenNode; - text_node != NULL; text_node = text_node->next) { - - if (xmlStrEqual (text_node->name, (xmlChar *)"Field")) { - gl_debug (DEBUG_XML, "->Line->Field node"); - node_text = g_new0 (glTextNode, 1); - node_text->field_flag = TRUE; - node_text->data = - (gchar *)xmlGetProp (text_node, (xmlChar *)"name"); - nodes = - g_list_append (nodes, node_text); - } else if (xmlNodeIsText (text_node)) { - gl_debug (DEBUG_XML, "->Line->\"literal\" node"); - node_text = g_new0 (glTextNode, 1); - node_text->field_flag = FALSE; - node_text->data = - (gchar *)xmlNodeGetContent (text_node); - gl_debug (DEBUG_XML, "text = \"%s\"", - node_text->data); - nodes = - g_list_append (nodes, node_text); - } else { - g_message ("Unexpected Text Line child: \"%s\"", - text_node->name); - } - - } - lines = g_list_append (lines, nodes); - - } else if (!xmlNodeIsText (line_node)) { - g_message ("Unexpected Text child: \"%s\"", - line_node->name); - } - - } - - gl_label_text_set_lines (object, lines); - - gl_text_node_lines_free (&lines); - xmlFree (font_family); - - /* Adjust location. In 0.4.x, text was anchored at x,y */ - gl_label_object_get_position (GL_LABEL_OBJECT(object), &x, &y); - gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h); - switch (align) { - case PANGO_ALIGN_LEFT: - /* nothing */ - break; - case PANGO_ALIGN_CENTER: - x -= w/2.0; - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - break; - case PANGO_ALIGN_RIGHT: - x -= w; - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - break; - default: - /* should not happen */ - break; - } - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Label->Box Node Properties */ -/*--------------------------------------------------------------------------*/ -static void -xml04_parse_box_props (xmlNodePtr node, - glLabelBox *object) -{ - gdouble w, h, line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; - - gl_debug (DEBUG_XML, "START"); - - w = lgl_xml_get_prop_double (node, "w", 0); - h = lgl_xml_get_prop_double (node, "h", 0); - - line_width = lgl_xml_get_prop_double (node, "line_width", 0); - - line_color_node = gl_color_node_new_default (); - line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); - - fill_color_node = gl_color_node_new_default (); - fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0); - - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); - gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); - gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color_node); - - gl_color_node_free (&line_color_node); - gl_color_node_free (&fill_color_node); - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Label->Line Node Properties */ -/*--------------------------------------------------------------------------*/ -static void -xml04_parse_line_props (xmlNodePtr node, - glLabelLine *object) -{ - gdouble w, h, line_width; - glColorNode *line_color_node; - - gl_debug (DEBUG_XML, "START"); - - w = lgl_xml_get_prop_double (node, "dx", 0); - h = lgl_xml_get_prop_double (node, "dy", 0); - - line_width = lgl_xml_get_prop_double (node, "line_width", 0); - - line_color_node = gl_color_node_new_default (); - line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); - - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); - gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); - - gl_color_node_free (&line_color_node); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Label->Ellipse Node Properties */ -/*--------------------------------------------------------------------------*/ -static void -xml04_parse_ellipse_props (xmlNodePtr node, - glLabelEllipse *object) -{ - gdouble w, h, line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; - - gl_debug (DEBUG_XML, "START"); - - w = lgl_xml_get_prop_double (node, "w", 0); - h = lgl_xml_get_prop_double (node, "h", 0); - - line_width = lgl_xml_get_prop_double (node, "line_width", 0); - - line_color_node = gl_color_node_new_default (); - line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); - - fill_color_node = gl_color_node_new_default (); - fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0); - - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); - gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); - gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color_node); - - gl_color_node_free (&line_color_node); - gl_color_node_free (&fill_color_node); - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Label->Image Node Properties */ -/*--------------------------------------------------------------------------*/ -static void -xml04_parse_image_props (xmlNodePtr node, - glLabelImage *object) -{ - gdouble w, h; - glTextNode *filename; - - gl_debug (DEBUG_XML, "START"); - - filename = g_new0 (glTextNode, 1); - filename->field_flag = FALSE; - filename->data = (gchar *)xmlGetProp (node, (xmlChar *)"filename"); - gl_label_image_set_filename (object, filename); - gl_text_node_free (&filename); - - w = lgl_xml_get_prop_double (node, "w", 0); - h = lgl_xml_get_prop_double (node, "h", 0); - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Label->Barcode Node Properties */ -/*--------------------------------------------------------------------------*/ -static void -xml04_parse_barcode_props (xmlNodePtr node, - glLabelBarcode *object) -{ - xmlChar *id; - gboolean text_flag; - glColorNode *color_node; - gdouble scale; - xmlNodePtr child; - glTextNode *text_node; - - gl_debug (DEBUG_XML, "START"); - - color_node = gl_color_node_new_default (); - color_node->color = lgl_xml_get_prop_uint (node, "color", 0); - - id = xmlGetProp (node, (xmlChar *)"style"); - - text_flag = lgl_xml_get_prop_boolean (node, "text", FALSE); - scale = lgl_xml_get_prop_double (node, "scale", 1.0); - if (scale == 0.0) { - scale = 0.5; /* Set to a valid value */ - } - gl_label_barcode_set_props (object, (gchar *)id, text_flag, TRUE, 0); - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), color_node); - - child = node->xmlChildrenNode; - text_node = g_new0 (glTextNode, 1); - if (xmlStrEqual (child->name, (xmlChar *)"Field")) { - text_node->field_flag = TRUE; - text_node->data = (gchar *)xmlGetProp (child, (xmlChar *)"name"); - } else if (xmlNodeIsText (child)) { - text_node->field_flag = FALSE; - text_node->data = (gchar *)xmlNodeGetContent (child); - } else { - g_message ("Unexpected Barcode child: \"%s\"", child->name); - } - gl_label_barcode_set_data (object, text_node); - - gl_color_node_free (&color_node); - gl_text_node_free (&text_node); - xmlFree (id); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML merge properties tag. */ -/*--------------------------------------------------------------------------*/ -static void -xml04_parse_merge_properties (xmlNodePtr node, - glLabel *label) -{ - glMerge *merge; - xmlChar *string; - - gl_debug (DEBUG_XML, "START"); - - string = xmlGetProp (node, (xmlChar *)"type"); - merge = gl_merge_new ((gchar *)string); - xmlFree (string); - - string = xmlGetProp (node, (xmlChar *)"src"); - gl_merge_set_src (merge, (gchar *)string); - xmlFree (string); - - gl_label_set_merge (label, merge); - - g_object_unref (G_OBJECT(merge)); - - gl_debug (DEBUG_XML, "END"); -} diff --git a/glabels2/src/xml-label-04.h b/glabels2/src/xml-label-04.h deleted file mode 100644 index be11bafd..00000000 --- a/glabels2/src/xml-label-04.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * xml-label-04.h: GLabels xml label compat module header file - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __XML_LABEL_04_H__ -#define __XML_LABEL_04_H__ - -#include -#include - -#include "xml-label.h" - -G_BEGIN_DECLS - -extern glLabel *gl_xml_label_04_parse (xmlNodePtr root, - glXMLLabelStatus *status); - -G_END_DECLS - - -#endif /* __XML_LABEL_04_H__ */ diff --git a/glabels2/src/xml-label.c b/glabels2/src/xml-label.c deleted file mode 100644 index 0f8e104c..00000000 --- a/glabels2/src/xml-label.c +++ /dev/null @@ -1,1794 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * label.c: GLabels xml label module - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#include "xml-label.h" - -#include -#include -#include -#include -#include - -#include "label.h" -#include "label-object.h" -#include "label-text.h" -#include "label-box.h" -#include "label-line.h" -#include "label-ellipse.h" -#include "label-image.h" -#include "label-barcode.h" -#include "base64.h" -#include "xml-label-04.h" -#include -#include -#include -#include "util.h" - -#include "debug.h" - -/*========================================================*/ -/* Private macros and constants. */ -/*========================================================*/ -#define COMPAT01_NAME_SPACE "http://snaught.com/glabels/0.1/" -#define COMPAT04_NAME_SPACE "http://snaught.com/glabels/0.4/" -#define COMPAT20_NAME_SPACE "http://snaught.com/glabels/2.0/" - -/*========================================================*/ -/* Private types. */ -/*========================================================*/ - -/*========================================================*/ -/* Private globals. */ -/*========================================================*/ - -/*========================================================*/ -/* Private function prototypes. */ -/*========================================================*/ - -static glLabel *xml_doc_to_label (xmlDocPtr doc, - glXMLLabelStatus *status); - -static glLabel *xml_parse_label (xmlNodePtr root, - glXMLLabelStatus *status); - -static void xml_parse_objects (xmlNodePtr node, - glLabel *label); - -static void xml_parse_object_text (xmlNodePtr node, - glLabel *label); - -static void xml_parse_object_box (xmlNodePtr node, - glLabel *label); - -static void xml_parse_object_ellipse (xmlNodePtr node, - glLabel *label); - -static void xml_parse_object_line (xmlNodePtr node, - glLabel *label); - -static void xml_parse_object_image (xmlNodePtr node, - glLabel *label); - -static void xml_parse_object_barcode (xmlNodePtr node, - glLabel *label); - -static void xml_parse_merge_fields (xmlNodePtr node, - glLabel *label); - -static void xml_parse_data (xmlNodePtr node, - glLabel *label); - -static void xml_parse_pixdata (xmlNodePtr node, - glLabel *label); - -static void xml_parse_toplevel_span (xmlNodePtr node, - glLabelObject *object); - -static void xml_parse_affine_attrs (xmlNodePtr node, - glLabelObject *object); - -static void xml_parse_shadow_attrs (xmlNodePtr node, - glLabelObject *object); - -static xmlDocPtr xml_label_to_doc (glLabel *label, - glXMLLabelStatus *status); - -static void xml_create_objects (xmlNodePtr root, - xmlNsPtr ns, - glLabel *label); - -static void xml_create_object_text (xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object); - -static void xml_create_object_box (xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object); - -static void xml_create_object_line (xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object); - -static void xml_create_object_ellipse(xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object); - -static void xml_create_object_image (xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object); - -static void xml_create_object_barcode(xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object); - -static void xml_create_merge_fields (xmlNodePtr root, - xmlNsPtr ns, - glLabel *label); - -static void xml_create_data (xmlNodePtr root, - xmlNsPtr ns, - glLabel *label); - -static void xml_create_pixdata (xmlNodePtr root, - xmlNsPtr ns, - glLabel *label, - gchar *name); - -static void xml_create_toplevel_span (xmlNodePtr node, - xmlNsPtr ns, - glLabelText *object_text); - -static void xml_create_affine_attrs (xmlNodePtr node, - glLabelObject *object); - -static void xml_create_shadow_attrs (xmlNodePtr node, - glLabelObject *object); - - -/****************************************************************************/ -/* Open and read label from xml file. */ -/****************************************************************************/ -glLabel * -gl_xml_label_open (const gchar *utf8_filename, - glXMLLabelStatus *status) -{ - xmlDocPtr doc; - glLabel *label; - gchar *filename; - - gl_debug (DEBUG_XML, "START"); - - filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); - g_return_val_if_fail (filename, NULL); - - doc = xmlParseFile (filename); - if (!doc) { - g_message (_("xmlParseFile error")); - *status = XML_LABEL_ERROR_OPEN_PARSE; - return NULL; - } - - xmlXIncludeProcess (doc); - xmlReconciliateNs (doc, xmlDocGetRootElement (doc)); - - label = xml_doc_to_label (doc, status); - - xmlFreeDoc (doc); - - if (label) { - gl_label_set_filename (label, utf8_filename); - gl_label_clear_modified (label); - } - - g_free (filename); - gl_debug (DEBUG_XML, "END"); - - return label; -} - -/****************************************************************************/ -/* Read label from xml buffer. */ -/****************************************************************************/ -glLabel * -gl_xml_label_open_buffer (const gchar *buffer, - glXMLLabelStatus *status) -{ - xmlDocPtr doc; - glLabel *label; - - gl_debug (DEBUG_XML, "START"); - - doc = xmlParseDoc ((xmlChar *) buffer); - if (!doc) { - g_message (_("xmlParseFile error")); - *status = XML_LABEL_ERROR_OPEN_PARSE; - return NULL; - } - - label = xml_doc_to_label (doc, status); - - xmlFreeDoc (doc); - - if (label) { - gl_label_clear_modified (label); - } - - gl_debug (DEBUG_XML, "END"); - - return label; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse xml doc structure and create label. */ -/*--------------------------------------------------------------------------*/ -static glLabel * -xml_doc_to_label (xmlDocPtr doc, - glXMLLabelStatus *status) -{ - xmlNodePtr root; - glLabel *label; - - gl_debug (DEBUG_XML, "START"); - - LIBXML_TEST_VERSION; - - *status = XML_LABEL_OK; - - root = xmlDocGetRootElement (doc); - if (!root || !root->name) { - g_message (_("No document root")); - *status = XML_LABEL_ERROR_OPEN_PARSE; - return NULL; - } - - /* Try compatability mode 0.1 */ - if (xmlSearchNsByHref (doc, root, (xmlChar *)COMPAT01_NAME_SPACE)) - { - g_message (_("Importing from glabels 0.1 format")); - g_message ("TODO"); - label = NULL; /* TODO */ - return label; - } - - /* Try compatability mode 0.4 */ - if (xmlSearchNsByHref (doc, root, (xmlChar *)COMPAT04_NAME_SPACE)) - { - g_message (_("Importing from glabels 0.4 format")); - label = gl_xml_label_04_parse (root, status); - return label; - } - - /* Test for current namespaces. */ - if ( !xmlSearchNsByHref (doc, root, (xmlChar *)COMPAT20_NAME_SPACE) && - !xmlSearchNsByHref (doc, root, (xmlChar *)LGL_XML_NAME_SPACE) ) - { - g_message (_("Unknown glabels Namespace -- Using %s"), - LGL_XML_NAME_SPACE); - } - - label = xml_parse_label (root, status); - if (label) - { - gl_label_set_compression (label, xmlGetDocCompressMode (doc)); - } - - gl_debug (DEBUG_XML, "END"); - - return label; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse xml root node and create label. */ -/*--------------------------------------------------------------------------*/ -static glLabel * -xml_parse_label (xmlNodePtr root, - glXMLLabelStatus *status) -{ - xmlNodePtr child_node; - glLabel *label; - lglTemplate *template; - - gl_debug (DEBUG_XML, "START"); - - *status = XML_LABEL_OK; - - if (!lgl_xml_is_node (root, "Glabels-document")) { - g_message (_("Bad root node = \"%s\""), root->name); - *status = XML_LABEL_ERROR_OPEN_PARSE; - return NULL; - } - - label = GL_LABEL(gl_label_new ()); - - /* Pass 1, extract data nodes to pre-load cache. */ - for (child_node = root->xmlChildrenNode; child_node != NULL; child_node = child_node->next) { - if (lgl_xml_is_node (child_node, "Data")) { - xml_parse_data (child_node, label); - } - } - - /* Pass 2, now extract everything else. */ - for (child_node = root->xmlChildrenNode; - child_node != NULL; - child_node = child_node->next) { - - if (lgl_xml_is_node (child_node, "Template")) { - template = lgl_xml_template_parse_template_node (child_node); - if (!template) { - g_object_unref (label); - *status = XML_LABEL_UNKNOWN_MEDIA; - return NULL; - } - lgl_db_register_template (template); - gl_label_set_template (label, template); - lgl_template_free (template); - } else if (lgl_xml_is_node (child_node, "Objects")) { - xml_parse_objects (child_node, label); - } else if (lgl_xml_is_node (child_node, "Merge")) { - xml_parse_merge_fields (child_node, label); - } else if (lgl_xml_is_node (child_node, "Data")) { - /* Handled in pass 1. */ - } else { - if (!xmlNodeIsText (child_node)) { - g_message (_("bad node in Document node = \"%s\""), - child_node->name); - g_object_unref (label); - *status = XML_LABEL_ERROR_OPEN_PARSE; - return NULL; - } - } - } - - gl_debug (DEBUG_XML, "END"); - - return label; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse Objects node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_objects (xmlNodePtr node, - glLabel *label) -{ - gboolean rotate_flag; - xmlNodePtr child; - - gl_debug (DEBUG_XML, "START"); - - rotate_flag = lgl_xml_get_prop_boolean (node, "rotate", FALSE); - gl_label_set_rotate_flag (label, rotate_flag); - - for (child = node->xmlChildrenNode; child != NULL; child = child->next) { - - if (lgl_xml_is_node (child, "Object-text")) { - xml_parse_object_text (child, label); - } else if (lgl_xml_is_node (child, "Object-box")) { - xml_parse_object_box (child, label); - } else if (lgl_xml_is_node (child, "Object-ellipse")) { - xml_parse_object_ellipse (child, label); - } else if (lgl_xml_is_node (child, "Object-line")) { - xml_parse_object_line (child, label); - } else if (lgl_xml_is_node (child, "Object-image")) { - xml_parse_object_image (child, label); - } else if (lgl_xml_is_node (child, "Object-barcode")) { - xml_parse_object_barcode (child, label); - } else { - if (!xmlNodeIsText (child)) { - g_message (_("bad node = \"%s\""), child->name); - break; - } - } - } - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Objects->Object-text Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_object_text (xmlNodePtr node, - glLabel *label) -{ - GObject *object; - gdouble x, y; - gdouble w, h; - gchar *string; - PangoAlignment align; - gboolean auto_shrink; - xmlNodePtr child; - - gl_debug (DEBUG_XML, "START"); - - object = gl_label_text_new (label); - - /* position attrs */ - x = lgl_xml_get_prop_length (node, "x", 0.0); - y = lgl_xml_get_prop_length (node, "y", 0.0); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - - /* implied size attrs */ - w = lgl_xml_get_prop_length (node, "w", 0); - h = lgl_xml_get_prop_length (node, "h", 0); - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); - - /* justify attr */ - string = lgl_xml_get_prop_string (node, "justify", NULL); - align = gl_util_string_to_align (string); - g_free (string); - gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object), align); - - /* auto_shrink attr */ - auto_shrink = lgl_xml_get_prop_boolean (node, "auto_shrink", FALSE); - gl_label_text_set_auto_shrink (GL_LABEL_TEXT(object), auto_shrink); - - /* affine attrs */ - xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); - - /* shadow attrs */ - xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); - - /* Process children */ - for (child = node->xmlChildrenNode; child != NULL; child = child->next) { - if (lgl_xml_is_node (child, "Span")) { - xml_parse_toplevel_span (child, GL_LABEL_OBJECT(object)); - break; - } else { - if (!xmlNodeIsText (child)) { - g_message ("Unexpected Object-text child: \"%s\"", - child->name); - } - } - } - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Objects->Object-box Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_object_box (xmlNodePtr node, - glLabel *label) -{ - GObject *object; - gdouble x, y; - gdouble w, h; - gdouble line_width; - glColorNode *line_color_node; - gchar *string; - glColorNode *fill_color_node; - - gl_debug (DEBUG_XML, "START"); - - object = gl_label_box_new (label); - - /* position attrs */ - x = lgl_xml_get_prop_length (node, "x", 0.0); - y = lgl_xml_get_prop_length (node, "y", 0.0); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - - /* size attrs */ - w = lgl_xml_get_prop_length (node, "w", 0); - h = lgl_xml_get_prop_length (node, "h", 0); - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); - - /* line attrs */ - line_width = lgl_xml_get_prop_length (node, "line_width", 1.0); - gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); - - line_color_node = gl_color_node_new_default (); - string = lgl_xml_get_prop_string (node, "line_color_field", NULL); - if ( string ) { - line_color_node->field_flag = TRUE; - line_color_node->key = string; - } else { - line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); - } - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); - gl_color_node_free (&line_color_node); - - - /* fill attrs */ - fill_color_node = gl_color_node_new_default (); - string = lgl_xml_get_prop_string (node, "fill_color_field", NULL); - if ( string ) { - fill_color_node->field_flag = TRUE; - fill_color_node->key = string; - } else { - fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0); - } - gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color_node); - gl_color_node_free (&fill_color_node); - - /* affine attrs */ - xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); - - /* shadow attrs */ - xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Objects->Object-ellipse Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_object_ellipse (xmlNodePtr node, - glLabel *label) -{ - GObject *object; - gdouble x, y; - gdouble w, h; - gdouble line_width; - glColorNode *line_color_node; - gchar *string; - glColorNode *fill_color_node; - - gl_debug (DEBUG_XML, "START"); - - object = gl_label_ellipse_new (label); - - /* position attrs */ - x = lgl_xml_get_prop_length (node, "x", 0.0); - y = lgl_xml_get_prop_length (node, "y", 0.0); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - - /* size attrs */ - w = lgl_xml_get_prop_length (node, "w", 0); - h = lgl_xml_get_prop_length (node, "h", 0); - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); - - /* line attrs */ - line_width = lgl_xml_get_prop_length (node, "line_width", 1.0); - gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); - - line_color_node = gl_color_node_new_default (); - string = lgl_xml_get_prop_string (node, "line_color_field", NULL); - if ( string ) { - line_color_node->field_flag = TRUE; - line_color_node->key = string; - } else { - line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); - } - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); - gl_color_node_free (&line_color_node); - - - /* fill attrs */ - fill_color_node = gl_color_node_new_default (); - string = lgl_xml_get_prop_string (node, "fill_color_field", NULL); - if ( string ) { - fill_color_node->field_flag = TRUE; - fill_color_node->key = string; - } else { - fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0); - } - gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color_node); - gl_color_node_free (&fill_color_node); - - /* affine attrs */ - xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); - - /* shadow attrs */ - xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Objects->Object-line Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_object_line (xmlNodePtr node, - glLabel *label) -{ - GObject *object; - gdouble x, y; - gdouble dx, dy; - gdouble line_width; - glColorNode *line_color_node; - gchar *string; - - gl_debug (DEBUG_XML, "START"); - - object = gl_label_line_new (label); - - /* position attrs */ - x = lgl_xml_get_prop_length (node, "x", 0.0); - y = lgl_xml_get_prop_length (node, "y", 0.0); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - - /* length attrs */ - dx = lgl_xml_get_prop_length (node, "dx", 0); - dy = lgl_xml_get_prop_length (node, "dy", 0); - gl_label_object_set_size (GL_LABEL_OBJECT(object), dx, dy); - - /* line attrs */ - line_width = lgl_xml_get_prop_length (node, "line_width", 1.0); - gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); - - line_color_node = gl_color_node_new_default (); - string = lgl_xml_get_prop_string (node, "line_color_field", NULL); - if ( string ) { - line_color_node->field_flag = TRUE; - line_color_node->key = string; - } else { - line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); - } - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); - gl_color_node_free (&line_color_node); - - /* affine attrs */ - xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); - - /* shadow attrs */ - xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Objects->Object-image Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_object_image (xmlNodePtr node, - glLabel *label) -{ - GObject *object; - gdouble x, y; - gdouble w, h; - gchar *string; - glTextNode *filename; - - gl_debug (DEBUG_XML, "START"); - - object = gl_label_image_new (label); - - /* position attrs */ - x = lgl_xml_get_prop_length (node, "x", 0.0); - y = lgl_xml_get_prop_length (node, "y", 0.0); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - - /* src or field attr */ - string = lgl_xml_get_prop_string (node, "src", NULL); - if ( string ) { - filename = g_new0 (glTextNode, 1); - filename->field_flag = FALSE; - filename->data = g_strdup ((gchar *)string); - gl_label_image_set_filename (GL_LABEL_IMAGE(object), filename); - gl_text_node_free (&filename); - xmlFree (string); - } else { - string = lgl_xml_get_prop_string (node, "field", NULL); - if ( string ) { - filename = g_new0 (glTextNode, 1); - filename->field_flag = TRUE; - filename->data = g_strdup ((gchar *)string); - gl_label_image_set_filename (GL_LABEL_IMAGE(object), filename); - gl_text_node_free (&filename); - xmlFree (string); - } else { - g_message ("Missing Object-image src or field attr"); - } - } - - /* size attrs */ - w = lgl_xml_get_prop_length (node, "w", 0); - h = lgl_xml_get_prop_length (node, "h", 0); - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); - - /* affine attrs */ - xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); - - /* shadow attrs */ - xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML Objects->Object-barcode Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_object_barcode (xmlNodePtr node, - glLabel *label) -{ - GObject *object; - gdouble x, y; - gdouble w, h; - gchar *string; - glTextNode *text_node; - gchar *id; - gboolean text_flag; - gboolean checksum_flag; - glColorNode *color_node; - guint format_digits; - - gl_debug (DEBUG_XML, "START"); - - object = gl_label_barcode_new (label); - - /* position attrs */ - x = lgl_xml_get_prop_length (node, "x", 0.0); - y = lgl_xml_get_prop_length (node, "y", 0.0); - gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); - - /* size attrs */ - w = lgl_xml_get_prop_length (node, "w", 0); - h = lgl_xml_get_prop_length (node, "h", 0); - gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); - - /* prop attrs */ - id = lgl_xml_get_prop_string (node, "style", NULL); - text_flag = lgl_xml_get_prop_boolean (node, "text", FALSE); - checksum_flag = lgl_xml_get_prop_boolean (node, "checksum", TRUE); - format_digits = lgl_xml_get_prop_uint (node, "format", 10); - gl_label_barcode_set_props (GL_LABEL_BARCODE(object), - (gchar *)id, text_flag, checksum_flag, format_digits); - g_free (id); - - color_node = gl_color_node_new_default (); - string = lgl_xml_get_prop_string (node, "color_field", NULL); - if ( string ) { - color_node->field_flag = TRUE; - color_node->key = string; - } else { - color_node->color = lgl_xml_get_prop_uint (node, "color", 0); - } - gl_label_object_set_line_color (GL_LABEL_OBJECT(object), color_node); - gl_color_node_free (&color_node); - - /* data or field attr */ - string = lgl_xml_get_prop_string (node, "data", NULL); - if ( string ) { - text_node = g_new0 (glTextNode, 1); - text_node->field_flag = FALSE; - text_node->data = string; - gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node); - gl_text_node_free (&text_node); - } else { - string = lgl_xml_get_prop_string (node, "field", NULL); - if ( string ) { - text_node = g_new0 (glTextNode, 1); - text_node->field_flag = TRUE; - text_node->data = string; - gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node); - gl_text_node_free (&text_node); - } else { - g_message ("Missing Object-barcode data or field attr"); - } - } - - /* affine attrs */ - xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); - - /* shadow attrs */ - xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML merge fields tag. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_merge_fields (xmlNodePtr node, - glLabel *label) -{ - gchar *string; - glMerge *merge; - - gl_debug (DEBUG_XML, "START"); - - string = lgl_xml_get_prop_string (node, "type", NULL); - merge = gl_merge_new (string); - g_free (string); - - string = lgl_xml_get_prop_string (node, "src", NULL); - gl_merge_set_src (merge, string); - g_free (string); - - gl_label_set_merge (label, merge); - - g_object_unref (G_OBJECT(merge)); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML data tag. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_data (xmlNodePtr node, - glLabel *label) -{ - xmlNodePtr child; - - gl_debug (DEBUG_XML, "START"); - - for (child = node->xmlChildrenNode; child != NULL; child = child->next) { - - if (lgl_xml_is_node (child, "Pixdata")) { - xml_parse_pixdata (child, label); - } else { - if (!xmlNodeIsText (child)) { - g_message (_("bad node in Data node = \"%s\""), - child->name); - } - } - } - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse XML pixbuf data tag. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_pixdata (xmlNodePtr node, - glLabel *label) -{ - gchar *name, *base64; - guchar *stream; - guint stream_length; - gboolean ret; - GdkPixdata *pixdata; - GdkPixbuf *pixbuf; - GHashTable *pixbuf_cache; - - gl_debug (DEBUG_XML, "START"); - - name = lgl_xml_get_prop_string (node, "name", NULL); - base64 = lgl_xml_get_node_content (node); - - stream = gl_base64_decode ((gchar *)base64, &stream_length); - pixdata = g_new0 (GdkPixdata, 1); - ret = gdk_pixdata_deserialize (pixdata, stream_length, stream, NULL); - - if (ret) { - pixbuf = gdk_pixbuf_from_pixdata (pixdata, TRUE, NULL); - - pixbuf_cache = gl_label_get_pixbuf_cache (label); - gl_pixbuf_cache_add_pixbuf (pixbuf_cache, (gchar *)name, pixbuf); - } - - g_free (name); - g_free (base64); - - g_free (stream); - g_free (pixdata); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse top-level Span tag. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_toplevel_span (xmlNodePtr node, - glLabelObject *object) -{ - gchar *font_family; - gdouble font_size; - PangoWeight font_weight; - gboolean font_italic_flag; - glColorNode *color_node; - gdouble text_line_spacing; - gchar *string; - GList *lines, *text_nodes; - xmlNodePtr child; - glTextNode *text_node; - - gl_debug (DEBUG_XML, "START"); - - /* Font family attr */ - font_family = lgl_xml_get_prop_string (node, "font_family", "Sans"); - gl_label_object_set_font_family (object, font_family); - g_free (font_family); - - /* Font size attr */ - font_size = lgl_xml_get_prop_double (node, "font_size", 0.0); - gl_label_object_set_font_size (object, font_size); - - /* Font weight attr */ - string = lgl_xml_get_prop_string (node, "font_weight", NULL); - font_weight = gl_util_string_to_weight (string); - g_free (string); - gl_label_object_set_font_weight (object, font_weight); - - /* Font italic flag attr */ - font_italic_flag = lgl_xml_get_prop_boolean (node, "font_italic", FALSE); - gl_label_object_set_font_italic_flag (object, font_italic_flag); - - /* Text color attr */ - color_node = gl_color_node_new_default (); - string = lgl_xml_get_prop_string (node, "color_field", NULL); - if ( string ) { - color_node->field_flag = TRUE; - color_node->key = string; - } else { - color_node->color = lgl_xml_get_prop_uint (node, "color", 0); - } - gl_label_object_set_text_color (object, color_node); - gl_color_node_free (&color_node); - - - /* Text line spacing attr */ - text_line_spacing = lgl_xml_get_prop_double (node, "line_spacing", 1.0); - gl_label_object_set_text_line_spacing (object, text_line_spacing); - - /* Now descend children, and build lines of text nodes */ - lines = NULL; - text_nodes = NULL; - for (child = node->xmlChildrenNode; child != NULL; child = child->next) { - - if (xmlNodeIsText (child)) { - gchar *data = lgl_xml_get_node_content (child); - - /* Hack: if the first char is LF, it's an xml formatting string */ - if (data[0] != '\n') { - /* Literal text */ - text_node = g_new0 (glTextNode, 1); - text_node->field_flag = FALSE; - text_node->data = g_strdup ((gchar *)data); - text_nodes = g_list_append (text_nodes, text_node); - } - g_free (data); - - } else if (lgl_xml_is_node (child, "Span")) { - - g_message ("Unexpected rich text (not supported, yet!)"); - - } else if (lgl_xml_is_node (child, "Field")) { - - /* Field node */ - string = lgl_xml_get_prop_string (child, "name", NULL); - text_node = g_new0 (glTextNode, 1); - text_node->field_flag = TRUE; - text_node->data = string; - text_nodes = g_list_append (text_nodes, text_node); - - } else if (lgl_xml_is_node (child, "NL")) { - - /* Store line. */ - lines = g_list_append (lines, text_nodes); - text_nodes = NULL; - - } else { - g_message ("Unexpected Span child: \"%s\"", child->name); - } - - } - if ( text_nodes ) { - /* Store last line. */ - lines = g_list_append (lines, text_nodes); - text_nodes = NULL; - } - gl_label_text_set_lines (GL_LABEL_TEXT(object), lines); - gl_text_node_lines_free (&lines); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse affine attributes. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_affine_attrs (xmlNodePtr node, - glLabelObject *object) -{ - gdouble a[6]; - cairo_matrix_t matrix; - - a[0] = lgl_xml_get_prop_double (node, "a0", 0.0); - a[1] = lgl_xml_get_prop_double (node, "a1", 0.0); - a[2] = lgl_xml_get_prop_double (node, "a2", 0.0); - a[3] = lgl_xml_get_prop_double (node, "a3", 0.0); - a[4] = lgl_xml_get_prop_double (node, "a4", 0.0); - a[5] = lgl_xml_get_prop_double (node, "a5", 0.0); - - cairo_matrix_init (&matrix, a[0], a[1], a[2], a[3], a[4], a[5]); - - gl_label_object_set_matrix (object, &matrix); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Parse shadow attributes. */ -/*--------------------------------------------------------------------------*/ -static void -xml_parse_shadow_attrs (xmlNodePtr node, - glLabelObject *object) -{ - gboolean shadow_state; - gdouble shadow_x; - gdouble shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - gchar *string; - - shadow_state = lgl_xml_get_prop_boolean (node, "shadow", FALSE); - gl_label_object_set_shadow_state (object, shadow_state); - - if (shadow_state) - { - shadow_x = lgl_xml_get_prop_length (node, "shadow_x", 0.0); - shadow_y = lgl_xml_get_prop_length (node, "shadow_y", 0.0); - gl_label_object_set_shadow_offset (object, shadow_x, shadow_y); - - shadow_color_node = gl_color_node_new_default (); - string = lgl_xml_get_prop_string (node, "shadow_color_field", NULL); - if ( string ) { - shadow_color_node->field_flag = TRUE; - shadow_color_node->key = string; - } else { - shadow_color_node->color = lgl_xml_get_prop_uint (node, "shadow_color", 0); - } - gl_label_object_set_shadow_color (object, shadow_color_node); - gl_color_node_free (&shadow_color_node); - - shadow_opacity = lgl_xml_get_prop_double (node, "shadow_opacity", 1.0); - gl_label_object_set_shadow_opacity (object, shadow_opacity); - } -} - -/****************************************************************************/ -/* Save label to xml label file. */ -/****************************************************************************/ -void -gl_xml_label_save (glLabel *label, - const gchar *utf8_filename, - glXMLLabelStatus *status) -{ - xmlDocPtr doc; - gint xml_ret; - gchar *filename; - - gl_debug (DEBUG_XML, "START"); - - doc = xml_label_to_doc (label, status); - - filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); - if (!filename) - g_message (_("Utf8 conversion error.")); - else { - xmlSetDocCompressMode (doc, gl_label_get_compression (label)); - xml_ret = xmlSaveFormatFile (filename, doc, TRUE); - xmlFreeDoc (doc); - if (xml_ret == -1) { - - g_message (_("Problem saving xml file.")); - *status = XML_LABEL_ERROR_SAVE_FILE; - - } else { - - gl_label_set_filename (label, utf8_filename); - gl_label_clear_modified (label); - - } - g_free (filename); - } - - gl_debug (DEBUG_XML, "END"); -} - -/****************************************************************************/ -/* Save label to xml buffer. */ -/****************************************************************************/ -gchar * -gl_xml_label_save_buffer (glLabel *label, - glXMLLabelStatus *status) -{ - xmlDocPtr doc; - gint size; - guchar *buffer; - - gl_debug (DEBUG_XML, "START"); - - doc = xml_label_to_doc (label, status); - - xmlDocDumpMemory (doc, &buffer, &size); - xmlFreeDoc (doc); - - gl_label_clear_modified (label); - - gl_debug (DEBUG_XML, "END"); - - return (gchar *)buffer; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Convert label to xml doc structure. */ -/*--------------------------------------------------------------------------*/ -static xmlDocPtr -xml_label_to_doc (glLabel *label, - glXMLLabelStatus *status) -{ - xmlDocPtr doc; - xmlNsPtr ns; - glMerge *merge; - - gl_debug (DEBUG_XML, "START"); - - LIBXML_TEST_VERSION; - - doc = xmlNewDoc ((xmlChar *)"1.0"); - doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *)"Glabels-document", NULL); - - ns = xmlNewNs (doc->xmlRootNode, (xmlChar *)LGL_XML_NAME_SPACE, NULL); - xmlSetNs (doc->xmlRootNode, ns); - - lgl_xml_template_create_template_node (label->template, doc->xmlRootNode, ns); - - xml_create_objects (doc->xmlRootNode, ns, label); - - merge = gl_label_get_merge (label); - gl_debug (DEBUG_XML, "merge=%p", merge); - if (merge != NULL) { - xml_create_merge_fields (doc->xmlRootNode, ns, label); - g_object_unref (G_OBJECT(merge)); - } - - xml_create_data (doc->xmlRootNode, ns, label); - - gl_debug (DEBUG_XML, "END"); - - *status = XML_LABEL_OK; - return doc; -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Objects Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_objects (xmlNodePtr root, - xmlNsPtr ns, - glLabel *label) -{ - xmlNodePtr node; - GList *p; - glLabelObject *object; - - gl_debug (DEBUG_XML, "START"); - - node = xmlNewChild (root, ns, (xmlChar *)"Objects", NULL); - lgl_xml_set_prop_string (node, "id", "0"); - lgl_xml_set_prop_boolean (node, "rotate", label->rotate_flag); - - for (p = label->objects; p != NULL; p = p->next) { - - object = GL_LABEL_OBJECT(p->data); - - if ( GL_IS_LABEL_TEXT(object) ) { - xml_create_object_text (node, ns, object); - } else if ( GL_IS_LABEL_BOX(object) ) { - xml_create_object_box (node, ns, object); - } else if ( GL_IS_LABEL_ELLIPSE(object) ) { - xml_create_object_ellipse (node, ns, object); - } else if ( GL_IS_LABEL_LINE(object) ) { - xml_create_object_line (node, ns, object); - } else if ( GL_IS_LABEL_IMAGE(object) ) { - xml_create_object_image (node, ns, object); - } else if ( GL_IS_LABEL_BARCODE(object) ) { - xml_create_object_barcode (node, ns, object); - } else { - g_message ("Unknown label object"); - } - - } - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Objects->Object-text Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_object_text (xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object) -{ - xmlNodePtr node; - gdouble x, y; - gdouble w, h; - PangoAlignment align; - gboolean auto_shrink; - - gl_debug (DEBUG_XML, "START"); - - node = xmlNewChild (root, ns, (xmlChar *)"Object-text", NULL); - - /* position attrs */ - gl_label_object_get_position (object, &x, &y); - lgl_xml_set_prop_length (node, "x", x); - lgl_xml_set_prop_length (node, "y", y); - - /* size attrs */ - gl_label_object_get_raw_size ( object, &w, &h); - lgl_xml_set_prop_length (node, "w", w); - lgl_xml_set_prop_length (node, "h", h); - - /* justify attr */ - align = gl_label_object_get_text_alignment (object); - lgl_xml_set_prop_string (node, "justify", gl_util_align_to_string (align)); - - /* auto_shrink attr */ - auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); - lgl_xml_set_prop_boolean (node, "auto_shrink", auto_shrink); - - /* affine attrs */ - xml_create_affine_attrs (node, object); - - /* shadow attrs */ - xml_create_shadow_attrs (node, object); - - /* Add children */ - xml_create_toplevel_span (node, ns, GL_LABEL_TEXT(object)); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Objects->Object-box Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_object_box (xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object) -{ - xmlNodePtr node; - gdouble x, y; - gdouble w, h; - gdouble line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; - - gl_debug (DEBUG_XML, "START"); - - node = xmlNewChild (root, ns, (xmlChar *)"Object-box", NULL); - - /* position attrs */ - gl_label_object_get_position (object, &x, &y); - lgl_xml_set_prop_length (node, "x", x); - lgl_xml_set_prop_length (node, "y", y); - - /* size attrs */ - gl_label_object_get_size (object, &w, &h); - lgl_xml_set_prop_length (node, "w", w); - lgl_xml_set_prop_length (node, "h", h); - - /* line attrs */ - line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); - lgl_xml_set_prop_length (node, "line_width", line_width); - - line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); - if (line_color_node->field_flag) - { - lgl_xml_set_prop_string (node, "line_color_field", line_color_node->key); - } - else - { - lgl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color); - } - gl_color_node_free (&line_color_node); - - /* fill attrs (color or field) */ - fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object)); - if (fill_color_node->field_flag) - { - lgl_xml_set_prop_string (node, "fill_color_field", fill_color_node->key); - } - else - { - lgl_xml_set_prop_uint_hex (node, "fill_color", fill_color_node->color); - } - gl_color_node_free (&fill_color_node); - - /* affine attrs */ - xml_create_affine_attrs (node, object); - - /* shadow attrs */ - xml_create_shadow_attrs (node, object); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Objects->Object-ellipse Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_object_ellipse (xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object) -{ - xmlNodePtr node; - gdouble x, y; - gdouble w, h; - gdouble line_width; - glColorNode *line_color_node; - glColorNode *fill_color_node; - - gl_debug (DEBUG_XML, "START"); - - node = xmlNewChild (root, ns, (xmlChar *)"Object-ellipse", NULL); - - /* position attrs */ - gl_label_object_get_position (object, &x, &y); - lgl_xml_set_prop_length (node, "x", x); - lgl_xml_set_prop_length (node, "y", y); - - /* size attrs */ - gl_label_object_get_size (object, &w, &h); - lgl_xml_set_prop_length (node, "w", w); - lgl_xml_set_prop_length (node, "h", h); - - /* line attrs */ - line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); - lgl_xml_set_prop_length (node, "line_width", line_width); - - line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); - if (line_color_node->field_flag) - { - lgl_xml_set_prop_string (node, "line_color_field", line_color_node->key); - } - else - { - lgl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color); - } - gl_color_node_free (&line_color_node); - - - /* fill attrs (color or field) */ - fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object)); - if (fill_color_node->field_flag) - { - lgl_xml_set_prop_string (node, "fill_color_field", fill_color_node->key); - } - else - { - lgl_xml_set_prop_uint_hex (node, "fill_color", fill_color_node->color); - } - gl_color_node_free (&fill_color_node); - - /* affine attrs */ - xml_create_affine_attrs (node, object); - - /* shadow attrs */ - xml_create_shadow_attrs (node, object); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Objects->Object-line Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_object_line (xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object) -{ - xmlNodePtr node; - gdouble x, y; - gdouble dx, dy; - gdouble line_width; - glColorNode *line_color_node; - - gl_debug (DEBUG_XML, "START"); - - node = xmlNewChild (root, ns, (xmlChar *)"Object-line", NULL); - - /* position attrs */ - gl_label_object_get_position (object, &x, &y); - lgl_xml_set_prop_length (node, "x", x); - lgl_xml_set_prop_length (node, "y", y); - - /* length attrs */ - gl_label_object_get_size (object, &dx, &dy); - lgl_xml_set_prop_length (node, "dx", dx); - lgl_xml_set_prop_length (node, "dy", dy); - - /* line attrs */ - line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); - lgl_xml_set_prop_length (node, "line_width", line_width); - - line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); - if (line_color_node->field_flag) - { - lgl_xml_set_prop_string (node, "line_color_field", line_color_node->key); - } - else - { - lgl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color); - } - gl_color_node_free (&line_color_node); - - - /* affine attrs */ - xml_create_affine_attrs (node, object); - - /* shadow attrs */ - xml_create_shadow_attrs (node, object); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Objects->Object-image Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_object_image (xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object) -{ - xmlNodePtr node; - gdouble x, y; - gdouble w, h; - glTextNode *filename; - - gl_debug (DEBUG_XML, "START"); - - node = xmlNewChild (root, ns, (xmlChar *)"Object-image", NULL); - - /* position attrs */ - gl_label_object_get_position (object, &x, &y); - lgl_xml_set_prop_length (node, "x", x); - lgl_xml_set_prop_length (node, "y", y); - - /* size attrs */ - gl_label_object_get_size (object, &w, &h); - lgl_xml_set_prop_length (node, "w", w); - lgl_xml_set_prop_length (node, "h", h); - - /* src OR field attr */ - filename = gl_label_image_get_filename (GL_LABEL_IMAGE(object)); - if (filename->field_flag) { - lgl_xml_set_prop_string (node, "field", filename->data); - } else { - lgl_xml_set_prop_string (node, "src", filename->data); - } - gl_text_node_free (&filename); - - /* affine attrs */ - xml_create_affine_attrs (node, object); - - /* shadow attrs */ - xml_create_shadow_attrs (node, object); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Objects->Object-barcode Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_object_barcode (xmlNodePtr root, - xmlNsPtr ns, - glLabelObject *object) -{ - xmlNodePtr node; - gdouble x, y; - gdouble w, h; - glTextNode *text_node; - gchar *id; - gboolean text_flag; - gboolean checksum_flag; - glColorNode *color_node; - guint format_digits; - - gl_debug (DEBUG_XML, "START"); - - node = xmlNewChild (root, ns, (xmlChar *)"Object-barcode", NULL); - - /* position attrs */ - gl_label_object_get_position (object, &x, &y); - lgl_xml_set_prop_length (node, "x", x); - lgl_xml_set_prop_length (node, "y", y); - - /* size attrs */ - gl_label_object_get_raw_size (object, &w, &h); - lgl_xml_set_prop_length (node, "w", w); - lgl_xml_set_prop_length (node, "h", h); - - /* Barcode properties attrs */ - gl_label_barcode_get_props (GL_LABEL_BARCODE(object), - &id, &text_flag, &checksum_flag, &format_digits); - lgl_xml_set_prop_string (node, "style", id); - lgl_xml_set_prop_boolean (node, "text", text_flag); - lgl_xml_set_prop_boolean (node, "checksum", checksum_flag); - - g_free (id); - - color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); - if (color_node->field_flag) - { - lgl_xml_set_prop_string (node, "color_field", color_node->key); - } - else - { - lgl_xml_set_prop_uint_hex (node, "color", color_node->color); - } - gl_color_node_free (&color_node); - - - /* data OR field attr */ - text_node = gl_label_barcode_get_data (GL_LABEL_BARCODE(object)); - if (text_node->field_flag) { - lgl_xml_set_prop_string (node, "field", text_node->data); - lgl_xml_set_prop_int (node, "format", format_digits); - } else { - lgl_xml_set_prop_string (node, "data", text_node->data); - } - gl_text_node_free (&text_node); - - /* affine attrs */ - xml_create_affine_attrs (node, object); - - /* shadow attrs */ - xml_create_shadow_attrs (node, object); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Label Merge Fields Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_merge_fields (xmlNodePtr root, - xmlNsPtr ns, - glLabel *label) -{ - xmlNodePtr node; - gchar *string; - glMerge *merge; - - gl_debug (DEBUG_XML, "START"); - - merge = gl_label_get_merge (label); - - node = xmlNewChild (root, ns, (xmlChar *)"Merge", NULL); - - string = gl_merge_get_name (merge); - lgl_xml_set_prop_string (node, "type", string); - g_free (string); - - string = gl_merge_get_src (merge); - lgl_xml_set_prop_string (node, "src", string); - g_free (string); - - g_object_unref (G_OBJECT(merge)); - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Label Data Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_data (xmlNodePtr root, - xmlNsPtr ns, - glLabel *label) -{ - xmlNodePtr node; - GList *name_list, *p; - GHashTable *pixbuf_cache; - - gl_debug (DEBUG_XML, "START"); - - node = xmlNewChild (root, ns, (xmlChar *)"Data", NULL); - - pixbuf_cache = gl_label_get_pixbuf_cache (label); - name_list = gl_pixbuf_cache_get_name_list (pixbuf_cache); - - for (p = name_list; p != NULL; p=p->next) { - xml_create_pixdata (node, ns, label, p->data); - } - - gl_pixbuf_cache_free_name_list (name_list); - - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Add XML Label Data Pixbuf Node */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_pixdata (xmlNodePtr root, - xmlNsPtr ns, - glLabel *label, - gchar *name) -{ - xmlNodePtr node; - GHashTable *pixbuf_cache; - GdkPixbuf *pixbuf; - GdkPixdata *pixdata; - guchar *stream; - guint stream_length; - gchar *base64; - - gl_debug (DEBUG_XML, "START"); - - pixbuf_cache = gl_label_get_pixbuf_cache (label); - - pixbuf = gl_pixbuf_cache_get_pixbuf (pixbuf_cache, name); - if ( pixbuf != NULL ) { - - pixdata = g_new0 (GdkPixdata, 1); - gdk_pixdata_from_pixbuf (pixdata, pixbuf, FALSE); - stream = gdk_pixdata_serialize (pixdata, &stream_length); - base64 = gl_base64_encode (stream, stream_length); - - node = xmlNewChild (root, ns, (xmlChar *)"Pixdata", (xmlChar *)base64); - lgl_xml_set_prop_string (node, "name", name); - lgl_xml_set_prop_string (node, "encoding", "Base64"); - - gl_pixbuf_cache_remove_pixbuf (pixbuf_cache, name); - - g_free (pixdata); - g_free (stream); - g_free (base64); - } - - - gl_debug (DEBUG_XML, "END"); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Create top-level Span node. */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_toplevel_span (xmlNodePtr root, - xmlNsPtr ns, - glLabelText *object_text) -{ - xmlNodePtr node; - gchar *font_family; - gdouble font_size; - PangoWeight font_weight; - gboolean font_italic_flag; - glColorNode *color_node; - PangoAlignment align; - gdouble text_line_spacing; - GList *lines, *p_line, *p_node; - glTextNode *text_node; - xmlNodePtr child; - - node = xmlNewChild (root, ns, (xmlChar *)"Span", NULL); - - /* All span attrs at top level. */ - font_family = gl_label_object_get_font_family (GL_LABEL_OBJECT(object_text)); - font_size = gl_label_object_get_font_size (GL_LABEL_OBJECT(object_text)); - text_line_spacing = gl_label_object_get_text_line_spacing (GL_LABEL_OBJECT(object_text)); - font_weight = gl_label_object_get_font_weight (GL_LABEL_OBJECT(object_text)); - font_italic_flag = gl_label_object_get_font_italic_flag (GL_LABEL_OBJECT(object_text)); - - color_node = gl_label_object_get_text_color (GL_LABEL_OBJECT(object_text)); - if (color_node->field_flag) - { - lgl_xml_set_prop_string (node, "color_field", color_node->key); - } - else - { - lgl_xml_set_prop_uint_hex (node, "color", color_node->color); - } - gl_color_node_free (&color_node); - - align = gl_label_object_get_text_alignment (GL_LABEL_OBJECT(object_text)); - lgl_xml_set_prop_string (node, "font_family", font_family); - lgl_xml_set_prop_double (node, "font_size", font_size); - lgl_xml_set_prop_string (node, "font_weight", gl_util_weight_to_string (font_weight)); - lgl_xml_set_prop_boolean (node, "font_italic", font_italic_flag); - - lgl_xml_set_prop_double (node, "line_spacing", text_line_spacing); - - /* Build children. */ - lines = gl_label_text_get_lines (GL_LABEL_TEXT(object_text)); - for (p_line = lines; p_line != NULL; p_line = p_line->next) { - - for (p_node = (GList *) p_line->data; p_node != NULL; - p_node = p_node->next) { - text_node = (glTextNode *) p_node->data; - - if (text_node->field_flag) { - child = xmlNewChild (node, ns, (xmlChar *)"Field", NULL); - lgl_xml_set_prop_string (child, "name", text_node->data); - } else { - xmlNodeAddContent (node, (xmlChar *)text_node->data); - } - - } - - if ( p_line->next ) { - child = xmlNewChild (node, ns, (xmlChar *)"NL", NULL); - } - - } - - gl_text_node_lines_free (&lines); - g_free (font_family); - -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Create affine attributes. */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_affine_attrs (xmlNodePtr node, - glLabelObject *object) -{ - cairo_matrix_t matrix; - - gl_label_object_get_matrix (object, &matrix); - - lgl_xml_set_prop_double (node, "a0", matrix.xx); - lgl_xml_set_prop_double (node, "a1", matrix.yx); - lgl_xml_set_prop_double (node, "a2", matrix.xy); - lgl_xml_set_prop_double (node, "a3", matrix.yy); - lgl_xml_set_prop_double (node, "a4", matrix.x0); - lgl_xml_set_prop_double (node, "a5", matrix.y0); -} - -/*--------------------------------------------------------------------------*/ -/* PRIVATE. Create shadow attributes. */ -/*--------------------------------------------------------------------------*/ -static void -xml_create_shadow_attrs (xmlNodePtr node, - glLabelObject *object) -{ - gboolean shadow_state; - gdouble shadow_x; - gdouble shadow_y; - glColorNode *shadow_color_node; - gdouble shadow_opacity; - - shadow_state = gl_label_object_get_shadow_state (object); - - if (shadow_state) - { - lgl_xml_set_prop_boolean (node, "shadow", shadow_state); - - gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); - lgl_xml_set_prop_length (node, "shadow_x", shadow_x); - lgl_xml_set_prop_length (node, "shadow_y", shadow_y); - - shadow_color_node = gl_label_object_get_shadow_color (object); - if (shadow_color_node->field_flag) - { - lgl_xml_set_prop_string (node, "shadow_color_field", shadow_color_node->key); - } - else - { - lgl_xml_set_prop_uint_hex (node, "shadow_color", shadow_color_node->color); - } - gl_color_node_free (&shadow_color_node); - - shadow_opacity = gl_label_object_get_shadow_opacity (object); - lgl_xml_set_prop_double (node, "shadow_opacity", shadow_opacity); - } -} - - diff --git a/glabels2/src/xml-label.h b/glabels2/src/xml-label.h deleted file mode 100644 index 5c5f0c37..00000000 --- a/glabels2/src/xml-label.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - -/* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * xml-label.h: GLabels xml label module header file - * - * Copyright (C) 2001-2002 Jim Evins . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __XML_LABEL_H__ -#define __XML_LABEL_H__ - -#include "label.h" - -G_BEGIN_DECLS - - -typedef enum { - XML_LABEL_UNKNOWN_MEDIA = 1, - XML_LABEL_OK = 0, - XML_LABEL_ERROR_OPEN_PARSE = -10, - XML_LABEL_ERROR_SAVE_FILE = -20, -} glXMLLabelStatus; - - -extern glLabel *gl_xml_label_open (const gchar * filename, - glXMLLabelStatus *status); -extern glLabel *gl_xml_label_open_buffer (const gchar * buffer, - glXMLLabelStatus *status); - -extern void gl_xml_label_save (glLabel * label, - const gchar * filename, - glXMLLabelStatus *status); -extern gchar *gl_xml_label_save_buffer (glLabel * label, - glXMLLabelStatus *status); - - -G_END_DECLS - - -#endif /* __XML_LABEL_H__ */ diff --git a/gtk-doc.make b/gtk-doc.make new file mode 100644 index 00000000..354ffb7c --- /dev/null +++ b/gtk-doc.make @@ -0,0 +1,173 @@ +# -*- mode: makefile -*- + +#################################### +# Everything below here is generic # +#################################### + +if GTK_DOC_USE_LIBTOOL +GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +else +GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +endif + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) + +EXTRA_DIST = \ + $(content_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ + $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) + +if ENABLE_GTK_DOC +all-local: html-build.stamp +else +all-local: +endif + +docs: html-build.stamp + +#### scan #### + +scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) + @echo 'gtk-doc: Scanning header files' + @-chmod -R u+w $(srcdir) + cd $(srcdir) && \ + gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) + if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ + else \ + cd $(srcdir) ; \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### templates #### + +tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt + @echo 'gtk-doc: Rebuilding template files' + @-chmod -R u+w $(srcdir) + cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) + touch tmpl-build.stamp + +tmpl.stamp: tmpl-build.stamp + @true + +tmpl/*.sgml: + @true + + +#### xml #### + +sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) + @echo 'gtk-doc: Building XML' + @-chmod -R u+w $(srcdir) + cd $(srcdir) && \ + gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) + touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo 'gtk-doc: Building HTML' + @-chmod -R u+w $(srcdir) + rm -rf $(srcdir)/html + mkdir $(srcdir)/html + cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) + @echo 'gtk-doc: Fixing cross-references' + cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + touch html-build.stamp + +############## + +clean-local: + rm -f *~ *.bak + rm -rf .libs + +distclean-local: + cd $(srcdir) && \ + rm -rf xml $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +maintainer-clean-local: clean + cd $(srcdir) && rm -rf xml html + +install-data-local: + -installfiles=`echo $(srcdir)/html/*`; \ + if test "$$installfiles" = '$(srcdir)/html/*'; \ + then echo '-- Nothing to install' ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + echo '-- Installing $(srcdir)/html/index.sgml' ; \ + $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ + which gtkdoc-rebase >/dev/null && \ + gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \ + fi + + +uninstall-local: + rm -f $(DESTDIR)$(TARGET_DIR)/* + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/tmpl + mkdir $(distdir)/xml + mkdir $(distdir)/html + -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl + -cp $(srcdir)/xml/*.xml $(distdir)/xml + cp $(srcdir)/html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs diff --git a/help/C/Makefile.am b/help/C/Makefile.am new file mode 100644 index 00000000..340802cd --- /dev/null +++ b/help/C/Makefile.am @@ -0,0 +1,9 @@ +figdir = figures +docname = glabels +lang = C +omffile = glabels-C.omf +entities = legal.xml + +include $(top_srcdir)/xmldocs.make +dist-hook: app-dist-hook + diff --git a/help/C/figures/glabels-template-cd.png b/help/C/figures/glabels-template-cd.png new file mode 100644 index 00000000..0a3de3bf Binary files /dev/null and b/help/C/figures/glabels-template-cd.png differ diff --git a/help/C/figures/glabels-template-label.png b/help/C/figures/glabels-template-label.png new file mode 100644 index 00000000..87a724b9 Binary files /dev/null and b/help/C/figures/glabels-template-label.png differ diff --git a/help/C/figures/glabels-template-layout.png b/help/C/figures/glabels-template-layout.png new file mode 100644 index 00000000..c7127952 Binary files /dev/null and b/help/C/figures/glabels-template-layout.png differ diff --git a/help/C/figures/main-window-empty.png b/help/C/figures/main-window-empty.png new file mode 100644 index 00000000..305bd609 Binary files /dev/null and b/help/C/figures/main-window-empty.png differ diff --git a/help/C/figures/merge-ex1-1.png b/help/C/figures/merge-ex1-1.png new file mode 100644 index 00000000..f8673c1d Binary files /dev/null and b/help/C/figures/merge-ex1-1.png differ diff --git a/help/C/figures/merge-ex1-2.png b/help/C/figures/merge-ex1-2.png new file mode 100644 index 00000000..a87675aa Binary files /dev/null and b/help/C/figures/merge-ex1-2.png differ diff --git a/help/C/figures/merge-ex1-3.png b/help/C/figures/merge-ex1-3.png new file mode 100644 index 00000000..f31ecafe Binary files /dev/null and b/help/C/figures/merge-ex1-3.png differ diff --git a/help/C/figures/merge-ex1-4.png b/help/C/figures/merge-ex1-4.png new file mode 100644 index 00000000..71e11864 Binary files /dev/null and b/help/C/figures/merge-ex1-4.png differ diff --git a/help/C/figures/merge-ex2-1.png b/help/C/figures/merge-ex2-1.png new file mode 100644 index 00000000..1c64ed76 Binary files /dev/null and b/help/C/figures/merge-ex2-1.png differ diff --git a/help/C/figures/merge-ex2-2.png b/help/C/figures/merge-ex2-2.png new file mode 100644 index 00000000..e1d8f2af Binary files /dev/null and b/help/C/figures/merge-ex2-2.png differ diff --git a/help/C/figures/merge-ex2-3.png b/help/C/figures/merge-ex2-3.png new file mode 100644 index 00000000..baac803a Binary files /dev/null and b/help/C/figures/merge-ex2-3.png differ diff --git a/help/C/figures/merge-ex2-4.png b/help/C/figures/merge-ex2-4.png new file mode 100644 index 00000000..62d750c6 Binary files /dev/null and b/help/C/figures/merge-ex2-4.png differ diff --git a/help/C/figures/object-editor-sidebar.png b/help/C/figures/object-editor-sidebar.png new file mode 100644 index 00000000..f0624a26 Binary files /dev/null and b/help/C/figures/object-editor-sidebar.png differ diff --git a/help/C/figures/print-copies.png b/help/C/figures/print-copies.png new file mode 100644 index 00000000..d34d03c9 Binary files /dev/null and b/help/C/figures/print-copies.png differ diff --git a/help/C/figures/print-merge.png b/help/C/figures/print-merge.png new file mode 100644 index 00000000..de654d09 Binary files /dev/null and b/help/C/figures/print-merge.png differ diff --git a/help/C/glabels-C.omf b/help/C/glabels-C.omf new file mode 100644 index 00000000..ad12113a --- /dev/null +++ b/help/C/glabels-C.omf @@ -0,0 +1,22 @@ + + + + + Jim Evins (evins@snaught.com) + + + gLabels + + 2004-08-09 + + + User manual for the gLabels label and business card creation program + + + user's guide + + + + + + diff --git a/help/C/glabels.xml b/help/C/glabels.xml new file mode 100644 index 00000000..3c36199b --- /dev/null +++ b/help/C/glabels.xml @@ -0,0 +1,2136 @@ + + + + + + gLabels"> + +]> + + + + + +
    + + + + &app; Manual V&manrevision; + + + 2003-2007 + Jim Evins + + + + + + + Jim Evins + + + &legal; + + + + + Jim + Evins + + + + + + + + + + + + + + + + + + + + + gLabels Manual V&manrevision; + &date; + + Jim Evins + evins@snaught.com + + Jim Evins + + + + + This manual describes version &appversion; of gLabels. + + + Feedback + To report a bug or make a suggestion regarding the &app; application or + this manual, follow the directions in the gLabels Contact Page. + + + + + + + gLabels + + + glabels + + + + + + + + + + Introduction + + The &app; application is a lightweight program for creating labels + and business cards for the GNOME desktop + environment. It is designed to work with various laser/ink-jet + peel-off label and business card sheets that you'll find at most + office supply stores. + + + + + + + + + + + Getting Started + + + To Start &app; + You can start &app; in the following ways: + + + + Applications menu + + Choose + + Office + gLabels + . + + + + Command line + + Type glabels, + then press Return: + + + + + + + When You Start &app; + When you start &app;, the following window is displayed. + + +
    + &app; Start Up Window + + + + + + +
    + + + + + + The &app; window contains the following elements: + + + + Menubar. + + The menus on the menubar contain all of the commands you + need to create and edit labels and business cards in + &app;. + + + + Main toolbar. + + The main toolbar contains a subset of common File and Edit + commands that you can access from the menubar. + + + + Drawing toolbar. + + The drawing toolbar contains a subset of commands for + editing the current glabels document. + + + + Display area. + + The display area is the main drawing interface to + &app;. + + + + Object sidebar. + + The object sidebar provides an interface for viewing and + editing all properties of an individual object. + + + + Properties toolbar. + + The properties toolbar contains a set of tools to + manipulate the properties of selected objects and set default + properties for new objects. + + + + Statusbar. + + The statusbar displays information about current + &app; activity and contextual + information about the menu items. + + + +
    +
    + + + + + + + + Usage + + + + To Create a New Label or Card + + To create a new label or business card, choose + File New + + to display the New Label or Card dialog. Select + the media type and orientation for the new document, + then click OK. A new document is + displayed in the display area of the &app; + window. + + If your particular media type is missing from this dialog, + see + + + + + + To Open a File + + To open a file, choose + File Open + to display the Open File dialog. + Select the file that you want to open, then click + OK. The file is displayed in the display area + of the &app; window. + + You can also open multiple files in + &app;. The application creates a separate + application window for each open file. + + The application records the paths and filenames of the + most recent files that you have edited and displays the files as menu + items on the + FileRecent Files + menu. + + + + + + To Open Multiple Files from a Command Line + + You can run &app; from a command line + and open a single file or multiple files. To open multiple files from + a command line, type the following command, then press + Return: + + glabels + file1.glabels file2.glabels file3.glabels + + + When the application starts, the files that you specify are + displayed in separate &app; windows. + + + + + + To Save a File + + You can save files in the following ways: + + + + + To save changes to an existing file, choose + File + Save . + + + + + To save a new file or to save an existing file under a new + filename, choose File + Save As . Enter a name + for the file in the Save As dialog box, + then click OK. + + + + + + + + + To Change Label Properties + + To change the media type and/or orientation of a label, choose + File + Properties to display the + Label properties dialog. Select the + new media type and orientation for the document, then click + OK. + + + + + + To Create a Custom Template + + To create a new custom template, choose + File + Template Designer ... + to display the Template Designer dialog. + This dialog will assist you in creating a custom template for + most types of label or card stationery that you may encounter. + + If you prefer, you can create your templates manually. + For this option see + + + + + + + To Close a File + + To close the current document, choose + File + Close to close the application + window. If the current document is modified, a confirmation dialog + will be presented, allowing you to save the document or cancel + the command. If the window being closed is the only open window, + &app; will exit. + + + + + + To Quit <application>&app;</application> + + To quit &app;, choose + File + Quit . This is equivalent + to closing all open windows. See + . + + + + + + To Print Labels or Cards + + To print labels or cards, choose + File Print + to display the Print dialog. + Once print options have been selected, click Print + to print the labels or cards. To simply preview the results, + click Print Preview instead. + + The Print dialog allows you to specify the + following print options: + + + The Labels Tab of the Print Dialog + + + + + Print control (Simple) + + + For simple labels or cards (no document merge), the job + tabbed section contains the following copy controls. + + + + + + The number of copies of the label can be selected by + choosing the number of full sheets to print, or a specific + subset of labels on a single sheet. + + The mini-preview can also be used to graphically select + the subset of labels by clicking the first label on the + mini-preview and dragging to the last label. + + + + + + Print control (Merge) + + + For labels or cards using the document merge (also known + as "mail merge") capability, the job tabbed section contains + the following merge controls instead of copy controls. + + + + + + The total number of labels or cards printed is the + product of the number of records in the merge source and + the number of copies selected. If multiple copies are + selected, these can be either collated (copies of the + same record grouped together) or un-collated (one copy + each record is printed before next copy). + + Printing can begin on any label on the first sheet. + This can be selected with the Start on + label spinbutton. + + The mini-preview can also be used to graphically select + this first label, by clicking on the desired label in the + mini-preview. + + + + + Options + + The following options can also be selected. + + + print outlines + Print outlines of labels. This option is useful for + dry-runs, to test printer alignment. + + + print in reverse + Prints the labels as mirror images. This option is + useful for printing on clear labels that will be viewed + from the reverse side (e.g. in a car window). + + + print crop marks + Prints crop marks along the edge of the sheet. + This option is useful for printing on blank stock, to + be cut after printing. This option does not work well + with all templates. + + + + + + + + + + + + To Create New Objects + + Objects are created by choosing the appropriate selection under + the Objects + Create Object submenu or + the Drawing Toolbar. This will place the + display area into object creation mode as indicated by its cursor. + To return to the default object selection mode without creating + an object, choose Objects + Select Mode . This will + return the display area's cursor to the default selection arrow. + + The following describes the object creation mode for each object + type: + + + + + Text + + Click the desired location of the upper left corner of the + text object. New text objects are initialized with the + string "Text." To change this text, or other properties, see + . + + + + + Box + + Click the desired location of the upper left corner of the + box object and drag to the desired location of the lower right + corner. If you simply click in a single location, a square + box will be created. To change properties of the box object, see + . + + + + + Line + + Click the desired location of one end of the + line object and drag to the desired location of the other end. + If you simply click in a single location, a diagonal line + will be created. To change properties of the line object, see + . + + + + + Ellipse + + Click the desired location of the upper left corner of the + ellipse object and drag to the desired location of the lower + right corner. If you simply click in a single location, a circle + will be created. To change properties of the ellipse object, see + . + + + + + Image + + Click the desired location of the upper left corner of the + image object and drag to the desired location of the lower + right corner. If you simply click in a single location, a square + will be created. New image objects are initialized with a + simple checkerboard image. To change this image, or other + properties of the image object, see + . + + + + + Barcode + + Click the desired location of the upper left corner of the + barcode object. New barcode objects are initialized to a + POSTNET barcode with representative data. To change data + and properties of the barcode object, see + . + + + + + + + + + + + To Select Objects + + A prerequisite for performing operations on objects is the + selection of individual objects or groups of objects. The + display area must be in the object selection mode to create new + selections, as indicated by an arrow cursor. The object + selection mode is selected by the + Objects + Select Mode menu item, + or the corresponding command on the Drawing + Toolbar. + + + + + Selecting a single object + + A single object can be selected simply by clicking + on the desired object in the display area. + Once selected the object will be highlighted with a set of + resizing handles. + + + + + Aggregate object selections + + Multiple objects can be selected by first selecting the first + object as above and then by holding the Ctrl + key while selecting additional objects. + Individual objects can be added to an existing selection + at any time by holding the Ctrl key while + selecting the desired objects. All objects can also be + selected by using the Edit + Select All + menu item. All objects in an aggregate object selection will be + highlighted. + + + + + Area selections + + Multiple objects can also be selected by clicking an empty + area and dragging to form a rectangular area. When released, + all objects contained in the area will form an aggregate + selection. An area selection can be used to add to an existing + selection by holding the Ctrl key while + performing the selection. + + + + + Unselecting objects + + Individual objects can be removed from an existing + selection by holding the Ctrl key while + clicking on a previously selected object. An entire selection + can be dismissed by using the + Edit Un-select All + menu item + or by simply clicking any empty space in the display area. + Once an object is unselected its highlight is removed. + + + + + + + + + + Clipboard Commands + + Object selections can be manipulated using the standard clipboard + operations Cut, + Copy, Paste, + and Delete. + + + + + + + + CtrlX + + Cut + + + + Moves selected objects to the clipboard. The objects are + then available for pasting back into the current document or + another document. + + + + + + + + CtrlC + + Copy + + + + Copies selected objects to the clipboard without deleting + them. The objects are then available for pasting back into + the current document or another document. + + + + + + + + CtrlV + + Paste + + + + Pastes objects from the clipboard into the current document. + &app; can only paste objects from + another &app; document. + + + + + + + + Delete + + Delete + + + + Deletes selected objects without placing them on the + clipboard. + + + + + + + + + + To Edit Object Properties + + Most object properties can be modified through the object + editor sidebar, illustrated below. To use the object editor, + a single object must first be selected. See + . + + +
    + Object Editor Sidebar + + + + + + +
    + + + The object editor will contain a subset of the following + tabbed sections, depending on object type: + + + Text Tabbed Section (Text objects) + + This section contains a small editor for changing the content + of a text object. It also contains a dropdown menu of available + document merge keys, that can be inserted into text. + + + + + Image Tabbed Section (Image objecs) + + This section contains a file entry with preview to select + image files. The browse button can be used to easily locate + image files. Alternatively, a document merge key can be used + instead to provide a filename at print time. + + + + + Data Tabbed Section (Barcode objecs) + + This section contains a text entry to enter literal barcode + data. Alternatively, a document merge key can be used to + provide this data at print time. + + + + + Style Tabbed Section (Text objects) + + This section contains controls to select text properties, + including font family, font size, font weight, color, and + text justification. + + + + + Style Tabbed Section (Barcode objecs) + + This section contains controls to select barcode properties, + including barcode style, color, whether to print text, and whether + to include a checksum digit. + + + + + Line Tabbed Section + + This section contains controls to select properties of lines + and outlines. These properties include line width and color. + + + + + Fill Tabbed Section + + This section contains controls to select fill properties of box + and ellipse objects. Currently the only fill property is fill + color. + + + + + Size Tabbed Section (All except line objects) + + This section contains controls to select the width and height + of an object. A checkbox is provided, so that the current aspect + ratio can be locked while manipulating the width and height controls. + Image objects also provide a button to reset the size to the + image's natural size (Assumes 72DPI). + + + + + Size Tabbed Section (Line objects) + + This section contains controls to select the length and angle + of a line object. + + + + + Position Tabbed Section + + This section contains controls to change the position of an + object. + + + + + + Shadow Tabbed Section (All except image and barcode objects) + + This section contains controls to add a shadow to an object. + + + + +
    + + + + Other Manipulations of Objects + + Objects can also be manipulated in the following ways. + + + Moving and Resizing Objects + + Objects can be moved by simply clicking on a selected + object and dragging the object to its new location. If the object + is part of an aggregate selection, all objects in the selection + will move with the object being dragged, maintaining their relative + positions to one another. If no object is selected, clicking on + an object will create a new selection containing that object. + See . + + A selected object can be resized by clicking one of its resize + handle and dragging it to obtain the new size. + + + + + Changing Stacking Order + + Stacking order refers to relative position in the z-axis of + objects. That is when objects overlap, which object will appear + on top of the other. By default, newer objects will appear above + older objects. To change this order, select one or more objects + and choose Objects + Order + Bring to Front + to raise the selection to the top of the stacking + order, or choose Objects + Order + Send to Back + to lower the selection to the bottom of the + stacking order. These menuitems are also available by right-clicking + the display area when there is a non-empty selection. + + + + + Rotating and Flipping Objects + + Objects can be rotated 90 degrees in either direction, or flipped + horizontally or vertically, by choosing the appropriate menuitem + in the Objects + Rotate/Flip sub-menu. These + menuitems are also available by right-clicking + the display area when there is a non-empty selection. + + + + + Aligning Objects + + Objects can be aligned horizontally or vertically, relative to + one another, or relative to the center line of the label, by + choosing the appropriate menuitem from the + Objects + Align Horizontal + or Objects + Align Horizontal sub-menus. + These menuitems are also available by right-clicking + the display area when there is a non-empty selection. + + + + + Using the Property Bar + + The property bar can be used to change some common properties + of objects en-masse. These properties include font family, font + size, font weight, text alignment, text color, fill color, line + or outline color, and line width. The property bar also controls + the defaults for these properties for any newly created objects. + + + + + + + + + + + Performing a Document Merge + + Document Merge (sometimes called "Mail Merge") is a powerful + feature that allows a unique label or card to be printed for each + record in an external data source. + + The first step to performing a document merge is to prepare + a source document that contains your merge data. This data could + be mailing addresses or any other data that you wish to create + unique labels or cards for. Currently back-ends only exist for + text files and the evolution data server -- others are planned. The currently + supported text-file format is very simple: each line is a record; + fields are delimited by commas (CSV), tabs, or colons; and newlines + can be embedded into fields by using the "\n" entity. This file + could be created using any text editor or could be created by + another program or script. A common way of creating CSV files is + to export them from a spreadsheet program. + + A label must then be configured to "point at" this data file. + To configure the merge properties of a document, choose + Objects + Merge Properties menu item + to display the merge properties dialog. This + dialog is used to select the exact data file format and file + name (location) of the merge data. + + Finally, once the label has been configured for a data file, + field keys can be inserted into text objects and used as source + or data for barcode objects and image filenames for image objects. + See for more information + on using merge data for these object types. + + Now that your label is configured, gLabels will print a unique + label for each record in your source document -- substituting fields + from each record for field keys in the all text, barcode, and + image objects. + + See for a detailed + tutorial on the document merge feature. + + + + + +
    + + + + + + + + Settings + To configure &app;, choose + + Settings + Preferences + . The + Preferences dialog contains the following tabbed + sections: + + + + + + + + + + + + + + Locale + + + + Units + + Use this radio button group to specify your prefered units. + Select one of the following options: + + + + Points + Use points (1 point = 1/72 in = 0.352778 mm). + + + + Inches + Use inches. + + + + Millimeters + Use millimeters. + + + Default: + Inches. + + + + + Default page size + + Use this radio button group to specify your prefered page size. + This will make it quicker for you to locate media types when creating a new + label or card. + + + + US Letter + Most of your media will be of the US Letter page size (8.5 x 11 inches). + + + + ISO A4 + Most of your media will be of the ISO A4 page size (210 x 297 mm). + + + Default: + US Letter. + + + + + + + + Object defaults + + + + Text + + Use these controls to set the default properties of new text objects. + These properties are + + + + Font + These controls are used to select font family and font size, and + whether the font should bold or in italics. + + + + Color + This control selects the default text color. + + + + Alignment + These controls are used to select the default text alignment (left, center or right). + + + + + + + Line + + Use these controls to set the default properties of lines and outlines of + new objects. These properties are + + + + Width + This control selects the default line width. + + + + Color + This control selects the default line color. + + + + + + + Fill + + Use these controls to set the default fill properties of + new objects. These properties are + + + + Color + This control selects the default fill color. + + + + + + + + + + + + + + Document Merge Tutorial + + Document Merge (sometimes called "Mail Merge") is a powerful + feature that allows a unique label or card to be printed for each + record in an external data source. It is however, the most mis-understood + feature of glabels. The following examples + will step through a couple of common tasks using the document merge + feature. + + + Example 1: Name Tags + + In this example we are organizing an orientation party for the new + crew members of our ship. We have a list of freshman crew members that we + created in gnumeric and exported as the following + CSV file. We could have created this file by using a text editor, but heck it + is the 23rd century. + + +Name,Department,SN +"Jim Kirk",Management,"SC937-0176 CEC" +"Mr. Spock",Sciences,S179-276SP +"Leonard McCoy",Medicine,unknown +"Montgomery Scott",Engineering,SE-197-54T + + + In glabels we have created a new glabels + document using the Avery 5395 "Name Badge Labels" template. Next we use the + Objects + Merge Properties menu item to display + the merge properties dialog. We use this dialog to + select the source type (in our case CSV) and the merge source (filename) as + shown. + + +
    + Merge properties dialog + + + + + + +
    + + + Before applying the merge source, we uncheck the first record since it is only + column headers from our original gnumeric spreadsheet + and would simply waste our first label. We could also unselect any other records + that we didn't want to print a label for. + + We can also view each record in more detail by clicking on the appropriate + expander (the little triangles) as shown. Once we are satisfied with the + selections in this dialog we click OK to accept the + changes. + + Now we start adding objects to our glabels document as shown. + + +
    + Adding objects + + + + + + +
    + + + In this example we have added three text objects and a barcode object. The + first text object contains only simple literal text ("Hello, my name is"). The + second text object contains a single merge field ("${1}") corresponding to the + first field of a record (first column of a line) which contains the new crew + member's full name. The third text field contains both literal text + ("Department: ") followed by a single merge field ("${2}") corresponding to + the second field or the crew member's department. The barcode object is + configured to use field (or key) "3" which contains our crew member's + starfleet serial number. + + Now we can print our name tags by selecting the + File + Print menu item. This will display + print dialog as shown below. + + +
    + Printing name tags + + + + + + +
    + + + Just to make sure our labels are going to look okay, we select the + Print outlines option and click + Print Preview. This will display a print preview dialog + as shown below. + + +
    + Name tags preview + + + + + + +
    + + + Everything looks good, so we can now load up our printer with + the appropriate label stock, print our name tags and start beaming our guests + aboard. + +
    + + + Example 2: Address Labels + + In this example we are going to throw a party and need to print mailing + address labels for our invitations. We have a list of our closest friends + that we created in gnumeric and exported as the + following CSV file. It should be noted that not everyone has a middle initial or + a two line address. + + +LAST,FIRST,MI,ADDR1,ADDR2,CITY,STATE,ZIP +,,,,,,, +Critter,Ess,S,"123 Faux St.",,Alexandria,VA,22310 +Doe,John,,"Apt 1X","451 Mystery St.",Trenton,NJ,08601 +Summers,Joyce,,"1630 Revello Dr",,Sunnydale,CA,95037 +McGarret,Steve,O,"404 Piikoi Street",,Honolulu,HI,96813 +Kramer,Cosmo,,"Apt 5B","129 W. 81 St.","New York",NY,10024-7207 + + + In glabels we have created a new glabels + document using the Avery 5512 "Address Labels" template. Next we use the + Objects + Merge Properties menu item to display + the merge properties dialog. We use this dialog to + select the source type (in our case CSV) and the merge source (filename) as + shown. + + +
    + Merge properties dialog + + + + + + +
    + + + Before applying the merge source, we uncheck the first record since it is only + column headers from our original gnumeric spreadsheet + and would simply waste our first label. We also unselect the second record + which is empty (an artifact of our original spreadsheet). We could also unselect + any other records that we didn't want to print a label for. + + We can also view each record in more detail by clicking on the appropriate + expander (the little triangles) as shown. Once we are satisfied with the + selections in this dialog we click OK to accept the + changes. + + Now we start adding objects to our glabels document as shown. + + +
    + Adding objects + + + + + + +
    + + + In this example we have a single text object. This text object contains + all of our merge fields organized on multiple lines as a mailing address. + Notice that fields ${4} and ${5} (corresponding to ADDR1 and ADDR2) are each + located with no other text on their own lines. When + glabels encounters a field as the only text on + a line, it will not expand the line if the field is empty. + + Now we can print our address labels by selecting the + File + Print menu item. This will display + print dialog as shown below. + + +
    + Printing address labels + + + + + + +
    + + + Just to make sure our labels are going to look okay, we select the + Print outlines option and click + Print Preview. This will display a print preview dialog + as shown below. + + +
    + Address labels preview + + + + + + +
    + + + Everything looks good, so we can now load up our printer with + the appropriate label stock, print our address labels and start mailing + our party invitations. + +
    + +
    + + + + + + + Manually Creating New Templates + + Predefined templates are defined by XML files located in + ${prefix}/share/glabels/, + where ${prefix} is usually something like + /usr/local or /usr depending + on the configuration option prefix. gLabels will + use all files of the form *-templates.xml + or *.template, that it finds in + ${prefix}/share/glabels/ and + ${HOME}/.glabels/. + Additional templates can be added by creating additional + *.template files in either of these directories. + + + The format for these files is defined in the DTD: + glabels-2.2.dtd. (This DTD also describes other + XML formats used by glabels.) + + + Assumptions/caveats + + + A sheet contains only one size of label or card (if a sheet + contains more than one size of item, it can be split into + multiple templates for multiple pass printing) + + + Distances can be expressed in units of pt, + in, mm, + cm, or pc. For example: + "1.0in" or "2.54cm". If no + units are specified, computer points (pt) will + be assumed (1 pt = + 1/72 in = 0.352778 mm). + + + + + + + Template Files + + +<?xml version="1.0"?> +<Glabels-templates> + + ...templates... + +</Glabels-templates> + + + + + + Example Template + + <Template brand="Avery" part="8160" size="US-Letter" description="Mailing Labels"> + <Label-rectangle id="0" width="189pt" height="72pt" round="5pt"> + <Markup-margin size="5pt"/> + <Layout nx="3" ny="10" x0="11.25pt" y0="36pt" dx="200pt" dy="72pt"/> + </Label-rectangle> + <Alias brand="Avery" part="5160"/> + <Alias brand="Avery" part="6233"/> + </Template> + + + + + Template Node + + A Template node describes a single stationary + product. It must contain one instance of any type of Label node + (Label-rectangle, + Label-round, or Label-cd). + This node can be followed by zero or more + Alias nodes. + + + + + + + + + Property + + + Description + + + + + + brand + + Brand or manufacturer of stationary product. + E.g. "Avery" + + + + part + + Part number or name of stationary product. + E.g. "8160" + + + + size + + Size of sheet. E.g., "US-Letter," "A4", ... + + + + description + + Description of stationary product. E.g, + "Mailing Labels." + + + + _description + + Translatable description of stationary product. + E.g, "Mailing Labels." (Only useful for predefined + templates) + + + + width + + Page width. Only valid if size="Other" + + + + height + + Page height. Only valid if size="Other" + + + + + + + + + + Label-rectangle Node + + A Label-rectangle node describes the + dimensions of a single label or business card that is rectangular + in shape (may have rounded edges). + + + + + + + + + Property + + + Description + + + + + + id + + Reserved for future use. Should always be 0. + + + + width + Width of label/card + + + height + Height of label/card + + + round + + Radius of corners. For items with square edges + (business cards), the radius should be 0. + + + + x_waste + + Amount of horizontal waste (over-print) to allow. This is useful + for minimizing alignment problems when using non-white + backgrounds (e.g. images). + + + + y_waste + + Amount of vertical waste (over-print) to allow. This is useful + for minimizing alignment problems when using non-white + backgrounds (e.g. images). + + + + + + + +
    + Label-rectangle Parameters + + + + + + +
    + + +
    + + + Label-round Node + + A Label-round node describes the dimensions + of a simple round label (not a CD). + + + + + + + + + Property + + + Description + + + + + + id + + Reserved for future use. Should always be 0. + + + + radius + Radius (1/2 diameter) of label + + + waste + + Amount of waste (over-print) to allow. This is useful + for minimizing alignment problems when using non-white + backgrounds (e.g. images). + + + + + + + + + + Label-cd Node + + A Label-cd node describes the dimensions + of a CD, DVD, or business card CD. + + + + + + + + + Property + + + Description + + + + + + id + + Reserved for future use. Should always be 0. + + + + radius + Outer radius of label + + + hole + Radius of concentric hole + + + width + + If present, the label is clipped to the given width. + (Useful for "business card CDs"). + + + + height + + If present, the label is clipped to the given height. + (Useful for "business card CDs"). + + + + waste + + Amount of waste (over-print) to allow. This is useful + for minimizing alignment problems when using non-white + backgrounds (e.g. images). + + + + + + + +
    + CD Label Parameters + + + + + + +
    + + +
    + + + Markup-margin Node + + A Markup-margin describes a margin along + all edges of a label. + + + + + + + + + Property + + + Description + + + + + + size + + Size of the margin. I.e. the distance of the margin + line from the edge of the card/label. + + + + + + + + + + Markup-line Node + + A Markup-line describes a markup line. + + + + + + + + + Property + + + Description + + + + + + x1 + + x coordinate of 1st endpoint of the line segment. + + + + y1 + + y coordinate of 1st endpoint of the line segment. + + + + x2 + + x coordinate of 2nd endpoint of the line segment. + + + + y2 + + y coordinate of 2nd endpoint of the line segment. + + + + + + + + + + Markup-circle Node + + A Markup-circle describes a markup circle. + + + + + + + + + + Property + + + Description + + + + + + x0 + + x coordinate of circle origin (center). + + + + y0 + + y coordinate of circle origin (center). + + + + radius + Radius of circle. + + + + + + + + + Markup-rect Node + + A Markup-rect describes a markup rectangle. + + + + + + + + + + Property + + + Description + + + + + + x1 + + x coordinate of upper left corner of rectangle. + + + + y1 + + y coordinate of upper left corner of rectangle. + + + + w + + Width of rectangle. + + + + h + + Height of rectangle. + + + + r + Radius of rounded corners of rectangle. + + + + + + + + + Layout Node + + A label node may contain multiple Layout + children. If labels are arranged in a simple grid pattern, only + one layout is needed. However, if labels are arranged in multiple + grids, such as a running bond pattern, multiple + layout tags can be used. Note: a single label + can always be treated as a grid of one. + + + + + + + + + Property + + + Description + + + + + + nx + + Number of labels/cards across in the grid + (horizontal) + + + + ny + + Number of labels/cards up and down in the grid + (vertical) + + + + x0 + + Distance from left edge of sheet to the left edge of + the left column of cards/labels in the layout. + + + + y0 + + Distance from the top edge of sheet to the top edge of + the top row of labels/cards in the layout. + + + + dx + Horizontal pitch of grid. + + + dy + Vertical pitch of grid. + + + + + + +
    + Layout Parameters + + + + + + +
    + + +
    + + + Alias Node + + An Alias node provides the name of a + product with the same size and layout characteristics as the + parent template. + + + + + + + + + Property + + + Description + + + + + + brand + + The brand or manufacturer of the equivalent product. + + + + part + + The part number or name of the equivalent product. + + + + + + + + +
    + + + + + + + + + + + + + + About &app; + &app; was written by Jim Evins + (evins@snaught.com). To find more information about + &app;, please visit the + gLabels Web + page. + + To report a bug or make a suggestion regarding this application or + this manual, follow the directions at the + gLabels Contact Page. + + + This program is distributed under the terms of the GNU + General Public license as published by the Free Software + Foundation; either version 2 of the License, or (at your option) + any later version. A copy of this license can be found at this + link, or in the file + COPYING included with the source code of this program. + + + + + + + +
    diff --git a/help/C/legal.xml b/help/C/legal.xml new file mode 100644 index 00000000..ac97e1de --- /dev/null +++ b/help/C/legal.xml @@ -0,0 +1,76 @@ + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation + License (GFDL), Version 1.1 or any later version published + by the Free Software Foundation with no Invariant Sections, + no Front-Cover Texts, and no Back-Cover Texts. You can find + a copy of the GFDL at this link or in the file COPYING-DOCS + distributed with this manual. + + This manual is part of a collection of GNOME manuals + distributed under the GFDL. If you want to distribute this + manual separately from the collection, you can do so by + adding a copy of the license to the manual, as described in + section 6 of the license. + + + + Many of the names used by companies to distinguish their + products and services are claimed as trademarks. Where those + names appear in any GNOME documentation, and the members of + the GNOME Documentation Project are made aware of those + trademarks, then the names are in capital letters or initial + capital letters. + + + + DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED + UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE + WITH THE FURTHER UNDERSTANDING THAT: + + + + DOCUMENT IS PROVIDED ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR + IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES + THAT THE DOCUMENT OR MODIFIED VERSION OF THE + DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR + A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE + RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE + OF THE DOCUMENT OR MODIFIED VERSION OF THE + DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR + MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT, + YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY + CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY + SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER + OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS + LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED + VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER + EXCEPT UNDER THIS DISCLAIMER; AND + + + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL + THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), + CONTRACT, OR OTHERWISE, SHALL THE AUTHOR, + INITIAL WRITER, ANY CONTRIBUTOR, OR ANY + DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION + OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH + PARTIES, BE LIABLE TO ANY PERSON FOR ANY + DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER + INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS + OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR + MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR + LOSSES ARISING OUT OF OR RELATING TO USE OF THE + DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT, + EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF + THE POSSIBILITY OF SUCH DAMAGES. + + + + + + diff --git a/help/Makefile.am b/help/Makefile.am new file mode 100644 index 00000000..a68e4e50 --- /dev/null +++ b/help/Makefile.am @@ -0,0 +1,3 @@ +## Process this file with automake to produce Makefile.in. + +SUBDIRS = C diff --git a/iec16022-0.2.1/BUGS b/iec16022-0.2.1/BUGS new file mode 100644 index 00000000..9de2b176 --- /dev/null +++ b/iec16022-0.2.1/BUGS @@ -0,0 +1,6 @@ +iec16022 -f i -c aaaaabbbbbccccc +Barcode too long for 32x8 +No barcode produced + +We should find a suit barcode and not error here. + diff --git a/iec16022-0.2.1/CHANGELOG b/iec16022-0.2.1/CHANGELOG new file mode 100644 index 00000000..7c02bce3 --- /dev/null +++ b/iec16022-0.2.1/CHANGELOG @@ -0,0 +1,26 @@ +0.2.1 + - Fix 'Barcode too long' bug. Thanks to Alessandro Zummo. + - Use Lindent to start cleaning up the code mess. + +2006-11-11 Stefan Schmidt + +0.2 + - Rewrite Makefile. + - Documentation update. + - Exclude double include of header files. + - Layout cahnges. Place return value in front of function name. + - 80 character per line. + - Print version number before usage. + - Tests + +2006-02-06 Stefan Schmidt + + +0.1 + - Initial release. + - INSTALL, README, TODO, CREDITS, Makefile, LICENSE and CHANGELOG files + added. + - Fix some include issues. + - Fix some signed/unsigned issues. + +2006-01-08 Stefan Schmidt diff --git a/iec16022-0.2.1/CREDITS b/iec16022-0.2.1/CREDITS new file mode 100644 index 00000000..37e2bcc8 --- /dev/null +++ b/iec16022-0.2.1/CREDITS @@ -0,0 +1,10 @@ +Adrian Kennard, Andrews & Arnold Ltd for the original source code. You can +find it at http://aa.gg/free/ + +Cliff Hones for the RS coding. + +Jan Luebbe for writing the manual page and maintaining +the debian package. + +Daniel Willman for maintaining the gentoo +ebuild. diff --git a/iec16022-0.2.1/INSTALL b/iec16022-0.2.1/INSTALL new file mode 100644 index 00000000..102a61e1 --- /dev/null +++ b/iec16022-0.2.1/INSTALL @@ -0,0 +1,8 @@ +To install this software you need the following libraries installed: +- libpopt +- zlib + +Installing iec16022 is really simple. Just do a 'make' and 'make install'. + +In standard configuration the binary will be installed in /usr/local/bin. You +can change the prefix and DESTDIR in the Makefile. diff --git a/iec16022-0.2.1/LICENSE b/iec16022-0.2.1/LICENSE new file mode 100644 index 00000000..3912109b --- /dev/null +++ b/iec16022-0.2.1/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + 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 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/iec16022-0.2.1/Makefile.am b/iec16022-0.2.1/Makefile.am new file mode 100644 index 00000000..566bdc09 --- /dev/null +++ b/iec16022-0.2.1/Makefile.am @@ -0,0 +1,35 @@ +INCLUDES = \ + -DLIB \ + $(GLABELS_CFLAGS) + + +IEC_FILES = \ + iec16022ecc200.c \ + reedsol.c + +noinst_LTLIBRARIES = libiec16022.la + +libiec16022_la_SOURCES = $(IEC_FILES) + +EXTRA_DIST = \ + BUGS \ + CHANGELOG \ + CREDITS \ + iec16022.1 \ + iec16022.c \ + iec16022ecc200.h \ + image.c \ + image.h \ + INSTALL \ + LICENSE \ + Makefile.dist \ + README \ + README.glabels \ + reedsol.h \ + TODO \ + test/testsuite-example.bin \ + test/testsuite-example.eps \ + test/testsuite-example.hex \ + test/testsuite-example.png \ + test/testsuite-example.text \ + test/testsuite.sh diff --git a/iec16022-0.2.1/Makefile.dist b/iec16022-0.2.1/Makefile.dist new file mode 100644 index 00000000..4929afdb --- /dev/null +++ b/iec16022-0.2.1/Makefile.dist @@ -0,0 +1,40 @@ +CC=/usr/bin/cc +INSTALL=/usr/bin/install +GZIP=/bin/gzip + +prefix=/usr/local +bindir=$(prefix)/bin +mandir=$(prefix)/share/man + +CFLAGS=-Wall + +.PHONY: test clean + +all: iec16022 manpage + +iec16022: iec16022ecc200.o image.o iec16022.c + $(CC) -c iec16022.c + $(CC) -o iec16022 $(CFLAGS) reedsol.o iec16022.o image.o iec16022ecc200.o -lz -lpopt + +manpage: iec16022.1 + $(GZIP) -f --best < iec16022.1 > iec16022.1.gz + +install: all + $(INSTALL) -d -m 755 $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 + $(INSTALL) -m 755 iec16022 $(DESTDIR)$(bindir) + $(INSTALL) -m 644 iec16022.1.gz $(DESTDIR)$(mandir)/man1 + +test: iec16022 + cd test; ./testsuite.sh + +iec16022ecc200.o: iec16022ecc200.c iec16022ecc200.h reedsol.o + $(CC) -c iec16022ecc200.c + +image.o: image.c image.h + $(CC) -c image.c + +reedsol.o: reedsol.c reedsol.h + $(CC) -DLIB -c reedsol.c + +clean: + rm -f iec16022 iec16022.1.gz *.o diff --git a/iec16022-0.2.1/README b/iec16022-0.2.1/README new file mode 100644 index 00000000..072c0aef --- /dev/null +++ b/iec16022-0.2.1/README @@ -0,0 +1,13 @@ +With iec16022 you can produce 2d barcodes. Also known as Data Matrix. These +barcodes are defined in ISO/IEC 16022. + +The code was originally written by Andrews & Arnold Ltd. You can download this +code from http://aa.gg/free/. +The current maintainer of the code is Stefan Schmidt. + +Website: http://www.datenfreihafen.org/projects/iec16022.html +Maillinglist: https://sirius.lasnet.de/mailman/listinfo/iec16022 +SVN repository: https://svn.datenfreihafen.org/iec16022/ + + +Stefan Schmidt diff --git a/iec16022-0.2.1/README.glabels b/iec16022-0.2.1/README.glabels new file mode 100644 index 00000000..ad1dced7 --- /dev/null +++ b/iec16022-0.2.1/README.glabels @@ -0,0 +1,6 @@ +The following changes have been made to the stock iec16022 0.2.1 distribution +to facilitate compilation with glabels: + + Makefile renamed to Makefile.dist + added Makefile.am, which is configured from ../configure.in + diff --git a/iec16022-0.2.1/TODO b/iec16022-0.2.1/TODO new file mode 100644 index 00000000..6c0a97bc --- /dev/null +++ b/iec16022-0.2.1/TODO @@ -0,0 +1,9 @@ +- Fix compiler warnings. +- Test on 64bit, powerpc, arm, etc. Anyone? +- Test stamp feature. Anyone? +- Use autotools + +Some things to think about: +--------------------------- +- Use libpng? +- Merge iec16022 in barcode? diff --git a/iec16022-0.2.1/iec16022.1 b/iec16022-0.2.1/iec16022.1 new file mode 100644 index 00000000..681c3a7f --- /dev/null +++ b/iec16022-0.2.1/iec16022.1 @@ -0,0 +1,52 @@ +.TH iec16022 1 2006-01-14 "iec16022 0.1" +.SH NAME +iec16022 \- program to generate 2d barcodes +.SH SYNOPSIS +.B iec16022 +.RI [ options ] +.SH DESCRIPTION +This manual page documents briefly the +.B iec16022 +command. +.PP +.B iec16022 +generates 2d barcodes conforming to the ISO/IEC 16022 standard (which is +also known as Data Matrix and Semacode). +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-s, \-\-size WxH +Sets the size of the generated barcode. +.TP +.B \-c, \-\-barcode text +Specifies the text to be encoded. +.TP +.B \-\-ecc 000|050|080|100|140|200 +Sets the type of ecc to be used. +.TP +.B \-i, \-\-infile filename +Read input data from file. +.TP +.B \-o, \-\-outfile filenmae +Save output to file (instead of standard output). +.TP +.B \-f, \-\-format Text|EPS|Bin|Hex|Stamp|PNG +Set the output type. +.TP +.B \-?, \-\-help +Show summary of options. +.TP +.B \-\-usage +Show short overview of options. +.SH EXAMPLE +To produce a datamatrix barcode for foobar in PNG format you need the following +arguments: +.TP +.B iec16022 -f PNG -c foobar -o foobar.png +.SH AUTHOR +iec16022 was written by Adrian Kennard, Andrews & Arnold Ltd. +.PP +This manual page was written by Jan Luebbe , +for the Debian project (but may be used by others). diff --git a/iec16022-0.2.1/iec16022.c b/iec16022-0.2.1/iec16022.c new file mode 100644 index 00000000..6fb7c30a --- /dev/null +++ b/iec16022-0.2.1/iec16022.c @@ -0,0 +1,462 @@ +/** + * + * IEC16022 bar code generation + * Adrian Kennard, Andrews & Arnold Ltd + * with help from Cliff Hones on the RS coding + * + * (c) 2004 Adrian Kennard, Andrews & Arnold Ltd + * (c) 2006 Stefan Schmidt + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#define IEC16022_VERSION "0.2" + +#include +#include +#include +#include +#include +#include +#include +#include "image.h" +#include "iec16022ecc200.h" + + // simple checked response malloc +void *safemalloc(int n) +{ + void *p = malloc(n); + if (!p) { + fprintf(stderr, "Malloc(%d) failed\n", n); + exit(1); + } + return p; +} + +// hex dump - bottom left pixel first +void dumphex(unsigned char *grid, int W, int H, unsigned char p) +{ + int c = 0, y; + for (y = 0; y < H; y++) { + int v = 0, x, b = 128; + for (x = 0; x < W; x++) { + if (grid[y * W + x]) + v |= b; + b >>= 1; + if (!b) { + printf("%02X", v ^ p); + v = 0; + b = 128; + c++; + } + } + if (b != 128) { + printf("%02X", v ^ p); + c++; + } + printf(" "); + c++; + if (c >= 80) { + printf("\n"); + c = 0; + } + } + if (c) + printf("\n"); +} + +int main(int argc, const char *argv[]) +{ + char c; + int W = 0, H = 0; + int ecc = 0; + int barcodelen = 0; + char *encoding = 0; + char *outfile = 0; + char *infile = 0; + char *barcode = 0; + char *format = "Text"; + char *size = 0; + char *eccstr = 0; + int len = 0, maxlen = 0, ecclen = 0; + unsigned char *grid = 0; + poptContext optCon; // context for parsing command-line options + const struct poptOption optionsTable[] = { + { + "size", 's', POPT_ARG_STRING, &size, 0, "Size", "WxH"}, + { + "barcode", 'c', POPT_ARG_STRING, &barcode, 0, "Barcode", + "text"}, + { + "ecc", 0, POPT_ARG_STRING, &eccstr, 0, "ECC", + "000/050/080/100/140/200"}, + { + "infile", 'i', POPT_ARG_STRING, &infile, 0, "Barcode file", + "filename"}, + { + "outfile", 'o', POPT_ARG_STRING, &outfile, 0, + "Output filename", + "filename"}, + { + "encoding", 'e', POPT_ARG_STRING, &encoding, 0, + "Encoding template", + "[CTXEAB]* for ecc200 or 11/27/41/37/128/256"}, + { + "format", 'f', POPT_ARGFLAG_SHOW_DEFAULT | POPT_ARG_STRING, + &format, 0, + "Output format", "Text/EPS/PNG/Bin/Hex/Stamp"}, + POPT_AUTOHELP { + NULL, 0, 0, NULL, 0} + }; + optCon = poptGetContext(NULL, argc, argv, optionsTable, 0); + poptSetOtherOptionHelp(optCon, "[barcode]"); + if ((c = poptGetNextOpt(optCon)) < -1) { + /* an error occurred during option processing */ + fprintf(stderr, "%s: %s\n", poptBadOption(optCon, + POPT_BADOPTION_NOALIAS), + poptStrerror(c)); + return 1; + } + + if (poptPeekArg(optCon) && !barcode && !infile) + barcode = (char *)poptGetArg(optCon); + if (poptPeekArg(optCon) || !barcode && !infile || barcode && infile) { + fprintf(stderr, "Version: %s\n", IEC16022_VERSION); + poptPrintUsage(optCon, stderr, 0); + return -1; + } + if (outfile && !freopen(outfile, "w", stdout)) { + perror(outfile); + return 1; + } + + if (infile) { // read from file + FILE *f = fopen(infile, "rb"); + barcode = safemalloc(4001); + if (!f) { + perror(infile); + return 1; + } + barcodelen = fread(barcode, 1, 4000, f); + if (barcodelen < 0) { + perror(infile); + return 1; + } + barcode[barcodelen] = 0; // null terminate anyway + close(f); + } else + barcodelen = strlen(barcode); + // check parameters + if (size) { + char *x = strchr(size, 'x'); + W = atoi(size); + if (x) + H = atoi(x + 1); + if (!H) + W = H; + } + if (eccstr) + ecc = atoi(eccstr); + if (W & 1) { // odd size + if (W != H || W < 9 || W > 49) { + fprintf(stderr, "Invalid size %dx%d\n", W, H); + return 1; + } + if (!eccstr) { + if (W >= 17) + ecc = 140; + else if (W >= 13) + ecc = 100; + else if (W >= 11) + ecc = 80; + else + ecc = 0; + } + if (ecc && ecc != 50 && ecc != 80 && ecc != 100 && ecc != 140 || + ecc == 50 && W < 11 || ecc == 80 && W < 13 || ecc == 100 + && W < 13 || ecc == 140 && W < 17) { + fprintf(stderr, "ECC%03d invalid for %dx%d\n", ecc, W, + H); + return 1; + } + + } else if (W) { // even size + if (W < H) { + int t = W; + W = H; + H = t; + } + if (!eccstr) + ecc = 200; + if (ecc != 200) { + fprintf(stderr, "ECC%03d invalid for %dx%d\n", ecc, W, + H); + return 1; + } + } + + else { // auto size + if (!eccstr) + // default is even sizes only unless explicit ecc set to force odd + // sizes + ecc = 200; + } + + if (tolower(*format) == 's') { // special stamp format checks & defaults + if (!W) + W = H = 32; + if (ecc != 200 || W != 32 || H != 32) + fprintf(stderr, "Stamps must be 32x32\n"); + if (encoding) + fprintf(stderr, "Stamps should use auto encoding\n"); + else { + int n; + for (n = 0; n < barcodelen && (barcode[n] == ' ' || + isdigit(barcode[n]) + || isupper(barcode[n])); + n++) ; + if (n < barcodelen) + fprintf(stderr, + "Has invalid characters for a stamp\n"); + else { + // Generate simplistic encoding rules as used by the windows app + // TBA - does not always match the windows app... + n = 0; + encoding = safemalloc(barcodelen + 1); + while (n < barcodelen) { + // ASCII + while (1) { + if (n == barcodelen + || n + 3 <= barcodelen + && (!isdigit(barcode[n]) + || + !isdigit(barcode + [n + 1]))) + break; + encoding[n++] = 'A'; + if (n < barcodelen + && isdigit(barcode[n - 1]) + && isdigit(barcode[n])) + encoding[n++] = 'A'; + } + // C40 + while (1) { + int r = 0; + while (n + r < barcodelen + && + isdigit(barcode[n + r])) + r++; + if (n + 3 > barcodelen + || r >= 6) + break; + encoding[n++] = 'C'; + encoding[n++] = 'C'; + encoding[n++] = 'C'; + } + } + encoding[n] = 0; + //fprintf (stderr, "%s\n%s\n", barcode, encoding); + } + } + } + // processing stamps + if ((W & 1) || ecc < 200) { // odd sizes + fprintf(stderr, "Not done odd sizes yet, sorry\n"); + } else { // even sizes + grid = + iec16022ecc200(&W, &H, &encoding, barcodelen, barcode, &len, + &maxlen, &ecclen); + } + + // output + if (!grid || !W) { + fprintf(stderr, "No barcode produced\n"); + return 1; + } + switch (tolower(*format)) { + case 'i': // info + printf("Size : %dx%d\n", W, H); + printf("Encoded : %d of %d bytes with %d bytes of ecc\n", len, + maxlen, ecclen); + printf("Barcode : %s\n", barcode); + printf("Encoding: %s\n", encoding); + break; + case 'h': // hex + dumphex(grid, W, H, 0); + break; + case 'b': // bin + { + int y; + for (y = 0; y < H; y++) { + int v = 0, x, b = 128; + for (x = 0; x < W; x++) { + if (grid[y * W + x]) + v |= b; + b >>= 1; + if (!b) { + putchar(v); + v = 0; + b = 128; + } + } + if (b != 128) + putchar(v); + } + } + break; + case 't': // text + { + int y; + for (y = H - 1; y >= 0; y--) { + int x; + for (x = 0; x < W; x++) + printf("%c", + grid[W * y + x] ? '*' : ' '); + printf("\n"); + } + } + break; + case 'e': // EPS + printf("%%!PS-Adobe-3.0 EPSF-3.0\n" + "%%%%Creator: IEC16022 barcode/stamp generator\n" + "%%%%BarcodeData: %s\n" "%%%%BarcodeSize: %dx%d\n" + "%%%%BarcodeFormat: ECC200\n" + "%%%%DocumentData: Clean7Bit\n" "%%%%LanguageLevel: 1\n" + "%%%%Pages: 1\n" "%%%%BoundingBox: 0 0 %d %d\n" + "%%%%EndComments\n" "%%%%Page: 1 1\n" + "%d %d 1[1 0 0 1 -1 -1]{<\n", barcode, W, H, W + 2, + H + 2, W, H); + dumphex(grid, W, H, 0xFF); + printf(">}image\n"); + break; + case 's': // Stamp + { + char temp[74], c; + time_t now; + struct tm t = { + 0 + }; + int v; + if (barcodelen < 74) { + fprintf(stderr, + "Does not look like a stamp barcode\n"); + return 1; + } + memcpy(temp, barcode, 74); + c = temp[5]; + temp[56] = 0; + t.tm_year = atoi(temp + 54) + 100; + t.tm_mday = 1; + now = mktime(&t); + temp[54] = 0; + now += 86400 * (atoi(temp + 51) - 1); + t = *gmtime(&now); + temp[46] = 0; + v = atoi(temp + 36); + printf("%%!PS-Adobe-3.0 EPSF-3.0\n" + "%%%%Creator: IEC16022 barcode/stamp generator\n" + "%%%%BarcodeData: %s\n" "%%%%BarcodeSize: %dx%d\n" "%%%%DocumentData: Clean7Bit\n" "%%%%LanguageLevel: 1\n" "%%%%Pages: 1\n" "%%%%BoundingBox: 0 0 190 80\n" "%%%%EndComments\n" "%%%%Page: 1 1\n" "10 dict begin/f{findfont exch scalefont \ + setfont}bind def/rm/rmoveto load def/m/moveto load \ + def/rl/rlineto load def\n" "/l/lineto load def/cp/closepath load def/c{dup stringwidth \ + pop -2 div 0 rmoveto show}bind def\n" "gsave 72 25.4 div dup scale 0 0 m 67 0 rl 0 28 rl -67 0 rl \ + cp clip 1 setgray fill 0 setgray 0.5 0 translate 0.3 \ + setlinewidth\n" "32 32 1[2 0 0 2 0 -11]{<\n", barcode, W, H); + dumphex(grid, W, H, 0xFF); + printf(">}image\n" + "3.25/Helvetica-Bold f 8 25.3 m(\\243%d.%02d)c\n" + "2.6/Helvetica f 8 22.3 m(%.4s %.4s)c\n" + "1.5/Helvetica f 8 3.3 m(POST BY)c\n" + "3.3/Helvetica f 8 0.25 m(%02d.%02d.%02d)c\n", + v / 100, v % 100, temp + 6, temp + 10, t.tm_mday, + t.tm_mon + 1, t.tm_year % 100); + if (c == '1' || c == '2' || c == 'A' || c == 'S') { + if (c == '2') + printf + ("42 0 m 10 0 rl 0 28 rl -10 0 rl cp 57 0 m 5 0 rl 0 \ + 28 rl -5 0 rl cp"); + else + printf + ("42 0 m 5 0 rl 0 28 rl -5 0 rl cp 52 0 m 10 0 rl 0 \ + 28 rl -10 0 rl cp"); + printf + (" 21 0 m 16 0 rl 0 28 rl -16 0 rl cp fill\n" + "21.3 0.3 m 15.4 0 rl 0 13 rl -15.4 0 rl cp 1 setgray \ + fill gsave 21.3 0.3 15.4 27.4 rectclip newpath\n"); + switch (c) { + case '1': + printf + ("27/Helvetica-Bold f 27 8.7 m(1)show grestore 0 setgray \ + 1.5/Helvetica-Bold f 22 3.3 m(POSTAGE PAID GB)show \ + 1.7/Helvetica f 29 1.5 m(DumbStamp.co.uk)c\n"); + break; + case '2': + printf + ("21/Helvetica-Bold f 23.5 13 m(2)1.25 1 scale show grestore \ + 0 setgray 1.5/Helvetica-Bold f 22 3.3 \ + m(POSTAGE PAID GB)show 1.7/Helvetica f 29 1.5 \ + m(DumbStamp.co.uk)c\n"); + break; + case 'A': + printf + ("16/Helvetica-Bold f 29 14.75 m 1.1 1 scale(A)c grestore 0 \ + setgray 1.5/Helvetica-Bold f 22 3.3 m(POSTAGE PAID GB)show \ + 1.7/Helvetica f 22 1.5 m(Par Avion)show\n"); + break; + case 'S': + printf + ("10/Helvetica-Bold f 29 17 m(SU)c grestore 0 setgray \ + 1.5/Helvetica-Bold f 22 1.5 m(POSTAGE PAID GB)show\n"); + break; + } + printf + ("2.3/Helvetica-Bold f 29 10 m(LOYAL MAIL)c\n"); + } else if (c == 'P') { // Standard Parcels + printf("21 0 m 41 0 rl 0 28 rl -41 0 rl cp fill\n" "37.7 0.3 m 24 0 rl 0 27.4 rl -24 0 rl cp 1 setgray fill \ + gsave 21.3 0.3 16.4 27.4 rectclip newpath\n" "22.5/Helvetica-Bold f 37.75 -1.25 m 90 rotate(SP)show \ + grestore 0 setgray\n" + "3.5/Helvetica-Bold f 49.7 21.5 m(LOYAL MAIL)c\n" "2.3/Helvetica-Bold f 49.7 7 m(POSTAGE PAID GB)c\n" "2.6/Helveica f 49.7 4.25 m(DumbStamp.co.uk)c\n"); + } else if (c == '3') + printf("21.15 0.15 40.7 27.7 rectstroke\n" + "21 0 m 41 0 rl 0 5 rl -41 0 rl cp fill\n" + "0 1 2{0 1 18{dup 1.525 mul 22.9 add 24 3 index 1.525 mul \ + add 3 -1 roll 9 add 29 div 0 360 arc fill}for pop}for\n" "50.5 23.07 m 11.5 0 rl 0 5 rl -11.5 0 rl cp fill\n" + "5.85/Helvetica f 23.7 15.6 m(Loyal Mail)show\n" "4.75/Helvetica-Bold f 24 11 m(special)show 4.9/Helvetica \ + f(delivery)show\n" "gsave 1 setgray 3.2/Helvetica-Bold f 24 1.6 \ + m(next day)show 26 10.15 m 2 0 rl stroke grestore\n" "21.15 9.9 m 53.8 9.9 l stroke 53.8 9.9 0.4 0 360 \ + arc fill\n"); + printf("end grestore\n"); + } + break; + case 'p': // png + { + int x, y; + Image *i = ImageNew(W + 2, H + 2, 2); + i->Colour[0] = 0xFFFFFF; + i->Colour[1] = 0; + for (y = 0; y < H; y++) + for (x = 0; x < W; x++) + if (grid[y * W + x]) + ImagePixel(i, x + 1, H - y) = 1; + ImageWritePNG(i, fileno(stdout), 0, -1, barcode); + ImageFree(i); + } + break; + default: + fprintf(stderr, "Unknown output format %s\n", format); + break; + } + return 0; +} diff --git a/iec16022-0.2.1/iec16022ecc200.c b/iec16022-0.2.1/iec16022ecc200.c new file mode 100644 index 00000000..0b28db70 --- /dev/null +++ b/iec16022-0.2.1/iec16022ecc200.c @@ -0,0 +1,963 @@ +/** + * + * IEC16022 bar code generation + * Adrian Kennard, Andrews & Arnold Ltd + * with help from Cliff Hones on the RS coding + * + * (c) 2004 Adrian Kennard, Andrews & Arnold Ltd + * (c) 2006 Stefan Schmidt + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include "reedsol.h" +#include "iec16022ecc200.h" + +static struct ecc200matrix_s { + int H, W; + int FH, FW; + int bytes; + int datablock, rsblock; +} ecc200matrix[] = { + 10, 10, 10, 10, 3, 3, 5, // + 12, 12, 12, 12, 5, 5, 7, // + 8, 18, 8, 18, 5, 5, 7, // + 14, 14, 14, 14, 8, 8, 10, // + 8, 32, 8, 16, 10, 10, 11, // + 16, 16, 16, 16, 12, 12, 12, // + 12, 26, 12, 26, 16, 16, 14, // + 18, 18, 18, 18, 18, 18, 14, // + 20, 20, 20, 20, 22, 22, 18, // + 12, 36, 12, 18, 22, 22, 18, // + 22, 22, 22, 22, 30, 30, 20, // + 16, 36, 16, 18, 32, 32, 24, // + 24, 24, 24, 24, 36, 36, 24, // + 26, 26, 26, 26, 44, 44, 28, // + 16, 48, 16, 24, 49, 49, 28, // + 32, 32, 16, 16, 62, 62, 36, // + 36, 36, 18, 18, 86, 86, 42, // + 40, 40, 20, 20, 114, 114, 48, // + 44, 44, 22, 22, 144, 144, 56, // + 48, 48, 24, 24, 174, 174, 68, // + 52, 52, 26, 26, 204, 102, 42, // + 64, 64, 16, 16, 280, 140, 56, // + 72, 72, 18, 18, 368, 92, 36, // + 80, 80, 20, 20, 456, 114, 48, // + 88, 88, 22, 22, 576, 144, 56, // + 96, 96, 24, 24, 696, 174, 68, // + 104, 104, 26, 26, 816, 136, 56, // + 120, 120, 20, 20, 1050, 175, 68, // + 132, 132, 22, 22, 1304, 163, 62, // + 144, 144, 24, 24, 1558, 156, 62, // 156*4+155*2 + 0 // terminate +}; + + // simple checked response malloc +static void *safemalloc(int n) +{ + void *p = malloc(n); + if (!p) { + fprintf(stderr, "Malloc(%d) failed\n", n); + exit(1); + } + return p; +} + +// Annex M placement alorithm low level +static void ecc200placementbit(int *array, int NR, int NC, int r, int c, + int p, char b) +{ + if (r < 0) { + r += NR; + c += 4 - ((NR + 4) % 8); + } + if (c < 0) { + c += NC; + r += 4 - ((NC + 4) % 8); + } + array[r * NC + c] = (p << 3) + b; +} + +static void ecc200placementblock(int *array, int NR, int NC, int r, + int c, int p) +{ + ecc200placementbit(array, NR, NC, r - 2, c - 2, p, 7); + ecc200placementbit(array, NR, NC, r - 2, c - 1, p, 6); + ecc200placementbit(array, NR, NC, r - 1, c - 2, p, 5); + ecc200placementbit(array, NR, NC, r - 1, c - 1, p, 4); + ecc200placementbit(array, NR, NC, r - 1, c - 0, p, 3); + ecc200placementbit(array, NR, NC, r - 0, c - 2, p, 2); + ecc200placementbit(array, NR, NC, r - 0, c - 1, p, 1); + ecc200placementbit(array, NR, NC, r - 0, c - 0, p, 0); +} + +static void ecc200placementcornerA(int *array, int NR, int NC, int p) +{ + ecc200placementbit(array, NR, NC, NR - 1, 0, p, 7); + ecc200placementbit(array, NR, NC, NR - 1, 1, p, 6); + ecc200placementbit(array, NR, NC, NR - 1, 2, p, 5); + ecc200placementbit(array, NR, NC, 0, NC - 2, p, 4); + ecc200placementbit(array, NR, NC, 0, NC - 1, p, 3); + ecc200placementbit(array, NR, NC, 1, NC - 1, p, 2); + ecc200placementbit(array, NR, NC, 2, NC - 1, p, 1); + ecc200placementbit(array, NR, NC, 3, NC - 1, p, 0); +} + +static void ecc200placementcornerB(int *array, int NR, int NC, int p) +{ + ecc200placementbit(array, NR, NC, NR - 3, 0, p, 7); + ecc200placementbit(array, NR, NC, NR - 2, 0, p, 6); + ecc200placementbit(array, NR, NC, NR - 1, 0, p, 5); + ecc200placementbit(array, NR, NC, 0, NC - 4, p, 4); + ecc200placementbit(array, NR, NC, 0, NC - 3, p, 3); + ecc200placementbit(array, NR, NC, 0, NC - 2, p, 2); + ecc200placementbit(array, NR, NC, 0, NC - 1, p, 1); + ecc200placementbit(array, NR, NC, 1, NC - 1, p, 0); +} + +static void ecc200placementcornerC(int *array, int NR, int NC, int p) +{ + ecc200placementbit(array, NR, NC, NR - 3, 0, p, 7); + ecc200placementbit(array, NR, NC, NR - 2, 0, p, 6); + ecc200placementbit(array, NR, NC, NR - 1, 0, p, 5); + ecc200placementbit(array, NR, NC, 0, NC - 2, p, 4); + ecc200placementbit(array, NR, NC, 0, NC - 1, p, 3); + ecc200placementbit(array, NR, NC, 1, NC - 1, p, 2); + ecc200placementbit(array, NR, NC, 2, NC - 1, p, 1); + ecc200placementbit(array, NR, NC, 3, NC - 1, p, 0); +} + +static void ecc200placementcornerD(int *array, int NR, int NC, int p) +{ + ecc200placementbit(array, NR, NC, NR - 1, 0, p, 7); + ecc200placementbit(array, NR, NC, NR - 1, NC - 1, p, 6); + ecc200placementbit(array, NR, NC, 0, NC - 3, p, 5); + ecc200placementbit(array, NR, NC, 0, NC - 2, p, 4); + ecc200placementbit(array, NR, NC, 0, NC - 1, p, 3); + ecc200placementbit(array, NR, NC, 1, NC - 3, p, 2); + ecc200placementbit(array, NR, NC, 1, NC - 2, p, 1); + ecc200placementbit(array, NR, NC, 1, NC - 1, p, 0); +} + +// Annex M placement alorithm main function +static void ecc200placement(int *array, int NR, int NC) +{ + int r, c, p; + // invalidate + for (r = 0; r < NR; r++) + for (c = 0; c < NC; c++) + array[r * NC + c] = 0; + // start + p = 1; + r = 4; + c = 0; + do { + // check corner + if (r == NR && !c) + ecc200placementcornerA(array, NR, NC, p++); + if (r == NR - 2 && !c && NC % 4) + ecc200placementcornerB(array, NR, NC, p++); + if (r == NR - 2 && !c && (NC % 8) == 4) + ecc200placementcornerC(array, NR, NC, p++); + if (r == NR + 4 && c == 2 && !(NC % 8)) + ecc200placementcornerD(array, NR, NC, p++); + // up/right + do { + if (r < NR && c >= 0 && !array[r * NC + c]) + ecc200placementblock(array, NR, NC, r, c, p++); + r -= 2; + c += 2; + } + while (r >= 0 && c < NC); + r++; + c += 3; + // down/left + do { + if (r >= 0 && c < NC && !array[r * NC + c]) + ecc200placementblock(array, NR, NC, r, c, p++); + r += 2; + c -= 2; + } + while (r < NR && c >= 0); + r += 3; + c++; + } + while (r < NR || c < NC); + // unfilled corner + if (!array[NR * NC - 1]) + array[NR * NC - 1] = array[NR * NC - NC - 2] = 1; +} + +// calculate and append ecc code, and if necessary interleave +static void ecc200(unsigned char *binary, int bytes, int datablock, int rsblock) +{ + int blocks = (bytes + 2) / datablock, b; + rs_init_gf(0x12d); + rs_init_code(rsblock, 1); + for (b = 0; b < blocks; b++) { + unsigned char buf[256], ecc[256]; + int n, p = 0; + for (n = b; n < bytes; n += blocks) + buf[p++] = binary[n]; + rs_encode(p, buf, ecc); + p = rsblock - 1; // comes back reversed + for (n = b; n < rsblock * blocks; n += blocks) + binary[bytes + n] = ecc[p--]; + } +} + +/* + * perform encoding for ecc200, source s len sl, to target t len tl, using + * optional encoding control string e return 1 if OK, 0 if failed. Does all + * necessary padding to tl + */ + +char ecc200encode(unsigned char *t, int tl, unsigned char *s, int sl, + char *encoding, int *lenp) +{ + char enc = 'a'; // start in ASCII encoding mode + int tp = 0, sp = 0; + if (strlen(encoding) < sl) { + fprintf(stderr, "Encoding string too short\n"); + return 0; + } + // do the encoding + while (sp < sl && tp < tl) { + char newenc = enc; // suggest new encoding + if (tl - tp <= 1 && (enc == 'c' || enc == 't') || tl - tp <= 2 + && enc == 'x') + enc = 'a'; // auto revert to ASCII + newenc = tolower(encoding[sp]); + switch (newenc) { // encode character + case 'c': // C40 + case 't': // Text + case 'x': // X12 + { + char out[6], p = 0; + const char *e, + *s2 = "!\"#$%&'()*+,-./:;<=>?@[\\]_", + *s3 = 0; + if (newenc == 'c') { + e = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + s3 = "`abcdefghijklmnopqrstuvwxyz{|}~\177"; + } + if (newenc == 't') { + e = " 0123456789abcdefghijklmnopqrstuvwxyz"; + s3 = "`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\177"; + } + if (newenc == 'x') + e = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\r*>"; + do { + unsigned char c = s[sp++]; + char *w; + if (c & 0x80) { + if (newenc == 'x') { + fprintf(stderr, + "Cannot encode char 0x%02X in X12\n", + c); + return 0; + } + c &= 0x7f; + out[p++] = 1; + out[p++] = 30; + } + w = strchr(e, c); + if (w) + out[p++] = ((w - e) + 3) % 40; + else { + if (newenc == 'x') { + fprintf(stderr, + "Cannot encode char 0x%02X in X12\n", + c); + return 0; + } + if (c < 32) { // shift 1 + out[p++] = 0; + out[p++] = c; + } else { + w = strchr(s2, c); + if (w) { // shift 2 + out[p++] = 1; + out[p++] = + (w - s2); + } else { + w = strchr(s3, + c); + if (w) { + out[p++] + = 2; + out[p++] + = + (w - + s3); + } else { + fprintf + (stderr, + "Could not encode 0x%02X, should \ + not happen\n", c); + return + 0; + } + } + } + } + if (p == 2 && tp + 2 == tl && sp == sl) + out[p++] = 0; // shift 1 pad at end + while (p >= 3) { + int v = + out[0] * 1600 + + out[1] * 40 + out[2] + 1; + if (enc != newenc) { + if (enc == 'c' + || enc == 't' + || enc == 'x') + t[tp++] = 254; // escape C40/text/X12 + else if (enc == 'x') + t[tp++] = 0x7C; // escape EDIFACT + if (newenc == 'c') + t[tp++] = 230; + if (newenc == 't') + t[tp++] = 239; + if (newenc == 'x') + t[tp++] = 238; + enc = newenc; + } + t[tp++] = (v >> 8); + t[tp++] = (v & 0xFF); + p -= 3; + out[0] = out[3]; + out[1] = out[4]; + out[2] = out[5]; + } + } + while (p && sp < sl); + } + break; + case 'e': // EDIFACT + { + unsigned char out[4], p = 0; + if (enc != newenc) { // can only be from C40/Text/X12 + t[tp++] = 254; + enc = 'a'; + } + while (sp < sl && tolower(encoding[sp]) == 'e' + && p < 4) + out[p++] = s[sp++]; + if (p < 4) { + out[p++] = 0x1F; + enc = 'a'; + } // termination + t[tp] = ((s[0] & 0x3F) << 2); + t[tp++] |= ((s[1] & 0x30) >> 4); + t[tp] = ((s[1] & 0x0F) << 4); + if (p == 2) + tp++; + else { + t[tp++] |= ((s[2] & 0x3C) >> 2); + t[tp] = ((s[2] & 0x03) << 6); + t[tp++] |= (s[3] & 0x3F); + } + } + break; + case 'a': // ASCII + if (enc != newenc) { + if (enc == 'c' || enc == 't' || enc == 'x') + t[tp++] = 254; // escape C40/text/X12 + else + t[tp++] = 0x7C; // escape EDIFACT + } + enc = 'a'; + if (sl - sp >= 2 && isdigit(s[sp]) + && isdigit(s[sp + 1])) { + t[tp++] = + (s[sp] - '0') * 10 + s[sp + 1] - '0' + 130; + sp += 2; + } else if (s[sp] > 127) { + t[tp++] = 235; + t[tp++] = s[sp++] - 127; + } else + t[tp++] = s[sp++] + 1; + break; + case 'b': // Binary + { + int l = 0; // how much to encode + if (encoding) { + int p; + for (p = sp; + p < sl + && tolower(encoding[p]) == 'b'; + p++) + l++; + } + t[tp++] = 231; // base256 + if (l < 250) + t[tp++] = l; + else { + t[tp++] = 249 + (l / 250); + t[tp++] = (l % 250); + } + while (l-- && tp < tl) { + t[tp] = s[sp++] + (((tp + 1) * 149) % 255) + 1; // see annex H + tp++; + } + enc = 'a'; // reverse to ASCII at end + } + break; + default: + fprintf(stderr, "Unknown encoding %c\n", newenc); + return 0; // failed + } + } + if (lenp) + *lenp = tp; + if (tp < tl && enc != 'a') { + if (enc == 'c' || enc == 'x' || enc == 't') + t[tp++] = 254; // escape X12/C40/Text + else + t[tp++] = 0x7C; // escape EDIFACT + } + if (tp < tl) + t[tp++] = 129; // pad + while (tp < tl) { // more padding + int v = 129 + (((tp + 1) * 149) % 253) + 1; // see Annex H + if (v > 254) + v -= 254; + t[tp++] = v; + } + if (tp > tl || sp < sl) + return 0; // did not fit + /* + * for (tp = 0; tp < tl; tp++) fprintf (stderr, "%02X ", t[tp]); \ + * fprintf (stderr, "\n"); + */ + return 1; // OK +} + +// Auto encoding format functions +static char encchr[] = "ACTXEB"; + +enum { + E_ASCII, + E_C40, + E_TEXT, + E_X12, + E_EDIFACT, + E_BINARY, + E_MAX +}; + +unsigned char switchcost[E_MAX][E_MAX] = { + 0, 1, 1, 1, 1, 2, // From E_ASCII + 1, 0, 2, 2, 2, 3, // From E_C40 + 1, 2, 0, 2, 2, 3, // From E_TEXT + 1, 2, 2, 0, 2, 3, // From E_X12 + 1, 2, 2, 2, 0, 3, // From E_EDIFACT + 0, 1, 1, 1, 1, 0, // From E_BINARY +}; + +/* + * Creates a encoding list (malloc) + * returns encoding string + * if lenp not null, target len stored + * if error, null returned + * if exact specified, then assumes shortcuts applicable for exact fit + * in target + * 1. No unlatch to return to ASCII for last encoded byte after C40 or + * Text or X12 + * 2. No unlatch to return to ASCII for last 1 or 2 encoded bytes after + * EDIFACT + * 3. Final C40 or text encoding exactly in last 2 bytes can have a shift + * 0 to pad to make a tripple + * Only use the encoding from an exact request if the len matches the target, + * otherwise free the result and try again with exact=0 + */ + +static char *encmake(int l, unsigned char *s, int *lenp, char exact) +{ + char *encoding = 0; + int p = l; + char e; + struct { + // number of bytes of source that can be encoded in a row at this point + // using this encoding mode + short s; + // number of bytes of target generated encoding from this point to end if + // already in this encoding mode + short t; + } enc[MAXBARCODE][E_MAX]; + memset(&enc, 0, sizeof(enc)); + if (!l) + return ""; // no length + if (l > MAXBARCODE) + return 0; // not valid + while (p--) { + char b = 0, sub; + int sl, tl, bl, t; + // consider each encoding from this point + // ASCII + sl = tl = 1; + if (isdigit(s[p]) && p + 1 < l && isdigit(s[p + 1])) + sl = 2; // double digit + else if (s[p] & 0x80) + tl = 2; // high shifted + bl = 0; + if (p + sl < l) + for (e = 0; e < E_MAX; e++) + if (enc[p + sl][e].t && ((t = enc[p + sl][e].t + + switchcost[E_ASCII] + [e]) < bl || !bl)) { + bl = t; + b = e; + } + enc[p][E_ASCII].t = tl + bl; + enc[p][E_ASCII].s = sl; + if (bl && b == E_ASCII) + enc[p][b].s += enc[p + sl][b].s; + // C40 + sub = tl = sl = 0; + do { + unsigned char c = s[p + sl++]; + if (c & 0x80) { // shift + upper + sub += 2; + c &= 0x7F; + } + if (c != ' ' && !isdigit(c) && !isupper(c)) + sub++; // shift + sub++; + while (sub >= 3) { + sub -= 3; + tl += 2; + } + } while (sub && p + sl < l); + if (exact && sub == 2 && p + sl == l) { + // special case, can encode last block with shift 0 at end (Is this + // valid when not end of target buffer?) + sub = 0; + tl += 2; + } + if (!sub) { // can encode C40 + bl = 0; + if (p + sl < l) + for (e = 0; e < E_MAX; e++) + if (enc[p + sl][e].t + && + ((t = + enc[p + sl][e].t + + switchcost[E_C40][e]) < bl + || !bl)) { + bl = t; + b = e; + } + if (exact && enc[p + sl][E_ASCII].t == 1 && 1 < bl) { + // special case, switch to ASCII for last bytes + bl = 1; + b = E_ASCII; + } + enc[p][E_C40].t = tl + bl; + enc[p][E_C40].s = sl; + if (bl && b == E_C40) + enc[p][b].s += enc[p + sl][b].s; + } + // Text + sub = tl = sl = 0; + do { + unsigned char c = s[p + sl++]; + if (c & 0x80) { // shift + upper + sub += 2; + c &= 0x7F; + } + if (c != ' ' && !isdigit(c) && !islower(c)) + sub++; // shift + sub++; + while (sub >= 3) { + sub -= 3; + tl += 2; + } + } while (sub && p + sl < l); + if (exact && sub == 2 && p + sl == l) { + // special case, can encode last block with shift 0 at end (Is this + // valid when not end of target buffer?) + sub = 0; + tl += 2; + } + if (!sub && sl) { // can encode Text + bl = 0; + if (p + sl < l) + for (e = 0; e < E_MAX; e++) + if (enc[p + sl][e].t + && + ((t = + enc[p + sl][e].t + + switchcost[E_TEXT][e]) < bl + || !bl)) { + bl = t; + b = e; + } + if (exact && enc[p + sl][E_ASCII].t == 1 && 1 < bl) { // special case, switch to ASCII for last bytes + bl = 1; + b = E_ASCII; + } + enc[p][E_TEXT].t = tl + bl; + enc[p][E_TEXT].s = sl; + if (bl && b == E_TEXT) + enc[p][b].s += enc[p + sl][b].s; + } + // X12 + sub = tl = sl = 0; + do { + unsigned char c = s[p + sl++]; + if (c != 13 && c != '*' && c != '>' && c != ' ' + && !isdigit(c) && !isupper(c)) { + sl = 0; + break; + } + sub++; + while (sub >= 3) { + sub -= 3; + tl += 2; + } + } while (sub && p + sl < l); + if (!sub && sl) { // can encode X12 + bl = 0; + if (p + sl < l) + for (e = 0; e < E_MAX; e++) + if (enc[p + sl][e].t + && + ((t = + enc[p + sl][e].t + + switchcost[E_X12][e]) < bl + || !bl)) { + bl = t; + b = e; + } + if (exact && enc[p + sl][E_ASCII].t == 1 && 1 < bl) { + // special case, switch to ASCII for last bytes + bl = 1; + b = E_ASCII; + } + enc[p][E_X12].t = tl + bl; + enc[p][E_X12].s = sl; + if (bl && b == E_X12) + enc[p][b].s += enc[p + sl][b].s; + } + // EDIFACT + sl = bl = 0; + if (s[p + 0] >= 32 && s[p + 0] <= 94) { // can encode 1 + char bs = 0; + if (p + 1 == l && (!bl || bl < 2)) { + bl = 2; + bs = 1; + } else + for (e = 0; e < E_MAX; e++) + if (e != E_EDIFACT && enc[p + 1][e].t + && + ((t = + 2 + enc[p + 1][e].t + + switchcost[E_ASCII][e]) + < bl || !bl)) // E_ASCII as allowed for unlatch + { + bs = 1; + bl = t; + b = e; + } + if (p + 1 < l && s[p + 1] >= 32 && s[p + 1] <= 94) { // can encode 2 + if (p + 2 == l && (!bl || bl < 2)) { + bl = 3; + bs = 2; + } else + for (e = 0; e < E_MAX; e++) + if (e != E_EDIFACT + && enc[p + 2][e].t + && + ((t = + 3 + enc[p + 2][e].t + + switchcost[E_ASCII][e]) + < bl || !bl)) // E_ASCII as allowed for unlatch + { + bs = 2; + bl = t; + b = e; + } + if (p + 2 < l && s[p + 2] >= 32 && s[p + 2] <= 94) { // can encode 3 + if (p + 3 == l && (!bl || bl < 3)) { + bl = 3; + bs = 3; + } else + for (e = 0; e < E_MAX; e++) + if (e != E_EDIFACT + && enc[p + 3][e].t + && + ((t = + 3 + enc[p + + 3][e].t + + switchcost + [E_ASCII][e]) + < bl || !bl)) // E_ASCII as allowed for unlatch + { + bs = 3; + bl = t; + b = e; + } + if (p + 4 < l && s[p + 3] >= 32 && s[p + 3] <= 94) { // can encode 4 + if (p + 4 == l + && (!bl || bl < 3)) { + bl = 3; + bs = 4; + } else { + for (e = 0; e < E_MAX; + e++) + if (enc[p + 4] + [e].t + && + ((t = + 3 + + enc[p + + 4][e]. + t + + switchcost + [E_EDIFACT] + [e]) < bl + || !bl)) { + bs = 4; + bl = t; + b = e; + } + if (exact + && enc[p + + 4][E_ASCII].t + && enc[p + + 4][E_ASCII]. + t <= 2 + && (t = + 3 + enc[p + + 4] + [E_ASCII].t) < + bl) { + // special case, switch to ASCII for last 1 ot two bytes + bs = 4; + bl = t; + b = E_ASCII; + } + } + } + } + } + enc[p][E_EDIFACT].t = bl; + enc[p][E_EDIFACT].s = bs; + if (bl && b == E_EDIFACT) + enc[p][b].s += enc[p + bs][b].s; + } + // Binary + bl = 0; + for (e = 0; e < E_MAX; e++) + if (enc[p + 1][e].t + && + ((t = + enc[p + 1][e].t + switchcost[E_BINARY][e] + + ((e == E_BINARY + && enc[p + 1][e].t == 249) ? 1 : 0)) + < bl || !bl)) { + bl = t; + b = e; + } + enc[p][E_BINARY].t = 1 + bl; + enc[p][E_BINARY].s = 1; + if (bl && b == E_BINARY) + enc[p][b].s += enc[p + 1][b].s; + /* + * fprintf (stderr, "%d:", p); for (e = 0; e < E_MAX; e++) fprintf \ + * (stderr, " %c*%d/%d", encchr[e], enc[p][e].s, enc[p][e].t); \ + * fprintf (stderr, "\n"); + */ + } + encoding = safemalloc(l + 1); + p = 0; + { + char cur = E_ASCII; // starts ASCII + while (p < l) { + int t, m = 0; + char b = 0; + for (e = 0; e < E_MAX; e++) + if (enc[p][e].t + && ((t = enc[p][e].t + switchcost[cur][e]) < + m || t == m && e == cur || !m)) { + b = e; + m = t; + } + cur = b; + m = enc[p][b].s; + if (!p && lenp) + *lenp = enc[p][b].t; + while (p < l && m--) + encoding[p++] = encchr[b]; + } + } + encoding[p] = 0; + return encoding; +} + +/* + * Main encoding function + * Returns the grid (malloced) containing the matrix. L corner at 0,0. + * Takes suggested size in *Wptr, *Hptr, or 0,0. Fills in actual size. + * Takes barcodelen and barcode to be encoded + * Note, if *encodingptr is null, then fills with auto picked (malloced) + * encoding + * If lenp not null, then the length of encoded data before any final + * unlatch or pad is stored + * If maxp not null, then the max storage of this size code is stored + * If eccp not null, then the number of ecc bytes used in this size is + * stored + * Returns 0 on error (writes to stderr with details). + */ + +unsigned char *iec16022ecc200(int *Wptr, int *Hptr, char **encodingptr, + int barcodelen, unsigned char *barcode, + int *lenp, int *maxp, int *eccp) +{ + unsigned char binary[3000]; // encoded raw data and ecc to place in barcode + int W = 0, H = 0; + char *encoding = 0; + unsigned char *grid = 0; + struct ecc200matrix_s *matrix; + memset(binary, 0, sizeof(binary)); + if (encodingptr) + encoding = *encodingptr; + if (Wptr) + W = *Wptr; + if (Hptr) + H = *Hptr; + + // encoding + if (W) { // known size + for (matrix = ecc200matrix; matrix->W && (matrix->W != W || + matrix->H != H); + matrix++) ; + if (!matrix->W) { + fprintf(stderr, "Invalid size %dx%d\n", W, H); + return 0; + } + if (!encoding) { + int len; + char *e = encmake(barcodelen, barcode, &len, 1); + if (e && len != matrix->bytes) { // try not an exact fit + free(e); + e = encmake(barcodelen, barcode, &len, 0); + if (len > matrix->bytes) { + fprintf(stderr, + "Cannot make barcode fit %dx%d\n", + W, H); + return 0; + } + } + encoding = e; + } + } else { + // find a suitable encoding + if (encoding == NULL) + encoding = encmake(barcodelen, barcode, NULL, 1); + + if (encoding) { // find one that fits chosen encoding + for (matrix = ecc200matrix; matrix->W; matrix++) + if (ecc200encode + (binary, matrix->bytes, barcode, barcodelen, + encoding, 0)) + break; + } else { + int len; + char *e; + e = encmake(barcodelen, barcode, &len, 1); + for (matrix = ecc200matrix; + matrix->W && matrix->bytes != len; matrix++) ; + if (e && !matrix->W) { // try for non exact fit + free(e); + e = encmake(barcodelen, barcode, &len, 0); + for (matrix = ecc200matrix; + matrix->W && matrix->bytes < len; + matrix++) ; + } + encoding = e; + } + if (!matrix->W) { + fprintf(stderr, + "Cannot find suitable size, barcode too long\n"); + return 0; + } + W = matrix->W; + H = matrix->H; + } + if (!ecc200encode(binary, matrix->bytes, barcode, barcodelen, + encoding, lenp)) { + fprintf(stderr, "Barcode too long for %dx%d\n", W, H); + return 0; + } + // ecc code + ecc200(binary, matrix->bytes, matrix->datablock, matrix->rsblock); + { // placement + int x, y, NC, NR, *places; + NC = W - 2 * (W / matrix->FW); + NR = H - 2 * (H / matrix->FH); + places = safemalloc(NC * NR * sizeof(int)); + ecc200placement(places, NR, NC); + grid = safemalloc(W * H); + memset(grid, 0, W * H); + for (y = 0; y < H; y += matrix->FH) { + for (x = 0; x < W; x++) + grid[y * W + x] = 1; + for (x = 0; x < W; x += 2) + grid[(y + matrix->FH - 1) * W + x] = 1; + } + for (x = 0; x < W; x += matrix->FW) { + for (y = 0; y < H; y++) + grid[y * W + x] = 1; + for (y = 0; y < H; y += 2) + grid[y * W + x + matrix->FW - 1] = 1; + } + for (y = 0; y < NR; y++) { + for (x = 0; x < NC; x++) { + int v = places[(NR - y - 1) * NC + x]; + //fprintf (stderr, "%4d", v); + if (v == 1 || v > 7 + && (binary[(v >> 3) - 1] & (1 << (v & 7)))) + grid[(1 + y + + 2 * (y / (matrix->FH - 2))) * W + + 1 + x + + 2 * (x / (matrix->FW - 2))] = 1; + } + //fprintf (stderr, "\n"); + } + free(places); + } + if (Wptr) + *Wptr = W; + if (Hptr) + *Hptr = H; + if (encodingptr) + *encodingptr = encoding; + if (maxp) + *maxp = matrix->bytes; + if (eccp) + *eccp = + (matrix->bytes + 2) / matrix->datablock * matrix->rsblock; + return grid; +} diff --git a/iec16022-0.2.1/iec16022ecc200.h b/iec16022-0.2.1/iec16022ecc200.h new file mode 100644 index 00000000..08678f08 --- /dev/null +++ b/iec16022-0.2.1/iec16022ecc200.h @@ -0,0 +1,47 @@ +/** + * + * IEC16022 bar code generation + * Adrian Kennard, Andrews & Arnold Ltd + * with help from Cliff Hones on the RS coding + * + * (c) 2004 Adrian Kennard, Andrews & Arnold Ltd + * (c) 2006 Stefan Schmidt + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * + * Main encoding function + * Returns the grid (malloced) containing the matrix. L corner at 0,0. + * Takes suggested size in *Wptr, *Hptr, or 0,0. Fills in actual size. + * Takes barcodelen and barcode to be encoded + * Note, if *encodingptr is null, then fills with auto picked (malloced) + * encoding. + * If lenp not null, then the length of encoded data before any final unlatch + * or pad is stored. + * If maxp not null, then the max storage of this size code is stored + * If eccp not null, then the number of ecc bytes used in this size is stored + * Returns 0 on error (writes to stderr with details). + * + */ + +#ifndef __IEC16022ECC200_H +#define __IEC16022ECC200_H + +unsigned char *iec16022ecc200(int *Wptr, int *Hptr, char **encodingptr, + int barcodelen, unsigned char *barcode, + int *lenp, int *maxp, int *eccp); +#define MAXBARCODE 3116 + +#endif /* __IEC16022ECC200_H */ diff --git a/iec16022-0.2.1/image.c b/iec16022-0.2.1/image.c new file mode 100644 index 00000000..f7dc3056 --- /dev/null +++ b/iec16022-0.2.1/image.c @@ -0,0 +1,668 @@ +/** + * + * Image handling tools, (c) AJK 2001-2005 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include +#include +#include +#include +#include "image.h" + +#define INTERLACE +#define CLEAR +#define USEZLIB + +#ifdef USEZLIB +#include +#endif + +unsigned char const bbc[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // + 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x00, // ! + 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // " + 0x36, 0x36, 0x7F, 0x36, 0x7F, 0x36, 0x36, 0x00, // # + 0x0C, 0x3F, 0x68, 0x3E, 0x0B, 0x7E, 0x18, 0x00, // $ + 0x60, 0x66, 0x0C, 0x18, 0x30, 0x66, 0x06, 0x00, // % + 0x38, 0x6C, 0x6C, 0x38, 0x6D, 0x66, 0x3B, 0x00, // & + 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, // ' + 0x0C, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00, // ( + 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, // ) + 0x00, 0x18, 0x7E, 0x3C, 0x7E, 0x18, 0x00, 0x00, // * + 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, // + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, // , + 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, // - + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, // . + 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00, // / + 0x18, 0x24, 0x66, 0x66, 0x66, 0x24, 0x18, 0x00, // 0 (non crossed) + 0x18, 0x38, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, // 1 + 0x3C, 0x66, 0x06, 0x0C, 0x18, 0x30, 0x7E, 0x00, // 2 + 0x3C, 0x66, 0x06, 0x1C, 0x06, 0x66, 0x3C, 0x00, // 3 + 0x0C, 0x1C, 0x3C, 0x6C, 0x7E, 0x0C, 0x0C, 0x00, // 4 + 0x7E, 0x60, 0x7C, 0x06, 0x06, 0x66, 0x3C, 0x00, // 5 + 0x1C, 0x30, 0x60, 0x7C, 0x66, 0x66, 0x3C, 0x00, // 6 + 0x7E, 0x06, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00, // 7 + 0x3C, 0x66, 0x66, 0x3C, 0x66, 0x66, 0x3C, 0x00, // 8 + 0x3C, 0x66, 0x66, 0x3E, 0x06, 0x0C, 0x38, 0x00, // 9 + 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, // : + 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x30, // ; + 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x00, // < + 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00, // = + 0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x00, // > + 0x3C, 0x66, 0x0C, 0x18, 0x18, 0x00, 0x18, 0x00, // ? + 0x3C, 0x66, 0x6E, 0x6A, 0x6E, 0x60, 0x3C, 0x00, // @ + 0x3C, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00, // A + 0x7C, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x7C, 0x00, // B + 0x3C, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3C, 0x00, // C + 0x78, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0x78, 0x00, // D + 0x7E, 0x60, 0x60, 0x7C, 0x60, 0x60, 0x7E, 0x00, // E + 0x7E, 0x60, 0x60, 0x7C, 0x60, 0x60, 0x60, 0x00, // F + 0x3C, 0x66, 0x60, 0x6E, 0x66, 0x66, 0x3C, 0x00, // G + 0x66, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66, 0x00, // H + 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, // I + 0x3E, 0x0C, 0x0C, 0x0C, 0x0C, 0x6C, 0x38, 0x00, // J + 0x66, 0x6C, 0x78, 0x70, 0x78, 0x6C, 0x66, 0x00, // K + 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7E, 0x00, // L + 0x63, 0x77, 0x7F, 0x6B, 0x6B, 0x63, 0x63, 0x00, // M + 0x66, 0x66, 0x76, 0x7E, 0x6E, 0x66, 0x66, 0x00, // N + 0x3C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, // O + 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x60, 0x60, 0x00, // P + 0x3C, 0x66, 0x66, 0x66, 0x6A, 0x6C, 0x36, 0x00, // Q + 0x7C, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0x66, 0x00, // R + 0x3C, 0x66, 0x60, 0x3C, 0x06, 0x66, 0x3C, 0x00, // S + 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, // T + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, // U + 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00, // V + 0x63, 0x63, 0x6B, 0x6B, 0x7F, 0x77, 0x63, 0x00, // W + 0x66, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x66, 0x00, // X + 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x00, // Y + 0x7E, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x7E, 0x00, // Z + 0x7C, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7C, 0x00, // [ + 0x00, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x00, // + 0x3E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x3E, 0x00, // ] + 0x18, 0x3C, 0x66, 0x42, 0x00, 0x00, 0x00, 0x00, // ^ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, // _ + 0x1C, 0x36, 0x30, 0x7C, 0x30, 0x30, 0x7E, 0x00, // ` + 0x00, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, // a + 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x7C, 0x00, // b + 0x00, 0x00, 0x3C, 0x66, 0x60, 0x66, 0x3C, 0x00, // c + 0x06, 0x06, 0x3E, 0x66, 0x66, 0x66, 0x3E, 0x00, // d + 0x00, 0x00, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, // e + 0x1C, 0x30, 0x30, 0x7C, 0x30, 0x30, 0x30, 0x00, // f + 0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x3C, // g + 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66, 0x66, 0x00, // h + 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, // i + 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x70, // j + 0x60, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0x00, // k + 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, // l + 0x00, 0x00, 0x36, 0x7F, 0x6B, 0x6B, 0x63, 0x00, // m + 0x00, 0x00, 0x7C, 0x66, 0x66, 0x66, 0x66, 0x00, // n + 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, // o + 0x00, 0x00, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x60, // p + 0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x07, // q + 0x00, 0x00, 0x6C, 0x76, 0x60, 0x60, 0x60, 0x00, // r + 0x00, 0x00, 0x3E, 0x60, 0x3C, 0x06, 0x7C, 0x00, // s + 0x30, 0x30, 0x7C, 0x30, 0x30, 0x30, 0x1C, 0x00, // t + 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, // u + 0x00, 0x00, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00, // v + 0x00, 0x00, 0x63, 0x6B, 0x6B, 0x7F, 0x36, 0x00, // w + 0x00, 0x00, 0x66, 0x3C, 0x18, 0x3C, 0x66, 0x00, // x + 0x00, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x06, 0x3C, // y + 0x00, 0x00, 0x7E, 0x0C, 0x18, 0x30, 0x7E, 0x00, // z + 0x0C, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0C, 0x00, // { + 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, // | + 0x30, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x30, 0x00, // } + 0x31, 0x6B, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, // ~ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // +}; + +const char smallc[] = " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-+&()/[];%"; +unsigned char const small[] = { + 0x00, 0x00, 0x00, // + 0x1F, 0x11, 0x1F, //0 + 0x11, 0x1F, 0x10, //1 + 0x1D, 0x15, 0x17, //2 + 0x11, 0x15, 0x1F, //3 + 0x07, 0x04, 0x1F, //4 + 0x17, 0x15, 0x1D, //5 + 0x1F, 0x15, 0x1D, //6 + 0x01, 0x01, 0x1F, //7 + 0x1F, 0x15, 0x1F, //8 + 0x17, 0x15, 0x1F, //9 + 0x1E, 0x05, 0x1E, //A + 0x1F, 0x15, 0x0A, //B + 0x0E, 0x11, 0x11, //C + 0x1F, 0x11, 0x0E, //D + 0x1F, 0x15, 0x11, //E + 0x1F, 0x05, 0x01, //F + 0x0E, 0x11, 0x19, //G + 0x1F, 0x04, 0x1F, //H + 0x11, 0x1F, 0x11, //I + 0x11, 0x0F, 0x01, //J + 0x1F, 0x04, 0x1B, //K + 0x1F, 0x10, 0x10, //L + 0x1F, 0x03, 0x1F, //M + 0x1F, 0x01, 0x1F, //N + 0x0E, 0x11, 0x0E, //O + 0x1F, 0x05, 0x02, //P + 0x0E, 0x19, 0x1E, //Q + 0x1F, 0x05, 0x1A, //R + 0x12, 0x15, 0x09, //S + 0x01, 0x1F, 0x01, //T + 0x1F, 0x10, 0x1F, //U + 0x0F, 0x10, 0x0F, //V + 0x1F, 0x18, 0x1F, //W + 0x1B, 0x04, 0x1B, //X + 0x03, 0x1C, 0x03, //Y + 0x19, 0x15, 0x13, //Z + 0x04, 0x04, 0x04, //- + 0x04, 0x0E, 0x04, //+ + 0x04, 0x0E, 0x04, //& (+) + 0x00, 0x0E, 0x11, //( + 0x11, 0x0E, 0x00, //) + 0x08, 0x04, 0x02, /// + 0x00, 0x1F, 0x11, //[ + 0x11, 0x1F, 0x00, //] + 0x10, 0x0A, 0x00, //; + 0x09, 0x04, 0x12, //% +}; + +Image *ImageNew(int w, int h, int c) +{ // create a new blank image + Image *i; + if (!w || !h) + return 0; + i = malloc(sizeof(*i)); + if (!i) + return 0; + memset(i, 0, sizeof(*i)); + i->W = w; + i->L = w + 1; + i->H = h; + i->C = c; + i->Image = malloc((w + 1) * h); + if (!i->Image) { + free(i); + return 0; + } + memset(i->Image, 0, (w + 1) * h); + if (c) { + i->Colour = malloc(sizeof(Colour) * c); + if (!i->Colour) { + free(i->Image); + free(i); + return 0; + } + memset(i->Colour, 0, sizeof(Colour) * c); + } + return i; +} + +void ImageFree(Image * i) +{ // free an image + if (i) { + if (i->Image) + free(i->Image); + if (i->Colour) + free(i->Colour); + free(i); + } +} + +#define MAXLZW 4096 +typedef short LZW[256]; +typedef LZW LZWTree[MAXLZW]; +typedef struct strPrivate { + int cols; // number of colours, power of 2 + unsigned char colbits; // number of bits for colours + int fh; // file handle + int lzwnext; // next code + int lzwlast; // last code in current bit size + int lzwbits; // current bit size + LZWTree lzw; // encode tree + unsigned char block[256]; // block so far, with count at start + int blockv; // pending value + int blockb; // bits used in pending value + short lzwcode; // which code we are on now +} Private; + +static LZWFlush(Private * p) +{ // flush this block + write(p->fh, p->block, *p->block + 1); + *p->block = 0; +} + +static LZWOut(Private * p, short v) +{ // output a value + p->blockv |= (v << p->blockb); + p->blockb += p->lzwbits; + while (p->blockb >= 8) { + p->block[++*p->block] = p->blockv; // last partial byte + p->blockv >>= 8; + p->blockb -= 8; + if (*p->block == 255) + LZWFlush(p); + } +} + +static LZWClear(Private * p) +{ + int c; + p->lzwbits = p->colbits + 1; + p->lzwnext = p->cols + 2; + p->lzwlast = (1 << p->lzwbits) - 1; + p->lzwcode = p->cols; // starting point + for (c = 0; c < p->cols; c++) { + p->lzw[p->cols][c] = c; // links to literal entries + // links from literals, dead ends initially + memset(&p->lzw[c], -1, p->cols * 2); + } +} + +static ImageStart(Private * p) +{ + unsigned char b = p->colbits; + write(p->fh, &b, 1); + *p->block = 0; + p->blockb = 0; + p->blockv = 0; + LZWClear(p); + LZWOut(p, p->cols); // clear code +} + +static ImageEnd(Private * p) +{ + LZWOut(p, p->lzwcode); // last prefix + LZWOut(p, p->cols + 1); // end code + if (p->blockb) + p->block[++*p->block] = p->blockv; // last partial byte + LZWFlush(p); +} + +static ImageOut(Private * p, unsigned char c) +{ + short next = p->lzw[p->lzwcode][c]; + if (next == -1) { // dead end + LZWOut(p, p->lzwcode); // prefix +#ifdef CLEAR + if (p->lzwnext + 1 == MAXLZW) { + LZWOut(p, p->cols); // clear code + LZWClear(p); + } else +#endif + if (p->lzwnext < MAXLZW) { + memset(p->lzw[p->lzwnext], -1, p->cols * 2); // init dead ends + p->lzw[p->lzwcode][c] = p->lzwnext; + if (p->lzwnext > p->lzwlast) { // bigger code + p->lzwbits++; + p->lzwlast = (1 << p->lzwbits) - 1; + } + p->lzwnext++; + } + p->lzwcode = c; + } else + p->lzwcode = next; // not a dead end +} + +// write GIF image +void ImageWriteGif(Image * i, int fh, int back, int trans, char *comment) +{ + struct strPrivate p; + p.fh = fh; + // count colours, min 4 + for (p.colbits = 2, p.cols = 4; p.cols < i->C; + p.cols *= 2, p.colbits++) ; + { // headers + char buf[1500]; + int n = 0; + strcpy(buf, "GIF87a"); +#ifndef INTERLACE + if (comment || trans >= 0) +#endif + buf[4] = '9'; // needs gif89 format + n = 6; + buf[n++] = (i->W & 255); + buf[n++] = (i->W >> 8); + buf[n++] = (i->H & 255); + buf[n++] = (i->H >> 8); + buf[n++] = (i->Colour ? 0x80 : 0) + 0x70 + (p.colbits - 1); + buf[n++] = back; // background + buf[n++] = 0; // aspect + if (i->Colour) { + int c; + for (c = 0; c < p.cols; c++) { + if (c < i->C) { + buf[n++] = (i->Colour[c] >> 16 & 255); + buf[n++] = (i->Colour[c] >> 8 & 255); + buf[n++] = (i->Colour[c] & 255); + } else { // extra, unused, colour + buf[n++] = 0; + buf[n++] = 0; + buf[n++] = 0; + } + } + } + // comment + if (comment && strlen(comment) < 256) { // comment + buf[n++] = 0x21; //extension + buf[n++] = 0xFE; //comment + buf[n++] = strlen(comment); + strcpy(buf + n, comment); + n += buf[n - 1]; + buf[n++] = 0; // end of block + } + if (trans >= 0) { // transparrent + buf[n++] = 0x21; // extension + buf[n++] = 0xF9; // graphic control + buf[n++] = 4; // len + buf[n++] = 1; // transparrent + buf[n++] = 0; // delay + buf[n++] = 0; + buf[n++] = trans; + buf[n++] = 0; // terminator + } + // image + buf[n++] = 0x2C; + buf[n++] = 0; // offset X + buf[n++] = 0; + buf[n++] = 0; // offset Y + buf[n++] = 0; + buf[n++] = (i->W & 255); + buf[n++] = (i->W >> 8); + buf[n++] = (i->H & 255); + buf[n++] = (i->H >> 8); +#ifdef INTERLACE + buf[n++] = 0x40; // interlaced, no local colour table +#else + buf[n++] = 0x00; // non interlaced, no local colour table +#endif + write(fh, buf, n); + } + // image data + { + unsigned char *b; + int x, y; + ImageStart(&p); +#ifdef INTERLACE + for (y = 0; y < i->H; y += 8) + for (b = &ImagePixel(i, 0, y), x = 0; x < i->W; x++) + ImageOut(&p, *b++); + for (y = 4; y < i->H; y += 8) + for (b = &ImagePixel(i, 0, y), x = 0; x < i->W; x++) + ImageOut(&p, *b++); + for (y = 2; y < i->H; y += 4) + for (b = &ImagePixel(i, 0, y), x = 0; x < i->W; x++) + ImageOut(&p, *b++); + for (y = 1; y < i->H; y += 2) + for (b = &ImagePixel(i, 0, y), x = 0; x < i->W; x++) + ImageOut(&p, *b++); +#else + for (y = 0; y < i->H; y++) + for (b = &ImagePixel(i, 0, y), x = 0; x < i->W; x++) + ImageOut(&p, *b++); +#endif + ImageEnd(&p); + } + write(fh, "\0", 1); // end of image data + write(fh, "\x3B", 1); // trailer +} + +void ImageText(Image * i, int x, int y, int col, char *text) +{ // writes 8x8 text + if (i && text) + while (*text) { + if (*text >= ' ' && *text) { + int r; + unsigned const char *b = + bbc + (*text - ' ') * 8; + for (r = 0; r < 8; r++) { + unsigned char v = *b++; + unsigned char *p = + &ImagePixel(i, x, y + r); + unsigned char m; + for (m = 0x80; m; m >>= 1, p++) + if (v & m) + *p = col; + } + } + x += 8; + text++; + } +} + +void ImageSmall(Image * i, int x, int y, int col, char *text) +{ // writes 4x6 digits + if (i && text) + while (*text) { + char *p = strchr(smallc, toupper(*text)); + if (p) { + int r; + char m = 1; + unsigned const char *b = + small + (p - smallc) * 3; + for (r = 0; r < 5; r++) { + int c; + for (c = 0; c < 3; c++) + if (b[c] & m) + ImagePixel(i, x + c, + y + r) = col; + m <<= 1; + } + x += 4; + } else if (*text == '.') { + ImagePixel(i, x, y + 4) = col; + x += 2; + } else if (*text == ':') { + ImagePixel(i, x, y + 1) = col; + ImagePixel(i, x, y + 3) = col; + x += 2; + } + text++; + } +} + +void ImageRect(Image * i, int x, int y, int w, int h, int c) +{ // fill a box + if (i && w && h) { + while (h--) { + unsigned char *p = &ImagePixel(i, x, y); + int n = w; + while (n--) + *p++ = c; + y++; + } + } +} + +// PNG code + + /* Table of CRCs of all 8-bit messages. */ +static unsigned int crc_table[256]; + + /* Make the table for a fast CRC. */ +void make_crc_table(void) +{ + unsigned int c; + int n, k; + for (n = 0; n < 256; n++) { + c = (unsigned int)n; + for (k = 0; k < 8; k++) { + if (c & 1) + c = 0xedb88320L ^ (c >> 1); + else + c = c >> 1; + } + crc_table[n] = c; + } +} + + /* Update a running CRC with the bytes buf[0..len-1]--the CRC + should be initialized to all 1's, and the transmitted value + is the 1's complement of the final running CRC (see the + crc() routine below)). */ + +unsigned int update_crc(unsigned int crc, unsigned char *buf, int len) +{ + unsigned int c = crc; + int n; + + for (n = 0; n < len; n++) + c = crc_table[(c ^ buf[n]) & 0xff] ^ (c >> 8); + + return c; +} + + /* Return the CRC of the bytes buf[0..len-1]. */ +unsigned int crc(unsigned char *buf, int len) +{ + return update_crc(0xffffffffL, buf, len) ^ 0xffffffffL; +} + +unsigned int writecrc(int fh, char *ptr, int len, unsigned int c) +{ + write(fh, ptr, len); + while (len--) + c = crc_table[(c ^ *ptr++) & 0xff] ^ (c >> 8); + return c; +} + +void writechunk(int fh, char *typ, void *ptr, int len) +{ + unsigned int v = htonl(len), crc; + write(fh, &v, 4); + crc = writecrc(fh, typ, 4, ~0); + if (len) + crc = writecrc(fh, ptr, len, crc); + v = htonl(~crc); + write(fh, &v, 4); +} + +#ifndef USEZLIB +unsigned int adlersum(unsigned char *p, int l, unsigned int adler) +{ + unsigned int s1 = (adler & 65535), s2 = (adler >> 16); + while (l--) { + s1 += *p++; + s2 += s1; + } + s1 %= 65521; // can be delayed due to sensible "l" values... + s2 %= 65521; + return (s2 << 16) + s1; +} +#endif + +// write PNG image +void ImageWritePNG(Image * i, int fh, int back, int trans, char *comment) +{ + make_crc_table(); + write(fh, "\211PNG\r\n\032\n", 8); // PNG header + { // IHDR + struct { + unsigned int width; + unsigned int height; + unsigned char depth; + unsigned char colour; + unsigned char compress; + unsigned char filter; + unsigned char interlace; + } ihdr = { + 0, 0, 8, 3, 0, 0}; + ihdr.width = htonl(i->W); + ihdr.height = htonl(i->H); + writechunk(fh, "IHDR", &ihdr, 13); + } + { // PLTE + unsigned int v = htonl(i->C * 3), crc, n; + write(fh, &v, 4); + crc = writecrc(fh, "PLTE", 4, ~0); + for (n = 0; n < i->C; n++) { + v = htonl(i->Colour[n] << 8); + crc = writecrc(fh, (void *)&v, 3, crc); + } + v = htonl(~crc); + write(fh, &v, 4); + } + if (back >= 0) { // bKGD + unsigned char b = back; + writechunk(fh, "bKGD", &b, 1); + } + if (*comment) { // tEXt + char c[] = "Comment"; + unsigned int v = htonl(strlen(c) + strlen(comment) + 1), crc; + write(fh, &v, 4); + crc = writecrc(fh, "tEXt", 4, ~0); + crc = writecrc(fh, c, strlen(c) + 1, crc); + crc = writecrc(fh, comment, strlen(comment), crc); + v = htonl(~crc); + write(fh, &v, 4); + } + { // tRNS + unsigned char alpha[256]; + int n; + for (n = 0; n < i->C; n++) + // 4th palette byte treated as 0=opaque, 255-transparren + alpha[n] = 255 - (i->Colour[n] >> 24); + if (trans >= 0 && trans < i->C) + // manual set of specific transparrent colour + alpha[trans] = 0; + writechunk(fh, "tRNS", alpha, i->C); + } +#ifndef USEZLIB + { // IDAT + unsigned int v = htonl(i->H * (i->L + 5) + 6), + crc, adler = 1, n; + unsigned char *p = i->Image; + write(fh, &v, 4); + crc = writecrc(fh, "IDAT", 4, ~0); + crc = writecrc(fh, "\170\001", 2, crc); // zlib header for deflate + n = i->H; + while (n--) { + unsigned char h[5]; + h[0] = (n ? 0 : 1); // last chunk in deflate, un compressed + h[1] = (i->L & 255); // Len, LSB first as per deflate spec + h[2] = (i->L / 256); + h[3] = ~(i->L & 255); // Inverse of Len + h[4] = ~(i->L / 256); + *p = 0; // filter 0 (NONE) + crc = writecrc(fh, h, 5, crc); + crc = writecrc(fh, p, i->L, crc); + adler = adlersum(p, i->L, adler); + p += i->L; + } + v = htonl(adler); + crc = writecrc(fh, (void *)&v, 4, crc); + v = htonl(~crc); + write(fh, &v, 4); + } +#else + { // IDAT + unsigned char *temp; + unsigned long n; + for (n = 0; n < i->H; n++) + i->Image[n * i->L] = 0; // filter 0 + n = i->H * i->L * 1001 / 1000 + 12; + temp = malloc(n); + if (compress2(temp, &n, i->Image, i->L * i->H, 9) != Z_OK) + fprintf(stderr, "Deflate error\n"); + else + writechunk(fh, "IDAT", temp, n); + free(temp); + } +#endif + writechunk(fh, "IEND", 0, 0); // IEND +} diff --git a/iec16022-0.2.1/image.h b/iec16022-0.2.1/image.h new file mode 100644 index 00000000..92d6d06e --- /dev/null +++ b/iec16022-0.2.1/image.h @@ -0,0 +1,49 @@ +/** + * + * Image handling tools, (c) AJK 2001-2005 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __IMAGE_H +#define __IMAGE_H + +typedef unsigned int Colour; // RGB value + +// Image object +typedef struct { + int W, // width + L, // Line length in Image (W+1) + H; // height + unsigned char *Image; // image array, one byte per pixel + int C; // colours (can be non power of 2, max 256) + Colour *Colour; // colour map (must have entry for each colour) +} Image; + +// macros and functions + +#define ImagePixel(i,x,y) ((i)->Image[1+(i)->L*(y)+(x)]) + +Image *ImageNew(int w, int h, int c); // create a new blank image +void ImageFree(Image * i); // free an image +void ImageWriteGif(Image * i, int fh, int back, int trans, char *comment); +void ImageWritePNG(Image * i, int fh, int back, int trans, char *comment); +void ImageText(Image * i, int x, int y, int c, char *text); // write 8x8 text +void ImageSmall(Image * i, int x, int y, int c, char *text); // write 4x6 text +void ImageRect(Image * i, int x, int y, int w, int h, int c); // fill a box +#define ImageWrite ImageWritePNG // default + +#endif /* __IMAGE_H */ diff --git a/iec16022-0.2.1/reedsol.c b/iec16022-0.2.1/reedsol.c new file mode 100644 index 00000000..a9502412 --- /dev/null +++ b/iec16022-0.2.1/reedsol.c @@ -0,0 +1,172 @@ +/** + * + * This is a simple Reed-Solomon encoder + * (C) Cliff Hones 2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +// It is not written with high efficiency in mind, so is probably +// not suitable for real-time encoding. The aim was to keep it +// simple, general and clear. +// +// + +// Usage: +// First call rs_init_gf(poly) to set up the Galois Field parameters. +// Then call rs_init_code(size, index) to set the encoding size +// Then call rs_encode(datasize, data, out) to encode the data. +// +// These can be called repeatedly as required - but note that +// rs_init_code must be called following any rs_init_gf call. +// +// If the parameters are fixed, some of the statics below can be +// replaced with constants in the obvious way, and additionally +// malloc/free can be avoided by using static arrays of a suitable +// size. + +#include // only needed for debug (main) +#include // only needed for malloc/free + +static int gfpoly; +static int symsize; // in bits +static int logmod; // 2**symsize - 1 +static int rlen; + +static int *log = NULL, *alog = NULL, *rspoly = NULL; + +// rs_init_gf(poly) initialises the parameters for the Galois Field. +// The symbol size is determined from the highest bit set in poly +// This implementation will support sizes up to 30 bits (though that +// will result in very large log/antilog tables) - bit sizes of +// 8 or 4 are typical +// +// The poly is the bit pattern representing the GF characteristic +// polynomial. e.g. for ECC200 (8-bit symbols) the polynomial is +// a**8 + a**5 + a**3 + a**2 + 1, which translates to 0x12d. + +void rs_init_gf(int poly) +{ + int m, b, p, v; + + // Return storage from previous setup + if (log) { + free(log); + free(alog); + free(rspoly); + rspoly = NULL; + } + // Find the top bit, and hence the symbol size + for (b = 1, m = 0; b <= poly; b <<= 1) + m++; + b >>= 1; + m--; + gfpoly = poly; + symsize = m; + + // Calculate the log/alog tables + logmod = (1 << m) - 1; + log = (int *)malloc(sizeof(int) * (logmod + 1)); + alog = (int *)malloc(sizeof(int) * logmod); + + for (p = 1, v = 0; v < logmod; v++) { + alog[v] = p; + log[p] = v; + p <<= 1; + if (p & b) + p ^= poly; + } +} + +// rs_init_code(nsym, index) initialises the Reed-Solomon encoder +// nsym is the number of symbols to be generated (to be appended +// to the input data). index is usually 1 - it is the index of +// the constant in the first term (i) of the RS generator polynomial: +// (x + 2**i)*(x + 2**(i+1))*... [nsym terms] +// For ECC200, index is 1. + +void rs_init_code(int nsym, int index) +{ + int i, k; + + if (rspoly) + free(rspoly); + rspoly = (int *)malloc(sizeof(int) * (nsym + 1)); + + rlen = nsym; + + rspoly[0] = 1; + for (i = 1; i <= nsym; i++) { + rspoly[i] = 1; + for (k = i - 1; k > 0; k--) { + if (rspoly[k]) + rspoly[k] = + alog[(log[rspoly[k]] + index) % logmod]; + rspoly[k] ^= rspoly[k - 1]; + } + rspoly[0] = alog[(log[rspoly[0]] + index) % logmod]; + index++; + } +} + +// Note that the following uses byte arrays, so is only suitable for +// symbol sizes up to 8 bits. Just change the data type of data and res +// to unsigned int * for larger symbols. + +void rs_encode(int len, unsigned char *data, unsigned char *res) +{ + int i, k, m; + for (i = 0; i < rlen; i++) + res[i] = 0; + for (i = 0; i < len; i++) { + m = res[rlen - 1] ^ data[i]; + for (k = rlen - 1; k > 0; k--) { + if (m && rspoly[k]) + res[k] = + res[k - + 1] ^ alog[(log[m] + + log[rspoly[k]]) % logmod]; + else + res[k] = res[k - 1]; + } + if (m && rspoly[0]) + res[0] = alog[(log[m] + log[rspoly[0]]) % logmod]; + else + res[0] = 0; + } +} + +#ifndef LIB +// The following tests the routines with the ISO/IEC 16022 Annexe R data +int main(void) +{ + register int i; + + unsigned char data[9] = { 142, 164, 186 }; + unsigned char out[5]; + + rs_init_gf(0x12d); + rs_init_code(5, 1); + + rs_encode(3, data, out); + + printf("Result of Annexe R encoding:\n"); + for (i = 4; i >= 0; i--) + printf(" %d\n", out[i]); + + return 0; +} +#endif diff --git a/iec16022-0.2.1/reedsol.h b/iec16022-0.2.1/reedsol.h new file mode 100644 index 00000000..0181a8df --- /dev/null +++ b/iec16022-0.2.1/reedsol.h @@ -0,0 +1,29 @@ +/** + * + * This is a simple Reed-Solomon encoder + * (C) Cliff Hones 2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __REEDSOL_H +#define __REEDSOL_H + +void rs_init_gf(int poly); +void rs_init_code(int nsym, int index); +void rs_encode(int len, unsigned char *data, unsigned char *res); + +#endif /* __REEDSOL_H */ diff --git a/iec16022-0.2.1/test/testsuite-example.bin b/iec16022-0.2.1/test/testsuite-example.bin new file mode 100644 index 00000000..02a4436d --- /dev/null +++ b/iec16022-0.2.1/test/testsuite-example.bin @@ -0,0 +1 @@ +ÿÿÿÿ¿`ïÁ϶mÜ>ýÜÏÃðŠ¼N¯·«9š‚±¤Ë»¾ƒÐ@¨ÄÌEÙù£,Æ<°Ü-öb°:Çw×ɪªªªÿÿÿÿŸÀŽöÊÕï—¦‘¸%kûhŽÔ«-¨Û£0ËQ³kâÛ€Éôå£ÂÍ~„ögëTåགྷ絪ªªª \ No newline at end of file diff --git a/iec16022-0.2.1/test/testsuite-example.eps b/iec16022-0.2.1/test/testsuite-example.eps new file mode 100644 index 00000000..9f97c228 --- /dev/null +++ b/iec16022-0.2.1/test/testsuite-example.eps @@ -0,0 +1,15 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: IEC16022 barcode/stamp generator +%%BarcodeData: Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o +%%BarcodeSize: 32x32 +%%BarcodeFormat: ECC200 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%BoundingBox: 0 0 34 34 +%%EndComments +%%Page: 1 1 +32 32 1[1 0 0 1 -1 -1]{< +00000000 409F10E5 3E304992 23C102F9 23E0303C 0F7543B1 504854C6 657D4E5B 3444417C 2FBF573B 33BA2606 5CD339C3 4FE823D2 099D4FC5 38882836 55555555 +00000000 603F7109 352A10F0 68596EFB 47DA7094 0497712B 54D257E4 24ED5CCF 34AE4C94 1DE524E1 7F360B1A 5C3D3281 7BE60998 14AB1A1F 427C184A 55555555 +>}image diff --git a/iec16022-0.2.1/test/testsuite-example.hex b/iec16022-0.2.1/test/testsuite-example.hex new file mode 100644 index 00000000..874101c1 --- /dev/null +++ b/iec16022-0.2.1/test/testsuite-example.hex @@ -0,0 +1,2 @@ +FFFFFFFF BF60EF1A C1CFB66D DC3EFD06 DC1FCFC3 F08ABC4E AFB7AB39 9A82B1A4 CBBBBE83 D040A8C4 CC45D9F9 A32CC63C B017DC2D F662B03A C777D7C9 AAAAAAAA +FFFFFFFF 9FC08EF6 CAD5EF0F 97A69104 B8258F6B FB688ED4 AB2DA81B DB12A330 CB51B36B E21ADB1E 80C9F4E5 A3C2CD7E 8419F667 EB54E5E0 BD83E7B5 AAAAAAAA diff --git a/iec16022-0.2.1/test/testsuite-example.png b/iec16022-0.2.1/test/testsuite-example.png new file mode 100644 index 00000000..050d1f0e Binary files /dev/null and b/iec16022-0.2.1/test/testsuite-example.png differ diff --git a/iec16022-0.2.1/test/testsuite-example.text b/iec16022-0.2.1/test/testsuite-example.text new file mode 100644 index 00000000..097a7d1c --- /dev/null +++ b/iec16022-0.2.1/test/testsuite-example.text @@ -0,0 +1,32 @@ +* * * * * * * * * * * * * * * * +* **** ** ***** **** ** * * +*** * ** * * * *** * **** +* * ** ***** ** ** *** +* * **** * ** ** * ****** +* ** * ***** * *** * * +*** * ** * ** ** ** **** +** * ** * * ** ** ** ** * ** +** ** ** * * * * ** ** +* * * ** * ** ** * * ** ** +***** ** ** * * *** ** * * +* *** * * ** **** ** * ** +* * **** * ** * * * * +** * * ** * * **** **** **** +* ******* * *** **** ** +******************************** +* * * * * * * * * * * * * * * * +** *** *** ***** * ***** * * +**** ** ** * * ** *** * +* ** * ***** *** * ** * +* * ** * ** ** ** **** +** ** * * *** ** ****** * +** * * * * * ** * +** * *** *** *** ***** * ** +* ** * * * * ** ** * * +* * ***** ** **** * * ** *** * +**** * * * * **** * *** +** *** ******* ****** ** +** *** ***** ****** * ** +** *** ***** ** ** ** ** * +* ****** ** *** **** ** * +******************************** diff --git a/iec16022-0.2.1/test/testsuite.sh b/iec16022-0.2.1/test/testsuite.sh new file mode 100755 index 00000000..82a100af --- /dev/null +++ b/iec16022-0.2.1/test/testsuite.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +FAILED=0 + +../iec16022 -o testsuite-test.text -f Text -c "Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o" +../iec16022 -o testsuite-test.eps -f EPS -c "Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o" +../iec16022 -o testsuite-test.png -f PNG -c "Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o" +../iec16022 -o testsuite-test.bin -f Bin -c "Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o" +../iec16022 -o testsuite-test.hex -f Hex -c "Aolash3l dee6Ieke OhBohm1C MengaR9m zaHaoQu2 huW3Uer8 ieg7chaJ haiKua1o" + +diff -b testsuite-test.text testsuite-example.text && echo "Text test passed" || echo "Text test FAILED" || FAILED=1 +diff -b testsuite-test.eps testsuite-example.eps && echo "EPS test passed" || echo "EPS test FAILED" || FAILED=1 +diff -b testsuite-test.png testsuite-example.png && echo "PNG test passed" || echo "PNG test FAILED" || FAILED=1 +diff -b testsuite-test.bin testsuite-example.bin && echo "Bin test passed" || echo "Bin test FAILED" || FAILED=1 +diff -b testsuite-test.hex testsuite-example.hex && echo "Hex test passed" || echo "Hex test FAILED" || FAILED=1 + +rm testsuite-test.* + +exit $FAILED diff --git a/libglabels/Makefile.am b/libglabels/Makefile.am new file mode 100644 index 00000000..2d1228ab --- /dev/null +++ b/libglabels/Makefile.am @@ -0,0 +1,58 @@ +templatesdir = $(datadir)/glabels/templates + +INCLUDES = \ + $(LIBGLABELS_CFLAGS) \ + -DDATADIR=\""$(datadir)"\" \ + -DLIBGLABELS_TEMPLATE_DIR=\""$(templatesdir)"\" \ + $(DISABLE_DEPRECATED_CFLAGS) + +libglabels_la_LDFLAGS=\ + -version-info $(LIBGLABELS_VERSION_INFO) \ + $(LIBGLABELS_LIBS) \ + -no-undefined + +lib_LTLIBRARIES = libglabels.la + +libglabelsincludedir=$(includedir)/libglabels + +libglabels_la_SOURCES = \ + libglabels-private.h \ + db.h \ + db.c \ + enums.h \ + paper.h \ + paper.c \ + category.h \ + category.c \ + template.h \ + template.c \ + xml-paper.h \ + xml-paper.c \ + xml-category.h \ + xml-category.c \ + xml-template.h \ + xml-template.c \ + xml.h \ + xml.c \ + str.h \ + str.c + +libglabelsinclude_HEADERS = \ + libglabels.h \ + db.h \ + enums.h \ + paper.h \ + category.h \ + template.h \ + xml-paper.h \ + xml-category.h \ + xml-template.h \ + xml.h \ + str.h + +EXTRA_DIST = \ + libglabels.pc.in + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libglabels.pc + diff --git a/libglabels/category.c b/libglabels/category.c new file mode 100644 index 00000000..e82e0849 --- /dev/null +++ b/libglabels/category.c @@ -0,0 +1,129 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (LIBGLABELS) Template library for GLABELS + * + * category.c: template category module + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ +#include + +#include "category.h" + +#include +#include +#include +#include +#include + +#include "libglabels-private.h" + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + + +/*===========================================*/ +/* Functions. */ +/*===========================================*/ +/** + * lgl_category_new: + * @id: Id of category definition. (E.g. label, card, etc.) Should be + * unique. + * @name: Localized name of category. + * + * Allocates and constructs a new #lglCategory structure. + * + * Returns: a pointer to a newly allocated #lglCategory structure. + * + */ +lglCategory * +lgl_category_new (gchar *id, + gchar *name) +{ + lglCategory *category; + + category = g_new0 (lglCategory,1); + category->id = g_strdup (id); + category->name = g_strdup (name); + + return category; +} + + +/** + * lgl_category_dup: + * @orig: #lglCategory structure to be duplicated. + * + * Duplicates an existing #lglCategory structure. + * + * Returns: a pointer to a newly allocated #lglCategory structure. + * + */ +lglCategory *lgl_category_dup (const lglCategory *orig) +{ + lglCategory *category; + + g_return_val_if_fail (orig, NULL); + + category = g_new0 (lglCategory,1); + + category->id = g_strdup (orig->id); + category->name = g_strdup (orig->name); + + return category; +} + + +/** + * lgl_category_free: + * @category: pointer to #lglCategory structure to be freed. + * + * Free all memory associated with an existing #lglCategory structure. + * + */ +void lgl_category_free (lglCategory *category) +{ + + if ( category != NULL ) { + + g_free (category->id); + category->id = NULL; + + g_free (category->name); + category->name = NULL; + + g_free (category); + } + +} + + diff --git a/libglabels/category.h b/libglabels/category.h new file mode 100644 index 00000000..3727d47d --- /dev/null +++ b/libglabels/category.h @@ -0,0 +1,59 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (LIBGLABELS) Template library for GLABELS + * + * category.h: template category module header file + * + * Copyright (C) 2006 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __CATEGORY_H__ +#define __CATEGORY_H__ + +#include +#include + +G_BEGIN_DECLS + +/* + * Template class + */ +typedef struct _lglCategory lglCategory; + +struct _lglCategory { + gchar *id; /* Unique ID of category */ + gchar *name; /* Localized name of category */ +}; + + +/* + * Category construction + */ +lglCategory *lgl_category_new (gchar *id, + gchar *name); + +lglCategory *lgl_category_dup (const lglCategory *orig); +void lgl_category_free (lglCategory *category); + + +G_END_DECLS + +#endif diff --git a/libglabels/db.c b/libglabels/db.c new file mode 100644 index 00000000..a7279047 --- /dev/null +++ b/libglabels/db.c @@ -0,0 +1,1615 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (LIBGLABELS) Template library for GLABELS + * + * db.c: template db module + * + * Copyright (C) 2003-2007 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ +#include + +#include "db.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libglabels-private.h" + +#include "xml-paper.h" +#include "xml-category.h" +#include "xml-template.h" + + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +static GList *papers = NULL; +static GList *categories = NULL; +static GList *templates = NULL; + +static GHashTable *template_cache = NULL; + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void init_template_cache (void); +static void add_to_template_cache (lglTemplate *template); + +static GList *read_papers (void); +static GList *read_paper_files_from_dir (GList *papers, + const gchar *dirname); + +static GList *read_categories (void); +static GList *read_category_files_from_dir (GList *categories, + const gchar *dirname); + +static GList *read_templates (void); +static GList *read_template_files_from_dir (GList *templates, + const gchar *dirname); + +static lglTemplate *template_full_page (const gchar *page_size); + + + +/*===========================================*/ +/* Module initialization */ +/*===========================================*/ + +/** + * lgl_db_init: + * + * Initialize all libglabels subsystems. It is not necessary for an application to call + * lgl_db_init(), because libglabels will initialize on demand. An application programmer may + * choose to call lgl_db_init() at startup to minimize the impact of the first libglabels call + * on GUI response time. + * + * This function initializes its paper definitions, category definitions, and its template + * database.. It will search both system and user template directories to locate + * this data. + */ +void +lgl_db_init (void) +{ + lglPaper *paper_other; + lglCategory *category_user_defined; + GList *page_sizes; + GList *p; + + /* + * Paper definitions + */ + if (!papers) + { + + papers = read_papers (); + + /* Create and append an "Other" entry. */ + paper_other = lgl_paper_new ("Other", _("Other"), 0.0, 0.0, NULL); + papers = g_list_append (papers, paper_other); + + } + + /* + * Categories + */ + if (!categories) + { + categories = read_categories (); + + /* Create and append a "User defined" entry. */ + category_user_defined = lgl_category_new ("user-defined", _("User defined")); + categories = g_list_append (categories, category_user_defined); + } + + /* + * Templates + */ + if (!templates) + { + + templates = read_templates (); + + /* Create and append generic full page templates. */ + page_sizes = lgl_db_get_paper_id_list (); + for ( p=page_sizes; p != NULL; p=p->next ) + { + if ( !lgl_db_is_paper_id_other (p->data) ) + { + templates = g_list_append (templates, + template_full_page (p->data)); + } + } + lgl_db_free_paper_id_list (page_sizes); + + init_template_cache (); + } +} + + + +/*===========================================*/ +/* Paper db functions. */ +/*===========================================*/ + +/** + * lgl_db_get_paper_id_list: + * + * Get a list of all paper ids known to libglabels. + * + * Returns: a list of paper ids. + * + */ +GList * +lgl_db_get_paper_id_list (void) +{ + GList *ids = NULL; + GList *p; + lglPaper *paper; + + if (!papers) + { + lgl_db_init (); + } + + for ( p=papers; p != NULL; p=p->next ) + { + paper = (lglPaper *)p->data; + ids = g_list_append (ids, g_strdup (paper->id)); + } + + return ids; +} + + +/** + * lgl_db_free_paper_id_list: + * @ids: List of id strings to be freed. + * + * Free up all storage associated with an id list obtained with + * lgl_db_get_paper_id_list(). + * + */ +void +lgl_db_free_paper_id_list (GList *ids) +{ + GList *p; + + for (p = ids; p != NULL; p = p->next) + { + g_free (p->data); + p->data = NULL; + } + + g_list_free (ids); +} + + +/** + * lgl_db_get_paper_name_list: + * + * Get a list of all localized paper names known to libglabels. + * + * Returns: a list of localized paper names. + * + */ +GList * +lgl_db_get_paper_name_list (void) +{ + GList *names = NULL; + GList *p; + lglPaper *paper; + + if (!papers) + { + lgl_db_init (); + } + + for ( p=papers; p != NULL; p=p->next ) + { + paper = (lglPaper *)p->data; + names = g_list_append (names, g_strdup (paper->name)); + } + + return names; +} + + +/** + * lgl_db_free_paper_name_list: + * @names: List of localized paper name strings to be freed. + * + * Free up all storage associated with a name list obtained with + * lgl_db_get_paper_name_list(). + * + */ +void +lgl_db_free_paper_name_list (GList *names) +{ + GList *p; + + for (p = names; p != NULL; p = p->next) + { + g_free (p->data); + p->data = NULL; + } + + g_list_free (names); +} + + +/** + * lgl_db_lookup_paper_from_name: + * @name: localized paper name string + * + * Lookup paper definition from localized paper name string. + * + * Returns: pointer to a newly allocated #lglPaper structure. + * + */ +lglPaper * +lgl_db_lookup_paper_from_name (const gchar *name) +{ + GList *p; + lglPaper *paper; + + if (!papers) + { + lgl_db_init (); + } + + if (name == NULL) + { + /* If no name, return first paper as a default */ + return lgl_paper_dup ((lglPaper *) papers->data); + } + + for (p = papers; p != NULL; p = p->next) + { + paper = (lglPaper *) p->data; + if (UTF8_EQUAL (paper->name, name)) + { + return lgl_paper_dup (paper); + } + } + + return NULL; +} + + +/** + * lgl_db_lookup_paper_from_id: + * @id: paper id string + * + * Lookup paper definition from id string. + * + * Returns: pointer to a newly allocated #lglPaper structure. + * + */ +lglPaper * +lgl_db_lookup_paper_from_id (const gchar *id) +{ + GList *p; + lglPaper *paper; + + if (!papers) + { + lgl_db_init (); + } + + if (id == NULL) + { + /* If no id, return first paper as a default */ + return lgl_paper_dup ((lglPaper *) papers->data); + } + + for (p = papers; p != NULL; p = p->next) + { + paper = (lglPaper *) p->data; + if (ASCII_EQUAL (paper->id, id)) + { + return lgl_paper_dup (paper); + } + } + + return NULL; +} + + +/** + * lgl_db_lookup_paper_id_from_name: + * @name: localized paper name stringp + * + * Lookup paper name string from localized paper name string. + * + * Returns: pointer to a newly allocated id string. + * + */ +gchar * +lgl_db_lookup_paper_id_from_name (const gchar *name) +{ + lglPaper *paper = NULL; + gchar *id = NULL; + + if (name != NULL) + { + paper = lgl_db_lookup_paper_from_name (name); + if ( paper != NULL ) + { + id = g_strdup (paper->id); + lgl_paper_free (paper); + paper = NULL; + } + } + + return id; +} + + +/** + * lgl_db_lookup_paper_name_from_id: + * @id: paper id string + * + * Lookup localized paper name string from paper id string. + * + * Returns: pointer to a newly allocated localized paper name string. + * + */ +gchar * +lgl_db_lookup_paper_name_from_id (const gchar *id) +{ + lglPaper *paper = NULL; + gchar *name = NULL; + + if (id != NULL) + { + paper = lgl_db_lookup_paper_from_id (id); + if ( paper != NULL ) + { + name = g_strdup (paper->name); + lgl_paper_free (paper); + paper = NULL; + } + } + + return name; +} + + +/** + * lgl_db_is_paper_id_known: + * @id: paper id to test + * + * Determine if given paper id is known to libglabels. + * + * Returns: TRUE if id is known, otherwise FALSE. + * + */ +gboolean +lgl_db_is_paper_id_known (const gchar *id) +{ + GList *p; + lglPaper *paper; + + if (!papers) + { + lgl_db_init (); + } + + if (id == NULL) + { + return FALSE; + } + + for (p = papers; p != NULL; p = p->next) + { + paper = (lglPaper *) p->data; + if (ASCII_EQUAL (paper->id, id)) + { + return TRUE; + } + } + + return FALSE; +} + +/** + * lgl_db_is_paper_id_other: + * @id: paper id to test + * + * Determine if given paper id is the special id "Other." + * + * Returns: TRUE if id is "Other", otherwise FALSE. + * + */ +gboolean +lgl_db_is_paper_id_other (const gchar *id) +{ + if (id == NULL) + { + return FALSE; + } + + return (ASCII_EQUAL (id, "Other")); +} + + +static GList * +read_papers (void) +{ + gchar *data_dir; + GList *papers = NULL; + + data_dir = LGL_SYSTEM_DATA_DIR; + papers = read_paper_files_from_dir (papers, data_dir); + g_free (data_dir); + + data_dir = LGL_USER_DATA_DIR; + papers = read_paper_files_from_dir (papers, data_dir); + g_free (data_dir); + + if (papers == NULL) { + g_critical (_("Unable to locate paper size definitions. Libglabels may not be installed correctly!")); + } + + return papers; +} + + +static GList * +read_paper_files_from_dir (GList *papers, + const gchar *dirname) +{ + GDir *dp; + const gchar *filename, *extension; + gchar *full_filename = NULL; + GError *gerror = NULL; + GList *new_papers = NULL; + + if (dirname == NULL) { + return papers; + } + + if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) { + return papers; + } + + dp = g_dir_open (dirname, 0, &gerror); + if (gerror != NULL) { + g_message ("cannot open data directory: %s", gerror->message ); + return papers; + } + + while ((filename = g_dir_read_name (dp)) != NULL) { + + extension = strrchr (filename, '.'); + + if (extension != NULL) { + + if ( ASCII_EQUAL (extension, ".paper") || + ASCII_EQUAL (filename, "paper-sizes.xml") ) + { + + full_filename = + g_build_filename (dirname, filename, NULL); + new_papers = + lgl_xml_paper_read_papers_from_file (full_filename); + g_free (full_filename); + + papers = g_list_concat (papers, new_papers); + new_papers = NULL; + + } + + } + + } + + g_dir_close (dp); + + return papers; +} + + +/** + * lgl_db_print_known_papers: + * + * For debugging purposes: print a list of all paper definitions known to + * libglabels. + * + */ +void +lgl_db_print_known_papers (void) +{ + GList *p; + lglPaper *paper; + + if (!papers) { + lgl_db_init (); + } + + g_print ("%s():\n", __FUNCTION__); + for (p = papers; p != NULL; p = p->next) { + paper = (lglPaper *) p->data; + + g_print ("PAPER id=\"%s\", name=\"%s\", width=%gpts, height=%gpts\n", + paper->id, paper->name, paper->width, paper->height); + + } + g_print ("\n"); + +} + + +/*===========================================*/ +/* Category db functions. */ +/*===========================================*/ + +/** + * lgl_db_get_category_id_list: + * + * Get a list of all category ids known to libglabels. + * + * Returns: a list of category ids. + * + */ +GList * +lgl_db_get_category_id_list (void) +{ + GList *ids = NULL; + GList *p; + lglCategory *category; + + if (!categories) + { + lgl_db_init (); + } + + for ( p=categories; p != NULL; p=p->next ) + { + category = (lglCategory *)p->data; + ids = g_list_append (ids, g_strdup (category->id)); + } + + return ids; +} + + +/** + * lgl_db_free_category_id_list: + * @ids: List of id strings to be freed. + * + * Free up all storage associated with an id list obtained with + * lgl_db_get_category_id_list(). + * + */ +void +lgl_db_free_category_id_list (GList *ids) +{ + GList *p; + + for (p = ids; p != NULL; p = p->next) + { + g_free (p->data); + p->data = NULL; + } + + g_list_free (ids); +} + + +/** + * lgl_db_get_category_name_list: + * + * Get a list of all localized category names known to libglabels. + * + * Returns: a list of localized category names. + * + */ +GList * +lgl_db_get_category_name_list (void) +{ + GList *names = NULL; + GList *p; + lglCategory *category; + + if (!categories) + { + lgl_db_init (); + } + + for ( p=categories; p != NULL; p=p->next ) + { + category = (lglCategory *)p->data; + names = g_list_append (names, g_strdup (category->name)); + } + + return names; +} + + +/** + * lgl_db_free_category_name_list: + * @names: List of localized category name strings to be freed. + * + * Free up all storage associated with a name list obtained with + * lgl_db_get_category_name_list(). + * + */ +void +lgl_db_free_category_name_list (GList *names) +{ + GList *p; + + for (p = names; p != NULL; p = p->next) + { + g_free (p->data); + p->data = NULL; + } + + g_list_free (names); +} + + +/** + * lgl_db_lookup_category_from_name: + * @name: localized category name string + * + * Lookup category definition from localized category name string. + * + * Returns: pointer to a newly allocated #lglCategory structure. + * + */ +lglCategory * +lgl_db_lookup_category_from_name (const gchar *name) +{ + GList *p; + lglCategory *category; + + if (!categories) + { + lgl_db_init (); + } + + if (name == NULL) + { + /* If no name, return first category as a default */ + return lgl_category_dup ((lglCategory *) categories->data); + } + + for (p = categories; p != NULL; p = p->next) + { + category = (lglCategory *) p->data; + if (UTF8_EQUAL (category->name, name)) + { + return lgl_category_dup (category); + } + } + + return NULL; +} + + +/** + * lgl_db_lookup_category_from_id: + * @id: category id string + * + * Lookup category definition from id string. + * + * Returns: pointer to a newly allocated #lglCategory structure. + * + */ +lglCategory * +lgl_db_lookup_category_from_id (const gchar *id) +{ + GList *p; + lglCategory *category; + + if (!categories) + { + lgl_db_init (); + } + + if (id == NULL) + { + /* If no id, return first category as a default */ + return lgl_category_dup ((lglCategory *) categories->data); + } + + for (p = categories; p != NULL; p = p->next) + { + category = (lglCategory *) p->data; + if (ASCII_EQUAL (category->id, id)) + { + return lgl_category_dup (category); + } + } + + return NULL; +} + + +/** + * lgl_db_lookup_category_id_from_name: + * @name: localized category name stringp + * + * Lookup category name string from localized category name string. + * + * Returns: pointer to a newly allocated id string. + * + */ +gchar * +lgl_db_lookup_category_id_from_name (const gchar *name) +{ + lglCategory *category = NULL; + gchar *id = NULL; + + if (name != NULL) + { + category = lgl_db_lookup_category_from_name (name); + if ( category != NULL ) + { + id = g_strdup (category->id); + lgl_category_free (category); + category = NULL; + } + } + + return id; +} + + +/** + * lgl_db_lookup_category_name_from_id: + * @id: category id string + * + * Lookup localized category name string from category id string. + * + * Returns: pointer to a newly allocated localized category name string. + * + */ +gchar * +lgl_db_lookup_category_name_from_id (const gchar *id) +{ + lglCategory *category = NULL; + gchar *name = NULL; + + if (id != NULL) + { + category = lgl_db_lookup_category_from_id (id); + if ( category != NULL ) + { + name = g_strdup (category->name); + lgl_category_free (category); + category = NULL; + } + } + + return name; +} + + +/** + * lgl_db_is_category_id_known: + * @id: category id to test + * + * Determine if given category id is known to libglabels. + * + * Returns: TRUE if id is known, otherwise FALSE. + * + */ +gboolean +lgl_db_is_category_id_known (const gchar *id) +{ + GList *p; + lglCategory *category; + + if (!categories) + { + lgl_db_init (); + } + + if (id == NULL) + { + return FALSE; + } + + for (p = categories; p != NULL; p = p->next) + { + category = (lglCategory *) p->data; + if (ASCII_EQUAL (category->id, id)) + { + return TRUE; + } + } + + return FALSE; +} + + +static GList * +read_categories (void) +{ + gchar *data_dir; + GList *categories = NULL; + + data_dir = LGL_SYSTEM_DATA_DIR; + categories = read_category_files_from_dir (categories, data_dir); + g_free (data_dir); + + data_dir = LGL_USER_DATA_DIR; + categories = read_category_files_from_dir (categories, data_dir); + g_free (data_dir); + + if (categories == NULL) { + g_critical (_("Unable to locate category definitions. Libglabels may not be installed correctly!")); + } + + return categories; +} + + +static GList * +read_category_files_from_dir (GList *categories, + const gchar *dirname) +{ + GDir *dp; + const gchar *filename, *extension; + gchar *full_filename = NULL; + GError *gerror = NULL; + GList *new_categories = NULL; + + if (dirname == NULL) { + return categories; + } + + if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) { + return categories; + } + + dp = g_dir_open (dirname, 0, &gerror); + if (gerror != NULL) { + g_message ("cannot open data directory: %s", gerror->message ); + return categories; + } + + while ((filename = g_dir_read_name (dp)) != NULL) { + + extension = strrchr (filename, '.'); + + if (extension != NULL) { + + if ( ASCII_EQUAL (extension, ".category") || + ASCII_EQUAL (filename, "categories.xml") ) + { + + full_filename = + g_build_filename (dirname, filename, NULL); + new_categories = + lgl_xml_category_read_categories_from_file (full_filename); + g_free (full_filename); + + categories = g_list_concat (categories, new_categories); + new_categories = NULL; + + } + + } + + } + + g_dir_close (dp); + + return categories; +} + + +/** + * lgl_db_print_known_categories: + * + * For debugging purposes: print a list of all category definitions known to + * libglabels. + * + */ +void +lgl_db_print_known_categories (void) +{ + GList *p; + lglCategory *category; + + if (!categories) { + lgl_db_init (); + } + + g_print ("%s():\n", __FUNCTION__); + for (p = categories; p != NULL; p = p->next) { + category = (lglCategory *) p->data; + + g_print ("CATEGORY id=\"%s\", name=\"%s\"\n", category->id, category->name); + + } + g_print ("\n"); + +} + + + +/*===========================================*/ +/* Brand db functions. */ +/*===========================================*/ + +/** + * lgl_db_get_brand_list: + * @paper_id: If non NULL, limit results to given page size. + * @category_id: If non NULL, limit results to given template category. + * + * Get a list of all valid brands of templates in the template database. + * Results can be filtered by page size and/or template category. A list of valid page + * sizes can be obtained using lgl_db_get_paper_id_list(). A list of valid template + * categories can be obtained using lgl_db_get_category_id_list(). + * + * Returns: a list of brands + */ +GList * +lgl_db_get_brand_list (const gchar *paper_id, + const gchar *category_id) +{ + GList *p_tmplt, *p_alias; + lglTemplate *template; + lglTemplateAlias *alias; + GList *brands = NULL; + + if (!templates) + { + lgl_db_init (); + } + + for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) + { + template = (lglTemplate *) p_tmplt->data; + if (lgl_template_does_page_size_match (template, paper_id) && + lgl_template_does_category_match (template, category_id)) + { + for (p_alias = template->aliases; p_alias != NULL; + p_alias = p_alias->next) + { + alias = (lglTemplateAlias *)p_alias->data; + + if ( !g_list_find_custom (brands, alias->brand, + (GCompareFunc)lgl_str_utf8_casecmp) ) + { + brands = g_list_insert_sorted (brands, + g_strdup (alias->brand), + (GCompareFunc)lgl_str_utf8_casecmp); + } + } + } + } + + return brands; +} + + +/** + * lgl_db_free_brand_list: + * @brands: List of template brand strings to be freed. + * + * Free up all storage associated with a list of template names obtained with + * lgl_db_get_brand_list(). + * + */ +void +lgl_db_free_brand_list (GList *brands) +{ + GList *p_brand; + + for (p_brand = brands; p_brand != NULL; p_brand = p_brand->next) + { + g_free (p_brand->data); + p_brand->data = NULL; + } + + g_list_free (brands); +} + + + +/*===========================================*/ +/* Template db functions. */ +/*===========================================*/ + +/** + * lgl_db_register_template: + * @template: Pointer to a template structure to add to database. + * + * Register a template. This function adds a template to the template database. + * The template will be stored in an individual XML file in the user template directory. + * + * Returns: Status of registration attempt (#lglDbRegStatus) + */ +lglDbRegStatus +lgl_db_register_template (const lglTemplate *template) +{ + lglTemplate *template_copy; + gchar *dir, *filename, *abs_filename; + gint bytes_written; + + if (!templates) + { + lgl_db_init (); + } + + if (lgl_db_does_template_exist (template->brand, template->part)) + { + return LGL_DB_REG_BRAND_PART_EXISTS; + } + + if (lgl_db_is_paper_id_known (template->paper_id)) + { + dir = LGL_USER_DATA_DIR; + mkdir (dir, 0775); /* Try to make sure directory exists. */ + filename = g_strdup_printf ("%s_%s.template", template->brand, template->part); + abs_filename = g_build_filename (dir, filename, NULL); + bytes_written = lgl_xml_template_write_template_to_file (template, abs_filename); + g_free (dir); + g_free (filename); + g_free (abs_filename); + + if (bytes_written > 0) + { + template_copy = lgl_template_dup (template); + lgl_template_add_category (template_copy, "user-defined"); + templates = g_list_append (templates, template_copy); + add_to_template_cache (template_copy); + return LGL_DB_REG_OK; + } + else + { + return LGL_DB_REG_FILE_WRITE_ERROR; + } + } + else + { + g_message ("Cannot register new template with unknown page size."); + return LGL_DB_REG_BAD_PAPER_ID; + } + +} + + +/** + * lgl_db_does_template_exist: + * @brand: Brand name. + * @part: Part name/number. + * + * This function tests whether a template with the given brand and part name/number exists. + * + * Returns: TRUE if such a template exists in the database. + */ +gboolean +lgl_db_does_template_exist (const gchar *brand, + const gchar *part) +{ + GList *p_tmplt, *p_alias; + lglTemplate *template; + lglTemplateAlias *alias; + + if (!templates) + { + lgl_db_init (); + } + + if ((brand == NULL) || (part == NULL)) + { + return FALSE; + } + + for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) + { + template = (lglTemplate *) p_tmplt->data; + for (p_alias = template->aliases; p_alias != NULL; p_alias = p_alias->next) + { + alias = (lglTemplateAlias *)p_alias->data; + + if ( UTF8_EQUAL (brand, alias->brand) && + UTF8_EQUAL (part, alias->part) ) + { + return TRUE; + } + } + } + + return FALSE; +} + + +/** + * lgl_db_does_template_name_exist: + * @name: name string + * + * This function test whether a template with the given name exists. + * + * Returns: TRUE if such a template exists in the database. + * + */ +gboolean +lgl_db_does_template_name_exist (const gchar *name) +{ + GList *p_tmplt, *p_alias; + lglTemplate *template; + lglTemplateAlias *alias; + gchar *candidate_name; + + if (!templates) + { + lgl_db_init (); + } + + if (name == NULL) + { + return FALSE; + } + + for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) + { + template = (lglTemplate *) p_tmplt->data; + for (p_alias = template->aliases; p_alias != NULL; p_alias = p_alias->next) + { + alias = (lglTemplateAlias *)p_alias->data; + candidate_name = g_strdup_printf ("%s %s", alias->brand, alias->part); + + if ( UTF8_EQUAL (candidate_name, name) ) { + g_free (candidate_name); + return TRUE; + } + g_free (candidate_name); + } + } + + return FALSE; +} + + +/** + * lgl_db_get_template_name_list_unique: + * @brand: If non NULL, limit results to given brand + * @paper_id: If non NULL, limit results to given page size. + * @category_id: If non NULL, limit results to given template category. + * + * Get a list of valid names of unique templates in the template database. Results + * can be filtered by page size and/or template category. A list of valid page sizes + * can be obtained using lgl_db_get_paper_id_list(). A list of valid template categories + * can be obtained using lgl_db_get_category_id_list(). + * + * This function differs from lgl_db_get_template_name_list_all(), because it does not + * return multiple names for the same template. + * + * Returns: a list of template names. + */ +GList * +lgl_db_get_template_name_list_unique (const gchar *brand, + const gchar *paper_id, + const gchar *category_id) +{ + GList *p_tmplt; + lglTemplate *template; + gchar *name; + GList *names = NULL; + + if (!templates) + { + lgl_db_init (); + } + + for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) + { + template = (lglTemplate *) p_tmplt->data; + + if (lgl_template_does_brand_match (template, brand) && + lgl_template_does_page_size_match (template, paper_id) && + lgl_template_does_category_match (template, category_id)) + { + name = g_strdup_printf ("%s %s", template->brand, template->part); + names = g_list_insert_sorted (names, name, + (GCompareFunc)g_utf8_collate); + } + } + + return names; +} + + +/** + * lgl_db_get_template_name_list_all: + * @brand: If non NULL, limit results to given brand + * @paper_id: If non NULL, limit results to given page size. + * @category_id: If non NULL, limit results to given template category. + * + * Get a list of all valid names and aliases of templates in the template database. + * Results can be filtered by page size and/or template category. A list of valid page + * sizes can be obtained using lgl_db_get_paper_id_list(). A list of valid template + * categories can be obtained using lgl_db_get_category_id_list(). + * + * This function differs from lgl_db_get_template_name_list_unique(), because it will + * return multiple names for the same template. + * + * Returns: a list of template names and aliases. + */ +GList * +lgl_db_get_template_name_list_all (const gchar *brand, + const gchar *paper_id, + const gchar *category_id) +{ + GList *p_tmplt, *p_alias; + lglTemplate *template; + lglTemplateAlias *alias; + gchar *name; + GList *names = NULL; + + if (!templates) + { + lgl_db_init (); + } + + for (p_tmplt = templates; p_tmplt != NULL; p_tmplt = p_tmplt->next) + { + template = (lglTemplate *) p_tmplt->data; + if (lgl_template_does_page_size_match (template, paper_id) && + lgl_template_does_category_match (template, category_id)) + { + for (p_alias = template->aliases; p_alias != NULL; + p_alias = p_alias->next) + { + alias = (lglTemplateAlias *)p_alias->data; + + if ( !brand || UTF8_EQUAL( alias->brand, brand) ) + { + name = g_strdup_printf ("%s %s", alias->brand, alias->part); + names = g_list_insert_sorted (names, name, + (GCompareFunc)g_utf8_collate); + } + } + } + } + + return names; +} + + +/** + * lgl_db_free_template_name_list: + * @names: List of template name strings to be freed. + * + * Free up all storage associated with a list of template names obtained with + * lgl_db_get_template_name_list_all() or lgl_db_get_template_name_list_unique(). + * + */ +void +lgl_db_free_template_name_list (GList *names) +{ + GList *p_name; + + for (p_name = names; p_name != NULL; p_name = p_name->next) + { + g_free (p_name->data); + p_name->data = NULL; + } + + g_list_free (names); +} + + +/** + * lgl_db_lookup_template_from_name: + * @name: name string + * + * Lookup template in template database from name string. + * + * Returns: pointer to a newly allocated #lglTemplate structure. + * + */ +lglTemplate * +lgl_db_lookup_template_from_name (const gchar *name) +{ + GList *p_alias; + lglTemplate *template; + lglTemplateAlias *alias; + gchar *candidate_name; + lglTemplate *new_template; + + if (!templates) + { + lgl_db_init (); + } + + if (name == NULL) + { + /* If no name, return first template as a default */ + return lgl_template_dup ((lglTemplate *) templates->data); + } + + template = g_hash_table_lookup (template_cache, name); + + if (template) + { + for (p_alias = template->aliases; p_alias != NULL; p_alias = p_alias->next) + { + alias = (lglTemplateAlias *)p_alias->data; + candidate_name = g_strdup_printf ("%s %s", alias->brand, alias->part); + + if ( UTF8_EQUAL (candidate_name, name) ) + { + g_free (candidate_name); + new_template = lgl_template_dup (template); + g_free (new_template->brand); + new_template->brand = g_strdup (alias->brand); + g_free (new_template->part); + new_template->part = g_strdup (alias->part); + return new_template; + } + + g_free (candidate_name); + } + } + + /* No matching template has been found so return the first template */ + return lgl_template_dup ((lglTemplate *) templates->data); +} + + +static void +init_template_cache (void) +{ + GList *p_tmplt, *p_alias; + lglTemplate *template; + lglTemplateAlias *alias; + gchar *name; + + template_cache = g_hash_table_new (g_str_hash, g_str_equal); + + for ( p_tmplt=templates; p_tmplt != NULL; p_tmplt=p_tmplt->next ) + { + template = (lglTemplate *) p_tmplt->data; + + for ( p_alias=template->aliases; p_alias != NULL; p_alias=p_alias->next ) + { + alias = (lglTemplateAlias *)p_alias->data; + name = g_strdup_printf ("%s %s", alias->brand, alias->part); + + g_hash_table_insert (template_cache, name, template); + } + } +} + + +static void +add_to_template_cache (lglTemplate *template) +{ + GList *p_alias; + lglTemplateAlias *alias; + gchar *name; + + for ( p_alias=template->aliases; p_alias != NULL; p_alias=p_alias->next ) + { + alias = (lglTemplateAlias *)p_alias->data; + name = g_strdup_printf ("%s %s", alias->brand, alias->part); + + g_hash_table_insert (template_cache, name, template); + } +} + + +static GList * +read_templates (void) +{ + gchar *data_dir; + GList *templates = NULL; + GList *p; + lglTemplate *template; + + /* + * User defined templates. Add to user-defined category. + */ + data_dir = LGL_USER_DATA_DIR; + templates = read_template_files_from_dir (templates, data_dir); + g_free (data_dir); + for ( p=templates; p != NULL; p=p->next ) + { + template = (lglTemplate *)p->data; + lgl_template_add_category (template, "user-defined"); + } + + /* + * System templates. + */ + data_dir = LGL_SYSTEM_DATA_DIR; + templates = read_template_files_from_dir (templates, data_dir); + g_free (data_dir); + + if (templates == NULL) + { + g_critical (_("Unable to locate any template files. Libglabels may not be installed correctly!")); + } + + return templates; +} + + +static GList * +read_template_files_from_dir (GList *templates, + const gchar *dirname) +{ + GDir *dp; + const gchar *filename, *extension, *extension2; + gchar *full_filename = NULL; + GError *gerror = NULL; + GList *new_templates = NULL; + + if (dirname == NULL) + return templates; + + if (!g_file_test (dirname, G_FILE_TEST_EXISTS)) + { + return templates; + } + + dp = g_dir_open (dirname, 0, &gerror); + if (gerror != NULL) + { + g_message ("cannot open data directory: %s", gerror->message ); + return templates; + } + + while ((filename = g_dir_read_name (dp)) != NULL) + { + + extension = strrchr (filename, '.'); + extension2 = strrchr (filename, '-'); + + if ( (extension && ASCII_EQUAL (extension, ".template")) || + (extension2 && ASCII_EQUAL (extension2, "-templates.xml")) ) + { + + full_filename = g_build_filename (dirname, filename, NULL); + new_templates = + lgl_xml_template_read_templates_from_file (full_filename); + g_free (full_filename); + + templates = g_list_concat (templates, new_templates); + new_templates = NULL; + } + + } + + g_dir_close (dp); + + return templates; +} + + +static lglTemplate * +template_full_page (const gchar *paper_id) +{ + lglPaper *paper = NULL; + lglTemplate *template = NULL; + lglTemplateFrame *frame = NULL; + gchar *part; + gchar *desc; + + g_return_val_if_fail (paper_id, NULL); + + paper = lgl_db_lookup_paper_from_id (paper_id); + if ( paper == NULL ) + { + return NULL; + } + + part = g_strdup_printf ("%s-Full-Page", paper->id); + desc = g_strdup_printf (_("Generic %s full page template"), paper->name); + + template = lgl_template_new ("Generic", part, desc, + paper_id, paper->width, paper->height); + + + frame = lgl_template_frame_rect_new ("0", + paper->width, + paper->height, + 0.0, + 0.0, + 0.0); + lgl_template_add_frame (template, frame); + + lgl_template_frame_add_layout (frame, lgl_template_layout_new (1, 1, 0., 0., 0., 0.)); + + lgl_template_frame_add_markup (frame, lgl_template_markup_margin_new (9.0)); + + g_free (desc); + desc = NULL; + lgl_paper_free (paper); + paper = NULL; + + return template; +} + + +/** + * lgl_db_print_known_templates: + * + * Print all known templates (for debugging purposes). + * + */ +void +lgl_db_print_known_templates (void) +{ + GList *p; + lglTemplate *template; + + g_print ("%s():\n", __FUNCTION__); + for (p=templates; p!=NULL; p=p->next) + { + template = (lglTemplate *)p->data; + + g_print("TEMPLATE brand=\"%s\", part=\"%s\", description=\"%s\"\n", + template->brand, template->part, template->description); + + } + g_print ("\n"); + +} + +/** + * lgl_db_print_aliases: + * @template: template + * + * Print all aliases of a template (for debugging purposes). + * + */ +void +lgl_db_print_aliases (const lglTemplate *template) +{ + GList *p; + lglTemplateAlias *alias; + + g_print ("%s():\n", __FUNCTION__); + for (p=template->aliases; p!=NULL; p=p->next) + { + alias = (lglTemplateAlias *)p->data; + + g_print("Alias: brand=\"%s\", part=\"%s\"\n", alias->brand, alias->part); + + } + g_print ("\n"); + +} + + diff --git a/libglabels/db.h b/libglabels/db.h new file mode 100644 index 00000000..c6b6f7ef --- /dev/null +++ b/libglabels/db.h @@ -0,0 +1,148 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (LIBGLABELS) Template library for GLABELS + * + * db.h: template db module header file + * + * Copyright (C) 2006-2007 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __DB_H__ +#define __DB_H__ + +#include +#include + +#include "paper.h" +#include "category.h" +#include "template.h" + +G_BEGIN_DECLS + +typedef enum +{ + LGL_DB_REG_OK = 0, + LGL_DB_REG_BAD_PAPER_ID = -1, + LGL_DB_REG_BRAND_PART_EXISTS = -2, + LGL_DB_REG_FILE_WRITE_ERROR = -3 +} lglDbRegStatus; + +/* + * Module initialization + */ +void lgl_db_init (void); + + +/* + * Paper + */ +GList *lgl_db_get_paper_id_list (void); + +void lgl_db_free_paper_id_list (GList *ids); + +GList *lgl_db_get_paper_name_list (void); + +void lgl_db_free_paper_name_list (GList *names); + +lglPaper *lgl_db_lookup_paper_from_name (const gchar *name); + +lglPaper *lgl_db_lookup_paper_from_id (const gchar *id); + +gchar *lgl_db_lookup_paper_id_from_name (const gchar *name); + +gchar *lgl_db_lookup_paper_name_from_id (const gchar *id); + +gboolean lgl_db_is_paper_id_known (const gchar *id); + +gboolean lgl_db_is_paper_id_other (const gchar *id); + + + +/* + * Template categories + */ +GList *lgl_db_get_category_id_list (void); + +void lgl_db_free_category_id_list (GList *ids); + +GList *lgl_db_get_category_name_list (void); + +void lgl_db_free_category_name_list (GList *names); + +lglCategory *lgl_db_lookup_category_from_name (const gchar *name); + +lglCategory *lgl_db_lookup_category_from_id (const gchar *id); + +gchar *lgl_db_lookup_category_id_from_name (const gchar *name); + +gchar *lgl_db_lookup_category_name_from_id (const gchar *id); + +gboolean lgl_db_is_category_id_known (const gchar *id); + + +/* + * Template brands + */ +GList *lgl_db_get_brand_list (const gchar *paper_id, + const gchar *category_id); + +void lgl_db_free_brand_list (GList *brands); + + +/* + * Templates + */ +lglDbRegStatus lgl_db_register_template (const lglTemplate *template); + +gboolean lgl_db_does_template_exist (const gchar *brand, + const gchar *part); + +gboolean lgl_db_does_template_name_exist (const gchar *name); + +GList *lgl_db_get_template_name_list_unique (const gchar *brand, + const gchar *paper_id, + const gchar *category_id); + +GList *lgl_db_get_template_name_list_all (const gchar *brand, + const gchar *paper_id, + const gchar *category_id); + +void lgl_db_free_template_name_list (GList *names); + +lglTemplate *lgl_db_lookup_template_from_name (const gchar *name); + + +/* + * Debugging functions + */ +void lgl_db_print_known_papers (void); + +void lgl_db_print_known_categories (void); + +void lgl_db_print_known_templates (void); + +void lgl_db_print_aliases (const lglTemplate *template); + + + +G_END_DECLS + +#endif diff --git a/libglabels/enums.h b/libglabels/enums.h new file mode 100644 index 00000000..d139dc25 --- /dev/null +++ b/libglabels/enums.h @@ -0,0 +1,49 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * enums.h: common libGLabels enumerations header file + * + * Copyright (C) 2003, 2004 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __ENUMS_H__ +#define __ENUMS_H__ + +#include + +G_BEGIN_DECLS + +/* Units of distance */ +typedef enum { + LGL_UNITS_POINT, /* encoded as "pt" */ + LGL_UNITS_INCH, /* encoded as "in" */ + LGL_UNITS_MM, /* encoded as "mm" */ + LGL_UNITS_CM, /* encoded as "cm" */ + LGL_UNITS_PICA, /* encoded as "pc" */ + + LGL_UNITS_FIRST = LGL_UNITS_POINT, + LGL_UNITS_LAST = LGL_UNITS_PICA, +} lglUnitsType; + + +G_END_DECLS + + +#endif /* __ENUMS_H__ */ diff --git a/libglabels/libglabels-private.h b/libglabels/libglabels-private.h new file mode 100644 index 00000000..dd8bda83 --- /dev/null +++ b/libglabels/libglabels-private.h @@ -0,0 +1,46 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * libglabels-private.h: libglabels private header file + * + * Copyright (C) 2004 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __LIBGLABELS_PRIVATE_H__ +#define __LIBGLABELS_PRIVATE_H__ + +#include +#include +#include + +#include "str.h" + +/* Data system and user data directories. (must free w/ g_free()) */ +#define LGL_SYSTEM_DATA_DIR g_build_filename (LIBGLABELS_TEMPLATE_DIR, NULL) +#define LGL_USER_DATA_DIR g_build_filename (g_get_home_dir (), ".glabels", NULL) + +#undef G_LOG_DOMAIN +#define G_LOG_DOMAIN "LibGlabels" + +#define UTF8_EQUAL(s1,s2) (!lgl_str_utf8_casecmp (s1, s2)) +#define ASCII_EQUAL(s1,s2) (!g_ascii_strcasecmp (s1, s2)) + + +#endif /* __LIBGLABELS_PRIVATE_H__ */ diff --git a/libglabels/libglabels.h b/libglabels/libglabels.h new file mode 100644 index 00000000..c74fbe01 --- /dev/null +++ b/libglabels/libglabels.h @@ -0,0 +1,40 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * libglabels.h: libglabels master header file + * + * Copyright (C) 2004 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __LIBGLABELS_H__ +#define __LIBGLABELS_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif /* __LIBGLABELS_H__ */ diff --git a/libglabels/libglabels.pc.in b/libglabels/libglabels.pc.in new file mode 100644 index 00000000..c16e8f47 --- /dev/null +++ b/libglabels/libglabels.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libglabels +Description: GLabels Template Library +Requires: glib-2.0 libxml-2.0 +Version: @VERSION@ +Libs: -L${libdir} -lglabels +Cflags: -I${includedir} + diff --git a/libglabels/paper.c b/libglabels/paper.c new file mode 100644 index 00000000..98826c9b --- /dev/null +++ b/libglabels/paper.c @@ -0,0 +1,144 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * paper.c: paper module + * + * Copyright (C) 2003, 2004 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ +#include + +#include "paper.h" + +#include +#include +#include +#include +#include + +#include "libglabels-private.h" + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + + +/*===========================================*/ +/* Functions. */ +/*===========================================*/ + +/** + * lgl_paper_new: + * @id: Id of paper definition. (E.g. US-Letter, A4, etc.) Should be + * unique. + * @name: Localized name of paper. + * @width: Width of paper in points. + * @height: Height of paper in points. + * @pwg_size: PWG 5101.1-2002 size name. + * + * Allocates and constructs a new #lglPaper structure. + * + * Returns: a pointer to a newly allocated #lglPaper structure. + * + */ +lglPaper * +lgl_paper_new (gchar *id, + gchar *name, + gdouble width, + gdouble height, + gchar *pwg_size) +{ + lglPaper *paper; + + paper = g_new0 (lglPaper,1); + + paper->id = g_strdup (id); + paper->name = g_strdup (name); + paper->width = width; + paper->height = height; + paper->pwg_size = g_strdup (pwg_size); + + return paper; +} + + +/** + * lgl_paper_dup: + * @orig: #lglPaper structure to be duplicated. + * + * Duplicates an existing #lglPaper structure. + * + * Returns: a pointer to a newly allocated #lglPaper structure. + * + */ +lglPaper *lgl_paper_dup (const lglPaper *orig) +{ + lglPaper *paper; + + g_return_val_if_fail (orig, NULL); + + paper = g_new0 (lglPaper,1); + + paper->id = g_strdup (orig->id); + paper->name = g_strdup (orig->name); + paper->width = orig->width; + paper->height = orig->height; + paper->pwg_size = g_strdup (orig->pwg_size); + + return paper; +} + + +/** + * lgl_paper_free: + * @paper: pointer to #lglPaper structure to be freed. + * + * Free all memory associated with an existing #lglPaper structure. + * + */ +void lgl_paper_free (lglPaper *paper) +{ + + if ( paper != NULL ) { + + g_free (paper->id); + paper->id = NULL; + + g_free (paper->name); + paper->name = NULL; + + g_free (paper->pwg_size); + paper->pwg_size = NULL; + + g_free (paper); + } + +} + + diff --git a/libglabels/paper.h b/libglabels/paper.h new file mode 100644 index 00000000..0fb42388 --- /dev/null +++ b/libglabels/paper.h @@ -0,0 +1,65 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * paper.h: paper module header file + * + * Copyright (C) 2003, 2004 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __PAPER_H__ +#define __PAPER_H__ + +#include +#include + +G_BEGIN_DECLS + + +/* + * lglPaper structure + */ +typedef struct _lglPaper lglPaper; + +struct _lglPaper { + gchar *id; /* Unique ID of paper definition */ + gchar *name; /* Localized name of paper */ + gdouble width; /* Width (in points) */ + gdouble height; /* Height (in points) */ + gchar *pwg_size; /* PWG 5101.1-2002 size name */ +}; + + +/* + * Paper construction + */ +lglPaper *lgl_paper_new (gchar *id, + gchar *name, + gdouble width, + gdouble height, + gchar *pwg_size); + +lglPaper *lgl_paper_dup (const lglPaper *orig); + +void lgl_paper_free (lglPaper *paper); + + +G_END_DECLS + +#endif diff --git a/libglabels/str.c b/libglabels/str.c new file mode 100644 index 00000000..7c1f59a6 --- /dev/null +++ b/libglabels/str.c @@ -0,0 +1,84 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (LIBGLABELS) Template library for GLABELS + * + * str.c: libGLabels string utilities + * + * Copyright (C) 2007 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ +#include + +#include "str.h" + + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + + +/*===========================================*/ +/* Functions. */ +/*===========================================*/ + +/** + * lgl_str_utf8_casecmp: + * @s1: string to compare with s2. + * @s2: string to compare with s1. + * + * Compare two UTF-8 strings, ignoring the case of characters. + * + * This function should be used only on strings that are known to be encoded + * in UTF-8 or a compatible UTF-8 subset. + * + * Returns: 0 if the strings match, a negative value if s1 < s2, + * or a positive value if s1 > s2. + * + */ +gint +lgl_str_utf8_casecmp (const gchar *s1, + const gchar *s2) +{ + gchar *folded_s1; + gchar *folded_s2; + gint result; + + folded_s1 = g_utf8_casefold (s1, -1); + folded_s2 = g_utf8_casefold (s2, -1); + + result = g_utf8_collate (folded_s1, folded_s2); + + g_free (folded_s1); + g_free (folded_s2); + + return result; +} + + diff --git a/libglabels/str.h b/libglabels/str.h new file mode 100644 index 00000000..bc6312f7 --- /dev/null +++ b/libglabels/str.h @@ -0,0 +1,41 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (LIBGLABELS) Template library for GLABELS + * + * str.h: libGLabels string utilities header file + * + * Copyright (C) 2007 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __STR_H__ +#define __STR_H__ + +#include + +G_BEGIN_DECLS + +gint lgl_str_utf8_casecmp (const gchar *s1, + const gchar *s2); + +G_END_DECLS + + +#endif /* __STR_H__ */ diff --git a/libglabels/template.c b/libglabels/template.c new file mode 100644 index 00000000..f6d6d212 --- /dev/null +++ b/libglabels/template.c @@ -0,0 +1,1121 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (LIBGLABELS) Template library for GLABELS + * + * template.c: template module + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ +#include + +#include "template.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libglabels-private.h" + +#include "paper.h" + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static gint compare_origins (gconstpointer a, + gconstpointer b, + gpointer user_data); + +/*===========================================*/ +/* Functions. */ +/*===========================================*/ + +/** + * lgl_template_new: + * @brand: Template brand + * @part: Template part name/number + * @description: Template descriptions + * @paper_id: Page size id + * @page_width: Page width in points, set to zero unless paper_id="Other" + * @page_height: Page height in points, set to zero unless paper_id="Other" + * + * Create a new template structure, with the given top-level attributes. The + * created template will have no initial aliases, categories, or frames + * associated with it. See lgl_template_add_alias(), lgl_template_add_category(), + * and lgl_template_add_frame() to add these. + * + * Returns: pointer to a newly allocated #lglTemplate structure. + * + */ +lglTemplate * +lgl_template_new (const gchar *brand, + const gchar *part, + const gchar *description, + const gchar *paper_id, + gdouble page_width, + gdouble page_height) +{ + lglTemplate *template; + lglTemplateAlias *alias; + + template = g_new0 (lglTemplate,1); + + template->brand = g_strdup (brand); + template->part = g_strdup (part); + template->description = g_strdup (description); + template->paper_id = g_strdup (paper_id); + template->page_width = page_width; + template->page_height = page_height; + + /* Always include primary name in alias list. */ + template->aliases = NULL; + alias = lgl_template_alias_new (brand, part); + lgl_template_add_alias (template, alias); + + return template; +} + + +/** + * lgl_template_get_name: + * @template: Pointer to template structure to test + * + * This function returns the name of the given template. The name is the concetenation + * of the brand and part name/number. + * + * Returns: A pointer to a newly allocated name string. Should be freed with g_free(). + * + */ +gchar * +lgl_template_get_name (const lglTemplate *template) +{ + g_return_val_if_fail (template, NULL); + + return g_strdup_printf ("%s %s", template->brand, template->part); +} + + +/** + * lgl_template_do_templates_match: + * @template1: Pointer to 1st template structure to test + * @template2: Pointer to 2nd template structure to test + * + * This function tests if the given templates match. This is a simple test that only tests + * the brand and part name/number. It does not test if they are actually identical. + * + * Returns: TRUE if the two template matche. + * + */ +gboolean +lgl_template_do_templates_match (const lglTemplate *template1, + const lglTemplate *template2) +{ + g_return_val_if_fail (template1, FALSE); + g_return_val_if_fail (template2, FALSE); + + return (UTF8_EQUAL (template1->brand, template2->brand) && + UTF8_EQUAL (template1->part, template2->part)); +} + + +/** + * lgl_template_does_brand_match: + * @template: Pointer to template structure to test + * @brand: Brand string + * + * This function tests if the brand of the template matches the given brand. + * + * Returns: TRUE if the template matches the given brand. + * + */ +gboolean +lgl_template_does_brand_match (const lglTemplate *template, + const gchar *brand) +{ + g_return_val_if_fail (template, FALSE); + + /* NULL matches everything. */ + if (brand == NULL) + { + return TRUE; + } + + return UTF8_EQUAL (template->brand, brand); +} + + +/** + * lgl_template_does_page_size_match: + * @template: Pointer to template structure to test + * @paper_id: Page size ID string + * + * This function tests if the page size of the template matches the given ID. + * + * Returns: TRUE if the template matches the given page size ID. + * + */ +gboolean +lgl_template_does_page_size_match (const lglTemplate *template, + const gchar *paper_id) +{ + g_return_val_if_fail (template, FALSE); + + /* NULL matches everything. */ + if (paper_id == NULL) + { + return TRUE; + } + + return ASCII_EQUAL(paper_id, template->paper_id); +} + + +/** + * lgl_template_does_category_match: + * @template: Pointer to template structure to test + * @category_id: Category ID string + * + * This function tests if the given template belongs to the given category ID. + * + * Returns: TRUE if the template matches the given category ID. + * + */ +gboolean +lgl_template_does_category_match (const lglTemplate *template, + const gchar *category_id) +{ + GList *p; + + g_return_val_if_fail (template, FALSE); + + /* NULL matches everything. */ + if (category_id == NULL) + { + return TRUE; + } + + for ( p=template->category_ids; p != NULL; p=p->next ) + { + if (ASCII_EQUAL(category_id, p->data)) + { + return TRUE; + } + } + + return FALSE; +} + + +/** + * lgl_template_alias_new: + * @brand: Alias brand + * @part: Alias part name/number + * + * Create a new template alias structure, with the given brand and part number. + * + * Returns: pointer to a newly allocated #lglTemplateAlias structure. + * + */ +lglTemplateAlias * +lgl_template_alias_new (const gchar *brand, + const gchar *part) +{ + lglTemplateAlias *alias; + + alias = g_new0 (lglTemplateAlias,1); + + alias->brand = g_strdup (brand); + alias->part = g_strdup (part); + + return alias; +} + + +/** + * lgl_template_add_alias: + * @template: Pointer to template structure + * @alias: Alias string + * + * This function adds the given alias to a templates list of aliases. + * + */ +void +lgl_template_add_alias (lglTemplate *template, + lglTemplateAlias *alias) +{ + g_return_if_fail (template); + g_return_if_fail (alias); + + template->aliases = g_list_append (template->aliases, alias); +} + + +/** + * lgl_template_add_frame: + * @template: Pointer to template structure + * @frame: Pointer to frame structure + * + * This function adds the given frame structure to the template. Once added, + * the frame structure belongs to the given template; do not attempt to free + * it. + * + * Note: Currently glabels only supports a single frame per template. + * + */ +void +lgl_template_add_frame (lglTemplate *template, + lglTemplateFrame *frame) +{ + g_return_if_fail (template); + g_return_if_fail (frame); + + template->frames = g_list_append (template->frames, frame); +} + + +/** + * lgl_template_add_category: + * @template: Pointer to template structure + * @category_id: Category ID string + * + * This function adds the given category ID to a templates category list. + * + */ +void +lgl_template_add_category (lglTemplate *template, + const gchar *category_id) +{ + g_return_if_fail (template); + g_return_if_fail (category_id); + + template->category_ids = g_list_append (template->category_ids, + g_strdup (category_id)); +} + + +/** + * lgl_template_frame_rect_new: + * @id: ID of frame. (This should currently always be "0"). + * @w: width of frame in points. + * @h: height of frame in points. + * @r: radius of rounded corners in points. (Should be 0 for square corners.) + * @x_waste: Amount of overprint to allow in the horizontal direction. + * @y_waste: Amount of overprint to allow in the vertical direction. + * + * This function creates a new template frame for a rectangular label or card. + * + * Returns: Pointer to newly allocated #lglTemplateFrame structure. + * + */ +lglTemplateFrame * +lgl_template_frame_rect_new (const gchar *id, + gdouble w, + gdouble h, + gdouble r, + gdouble x_waste, + gdouble y_waste) +{ + lglTemplateFrame *frame; + + frame = g_new0 (lglTemplateFrame, 1); + + frame->shape = LGL_TEMPLATE_FRAME_SHAPE_RECT; + frame->rect.id = g_strdup (id); + + frame->rect.w = w; + frame->rect.h = h; + frame->rect.r = r; + frame->rect.x_waste = x_waste; + frame->rect.y_waste = y_waste; + + return frame; +} + + +/** + * lgl_template_frame_round_new: + * @id: ID of frame. (This should currently always be "0"). + * @r: radius of label in points. + * @waste: Amount of overprint to allow. + * + * This function creates a new template frame for a round label. + * + * Returns: Pointer to newly allocated #lglTemplateFrame structure. + * + */ +lglTemplateFrame * +lgl_template_frame_round_new (const gchar *id, + gdouble r, + gdouble waste) +{ + lglTemplateFrame *frame; + + frame = g_new0 (lglTemplateFrame, 1); + + frame->shape = LGL_TEMPLATE_FRAME_SHAPE_ROUND; + frame->round.id = g_strdup (id); + + frame->round.r = r; + frame->round.waste = waste; + + return frame; +} + + +/** + * lgl_template_frame_cd_new: + * @id: ID of frame. (This should currently always be "0"). + * @r1: outer radius of label in points. + * @r2: radius of center hole in points. + * @w: clip width of frame in points for business card CDs. Should be 0 for no clipping. + * @h: clip height of frame in points for business card CDs. Should be 0 for no clipping. + * @waste: Amount of overprint to allow. + * + * This function creates a new template frame for a CD/DVD label. + * + * Returns: Pointer to newly allocated #lglTemplateFrame structure. + * + */ +lglTemplateFrame * +lgl_template_frame_cd_new (const gchar *id, + gdouble r1, + gdouble r2, + gdouble w, + gdouble h, + gdouble waste) +{ + lglTemplateFrame *frame; + + frame = g_new0 (lglTemplateFrame, 1); + + frame->shape = LGL_TEMPLATE_FRAME_SHAPE_CD; + frame->cd.id = g_strdup (id); + + frame->cd.r1 = r1; + frame->cd.r2 = r2; + frame->cd.w = w; + frame->cd.h = h; + frame->cd.waste = waste; + + return frame; +} + + +/** + * lgl_template_frame_get_size: + * @frame: #lglTemplateFrame structure to query + * @w: pointer to location to receive width of frame + * @h: pointer to location to receive height of frame + * + * Get size (width and height) of given #lglTemplateFrame in points. + * + */ +void +lgl_template_frame_get_size (const lglTemplateFrame *frame, + gdouble *w, + gdouble *h) +{ + g_return_if_fail (frame); + + switch (frame->shape) { + case LGL_TEMPLATE_FRAME_SHAPE_RECT: + *w = frame->rect.w; + *h = frame->rect.h; + break; + case LGL_TEMPLATE_FRAME_SHAPE_ROUND: + *w = 2.0 * frame->round.r; + *h = 2.0 * frame->round.r; + break; + case LGL_TEMPLATE_FRAME_SHAPE_CD: + if (frame->cd.w == 0.0) { + *w = 2.0 * frame->cd.r1; + } else { + *w = frame->cd.w; + } + if (frame->cd.h == 0.0) { + *h = 2.0 * frame->cd.r1; + } else { + *h = frame->cd.h; + } + break; + default: + *w = 0.0; + *h = 0.0; + break; + } +} + + +/** + * lgl_template_frame_get_n_labels: + * @frame: #lglTemplateFrame structure to query + * + * Get total number of labels per sheet corresponding to the given frame. + * + * Returns: number of labels per sheet. + * + */ +gint +lgl_template_frame_get_n_labels (const lglTemplateFrame *frame) +{ + gint n_labels = 0; + GList *p; + lglTemplateLayout *layout; + + g_return_val_if_fail (frame, 0); + + for ( p=frame->all.layouts; p != NULL; p=p->next ) { + layout = (lglTemplateLayout *)p->data; + + n_labels += layout->nx * layout->ny; + } + + return n_labels; +} + + +/** + * lgl_template_frame_get_origins: + * @frame: #lglTemplateFrame structure to query + * + * Get an array of label origins for the given frame. These origins represent the + * upper left hand corner of each label on a page corresponding to the given frame. + * The origins will be ordered geometrically left to right and then top to bottom. + * The array should be freed using g_free(). + * + * Returns: A newly allocated array of #lglTemplateOrigin structures. + * + */ +lglTemplateOrigin * +lgl_template_frame_get_origins (const lglTemplateFrame *frame) +{ + gint i_label, n_labels, ix, iy; + lglTemplateOrigin *origins; + GList *p; + lglTemplateLayout *layout; + + g_return_val_if_fail (frame, NULL); + + n_labels = lgl_template_frame_get_n_labels (frame); + origins = g_new0 (lglTemplateOrigin, n_labels); + + i_label = 0; + for ( p=frame->all.layouts; p != NULL; p=p->next ) { + layout = (lglTemplateLayout *)p->data; + + for (iy = 0; iy < layout->ny; iy++) { + for (ix = 0; ix < layout->nx; ix++, i_label++) { + origins[i_label].x = ix*layout->dx + layout->x0; + origins[i_label].y = iy*layout->dy + layout->y0; + } + } + } + + g_qsort_with_data (origins, n_labels, sizeof(lglTemplateOrigin), + compare_origins, NULL); + + return origins; +} + + +/** + * lgl_template_frame_add_layout: + * @frame: Pointer to template frame to add layout to. + * @layout: Pointer to layout structure to add to frame. + * + * This function adds a layout structure to the given template frame. + * + */ +void +lgl_template_frame_add_layout (lglTemplateFrame *frame, + lglTemplateLayout *layout) +{ + g_return_if_fail (frame); + g_return_if_fail (layout); + + frame->all.layouts = g_list_append (frame->all.layouts, layout); +} + + +/** + * lgl_template_frame_add_markup: + * @frame: Pointer to template frame to add markup to. + * @markup: Pointer to markup structure to add to frame. + * + * This function adds a markup structure to the given template frame. + * + */ +void +lgl_template_frame_add_markup (lglTemplateFrame *frame, + lglTemplateMarkup *markup) +{ + g_return_if_fail (frame); + g_return_if_fail (markup); + + frame->all.markups = g_list_append (frame->all.markups, markup); +} + + +/** + * lgl_template_layout_new: + * @nx: Number of labels across. + * @ny: Number of labels down. + * @x0: X coordinate of the top-left corner of the top-left label in the layout in points. + * @y0: Y coordinate of the top-left corner of the top-left label in the layout in points. + * @dx: Horizontal pitch in points. This is the distance from left-edge to left-edge. + * @dy: Vertical pitch in points. This is the distance from top-edge to top-edge. + * + * This function creates a new layout structure with the given parameters. + * + * Returns: a newly allocated #lglTemplateLayout structure. + * + */ +lglTemplateLayout * +lgl_template_layout_new (gint nx, + gint ny, + gdouble x0, + gdouble y0, + gdouble dx, + gdouble dy) +{ + lglTemplateLayout *layout; + + layout = g_new0 (lglTemplateLayout, 1); + + layout->nx = nx; + layout->ny = ny; + layout->x0 = x0; + layout->y0 = y0; + layout->dx = dx; + layout->dy = dy; + + return layout; +} + + +/** + * lgl_template_markup_margin_new: + * @size: margin size in points. + * + * This function creates a new margin markup structure. + * + * Returns: a newly allocated #lglTemplateMarkup structure. + * + */ +lglTemplateMarkup * +lgl_template_markup_margin_new (gdouble size) +{ + lglTemplateMarkup *markup; + + markup = g_new0 (lglTemplateMarkup, 1); + + markup->type = LGL_TEMPLATE_MARKUP_MARGIN; + markup->margin.size = size; + + return markup; +} + + +/** + * lgl_template_markup_line_new: + * @x1: x coordinate of first endpoint. + * @y1: y coordinate of first endpoint. + * @x2: x coordinate of second endpoint. + * @y2: y coordinate of second endpoint. + * + * This function creates a new line markup structure. + * + * Returns: a newly allocated #lglTemplateMarkup structure. + * + */ +lglTemplateMarkup * +lgl_template_markup_line_new (gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) +{ + lglTemplateMarkup *markup; + + markup = g_new0 (lglTemplateMarkup, 1); + + markup->type = LGL_TEMPLATE_MARKUP_LINE; + markup->line.x1 = x1; + markup->line.y1 = y1; + markup->line.x2 = x2; + markup->line.y2 = y2; + + return markup; +} + + +/** + * lgl_template_markup_circle_new: + * @x0: x coordinate of center of circle. + * @y0: y coordinate of center of circle. + * @r: radius of circle. + * + * This function creates a new circle markup structure. + * + * Returns: a newly allocated #lglTemplateMarkup structure. + * + */ +lglTemplateMarkup * +lgl_template_markup_circle_new (gdouble x0, + gdouble y0, + gdouble r) +{ + lglTemplateMarkup *markup; + + markup = g_new0 (lglTemplateMarkup, 1); + + markup->type = LGL_TEMPLATE_MARKUP_CIRCLE; + markup->circle.x0 = x0; + markup->circle.y0 = y0; + markup->circle.r = r; + + return markup; +} + + +/** + * lgl_template_markup_rect_new: + * @x1: x coordinate of top-left corner of rectangle. + * @y1: y coordinate of top-left corner of rectangle. + * @w: width of rectangle. + * @h: height of rectangle. + * @r: radius of rounded corner. + * + * This function creates a new rectangle markup structure. + * + * Returns: a newly allocated #lglTemplateMarkup structure. + * + */ +lglTemplateMarkup * +lgl_template_markup_rect_new (gdouble x1, + gdouble y1, + gdouble w, + gdouble h, + gdouble r) +{ + lglTemplateMarkup *markup; + + markup = g_new0 (lglTemplateMarkup, 1); + + markup->type = LGL_TEMPLATE_MARKUP_RECT; + markup->rect.x1 = x1; + markup->rect.y1 = y1; + markup->rect.w = w; + markup->rect.h = h; + markup->rect.r = r; + + return markup; +} + + +/** + * lgl_template_dup: + * @orig_template: Template to duplicate. + * + * This function duplicates a template structure. + * + * Returns: a newly allocated #lglTemplate structure. + * + */ +lglTemplate * +lgl_template_dup (const lglTemplate *orig_template) +{ + lglTemplate *template; + lglTemplateAlias *alias; + GList *p; + lglTemplateFrame *frame; + + g_return_val_if_fail (orig_template, NULL); + + template = lgl_template_new (orig_template->brand, + orig_template->part, + orig_template->description, + orig_template->paper_id, + orig_template->page_width, + orig_template->page_height); + + for ( p=orig_template->aliases; p != NULL; p=p->next ) + { + alias = (lglTemplateAlias *)p->data; + + if ( !(UTF8_EQUAL (template->brand, alias->brand) && + UTF8_EQUAL (template->part, alias->part)) ) + { + lgl_template_add_alias (template, lgl_template_alias_dup (alias)); + } + + } + + for ( p=orig_template->category_ids; p != NULL; p=p->next ) + { + lgl_template_add_category (template, p->data); + } + + for ( p=orig_template->frames; p != NULL; p=p->next ) + { + frame = (lglTemplateFrame *)p->data; + + lgl_template_add_frame (template, lgl_template_frame_dup (frame)); + } + + return template; +} + + +/** + * lgl_template_free: + * @template: Template to free. + * + * This function frees all memory associated with given template structure. + * + */ +void +lgl_template_free (lglTemplate *template) +{ + GList *p; + lglTemplateFrame *frame; + + if ( template != NULL ) { + + g_free (template->brand); + template->brand = NULL; + + g_free (template->part); + template->part = NULL; + + g_free (template->description); + template->description = NULL; + + g_free (template->paper_id); + template->paper_id = NULL; + + for ( p=template->aliases; p != NULL; p=p->next ) { + + lgl_template_alias_free (p->data); + p->data = NULL; + + } + g_list_free (template->aliases); + template->aliases = NULL; + + for ( p=template->category_ids; p != NULL; p=p->next ) { + + g_free (p->data); + p->data = NULL; + + } + g_list_free (template->category_ids); + template->category_ids = NULL; + + for ( p=template->frames; p != NULL; p=p->next ) { + + frame = (lglTemplateFrame *)p->data; + + lgl_template_frame_free (frame); + p->data = NULL; + } + g_list_free (template->frames); + template->frames = NULL; + + g_free (template); + + } + +} + + +/** + * lgl_template_alias_dup: + * @orig_alias: Alias to duplicate. + * + * This function duplicates a template alias structure. + * + * Returns: a newly allocated #lglTemplateAlias structure. + * + */ +lglTemplateAlias * +lgl_template_alias_dup (const lglTemplateAlias *orig_alias) +{ + g_return_val_if_fail (orig_alias, NULL); + + return lgl_template_alias_new (orig_alias->brand, orig_alias->part); +} + + +/** + * lgl_template_alias_free: + * @alias: Alias to free. + * + * This function frees all memory associated with given template alias structure. + * + */ +void +lgl_template_alias_free (lglTemplateAlias *alias) +{ + + if ( alias != NULL ) + { + g_free (alias->brand); + alias->brand = NULL; + + g_free (alias->part); + alias->part = NULL; + + g_free (alias); + } +} + + +/** + * lgl_template_frame_dup: + * @orig_frame: Frame to duplicate. + * + * This function duplicates a template frame structure. + * + * Returns: a newly allocated #lglTemplateFrame structure. + * + */ +lglTemplateFrame * +lgl_template_frame_dup (const lglTemplateFrame *orig_frame) +{ + lglTemplateFrame *frame; + GList *p; + lglTemplateLayout *layout; + lglTemplateMarkup *markup; + + g_return_val_if_fail (orig_frame, NULL); + + switch (orig_frame->shape) { + + case LGL_TEMPLATE_FRAME_SHAPE_RECT: + frame = + lgl_template_frame_rect_new (orig_frame->all.id, + orig_frame->rect.w, + orig_frame->rect.h, + orig_frame->rect.r, + orig_frame->rect.x_waste, + orig_frame->rect.y_waste); + break; + + case LGL_TEMPLATE_FRAME_SHAPE_ROUND: + frame = + lgl_template_frame_round_new (orig_frame->all.id, + orig_frame->round.r, + orig_frame->round.waste); + break; + + case LGL_TEMPLATE_FRAME_SHAPE_CD: + frame = + lgl_template_frame_cd_new (orig_frame->all.id, + orig_frame->cd.r1, + orig_frame->cd.r2, + orig_frame->cd.w, + orig_frame->cd.h, + orig_frame->cd.waste); + break; + + default: + return NULL; + break; + } + + for ( p=orig_frame->all.layouts; p != NULL; p=p->next ) { + + layout = (lglTemplateLayout *)p->data; + + lgl_template_frame_add_layout (frame, lgl_template_layout_dup (layout)); + } + + for ( p=orig_frame->all.markups; p != NULL; p=p->next ) { + + markup = (lglTemplateMarkup *)p->data; + + lgl_template_frame_add_markup (frame, lgl_template_markup_dup (markup)); + } + + return frame; +} + + +/** + * lgl_template_frame_free: + * @frame: Frame to free. + * + * This function frees all memory associated with given template frame structure. + * + */ +void +lgl_template_frame_free (lglTemplateFrame *frame) +{ + GList *p; + lglTemplateLayout *layout; + lglTemplateMarkup *markup; + + if ( frame != NULL ) { + + g_free (frame->all.id); + frame->all.id = NULL; + + for ( p=frame->all.layouts; p != NULL; p=p->next ) { + + layout = (lglTemplateLayout *)p->data; + + lgl_template_layout_free (layout); + p->data = NULL; + } + g_list_free (frame->all.layouts); + frame->all.layouts = NULL; + + for ( p=frame->all.markups; p != NULL; p=p->next ) { + + markup = (lglTemplateMarkup *)p->data; + + lgl_template_markup_free (markup); + p->data = NULL; + } + g_list_free (frame->all.markups); + frame->all.markups = NULL; + + g_free (frame); + + } + +} + + +/** + * lgl_template_layout_dup: + * @orig_layout: Layout to duplicate. + * + * This function duplicates a template layout structure. + * + * Returns: a newly allocated #lglTemplateLayout structure. + * + */ +lglTemplateLayout * +lgl_template_layout_dup (const lglTemplateLayout *orig_layout) +{ + lglTemplateLayout *layout; + + g_return_val_if_fail (orig_layout, NULL); + + layout = g_new0 (lglTemplateLayout, 1); + + /* copy contents */ + *layout = *orig_layout; + + return layout; +} + + +/** + * lgl_template_layout_free: + * @layout: Layout to free. + * + * This function frees all memory associated with given template layout structure. + * + */ +void +lgl_template_layout_free (lglTemplateLayout *layout) +{ + g_free (layout); +} + + +/** + * lgl_template_markup_dup: + * @orig_markup: Markup to duplicate. + * + * This function duplicates a template markup structure. + * + * Returns: a newly allocated #lglTemplateMarkup structure. + * + */ +lglTemplateMarkup * +lgl_template_markup_dup (const lglTemplateMarkup *orig_markup) +{ + lglTemplateMarkup *markup; + + g_return_val_if_fail (orig_markup, NULL); + + markup = g_new0 (lglTemplateMarkup, 1); + + *markup = *orig_markup; + + return markup; +} + + +/** + * lgl_template_markup_free: + * @markup: Markup to free. + * + * This function frees all memory associated with given template markup structure. + * + */ +void +lgl_template_markup_free (lglTemplateMarkup *markup) +{ + g_free (markup); +} + + +static gint +compare_origins (gconstpointer a, + gconstpointer b, + gpointer user_data) +{ + const lglTemplateOrigin *a_origin = a, *b_origin = b; + + if ( a_origin->y < b_origin->y ) { + return -1; + } else if ( a_origin->y > b_origin->y ) { + return +1; + } else { + if ( a_origin->x < b_origin->x ) { + return -1; + } else if ( a_origin->x > b_origin->x ) { + return +1; + } else { + return 0; /* hopefully 2 labels won't have the same origin */ + } + } +} + diff --git a/libglabels/template.h b/libglabels/template.h new file mode 100644 index 00000000..cbcbccf2 --- /dev/null +++ b/libglabels/template.h @@ -0,0 +1,380 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (LIBGLABELS) Template library for GLABELS + * + * template.h: template module header file + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __TEMPLATE_H__ +#define __TEMPLATE_H__ + +#include +#include + +G_BEGIN_DECLS + +typedef struct _lglTemplate lglTemplate; + +typedef struct _lglTemplateAlias lglTemplateAlias; + +typedef union _lglTemplateFrame lglTemplateFrame; +typedef struct _lglTemplateFrameAll lglTemplateFrameAll; +typedef struct _lglTemplateFrameRect lglTemplateFrameRect; +typedef struct _lglTemplateFrameRound lglTemplateFrameRound; +typedef struct _lglTemplateFrameCD lglTemplateFrameCD; + +typedef struct _lglTemplateLayout lglTemplateLayout; + +typedef union _lglTemplateMarkup lglTemplateMarkup; +typedef struct _lglTemplateMarkupMargin lglTemplateMarkupMargin; +typedef struct _lglTemplateMarkupLine lglTemplateMarkupLine; +typedef struct _lglTemplateMarkupCircle lglTemplateMarkupCircle; +typedef struct _lglTemplateMarkupRect lglTemplateMarkupRect; + +typedef struct _lglTemplateOrigin lglTemplateOrigin; + +/* + * Top-level Template Structure + */ +struct _lglTemplate { + + gchar *brand; + gchar *part; + gchar *description; + gchar *paper_id; + gdouble page_width; + gdouble page_height; + + /* List of (lglTemplateAlias *) aliase structures. */ + GList *aliases; + + /* List of (gchar *) category ids. */ + GList *category_ids; + + /* List of (lglTemplateFrame *) label frame structures. + * Currently glabels only supports a single label frame per + * template. */ + GList *frames; + +}; + + +/* + * Top-level Template Structure + */ +struct _lglTemplateAlias { + + gchar *brand; + gchar *part; + +}; + +/* + * Possible Frame Shapes + */ +typedef enum { + LGL_TEMPLATE_FRAME_SHAPE_RECT, + LGL_TEMPLATE_FRAME_SHAPE_ROUND, + LGL_TEMPLATE_FRAME_SHAPE_CD, +} lglTemplateFrameShape; + + +/* + * Frame Structure + */ +struct _lglTemplateFrameAll { + + /* Begin Common Fields */ + lglTemplateFrameShape shape; + + gchar *id; /* Id, currently always "0" */ + GList *layouts; /* List of lglTemplateLayouts */ + GList *markups; /* List of lglTemplateMarkups */ + /* End Common Fields */ +}; + +struct _lglTemplateFrameRect { + + /* Begin Common Fields */ + lglTemplateFrameShape shape; /* Always LGL_TEMPLATE_FRAME_SHAPE_RECT. */ + + gchar *id; /* Id, currently always "0" */ + GList *layouts; /* List of lglTemplateLayouts */ + GList *markups; /* List of lglTemplateMarkups */ + /* End Common Fields */ + + gdouble w; /* Width */ + gdouble h; /* Height */ + gdouble r; /* Corner radius */ + gdouble x_waste; /* Amount of horiz overprint allowed. */ + gdouble y_waste; /* Amount of vert overprint allowed. */ +}; + +struct _lglTemplateFrameRound { + + /* Begin Common Fields */ + lglTemplateFrameShape shape; /* Always LGL_TEMPLATE_FRAME_SHAPE_ROUND. */ + + gchar *id; /* Id, currently always "0" */ + GList *layouts; /* List of lglTemplateLayouts */ + GList *markups; /* List of lglTemplateMarkups */ + /* End Common Fields */ + + gdouble r; /* Radius */ + gdouble waste; /* Amount of overprint allowed. */ +}; + +struct _lglTemplateFrameCD { + + /* Begin Common Fields */ + lglTemplateFrameShape shape; /* Always LGL_TEMPLATE_FRAME_SHAPE_CD. */ + + gchar *id; /* Id, currently always "0" */ + GList *layouts; /* List of lglTemplateLayouts */ + GList *markups; /* List of lglTemplateMarkups */ + /* End Common Fields */ + + gdouble r1; /* Outer radius */ + gdouble r2; /* Inner radius (hole) */ + gdouble w; /* Clip width, business card CDs */ + gdouble h; /* Clip height, business card CDs */ + gdouble waste; /* Amount of overprint allowed. */ +}; + +union _lglTemplateFrame{ + + lglTemplateFrameShape shape; + + lglTemplateFrameAll all; + lglTemplateFrameRect rect; + lglTemplateFrameRound round; + lglTemplateFrameCD cd; +}; + + +/* + * Label Layout Structure + */ +struct _lglTemplateLayout { + + gint nx; /* Number of labels across */ + gint ny; /* Number of labels up and down */ + + gdouble x0; /* Left of grid from left edge of paper */ + gdouble y0; /* Top of grid from top edge of paper */ + + gdouble dx; /* Horizontal pitch of grid */ + gdouble dy; /* Vertical pitch of grid */ + +}; + + +/* + * Possible Markup Types + */ +typedef enum { + LGL_TEMPLATE_MARKUP_MARGIN, + LGL_TEMPLATE_MARKUP_LINE, + LGL_TEMPLATE_MARKUP_CIRCLE, + LGL_TEMPLATE_MARKUP_RECT, +} lglTemplateMarkupType; + + +/* + * Label Markup Structure (Helpful lines drawn in glabels to help locate objects) + */ +struct _lglTemplateMarkupMargin { + + lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_MARGIN */ + + gdouble size; /* Margin size */ +}; + +struct _lglTemplateMarkupLine { + + lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_LINE */ + + gdouble x1, y1; /* 1st endpoint */ + gdouble x2, y2; /* 2nd endpoint */ +}; + +struct _lglTemplateMarkupCircle { + + lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_CIRCLE */ + + gdouble x0, y0; /* Center of circle */ + gdouble r; /* Radius of circle */ +}; + +struct _lglTemplateMarkupRect { + + lglTemplateMarkupType type; /* Always LGL_TEMPLATE_MARKUP_RECT */ + + gdouble x1, y1; /* Upper left corner */ + gdouble w, h; /* Width and height. */ + gdouble r; /* Radius of corners. */ +}; + +union _lglTemplateMarkup { + + lglTemplateMarkupType type; + + lglTemplateMarkupMargin margin; + lglTemplateMarkupLine line; + lglTemplateMarkupCircle circle; + lglTemplateMarkupRect rect; +}; + + +/* + * Origin coordinates + */ +struct _lglTemplateOrigin { + + gdouble x, y; /* Label origin relative to upper + * upper left hand corner of paper */ + +}; + + + +/* + * Template query functions + */ +gchar *lgl_template_get_name (const lglTemplate *template); + +gboolean lgl_template_do_templates_match (const lglTemplate *template1, + const lglTemplate *template2); + +gboolean lgl_template_does_brand_match (const lglTemplate *template, + const gchar *brand); + +gboolean lgl_template_does_page_size_match (const lglTemplate *template, + const gchar *paper_id); + +gboolean lgl_template_does_category_match (const lglTemplate *template, + const gchar *category_id); + + +/* + * Frame query functions + */ +void lgl_template_frame_get_size (const lglTemplateFrame *frame, + gdouble *w, + gdouble *h); + +gint lgl_template_frame_get_n_labels (const lglTemplateFrame *frame); + +lglTemplateOrigin *lgl_template_frame_get_origins (const lglTemplateFrame *frame); + + +/* + * Template Construction + */ +lglTemplate *lgl_template_new (const gchar *brand, + const gchar *part, + const gchar *description, + const gchar *paper_id, + gdouble page_width, + gdouble page_height); + +void lgl_template_add_alias (lglTemplate *template, + lglTemplateAlias *alias); + +void lgl_template_add_category (lglTemplate *template, + const gchar *category_id); + +void lgl_template_add_frame (lglTemplate *template, + lglTemplateFrame *frame); + +lglTemplateFrame *lgl_template_frame_rect_new (const gchar *id, + gdouble w, + gdouble h, + gdouble r, + gdouble x_waste, + gdouble y_waste); + +lglTemplateAlias *lgl_template_alias_new (const gchar *brand, + const gchar *part); + +lglTemplateFrame *lgl_template_frame_round_new (const gchar *id, + gdouble r, + gdouble waste); + +lglTemplateFrame *lgl_template_frame_cd_new (const gchar *id, + gdouble r1, + gdouble r2, + gdouble w, + gdouble h, + gdouble waste); + +void lgl_template_frame_add_layout (lglTemplateFrame *frame, + lglTemplateLayout *layout); + +void lgl_template_frame_add_markup (lglTemplateFrame *frame, + lglTemplateMarkup *markup); + +lglTemplateLayout *lgl_template_layout_new (gint nx, + gint ny, + gdouble x0, + gdouble y0, + gdouble dx, + gdouble dy); + +lglTemplateMarkup *lgl_template_markup_margin_new (gdouble size); + +lglTemplateMarkup *lgl_template_markup_line_new (gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2); + +lglTemplateMarkup *lgl_template_markup_circle_new (gdouble x0, + gdouble y0, + gdouble r); + +lglTemplateMarkup *lgl_template_markup_rect_new (gdouble x1, + gdouble y1, + gdouble w, + gdouble h, + gdouble r); + +lglTemplate *lgl_template_dup (const lglTemplate *orig_template); + +void lgl_template_free (lglTemplate *template); + +lglTemplateAlias *lgl_template_alias_dup (const lglTemplateAlias *orig_alias); +void lgl_template_alias_free (lglTemplateAlias *alias); + +lglTemplateFrame *lgl_template_frame_dup (const lglTemplateFrame *orig_frame); +void lgl_template_frame_free (lglTemplateFrame *frame); + +lglTemplateLayout *lgl_template_layout_dup (const lglTemplateLayout *orig_layout); +void lgl_template_layout_free (lglTemplateLayout *layout); + +lglTemplateMarkup *lgl_template_markup_dup (const lglTemplateMarkup *orig_markup); +void lgl_template_markup_free (lglTemplateMarkup *markup); + + +G_END_DECLS + +#endif diff --git a/libglabels/xml-category.c b/libglabels/xml-category.c new file mode 100644 index 00000000..0e759c9a --- /dev/null +++ b/libglabels/xml-category.c @@ -0,0 +1,169 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * xml-category.c: category xml module + * + * Copyright (C) 2006 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ +#include + +#include "xml-category.h" + +#include +#include +#include +#include + +#include "libglabels-private.h" + +#include "xml.h" + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + + +/** + * lgl_xml_category_read_categories_from_file: + * @utf8_filename: Filename of categories file (name encoded as UTF-8) + * + * Read category definitions from a file. + * + * Returns: a list of #lglCategory structures. + * + */ +GList * +lgl_xml_category_read_categories_from_file (gchar *utf8_filename) +{ + gchar *filename; + GList *categories; + xmlDocPtr categories_doc; + + LIBXML_TEST_VERSION; + + filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); + if (!filename) { + g_message ("Utf8 filename conversion error"); + return NULL; + } + + categories_doc = xmlParseFile (filename); + if (!categories_doc) { + g_message ("\"%s\" is not a glabels category file (not XML)", + filename); + return NULL; + } + + categories = lgl_xml_category_parse_categories_doc (categories_doc); + + g_free (filename); + xmlFreeDoc (categories_doc); + + return categories; +} + + +/** + * lgl_xml_category_parse_categories_doc: + * @categories_doc: libxml #xmlDocPtr tree, representing a categories + * definition file. + * + * Read category definitions from a libxml #xmlDocPtr tree. + * + * Returns: a list of #lglCategory structures. + * + */ +GList * +lgl_xml_category_parse_categories_doc (xmlDocPtr categories_doc) +{ + GList *categories = NULL; + xmlNodePtr root, node; + lglCategory *category; + + LIBXML_TEST_VERSION; + + root = xmlDocGetRootElement (categories_doc); + if (!root || !root->name) { + g_message ("\"%s\" is not a glabels category file (no root node)", + categories_doc->name); + xmlFreeDoc (categories_doc); + return categories; + } + if (!lgl_xml_is_node (root, "Glabels-categories")) { + g_message ("\"%s\" is not a glabels category file (wrong root node)", + categories_doc->name); + xmlFreeDoc (categories_doc); + return categories; + } + + for (node = root->xmlChildrenNode; node != NULL; node = node->next) { + + if (lgl_xml_is_node (node, "Category")) { + category = lgl_xml_category_parse_category_node (node); + categories = g_list_append (categories, category); + } else { + if ( !xmlNodeIsText(node) ) { + if (!lgl_xml_is_node (node, "comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + } + + return categories; +} + + +/** + * lgl_xml_category_parse_category_node: + * @category_node: libxml #xmlNodePtr category node from a #xmlDocPtr tree. + * + * Read a single category definition from a libxml #xmlNodePtr node. + * + * Returns: a pointer to a newly created #lglCategory structure. + * + */ +lglCategory * +lgl_xml_category_parse_category_node (xmlNodePtr category_node) +{ + lglCategory *category; + gchar *id, *name; + + LIBXML_TEST_VERSION; + + id = lgl_xml_get_prop_string (category_node, "id", NULL); + name = lgl_xml_get_prop_i18n_string (category_node, "name", NULL); + + category = lgl_category_new (id, name); + + g_free (id); + g_free (name); + + return category; +} + diff --git a/libglabels/xml-category.h b/libglabels/xml-category.h new file mode 100644 index 00000000..ef01d9fb --- /dev/null +++ b/libglabels/xml-category.h @@ -0,0 +1,46 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * xml-category.h: category xml module header file + * + * Copyright (C) 2006 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __XML_CATEGORY_H__ +#define __XML_CATEGORY_H__ + +#include +#include +#include + +#include "category.h" + +G_BEGIN_DECLS + +GList *lgl_xml_category_read_categories_from_file (gchar *utf8_filename); + +GList *lgl_xml_category_parse_categories_doc (xmlDocPtr categories_doc); + +lglCategory *lgl_xml_category_parse_category_node (xmlNodePtr category_node); + + +G_END_DECLS + +#endif /* __XML_CATEGORY_H__ */ diff --git a/libglabels/xml-paper.c b/libglabels/xml-paper.c new file mode 100644 index 00000000..fc6f07fa --- /dev/null +++ b/libglabels/xml-paper.c @@ -0,0 +1,176 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * xml-paper.c: paper xml module + * + * Copyright (C) 2003, 2004 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ +#include + +#include "xml-paper.h" + +#include +#include +#include +#include + +#include "libglabels-private.h" + +#include "xml.h" + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + + +/** + * lgl_xml_paper_read_papers_from_file: + * @utf8_filename: Filename of papers file (name encoded as UTF-8) + * + * Read paper definitions from a file. + * + * Returns: a list of #lglPaper structures. + * + */ +GList * +lgl_xml_paper_read_papers_from_file (gchar *utf8_filename) +{ + gchar *filename; + GList *papers; + xmlDocPtr papers_doc; + + LIBXML_TEST_VERSION; + + filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); + if (!filename) { + g_message ("Utf8 filename conversion error"); + return NULL; + } + + papers_doc = xmlParseFile (filename); + if (!papers_doc) { + g_message ("\"%s\" is not a glabels paper file (not XML)", + filename); + return NULL; + } + + papers = lgl_xml_paper_parse_papers_doc (papers_doc); + + g_free (filename); + xmlFreeDoc (papers_doc); + + return papers; +} + + +/** + * lgl_xml_paper_parse_papers_doc: + * @papers_doc: libxml #xmlDocPtr tree, representing a papers definition file. + * + * Read paper definitions from a libxml #xmlDocPtr tree. + * + * Returns: a list of #lglPaper structures. + * + */ +GList * +lgl_xml_paper_parse_papers_doc (xmlDocPtr papers_doc) +{ + GList *papers = NULL; + xmlNodePtr root, node; + lglPaper *paper; + + LIBXML_TEST_VERSION; + + root = xmlDocGetRootElement (papers_doc); + if (!root || !root->name) { + g_message ("\"%s\" is not a glabels paper file (no root node)", + papers_doc->name); + xmlFreeDoc (papers_doc); + return papers; + } + if (!lgl_xml_is_node (root, "Glabels-paper-sizes")) { + g_message ("\"%s\" is not a glabels paper file (wrong root node)", + papers_doc->name); + xmlFreeDoc (papers_doc); + return papers; + } + + for (node = root->xmlChildrenNode; node != NULL; node = node->next) { + + if (lgl_xml_is_node (node, "Paper-size")) { + paper = lgl_xml_paper_parse_paper_node (node); + papers = g_list_append (papers, paper); + } else { + if ( !xmlNodeIsText(node) ) { + if (!lgl_xml_is_node (node, "comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + } + + return papers; +} + + +/** + * lgl_xml_paper_parse_paper_node: + * @paper_node: libxml #xmlNodePtr paper node from a #xmlDocPtr tree. + * + * Read a single paper definition from a libxml #xmlNodePtr node. + * + * Returns: a pointer to a newly created #lglPaper structure. + * + */ +lglPaper * +lgl_xml_paper_parse_paper_node (xmlNodePtr paper_node) +{ + lglPaper *paper; + gchar *id, *name, *pwg_size; + gdouble width, height; + + LIBXML_TEST_VERSION; + + id = lgl_xml_get_prop_string (paper_node, "id", NULL); + + name = lgl_xml_get_prop_i18n_string (paper_node, "name", NULL); + + width = lgl_xml_get_prop_length (paper_node, "width", 0); + height = lgl_xml_get_prop_length (paper_node, "height", 0); + + pwg_size = lgl_xml_get_prop_string (paper_node, "pwg_size", NULL); + + paper = lgl_paper_new (id, name, width, height, pwg_size); + + g_free (id); + g_free (name); + g_free (pwg_size); + + return paper; +} + diff --git a/libglabels/xml-paper.h b/libglabels/xml-paper.h new file mode 100644 index 00000000..df90bcff --- /dev/null +++ b/libglabels/xml-paper.h @@ -0,0 +1,46 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * xml-paper.h: paper xml module header file + * + * Copyright (C) 2003, 2004 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __XML_PAPER_H__ +#define __XML_PAPER_H__ + +#include +#include +#include + +#include "paper.h" + +G_BEGIN_DECLS + +GList *lgl_xml_paper_read_papers_from_file (gchar *utf8_filename); + +GList *lgl_xml_paper_parse_papers_doc (xmlDocPtr papers_doc); + +lglPaper *lgl_xml_paper_parse_paper_node (xmlNodePtr paper_node); + + +G_END_DECLS + +#endif /* __XML_PAPER_H__ */ diff --git a/libglabels/xml-template.c b/libglabels/xml-template.c new file mode 100644 index 00000000..6f1ae4b8 --- /dev/null +++ b/libglabels/xml-template.c @@ -0,0 +1,972 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (LIBGLABELS) Template library for GLABELS + * + * xml-template.c: template xml module + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ +#include + +#include "xml-template.h" + +#include +#include +#include +#include + +#include "libglabels-private.h" + +#include "db.h" +#include "xml.h" + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ +static void xml_parse_meta_node (xmlNodePtr label_node, + lglTemplate *template); +static void xml_parse_label_rectangle_node (xmlNodePtr label_node, + lglTemplate *template); +static void xml_parse_label_round_node (xmlNodePtr label_node, + lglTemplate *template); +static void xml_parse_label_cd_node (xmlNodePtr label_node, + lglTemplate *template); +static void xml_parse_layout_node (xmlNodePtr layout_node, + lglTemplateFrame *frame); +static void xml_parse_markup_margin_node (xmlNodePtr markup_node, + lglTemplateFrame *frame); +static void xml_parse_markup_line_node (xmlNodePtr markup_node, + lglTemplateFrame *frame); +static void xml_parse_markup_circle_node (xmlNodePtr markup_node, + lglTemplateFrame *frame); +static void xml_parse_markup_rect_node (xmlNodePtr markup_node, + lglTemplateFrame *frame); +static void xml_parse_alias_node (xmlNodePtr alias_node, + lglTemplate *template); + +static void xml_create_meta_node (const gchar *category, + xmlNodePtr root, + const xmlNsPtr ns); +static void xml_create_label_node (const lglTemplateFrame *frame, + xmlNodePtr root, + const xmlNsPtr ns); +static void xml_create_layout_node (const lglTemplateLayout *layout, + xmlNodePtr root, + const xmlNsPtr ns); +static void xml_create_markup_margin_node (const lglTemplateMarkup *margin, + xmlNodePtr root, + const xmlNsPtr ns); +static void xml_create_markup_line_node (const lglTemplateMarkup *line, + xmlNodePtr root, + const xmlNsPtr ns); +static void xml_create_markup_circle_node (const lglTemplateMarkup *circle, + xmlNodePtr root, + const xmlNsPtr ns); +static void xml_create_markup_rect_node (const lglTemplateMarkup *circle, + xmlNodePtr root, + const xmlNsPtr ns); +static void xml_create_alias_node (const lglTemplateAlias *alias, + xmlNodePtr root, + const xmlNsPtr ns); + + +/** + * lgl_xml_template_read_templates_from_file: + * @utf8_filename: Filename of papers file (name encoded as UTF-8) + * + * Read glabels templates from template file. + * + * Returns: a list of #lglTemplate structures. + * + */ +GList * +lgl_xml_template_read_templates_from_file (const gchar *utf8_filename) +{ + gchar *filename; + xmlDocPtr templates_doc; + GList *templates = NULL; + + LIBXML_TEST_VERSION; + + filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); + if (!filename) { + g_message ("Utf8 filename conversion error"); + return NULL; + } + + templates_doc = xmlParseFile (filename); + if (!templates_doc) { + g_message ("\"%s\" is not a glabels template file (not XML)", + filename); + return templates; + } + + templates = lgl_xml_template_parse_templates_doc (templates_doc); + + g_free (filename); + xmlFreeDoc (templates_doc); + + return templates; +} + + +/** + * lgl_xml_template_parse_templates_doc: + * @templates_doc: libxml #xmlDocPtr tree, representing template file. + * + * Read glabels templates from a libxml #xmlDocPtr tree. + * + * Returns: a list of #lglTemplate structures. + * + */ +GList * +lgl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc) +{ + + GList *templates = NULL; + xmlNodePtr root, node; + lglTemplate *template; + + LIBXML_TEST_VERSION; + + root = xmlDocGetRootElement (templates_doc); + if (!root || !root->name) { + g_message ("\"%s\" is not a glabels template file (no root node)", + templates_doc->URL); + return templates; + } + if (!lgl_xml_is_node (root, "Glabels-templates")) { + g_message ("\"%s\" is not a glabels template file (wrong root node)", + templates_doc->URL); + return templates; + } + + for (node = root->xmlChildrenNode; node != NULL; node = node->next) { + + if (lgl_xml_is_node (node, "Template")) { + template = lgl_xml_template_parse_template_node (node); + templates = g_list_append (templates, template); + } else { + if ( !xmlNodeIsText(node) ) { + if (!lgl_xml_is_node (node,"comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + } + + return templates; +} + + +/** + * lgl_xml_template_parse_template_node: + * @template_node: libxml #xmlNodePtr template node from a #xmlDocPtr tree. + * + * Read a single glabels template from a libxml #xmlNodePtr node. + * + * Returns: a pointer to a newly created #lglTemplate structure. + * + */ +lglTemplate * +lgl_xml_template_parse_template_node (const xmlNodePtr template_node) +{ + gchar *brand; + gchar *part; + gchar *name; + gchar *description; + gchar *paper_id; + gdouble page_width, page_height; + lglPaper *paper = NULL; + lglTemplate *template; + xmlNodePtr node; + gchar **v; + + brand = lgl_xml_get_prop_string (template_node, "brand", NULL); + part = lgl_xml_get_prop_string (template_node, "part", NULL); + if (!brand || !part) + { + name = lgl_xml_get_prop_string (template_node, "name", NULL); + if (name) + { + v = g_strsplit (name, " ", 2); + brand = g_strdup (v[0]); + part = g_strchug (g_strdup (v[1])); + g_free (name); + g_strfreev (v); + + } + else + { + g_message (_("Missing name or brand/part attributes.")); + } + } + + description = lgl_xml_get_prop_i18n_string (template_node, "description", NULL); + paper_id = lgl_xml_get_prop_string (template_node, "size", NULL); + + if (lgl_db_is_paper_id_other (paper_id)) { + + page_width = lgl_xml_get_prop_length (template_node, "width", 0); + page_height = lgl_xml_get_prop_length (template_node, "height", 0); + + } else { + paper = lgl_db_lookup_paper_from_id (paper_id); + if (paper == NULL) { + /* This should always be an id, but just in case a name + slips by! */ + g_message (_("Unknown page size id \"%s\", trying as name"), + paper_id); + paper = lgl_db_lookup_paper_from_name (paper_id); + g_free (paper_id); + paper_id = g_strdup (paper->id); + } + if (paper != NULL) { + page_width = paper->width; + page_height = paper->height; + } else { + page_width = 612; + page_height = 792; + g_message (_("Unknown page size id or name \"%s\""), + paper_id); + } + lgl_paper_free (paper); + paper = NULL; + } + + template = lgl_template_new (brand, part, description, + paper_id, page_width, page_height); + + for (node = template_node->xmlChildrenNode; node != NULL; + node = node->next) { + if (lgl_xml_is_node (node, "Meta")) { + xml_parse_meta_node (node, template); + } else if (lgl_xml_is_node (node, "Label-rectangle")) { + xml_parse_label_rectangle_node (node, template); + } else if (lgl_xml_is_node (node, "Label-round")) { + xml_parse_label_round_node (node, template); + } else if (lgl_xml_is_node (node, "Label-cd")) { + xml_parse_label_cd_node (node, template); + } else if (lgl_xml_is_node (node, "Alias")) { + xml_parse_alias_node (node, template); + } else { + if (!xmlNodeIsText (node)) { + if (!lgl_xml_is_node (node,"comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + } + + g_free (brand); + g_free (part); + g_free (description); + g_free (paper_id); + + return template; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Template->Meta Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_meta_node (xmlNodePtr meta_node, + lglTemplate *template) +{ + gchar *category; + + category = lgl_xml_get_prop_string (meta_node, "category", NULL); + + if (category != NULL) + { + lgl_template_add_category (template, category); + g_free (category); + } +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Template->Label-rectangle Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_label_rectangle_node (xmlNodePtr label_node, + lglTemplate *template) +{ + gchar *id; + gchar *tmp; + gdouble x_waste, y_waste; + gdouble w, h, r; + lglTemplateFrame *frame; + xmlNodePtr node; + + id = lgl_xml_get_prop_string (label_node, "id", NULL); + + if ((tmp = lgl_xml_get_prop_string (label_node, "waste", NULL))) { + /* Handle single "waste" property. */ + x_waste = y_waste = lgl_xml_get_prop_length (label_node, "waste", 0); + g_free (tmp); + } else { + x_waste = lgl_xml_get_prop_length (label_node, "x_waste", 0); + y_waste = lgl_xml_get_prop_length (label_node, "y_waste", 0); + } + + w = lgl_xml_get_prop_length (label_node, "width", 0); + h = lgl_xml_get_prop_length (label_node, "height", 0); + r = lgl_xml_get_prop_length (label_node, "round", 0); + + frame = lgl_template_frame_rect_new ((gchar *)id, w, h, r, x_waste, y_waste); + lgl_template_add_frame (template, frame); + + for (node = label_node->xmlChildrenNode; node != NULL; + node = node->next) { + if (lgl_xml_is_node (node, "Layout")) { + xml_parse_layout_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-margin")) { + xml_parse_markup_margin_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-line")) { + xml_parse_markup_line_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-circle")) { + xml_parse_markup_circle_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-rect")) { + xml_parse_markup_rect_node (node, frame); + } else if (!xmlNodeIsText (node)) { + if (!lgl_xml_is_node (node, "comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + + g_free (id); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Template->Label-round Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_label_round_node (xmlNodePtr label_node, + lglTemplate *template) +{ + gchar *id; + gdouble waste; + gdouble r; + lglTemplateFrame *frame; + xmlNodePtr node; + + id = lgl_xml_get_prop_string (label_node, "id", NULL); + waste = lgl_xml_get_prop_length (label_node, "waste", 0); + r = lgl_xml_get_prop_length (label_node, "radius", 0); + + frame = lgl_template_frame_round_new ((gchar *)id, r, waste); + lgl_template_add_frame (template, frame); + + for (node = label_node->xmlChildrenNode; node != NULL; + node = node->next) { + if (lgl_xml_is_node (node, "Layout")) { + xml_parse_layout_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-margin")) { + xml_parse_markup_margin_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-line")) { + xml_parse_markup_line_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-circle")) { + xml_parse_markup_circle_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-rect")) { + xml_parse_markup_rect_node (node, frame); + } else if (!xmlNodeIsText (node)) { + if (!lgl_xml_is_node (node, "comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + + g_free (id); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Template->Label-cd Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_label_cd_node (xmlNodePtr label_node, + lglTemplate *template) +{ + gchar *id; + gdouble waste; + gdouble r1, r2, w, h; + lglTemplateFrame *frame; + xmlNodePtr node; + + id = lgl_xml_get_prop_string (label_node, "id", NULL); + waste = lgl_xml_get_prop_length (label_node, "waste", 0); + r1 = lgl_xml_get_prop_length (label_node, "radius", 0); + r2 = lgl_xml_get_prop_length (label_node, "hole", 0); + w = lgl_xml_get_prop_length (label_node, "width", 0); + h = lgl_xml_get_prop_length (label_node, "height", 0); + + frame = lgl_template_frame_cd_new ((gchar *)id, r1, r2, w, h, waste); + lgl_template_add_frame (template, frame); + + for (node = label_node->xmlChildrenNode; node != NULL; + node = node->next) { + if (lgl_xml_is_node (node, "Layout")) { + xml_parse_layout_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-margin")) { + xml_parse_markup_margin_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-line")) { + xml_parse_markup_line_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-circle")) { + xml_parse_markup_circle_node (node, frame); + } else if (lgl_xml_is_node (node, "Markup-rect")) { + xml_parse_markup_rect_node (node, frame); + } else if (!xmlNodeIsText (node)) { + if (!lgl_xml_is_node (node, "comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + + g_free (id); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Template->Label->Layout Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_layout_node (xmlNodePtr layout_node, + lglTemplateFrame *frame) +{ + gint nx, ny; + gdouble x0, y0, dx, dy; + xmlNodePtr node; + + nx = lgl_xml_get_prop_int (layout_node, "nx", 1); + ny = lgl_xml_get_prop_int (layout_node, "ny", 1); + + x0 = lgl_xml_get_prop_length (layout_node, "x0", 0); + y0 = lgl_xml_get_prop_length (layout_node, "y0", 0); + + dx = lgl_xml_get_prop_length (layout_node, "dx", 0); + dy = lgl_xml_get_prop_length (layout_node, "dy", 0); + + lgl_template_frame_add_layout (frame, lgl_template_layout_new (nx, ny, x0, y0, dx, dy)); + + for (node = layout_node->xmlChildrenNode; node != NULL; + node = node->next) { + if (!xmlNodeIsText (node)) { + if (!lgl_xml_is_node (node, "comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Template->Label->Markup-margin Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_markup_margin_node (xmlNodePtr markup_node, + lglTemplateFrame *frame) +{ + gdouble size; + xmlNodePtr node; + + size = lgl_xml_get_prop_length (markup_node, "size", 0); + + lgl_template_frame_add_markup (frame, lgl_template_markup_margin_new (size)); + + for (node = markup_node->xmlChildrenNode; node != NULL; + node = node->next) { + if (!xmlNodeIsText (node)) { + if (!lgl_xml_is_node (node, "comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Template->Label->Markup-line Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_markup_line_node (xmlNodePtr markup_node, + lglTemplateFrame *frame) +{ + gdouble x1, y1, x2, y2; + xmlNodePtr node; + + x1 = lgl_xml_get_prop_length (markup_node, "x1", 0); + y1 = lgl_xml_get_prop_length (markup_node, "y1", 0); + x2 = lgl_xml_get_prop_length (markup_node, "x2", 0); + y2 = lgl_xml_get_prop_length (markup_node, "y2", 0); + + lgl_template_frame_add_markup (frame, lgl_template_markup_line_new (x1, y1, x2, y2)); + + for (node = markup_node->xmlChildrenNode; node != NULL; + node = node->next) { + if (!xmlNodeIsText (node)) { + if (!lgl_xml_is_node (node, "comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Template->Label->Markup-circle Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_markup_circle_node (xmlNodePtr markup_node, + lglTemplateFrame *frame) +{ + gdouble x0, y0, r; + xmlNodePtr node; + + x0 = lgl_xml_get_prop_length (markup_node, "x0", 0); + y0 = lgl_xml_get_prop_length (markup_node, "y0", 0); + r = lgl_xml_get_prop_length (markup_node, "radius", 0); + + lgl_template_frame_add_markup (frame, lgl_template_markup_circle_new (x0, y0, r)); + + for (node = markup_node->xmlChildrenNode; node != NULL; + node = node->next) { + if (!xmlNodeIsText (node)) { + if (!lgl_xml_is_node (node, "comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Template->Label->Markup-rect Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_markup_rect_node (xmlNodePtr markup_node, + lglTemplateFrame *frame) +{ + gdouble x1, y1, w, h, r; + xmlNodePtr node; + + x1 = lgl_xml_get_prop_length (markup_node, "x1", 0); + y1 = lgl_xml_get_prop_length (markup_node, "y1", 0); + w = lgl_xml_get_prop_length (markup_node, "w", 0); + h = lgl_xml_get_prop_length (markup_node, "h", 0); + r = lgl_xml_get_prop_length (markup_node, "r", 0); + + lgl_template_frame_add_markup (frame, lgl_template_markup_rect_new (x1, y1, w, h, r)); + + for (node = markup_node->xmlChildrenNode; node != NULL; + node = node->next) { + if (!xmlNodeIsText (node)) { + if (!lgl_xml_is_node (node, "comment")) { + g_message ("bad node = \"%s\"",node->name); + } + } + } + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Template->Alias Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_alias_node (xmlNodePtr alias_node, + lglTemplate *template) +{ + gchar *brand; + gchar *part; + gchar *name; + gchar **v; + + brand = lgl_xml_get_prop_string (alias_node, "brand", NULL); + part = lgl_xml_get_prop_string (alias_node, "part", NULL); + if (!brand || !part) + { + name = lgl_xml_get_prop_string (alias_node, "name", NULL); + if (name) + { + g_message (_("Missing required \"brand\" or \"part\" attribute, trying deprecated name.")); + v = g_strsplit (name, " ", 2); + brand = g_strdup (v[0]); + part = g_strdup (v[1]); + g_free (name); + g_strfreev (v); + + } + else + { + g_message (_("Name attribute also missing.")); + } + } + + lgl_template_add_alias (template, lgl_template_alias_new (brand, part)); + + g_free (brand); + g_free (part); +} + +/** + * lgl_xml_template_write_templates_to_file: + * @templates: List of #lglTemplate structures + * @utf8_filename: Filename of templates file (name encoded as UTF-8) + * + * Write a list of #lglTemplate structures to a glabels XML template file. + * + * Returns: the number of bytes written or -1 in case of failure + * + */ +gint +lgl_xml_template_write_templates_to_file (GList *templates, + const gchar *utf8_filename) +{ + xmlDocPtr doc; + xmlNsPtr ns; + gint bytes_written; + GList *p; + lglTemplate *template; + gchar *filename; + + doc = xmlNewDoc ((xmlChar *)"1.0"); + doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *)"Glabels-templates", NULL); + + ns = xmlNewNs (doc->xmlRootNode, (xmlChar *)LGL_XML_NAME_SPACE, NULL); + xmlSetNs (doc->xmlRootNode, ns); + + for (p=templates; p!=NULL; p=p->next) { + template = (lglTemplate *)p->data; + lgl_xml_template_create_template_node (template, doc->xmlRootNode, ns); + } + + filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); + if (!filename) + { + g_message (_("Utf8 conversion error.")); + return -1; + } + else + { + xmlSetDocCompressMode (doc, 0); + bytes_written = xmlSaveFormatFile (filename, doc, TRUE); + xmlFreeDoc (doc); + g_free (filename); + return bytes_written; + } + +} + + +/** + * lgl_xml_template_write_template_to_file: + * @template: #lglTemplate structure to be written + * @utf8_filename: Filename of templates file (name encoded as UTF-8) + * + * Write a single #lglTemplate structures to a glabels XML template file. + * + * Returns: the number of bytes written or -1 in case of failure + * + */ +gint +lgl_xml_template_write_template_to_file (const lglTemplate *template, + const gchar *utf8_filename) +{ + GList *templates = NULL; + gint bytes_written; + + templates = g_list_append (templates, (gpointer)template); + + bytes_written = lgl_xml_template_write_templates_to_file (templates, utf8_filename); + + g_list_free (templates); + + return bytes_written; +} + + +/** + * lgl_xml_template_create_template_node: + * @template: #lglTemplate structure to be written + * @root: parent node to receive new child node + * @ns: a libxml #xmlNsPtr + * + * Add a single #lglTemplate child node to given #xmlNodePtr. + * + */ +void +lgl_xml_template_create_template_node (const lglTemplate *template, + xmlNodePtr root, + const xmlNsPtr ns) +{ + xmlNodePtr node; + GList *p; + lglTemplateAlias *alias; + lglTemplateFrame *frame; + + node = xmlNewChild (root, ns, (xmlChar *)"Template", NULL); + + lgl_xml_set_prop_string (node, "brand", template->brand); + lgl_xml_set_prop_string (node, "part", template->part); + + lgl_xml_set_prop_string (node, "size", template->paper_id); + if (xmlStrEqual ((xmlChar *)template->paper_id, (xmlChar *)"Other")) + { + + lgl_xml_set_prop_length (node, "width", template->page_width); + lgl_xml_set_prop_length (node, "height", template->page_height); + + } + + lgl_xml_set_prop_string (node, "description", template->description); + + for ( p=template->aliases; p != NULL; p=p->next ) { + alias = (lglTemplateAlias *)p->data; + if ( !(xmlStrEqual ((xmlChar *)template->brand, (xmlChar *)alias->brand) && + xmlStrEqual ((xmlChar *)template->part, (xmlChar *)alias->part)) ) + { + xml_create_alias_node ( alias, node, ns ); + } + } + for ( p=template->category_ids; p != NULL; p=p->next ) + { + xml_create_meta_node ( p->data, node, ns ); + } + for ( p=template->frames; p != NULL; p=p->next ) + { + frame = (lglTemplateFrame *)p->data; + xml_create_label_node (frame, node, ns); + } + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Template->Meta Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_meta_node (const gchar *category, + xmlNodePtr root, + const xmlNsPtr ns) +{ + xmlNodePtr node; + + node = xmlNewChild (root, ns, (xmlChar *)"Meta", NULL); + lgl_xml_set_prop_string (node, "category", category); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Template->Label Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_label_node (const lglTemplateFrame *frame, + xmlNodePtr root, + const xmlNsPtr ns) +{ + xmlNodePtr node; + GList *p; + lglTemplateMarkup *markup; + lglTemplateLayout *layout; + + switch (frame->shape) { + + case LGL_TEMPLATE_FRAME_SHAPE_RECT: + node = xmlNewChild(root, ns, (xmlChar *)"Label-rectangle", NULL); + lgl_xml_set_prop_string (node, "id", frame->all.id); + lgl_xml_set_prop_length (node, "width", frame->rect.w); + lgl_xml_set_prop_length (node, "height", frame->rect.h); + lgl_xml_set_prop_length (node, "round", frame->rect.r); + lgl_xml_set_prop_length (node, "x_waste", frame->rect.x_waste); + lgl_xml_set_prop_length (node, "y_waste", frame->rect.y_waste); + break; + + case LGL_TEMPLATE_FRAME_SHAPE_ROUND: + node = xmlNewChild(root, ns, (xmlChar *)"Label-round", NULL); + lgl_xml_set_prop_string (node, "id", frame->all.id); + lgl_xml_set_prop_length (node, "radius", frame->round.r); + lgl_xml_set_prop_length (node, "waste", frame->round.waste); + break; + + case LGL_TEMPLATE_FRAME_SHAPE_CD: + node = xmlNewChild(root, ns, (xmlChar *)"Label-cd", NULL); + lgl_xml_set_prop_string (node, "id", frame->all.id); + lgl_xml_set_prop_length (node, "radius", frame->cd.r1); + lgl_xml_set_prop_length (node, "hole", frame->cd.r2); + if (frame->cd.w != 0.0) { + lgl_xml_set_prop_length (node, "width", frame->cd.w); + } + if (frame->cd.h != 0.0) { + lgl_xml_set_prop_length (node, "height", frame->cd.h); + } + lgl_xml_set_prop_length (node, "waste", frame->cd.waste); + break; + + default: + g_message ("Unknown label style"); + return; + break; + + } + + for ( p=frame->all.markups; p != NULL; p=p->next ) { + markup = (lglTemplateMarkup *)p->data; + switch (markup->type) { + case LGL_TEMPLATE_MARKUP_MARGIN: + xml_create_markup_margin_node (markup, node, ns); + break; + case LGL_TEMPLATE_MARKUP_LINE: + xml_create_markup_line_node (markup, node, ns); + break; + case LGL_TEMPLATE_MARKUP_CIRCLE: + xml_create_markup_circle_node (markup, node, ns); + break; + case LGL_TEMPLATE_MARKUP_RECT: + xml_create_markup_rect_node (markup, node, ns); + break; + default: + g_message ("Unknown markup type"); + break; + } + } + + for ( p=frame->all.layouts; p != NULL; p=p->next ) { + layout = (lglTemplateLayout *)p->data; + xml_create_layout_node (layout, node, ns); + } + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Template->Label->Layout Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_layout_node (const lglTemplateLayout *layout, + xmlNodePtr root, + const xmlNsPtr ns) +{ + xmlNodePtr node; + + node = xmlNewChild(root, ns, (xmlChar *)"Layout", NULL); + lgl_xml_set_prop_int (node, "nx", layout->nx); + lgl_xml_set_prop_int (node, "ny", layout->ny); + lgl_xml_set_prop_length (node, "x0", layout->x0); + lgl_xml_set_prop_length (node, "y0", layout->y0); + lgl_xml_set_prop_length (node, "dx", layout->dx); + lgl_xml_set_prop_length (node, "dy", layout->dy); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Template->Label->Markup-margin Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_markup_margin_node (const lglTemplateMarkup *markup, + xmlNodePtr root, + const xmlNsPtr ns) +{ + xmlNodePtr node; + + node = xmlNewChild(root, ns, (xmlChar *)"Markup-margin", NULL); + + lgl_xml_set_prop_length (node, "size", markup->margin.size); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Template->Label->Markup-line Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_markup_line_node (const lglTemplateMarkup *markup, + xmlNodePtr root, + const xmlNsPtr ns) +{ + xmlNodePtr node; + + node = xmlNewChild(root, ns, (xmlChar *)"Markup-line", NULL); + + lgl_xml_set_prop_length (node, "x1", markup->line.x1); + lgl_xml_set_prop_length (node, "y1", markup->line.y1); + lgl_xml_set_prop_length (node, "x2", markup->line.x2); + lgl_xml_set_prop_length (node, "y2", markup->line.y2); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Template->Label->Markup-circle Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_markup_circle_node (const lglTemplateMarkup *markup, + xmlNodePtr root, + const xmlNsPtr ns) +{ + xmlNodePtr node; + + node = xmlNewChild(root, ns, (xmlChar *)"Markup-circle", NULL); + + lgl_xml_set_prop_length (node, "x0", markup->circle.x0); + lgl_xml_set_prop_length (node, "y0", markup->circle.y0); + lgl_xml_set_prop_length (node, "radius", markup->circle.r); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Template->Label->Markup-rect Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_markup_rect_node (const lglTemplateMarkup *markup, + xmlNodePtr root, + const xmlNsPtr ns) +{ + xmlNodePtr node; + + node = xmlNewChild(root, ns, (xmlChar *)"Markup-rect", NULL); + + lgl_xml_set_prop_length (node, "x1", markup->rect.x1); + lgl_xml_set_prop_length (node, "y1", markup->rect.y1); + lgl_xml_set_prop_length (node, "w", markup->rect.w); + lgl_xml_set_prop_length (node, "h", markup->rect.h); + lgl_xml_set_prop_length (node, "r", markup->rect.r); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Template->Alias Node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_alias_node (const lglTemplateAlias *alias, + xmlNodePtr root, + const xmlNsPtr ns) +{ + xmlNodePtr node; + + node = xmlNewChild (root, ns, (xmlChar *)"Alias", NULL); + + lgl_xml_set_prop_string (node, "brand", alias->brand); + lgl_xml_set_prop_string (node, "part", alias->part); + +} + diff --git a/libglabels/xml-template.h b/libglabels/xml-template.h new file mode 100644 index 00000000..b940db32 --- /dev/null +++ b/libglabels/xml-template.h @@ -0,0 +1,55 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * xml-template.h: template xml module header file + * + * Copyright (C) 2001-2004 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __XML_TEMPLATE_H__ +#define __XML_TEMPLATE_H__ + +#include +#include + +#include "template.h" + +G_BEGIN_DECLS + +GList *lgl_xml_template_read_templates_from_file (const gchar *utf8_filename); + +GList *lgl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc); + +lglTemplate *lgl_xml_template_parse_template_node (const xmlNodePtr template_node); + + +gint lgl_xml_template_write_templates_to_file (GList *templates, + const gchar *utf8_filename); + +gint lgl_xml_template_write_template_to_file (const lglTemplate *template, + const gchar *utf8_filename); + +void lgl_xml_template_create_template_node (const lglTemplate *template, + xmlNodePtr root, + const xmlNsPtr ns); + +G_END_DECLS + +#endif /* __XML_TEMPLATE_H__ */ diff --git a/libglabels/xml.c b/libglabels/xml.c new file mode 100644 index 00000000..0943d908 --- /dev/null +++ b/libglabels/xml.c @@ -0,0 +1,539 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * xml.c: GLabels xml utilities module + * + * Copyright (C) 2003, 2004 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ +#include + +#include "xml.h" + +#include +#include +#include +#include + +#include "libglabels-private.h" + + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +#define POINTS_PER_POINT 1.0 /* internal units are points. */ +#define POINTS_PER_INCH 72.0 +#define POINTS_PER_MM 2.83464566929 +#define POINTS_PER_CM (10.0*POINTS_PER_MM) +#define POINTS_PER_PICA (1.0/12.0) + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +typedef struct { + xmlChar *name; + gdouble points_per_unit; +} UnitTableEntry; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +static UnitTableEntry unit_table[] = { + + /* These names are identical to the absolute length units supported in + the CSS2 Specification (Section 4.3.2) */ + + /* This table must be sorted exactly as the enumerations in lglUnitsType */ + + /* [LGL_UNITS_POINT] */ {(xmlChar *)"pt", POINTS_PER_POINT}, + /* [LGL_UNITS_INCH] */ {(xmlChar *)"in", POINTS_PER_INCH}, + /* [LGL_UNITS_MM] */ {(xmlChar *)"mm", POINTS_PER_MM}, + /* [LGL_UNITS_CM] */ {(xmlChar *)"cm", POINTS_PER_CM}, + /* [LGL_UNITS_PICA] */ {(xmlChar *)"pc", POINTS_PER_PICA}, + +}; + +static lglUnitsType default_units = LGL_UNITS_POINT; + + +/****************************************************************************/ + +/** + * lgl_xml_get_prop_string: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @default_val: a default value to return if property not found + * + * Return value of property as a string. + * + * Returns: the property as a pointer to a gchar string. This string should + * be freed with g_free(). + * + */ +gchar * +lgl_xml_get_prop_string (xmlNodePtr node, + const gchar *property, + const gchar *default_val) +{ + gchar *val; + xmlChar *string; + + string = xmlGetProp (node, (xmlChar *)property); + if ( string != NULL ) { + val = g_strdup ((gchar *)string); + xmlFree (string); + return val; + } + + if (default_val) { + return g_strdup (default_val); + } + + return NULL; +} + + +/** + * lgl_xml_get_prop_i18n_string: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @default_val: a default value to return if property not found + * + * Return value of a translatable property as a string. + * + * Returns: the property as a pointer to a gchar string. This string should + * be freed with g_free(). + * + */ +gchar * +lgl_xml_get_prop_i18n_string (xmlNodePtr node, + const gchar *property, + const gchar *default_val) +{ + gchar *_property; + gchar *val; + xmlChar *string; + + _property = g_strdup_printf ("_%s", property); + string = xmlGetProp (node, (xmlChar *)_property); + g_free (_property); + + if ( string != NULL ) { + + val = g_strdup (gettext ((char *)string)); + xmlFree (string); + return val; + + } + + string = xmlGetProp (node, (xmlChar *)property); + if ( string != NULL ) { + val = g_strdup ((gchar *)string); + xmlFree (string); + return val; + } + + if (default_val) { + return g_strdup (default_val); + } + + return NULL; +} + + +/** + * lgl_xml_get_prop_double: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @default_val: a default value to return if property not found + * + * Return value of property as a double. + * + * Returns: the property as a double. + * + */ +gdouble +lgl_xml_get_prop_double (xmlNodePtr node, + const gchar *property, + gdouble default_val) +{ + gdouble val; + xmlChar *string; + + string = xmlGetProp (node, (xmlChar *)property); + if ( string != NULL ) { + val = g_strtod ((gchar *)string, NULL); + xmlFree (string); + return val; + } + + return default_val; +} + + +/** + * lgl_xml_get_prop_boolean: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @default_val: a default value to return if property not found + * + * Return value of property as a boolean. + * + * Returns: the property as a boolean. + * + */ +gboolean +lgl_xml_get_prop_boolean (xmlNodePtr node, + const gchar *property, + gboolean default_val) +{ + gboolean val; + xmlChar *string; + + string = xmlGetProp (node, (xmlChar *)property); + if ( string != NULL ) { + val = !((xmlStrcasecmp (string, (xmlChar *)"false") == 0) || + xmlStrEqual (string, (xmlChar *)"0"));; + xmlFree (string); + return val; + } + + return default_val; +} + + +/** + * lgl_xml_get_prop_int: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @default_val: a default value to return if property not found + * + * Return value of property as an integer. + * + * Returns: the property as an integer. + * + */ +gint +lgl_xml_get_prop_int (xmlNodePtr node, + const gchar *property, + gint default_val) +{ + gint val; + xmlChar *string; + + string = xmlGetProp (node, (xmlChar *)property); + if ( string != NULL ) { + val = strtol ((char *)string, NULL, 0); + xmlFree (string); + return val; + } + + return default_val; +} + + +/** + * lgl_xml_get_prop_uint: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @default_val: a default value to return if property not found + * + * Return value of property (usually formatted in hex) as an unsigned integer. + * + * Returns: the property as an unsigned integer. + * + */ +guint +lgl_xml_get_prop_uint (xmlNodePtr node, + const gchar *property, + guint default_val) +{ + guint val; + xmlChar *string; + + string = xmlGetProp (node, (xmlChar *)property); + if ( string != NULL ) { + val = strtoul ((char *)string, NULL, 0); + xmlFree (string); + return val; + } + + return default_val; +} + + +/** + * lgl_xml_get_prop_length: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @default_val: a default value to return if property not found + * + * Return value of a length property as a double, converting to internal + * units (points). The property is expected to be formatted as a number + * followed by a units string. If there is no units string, the length + * is assumed to be in points. Valid units strings are "pt" for points, + * "in" for inches, "mm" for millimeters, "cm" for centimeters, and + * "pc" for picas. + * + * Returns: the length in points. + * + */ +gdouble +lgl_xml_get_prop_length (xmlNodePtr node, + const gchar *property, + gdouble default_val) +{ + gdouble val; + xmlChar *string; + xmlChar *unit; + gint i; + + string = xmlGetProp (node, (xmlChar *)property); + if ( string != NULL ) { + + val = g_strtod ((gchar *)string, (gchar **)&unit); + + if (unit != string) { + unit = (xmlChar *)g_strchug ((gchar *)unit); + if (strlen ((char *)unit) > 0 ) { + for (i=LGL_UNITS_FIRST; i<=LGL_UNITS_LAST; i++) { + if (xmlStrcasecmp (unit, unit_table[i].name) == 0) { + val *= unit_table[i].points_per_unit; + break; + } + } + if (i>LGL_UNITS_LAST) { + g_message ("Line %ld, Node \"%s\", Property \"%s\": Unknown unit \"%s\", assuming points", + xmlGetLineNo (node), node->name, property, + unit); + } + } + } + else { + val = 0.0; + } + + xmlFree (string); + return val; + } + + return default_val; +} + + +/** + * lgl_xml_set_prop_string: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @val: the value to set + * + * Set a property from a string. + * + */ +void +lgl_xml_set_prop_string (xmlNodePtr node, + const gchar *property, + const gchar *val) +{ + if (val != NULL) { + xmlSetProp (node, (xmlChar *)property, (xmlChar *)val); + } +} + + +/** + * lgl_xml_set_prop_double: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @val: the value to set + * + * Set a property from a double. + * + */ +void +lgl_xml_set_prop_double (xmlNodePtr node, + const gchar *property, + gdouble val) +{ + gchar *string, buffer[G_ASCII_DTOSTR_BUF_SIZE]; + + /* Guarantee "C" locale by use of g_ascii_formatd */ + string = g_ascii_formatd (buffer, G_ASCII_DTOSTR_BUF_SIZE, "%g", val); + + xmlSetProp (node, (xmlChar *)property, (xmlChar *)string); +} + + +/** + * lgl_xml_set_prop_boolean: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @val: the value to set + * + * Set a property from a boolean. + * + */ +void +lgl_xml_set_prop_boolean (xmlNodePtr node, + const gchar *property, + gboolean val) +{ + xmlSetProp (node, (xmlChar *)property, (xmlChar *)(val ? "True" : "False")); +} + +/** + * lgl_xml_set_prop_int: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @val: the value to set + * + * Set a property from an integer. + * + */ +void +lgl_xml_set_prop_int (xmlNodePtr node, + const gchar *property, + gint val) +{ + gchar *string; + + string = g_strdup_printf ("%d", val); + xmlSetProp (node, (xmlChar *)property, (xmlChar *)string); + g_free (string); +} + +/** + * lgl_xml_set_prop_uint_hex: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @val: the value to set + * + * Set a property from an unsigned integer and format in hex. + * + */ +void +lgl_xml_set_prop_uint_hex (xmlNodePtr node, + const gchar *property, + guint val) +{ + gchar *string; + + string = g_strdup_printf ("0x%08x", val); + xmlSetProp (node, (xmlChar *)property, (xmlChar *)string); + g_free (string); +} + +/** + * lgl_xml_set_prop_length: + * @node: the libxml2 #xmlNodePtr of the node + * @property: the property name + * @val: the length to set in internal units (points) + * + * Set a property from a length, performing any necessary conversion. + * Length properties are formatted as a number followed by a units string. + * The units of the formatted property is determined by the most recent call to + * lgl_xml_set_default_units(). + * + */ +void +lgl_xml_set_prop_length (xmlNodePtr node, + const gchar *property, + gdouble val) +{ + gchar *string, buffer[G_ASCII_DTOSTR_BUF_SIZE]; + gchar *string_unit; + + /* Convert to default units */ + val /= unit_table[default_units].points_per_unit; + + /* Guarantee "C" locale by use of g_ascii_formatd */ + string = g_ascii_formatd (buffer, G_ASCII_DTOSTR_BUF_SIZE, "%g", val); + + string_unit = g_strdup_printf ("%s%s", string, unit_table[default_units].name); + xmlSetProp (node, (xmlChar *)property, (xmlChar *)string_unit); + g_free (string_unit); +} + +/** + * lgl_xml_is_node + * @node: the libxml2 #xmlNodePtr of the node + * @name : the node name + * + * Test if a node name matches given name. + * + * Returns: TRUE if the name of the node matches. Otherwise FALSE. + * + */ +gboolean +lgl_xml_is_node (xmlNodePtr node, + const gchar *name) +{ + return xmlStrEqual (node->name, (xmlChar *)name); +} + + +/** + * lgl_xml_get_node_content + * @node: the libxml2 #xmlNodePtr of the node + * + * Get the content of a node. + * + * Returns: the property as a pointer to a gchar string. This string should + * be freed with g_free(). + */ +gchar * +lgl_xml_get_node_content (xmlNodePtr node) +{ + xmlChar *xml_content; + gchar *g_content; + + xml_content = xmlNodeGetContent (node); + + if (xml_content != NULL) { + + g_content = g_strdup ((gchar *)xml_content); + xmlFree (xml_content); + return g_content; + + } + + return NULL; +} + + +/** + * lgl_xml_set_default_units: + * @units: default units selection (#lglUnitsType) + * + * Set the default units when formatting lengths. See + * lgl_xml_set_prop_length(). + * + */ +void +lgl_xml_set_default_units (lglUnitsType units) +{ + g_return_if_fail ((units >= LGL_UNITS_FIRST) && (units <= LGL_UNITS_LAST)); + + default_units = units; +} + + diff --git a/libglabels/xml.h b/libglabels/xml.h new file mode 100644 index 00000000..3ef2e495 --- /dev/null +++ b/libglabels/xml.h @@ -0,0 +1,113 @@ +/* + * (LIBGLABELS) Template library for GLABELS + * + * xml.h: GLabels xml utilities header file + * + * Copyright (C) 2003, 2004 Jim Evins . + * + * This file is part of the LIBGLABELS 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., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA + */ + +#ifndef __XML_H__ +#define __XML_H__ + +#include +#include + +#include "enums.h" + +#define LGL_XML_NAME_SPACE "http://snaught.com/glabels/2.2/" + +G_BEGIN_DECLS + +/* + * Get property functions + */ +gchar * lgl_xml_get_prop_string (xmlNodePtr node, + const gchar *property, + const gchar *default_val); + +gchar * lgl_xml_get_prop_i18n_string (xmlNodePtr node, + const gchar *property, + const gchar *default_val); + +gdouble lgl_xml_get_prop_double (xmlNodePtr node, + const gchar *property, + gdouble default_val); + +gboolean lgl_xml_get_prop_boolean (xmlNodePtr node, + const gchar *property, + gboolean default_val); + +gint lgl_xml_get_prop_int (xmlNodePtr node, + const gchar *property, + gint default_val); + +guint lgl_xml_get_prop_uint (xmlNodePtr node, + const gchar *property, + guint default_val); + +gdouble lgl_xml_get_prop_length (xmlNodePtr node, + const gchar *property, + gdouble default_val); + + +/* + * Set property functions + */ +void lgl_xml_set_prop_string (xmlNodePtr node, + const gchar *property, + const gchar *val); + +void lgl_xml_set_prop_double (xmlNodePtr node, + const gchar *property, + gdouble val); + +void lgl_xml_set_prop_boolean (xmlNodePtr node, + const gchar *property, + gboolean val); + +void lgl_xml_set_prop_int (xmlNodePtr node, + const gchar *property, + gint val); + +void lgl_xml_set_prop_uint_hex (xmlNodePtr node, + const gchar *property, + guint val); + +void lgl_xml_set_prop_length (xmlNodePtr node, + const gchar *property, + gdouble val); + +/* + * Other node functions + */ +gboolean lgl_xml_is_node (xmlNodePtr node, + const gchar *name); + +gchar * lgl_xml_get_node_content (xmlNodePtr node); + +/* + * Misc functions + */ +void lgl_xml_set_default_units (lglUnitsType units); + +G_END_DECLS + + +#endif /* __XML_H__ */ diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 00000000..65db50a5 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,186 @@ +# List of source files containing translatable strings. + +src/glabels.c +src/glabels-batch.c +src/window.c +src/window.h +src/stock.c +src/stock.h +src/ui.h +src/ui.c +src/ui-property-bar.h +src/ui-property-bar.c +src/ui-sidebar.h +src/ui-sidebar.c +src/ui-util.h +src/ui-util.c +src/ui-commands.h +src/ui-commands.c +src/file.h +src/file.c +src/recent.h +src/recent.c +src/prefs.c +src/prefs.h +src/prefs-model.c +src/prefs-model.h +src/prefs-dialog.c +src/prefs-dialog.h +src/hig.h +src/view.c +src/view.h +src/view-object.c +src/view-object.h +src/view-box.c +src/view-box.h +src/view-ellipse.c +src/view-ellipse.h +src/view-line.c +src/view-line.h +src/view-image.c +src/view-image.h +src/view-text.c +src/view-text.h +src/view-barcode.c +src/view-barcode.h +src/object-editor.c +src/object-editor.h +src/object-editor-private.h +src/object-editor-bc-page.c +src/object-editor-data-page.c +src/object-editor-edit-page.c +src/object-editor-fill-page.c +src/object-editor-image-page.c +src/object-editor-line-page.c +src/object-editor-lsize-page.c +src/object-editor-position-page.c +src/object-editor-size-page.c +src/object-editor-text-page.c +src/merge-properties-dialog.c +src/merge-properties-dialog.h +src/print.c +src/print.h +src/print-op.c +src/template-designer.c +src/template-designer.h +src/bc.c +src/bc.h +src/bc-gnubarcode.c +src/bc-gnubarcode.h +src/bc-postnet.c +src/bc-postnet.h +src/label.c +src/label.h +src/label-object.c +src/label-object.h +src/label-text.c +src/label-text.h +src/label-box.c +src/label-box.h +src/label-line.c +src/label-line.h +src/label-ellipse.c +src/label-ellipse.h +src/label-image.c +src/label-image.h +src/label-barcode.c +src/label-barcode.h +src/xml-label.c +src/xml-label.h +src/xml-label-04.c +src/xml-label-04.h +src/pixbuf-cache.c +src/pixbuf-cache.h +src/base64.c +src/base64.h +src/merge.c +src/merge.h +src/merge-init.c +src/merge-init.h +src/merge-text.c +src/merge-text.h +src/merge-evolution.c +src/text-node.c +src/text-node.h +src/wdgt-print-copies.c +src/wdgt-print-copies.h +src/wdgt-print-merge.c +src/wdgt-print-merge.h +src/wdgt-media-select.c +src/wdgt-media-select.h +src/wdgt-mini-preview.c +src/wdgt-mini-preview.h +src/wdgt-rotate-label.c +src/wdgt-rotate-label.h +src/wdgt-chain-button.c +src/wdgt-chain-button.h +src/util.c +src/util.h +src/color.c +src/color.h +src/debug.c +src/debug.h +src/mygal/color-group.c +src/mygal/color-group.h +src/mygal/color-palette.c +src/mygal/color-palette.h +src/mygal/e-colors.c +src/mygal/e-colors.h +src/mygal/e-util.h +src/mygal/mygal-combo-box.c +src/mygal/mygal-combo-box.h +src/mygal/widget-color-combo.c +src/mygal/widget-color-combo.h +src/critical-error-handler.c +src/warning-handler.c + +libglabels/category.c +libglabels/category.h +libglabels/db.c +libglabels/db.h +libglabels/enums.h +libglabels/libglabels.h +libglabels/libglabels-private.h +libglabels/paper.c +libglabels/paper.h +libglabels/str.c +libglabels/str.h +libglabels/template.c +libglabels/template.h +libglabels/xml.c +libglabels/xml.h +libglabels/xml-category.c +libglabels/xml-category.h +libglabels/xml-paper.c +libglabels/xml-paper.h +libglabels/xml-template.c +libglabels/xml-template.h + +data/glade/merge-properties-dialog.glade +data/glade/new-label-dialog.glade +data/glade/object-editor.glade +data/glade/prefs-dialog.glade +data/glade/print-custom-widget.glade +data/glade/property-bar.glade +data/glade/template-designer.glade +data/glade/wdgt-media-select.glade +data/glade/wdgt-rotate-label.glade + +data/templates/paper-sizes.xml +data/templates/categories.xml +data/templates/avery-iso-templates.xml +data/templates/avery-other-templates.xml +data/templates/avery-us-templates.xml +data/templates/brother-other-templates.xml +data/templates/dymo-other-templates.xml +data/templates/misc-iso-templates.xml +data/templates/misc-other-templates.xml +data/templates/misc-us-templates.xml +data/templates/zweckform-iso-templates.xml + +data/desktop/glabels.desktop.in + +data/mime/glabels.keys.in +data/mime/glabels.xml.in + +barcode-0.98/compat/getopt.c diff --git a/po/cs.po b/po/cs.po new file mode 100644 index 00000000..83b65caa --- /dev/null +++ b/po/cs.po @@ -0,0 +1,2484 @@ +# cs translation of Glabels. +# Copyright (C) 2005 THE Glabels'S COPYRIGHT HOLDER +# This file is distributed under the same license as the Glabels package. +# David Makovský (Yakeen) , 2005 +# Zbynek Mrkvicka , 2005 +# +msgid "" +msgstr "" +"Project-Id-Version: Glabels 2.0.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-01-22 11:49-0500\n" +"PO-Revision-Date: 2005-02-02 21:35+0100\n" +"Last-Translator: David Makovský (Yakeen) \n" +"Language-Team: cs \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit" + +#: src/glabels.c:116 +msgid "Could not initialize Bonobo!\n" +msgstr "Nepodařila se inicializace Bonobo serveru!\n" + +#: src/glabels-batch.c:52 +msgid "print this message" +msgstr "tisk této zprávy" + +#: src/glabels-batch.c:54 +msgid "print the version of glabels-batch being used" +msgstr "vypíše verzi glabels-batch, která je používána" + +#: src/glabels-batch.c:56 +msgid "set output filename (default=\"output.ps\")" +msgstr "nastavte jméno souboru výstupu (standartně=\"output.ps\")" + +#: src/glabels-batch.c:56 src/glabels-batch.c:70 +msgid "filename" +msgstr "název souboru" + +#: src/glabels-batch.c:58 +msgid "number of sheets (default=1)" +msgstr "počet stránek (standartně=1)" + +#: src/glabels-batch.c:58 +msgid "sheets" +msgstr "seÅ¡ity" + +#: src/glabels-batch.c:60 +msgid "number of copies (default=1)" +msgstr "počet kopií (standartní nastavení = 1)" + +#: src/glabels-batch.c:60 +msgid "copies" +msgstr "kopie" + +#: src/glabels-batch.c:62 +msgid "first label on first sheet (default=1)" +msgstr "první etiketa na prvním listu (standartně=1)" + +#: src/glabels-batch.c:62 +msgid "first" +msgstr "první" + +#: src/glabels-batch.c:64 src/print-dialog.c:336 +msgid "print outlines (to test printer alignment)" +msgstr "tisk obrysů (test zarovnávání tiskárny)" + +#: src/glabels-batch.c:66 src/print-dialog.c:344 +msgid "print in reverse (i.e. a mirror image)" +msgstr "obrácený tisk (např. převrácený obrázek)" + +#: src/glabels-batch.c:68 src/print-dialog.c:351 +msgid "print crop marks" +msgstr "tisknout značky pro ořez" + +#: src/glabels-batch.c:70 +msgid "input file for merging" +msgstr "vstupní soubor pro sloučení" + +#: src/glabels-batch.c:107 +msgid "[OPTION...] GLABELS_FILE..." +msgstr "" + +#: src/glabels-batch.c:127 +#, c-format +msgid "missing glabels file\n" +msgstr "chybí soubor programu glabels\n" + +#: src/glabels-batch.c:158 +#, c-format +msgid "cannot perform document merge with glabels file %s\n" +msgstr "" + +#: src/glabels-batch.c:182 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "nepodařilo se otevřít soubor programu glabels %s\n" + +#: src/window.c:244 +msgid "(none) - gLabels" +msgstr "(žádný) - gLabels" + +#: src/window.c:414 +msgid "(modified)" +msgstr "(modifikováno)" + +#: src/stock.c:65 data/ui/glabels-ui.xml.h:162 +msgid "_Select Mode" +msgstr "Mód výběru" + +#: src/stock.c:66 data/ui/glabels-ui.xml.h:163 +msgid "_Text" +msgstr "_Text" + +#: src/stock.c:67 data/ui/glabels-ui.xml.h:148 +msgid "_Line" +msgstr "Čár_a" + +#: src/stock.c:68 data/ui/glabels-ui.xml.h:130 +msgid "_Box" +msgstr "O_bdélník" + +#: src/stock.c:69 data/ui/glabels-ui.xml.h:141 +msgid "_Ellipse" +msgstr "_Elipsa" + +#: src/stock.c:70 data/ui/glabels-ui.xml.h:146 +msgid "_Image" +msgstr "Obrá_zek" + +#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 +msgid "Bar_code" +msgstr "Čárový _kód" + +#: src/stock.c:72 +msgid "_Merge Properties" +msgstr "Vlastnosti sloučení" + +#: src/stock.c:73 +msgid "Object _Properties" +msgstr "Nastavení objektu" + +#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 +msgid "Bring to _Front" +msgstr "Vynést dopředu" + +#: src/stock.c:75 data/ui/glabels-ui.xml.h:109 +msgid "Send to _Back" +msgstr "Poslat _dozadu" + +#: src/stock.c:76 data/ui/glabels-ui.xml.h:96 +msgid "Rotate _Left" +msgstr "Otočit do_leva" + +#: src/stock.c:77 data/ui/glabels-ui.xml.h:97 +msgid "Rotate _Right" +msgstr "Otočit do_prava" + +#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 +msgid "Flip _Horizontally" +msgstr "Převrátit _vodorovně" + +#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 +msgid "Flip _Vertically" +msgstr "Převrátit _svisle" + +#: src/stock.c:80 data/ui/glabels-ui.xml.h:147 +msgid "_Lefts" +msgstr "Nalevo" + +#: src/stock.c:81 data/ui/glabels-ui.xml.h:159 +msgid "_Rights" +msgstr "Napravo" + +#: src/stock.c:82 data/ui/glabels-ui.xml.h:131 +msgid "_Centers" +msgstr "_Nastřed" + +#: src/stock.c:83 data/ui/glabels-ui.xml.h:164 +msgid "_Tops" +msgstr "Nahoru" + +#: src/stock.c:84 +msgid "Bottoms" +msgstr "Naspod" + +#: src/stock.c:85 +msgid "Centers" +msgstr "Nastřed" + +#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 +msgid "Label Ce_nter" +msgstr "Střed etikety" + +#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 +msgid "Fill color" +msgstr "Barva výplně" + +#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 +msgid "Line color" +msgstr "Barva čáry" + +#: src/stock.c:90 src/stock.c:92 +msgid "Linked" +msgstr "Spojeno" + +#: src/stock.c:91 src/stock.c:93 +msgid "Not Linked" +msgstr "Nespojeno" + +#: src/ui-property-bar.c:345 src/object-editor.c:499 +msgid "Default" +msgstr "Výchozí" + +#: src/ui-property-bar.c:360 src/object-editor.c:512 +msgid "No fill" +msgstr "Bez výplně" + +#: src/ui-property-bar.c:375 src/object-editor.c:505 +msgid "No line" +msgstr "" + +#: src/ui-sidebar.c:180 +msgid "Object properties" +msgstr "Vlastnosti objektu" + +#: src/commands.c:385 +msgid "" +"A label and business card creation program for GNOME.\n" +" \n" +"Glabels is free software; you can redistribute it and/or modify it under the " +"terms of the GNU General Public License as published by the Free Software " +"Foundation; either version 2 of the License, or (at your option) any later " +"version.\n" +" \n" +"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.\n" +msgstr "" +"Program pro tvorbu etiket a vizitek v prostředí GNOME.\n" +" \n" +"Glabels je svobodný software, můžete s ním nakládat podle GPL licence verze " +"2, nebo jakoukoliv pozdější.\n" +" \n" +"Program je distribuován s nadějí, že bude nápomocen, ale je distribuován bez " +"ručení záruky, tak jak je uvedeno v GPL Licenci verze 2. Pro další detaily " +"si přečtěte tuto licenci.\n" + +#: src/commands.c:399 +msgid "See the file AUTHORS for additional credits," +msgstr "Prohlédněte si soubor AUTHORS pro dodatečné informace," + +#: src/commands.c:400 +msgid "or visit http://glabels.sourceforge.net/" +msgstr "nebo navÅ¡tivte http://glabels.sourceforge.net/" + +#: src/commands.c:409 +msgid " " +msgstr "" + +#: src/commands.c:424 +msgid "glabels" +msgstr "glabels" + +#: src/file.c:100 +msgid "New Label or Card" +msgstr "Nová etiketa či vizitka" + +#: src/file.c:132 src/file.c:304 +msgid "Media Type" +msgstr "Typ média" + +#: src/file.c:138 src/file.c:310 +msgid "Label orientation" +msgstr "Orientace etikety" + +#: src/file.c:269 +msgid "Label properties" +msgstr "Vlastnosti etikety" + +#: src/file.c:452 src/file.c:870 +msgid "All files" +msgstr "VÅ¡echny soubory" + +#: src/file.c:457 src/file.c:875 +msgid "gLabels documents" +msgstr "Dokumenty gLabels" + +#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 +msgid "Empty file name selection" +msgstr "Prázdné pole jména souboru" + +#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 +msgid "Please select a file or supply a valid file name" +msgstr "Vyberte, prosím, soubor, nebo vypiÅ¡te platné jméno souboru" + +#: src/file.c:519 src/file.c:631 +msgid "File does not exist" +msgstr "Soubor neexistuje" + +#: src/file.c:563 data/ui/glabels-ui.xml.h:74 +msgid "Open" +msgstr "Otevřít" + +#: src/file.c:565 +msgid "Open label" +msgstr "Otevřít etiketu" + +#: src/file.c:707 +#, c-format +msgid "Could not open file \"%s\"" +msgstr "nepodařilo se otevřít soubor \"%s\"" + +#: src/file.c:715 +msgid "Not a supported file format" +msgstr "Formát tohoto souboru není podporován" + +#: src/file.c:797 src/file.c:979 src/file.c:1174 +#, c-format +msgid "Could not save file \"%s\"" +msgstr "Nepodařilo se uložit soubor \"%s\"" + +#: src/file.c:805 src/file.c:987 src/file.c:1182 +msgid "Error encountered during save. The file is still not saved." +msgstr "Při ukládání se vyskytla chyba. Soubor nebyl uložen." + +#: src/file.c:848 src/file.c:1048 +#, c-format +msgid "Save \"%s\" as" +msgstr "Uložit \"%s\" jako" + +#: src/file.c:935 src/file.c:1131 +msgid "Please supply a valid file name" +msgstr "Prosím vepiÅ¡te platné jméno souboru" + +#: src/file.c:952 src/file.c:1147 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "Přepsat soubor \"%s\"?" + +#: src/file.c:960 src/file.c:1155 +msgid "File already exists." +msgstr "Soubor již existuje." + +#: src/file.c:1271 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "Uložit před zavřením změny v dokumentu \"%s\"?" + +#: src/file.c:1279 +msgid "Your changes will be lost if you don't save them." +msgstr "VaÅ¡e změny budou ztraceny pokud je neuložíte." + +#: src/file.c:1282 +msgid "Close without saving" +msgstr "Zavřít bez uložení" + +#. Should not happen +#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 +#: data/glade/object-editor.glade.h:37 +msgid "points" +msgstr "bodů" + +#: src/prefs.c:158 data/glade/object-editor.glade.h:36 +#: data/glade/template-designer.glade.h:74 +msgid "inches" +msgstr "palce" + +#: src/prefs.c:160 +msgid "mm" +msgstr "mm" + +#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 +msgid "gLabels Preferences" +msgstr "Nastavení programu gLabels" + +#. +#. * Submenu: Order +#. +#: src/view.c:3574 data/ui/glabels-ui.xml.h:154 +msgid "_Order" +msgstr "_Pořadí" + +#. +#. * Submenu: Rotate/Flip +#. +#: src/view.c:3595 data/ui/glabels-ui.xml.h:160 +msgid "_Rotate/Flip" +msgstr "_Rotace/Převrácení" + +#. +#. * Submenu: Align Horizontally +#. +#: src/view.c:3628 +msgid "Align _Horizontally" +msgstr "Zarovnat _vodorovně" + +#. +#. * Submenu: Align Vertically +#. +#: src/view.c:3667 +msgid "Align _Vertically" +msgstr "Zarovnat _svisle" + +#: src/view.c:3728 data/ui/glabels-ui.xml.h:137 +msgid "_Delete" +msgstr "_Smazat" + +#. Build editor. +#: src/view-box.c:224 +msgid "Box object properties" +msgstr "Vlastnosti obdélníku/čtverce" + +#. Build editor. +#: src/view-ellipse.c:224 +msgid "Ellipse object properties" +msgstr "Vlastnosti elipsy" + +#. Build editor. +#: src/view-line.c:224 +msgid "Line object properties" +msgstr "Vlastnosti čáry" + +#. Build editor. +#: src/view-image.c:223 +msgid "Image object properties" +msgstr "Vlastnosti obrázku" + +#. Build editor. +#: src/view-text.c:251 +msgid "Text object properties" +msgstr "Vlastnosti textu" + +#: src/view-text.c:563 data/glade/object-editor.glade.h:28 +msgid "Text" +msgstr "Text" + +#. Build editor. +#: src/view-barcode.c:210 +msgid "Barcode object properties" +msgstr "Vlastnosti čárového kódu" + +#: src/view-barcode.c:580 src/print.c:1089 +msgid "Invalid barcode data" +msgstr "Neplatná data čárového kódu" + +#: src/merge-properties-dialog.c:231 +msgid "Merge Properties" +msgstr "Nastavení sloučení" + +#. ---- Source section ---- +#: src/merge-properties-dialog.c:237 +msgid "Source" +msgstr "Zdroj" + +#: src/merge-properties-dialog.c:245 +msgid "Format:" +msgstr "Formát:" + +#. Location line +#: src/merge-properties-dialog.c:273 +msgid "Location:" +msgstr "Umístění:" + +#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 +msgid "Select merge-database source" +msgstr "Výběr databázového zdroje pro sloučení" + +#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 +msgid "N/A" +msgstr "Není k dispozici" + +#. ---- Sample Fields section ---- +#: src/merge-properties-dialog.c:300 +msgid "Record selection/preview:" +msgstr "Náhled na záznam výběru" + +#: src/merge-properties-dialog.c:326 +msgid "Select" +msgstr "Výběr" + +#: src/merge-properties-dialog.c:334 +msgid "Record/Field" +msgstr "Záznam/Pole" + +#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 +msgid "Data" +msgstr "Data" + +#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:81 +msgid "Print" +msgstr "Tisk" + +#: src/print-dialog.c:281 +msgid "_Job" +msgstr "Úloha" + +#: src/print-dialog.c:286 +msgid "P_rinter" +msgstr "_Tiskárna" + +#. ----------- Add simple-copies widget ------------ +#: src/print-dialog.c:314 +msgid "Copies" +msgstr "Kopie" + +#. ------- Add merge control widget ------------ +#: src/print-dialog.c:322 +msgid "Document merge control" +msgstr "Kontrola sloučení dokumentu" + +#. ----------- Add custom print options area ------------ +#: src/print-dialog.c:330 +msgid "Options" +msgstr "Možnosti" + +#: src/print-dialog.c:553 src/print-dialog.c:592 +msgid "Print preview" +msgstr "Náhled tisku" + +#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 +msgid "gLabels Template Designer" +msgstr "Návrhář Å¡ablon gLabels" + +#: src/bc.c:60 +msgid "POSTNET (any)" +msgstr "POSTNET (jakýkoli)" + +#: src/bc.c:63 +msgid "POSTNET-5 (ZIP only)" +msgstr "POSTNET-5 (pouze ZIP)" + +#: src/bc.c:66 +msgid "POSTNET-9 (ZIP+4)" +msgstr "" + +#: src/bc.c:69 +msgid "POSTNET-11 (DPBC)" +msgstr "" + +#: src/bc.c:72 +msgid "EAN (any)" +msgstr "EAN (jakýkoli)" + +#: src/bc.c:75 +msgid "EAN-8" +msgstr "" + +#: src/bc.c:78 +msgid "EAN-8 +2" +msgstr "" + +#: src/bc.c:81 +msgid "EAN-8 +5" +msgstr "" + +#: src/bc.c:84 +msgid "EAN-13" +msgstr "" + +#: src/bc.c:87 +msgid "EAN-13 +2" +msgstr "" + +#: src/bc.c:90 +msgid "EAN-13 +5" +msgstr "" + +#: src/bc.c:93 +msgid "UPC (UPC-A or UPC-E)" +msgstr "UPC (UPC-A nebo UPC-E)" + +#: src/bc.c:96 +msgid "UPC-A" +msgstr "" + +#: src/bc.c:99 +msgid "UPC-A +2" +msgstr "" + +#: src/bc.c:102 +msgid "UPC-A +5" +msgstr "" + +#: src/bc.c:105 +msgid "UPC-E" +msgstr "" + +#: src/bc.c:108 +msgid "UPC-E +2" +msgstr "" + +#: src/bc.c:111 +msgid "UPC-E +5" +msgstr "" + +#: src/bc.c:114 +msgid "ISBN" +msgstr "" + +#: src/bc.c:117 +msgid "ISBN +5" +msgstr "" + +#: src/bc.c:120 +msgid "Code 39" +msgstr "" + +#: src/bc.c:123 +msgid "Code 128" +msgstr "" + +#: src/bc.c:126 +msgid "Code 128C" +msgstr "" + +#: src/bc.c:129 +msgid "Code 128B" +msgstr "" + +#: src/bc.c:132 +msgid "Interleaved 2 of 5" +msgstr "" + +#: src/bc.c:135 +msgid "Codabar" +msgstr "" + +#: src/bc.c:138 +msgid "MSI" +msgstr "" + +#: src/bc.c:141 +msgid "Plessey" +msgstr "" + +#: src/label.c:569 +msgid "Untitled" +msgstr "Nepojmenovaný" + +#: src/xml-label.c:176 src/xml-label.c:213 +msgid "xmlParseFile error" +msgstr "chyba (xmlParseFile)" + +#: src/xml-label.c:250 +msgid "No document root" +msgstr "" + +#: src/xml-label.c:264 +msgid "Importing from glabels 0.1 format" +msgstr "Importuji formát glabels verze 0.1" + +#: src/xml-label.c:272 +msgid "Importing from glabels 0.4 format" +msgstr "Importuji formát glabels verze 0.4" + +#: src/xml-label.c:279 +msgid "Importing from glabels 1.91 format" +msgstr "Importuji formát glabels verze 1.91" + +#: src/xml-label.c:282 +msgid "bad document, unknown glabels Namespace" +msgstr "" + +#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "" + +#: src/xml-label.c:348 src/xml-label-191.c:165 +#, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "" + +#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 +#, c-format +msgid "bad node = \"%s\"" +msgstr "" + +#: src/xml-label.c:796 src/xml-label-191.c:605 +#, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "" + +#: src/xml-label.c:962 libglabels/xml-template.c:535 +msgid "Utf8 conversion error." +msgstr "Chyba při konverzi UTF-8" + +#: src/xml-label.c:969 libglabels/xml-template.c:542 +msgid "Problem saving xml file." +msgstr "Problém s ukládáním dat do xml." + +#. This should always be an id, but just in case a name +#. slips by! +#: src/xml-label-191.c:680 libglabels/xml-template.c:199 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "" + +#: src/xml-label-191.c:690 libglabels/xml-template.c:209 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "" + +#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 +msgid "None" +msgstr "Žádný" + +#: src/merge-init.c:53 +msgid "Text file with comma delimeters (CSV)" +msgstr "Text se středníky jako oddělovači sloupců (CSV)" + +#: src/merge-init.c:60 +msgid "Text file with colon delimeters" +msgstr "Text s dvojtečkami jako oddělovači sloupců" + +#: src/merge-init.c:67 +msgid "Text file with tab delimeters" +msgstr "Text s tabulátory jako oddělovači sloupců" + +#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 +msgid "File:" +msgstr "Soubor:" + +#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 +msgid "Key:" +msgstr "Klíč:" + +#: src/wdgt-print-copies.c:179 +msgid "Sheets:" +msgstr "Stránky:" + +#: src/wdgt-print-copies.c:197 +msgid "Labels" +msgstr "Etikety" + +#: src/wdgt-print-copies.c:200 +msgid "from:" +msgstr "od:" + +#: src/wdgt-print-copies.c:207 +msgid "to:" +msgstr "komu:" + +#: src/wdgt-print-merge.c:178 +msgid "Start on label" +msgstr "Začít na etiketě" + +#: src/wdgt-print-merge.c:186 +msgid "on 1st sheet" +msgstr "na první stránce" + +#: src/wdgt-print-merge.c:195 +msgid "Copies:" +msgstr "Kopie:" + +#: src/wdgt-print-merge.c:201 +msgid "Collate" +msgstr "Shromáždit" + +#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 +msgid "Description:" +msgstr "Popis:" + +#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 +msgid "Page size:" +msgstr "Velikost stránky:" + +#: src/wdgt-media-select.c:290 +msgid "Label size:" +msgstr "Velikost etikety:" + +#: src/wdgt-media-select.c:301 +msgid "Layout:" +msgstr "Rozvržení:" + +#: src/wdgt-media-select.c:578 +#, c-format +msgid "%d x %d (%d per sheet)" +msgstr "%d x %d (%d na stránku)" + +#: src/wdgt-media-select.c:582 +#, c-format +msgid "%d per sheet" +msgstr "%d na stránku" + +#: src/wdgt-media-select.c:614 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +#: src/wdgt-media-select.c:619 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 +#, c-format +msgid "%s %s diameter" +msgstr "%s %s průměr" + +#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 +#, c-format +msgid "%.5g %s diameter" +msgstr "%.5g %s průměr" + +#: src/wdgt-rotate-label.c:193 +msgid "Rotate" +msgstr "Rotovat" + +#. This is the default custom color +#: src/mygal/color-palette.c:396 +msgid "custom" +msgstr "vlastní" + +#. "Custom" color - we'll pop up a GnomeColorPicker +#: src/mygal/color-palette.c:438 +msgid "Custom Color:" +msgstr "Vlastní barva" + +#: src/mygal/color-palette.c:446 +msgid "Choose Custom Color" +msgstr "Vyberte vlastní barvu" + +#: src/mygal/color-palette.c:579 +msgid "black" +msgstr "černá" + +#: src/mygal/color-palette.c:580 +msgid "light brown" +msgstr "světle hnědá" + +#: src/mygal/color-palette.c:581 +msgid "brown gold" +msgstr "zlatohnědá" + +#: src/mygal/color-palette.c:582 +msgid "dark green #2" +msgstr "tmavě zelená #2" + +#: src/mygal/color-palette.c:583 +msgid "navy" +msgstr "námořnická modř" + +#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 +msgid "dark blue" +msgstr "tmavě modrá" + +#: src/mygal/color-palette.c:585 +msgid "purple #2" +msgstr "purpurová #2" + +#: src/mygal/color-palette.c:586 +msgid "very dark gray" +msgstr "velmi tmavě Å¡edá" + +#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 +msgid "dark red" +msgstr "tmavě červená" + +#: src/mygal/color-palette.c:590 +msgid "red-orange" +msgstr "červenooranžová" + +#: src/mygal/color-palette.c:591 +msgid "gold" +msgstr "zlatá" + +#: src/mygal/color-palette.c:592 +msgid "dark green" +msgstr "tmavě zelená" + +#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 +msgid "dull blue" +msgstr "mdlá modř" + +#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 +msgid "blue" +msgstr "modrá" + +#: src/mygal/color-palette.c:595 +msgid "dull purple" +msgstr "mdlý purpur" + +#: src/mygal/color-palette.c:596 +msgid "dark grey" +msgstr "tmavě Å¡edá" + +#: src/mygal/color-palette.c:599 +msgid "red" +msgstr "červená" + +#: src/mygal/color-palette.c:600 +msgid "orange" +msgstr "oranžová" + +#: src/mygal/color-palette.c:601 +msgid "lime" +msgstr "citrónová" + +#: src/mygal/color-palette.c:602 +msgid "dull green" +msgstr "mdlá zeleň" + +#: src/mygal/color-palette.c:603 +msgid "dull blue #2" +msgstr "mdlá modř #2" + +#: src/mygal/color-palette.c:604 +msgid "sky blue #2" +msgstr "nebeská modř #2" + +#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 +msgid "purple" +msgstr "purpurová" + +#: src/mygal/color-palette.c:606 +msgid "gray" +msgstr "Å¡edá" + +#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 +msgid "magenta" +msgstr "fialová" + +#: src/mygal/color-palette.c:610 +msgid "bright orange" +msgstr "jasně oranžová" + +#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 +msgid "yellow" +msgstr "žludá" + +#: src/mygal/color-palette.c:612 +msgid "green" +msgstr "zelená" + +#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 +msgid "cyan" +msgstr "azurová" + +#: src/mygal/color-palette.c:614 +msgid "bright blue" +msgstr "jasně modrá" + +#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 +msgid "red purple" +msgstr "červenofialová" + +#: src/mygal/color-palette.c:616 +msgid "light grey" +msgstr "světle Å¡edá" + +#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 +msgid "pink" +msgstr "růžová" + +#: src/mygal/color-palette.c:620 +msgid "light orange" +msgstr "světle oranžová" + +#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 +msgid "light yellow" +msgstr "světle žlutá" + +#: src/mygal/color-palette.c:622 +msgid "light green" +msgstr "světle zelená" + +#: src/mygal/color-palette.c:623 +msgid "light cyan" +msgstr "světle azurová" + +#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 +msgid "light blue" +msgstr "světle modrá" + +#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 +msgid "light purple" +msgstr "světle purpurová" + +#: src/mygal/color-palette.c:626 +msgid "white" +msgstr "bílá" + +#: src/mygal/color-palette.c:631 +msgid "purplish blue" +msgstr "fialovomodrá" + +#: src/mygal/color-palette.c:635 +msgid "dark purple" +msgstr "tmavě purpurová" + +#: src/mygal/color-palette.c:637 +msgid "sky blue" +msgstr "nebeská modř" + +#: libglabels/template.c:848 +#, c-format +msgid "Generic %s full page" +msgstr "" + +#: libglabels/template.c:897 +msgid "No template files found!" +msgstr "Nenalezeny Å¡ablony!" + +#. Create and append an "Other" entry. +#: libglabels/paper.c:67 +msgid "Other" +msgstr "Jiné" + +#: libglabels/paper.c:361 +msgid "No paper files found!" +msgstr "" + +#: data/ui/glabels-ui.xml.h:1 +msgid "About glabels" +msgstr "O programu glabels" + +#: data/ui/glabels-ui.xml.h:2 +msgid "About..." +msgstr "O programu" + +#: data/ui/glabels-ui.xml.h:3 +msgid "Align _Horizontal" +msgstr "Zarovnat _vodorovně" + +#: data/ui/glabels-ui.xml.h:4 +msgid "Align _Vertical" +msgstr "Zarovnat _svisle" + +#: data/ui/glabels-ui.xml.h:5 +msgid "Align objects to bottoms" +msgstr "Zarovnat objekty dolů" + +#: data/ui/glabels-ui.xml.h:6 +msgid "Align objects to horizontal centers" +msgstr "Zarovnat objekty vodorovně na střed" + +#: data/ui/glabels-ui.xml.h:7 +msgid "Align objects to left edges" +msgstr "Zarovnat objekty dle levého kraje" + +#: data/ui/glabels-ui.xml.h:8 +msgid "Align objects to right edges" +msgstr "Zarovnat objekty dle pravého kraje" + +#: data/ui/glabels-ui.xml.h:9 +msgid "Align objects to tops" +msgstr "Zarovnat objekty nahoru" + +#: data/ui/glabels-ui.xml.h:10 +msgid "Align objects to vertical centers" +msgstr "Zarovnat objekty svisle na střed" + +#: data/ui/glabels-ui.xml.h:12 +msgid "Bold" +msgstr "Tučně" + +#: data/ui/glabels-ui.xml.h:14 +msgid "Center align" +msgstr "Na střed" + +#: data/ui/glabels-ui.xml.h:15 +msgid "Center objects to horizontal label center" +msgstr "Vycentrovat objekty vodorovně na střed etikety" + +#: data/ui/glabels-ui.xml.h:16 +msgid "Center objects to vertical label center" +msgstr "Vycentrovat objekty svisle na střed etikety" + +#: data/ui/glabels-ui.xml.h:17 +msgid "Change the visibility of markup lines in the current window" +msgstr "Změnit viditelnost hraničních čar v okně" + +#: data/ui/glabels-ui.xml.h:18 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "Změnit viditelnost panelu kreslení v okně" + +#: data/ui/glabels-ui.xml.h:19 +msgid "Change the visibility of the grid in the current window" +msgstr "Změnit viditelnost mřížky v okně" + +#: data/ui/glabels-ui.xml.h:20 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "Změnit viditelnost hlavního panelu nástrojů v okně" + +#: data/ui/glabels-ui.xml.h:21 +msgid "Change the visibility of the property toolbar in the current window" +msgstr "Změnit viditelnost panelu vlastností v okně" + +#: data/ui/glabels-ui.xml.h:22 +msgid "Close" +msgstr "Zavřít" + +#: data/ui/glabels-ui.xml.h:23 +msgid "Close the current file" +msgstr "Zavřít tento soubor" + +#: data/ui/glabels-ui.xml.h:24 +msgid "Configure the application" +msgstr "Konfigurovat aplikaci" + +#: data/ui/glabels-ui.xml.h:25 +msgid "Contents" +msgstr "Obsah" + +#: data/ui/glabels-ui.xml.h:26 +msgid "Copy" +msgstr "Kopírovat" + +#: data/ui/glabels-ui.xml.h:27 +msgid "Copy the selection" +msgstr "Kopírovat výběr" + +#: data/ui/glabels-ui.xml.h:28 +msgid "Create a custom template" +msgstr "Vytvořit vlastní Å¡ablonu" + +#: data/ui/glabels-ui.xml.h:29 +msgid "Create a new document" +msgstr "Vytvořit nový dokument" + +#: data/ui/glabels-ui.xml.h:30 +msgid "Create barcode object" +msgstr "Vložit čárový kód" + +#: data/ui/glabels-ui.xml.h:31 +msgid "Create box/rectangle object" +msgstr "Vytvořit čtverec/obdélník" + +#: data/ui/glabels-ui.xml.h:32 +msgid "Create ellipse/circle object" +msgstr "Vytvořit elipsu/kruh" + +#: data/ui/glabels-ui.xml.h:33 +msgid "Create image object" +msgstr "Vložit obrázek" + +#: data/ui/glabels-ui.xml.h:34 +msgid "Create line object" +msgstr "Vložit čáru" + +#: data/ui/glabels-ui.xml.h:35 +msgid "Create text object" +msgstr "Vložit text" + +#: data/ui/glabels-ui.xml.h:36 +msgid "Cu_t" +msgstr "_Vyjmout" + +#: data/ui/glabels-ui.xml.h:37 +msgid "Customize" +msgstr "Přizpůsobit" + +#: data/ui/glabels-ui.xml.h:38 +msgid "Customize Drawing Toolbar" +msgstr "Přizpůsobit panel kreslení" + +#: data/ui/glabels-ui.xml.h:39 +msgid "Customize Main Toolbar" +msgstr "Přizpůsobit hlavní panel" + +#: data/ui/glabels-ui.xml.h:40 +msgid "Customize Property Toolbar" +msgstr "Přizpůsobit panel vlastností" + +#: data/ui/glabels-ui.xml.h:41 +msgid "Customize toolbars" +msgstr "Přizpůsobit panely" + +#: data/ui/glabels-ui.xml.h:42 +msgid "Cut" +msgstr "Vyjmout" + +#: data/ui/glabels-ui.xml.h:43 +msgid "Cut the selection" +msgstr "Vyjmout výběr" + +#: data/ui/glabels-ui.xml.h:44 +msgid "Decrease magnification" +msgstr "ZmenÅ¡it" + +#: data/ui/glabels-ui.xml.h:45 +msgid "Delete" +msgstr "Smazat" + +#: data/ui/glabels-ui.xml.h:46 +msgid "Delete the selected objects" +msgstr "Smazat vybrané objekty" + +#: data/ui/glabels-ui.xml.h:47 +msgid "Drawing toolbar" +msgstr "Panl kreslení" + +#: data/ui/glabels-ui.xml.h:48 +msgid "Dump XML" +msgstr "Vypsat XML" + +#: data/ui/glabels-ui.xml.h:49 +msgid "Dump the UI Xml description" +msgstr "Vypsat popis UI v XML" + +#: data/ui/glabels-ui.xml.h:50 +msgid "Edit merge properties" +msgstr "Upravit vlastnosti sloučení" + +#: data/ui/glabels-ui.xml.h:54 +msgid "Flip object horizontally" +msgstr "Převrátit objekt vodorovně" + +#: data/ui/glabels-ui.xml.h:55 +msgid "Flip object vertically" +msgstr "Převrátit objekt svisle" + +#: data/ui/glabels-ui.xml.h:56 +msgid "Font name" +msgstr "Název fontu" + +#: data/ui/glabels-ui.xml.h:57 +msgid "Font selector" +msgstr "Výběr fontu" + +#: data/ui/glabels-ui.xml.h:58 +msgid "Font size" +msgstr "Velikost fontu" + +#: data/ui/glabels-ui.xml.h:59 +msgid "Icon and _Text" +msgstr "Ikony a text" + +#: data/ui/glabels-ui.xml.h:60 +msgid "Increase magnification" +msgstr "ZvětÅ¡it" + +#: data/ui/glabels-ui.xml.h:61 +msgid "Italic" +msgstr "Kurzíva" + +#: data/ui/glabels-ui.xml.h:63 +msgid "Left align" +msgstr "Nalevo" + +#: data/ui/glabels-ui.xml.h:65 +msgid "Line width" +msgstr "Šířka čáry" + +#: data/ui/glabels-ui.xml.h:66 +msgid "Lower object to bottom" +msgstr "Poslat objekt dozadu" + +#: data/ui/glabels-ui.xml.h:67 +msgid "M_arkup" +msgstr "Ohraničení" + +#: data/ui/glabels-ui.xml.h:68 +msgid "Main toolbar" +msgstr "Hlavní panel" + +#: data/ui/glabels-ui.xml.h:69 +msgid "Markup" +msgstr "Ohraničení" + +#: data/ui/glabels-ui.xml.h:70 +msgid "Modify document properties" +msgstr "Upravit vlastnosti dokumentu" + +#: data/ui/glabels-ui.xml.h:71 +msgid "New" +msgstr "Nový" + +#: data/ui/glabels-ui.xml.h:72 +msgid "Object property editor" +msgstr "Editor vlastností objektu" + +#: data/ui/glabels-ui.xml.h:73 +msgid "Only show icons in the main toolbar" +msgstr "Zobraz v hlavním panelu jen ikony" + +#: data/ui/glabels-ui.xml.h:75 +msgid "Open a file" +msgstr "Otevřít soubor" + +#: data/ui/glabels-ui.xml.h:76 +msgid "Open the glabels manual" +msgstr "Otevřít mauál programu" + +#: data/ui/glabels-ui.xml.h:77 +msgid "Paste" +msgstr "Vložit" + +#: data/ui/glabels-ui.xml.h:78 +msgid "Paste the clipboard" +msgstr "Vložit ze schránky" + +#: data/ui/glabels-ui.xml.h:79 +msgid "Pr_eferences..." +msgstr "_Nastavení" + +#: data/ui/glabels-ui.xml.h:80 +msgid "Preferences" +msgstr "Nastavení" + +#: data/ui/glabels-ui.xml.h:82 +msgid "Print the current file" +msgstr "Tisk tohoto souboru" + +#: data/ui/glabels-ui.xml.h:83 +msgid "Proper_ties..." +msgstr "Nas_tavení..." + +#: data/ui/glabels-ui.xml.h:84 +msgid "Properties" +msgstr "Nastavení" + +#: data/ui/glabels-ui.xml.h:85 +msgid "Property toolbar" +msgstr "Panel vlastností" + +#: data/ui/glabels-ui.xml.h:86 +msgid "Quit" +msgstr "Konec" + +#: data/ui/glabels-ui.xml.h:87 +msgid "Quit the program" +msgstr "Ukončit program" + +#: data/ui/glabels-ui.xml.h:88 +msgid "Raise object to top" +msgstr "Vynést objekt dopředu" + +#: data/ui/glabels-ui.xml.h:89 +msgid "Recent _Files" +msgstr "Otevřít nedávné" + +#: data/ui/glabels-ui.xml.h:90 +msgid "Redo" +msgstr "Znovu" + +#: data/ui/glabels-ui.xml.h:91 +msgid "Redo the undone action" +msgstr "Provést znovu vrácenou akci" + +#: data/ui/glabels-ui.xml.h:92 +msgid "Remove all selections" +msgstr "Odstranit vÅ¡echna označení" + +#: data/ui/glabels-ui.xml.h:94 +#, no-c-format +msgid "Restore scale to 100%" +msgstr "Vrátit měřítko na 100%" + +#: data/ui/glabels-ui.xml.h:95 +msgid "Right align" +msgstr "Napravo" + +#: data/ui/glabels-ui.xml.h:98 +msgid "Rotate object 90 clockwise" +msgstr "Otočit objekt o 90° po směru hodinových ručiček" + +#: data/ui/glabels-ui.xml.h:99 +msgid "Rotate object 90 counter-clockwise" +msgstr "Otočit objekt o 90° proti směru hodinových ručiček" + +#: data/ui/glabels-ui.xml.h:100 +msgid "Save" +msgstr "Uložit" + +#: data/ui/glabels-ui.xml.h:101 +msgid "Save As" +msgstr "Uložit jako" + +#: data/ui/glabels-ui.xml.h:102 +msgid "Save _As..." +msgstr "Uložit _jako..." + +#: data/ui/glabels-ui.xml.h:103 +msgid "Save the current file" +msgstr "Uložit tento soubor" + +#: data/ui/glabels-ui.xml.h:104 +msgid "Save the current file with a different name" +msgstr "Uložit tento soubor s jiným jménem" + +#: data/ui/glabels-ui.xml.h:105 +msgid "Select All" +msgstr "Vybrat vÅ¡e" + +#: data/ui/glabels-ui.xml.h:106 +msgid "Select _All" +msgstr "Vybr_at vÅ¡e" + +#: data/ui/glabels-ui.xml.h:107 +msgid "Select all objects" +msgstr "Vybrat vÅ¡echny objekty" + +#: data/ui/glabels-ui.xml.h:108 +msgid "Select, move and modify objects" +msgstr "Označení, posun a změna objektů" + +#: data/ui/glabels-ui.xml.h:110 +msgid "Set main toolbar button style according to desktop default" +msgstr "" +"Nastavit tlačítka na hlavním panelu stejně jako je základní nastavení " +"prostředí" + +#: data/ui/glabels-ui.xml.h:111 +msgid "Show _Tooltips" +msgstr "Ukazovat tipy" + +#: data/ui/glabels-ui.xml.h:112 +msgid "Show both icons and texts in the main toolbar" +msgstr "Zobrazit ikony a popisy v hlavní nástrojové liÅ¡tě" + +#: data/ui/glabels-ui.xml.h:113 +msgid "Show tooltips in the drawing toolbar" +msgstr "Ukazovat tipy v panelu kreslení" + +#: data/ui/glabels-ui.xml.h:114 +msgid "Show tooltips in the main toolbar" +msgstr "Ukazovat tipy v hlavním panelu" + +#: data/ui/glabels-ui.xml.h:115 +msgid "Show tooltips in the property toolbar" +msgstr "Ukazovat tipy v panelu vlastností" + +#: data/ui/glabels-ui.xml.h:116 +msgid "Template Designer" +msgstr "Návrhář Å¡ablon" + +#: data/ui/glabels-ui.xml.h:117 +msgid "Template _Designer..." +msgstr "Návrhář Å¡_ablon..." + +#: data/ui/glabels-ui.xml.h:118 +msgid "Text color" +msgstr "Barva textu" + +#: data/ui/glabels-ui.xml.h:119 +msgid "U_n-select All" +msgstr "Odz_načit vÅ¡e" + +#: data/ui/glabels-ui.xml.h:120 +msgid "Un-select All" +msgstr "Odznačit vÅ¡e" + +#: data/ui/glabels-ui.xml.h:121 +msgid "Undo" +msgstr "Zpět" + +#: data/ui/glabels-ui.xml.h:122 +msgid "Undo the last action" +msgstr "Vrátit o akci zpět" + +#: data/ui/glabels-ui.xml.h:123 +msgid "Zoom _1:1" +msgstr "ZvětÅ¡ení 1:1" + +#: data/ui/glabels-ui.xml.h:124 +msgid "Zoom _In" +msgstr "ZvětÅ¡it" + +#: data/ui/glabels-ui.xml.h:125 +msgid "Zoom _Out" +msgstr "ZmenÅ¡it" + +#: data/ui/glabels-ui.xml.h:126 +msgid "Zoom to _fit" +msgstr "Přizpůsobit velikosti" + +#: data/ui/glabels-ui.xml.h:127 +msgid "Zoom to fit window" +msgstr "Přizpůsobit velikosti okna" + +#: data/ui/glabels-ui.xml.h:128 +msgid "_About..." +msgstr "_O programu..." + +#: data/ui/glabels-ui.xml.h:129 +msgid "_Bottoms" +msgstr "Naspod" + +#: data/ui/glabels-ui.xml.h:132 +msgid "_Close" +msgstr "_Zavřít" + +#: data/ui/glabels-ui.xml.h:133 +msgid "_Contents" +msgstr "_Obsah" + +#: data/ui/glabels-ui.xml.h:134 +msgid "_Copy" +msgstr "_Kopírovat" + +#: data/ui/glabels-ui.xml.h:135 +msgid "_Create Object" +msgstr "_Vytvořit objekt" + +#: data/ui/glabels-ui.xml.h:136 +msgid "_Debug" +msgstr "_Debugování" + +#: data/ui/glabels-ui.xml.h:138 +msgid "_Desktop Default" +msgstr "Přednastavení prostředí" + +#: data/ui/glabels-ui.xml.h:139 +msgid "_Drawing Toolbar" +msgstr "Panel _kreslení" + +#: data/ui/glabels-ui.xml.h:140 +msgid "_Edit" +msgstr "_Upravit" + +#: data/ui/glabels-ui.xml.h:142 +msgid "_File" +msgstr "_Soubor" + +#: data/ui/glabels-ui.xml.h:143 +msgid "_Grid" +msgstr "_Mřížka" + +#: data/ui/glabels-ui.xml.h:144 +msgid "_Help" +msgstr "_Nápověda" + +#: data/ui/glabels-ui.xml.h:145 +msgid "_Icon" +msgstr "_Ikona" + +#: data/ui/glabels-ui.xml.h:149 +msgid "_Main Toolbar" +msgstr "_Hlavní panel" + +#: data/ui/glabels-ui.xml.h:150 +msgid "_Merge Properties..." +msgstr "Nastavení sloučení" + +#: data/ui/glabels-ui.xml.h:151 +msgid "_New" +msgstr "_Nový" + +#: data/ui/glabels-ui.xml.h:152 +msgid "_Objects" +msgstr "_Objekty" + +#: data/ui/glabels-ui.xml.h:153 +msgid "_Open..." +msgstr "_Otevřít" + +#: data/ui/glabels-ui.xml.h:155 +msgid "_Paste" +msgstr "Vl_ožit" + +#: data/ui/glabels-ui.xml.h:156 +msgid "_Print..." +msgstr "_Tisk..." + +#: data/ui/glabels-ui.xml.h:157 +msgid "_Property Toolbar" +msgstr "Panel _vlastností" + +#: data/ui/glabels-ui.xml.h:158 +msgid "_Quit" +msgstr "_Konec" + +#: data/ui/glabels-ui.xml.h:161 +msgid "_Save" +msgstr "_Uložit" + +#: data/ui/glabels-ui.xml.h:165 +msgid "_View" +msgstr "_Zobrazit" + +#: data/glade/prefs-dialog.glade.h:1 +msgid " " +msgstr "" + +#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 +#: data/glade/template-designer.glade.h:5 +msgid "*" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:3 +msgid "Default page size" +msgstr "Výchozí velikost stránky" + +#: data/glade/prefs-dialog.glade.h:4 +msgid "Fill" +msgstr "Výplň" + +#: data/glade/prefs-dialog.glade.h:5 +msgid "Line" +msgstr "Čára" + +#: data/glade/prefs-dialog.glade.h:6 +msgid "Text" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:7 +msgid "Units" +msgstr "Jednotky" + +#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 +msgid "Alignment:" +msgstr "Zarovnání:" + +#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 +msgid "Color:" +msgstr "Barva:" + +#: data/glade/prefs-dialog.glade.h:10 +msgid "Font:" +msgstr "Font:" + +#: data/glade/prefs-dialog.glade.h:11 +msgid "ISO A4" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:12 +msgid "Inches" +msgstr "Palce" + +#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 +msgid "Line Spacing:" +msgstr "Řádkování:" + +#: data/glade/prefs-dialog.glade.h:14 +msgid "Locale" +msgstr "Místní zvyklosti" + +#: data/glade/prefs-dialog.glade.h:15 +msgid "Millimeters" +msgstr "Milimetry" + +#: data/glade/prefs-dialog.glade.h:16 +msgid "Object defaults" +msgstr "Výchozí hodnoty objektu" + +#: data/glade/prefs-dialog.glade.h:17 +msgid "Points" +msgstr "Body" + +#: data/glade/prefs-dialog.glade.h:18 +msgid "Select default properties for new objects." +msgstr "Vyberte výchozí nastavení pro nové objekty" + +#: data/glade/prefs-dialog.glade.h:19 +msgid "Select locale specific behavior." +msgstr "Zvolte specifické chování pro místní zvyklosti." + +#. Most popular (at top of list) +#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:29 +msgid "US Letter" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 +#: data/glade/template-designer.glade.h:72 +msgid "Width:" +msgstr "Šířka:" + +#: data/glade/object-editor.glade.h:2 +msgid "00000000000 00000" +msgstr "" + +#: data/glade/object-editor.glade.h:3 +msgid "Xxx object properties" +msgstr "Vlastnosti objektu xxx" + +#: data/glade/object-editor.glade.h:5 +msgid "Allow merge to automatically shrink text" +msgstr "Při sloučení povolit automatické smrÅ¡tění textu" + +#: data/glade/object-editor.glade.h:6 +msgid "Angle:" +msgstr "Úhel:" + +#: data/glade/object-editor.glade.h:7 +msgid "Checksum" +msgstr "Kontrolní součet" + +#: data/glade/object-editor.glade.h:10 +msgid "Family:" +msgstr "Rodina:" + +#: data/glade/object-editor.glade.h:12 +msgid "Fill" +msgstr "Výplň" + +#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 +msgid "Height:" +msgstr "Výška:" + +#: data/glade/object-editor.glade.h:14 +msgid "Image" +msgstr "Obrázek" + +#: data/glade/object-editor.glade.h:15 +msgid "Insert merge field" +msgstr "Vložit pole pro sloučení" + +#: data/glade/object-editor.glade.h:17 +msgid "Length:" +msgstr "Délka:" + +#: data/glade/object-editor.glade.h:18 +msgid "Line" +msgstr "Čára" + +#: data/glade/object-editor.glade.h:20 +msgid "Literal:" +msgstr "Písmena:" + +#: data/glade/object-editor.glade.h:21 +msgid "Load image" +msgstr "Načíst obrázek" + +#: data/glade/object-editor.glade.h:22 +msgid "Position" +msgstr "Pozice" + +#: data/glade/object-editor.glade.h:23 +msgid "Reset image size" +msgstr "Resetovat velikost obrázku" + +#: data/glade/object-editor.glade.h:24 +msgid "Size" +msgstr "Velikost" + +#: data/glade/object-editor.glade.h:25 +msgid "Size:" +msgstr "Velikost:" + +#: data/glade/object-editor.glade.h:26 +msgid "Style" +msgstr "Styl" + +#: data/glade/object-editor.glade.h:27 +msgid "Style:" +msgstr "Styl:" + +#: data/glade/object-editor.glade.h:30 +msgid "X:" +msgstr "X:" + +#: data/glade/object-editor.glade.h:31 +msgid "Y:" +msgstr "Y:" + +#: data/glade/object-editor.glade.h:32 +msgid "degrees" +msgstr "stupně" + +#: data/glade/object-editor.glade.h:33 +msgid "dialog1" +msgstr "" + +#: data/glade/object-editor.glade.h:34 +msgid "digits:" +msgstr "číslic:" + +#: data/glade/object-editor.glade.h:35 +msgid "format:" +msgstr "formát:" + +#: data/glade/template-designer.glade.h:1 +msgid " " +msgstr "" + +#: data/glade/template-designer.glade.h:2 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "(např. \"Adresní Å¡títky,\" \"Vizitky,\" ...)" + +#: data/glade/template-designer.glade.h:3 +msgid "(e.g., 8163A)" +msgstr "(např. 8163A)" + +#: data/glade/template-designer.glade.h:4 +msgid "(e.g., Avery, Acme, ...)" +msgstr "(např. Avery, Acme, ...)" + +#: data/glade/template-designer.glade.h:6 +msgid "1. Outer radius:" +msgstr "1. Vnější poloměr:" + +#: data/glade/template-designer.glade.h:7 +msgid "1. Radius:" +msgstr "1. Poloměr:" + +#: data/glade/template-designer.glade.h:8 +msgid "1. Width:" +msgstr "1. Šířka:" + +#: data/glade/template-designer.glade.h:9 +msgid "2. Height:" +msgstr "2. Výška:" + +#: data/glade/template-designer.glade.h:10 +msgid "2. Inner radius:" +msgstr "2. Vnitřní poloměr:" + +#: data/glade/template-designer.glade.h:11 +msgid "2. Waste (overprint allowed):" +msgstr "2. Odsazení (povolený přetisk):" + +#: data/glade/template-designer.glade.h:12 +msgid "3. Clipping width:" +msgstr "3. Šířka výstřižku:" + +#: data/glade/template-designer.glade.h:13 +msgid "3. Margin" +msgstr "3. Okraj" + +#: data/glade/template-designer.glade.h:14 +msgid "3. Round (radius of corner):" +msgstr "3. Zaoblení (poloměr rohu):" + +#: data/glade/template-designer.glade.h:15 +msgid "4. Clipping height:" +msgstr "4. Výška výstřižku:" + +#: data/glade/template-designer.glade.h:16 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "4. Horizontální odsazení (povolený přetisk):" + +#: data/glade/template-designer.glade.h:17 +msgid "5. Vert. waste (overprint allowed):" +msgstr "5. Vert. odsazení (povolený přetisk):" + +#: data/glade/template-designer.glade.h:18 +msgid "5. Waste (overprint allowed):" +msgstr "5. Odsazení (povolený přetisk):" + +#: data/glade/template-designer.glade.h:19 +msgid "6. Margin" +msgstr "6. Okraj" + +#: data/glade/template-designer.glade.h:20 +msgid "Brand/Manufacturer:" +msgstr "Značka/Výrobce:" + +#: data/glade/template-designer.glade.h:21 +msgid "CD/DVD (including credit card CDs)" +msgstr "CD/DVD (včetně vizitkových CD)" + +#: data/glade/template-designer.glade.h:22 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "" +"Gratulujeme!\n" +"\n" +"Dokončili jste návrh Å¡ablony gLabels.\n" +"Pokud si přejete návrh přijmout a uložit, klikněte na \"Použít\".\n" +"\n" +"Jinak klikněte na \"ZruÅ¡it\" pro zahození návrhu či na\n" +"\"Zpět\" pro další úpravy tohoto návrhu." + +#: data/glade/template-designer.glade.h:30 +msgid "Design Completed" +msgstr "Návrh byl dokončen" + +#: data/glade/template-designer.glade.h:31 +msgid "Distance from left edge (x0):" +msgstr "Vzdálenost od levého okraje (x0):" + +#: data/glade/template-designer.glade.h:32 +msgid "Distance from top edge (y0):" +msgstr "Vzdálenost od horního okraje (y0):" + +#: data/glade/template-designer.glade.h:34 +msgid "Horizontal pitch (dx):" +msgstr "Vodorovná rozteč (dx):" + +#: data/glade/template-designer.glade.h:35 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" +"Kolik rozvržení obsahuje vaÅ¡e Å¡ablona? \n" +"\n" +"Rozvržení je sada etiket nebo vizitek, které mohou být uspořádány na\n" +"jednoduché mřížce. VětÅ¡ina Å¡ablon potřebuje jedno rozvržení jako v\n" +"prvním příkladu. Druhý příklad ilustruje dvě rozvržení." + +#: data/glade/template-designer.glade.h:40 +msgid "Label Size (CD/DVD)" +msgstr "Velikost etikety (CD/DVD)" + +#: data/glade/template-designer.glade.h:41 +msgid "Label Size (Round)" +msgstr "Velikost etikety (oválná)" + +#: data/glade/template-designer.glade.h:42 +msgid "Label or Card Shape" +msgstr "Tvar etikety či vizitky" + +#: data/glade/template-designer.glade.h:43 +msgid "Label or Card Size (Rectangular)" +msgstr "Velikost etikety či vizitky (obdélníková)" + +#: data/glade/template-designer.glade.h:44 +msgid "Layout #1" +msgstr "Rozvržení #1" + +#: data/glade/template-designer.glade.h:45 +msgid "Layout #2" +msgstr "Rozvržení #2" + +#: data/glade/template-designer.glade.h:46 +msgid "Layout(s)" +msgstr "Rozvržení" + +#: data/glade/template-designer.glade.h:47 +msgid "Name and Description" +msgstr "Název a popis" + +#: data/glade/template-designer.glade.h:48 +msgid "Number across (nx):" +msgstr "Počet napříč (nx):" + +#: data/glade/template-designer.glade.h:49 +msgid "Number down (ny):" +msgstr "Počet dolů (ny):" + +#: data/glade/template-designer.glade.h:50 +msgid "Number of Layouts" +msgstr "Počet rozvržení" + +#: data/glade/template-designer.glade.h:51 +msgid "Number of layouts:" +msgstr "Počet rozvržení:" + +#: data/glade/template-designer.glade.h:52 +msgid "Page Size" +msgstr "Velikost stránky" + +#: data/glade/template-designer.glade.h:54 +msgid "Part #:" +msgstr "Část #:" + +#: data/glade/template-designer.glade.h:55 +msgid "" +"Please enter the following identifying information about the template " +"stationery." +msgstr "" +"Vyplňte, prosím, následující informace o Å¡abloně." + +#: data/glade/template-designer.glade.h:56 +msgid "Please enter the following layout information." +msgstr "Vyplňte, prosím, následující informaci o rozvržení." + +#: data/glade/template-designer.glade.h:57 +msgid "" +"Please enter the following size parameters of a single label in your " +"template." +msgstr "" +"Vyplňte, prosím, následující parametry velikosti jedné etikety ve " +"vaší Å¡abloně." + +#: data/glade/template-designer.glade.h:58 +msgid "" +"Please enter the following size parameters of a single label or card in your " +"template." +msgstr "" +"Vyplňte, prosím, následující parametry velikosti jedné etikety nebo vizitky ve " +"vaší Å¡abloně." + +#: data/glade/template-designer.glade.h:59 +msgid "Please select the basic shape of the labels or cards." +msgstr "Vyberte, prosím, základní tvar etiket nebo vizitek." + +#: data/glade/template-designer.glade.h:60 +msgid "Please select the page size of the template stationery." +msgstr "Vyberte, prosím, velikost stránky Å¡ablony." + +#: data/glade/template-designer.glade.h:61 +msgid "Print test sheet" +msgstr "Vytisknout testovací stránku" + +#: data/glade/template-designer.glade.h:62 +msgid "Rectangular or square (can have rounded corners)" +msgstr "Obdélníkový nebo čtvercový (může mít zaoblené rohy)" + +#: data/glade/template-designer.glade.h:63 +msgid "Round" +msgstr "Oválný" + +#: data/glade/template-designer.glade.h:64 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" +"Å ablony, které potřebují\n" +"dvě rozvržení." + +#: data/glade/template-designer.glade.h:66 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" +"Å ablony, které potřebují\n" +"jedno rozvržení." + +#: data/glade/template-designer.glade.h:68 +msgid "Vertical pitch (dy):" +msgstr "Svislá rozteč (dy):" + +#: data/glade/template-designer.glade.h:69 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" +"Vítejte v Návrháři Å¡ablon programu gLabels.\n" +"\n" +"Tento dialog vám pomůže při vytváření vlastní Å¡ablony gLabels." + +#. Other ISO A series sizes +#: data/templates/paper-sizes.xml.h:2 +msgid "A0" +msgstr "" + +#: data/templates/paper-sizes.xml.h:3 +msgid "A1" +msgstr "" + +#: data/templates/paper-sizes.xml.h:4 +msgid "A10" +msgstr "" + +#: data/templates/paper-sizes.xml.h:5 +msgid "A2" +msgstr "" + +#: data/templates/paper-sizes.xml.h:6 +msgid "A3" +msgstr "" + +#: data/templates/paper-sizes.xml.h:7 +msgid "A4" +msgstr "" + +#: data/templates/paper-sizes.xml.h:8 +msgid "A5" +msgstr "" + +#: data/templates/paper-sizes.xml.h:9 +msgid "A6" +msgstr "" + +#: data/templates/paper-sizes.xml.h:10 +msgid "A7" +msgstr "" + +#: data/templates/paper-sizes.xml.h:11 +msgid "A8" +msgstr "" + +#: data/templates/paper-sizes.xml.h:12 +msgid "A9" +msgstr "" + +#. ISO B series sizes +#: data/templates/paper-sizes.xml.h:14 +msgid "B0" +msgstr "" + +#: data/templates/paper-sizes.xml.h:15 +msgid "B1" +msgstr "" + +#: data/templates/paper-sizes.xml.h:16 +msgid "B10" +msgstr "" + +#: data/templates/paper-sizes.xml.h:17 +msgid "B2" +msgstr "" + +#: data/templates/paper-sizes.xml.h:18 +msgid "B3" +msgstr "" + +#: data/templates/paper-sizes.xml.h:19 +msgid "B4" +msgstr "" + +#: data/templates/paper-sizes.xml.h:20 +msgid "B5" +msgstr "" + +#: data/templates/paper-sizes.xml.h:21 +msgid "B6" +msgstr "" + +#: data/templates/paper-sizes.xml.h:22 +msgid "B7" +msgstr "" + +#: data/templates/paper-sizes.xml.h:23 +msgid "B8" +msgstr "" + +#: data/templates/paper-sizes.xml.h:24 +msgid "B9" +msgstr "" + +#: data/templates/paper-sizes.xml.h:25 +msgid "US Executive" +msgstr "" + +#. Other US paper sizes +#: data/templates/paper-sizes.xml.h:27 +msgid "US Legal" +msgstr "" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:2 +#: data/templates/zweckform-iso-templates.xml.h:2 +msgid "Address Labels" +msgstr "Adresní etikety" + +#. =================================================================== +#. ============================================================ +#. =================================================================== +#. ====================================================== +#: data/templates/avery-us-templates.xml.h:4 +#: data/templates/avery-iso-templates.xml.h:4 +#: data/templates/zweckform-iso-templates.xml.h:6 +#: data/templates/misc-us-templates.xml.h:3 +#: data/templates/misc-iso-templates.xml.h:17 +msgid "Business Cards" +msgstr "Vizitky" + +#: data/templates/avery-us-templates.xml.h:5 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:7 +msgid "Diskette Labels" +msgstr "Disketové etikety" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:9 +msgid "Filing Labels" +msgstr "" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:11 +msgid "Full Sheet Labels" +msgstr "" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:13 +msgid "Large Round Labels" +msgstr "Velké oválné etikety" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:15 +msgid "Name Badge Labels" +msgstr "" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:17 +msgid "Return Address Labels" +msgstr "Zpáteční adresa" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:19 +msgid "Shipping Labels" +msgstr "Dopravní etikety" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:21 +msgid "Small Round Labels" +msgstr "Malé oválné etikety" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:23 +msgid "Square Labels" +msgstr "Čtvercové etikety" + +#: data/templates/avery-us-templates.xml.h:24 +msgid "Video Tape Face Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:25 +msgid "Video Tape Spine Labels" +msgstr "" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:2 +msgid "Address labels" +msgstr "Adresní etikety" + +#. =============================================================== +#: data/templates/avery-iso-templates.xml.h:6 +msgid "CD Booklet" +msgstr "" + +#. =============================================================== +#: data/templates/avery-iso-templates.xml.h:8 +msgid "CD Inlet" +msgstr "" + +#. =============================================================== +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:10 +#: data/templates/zweckform-iso-templates.xml.h:8 +#: data/templates/misc-us-templates.xml.h:5 +#: data/templates/misc-iso-templates.xml.h:21 +msgid "CD/DVD Labels" +msgstr "CD/DVD etikety" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:12 +msgid "Diskette labels" +msgstr "Disketové etikety" + +#. =============================================================== +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:14 +#: data/templates/zweckform-iso-templates.xml.h:14 +#: data/templates/misc-iso-templates.xml.h:35 +msgid "Mailing Labels" +msgstr "PoÅ¡tovní etikety" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:16 +msgid "Mailing labels" +msgstr "PoÅ¡tovní etikety" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:18 +msgid "Mini Address Labels" +msgstr "" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:20 +msgid "Shipping labels" +msgstr "Dopravní etikety" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:4 +msgid "Allround Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:10 +msgid "Correction and Cover-up Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:12 +msgid "Lever Arch File Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:16 +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:18 +msgid "Rectangular Copier Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:20 +#: data/templates/misc-iso-templates.xml.h:44 +msgid "Rectangular Labels" +msgstr "Obdélníkové etikety" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:22 +msgid "Video Labels (back)" +msgstr "Video etikety (zadní strana)" + +#: data/templates/misc-us-templates.xml.h:1 +msgid "Business Card CD" +msgstr "Vizitkové CD" + +#: data/templates/misc-us-templates.xml.h:4 +msgid "CD Template Rectangles" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:6 +msgid "CD/DVD Labels (Face Only)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:7 +#: data/templates/misc-iso-templates.xml.h:23 +msgid "CD/DVD Labels (face only)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:9 +msgid "Cassette Labels" +msgstr "Kazetové etikety" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:11 +msgid "DLT Labels" +msgstr "DLT etikety" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:13 +msgid "Microtube labels" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:14 +msgid "Mini-CD Labels" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:15 +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:16 +msgid "PRO CD Labels 2-up (Face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:17 +#: data/templates/misc-iso-templates.xml.h:42 +msgid "PRO CD Labels 2-up (face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:18 +msgid "Slimline CD Case (rightside up)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:19 +msgid "Slimline CD Case (upside down)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:1 +msgid "Agipa 119488: Business Cards" +msgstr "Agipa 119488: Vizitky" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:3 +msgid "Allround Labels --24" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:5 +msgid "Allround Labels --44" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:7 +msgid "Allround Labels --64" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:9 +msgid "Allround Labels --65" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:11 +msgid "Arch File Labels" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:13 +msgid "Arch File Labels (large)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:15 +msgid "Arch File Labels (small)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:19 +msgid "CD Labels" +msgstr "CD etikety" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:25 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:27 +msgid "Diskette Labels (face only)" +msgstr "Disketové etikety (pouze předek)" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:29 +msgid "EPSON Photo Stickers 16" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:31 +msgid "Etiketten" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:33 +msgid "Fridge Magnet Stickers" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:37 +msgid "Mailing Labels --14" +msgstr "PoÅ¡tovní etikety --14" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:39 +msgid "Mailing Labels-2 columns" +msgstr "PoÅ¡tovní etikety-2 sloupce" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:41 +msgid "Mailing Labels-3 columns" +msgstr "PoÅ¡tovní etikety-3 sloupce" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:46 +msgid "Video Labels (face only)" +msgstr "Video etikety (pouze předek)" + +#: data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers" +msgstr "Vytvářejte etikety, vizitky a obaly médií" + +#: data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "Návrhář etiket gLabels" + +#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 +msgid "gLabels Project File" +msgstr "" + +#~ msgid "Only show icons in the drawing toolbar" +#~ msgstr "Zobrazv panelu kreslení jen ikony " + +#~ msgid "Set drawing toolbar button style according to desktop default" +#~ msgstr "" +#~ "Nastavit tlačítka na panelu kreslení stejně jako je základní nastavení " +#~ "prostředí" + +#, fuzzy +#~ msgid "Show both icons and texts in the drawing toolbar" +#~ msgstr "Ukazovat tipy v panelu kreslení" + +#~ msgid "Object _Properties..." +#~ msgstr "Možnosti objektu" + +#~ msgid "Display units" +#~ msgstr "Jednotky zobrazení" + +#~ msgid "Default page size" +#~ msgstr "Standartní velikost stránky" + +#~ msgid "Outline" +#~ msgstr "Obrys" + +#~ msgid "Edit line object properties" +#~ msgstr "Editace nastavení objektu řádky" + +#~ msgid "Edit text object properties" +#~ msgstr "Editace nastavení objektu text" + +#~ msgid "Edit text:" +#~ msgstr "Editace textu:" + +#~ msgid "Maintain current aspect ratio" +#~ msgstr "Udržet současný poměr stran" + +#~ msgid "Open %s" +#~ msgstr "Otevřít %s" diff --git a/po/de.po b/po/de.po new file mode 100644 index 00000000..6d2d9125 --- /dev/null +++ b/po/de.po @@ -0,0 +1,2707 @@ +# German translation of glabels. +# Copyright (C) 2001-2008 Jim Evins +# Marcus Bauer , 2001. +# Christian Neumair , 2002. +# Mario Blättermann , 2008, 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: glabels HEAD\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-04-29 12:35+0200\n" +"PO-Revision-Date: 2009-04-29 12:45+0100\n" +"Last-Translator: Mario Blättermann \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../src/glabels.c:66 ../src/glabels-batch.c:69 +msgid "[FILE...]" +msgstr "[DATEI...]" + +#: ../src/glabels.c:83 +msgid "Launch gLabels label and business card designer." +msgstr "Starten des gLabels Etiketten- und Visitenkarten-Designers." + +#: ../src/glabels.c:91 ../src/glabels-batch.c:105 +#, c-format +msgid "" +"%s\n" +"Run '%s --help' to see a full list of available command line options.\n" +msgstr "" +"%s\n" +"Rufen Sie »%s --help« auf, um eine vollständige Liste der " +"Befehlszeilenoptionen zu erhalten.\n" + +#: ../src/glabels-batch.c:53 +msgid "set output filename (default=\"output.pdf\")" +msgstr "Ausgabe-Dateiname festlegen (Vorgabe: »output.pdf«)" + +#: ../src/glabels-batch.c:53 ../src/glabels-batch.c:67 +msgid "filename" +msgstr "Dateiname" + +#: ../src/glabels-batch.c:55 +msgid "number of sheets (default=1)" +msgstr "Anzahl der Blätter (Vorgabe: 1)" + +#: ../src/glabels-batch.c:55 +msgid "sheets" +msgstr "Blätter" + +#: ../src/glabels-batch.c:57 +msgid "number of copies (default=1)" +msgstr "Anzahl der Kopien (Vorgabe: 1)" + +#: ../src/glabels-batch.c:57 +msgid "copies" +msgstr "Kopien" + +#: ../src/glabels-batch.c:59 +msgid "first label on first sheet (default=1)" +msgstr "Erstes Etikett auf dem ersten Blatt (Vorgabe: 1)" + +#: ../src/glabels-batch.c:59 +msgid "first" +msgstr "Erste" + +#: ../src/glabels-batch.c:61 ../data/builder/print-custom-widget.glade.h:6 +msgid "print outlines (to test printer alignment)" +msgstr "Begrenzungen drucken (um Druckausrichtung zu testen)" + +#: ../src/glabels-batch.c:63 ../data/builder/print-custom-widget.glade.h:5 +msgid "print in reverse (i.e. a mirror image)" +msgstr "Spiegelbildlich drucken" + +#: ../src/glabels-batch.c:65 ../data/builder/print-custom-widget.glade.h:4 +msgid "print crop marks" +msgstr "Schnittmarken drucken" + +#: ../src/glabels-batch.c:67 +msgid "input file for merging" +msgstr "Eingabedatei zum Mischen" + +#: ../src/glabels-batch.c:97 +msgid "Print files created with gLabels." +msgstr "Mit gLabels erstellte Dateien drucken." + +#: ../src/glabels-batch.c:147 +#, c-format +msgid "cannot perform document merge with glabels file %s\n" +msgstr "" +"Dokumentverarbeitung kann mit gLabels-Datei %s nicht ausgeführt werden\n" + +#: ../src/glabels-batch.c:169 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "glabels-Datei %s kann nicht geöffnet werden\n" + +#: ../src/window.c:259 +msgid "(none) - gLabels" +msgstr "(Unbenannt) - gLabels" + +#: ../src/window.c:432 +msgid "(modified)" +msgstr "(geändert)" + +#: ../src/stock.c:72 +msgid "_Select Mode" +msgstr "Modus au_swählen" + +#: ../src/stock.c:73 +msgid "_Text" +msgstr "_Text" + +#: ../src/stock.c:74 +msgid "_Line" +msgstr "_Linie" + +#: ../src/stock.c:75 +msgid "_Box" +msgstr "_Rechteck" + +#: ../src/stock.c:76 +msgid "_Ellipse" +msgstr "_Ellipse" + +#: ../src/stock.c:77 +msgid "_Image" +msgstr "B_ild" + +#: ../src/stock.c:78 +msgid "Bar_code" +msgstr "Strich_code" + +#: ../src/stock.c:79 +msgid "_Merge Properties" +msgstr "_Mischeinstellungen" + +#: ../src/stock.c:80 +msgid "Object _Properties" +msgstr "Objektei_genschaften" + +#: ../src/stock.c:81 +msgid "Bring to _Front" +msgstr "Ganz nach _vorn" + +#: ../src/stock.c:82 +msgid "Send to _Back" +msgstr "Ganz nach _hinten" + +#: ../src/stock.c:83 +msgid "Rotate _Left" +msgstr "_Links drehen" + +#: ../src/stock.c:84 +msgid "Rotate _Right" +msgstr "_Rechts drehen" + +#: ../src/stock.c:85 +msgid "Flip _Horizontally" +msgstr "_Horizontal spiegeln" + +#: ../src/stock.c:86 +msgid "Flip _Vertically" +msgstr "_Vertikal spiegeln" + +#: ../src/stock.c:87 +msgid "_Lefts" +msgstr "_Links" + +#: ../src/stock.c:88 +msgid "_Rights" +msgstr "_Rechts" + +#: ../src/stock.c:89 +msgid "_Centers" +msgstr "_Mitte" + +#: ../src/stock.c:90 +msgid "_Tops" +msgstr "_Oben" + +#: ../src/stock.c:91 +msgid "Bottoms" +msgstr "Unten" + +#: ../src/stock.c:92 +msgid "Centers" +msgstr "Mitte" + +#: ../src/stock.c:93 ../src/stock.c:94 +msgid "Label Ce_nter" +msgstr "Etikett ze_ntrieren" + +#: ../src/stock.c:95 ../data/builder/property-bar.glade.h:3 +msgid "Fill color" +msgstr "Füllfarbe" + +#: ../src/stock.c:96 ../data/builder/property-bar.glade.h:8 +msgid "Line color" +msgstr "Linienfarbe" + +#: ../src/stock.c:97 ../src/stock.c:99 +msgid "Linked" +msgstr "Verknüpft" + +#: ../src/stock.c:98 ../src/stock.c:100 +msgid "Not Linked" +msgstr "Nicht verknüpft" + +#. Menu entries. +#: ../src/ui.c:93 +msgid "_File" +msgstr "_Datei" + +#: ../src/ui.c:94 +msgid "Open Recent _Files" +msgstr "_Zuletzt geöffnete Dateien" + +#: ../src/ui.c:95 +msgid "_Edit" +msgstr "_Bearbeiten" + +#: ../src/ui.c:96 +msgid "_View" +msgstr "_Ansicht" + +#: ../src/ui.c:97 +msgid "Customize Main Toolbar" +msgstr "Werkzeugleiste anpassen" + +#: ../src/ui.c:98 +msgid "Customize Drawing Toolbar" +msgstr "Zeichenwerkzeugleiste anpassen" + +#: ../src/ui.c:99 +msgid "Customize Properties Toolbar" +msgstr "Eigenschaften-Werkzeugleiste anpassen" + +#: ../src/ui.c:100 +msgid "_Objects" +msgstr "_Objekte" + +#: ../src/ui.c:101 +msgid "_Create" +msgstr "_Erzeugen" + +#: ../src/ui.c:102 +msgid "_Order" +msgstr "_Anordnung" + +#: ../src/ui.c:103 +msgid "_Rotate/Flip" +msgstr "D_rehen/Spiegeln" + +#: ../src/ui.c:104 +msgid "Align _Horizontal" +msgstr "_Horizontal" + +#: ../src/ui.c:105 +msgid "Align _Vertical" +msgstr "_Vertikal" + +#: ../src/ui.c:106 +msgid "_Help" +msgstr "_Hilfe" + +#. Popup entries. +#: ../src/ui.c:109 ../src/ui.c:110 +msgid "Context Menu" +msgstr "Kontextmenü" + +#: ../src/ui.c:115 +msgid "_New" +msgstr "_Neu" + +#: ../src/ui.c:117 +msgid "Create a new file" +msgstr "Eine neue Datei erstellen" + +#: ../src/ui.c:122 +msgid "_Open..." +msgstr "Ö_ffnen …" + +#: ../src/ui.c:124 +msgid "Open a file" +msgstr "Eine Datei öffnen" + +#: ../src/ui.c:129 +msgid "_Save" +msgstr "_Speichern" + +#: ../src/ui.c:131 +msgid "Save current file" +msgstr "Die aktuelle Datei speichern" + +#: ../src/ui.c:136 +msgid "Save _As..." +msgstr "Speichern _unter …" + +#: ../src/ui.c:138 +msgid "Save the current file to a different name" +msgstr "Die aktuelle Datei unter einem anderen Dateinamen speichern" + +#: ../src/ui.c:143 +msgid "_Print..." +msgstr "_Drucken …" + +#: ../src/ui.c:145 +msgid "Print the current file" +msgstr "Die aktuelle Datei drucken" + +#: ../src/ui.c:150 +msgid "Properties..." +msgstr "Einstellungen …" + +#: ../src/ui.c:152 +msgid "Modify document properties" +msgstr "Dokumenteigenschaften ändern" + +#: ../src/ui.c:157 +msgid "Template _Designer..." +msgstr "Vorlagen-_Designer …" + +#: ../src/ui.c:159 +msgid "Create a custom template" +msgstr "Eine neue benutzerdefinierte Vorlage erstellen" + +#: ../src/ui.c:164 +msgid "_Close" +msgstr "S_chließen" + +#: ../src/ui.c:166 +msgid "Close the current file" +msgstr "Die aktuelle Datei schließen" + +#: ../src/ui.c:171 +msgid "_Quit" +msgstr "_Beenden" + +#: ../src/ui.c:173 +msgid "Quit the program" +msgstr "Das Programm beenden" + +#: ../src/ui.c:180 +msgid "Cut" +msgstr "Ausschneiden" + +#: ../src/ui.c:182 +msgid "Cut the selection" +msgstr "Die Markierung ausschneiden" + +#: ../src/ui.c:187 +msgid "Copy" +msgstr "Kopieren" + +#: ../src/ui.c:189 +msgid "Copy the selection" +msgstr "Die Markierung kopieren" + +#: ../src/ui.c:194 +msgid "Paste" +msgstr "Einfügen" + +#: ../src/ui.c:196 +msgid "Paste the clipboard" +msgstr "Inhalt der Zwischenablage einfügen" + +#: ../src/ui.c:201 +msgid "Delete" +msgstr "Löschen" + +#: ../src/ui.c:203 +msgid "Delete the selected objects" +msgstr "Die markierten Objekte löschen" + +#: ../src/ui.c:208 +msgid "Select All" +msgstr "Alles markieren" + +#: ../src/ui.c:210 +msgid "Select all objects" +msgstr "Alle Objekte markieren" + +#: ../src/ui.c:215 +msgid "Un-select All" +msgstr "Alle Markierungen löschen" + +#: ../src/ui.c:217 +msgid "Remove all selections" +msgstr "Alle Auswahlen aufheben" + +#: ../src/ui.c:222 +msgid "Preferences" +msgstr "Einstellungen" + +#: ../src/ui.c:224 +msgid "Configure the application" +msgstr "Die Anwendung konfigurieren" + +#: ../src/ui.c:231 +msgid "Zoom in" +msgstr "Vergrößern" + +#: ../src/ui.c:233 +msgid "Increase magnification" +msgstr "Vergrößern" + +#: ../src/ui.c:238 +msgid "Zoom out" +msgstr "Verkleinern" + +#: ../src/ui.c:240 +msgid "Decrease magnification" +msgstr "Verkleinern" + +#: ../src/ui.c:245 +msgid "Zoom 1 to 1" +msgstr "Vergrößerung 1:1" + +#: ../src/ui.c:247 +msgid "Restore scale to 100%" +msgstr "Maßstab auf 100% wiederherstellen" + +#: ../src/ui.c:252 +msgid "Zoom to fit" +msgstr "Einpassen" + +#: ../src/ui.c:254 +msgid "Set scale to fit window" +msgstr "In Fenster einpassen" + +#: ../src/ui.c:261 +msgid "Select Mode" +msgstr "Modus auswählen" + +#: ../src/ui.c:263 +msgid "Select, move and modify objects" +msgstr "Objekte auswählen, bewegen, ändern" + +#: ../src/ui.c:268 ../src/view-text.c:494 +#: ../data/builder/object-editor.glade.h:32 +msgid "Text" +msgstr "Text" + +#: ../src/ui.c:270 +msgid "Create text object" +msgstr "Textobjekt erzeugen" + +#: ../src/ui.c:275 +msgid "Box" +msgstr "Rechteck" + +#: ../src/ui.c:277 +msgid "Create box/rectangle object" +msgstr "Rechteck-Objekt erzeugen" + +#: ../src/ui.c:282 ../data/builder/object-editor.glade.h:20 +msgid "Line" +msgstr "Linie" + +#: ../src/ui.c:284 +msgid "Create line object" +msgstr "Linienobjekt erzeugen" + +#: ../src/ui.c:289 +msgid "Ellipse" +msgstr "Ellipse" + +#: ../src/ui.c:291 +msgid "Create ellipse/circle object" +msgstr "Ellipsen- oder Kreisobjekt erzeugen" + +#: ../src/ui.c:296 ../data/builder/object-editor.glade.h:16 +msgid "Image" +msgstr "Bild" + +#: ../src/ui.c:298 +msgid "Create image object" +msgstr "Bildobjekt erzeugen" + +#: ../src/ui.c:303 +msgid "Barcode" +msgstr "Strichcode" + +#: ../src/ui.c:305 +msgid "Create barcode object" +msgstr "Strichcodeobjekt erzeugen" + +#: ../src/ui.c:310 +msgid "Bring to front" +msgstr "Ganz nach vorn" + +#: ../src/ui.c:312 +msgid "Raise object to top" +msgstr "Objekt im Ebenenstapel nach oben verschieben" + +#: ../src/ui.c:317 +msgid "Send to back" +msgstr "Ganz nach hinten" + +#: ../src/ui.c:319 +msgid "Lower object to bottom" +msgstr "Objekt im Ebenenstapel nach unten verschieben" + +#: ../src/ui.c:324 +msgid "Rotate left" +msgstr "Links drehen" + +#: ../src/ui.c:326 +msgid "Rotate object 90 degrees counter-clockwise" +msgstr "Objekt um 90 Grad gegen den Uhrzeigersinn drehen" + +#: ../src/ui.c:331 +msgid "Rotate right" +msgstr "Rechts drehen" + +#: ../src/ui.c:333 +msgid "Rotate object 90 degrees clockwise" +msgstr "Objekt um 90 Grad im Uhrzeigersinn drehen" + +#: ../src/ui.c:338 +msgid "Flip horizontally" +msgstr "Horizontal spiegeln" + +#: ../src/ui.c:340 +msgid "Flip object horizontally" +msgstr "Objekt horizontal spiegeln" + +#: ../src/ui.c:345 +msgid "Flip vertically" +msgstr "Vertikal spiegeln" + +#: ../src/ui.c:347 +msgid "Flip object vertically" +msgstr "Objekt vertikal spiegeln" + +#: ../src/ui.c:352 +msgid "Align left" +msgstr "Linksbündig" + +#: ../src/ui.c:354 +msgid "Align objects to left edges" +msgstr "Objekte am linken Rand anordnen" + +#: ../src/ui.c:359 +msgid "Align right" +msgstr "Rechtsbündig" + +#: ../src/ui.c:361 +msgid "Align objects to right edges" +msgstr "Objekte am rechten Rand anordnen" + +#: ../src/ui.c:366 +msgid "Align horizontal center" +msgstr "Horizontal mittig anordnen" + +#: ../src/ui.c:368 +msgid "Align objects to horizontal centers" +msgstr "Objekte an der horizontalen Mitte anordnen" + +#: ../src/ui.c:373 +msgid "Align tops" +msgstr "Oben bündig" + +#: ../src/ui.c:375 +msgid "Align objects to top edges" +msgstr "Objekte am oberen Rand anordnen" + +#: ../src/ui.c:380 +msgid "Align bottoms" +msgstr "Unten bündig" + +#: ../src/ui.c:382 +msgid "Align objects to bottom edges" +msgstr "Objekte am unteren Rand anordnen" + +#: ../src/ui.c:387 +msgid "Align vertical center" +msgstr "Vertikal mittig anordnen" + +#: ../src/ui.c:389 +msgid "Align objects to vertical centers" +msgstr "Objekte an der vertikalen Mitte anordnen" + +#: ../src/ui.c:394 +msgid "Center horizontally" +msgstr "Horizontal zentrieren" + +#: ../src/ui.c:396 +msgid "Center objects to horizontal label center" +msgstr "Objekte zur horizontalen Mitte des Etiketts zentrieren" + +#: ../src/ui.c:401 +msgid "Center vertically" +msgstr "Vertikal zentrieren" + +#: ../src/ui.c:403 +msgid "Center objects to vertical label center" +msgstr "Objekte zur vertikalen Mitte des Etiketts zentrieren" + +#: ../src/ui.c:408 +msgid "Merge properties" +msgstr "Mischeinstellungen" + +#: ../src/ui.c:410 +msgid "Edit merge properties" +msgstr "Mischeinstellungen bearbeiten" + +#: ../src/ui.c:417 +msgid "Contents" +msgstr "Inhalte" + +#: ../src/ui.c:419 +msgid "Open glabels manual" +msgstr "Das gLabels-Handbuch öffnen" + +#: ../src/ui.c:424 +msgid "About..." +msgstr "Info …" + +#: ../src/ui.c:426 +msgid "About glabels" +msgstr "Info zu gLabels" + +# CHECK +#: ../src/ui.c:436 +msgid "Property toolbar" +msgstr "Eigenschaften-Werkzeugleiste" + +#: ../src/ui.c:438 +msgid "Change the visibility of the property toolbar in the current window" +msgstr "" +"Die Sichtbarkeit der Werkzeugleiste im aktuellen Fenster ein- oder ausschalten" + +#: ../src/ui.c:444 +msgid "Grid" +msgstr "Raster" + +#: ../src/ui.c:446 +msgid "Change the visibility of the grid in the current window" +msgstr "Die Sichtbarkeit des Rasters im aktuellen Fenster ein- oder ausschalten" + +#: ../src/ui.c:452 +msgid "Markup" +msgstr "Markierungen" + +#: ../src/ui.c:454 +msgid "Change the visibility of markup lines in the current window" +msgstr "Die Sichtbarkeit von Markierungslinien im aktuellen Fenster ändern" + +#: ../src/ui.c:465 +msgid "Main toolbar" +msgstr "Haupt-Werkzeugleiste" + +#: ../src/ui.c:467 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "" +"Die Sichtbarkeit der Haupt-Werkzeugleiste im aktuellen Fenster einschalten/" +"ausschalten" + +#: ../src/ui.c:473 +msgid "Drawing toolbar" +msgstr "Zeichenwerkzeugleiste" + +#: ../src/ui.c:475 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "" +"Die Sichtbarkeit der Zeichenwerkzeugleiste im aktuellen Fenster einschalten/" +"ausschalten" + +#: ../src/ui-property-bar.c:279 ../src/prefs-dialog.c:328 +#: ../src/object-editor-bc-page.c:93 ../src/object-editor-text-page.c:93 +#: ../src/object-editor-shadow-page.c:93 +msgid "Default" +msgstr "Standard" + +#: ../src/ui-property-bar.c:291 ../src/prefs-dialog.c:334 +#: ../src/object-editor-fill-page.c:79 +msgid "No Fill" +msgstr "Keine Füllung" + +#: ../src/ui-property-bar.c:303 ../src/prefs-dialog.c:331 +#: ../src/object-editor-line-page.c:81 +msgid "No Line" +msgstr "Keine Linie" + +#: ../src/ui-sidebar.c:152 +msgid "Object properties" +msgstr "Objekteigenschaften" + +#: ../src/ui-commands.c:1064 +msgid "Glabels includes contributions from:" +msgstr "Glabels entstand unter Mitwirkung von:" + +#: ../src/ui-commands.c:1070 +msgid "See the file AUTHORS for additional credits," +msgstr "Lesen die Datei AUTHORS für zusätzliche Danksagungen," + +#: ../src/ui-commands.c:1071 +msgid "or visit http://glabels.sourceforge.net/" +msgstr "oder besuchen Sie http://glabels.sourceforge.net/" + +#: ../src/ui-commands.c:1083 +msgid "A label and business card creation program.\n" +msgstr "Eine Anwendung zum Erstellen von Etiketten und Visitenkarten.\n" + +#: ../src/ui-commands.c:1087 +msgid "translator-credits" +msgstr "" +"Marcus Bauer \n" +"Christian Neumair \n" +"Mario Blättermann " + +#: ../src/ui-commands.c:1090 +msgid "" +"Glabels is free software; you can redistribute it and/or modify it\n" +"under the terms of the GNU General Public License as published by\n" +"the Free Software Foundation; either version 2 of the License, or\n" +"(at your option) any later version.\n" +"\n" +"This program is distributed in the hope that it will be useful, but\n" +"WITHOUT ANY WARRANTY; without even the implied warranty of\n" +"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See\n" +"the GNU General Public License for more details.\n" +msgstr "" +"Glabels ist freie Software; Sie können sie weiterverteilen und/oder ändern\n" +"unter den Bedingungen der GNU General Public License, veröffentlicht von\n" +"der Free Software Foundation, entweder Version 2 der Lizenz oder (optional)\n" +"jeder späteren Version.\n" +" \n" +"Dieses Programm wird verteilt in der Hoffnung, dass es nützlich ist, aber\n" +"OHNE JEDE GARANTIE; Weitere Details in der GNU General Public License.\n" + +#: ../src/ui-commands.c:1116 +msgid "glabels" +msgstr "glabels" + +#: ../src/file.c:91 +msgid "New Label or Card" +msgstr "Neues Etikett oder neue Karte" + +#: ../src/file.c:191 +msgid "Label properties" +msgstr "Etiketten-Eigenschaften" + +#: ../src/file.c:292 ../src/file.c:578 +msgid "All files" +msgstr "Alle Dateien" + +#: ../src/file.c:297 ../src/file.c:583 +msgid "gLabels documents" +msgstr "gLabels-Dokumente" + +#: ../src/file.c:343 ../src/file.c:640 +msgid "Empty file name selection" +msgstr "Auswahl des Dateinamens ist leer" + +#: ../src/file.c:346 ../src/file.c:362 +msgid "Please select a file or supply a valid file name" +msgstr "Bitte wählen Sie eine Datei oder geben Sie einen gültigen Dateinamen an" + +#: ../src/file.c:359 +msgid "File does not exist" +msgstr "Datei existiert nicht" + +#: ../src/file.c:433 +#, c-format +msgid "Could not open file \"%s\"" +msgstr "Datei »%s« konnte nicht geöffnet werden" + +#: ../src/file.c:436 +msgid "Not a supported file format" +msgstr "Kein unterstütztes Dateiformat" + +#: ../src/file.c:513 ../src/file.c:690 +#, c-format +msgid "Could not save file \"%s\"" +msgstr "Datei »%s« konnte nicht gespeichert werden" + +#: ../src/file.c:517 ../src/file.c:694 +msgid "Error encountered during save. The file is still not saved." +msgstr "Fehler während des Speicherns. Datei wurde noch nicht gespeichert." + +#: ../src/file.c:556 +#, c-format +msgid "Save \"%s\" as" +msgstr "»%s« speichern unter" + +#: ../src/file.c:643 +msgid "Please supply a valid file name" +msgstr "Bitte geben Sie einen gültigen Dateinamen an" + +#: ../src/file.c:664 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "Datei »%s« überschreiben?" + +#: ../src/file.c:668 +msgid "File already exists." +msgstr "Datei existiert bereits." + +#: ../src/file.c:764 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "Änderungen am Dokument »%s« vor dem Schließen speichern?" + +#: ../src/file.c:768 +msgid "Your changes will be lost if you don't save them." +msgstr "Nicht gespeicherte Änderungen gehen verloren, wenn Sie nicht speichern." + +#: ../src/file.c:771 +msgid "Close without saving" +msgstr "Schließen, ohne zu speichern" + +#. Should not happen +#: ../src/prefs.c:159 ../src/prefs.c:166 +#: ../data/builder/object-editor.glade.h:43 +#: ../data/builder/prefs-dialog.glade.h:22 +msgid "points" +msgstr "Punkte" + +#: ../src/prefs.c:161 ../data/builder/object-editor.glade.h:42 +#: ../data/builder/template-designer.glade.h:64 +msgid "inches" +msgstr "Zoll" + +#: ../src/prefs.c:163 +msgid "mm" +msgstr "mm" + +#: ../src/prefs-dialog.c:167 ../data/builder/prefs-dialog.glade.h:21 +msgid "gLabels Preferences" +msgstr "gLabels-Einstellungen" + +#. Build editor. +#: ../src/view-box.c:175 +msgid "Box object properties" +msgstr "Eigenschaften des Rechteck-Objekts" + +#. Build editor. +#: ../src/view-ellipse.c:175 +msgid "Ellipse object properties" +msgstr "Eigenschaften des Ellipsen-Objekts" + +#. Build editor. +#: ../src/view-line.c:174 +msgid "Line object properties" +msgstr "Eigenschaften des Linien-Objekts" + +#. Build editor. +#: ../src/view-image.c:174 +msgid "Image object properties" +msgstr "Eigenschaften des Bild-Objekts" + +#. Build editor. +#: ../src/view-text.c:178 +msgid "Text object properties" +msgstr "Eigenschaften des Text-Objekts" + +#. Build editor. +#: ../src/view-barcode.c:174 +msgid "Barcode object properties" +msgstr "Eigenschaften des Strichcode-Objekts" + +#: ../src/object-editor-image-page.c:267 +msgid "All Files" +msgstr "Alle Dateien" + +#: ../src/object-editor-image-page.c:272 +msgid "All Images" +msgstr "Alle Bilder" + +#: ../src/object-editor-image-page.c:287 +#, c-format +msgid "%s (*.%s)" +msgstr "%s (*.%s)" + +#: ../src/merge-properties-dialog.c:271 +msgid "Merge Properties" +msgstr "Mischeinstellungen" + +#: ../src/merge-properties-dialog.c:297 ../src/merge-properties-dialog.c:405 +msgid "Select merge-database source" +msgstr "Wählen Sie die einzumischende Datenquelle" + +#: ../src/merge-properties-dialog.c:306 ../src/merge-properties-dialog.c:425 +msgid "N/A" +msgstr "Nicht verfügbar" + +#: ../src/merge-properties-dialog.c:332 +msgid "Select" +msgstr "Markieren" + +#: ../src/merge-properties-dialog.c:340 +msgid "Record/Field" +msgstr "Feld" + +#: ../src/merge-properties-dialog.c:348 +#: ../data/builder/object-editor.glade.h:10 +msgid "Data" +msgstr "Wert" + +#: ../src/merge-properties-dialog.c:418 +msgid "Fixed" +msgstr "Fixiert" + +#. =================================================================== +#: ../src/print-op.c:242 ../src/wdgt-print-copies.c:171 +#: ../data/templates/misc-iso-templates.xml.h:34 +msgid "Labels" +msgstr "Labels" + +#: ../src/template-designer.c:411 +msgid "gLabels Template Designer" +msgstr "gLabels Vorlagen-Designer" + +#: ../src/template-designer.c:481 +msgid "Welcome" +msgstr "Willkommen" + +#: ../src/template-designer.c:534 +msgid "Name and Description" +msgstr "Name und Beschreibung" + +#: ../src/template-designer.c:595 +msgid "Page Size" +msgstr "Seitenformat" + +#: ../src/template-designer.c:675 +msgid "Label or Card Shape" +msgstr "Form des neuen Etiketts oder der neuen Karte" + +#: ../src/template-designer.c:735 +msgid "Label or Card Size" +msgstr "Größe des neuen Etiketts oder der neuen Karte" + +#: ../src/template-designer.c:844 +msgid "Label Size (round)" +msgstr "Etikettengröße (rund)" + +#: ../src/template-designer.c:935 +msgid "Label Size (CD/DVD)" +msgstr "Etikettengröße (CD/DVD)" + +#: ../src/template-designer.c:1036 +msgid "Number of Layouts" +msgstr "Anzahl der Layouts" + +#: ../src/template-designer.c:1110 +msgid "Layout(s)" +msgstr "Layout(s)" + +#: ../src/template-designer.c:1229 +msgid "Design Completed" +msgstr "Design ist komplett" + +#: ../src/template-designer.c:1396 +msgid "" +"Brand and part# match an existing " +"template!" +msgstr "" +"Für diese Marke und Nummer wurde eine " +"Vorlage gefunden!" + +#: ../src/bc.c:67 +msgid "POSTNET (any)" +msgstr "POSTNET (allgemein)" + +#: ../src/bc.c:70 +msgid "POSTNET-5 (ZIP only)" +msgstr "POSTNET-5 (nur ZIP)" + +#: ../src/bc.c:73 +msgid "POSTNET-9 (ZIP+4)" +msgstr "POSTNET-9 (ZIP+4)" + +#: ../src/bc.c:76 +msgid "POSTNET-11 (DPBC)" +msgstr "POSTNET-11 (DPBC)" + +#: ../src/bc.c:79 +msgid "CEPNET" +msgstr "CEPNET" + +#: ../src/bc.c:82 +msgid "EAN (any)" +msgstr "EAN (any)" + +#: ../src/bc.c:85 +msgid "EAN-8" +msgstr "EAN-8" + +#: ../src/bc.c:88 +msgid "EAN-8 +2" +msgstr "EAN-8 +2" + +#: ../src/bc.c:91 +msgid "EAN-8 +5" +msgstr "EAN-8 +5" + +#: ../src/bc.c:94 +msgid "EAN-13" +msgstr "EAN-13" + +#: ../src/bc.c:97 +msgid "EAN-13 +2" +msgstr "EAN-13 +2" + +#: ../src/bc.c:100 +msgid "EAN-13 +5" +msgstr "EAN-13 +5" + +#: ../src/bc.c:103 +msgid "UPC (UPC-A or UPC-E)" +msgstr "UPC (UPC-A oder UPC-E)" + +#: ../src/bc.c:106 +msgid "UPC-A" +msgstr "UPC-A" + +#: ../src/bc.c:109 +msgid "UPC-A +2" +msgstr "UPC-A +2" + +#: ../src/bc.c:112 +msgid "UPC-A +5" +msgstr "UPC-A +5" + +#: ../src/bc.c:115 +msgid "UPC-E" +msgstr "UPC-E" + +#: ../src/bc.c:118 +msgid "UPC-E +2" +msgstr "UPC-E +2" + +#: ../src/bc.c:121 +msgid "UPC-E +5" +msgstr "UPC-E +5" + +#: ../src/bc.c:124 +msgid "ISBN" +msgstr "ISBN" + +#: ../src/bc.c:127 +msgid "ISBN +5" +msgstr "ISBN +5" + +#: ../src/bc.c:130 +msgid "Code 39" +msgstr "Code 39" + +#: ../src/bc.c:133 +msgid "Code 128" +msgstr "Code 128" + +#: ../src/bc.c:136 +msgid "Code 128C" +msgstr "Code 128C" + +#: ../src/bc.c:139 +msgid "Code 128B" +msgstr "Code 128B" + +#: ../src/bc.c:142 +msgid "Interleaved 2 of 5" +msgstr "Interleaved 2 of 5" + +#: ../src/bc.c:145 +msgid "Codabar" +msgstr "Codabar" + +#: ../src/bc.c:148 +msgid "MSI" +msgstr "MSI" + +#: ../src/bc.c:151 +msgid "Plessey" +msgstr "Plessey" + +#: ../src/bc.c:154 +msgid "IEC16022 (DataMatrix)" +msgstr "IEC16022 (DataMatrix)" + +#: ../src/label.c:531 +msgid "Untitled" +msgstr "Unbenannt" + +#: ../src/label-barcode.c:426 +msgid "Barcode data empty" +msgstr "Strichcode-Daten sind leer" + +#: ../src/label-barcode.c:430 +msgid "Invalid barcode data" +msgstr "Ungültige Strichcode-Daten" + +#: ../src/xml-label.c:189 ../src/xml-label.c:226 +msgid "xmlParseFile error" +msgstr "Fehler: xmlParseFile error" + +#: ../src/xml-label.c:262 +msgid "No document root" +msgstr "Kein document root" + +#: ../src/xml-label.c:270 +msgid "Importing from glabels 0.1 format" +msgstr "Aus dem glabels 0.1-Format wird importiert" + +#: ../src/xml-label.c:279 +msgid "Importing from glabels 0.4 format" +msgstr "Aus dem glabels 0.4-Format wird importiert" + +#: ../src/xml-label.c:288 +#, c-format +msgid "Unknown glabels Namespace -- Using %s" +msgstr "Unbekannter glabels-Namensraum -- %s wird verwendet" + +#: ../src/xml-label.c:319 ../src/xml-label-04.c:79 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "Fehlerhafter root node = »%s«" + +#: ../src/xml-label.c:356 +#, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "Ungültiger Node im Dokument-Node = »%s«" + +#: ../src/xml-label.c:401 ../src/xml-label-04.c:127 +#, c-format +msgid "bad node = \"%s\"" +msgstr "fehlerhafter node = »%s«" + +#: ../src/xml-label.c:840 +#, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "Ungültiger Node im Daten-Node = »%s«" + +#: ../src/xml-label.c:1077 ../libglabels/xml-template.c:670 +msgid "Utf8 conversion error." +msgstr "Fehler in der UTF8-Umwandlung." + +#: ../src/xml-label.c:1084 +msgid "Problem saving xml file." +msgstr "Problem beim Speichern der xml-Datei." + +#: ../src/merge.c:170 ../src/merge.c:211 ../src/merge.c:375 ../src/merge.c:378 +msgid "None" +msgstr "Keine" + +#: ../src/merge-init.c:59 +msgid "Text file with comma delimeters (CSV)" +msgstr "Textdatei mit Kommata als Trennern (CSV)" + +#: ../src/merge-init.c:66 +msgid "Text file with colon delimeters" +msgstr "Textdatei mit Semikola als Trennern" + +#: ../src/merge-init.c:73 +msgid "Text file with tab delimeters" +msgstr "Textdatei mit Tabulatoren als Trennern" + +#: ../src/merge-init.c:82 +msgid "Data from default Evolution Addressbook" +msgstr "Daten aus dem vorgegebenen Evolution-Adressbuch" + +#: ../src/merge-init.c:88 +msgid "Data from a file containing VCards" +msgstr "Daten aus einer Datei, die VCards enthält" + +#: ../src/merge-evolution.c:309 +msgid "Couldn't construct query" +msgstr "Abfrage konnte nicht erstellt werden" + +#: ../src/merge-evolution.c:315 ../src/merge-evolution.c:326 +msgid "Couldn't open addressbook." +msgstr "Adressbuch konnte nicht geöffnet werden" + +#: ../src/merge-evolution.c:341 +msgid "Couldn't list available fields." +msgstr "Verfügbare Felder konnten nicht aufgelistet werden." + +#: ../src/merge-evolution.c:377 +msgid "Couldn't get contacts." +msgstr "Kontakte konnten nicht geholt werden." + +#: ../src/color-combo.c:210 +msgid "Default Color" +msgstr "Standardfarbe" + +#: ../src/color-combo-menu.c:86 +msgid "Dark Red" +msgstr "Dunkelrot" + +#: ../src/color-combo-menu.c:87 +msgid "Brown" +msgstr "Braun" + +#: ../src/color-combo-menu.c:88 +msgid "Dark Goldenrod" +msgstr "Dunkle Goldrute" + +#: ../src/color-combo-menu.c:89 +msgid "Dark Green" +msgstr "Dunkles Grün" + +#: ../src/color-combo-menu.c:90 +msgid "Dark Cyan" +msgstr "Dunkles Cyan-Blau" + +#: ../src/color-combo-menu.c:91 +msgid "Navy Blue" +msgstr "Marineblau" + +#: ../src/color-combo-menu.c:92 +msgid "Dark Violet" +msgstr "Dunkles Violett" + +#: ../src/color-combo-menu.c:94 +msgid "Red" +msgstr "Rot" + +#: ../src/color-combo-menu.c:95 +msgid "Orange" +msgstr "Orange" + +#: ../src/color-combo-menu.c:96 +msgid "Dark Yellow" +msgstr "Dunkles Gelb" + +#: ../src/color-combo-menu.c:97 +msgid "Medium green" +msgstr "Mittelgrün" + +#: ../src/color-combo-menu.c:98 +msgid "Turquoise" +msgstr "Türkis" + +#: ../src/color-combo-menu.c:99 +msgid "Blue" +msgstr "Blau" + +#: ../src/color-combo-menu.c:100 +msgid "Purple" +msgstr "Purpur" + +#: ../src/color-combo-menu.c:102 +msgid "Salmon" +msgstr "Lachs" + +#: ../src/color-combo-menu.c:103 +msgid "Gold" +msgstr "Gold" + +#: ../src/color-combo-menu.c:104 +msgid "Yellow" +msgstr "Gelb" + +#: ../src/color-combo-menu.c:105 +msgid "Green" +msgstr "Grün" + +#: ../src/color-combo-menu.c:106 +msgid "Cyan" +msgstr "Cyan-Blau" + +#: ../src/color-combo-menu.c:107 +msgid "SkyBlue" +msgstr "Himmelblau" + +#: ../src/color-combo-menu.c:108 +msgid "Violet" +msgstr "Violett" + +#: ../src/color-combo-menu.c:110 +msgid "Pink" +msgstr "Pink" + +#: ../src/color-combo-menu.c:111 +msgid "Khaki" +msgstr "Khaki" + +#: ../src/color-combo-menu.c:112 +msgid "Light Yellow" +msgstr "Helles Gelb" + +#: ../src/color-combo-menu.c:113 +msgid "Light Green" +msgstr "Helles Grün" + +#: ../src/color-combo-menu.c:114 +msgid "Light Cyan" +msgstr "Helles Cyan-Blau" + +#: ../src/color-combo-menu.c:115 +msgid "Slate Gray" +msgstr "Schiefergrau" + +#: ../src/color-combo-menu.c:116 +msgid "Thistle" +msgstr "Distle" + +#: ../src/color-combo-menu.c:118 +msgid "White" +msgstr "Weiß" + +#: ../src/color-combo-menu.c:119 +#, c-format +msgid "10% Gray" +msgstr "10% Grau" + +#: ../src/color-combo-menu.c:120 +#, c-format +msgid "25% Gray" +msgstr "25% Grau" + +#: ../src/color-combo-menu.c:121 +#, c-format +msgid "40% Gray" +msgstr "40% Grau" + +#: ../src/color-combo-menu.c:122 +#, c-format +msgid "50% Gray" +msgstr "50% Grau" + +#: ../src/color-combo-menu.c:123 +#, c-format +msgid "60% Gray" +msgstr "60% Grau" + +#: ../src/color-combo-menu.c:124 +msgid "Black" +msgstr "Schwarz" + +#: ../src/color-combo-menu.c:252 ../src/color-combo-menu.c:369 +msgid "Custom Color" +msgstr "Benutzerdefinierte Farbe" + +#: ../src/color-combo-menu.c:317 +#, c-format +msgid "Custom Color #%u" +msgstr "Benutzerdefinierte Farbe #%u" + +#: ../src/wdgt-print-copies.c:153 +msgid "Sheets:" +msgstr "Seiten:" + +#: ../src/wdgt-print-copies.c:173 +msgid "from:" +msgstr "von:" + +#: ../src/wdgt-print-copies.c:179 +msgid "to:" +msgstr "bis:" + +#: ../src/wdgt-print-merge.c:154 +msgid "Start on label" +msgstr "Start bei Etikett" + +#: ../src/wdgt-print-merge.c:161 +msgid "on 1st sheet" +msgstr "auf erster Seite" + +#: ../src/wdgt-print-merge.c:170 +msgid "Copies:" +msgstr "Kopien:" + +#: ../src/wdgt-print-merge.c:176 +msgid "Collate" +msgstr "Zuordnen" + +#: ../src/wdgt-media-select.c:290 ../src/wdgt-media-select.c:294 +#: ../src/wdgt-media-select.c:299 ../src/wdgt-media-select.c:308 +#: ../src/wdgt-media-select.c:311 ../src/wdgt-media-select.c:404 +#: ../src/wdgt-media-select.c:611 ../src/wdgt-media-select.c:620 +msgid "Any" +msgstr "Beliebig" + +#: ../src/wdgt-media-select.c:645 +#, c-format +msgid "%d per sheet" +msgstr "%d pro Seite" + +#: ../src/wdgt-media-select.c:675 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +#: ../src/wdgt-media-select.c:680 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: ../src/wdgt-media-select.c:691 ../src/wdgt-media-select.c:705 +#, c-format +msgid "%s %s diameter" +msgstr "%s %s Durchmesser" + +#: ../src/wdgt-media-select.c:695 ../src/wdgt-media-select.c:709 +#, c-format +msgid "%.5g %s diameter" +msgstr "%.5g %s Durchmesser" + +#: ../src/wdgt-media-select.c:783 +msgid "No recent templates found." +msgstr "Keine zuletzt benutzten Vorlagen gefunden." + +#: ../src/wdgt-media-select.c:784 +msgid "Try selecting a template from the \"Search all templates\" page." +msgstr "" +"Bitte versuchen Sie, eine Vorlage in »Alle Vorlagen durchsuchen« auszuwählen." + +#: ../src/wdgt-media-select.c:863 +msgid "No match." +msgstr "Keine Treffer." + +#: ../src/wdgt-media-select.c:864 +msgid "Try selecting a different brand, page size or category." +msgstr "" +"Versuchen Sie eine andere Marke, Seitengröße oder Kategorie auszuwählen." + +#: ../src/wdgt-rotate-label.c:129 +msgid "Normal" +msgstr "Normal" + +#: ../src/wdgt-rotate-label.c:130 +msgid "Rotated" +msgstr "Gedreht" + +#: ../src/critical-error-handler.c:73 +msgid "gLabels Fatal Error!" +msgstr "Schwerwiegender Fehler in gLabels!" + +#: ../src/warning-handler.c:73 +msgid "gLabels Error!" +msgstr "gLabels-Fehler!" + +#. Create and append an "Other" entry. +#: ../libglabels/db.c:118 +msgid "Other" +msgstr "Andere" + +#. Create and append a "User defined" entry. +#: ../libglabels/db.c:131 +msgid "User defined" +msgstr "Benutzerdefiniert" + +#: ../libglabels/db.c:482 +msgid "" +"Unable to locate paper size definitions. Libglabels may not be installed " +"correctly!" +msgstr "" +"Die Definitionen der Papiergrößen konnten nicht gefunden werden. Libglabels " +"ist möglicherweise nicht korrekt installiert!" + +#: ../libglabels/db.c:875 +msgid "" +"Unable to locate category definitions. Libglabels may not be installed " +"correctly!" +msgstr "" +"Es war nicht möglich, Kategorie-Definitionen zu finden. Libglabels könnte " +"möglicherweise nicht korrekt installiert sein!" + +#: ../libglabels/db.c:1461 +msgid "" +"Unable to locate any template files. Libglabels may not be installed " +"correctly!" +msgstr "" +"Es konnten keine Vorlagendateien gefunden werden. Möglicherweise ist " +"libglabels nicht korrekt installiert!" + +#: ../libglabels/db.c:1538 +#, c-format +msgid "Generic %s full page template" +msgstr "Allgemeine Ganzseitenvorlage %s" + +#: ../libglabels/xml-template.c:227 +msgid "Missing name or brand/part attributes." +msgstr "Name oder Attribute für Marke/Nummer fehlen." + +#. This should always be an id, but just in case a name +#. slips by! +#: ../libglabels/xml-template.c:244 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "Unbekannte Kennung der Seitengröße »%s«, wird als Name versucht" + +#: ../libglabels/xml-template.c:256 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "Unbekannte Kennung der Seitengröße oder Name »%s«" + +#: ../libglabels/xml-template.c:615 +msgid "" +"Missing required \"brand\" or \"part\" attribute, trying deprecated name." +msgstr "" +"Benötigte Attribute »brand« oder »part« fehlt, missbilligter Name wird " +"versucht. " + +#: ../libglabels/xml-template.c:625 +msgid "Name attribute also missing." +msgstr "Name des Attributs fehlt ebenfalls." + +#: ../data/builder/merge-properties-dialog.glade.h:1 +msgid "Record selection/preview" +msgstr "Feldauswahl/Vorschau" + +#: ../data/builder/merge-properties-dialog.glade.h:2 +msgid "Source" +msgstr "Quelle" + +#: ../data/builder/merge-properties-dialog.glade.h:3 +msgid "Format:" +msgstr "Format:" + +#: ../data/builder/merge-properties-dialog.glade.h:4 +msgid "Location:" +msgstr "Ort:" + +#: ../data/builder/merge-properties-dialog.glade.h:5 +msgid "Select all" +msgstr "Alles markieren" + +#: ../data/builder/merge-properties-dialog.glade.h:6 +msgid "Unselect all" +msgstr "Markierung aufheben" + +#: ../data/builder/merge-properties-dialog.glade.h:7 +#: ../data/builder/object-editor.glade.h:39 +msgid "dialog1" +msgstr "dialog1" + +#: ../data/builder/new-label-dialog.glade.h:1 +msgid "Label orientation" +msgstr "Ausrichtung des Etiketts" + +#: ../data/builder/new-label-dialog.glade.h:2 +msgid "Media type" +msgstr "Medientyp" + +#: ../data/builder/object-editor.glade.h:2 +#, no-c-format +msgid "%" +msgstr "%" + +#: ../data/builder/object-editor.glade.h:3 +msgid "00000000000 00000" +msgstr "00000000000 00000" + +#: ../data/builder/object-editor.glade.h:4 +msgid "Xxx object properties" +msgstr "Xxx-Objekteigenschaften" + +#: ../data/builder/object-editor.glade.h:5 +#: ../data/builder/prefs-dialog.glade.h:7 +msgid "Alignment:" +msgstr "Ausrichtung:" + +#: ../data/builder/object-editor.glade.h:6 +msgid "Allow merge to automatically shrink text" +msgstr "Automatisches Anpassen der Textgröße erlauben" + +#: ../data/builder/object-editor.glade.h:7 +msgid "Angle:" +msgstr "Winkel:" + +#: ../data/builder/object-editor.glade.h:8 +msgid "Checksum" +msgstr "Prüfsumme" + +#: ../data/builder/object-editor.glade.h:9 +#: ../data/builder/prefs-dialog.glade.h:8 +msgid "Color:" +msgstr "Farbe:" + +#: ../data/builder/object-editor.glade.h:11 +msgid "Enable shadow" +msgstr "Schattierung aktivieren" + +#: ../data/builder/object-editor.glade.h:12 +msgid "Family:" +msgstr "Familie:" + +#: ../data/builder/object-editor.glade.h:13 +msgid "File:" +msgstr "Datei:" + +#: ../data/builder/object-editor.glade.h:14 +msgid "Fill" +msgstr "Füllen" + +#: ../data/builder/object-editor.glade.h:15 +#: ../data/builder/template-designer.glade.h:30 +msgid "Height:" +msgstr "Höhe" + +#: ../data/builder/object-editor.glade.h:17 +msgid "Insert merge field" +msgstr "Datenfeld einfügen" + +#: ../data/builder/object-editor.glade.h:18 +msgid "Key:" +msgstr "Schlüssel:" + +#: ../data/builder/object-editor.glade.h:19 +msgid "Length:" +msgstr "Länge:" + +#: ../data/builder/object-editor.glade.h:21 +#: ../data/builder/prefs-dialog.glade.h:12 +msgid "Line Spacing:" +msgstr "Zeilenabstand:" + +#: ../data/builder/object-editor.glade.h:22 +msgid "Literal:" +msgstr "Literale:" + +#: ../data/builder/object-editor.glade.h:23 +msgid "Opacity:" +msgstr "Transparenz:" + +#: ../data/builder/object-editor.glade.h:24 +msgid "Position" +msgstr "Position" + +#: ../data/builder/object-editor.glade.h:25 +msgid "Reset image size" +msgstr "Bildgröße zurücksetzen" + +#: ../data/builder/object-editor.glade.h:26 +msgid "Select A File" +msgstr "Datei auswählen" + +#: ../data/builder/object-editor.glade.h:27 +msgid "Shadow" +msgstr "Schattierung" + +#: ../data/builder/object-editor.glade.h:28 +msgid "Size" +msgstr "Breite" + +#: ../data/builder/object-editor.glade.h:29 +msgid "Size:" +msgstr "Größe:" + +#: ../data/builder/object-editor.glade.h:30 +msgid "Style" +msgstr "Stil" + +#: ../data/builder/object-editor.glade.h:31 +msgid "Style:" +msgstr "Stil:" + +#: ../data/builder/object-editor.glade.h:33 +#: ../data/builder/prefs-dialog.glade.h:20 +#: ../data/builder/template-designer.glade.h:61 +msgid "Width:" +msgstr "Breite:" + +#: ../data/builder/object-editor.glade.h:34 +msgid "X Offset:" +msgstr "X-Versatz:" + +#: ../data/builder/object-editor.glade.h:35 +msgid "X:" +msgstr "X:" + +#: ../data/builder/object-editor.glade.h:36 +msgid "Y Offset:" +msgstr "Y-Versatz:" + +#: ../data/builder/object-editor.glade.h:37 +msgid "Y:" +msgstr "Y:" + +#: ../data/builder/object-editor.glade.h:38 +msgid "degrees" +msgstr "Grad" + +#: ../data/builder/object-editor.glade.h:40 +msgid "digits:" +msgstr "Zeichen:" + +#: ../data/builder/object-editor.glade.h:41 +msgid "format:" +msgstr "Format:" + +#: ../data/builder/prefs-dialog.glade.h:1 +msgid " " +msgstr " " + +#: ../data/builder/prefs-dialog.glade.h:2 +msgid "Default page size" +msgstr "Vorgegebene Seitengröße" + +#: ../data/builder/prefs-dialog.glade.h:3 +msgid "Fill" +msgstr "Füllung" + +#: ../data/builder/prefs-dialog.glade.h:4 +msgid "Line" +msgstr "Linie" + +#: ../data/builder/prefs-dialog.glade.h:5 +msgid "Text" +msgstr "Text" + +#: ../data/builder/prefs-dialog.glade.h:6 +msgid "Units" +msgstr "Einheiten" + +#: ../data/builder/prefs-dialog.glade.h:9 +msgid "Font:" +msgstr "Schrift:" + +#: ../data/builder/prefs-dialog.glade.h:10 +msgid "ISO A4" +msgstr "A4" + +#: ../data/builder/prefs-dialog.glade.h:11 +msgid "Inches" +msgstr "Zoll" + +#: ../data/builder/prefs-dialog.glade.h:13 +msgid "Locale" +msgstr "Spracheinstellung" + +#: ../data/builder/prefs-dialog.glade.h:14 +msgid "Millimeters" +msgstr "Millimeter" + +#: ../data/builder/prefs-dialog.glade.h:15 +msgid "Object defaults" +msgstr "Objekt-Vorgaben" + +#: ../data/builder/prefs-dialog.glade.h:16 +msgid "Points" +msgstr "Punkte" + +#: ../data/builder/prefs-dialog.glade.h:17 +msgid "Select default properties for new objects." +msgstr "Wählen Sie die vorgegebenen Eigenschaften für neue Objekte." + +#: ../data/builder/prefs-dialog.glade.h:18 +msgid "Select locale specific behavior." +msgstr "Wählen Sie hier Einstellungen gemäß Ihrer Sprache/Ihres Landes." + +#. Most popular (at top of list) +#: ../data/builder/prefs-dialog.glade.h:19 +#: ../data/templates/paper-sizes.xml.h:29 +msgid "US Letter" +msgstr "US-Letter" + +#: ../data/builder/print-custom-widget.glade.h:1 +msgid "Options" +msgstr "Optionen" + +#: ../data/builder/print-custom-widget.glade.h:2 +msgid "Print control (Merge)" +msgstr "Drucksteuerung (Mischen)" + +#: ../data/builder/print-custom-widget.glade.h:3 +msgid "Print control (Simple)" +msgstr "Drucksteuerung (Einfach)" + +#: ../data/builder/property-bar.glade.h:1 +msgid "Bold" +msgstr "Fett" + +#: ../data/builder/property-bar.glade.h:2 +msgid "Center align" +msgstr "Zentrieren" + +#: ../data/builder/property-bar.glade.h:4 +msgid "Font family" +msgstr "Schriftfamilie" + +#: ../data/builder/property-bar.glade.h:5 +msgid "Font size" +msgstr "Schriftgröße" + +#: ../data/builder/property-bar.glade.h:6 +msgid "Italic" +msgstr "Kursiv" + +#: ../data/builder/property-bar.glade.h:7 +msgid "Left align" +msgstr "Linksbündig" + +#: ../data/builder/property-bar.glade.h:9 +msgid "Line width" +msgstr "Linienbreite" + +#: ../data/builder/property-bar.glade.h:10 +msgid "Right align" +msgstr "Rechtsbündig" + +#: ../data/builder/property-bar.glade.h:11 +msgid "Text Color" +msgstr "Textfarbe" + +#: ../data/builder/template-designer.glade.h:1 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "(z.B. »Adressaufkleber«, »Visitenkarten« …)" + +#: ../data/builder/template-designer.glade.h:2 +msgid "(e.g., 8163A)" +msgstr "(z.B., 8163A)" + +#: ../data/builder/template-designer.glade.h:3 +msgid "(e.g., Avery, Acme, ...)" +msgstr "(z.B., Avery, Acme, ...)" + +#: ../data/builder/template-designer.glade.h:4 +msgid "1. Outer radius:" +msgstr "1. Äußerer Radius:" + +#: ../data/builder/template-designer.glade.h:5 +msgid "1. Radius:" +msgstr "1. Radius:" + +#: ../data/builder/template-designer.glade.h:6 +msgid "1. Width:" +msgstr "1. Breite:" + +#: ../data/builder/template-designer.glade.h:7 +msgid "2. Height:" +msgstr "2. Höhe:" + +#: ../data/builder/template-designer.glade.h:8 +msgid "2. Inner radius:" +msgstr "2. Innerer Radius:" + +#: ../data/builder/template-designer.glade.h:9 +msgid "2. Waste (overprint allowed):" +msgstr "2. Überstand (Bedrucken erlaubt):" + +#: ../data/builder/template-designer.glade.h:10 +msgid "3. Clipping width:" +msgstr "3. Innere Breite:" + +#: ../data/builder/template-designer.glade.h:11 +msgid "3. Margin" +msgstr "3. Ränder" + +#: ../data/builder/template-designer.glade.h:12 +msgid "3. Round (radius of corner):" +msgstr "3. Rundung (Radius der Ecken):" + +#: ../data/builder/template-designer.glade.h:13 +msgid "4. Clipping height:" +msgstr "4. Innere Höhe:" + +#: ../data/builder/template-designer.glade.h:14 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "4. Horiz. Überstand (Bedrucken erlaubt):" + +#: ../data/builder/template-designer.glade.h:15 +msgid "5. Vert. waste (overprint allowed):" +msgstr "3. Vert. Überstand (Bedrucken erlaubt):" + +#: ../data/builder/template-designer.glade.h:16 +msgid "5. Waste (overprint allowed):" +msgstr "5. Überstand (Bedrucken erlaubt):" + +#: ../data/builder/template-designer.glade.h:17 +msgid "6. Margin" +msgstr "6. Rand" + +#: ../data/builder/template-designer.glade.h:18 +msgid "Brand/Manufacturer:" +msgstr "Marke/Hersteller:" + +#: ../data/builder/template-designer.glade.h:19 +msgid "CD/DVD (including credit card CDs)" +msgstr "CD/DVD (einschließlich Kreditkarten-CDs)" + +#: ../data/builder/template-designer.glade.h:20 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "" +"Herzlichen Glückwunsch!\n" +"\n" +"Das Erzeugen der Vorlage ist abgeschlossen.\n" +"Falls Sie diese Vorlage akzeptieren und speichern wollen,\n" +"klicken Sie auf »Akzeptieren«.\n" +"\n" +"Anderenfalls klicken Sie auf »Abbrechen«, um die\n" +"Vorlage zu verwerfen, oder auf »Zurück«,\n" +"um die Vorlage erneut zu bearbeiten." + +#: ../data/builder/template-designer.glade.h:27 +msgid "Description:" +msgstr "Beschreibung:" + +#: ../data/builder/template-designer.glade.h:28 +msgid "Distance from left edge (x0):" +msgstr "Abstand vom linken Rand (x0):" + +#: ../data/builder/template-designer.glade.h:29 +msgid "Distance from top edge (y0):" +msgstr "Abstand vom oberen Rand (x0):" + +#: ../data/builder/template-designer.glade.h:31 +msgid "Horizontal pitch (dx):" +msgstr "Horizontaler Abstand (dx):" + +#: ../data/builder/template-designer.glade.h:32 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" +"Wie viele Layouts wird Ihre Vorlage enthalten?\n" +"\n" +"Ein Layout ist ein Satz von Etiketten oder Karten, die in einem einfachen " +"Raster\n" +"angeordnet sind. Die meisten Vorlagen verwenden nur ein Layout, wie im\n" +"ersten Beispiel. Das zweite Beispiel zeigt die Verwendung zweier Layouts." + +#: ../data/builder/template-designer.glade.h:37 +msgid "Layout #1" +msgstr "Layout #1" + +#: ../data/builder/template-designer.glade.h:38 +msgid "Layout #2" +msgstr "Layout #2" + +#: ../data/builder/template-designer.glade.h:39 +msgid "Number across (nx):" +msgstr "Anzahl horizontal (nx):" + +#: ../data/builder/template-designer.glade.h:40 +msgid "Number down (ny):" +msgstr "Anzahl vertikal (ny):" + +#: ../data/builder/template-designer.glade.h:41 +msgid "Number of layouts:" +msgstr "Anzahl der Layouts:" + +#: ../data/builder/template-designer.glade.h:42 +#: ../data/builder/wdgt-media-select.glade.h:3 +msgid "Page size:" +msgstr "Seitenformat:" + +#: ../data/builder/template-designer.glade.h:43 +msgid "Part #:" +msgstr "Nummer:" + +#: ../data/builder/template-designer.glade.h:44 +msgid "" +"Please enter the following identifying information about the template " +"stationery." +msgstr "" +"Bitte geben Sie die folgenden Identifizierungsinformationen über die Vorlage " +"an." + +#: ../data/builder/template-designer.glade.h:45 +msgid "Please enter the following layout information." +msgstr "Bitte geben Sie die folgenden Layout-Informationen ein." + +#: ../data/builder/template-designer.glade.h:46 +msgid "" +"Please enter the following size parameters of a single label in your template." +msgstr "" +"Bitte geben Sie die folgenden Größenwerte des einzelnen Etiketts in Ihrer " +"Vorlage an." + +#: ../data/builder/template-designer.glade.h:47 +msgid "" +"Please enter the following size parameters of a single label or card in your " +"template." +msgstr "" +"Bitte geben Sie die folgenden Größenwerte des einzelnen Etiketts oder der " +"einzelnen Karte in Ihrer Vorlage an." + +#: ../data/builder/template-designer.glade.h:48 +msgid "Please select the basic shape of the labels or cards." +msgstr "Bitte wählen Sie die Grundform der Etiketten oder Karten aus." + +#: ../data/builder/template-designer.glade.h:49 +msgid "Please select the page size of the template stationery." +msgstr "Bitte wählen Si das Papierformat der Vorlage aus." + +#: ../data/builder/template-designer.glade.h:50 +msgid "Print test sheet" +msgstr "Textseite drucken" + +#: ../data/builder/template-designer.glade.h:51 +msgid "Rectangular or square (can have rounded corners)" +msgstr "Rechteckig oder quadratisch (auch mit abgerundeten Ecken)" + +#: ../data/builder/template-designer.glade.h:52 +msgid "Round" +msgstr "Rund" + +#: ../data/builder/template-designer.glade.h:53 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" +"Vorlagen benötigen\n" +"zwei Layouts." + +#: ../data/builder/template-designer.glade.h:55 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" +"Vorlagen benötigen nur\n" +"ein Layout." + +#: ../data/builder/template-designer.glade.h:57 +msgid "Vertical pitch (dy):" +msgstr "Vertikaler Abstand (dy):" + +#: ../data/builder/template-designer.glade.h:58 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" +"Willkommen zum gLabels Vorlagen-Designer.\n" +"\n" +"Dieser Dialog wird Sie beim Erstellen einer benutzerdefinierten\n" +"gLabels-Vorlage unterstützen." + +#: ../data/builder/template-designer.glade.h:62 +msgid "cd_size_page" +msgstr "cd_size_page" + +#: ../data/builder/template-designer.glade.h:63 +msgid "finish_page" +msgstr "finish_page" + +#: ../data/builder/template-designer.glade.h:65 +msgid "layout_page" +msgstr "layout_page" + +#: ../data/builder/template-designer.glade.h:66 +msgid "name_page" +msgstr "name_page" + +#: ../data/builder/template-designer.glade.h:67 +msgid "nlayouts_page" +msgstr "nlayouts_page" + +#: ../data/builder/template-designer.glade.h:68 +msgid "pg_size_page" +msgstr "pg_size_page" + +#: ../data/builder/template-designer.glade.h:69 +msgid "rect_size_page" +msgstr "rect_size_page" + +#: ../data/builder/template-designer.glade.h:70 +msgid "round_size_page" +msgstr "round_size_page" + +#: ../data/builder/template-designer.glade.h:71 +msgid "shape_page" +msgstr "shape_page" + +#: ../data/builder/template-designer.glade.h:72 +msgid "start_page" +msgstr "start_page" + +#: ../data/builder/wdgt-media-select.glade.h:1 +msgid "Brand:" +msgstr "Marke:" + +#: ../data/builder/wdgt-media-select.glade.h:2 +msgid "Category:" +msgstr "Kategorie:" + +#: ../data/builder/wdgt-media-select.glade.h:4 +msgid "Recent templates" +msgstr "Zuletzt benutzte Vorlagen" + +#: ../data/builder/wdgt-media-select.glade.h:5 +msgid "Search all templates" +msgstr "Alle Vorlagen durchsuchen" + +#. Other ISO A series sizes +#: ../data/templates/paper-sizes.xml.h:2 +msgid "A0" +msgstr "A0" + +#: ../data/templates/paper-sizes.xml.h:3 +msgid "A1" +msgstr "A1" + +#: ../data/templates/paper-sizes.xml.h:4 +msgid "A10" +msgstr "A10" + +#: ../data/templates/paper-sizes.xml.h:5 +msgid "A2" +msgstr "A2" + +#: ../data/templates/paper-sizes.xml.h:6 +msgid "A3" +msgstr "A3" + +#: ../data/templates/paper-sizes.xml.h:7 +msgid "A4" +msgstr "A4" + +#: ../data/templates/paper-sizes.xml.h:8 +msgid "A5" +msgstr "A5" + +#: ../data/templates/paper-sizes.xml.h:9 +msgid "A6" +msgstr "A6" + +#: ../data/templates/paper-sizes.xml.h:10 +msgid "A7" +msgstr "A7" + +#: ../data/templates/paper-sizes.xml.h:11 +msgid "A8" +msgstr "A8" + +#: ../data/templates/paper-sizes.xml.h:12 +msgid "A9" +msgstr "A9" + +#. ISO B series sizes +#: ../data/templates/paper-sizes.xml.h:14 +msgid "B0" +msgstr "B0" + +#: ../data/templates/paper-sizes.xml.h:15 +msgid "B1" +msgstr "B1" + +#: ../data/templates/paper-sizes.xml.h:16 +msgid "B10" +msgstr "B10" + +#: ../data/templates/paper-sizes.xml.h:17 +msgid "B2" +msgstr "B2" + +#: ../data/templates/paper-sizes.xml.h:18 +msgid "B3" +msgstr "B3" + +#: ../data/templates/paper-sizes.xml.h:19 +msgid "B4" +msgstr "B4" + +#: ../data/templates/paper-sizes.xml.h:20 +msgid "B5" +msgstr "B5" + +#: ../data/templates/paper-sizes.xml.h:21 +msgid "B6" +msgstr "B6" + +#: ../data/templates/paper-sizes.xml.h:22 +msgid "B7" +msgstr "B7" + +#: ../data/templates/paper-sizes.xml.h:23 +msgid "B8" +msgstr "B8" + +#: ../data/templates/paper-sizes.xml.h:24 +msgid "B9" +msgstr "B9" + +#: ../data/templates/paper-sizes.xml.h:25 +msgid "US Executive" +msgstr "US Executive" + +#. Other US paper sizes +#: ../data/templates/paper-sizes.xml.h:27 +msgid "US Legal" +msgstr "US Legal" + +#: ../data/templates/categories.xml.h:1 +msgid "Any card" +msgstr "Beliebige Karte" + +#: ../data/templates/categories.xml.h:2 +msgid "Any label" +msgstr "All Etiketten" + +#: ../data/templates/categories.xml.h:3 +msgid "Business cards" +msgstr "Visitenkarten" + +#: ../data/templates/categories.xml.h:4 +msgid "CD/DVD or other media" +msgstr "CD/DVD oder andere Medien" + +#: ../data/templates/categories.xml.h:5 +msgid "Mailing/shipping products" +msgstr "Post- und Versandprodukte" + +#: ../data/templates/categories.xml.h:6 +msgid "Rectangular labels" +msgstr "Rechteckige Etiketten" + +#: ../data/templates/categories.xml.h:7 +msgid "Round labels" +msgstr "Runde Etiketten" + +#: ../data/templates/categories.xml.h:8 +msgid "Square labels" +msgstr "Quadratische Etiketten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:2 +#: ../data/templates/avery-iso-templates.xml.h:2 +#: ../data/templates/dymo-other-templates.xml.h:4 +#: ../data/templates/misc-iso-templates.xml.h:2 +#: ../data/templates/zweckform-iso-templates.xml.h:2 +msgid "Address Labels" +msgstr "Adressaufkleber" + +#. =================================================================== +#. ============================================================ +#. =================================================================== +#. ******************************************************************** +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:4 +#: ../data/templates/avery-iso-templates.xml.h:8 +#: ../data/templates/misc-us-templates.xml.h:4 +#: ../data/templates/misc-iso-templates.xml.h:12 +#: ../data/templates/zweckform-iso-templates.xml.h:6 +msgid "Business Cards" +msgstr "Visitenkarten" + +#. =================================================================== +#. =============================================================== +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:6 +#: ../data/templates/avery-iso-templates.xml.h:14 +#: ../data/templates/misc-us-templates.xml.h:8 +#: ../data/templates/misc-iso-templates.xml.h:16 +#: ../data/templates/zweckform-iso-templates.xml.h:8 +msgid "CD/DVD Labels" +msgstr "CD/DVD-Etiketten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:8 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "CD/DVD-Etiketten (Medienaufkleber)" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:10 +msgid "CD/DVD Labels (Spine Labels)" +msgstr "CD/DVD-Etiketten (Spine Labels)" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:12 +#: ../data/templates/avery-iso-templates.xml.h:16 +msgid "Diskette Labels" +msgstr "Diskettenaufkleber" + +#. the LSK labels can be torn in half down the center +#: ../data/templates/avery-us-templates.xml.h:14 +msgid "Divider Labels" +msgstr "Etiketten für Trennblätter" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:16 +msgid "Filing Labels" +msgstr "Ordneretiketten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:18 +msgid "Full Sheet Labels" +msgstr "Ganzseitige Etiketten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:20 +msgid "ID Labels" +msgstr "Etiketten für Archivierungsordner" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:22 +msgid "Index Cards" +msgstr "Indexkarten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:24 +msgid "Large Round Labels" +msgstr "Große runde Etiketten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:26 +msgid "Name Badge Labels" +msgstr "Namensschid-Etiketten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:28 +msgid "Post cards" +msgstr "Postkarten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:30 +#: ../data/templates/dymo-other-templates.xml.h:12 +msgid "Return Address Labels" +msgstr "Rückantwort-Adressaufkleber" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:32 +msgid "Round Labels" +msgstr "Runde Etiketten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:34 +msgid "Shipping Labels" +msgstr "Versandetiketten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:36 +msgid "Small Round Labels" +msgstr "Kleine runde Etiketten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:38 +msgid "Square Labels" +msgstr "Quadratische Etiketten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:40 +msgid "Tent Cards" +msgstr "Klappkarten" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:42 +msgid "Video Tape Face Labels" +msgstr "Etiketten für Videokassetten (Vorderseite)" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:44 +msgid "Video Tape Spine Labels" +msgstr "Etiketten für Videokassetten (Rückseite)" + +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:4 +msgid "Address labels" +msgstr "Adressaufkleber" + +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:6 +msgid "Allround labels" +msgstr "Universal-Etiketten" + +#. =============================================================== +#: ../data/templates/avery-iso-templates.xml.h:10 +msgid "CD Booklet" +msgstr "CD-Einlegeheft" + +#. =============================================================== +#: ../data/templates/avery-iso-templates.xml.h:12 +msgid "CD Inlet" +msgstr "CD-Einleger" + +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:18 +msgid "Diskette labels" +msgstr "Diskettenaufkleber" + +#. =============================================================== +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:20 +#: ../data/templates/misc-us-templates.xml.h:18 +#: ../data/templates/misc-iso-templates.xml.h:36 +#: ../data/templates/zweckform-iso-templates.xml.h:16 +msgid "Mailing Labels" +msgstr "Adressaufkleber" + +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:22 +msgid "Mailing labels" +msgstr "Adressaufkleber" + +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:24 +msgid "Mini Address Labels" +msgstr "Mini-Adressaufkleber" + +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:26 +msgid "Shipping labels" +msgstr "Versandaufkleber" + +#. =================================================================== +#: ../data/templates/avery-other-templates.xml.h:2 +msgid "File Folder Labels" +msgstr "Aktenordner-Etiketten" + +#: ../data/templates/brother-other-templates.xml.h:1 +msgid "Multi Purpose Labels 17mm x 54mm" +msgstr "Mehrzwecketiketten 17mm x 54mm" + +#: ../data/templates/brother-other-templates.xml.h:2 +msgid "Shipping Labels 62mm x 100mm" +msgstr "Versandetiketten 62mm x 100mm" + +#. +#. ********************************************************************* +#. ********************************************************************* +#. Labels for the Brother QL-500/550/650 PC Label Printers +#. +#. These templates work with the Brother Linux Printer CUPS Driver. It +#. is unknown if these work correctly with the foomatic print driver for +#. these printers. +#. +#. One difference from typical templates is that the template size is +#. not the actual media size - it is the size of the printable area, +#. which is smaller than the media size. This is because (at least with +#. the Brother driver) coordinates are relative the corner of this area. +#. +#. ********************************************************************* +#. ********************************************************************* +#. +#: ../data/templates/brother-other-templates.xml.h:20 +msgid "Standard Address Labels 29mm x 90mm" +msgstr "Standard-Adressaufkleber 29mm x 90mm" + +#. =================================================================== +#: ../data/templates/dymo-other-templates.xml.h:2 +msgid "3.5in Diskette" +msgstr "3.5-Zoll- Diskette" + +#. =================================================================== +#: ../data/templates/dymo-other-templates.xml.h:6 +msgid "File Folder" +msgstr "Aktenordner" + +#. =================================================================== +#: ../data/templates/dymo-other-templates.xml.h:8 +msgid "Hanging Folder" +msgstr "Hängemappe" + +#. =================================================================== +#: ../data/templates/dymo-other-templates.xml.h:10 +msgid "Large Address Labels" +msgstr "Große Adressaufkleber" + +#. =================================================================== +#: ../data/templates/dymo-other-templates.xml.h:14 +msgid "Shipping Address Labels" +msgstr "Versand-Adressaufkleber" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:2 +msgid "Business Card CD" +msgstr "Visitenkarten-CD" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:6 +msgid "CD Template Rectangles" +msgstr "CD-Vorlagen (rechteckig)" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:10 +msgid "CD/DVD Labels (Face Only)" +msgstr "CD/DVD-Etiketten (nur Vorderseite)" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:12 +#: ../data/templates/misc-iso-templates.xml.h:18 +msgid "CD/DVD Labels (face only)" +msgstr "CD/DVD-Etiketten (nur Vorderseite)" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:14 +msgid "Cassette Labels" +msgstr "Kassettenaufkleber" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:16 +msgid "DLT Labels" +msgstr "DLT-Etiketten" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:20 +msgid "Microtube labels" +msgstr "Microtube-Etiketten" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:22 +msgid "Mini-CD Labels" +msgstr "Mini-CD-Etiketten" + +#: ../data/templates/misc-us-templates.xml.h:23 +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "PRO-CD-Etiketten 2-up (nur CD-Spine)" + +#: ../data/templates/misc-us-templates.xml.h:24 +msgid "PRO CD Labels 2-up (Face only)" +msgstr "PRO-CD-Etiketten 2-up (nur Vorderseite)" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:26 +#: ../data/templates/misc-iso-templates.xml.h:42 +msgid "PRO CD Labels 2-up (face only)" +msgstr "PRO-CD-Etiketten 2-up (nur Vorderseite)" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:28 +msgid "Slimline CD Case (rightside up)" +msgstr "Slimline CD Case (normal)" + +#: ../data/templates/misc-us-templates.xml.h:29 +msgid "Slimline CD Case (upside down)" +msgstr "Slimline CD Case (umgekehrt)" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:4 +#: ../data/templates/zweckform-iso-templates.xml.h:4 +msgid "Allround Labels" +msgstr "Universal-Etiketten" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:6 +msgid "Arch File Labels" +msgstr "Etiketten für Archivierungsordner" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:8 +msgid "Arch File Labels (large)" +msgstr "Etiketten für Archivierungsordner (groß)" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:10 +msgid "Arch File Labels (small)" +msgstr "Etiketten für Archivierungsordner (klein)" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:14 +msgid "CD Labels" +msgstr "CD-Aufkleber" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:20 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "CD/DVD-Etiketten im Standardformat (nur Vorderseite)" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:22 +msgid "Diskette Labels (face only)" +msgstr "Diskettenaufkleber (nur Vorderseite)" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:24 +msgid "EPSON Photo Stickers 16" +msgstr "EPSON Photo Stickers 16" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:26 +msgid "Etiketten" +msgstr "Etiketten" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:28 +msgid "Fridge Magnet Stickers" +msgstr "Aufkleber für Kühlschrankmagnete" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:30 +msgid "General Labels" +msgstr "Allgemeine Etiketten" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:32 +msgid "Inkjet/Laser Labels 70x37mm" +msgstr "Inkjet/Laseretiketten 70x37mm" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:38 +msgid "Mailing Labels-2 columns" +msgstr "Adressaufkleber 2-spaltig" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:40 +msgid "Mailing Labels-3 columns" +msgstr "Adressaufkleber 3-spaltig" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:44 +#: ../data/templates/zweckform-iso-templates.xml.h:24 +msgid "Rectangular Labels" +msgstr "Rechteckige Etiketten" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:46 +msgid "Video Labels (face only)" +msgstr "Video-Etiketten (nur Vorderseite)" + +#. =================================================================== +#: ../data/templates/misc-other-templates.xml.h:2 +msgid "Multi-Purpose Labels" +msgstr "Mehrzweck-Etiketten" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:10 +msgid "Correction and Cover-up Labels" +msgstr "Korrektur- und Abdeckaufkleber" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:12 +msgid "File Back Labels" +msgstr "Ordnerrücken" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:14 +msgid "Lever Arch File Labels" +msgstr "Lever Etiketten für Archivierungsordner" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:18 +msgid "Multi-purpose Stick+Lift Labels" +msgstr "Mehrzweck-Stick+Lift-Aufkleber" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:20 +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "QSL-Karten Etiketten 70mm x 50,8mm" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:22 +msgid "Rectangular Copier Labels" +msgstr "Rechteckige Kopieretiketten" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:26 +msgid "Video Labels (back)" +msgstr "Video-Etiketten (Rückseite)" + +#: ../data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers" +msgstr "Erstellen von Etiketten, Visitenkarten und Medien-Covern" + +#: ../data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "gLabels Etiketten-Designer" + +#: ../data/mime/glabels.keys.in.h:1 ../data/mime/glabels.xml.in.h:1 +msgid "gLabels Project File" +msgstr "gLabels-Projektdatei" + +#: ../barcode-0.98/compat/getopt.c:583 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: Option `%s' ist nicht eindeutig\n" + +#: ../barcode-0.98/compat/getopt.c:607 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: Option `--%s' erlaubt kein Argument\n" + +#: ../barcode-0.98/compat/getopt.c:612 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: Option `%c%s' erlaubt kein Argument\n" + +#: ../barcode-0.98/compat/getopt.c:629 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: Option `%s' benötigt ein Argument\n" + +#. --option +#: ../barcode-0.98/compat/getopt.c:658 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: Nicht erkannte Option `--%s'\n" + +#. +option or -option +#: ../barcode-0.98/compat/getopt.c:662 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: Nicht erkannte Option `%c%s'\n" + +#. 1003.2 specifies the format of this message. +#: ../barcode-0.98/compat/getopt.c:688 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: Unerlaubte Option -- %c\n" + +#: ../barcode-0.98/compat/getopt.c:691 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: Ungültige Option -- %c\n" + +#: ../barcode-0.98/compat/getopt.c:727 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: Option benötigt ein Argument -- %c\n" diff --git a/po/eo.po b/po/eo.po new file mode 100644 index 00000000..cda51cea --- /dev/null +++ b/po/eo.po @@ -0,0 +1,2438 @@ +# translation of eo.po to +# Italian translation of glabels. +# Copyright (C) 2003 THE glabels'S COPYRIGHT HOLDER +# This file is distributed under the same license as the glabels package. +# +# Esperanto special letters: ĉŝĝĥĵŭ -- 2244 +# Antonio C. Codazzi "la Filozofo" , 2007. +# +# +msgid "" +msgstr "" +"Project-Id-Version: eo\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-06-19 20:43-0400\n" +"PO-Revision-Date: 2007-06-06 16:48+0200\n" +"Last-Translator: Antonio C. Codazzi \n" +"Language-Team: Esperanto \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.0.2\n" + +#: src/glabels.c:116 +msgid "Could not initialize Bonobo!\n" +msgstr "Estas neeble prepari Bonobon!\n" + +#: src/glabels-batch.c:52 +msgid "print this message" +msgstr "presu tiun ĉi mesaĝon" + +#: src/glabels-batch.c:54 +msgid "print the version of glabels-batch being used" +msgstr "presu version de uzata staplo de glabels" + +#: src/glabels-batch.c:56 +msgid "set output filename (default=\"output.ps\")" +msgstr "agordu dosiernomon de eligo (defaÅ­lte \"output.ps\")" + +#: src/glabels-batch.c:56 src/glabels-batch.c:70 +msgid "filename" +msgstr "dosiernomo" + +#: src/glabels-batch.c:58 +msgid "number of sheets (default=1)" +msgstr "nombro da folioj (defaÅ­lte 1)" + +#: src/glabels-batch.c:58 +msgid "sheets" +msgstr "folioj" + +#: src/glabels-batch.c:60 +msgid "number of copies (default=1)" +msgstr "nombro da ekzempleroj (defaÅ­lte 1)" + +#: src/glabels-batch.c:60 +msgid "copies" +msgstr "ekzempleroj" + +#: src/glabels-batch.c:62 +msgid "first label on first sheet (default=1)" +msgstr "unua etikedo de unua folio (defaÅ­lte 1)" + +#: src/glabels-batch.c:62 +msgid "first" +msgstr "unua" + +#: src/glabels-batch.c:64 src/print-dialog.c:336 +msgid "print outlines (to test printer alignment)" +msgstr "presu konturojn (por testi alliniĝon de la printilo)" + +#: src/glabels-batch.c:66 src/print-dialog.c:344 +msgid "print in reverse (i.e. a mirror image)" +msgstr "presu inverse (ekz. iun spegulitan bildon)" + +#: src/glabels-batch.c:68 src/print-dialog.c:351 +msgid "print crop marks" +msgstr "presu liniojn de tranĉo" + +#: src/glabels-batch.c:70 +msgid "input file for merging" +msgstr "eniga dosiero por kunfandi" + +#: src/glabels-batch.c:107 +msgid "[OPTION...] GLABELS_FILE..." +msgstr "[OPTION...] GLABELS_FILE..." + +#: src/glabels-batch.c:127 +#, c-format +msgid "missing glabels file\n" +msgstr "mankanta dosero de glabels\n" + +#: src/glabels-batch.c:158 +#, c-format +msgid "cannot perform document merge with glabels file %s\n" +msgstr "estas neeble kunfandi dokumentojn kun dosiero de glabels %s\n" + +#: src/glabels-batch.c:182 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "estas neeble malfermi dosieron de glabels %s\n" + +#: src/window.c:244 +msgid "(none) - gLabels" +msgstr "(nenio) - gLabels" + +#: src/window.c:414 +msgid "(modified)" +msgstr "(modifita)" + +#: src/stock.c:65 data/ui/glabels-ui.xml.h:162 +msgid "_Select Mode" +msgstr "Modu_so de Elektado" + +#: src/stock.c:66 data/ui/glabels-ui.xml.h:163 +msgid "_Text" +msgstr "_Teksto" + +#: src/stock.c:67 data/ui/glabels-ui.xml.h:148 +msgid "_Line" +msgstr "_Linio" + +#: src/stock.c:68 data/ui/glabels-ui.xml.h:130 +msgid "_Box" +msgstr "_Fako" + +#: src/stock.c:69 data/ui/glabels-ui.xml.h:141 +msgid "_Ellipse" +msgstr "_Elipso" + +#: src/stock.c:70 data/ui/glabels-ui.xml.h:146 +msgid "_Image" +msgstr "_Bildo" + +#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 +msgid "Bar_code" +msgstr "Strek_kodo" + +#: src/stock.c:72 +msgid "_Merge Properties" +msgstr "Ecoj de Ku_nfando" + +#: src/stock.c:73 +msgid "Object _Properties" +msgstr "Ecoj de _Objekto" + +#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 +msgid "Bring to _Front" +msgstr "Portu _Fronten" + +#: src/stock.c:75 data/ui/glabels-ui.xml.h:109 +msgid "Send to _Back" +msgstr "_Sendu MalantaÅ­en" + +#: src/stock.c:76 data/ui/glabels-ui.xml.h:96 +msgid "Rotate _Left" +msgstr "Turnu _Maldekstren" + +#: src/stock.c:77 data/ui/glabels-ui.xml.h:97 +msgid "Rotate _Right" +msgstr "Turnu _Dekstren" + +#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 +msgid "Flip _Horizontally" +msgstr "Renversu _Horizontale" + +#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 +msgid "Flip _Vertically" +msgstr "Renversu _Vertikale" + +#: src/stock.c:80 data/ui/glabels-ui.xml.h:147 +msgid "_Lefts" +msgstr "_Maldekstre" + +#: src/stock.c:81 data/ui/glabels-ui.xml.h:159 +msgid "_Rights" +msgstr "_Dekstre" + +#: src/stock.c:82 data/ui/glabels-ui.xml.h:131 +msgid "_Centers" +msgstr "_Centre" + +#: src/stock.c:83 data/ui/glabels-ui.xml.h:164 +msgid "_Tops" +msgstr "_Supre" + +#: src/stock.c:84 +msgid "Bottoms" +msgstr "Sube" + +#: src/stock.c:85 +msgid "Centers" +msgstr "Centre" + +#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 +msgid "Label Ce_nter" +msgstr "Ce_ntrita Etikedo" + +#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 +msgid "Fill color" +msgstr "Koloro de plenigo" + +#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 +msgid "Line color" +msgstr "Koloro de linio" + +#: src/stock.c:90 src/stock.c:92 +msgid "Linked" +msgstr "Kunligita" + +#: src/stock.c:91 src/stock.c:93 +msgid "Not Linked" +msgstr "Neniu Kunligo" + +#: src/ui-property-bar.c:345 src/object-editor.c:499 +msgid "Default" +msgstr "DefaÅ­lto" + +#: src/ui-property-bar.c:360 src/object-editor.c:512 +msgid "No fill" +msgstr "Neniu Plenigo" + +#: src/ui-property-bar.c:375 src/object-editor.c:505 +msgid "No line" +msgstr "Neniu Linio" + +#: src/ui-sidebar.c:180 +msgid "Object properties" +msgstr "Ecoj de objekto" + +#: src/commands.c:385 +msgid "" +"A label and business card creation program for GNOME.\n" +" \n" +"Glabels is free software; you can redistribute it and/or modify it under the " +"terms of the GNU General Public License as published by the Free Software " +"Foundation; either version 2 of the License, or (at your option) any later " +"version.\n" +" \n" +"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.\n" +msgstr "" + +#: src/commands.c:399 +msgid "See the file AUTHORS for additional credits," +msgstr "Vidigu la dosieron nomitan AUTHORS por pluaj informoj," + +#: src/commands.c:400 +msgid "or visit http://glabels.sourceforge.net/" +msgstr "aÅ­ vizitu http://glabels.sourceforge.net/" + +#: src/commands.c:409 +msgid " " +msgstr " " + +#: src/commands.c:424 +msgid "glabels" +msgstr "glabels" + +#: src/file.c:100 +msgid "New Label or Card" +msgstr "Nova Etikedo aÅ­ Karto" + +#: src/file.c:132 src/file.c:304 +msgid "Media Type" +msgstr "Speco de plurmedio" + +#: src/file.c:138 src/file.c:310 +msgid "Label orientation" +msgstr "Orientado de etikedo" + +#: src/file.c:269 +msgid "Label properties" +msgstr "Ecoj de etikedo" + +#: src/file.c:452 src/file.c:870 +msgid "All files" +msgstr "Ĉiuj dosieroj" + +#: src/file.c:457 src/file.c:875 +msgid "gLabels documents" +msgstr "Dokumentoj de gLabels" + +#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 +msgid "Empty file name selection" +msgstr "Elektado de nomon de vakua dosiero" + +#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 +msgid "Please select a file or supply a valid file name" +msgstr "Bonvolu indiki dosieron aÅ­ validan dosiernomon" + +#: src/file.c:519 src/file.c:631 +msgid "File does not exist" +msgstr "la dosiero ne ekzistas" + +#: src/file.c:563 data/ui/glabels-ui.xml.h:74 +msgid "Open" +msgstr "Malfermu" + +#: src/file.c:565 +msgid "Open label" +msgstr "Malfermu etikedon" + +#: src/file.c:707 +#, c-format +msgid "Could not open file \"%s\"" +msgstr "Estas neeble malfermi dosieron \"%s\"" + +#: src/file.c:715 +msgid "Not a supported file format" +msgstr "La formato de dosiero ne estas subtenita" + +#: src/file.c:797 src/file.c:979 src/file.c:1174 +#, c-format +msgid "Could not save file \"%s\"" +msgstr "estas neeble konservi dosieron \"%s\"" + +#: src/file.c:805 src/file.c:987 src/file.c:1182 +msgid "Error encountered during save. The file is still not saved." +msgstr "Eraro dum konservado. la dosiero ankoraÅ­ ne estas konservita." + +#: src/file.c:848 src/file.c:1048 +#, c-format +msgid "Save \"%s\" as" +msgstr "Konservu \"%s\" kiel" + +#: src/file.c:935 src/file.c:1131 +msgid "Please supply a valid file name" +msgstr "Bonvolu indiki validan dosiernomon" + +#: src/file.c:952 src/file.c:1147 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "Ĉu mi devas anstataÅ­igi dosieron \"%s\"?" + +#: src/file.c:960 src/file.c:1155 +msgid "File already exists." +msgstr "La dosiero jam ekzistas." + +#: src/file.c:1271 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "Ĉu mi devas konservi la modifojn de la dokumento \"%s\" antaÅ­ ol fermi?" + +#: src/file.c:1279 +msgid "Your changes will be lost if you don't save them." +msgstr "La modifoj estos perditaj se oni ne konservas ilin." + +#: src/file.c:1282 +msgid "Close without saving" +msgstr "fermu sen konservi" + +#. Should not happen +#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 +#: data/glade/object-editor.glade.h:37 +msgid "points" +msgstr "punktoj" + +#: src/prefs.c:158 data/glade/object-editor.glade.h:36 +#: data/glade/template-designer.glade.h:74 +msgid "inches" +msgstr "coloj" + +#: src/prefs.c:160 +msgid "mm" +msgstr "mm" + +#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 +msgid "gLabels Preferences" +msgstr "Agordoj de gLabels" + +#. +#. * Submenu: Order +#. +#: src/view.c:3574 data/ui/glabels-ui.xml.h:154 +msgid "_Order" +msgstr "_Ordo" + +#. +#. * Submenu: Rotate/Flip +#. +#: src/view.c:3595 data/ui/glabels-ui.xml.h:160 +msgid "_Rotate/Flip" +msgstr "_Rotacio/Renverso" + +#. +#. * Submenu: Align Horizontally +#. +#: src/view.c:3628 +msgid "Align _Horizontally" +msgstr "LaÅ­linnigu _Horizontale" + +#. +#. * Submenu: Align Vertically +#. +#: src/view.c:3667 +msgid "Align _Vertically" +msgstr "LaÅ­linnigu _Verticale" + +#: src/view.c:3728 data/ui/glabels-ui.xml.h:137 +msgid "_Delete" +msgstr "_Forigu" + +#. Build editor. +#: src/view-box.c:224 +msgid "Box object properties" +msgstr "Ecoj de Fako" + +#. Build editor. +#: src/view-ellipse.c:224 +msgid "Ellipse object properties" +msgstr "Ecoj de Elipso" + +#. Build editor. +#: src/view-line.c:224 +msgid "Line object properties" +msgstr "Ecoj de Linio" + +#. Build editor. +#: src/view-image.c:223 +msgid "Image object properties" +msgstr "Ecoj de Bildo" + +#. Build editor. +#: src/view-text.c:251 +msgid "Text object properties" +msgstr "Ecoj de Teksto" + +#: src/view-text.c:563 data/glade/object-editor.glade.h:28 +msgid "Text" +msgstr "Teksto" + +#. Build editor. +#: src/view-barcode.c:210 +msgid "Barcode object properties" +msgstr "Ecoj de Strekkodo" + +#: src/view-barcode.c:580 src/print.c:1089 +msgid "Invalid barcode data" +msgstr "Nevalida strekkodo" + +#: src/merge-properties-dialog.c:231 +msgid "Merge Properties" +msgstr "Ecoj de Kunfando" + +#. ---- Source section ---- +#: src/merge-properties-dialog.c:237 +msgid "Source" +msgstr "Fonto" + +#: src/merge-properties-dialog.c:245 +msgid "Format:" +msgstr "Formato:" + +#. Location line +#: src/merge-properties-dialog.c:273 +msgid "Location:" +msgstr "Lokiĝo:" + +#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 +msgid "Select merge-database source" +msgstr "Elektu fonton de kunfand-datumbazo" + +#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 +msgid "N/A" +msgstr "N/A" + +#. ---- Sample Fields section ---- +#: src/merge-properties-dialog.c:300 +msgid "Record selection/preview:" +msgstr "Elektado/AntaÅ­montro de rikordo:" + +#: src/merge-properties-dialog.c:326 +msgid "Select" +msgstr "Elektu" + +#: src/merge-properties-dialog.c:334 +msgid "Record/Field" +msgstr "Rikordo/Kampo" + +#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 +msgid "Data" +msgstr "Datumoj" + +#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:81 +msgid "Print" +msgstr "Presu" + +#: src/print-dialog.c:281 +msgid "_Job" +msgstr "_Laboro" + +#: src/print-dialog.c:286 +msgid "P_rinter" +msgstr "P_rintilo" + +#. ----------- Add simple-copies widget ------------ +#: src/print-dialog.c:314 +msgid "Copies" +msgstr "Ekzempleroj" + +#. ------- Add merge control widget ------------ +#: src/print-dialog.c:322 +msgid "Document merge control" +msgstr "Kontrolo de kunfando de dokumento" + +#. ----------- Add custom print options area ------------ +#: src/print-dialog.c:330 +msgid "Options" +msgstr "Opcioj" + +#: src/print-dialog.c:553 src/print-dialog.c:592 +msgid "Print preview" +msgstr "AntaÅ­montro de presado" + +#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 +msgid "gLabels Template Designer" +msgstr "Desegnilo de modeloj por gLabels" + +#: src/bc.c:60 +msgid "POSTNET (any)" +msgstr "POSTNET (iu ajn)" + +#: src/bc.c:63 +msgid "POSTNET-5 (ZIP only)" +msgstr "POSTNET-5 (nur ZIP/CAP)" + +#: src/bc.c:66 +msgid "POSTNET-9 (ZIP+4)" +msgstr "POSTNET-9 (ZIP/CAP+4)" + +#: src/bc.c:69 +msgid "POSTNET-11 (DPBC)" +msgstr "POSTNET-11 (DPBC)" + +#: src/bc.c:72 +msgid "EAN (any)" +msgstr "EAN (iu ajn)" + +#: src/bc.c:75 +msgid "EAN-8" +msgstr "EAN-8" + +#: src/bc.c:78 +msgid "EAN-8 +2" +msgstr "EAN-8 +2" + +#: src/bc.c:81 +msgid "EAN-8 +5" +msgstr "EAN-8 +5" + +#: src/bc.c:84 +msgid "EAN-13" +msgstr "EAN-13" + +#: src/bc.c:87 +msgid "EAN-13 +2" +msgstr "EAN-13 +2" + +#: src/bc.c:90 +msgid "EAN-13 +5" +msgstr "EAN-13 +5" + +#: src/bc.c:93 +msgid "UPC (UPC-A or UPC-E)" +msgstr "UPC (UPC-A aÅ­ UPC-E)" + +#: src/bc.c:96 +msgid "UPC-A" +msgstr "UPC-A" + +#: src/bc.c:99 +msgid "UPC-A +2" +msgstr "UPC-A +2" + +#: src/bc.c:102 +msgid "UPC-A +5" +msgstr "UPC-A +5" + +#: src/bc.c:105 +msgid "UPC-E" +msgstr "UPC-E" + +#: src/bc.c:108 +msgid "UPC-E +2" +msgstr "UPC-E +2" + +#: src/bc.c:111 +msgid "UPC-E +5" +msgstr "UPC-E +5" + +#: src/bc.c:114 +msgid "ISBN" +msgstr "ISBN" + +#: src/bc.c:117 +msgid "ISBN +5" +msgstr "ISBN +5" + +#: src/bc.c:120 +msgid "Code 39" +msgstr "Kodo 39" + +#: src/bc.c:123 +msgid "Code 128" +msgstr "Kodo 128" + +#: src/bc.c:126 +msgid "Code 128C" +msgstr "Kodo 128C" + +#: src/bc.c:129 +msgid "Code 128B" +msgstr "Kodo 128B" + +#: src/bc.c:132 +msgid "Interleaved 2 of 5" +msgstr "Interleaved 2 of 5" + +#: src/bc.c:135 +msgid "Codabar" +msgstr "Codabar" + +#: src/bc.c:138 +msgid "MSI" +msgstr "MSI" + +#: src/bc.c:141 +msgid "Plessey" +msgstr "Plessey" + +#: src/label.c:569 +msgid "Untitled" +msgstr "Sen nomo" + +#: src/xml-label.c:176 src/xml-label.c:213 +msgid "xmlParseFile error" +msgstr "Eraro de xml-dosiero de sintaksa analizo" + +#: src/xml-label.c:250 +msgid "No document root" +msgstr "Neniu radika dokumento" + +#: src/xml-label.c:264 +msgid "Importing from glabels 0.1 format" +msgstr "Importante el formato de glabels 0.1" + +#: src/xml-label.c:272 +msgid "Importing from glabels 0.4 format" +msgstr "Importante el formato de glabels 0.4" + +#: src/xml-label.c:279 +msgid "Importing from glabels 1.91 format" +msgstr "Importante el formato de glabels 1.91" + +#: src/xml-label.c:282 +msgid "bad document, unknown glabels Namespace" +msgstr "Nekorekta dokumento, nekonata Nomospaco de glabels" + +#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "Nekorekta radika nodo = \"%s\"" + +#: src/xml-label.c:348 src/xml-label-191.c:165 +#, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "nekorekta nodo en nodo de Dokumeto = \"%s\"" + +#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 +#, c-format +msgid "bad node = \"%s\"" +msgstr "nekorekta nodo = \"%s\"" + +#: src/xml-label.c:796 src/xml-label-191.c:605 +#, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "nekorekta nodo en nodo de Datumoj = \"%s\"" + +#: src/xml-label.c:962 libglabels/xml-template.c:535 +msgid "Utf8 conversion error." +msgstr "eraro de konvertado en Utf8." + +#: src/xml-label.c:969 libglabels/xml-template.c:542 +msgid "Problem saving xml file." +msgstr "Problemo laÅ­ konservo de xml-dosiero" + +#. This should always be an id, but just in case a name +#. slips by! +#: src/xml-label-191.c:680 libglabels/xml-template.c:199 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "Nekonata id \"%s\" de grando de paĝo, provante kiel nomo" + +#: src/xml-label-191.c:690 libglabels/xml-template.c:209 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "Nekonata id de (paĝo)grando aÅ­ de nomo \"%s\"" + +#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 +msgid "None" +msgstr "Nenio" + +#: src/merge-init.c:53 +msgid "Text file with comma delimeters (CSV)" +msgstr "Teksta dosiero kun komo kiel disigilo (CSV)" + +#: src/merge-init.c:60 +msgid "Text file with colon delimeters" +msgstr "Teksta dosiero kun komo kiel disigilo" + +#: src/merge-init.c:67 +msgid "Text file with tab delimeters" +msgstr "Teksta dosiero kun TAB kiel disigilo" + +#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 +msgid "File:" +msgstr "Dosiero:" + +#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 +msgid "Key:" +msgstr "Ŝlosilo:" + +#: src/wdgt-print-copies.c:179 +msgid "Sheets:" +msgstr "Folioj:" + +#: src/wdgt-print-copies.c:197 +msgid "Labels" +msgstr "Etikedoj" + +#: src/wdgt-print-copies.c:200 +msgid "from:" +msgstr "de:" + +#: src/wdgt-print-copies.c:207 +msgid "to:" +msgstr "ĝis:" + +#: src/wdgt-print-merge.c:178 +msgid "Start on label" +msgstr "Starto en etikedo" + +#: src/wdgt-print-merge.c:186 +msgid "on 1st sheet" +msgstr "en 1a folio" + +#: src/wdgt-print-merge.c:195 +msgid "Copies:" +msgstr "Ekzempleroj:" + +#: src/wdgt-print-merge.c:201 +msgid "Collate" +msgstr "LaÅ­kajere" + +#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 +msgid "Description:" +msgstr "Priskribo:" + +#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 +msgid "Page size:" +msgstr "Grando de paĝo:" + +#: src/wdgt-media-select.c:290 +msgid "Label size:" +msgstr "Grando de etikedo:" + +#: src/wdgt-media-select.c:301 +msgid "Layout:" +msgstr "Aspekto:" + +#: src/wdgt-media-select.c:578 +#, c-format +msgid "%d x %d (%d per sheet)" +msgstr "%d x %d (%d por folio)" + +#: src/wdgt-media-select.c:582 +#, c-format +msgid "%d per sheet" +msgstr "%d por folio" + +#: src/wdgt-media-select.c:614 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +#: src/wdgt-media-select.c:619 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 +#, c-format +msgid "%s %s diameter" +msgstr "%s %s diametro" + +#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 +#, c-format +msgid "%.5g %s diameter" +msgstr "%.5g %s diametro" + +#: src/wdgt-rotate-label.c:193 +msgid "Rotate" +msgstr "Rotacio" + +#. This is the default custom color +#: src/mygal/color-palette.c:396 +msgid "custom" +msgstr "personigita" + +#. "Custom" color - we'll pop up a GnomeColorPicker +#: src/mygal/color-palette.c:438 +msgid "Custom Color:" +msgstr "Personigita Koloro:" + +#: src/mygal/color-palette.c:446 +msgid "Choose Custom Color" +msgstr "Elektu personigitan koloron" + +#: src/mygal/color-palette.c:579 +msgid "black" +msgstr "nigro" + +#: src/mygal/color-palette.c:580 +msgid "light brown" +msgstr "hela bruna koloro" + +#: src/mygal/color-palette.c:581 +msgid "brown gold" +msgstr "malhela oro" + +#: src/mygal/color-palette.c:582 +msgid "dark green #2" +msgstr "malhela verdo #2" + +#: src/mygal/color-palette.c:583 +msgid "navy" +msgstr "mararmea bluo" + +#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 +msgid "dark blue" +msgstr "malhela bluo" + +#: src/mygal/color-palette.c:585 +msgid "purple #2" +msgstr "viola koloro #2" + +#: src/mygal/color-palette.c:586 +msgid "very dark gray" +msgstr "tre malhela grizo" + +#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 +msgid "dark red" +msgstr "malhela ruĝo" + +#: src/mygal/color-palette.c:590 +msgid "red-orange" +msgstr "ruĝ-oranĝo" + +#: src/mygal/color-palette.c:591 +msgid "gold" +msgstr "oro" + +#: src/mygal/color-palette.c:592 +msgid "dark green" +msgstr "malhela verdo" + +#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 +msgid "dull blue" +msgstr "nebrila bluo" + +#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 +msgid "blue" +msgstr "bluo" + +#: src/mygal/color-palette.c:595 +msgid "dull purple" +msgstr "nebrila violo" + +#: src/mygal/color-palette.c:596 +msgid "dark grey" +msgstr "malhela grizo" + +#: src/mygal/color-palette.c:599 +msgid "red" +msgstr "ruĝo" + +#: src/mygal/color-palette.c:600 +msgid "orange" +msgstr "oranĝa koloro" + +#: src/mygal/color-palette.c:601 +msgid "lime" +msgstr "limeta koloro" + +#: src/mygal/color-palette.c:602 +msgid "dull green" +msgstr "nebrila verdo" + +#: src/mygal/color-palette.c:603 +msgid "dull blue #2" +msgstr "nebrila bluo #2" + +#: src/mygal/color-palette.c:604 +msgid "sky blue #2" +msgstr "ĉielbluo #2" + +#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 +msgid "purple" +msgstr "violo" + +#: src/mygal/color-palette.c:606 +msgid "gray" +msgstr "grizo" + +#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 +msgid "magenta" +msgstr "intense karmezina" + +#: src/mygal/color-palette.c:610 +msgid "bright orange" +msgstr "brila oranĝo" + +#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 +msgid "yellow" +msgstr "flavo" + +#: src/mygal/color-palette.c:612 +msgid "green" +msgstr "verdo" + +#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 +msgid "cyan" +msgstr "cejano" + +#: src/mygal/color-palette.c:614 +msgid "bright blue" +msgstr "brila bluo" + +#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 +msgid "red purple" +msgstr "ruĝ-violo" + +#: src/mygal/color-palette.c:616 +msgid "light grey" +msgstr "hela grizo" + +#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 +msgid "pink" +msgstr "rozkoloro" + +#: src/mygal/color-palette.c:620 +msgid "light orange" +msgstr "hela oranĝo" + +#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 +msgid "light yellow" +msgstr "hela flavo" + +#: src/mygal/color-palette.c:622 +msgid "light green" +msgstr "hela verdo" + +#: src/mygal/color-palette.c:623 +msgid "light cyan" +msgstr "hela cejano" + +#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 +msgid "light blue" +msgstr "hela bluo" + +#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 +msgid "light purple" +msgstr "hela violo" + +#: src/mygal/color-palette.c:626 +msgid "white" +msgstr "blanko" + +#: src/mygal/color-palette.c:631 +msgid "purplish blue" +msgstr "viol-bluo" + +#: src/mygal/color-palette.c:635 +msgid "dark purple" +msgstr "malhela violo" + +#: src/mygal/color-palette.c:637 +msgid "sky blue" +msgstr "ĉielbluo" + +#: libglabels/template.c:848 +#, c-format +msgid "Generic %s full page" +msgstr "Ĝenerala %s plena paĝo" + +#: libglabels/template.c:897 +msgid "No template files found!" +msgstr "Neniu modelo estis trovita!" + +#. Create and append an "Other" entry. +#: libglabels/paper.c:67 +msgid "Other" +msgstr "Aliaĵoj" + +#: libglabels/paper.c:361 +msgid "No paper files found!" +msgstr "Neniu papera dosiero estis trovita!!" + +#: data/ui/glabels-ui.xml.h:1 +msgid "About glabels" +msgstr "Pri glabels" + +#: data/ui/glabels-ui.xml.h:2 +msgid "About..." +msgstr "Pri..." + +#: data/ui/glabels-ui.xml.h:3 +msgid "Align _Horizontal" +msgstr "LaÅ­linnigu _Horizontale" + +#: data/ui/glabels-ui.xml.h:4 +msgid "Align _Vertical" +msgstr "LaÅ­linnigu _Verticale" + +#: data/ui/glabels-ui.xml.h:5 +msgid "Align objects to bottoms" +msgstr "LaÅ­linnigu objektojn sube" + +#: data/ui/glabels-ui.xml.h:6 +msgid "Align objects to horizontal centers" +msgstr "LaÅ­linnigu objektojn laÅ­ horizontala centro" + +#: data/ui/glabels-ui.xml.h:7 +msgid "Align objects to left edges" +msgstr "LaÅ­linnigu objektojn laÅ­ maldekstra rando" + +#: data/ui/glabels-ui.xml.h:8 +msgid "Align objects to right edges" +msgstr "LaÅ­linnigu objektojn laÅ­ dekstra rando" + +#: data/ui/glabels-ui.xml.h:9 +msgid "Align objects to tops" +msgstr "LaÅ­linnigu objektojn supre" + +#: data/ui/glabels-ui.xml.h:10 +msgid "Align objects to vertical centers" +msgstr "LaÅ­liniigu objektojn laÅ­ verticala centro" + +#: data/ui/glabels-ui.xml.h:12 +msgid "Bold" +msgstr "Dika" + +#: data/ui/glabels-ui.xml.h:14 +msgid "Center align" +msgstr "LaÅ­liniiĝu centre" + +#: data/ui/glabels-ui.xml.h:15 +msgid "Center objects to horizontal label center" +msgstr "Centrigu objektojn laÅ­ horizontala centro de etikedo" + +#: data/ui/glabels-ui.xml.h:16 +msgid "Center objects to vertical label center" +msgstr "Centrigu objektojn laÅ­ vertikala centro de etikedo" + +#: data/ui/glabels-ui.xml.h:17 +msgid "Change the visibility of markup lines in the current window" +msgstr "Ŝangu videblecon de linioj de demarkacio en nuna fenestro" + +#: data/ui/glabels-ui.xml.h:18 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "Ŝangu videblecon de la ilarstango de desegno en nuna fenestro" + +#: data/ui/glabels-ui.xml.h:19 +msgid "Change the visibility of the grid in the current window" +msgstr "Ŝangu videblecon de la krado en nuna fenestro" + +#: data/ui/glabels-ui.xml.h:20 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "Ŝangu videblecon de la ĉefa ilarstango en nuna fenestro" + +#: data/ui/glabels-ui.xml.h:21 +msgid "Change the visibility of the property toolbar in the current window" +msgstr "Ŝangu videblecon de ilarstango de ecoj en nuna fenestro" + +#: data/ui/glabels-ui.xml.h:22 +msgid "Close" +msgstr "Fermu" + +#: data/ui/glabels-ui.xml.h:23 +msgid "Close the current file" +msgstr "Fermu la nunan dosieron" + +#: data/ui/glabels-ui.xml.h:24 +msgid "Configure the application" +msgstr "Agordu la programon" + +#: data/ui/glabels-ui.xml.h:25 +msgid "Contents" +msgstr "Entenoj" + +#: data/ui/glabels-ui.xml.h:26 +msgid "Copy" +msgstr "Kopiu" + +#: data/ui/glabels-ui.xml.h:27 +msgid "Copy the selection" +msgstr "Kopiu la elektaĵon" + +#: data/ui/glabels-ui.xml.h:28 +msgid "Create a custom template" +msgstr "Kreu personigitan modelon" + +#: data/ui/glabels-ui.xml.h:29 +msgid "Create a new document" +msgstr "Kreu novan dokumenton" + +#: data/ui/glabels-ui.xml.h:30 +msgid "Create barcode object" +msgstr "Keu strekkodan objekton" + +#: data/ui/glabels-ui.xml.h:31 +msgid "Create box/rectangle object" +msgstr "Kreu objekton de areo/rektangulo" + +#: data/ui/glabels-ui.xml.h:32 +msgid "Create ellipse/circle object" +msgstr "Kreu objekton de elipse/circlo" + +#: data/ui/glabels-ui.xml.h:33 +msgid "Create image object" +msgstr "Kreu bildan objekton" + +#: data/ui/glabels-ui.xml.h:34 +msgid "Create line object" +msgstr "Kreu linian objekton" + +#: data/ui/glabels-ui.xml.h:35 +msgid "Create text object" +msgstr "Kreu tekstan objekton" + +#: data/ui/glabels-ui.xml.h:36 +msgid "Cu_t" +msgstr "El_tondu" + +#: data/ui/glabels-ui.xml.h:37 +msgid "Customize" +msgstr "Personigu" + +#: data/ui/glabels-ui.xml.h:38 +msgid "Customize Drawing Toolbar" +msgstr "Personigu ilarstangon de desegno" + +#: data/ui/glabels-ui.xml.h:39 +msgid "Customize Main Toolbar" +msgstr "Personigu ĉefan ilarstangon" + +#: data/ui/glabels-ui.xml.h:40 +msgid "Customize Property Toolbar" +msgstr "Personigu ilarstangon de ecoj" + +#: data/ui/glabels-ui.xml.h:41 +msgid "Customize toolbars" +msgstr "Personigu ilarstangojn" + +#: data/ui/glabels-ui.xml.h:42 +msgid "Cut" +msgstr "Eltondu" + +#: data/ui/glabels-ui.xml.h:43 +msgid "Cut the selection" +msgstr "Eltondu elektaĵon" + +#: data/ui/glabels-ui.xml.h:44 +msgid "Decrease magnification" +msgstr "Malpliigu zomon" + +#: data/ui/glabels-ui.xml.h:45 +msgid "Delete" +msgstr "Forigu" + +#: data/ui/glabels-ui.xml.h:46 +msgid "Delete the selected objects" +msgstr "Forigu elektitajn objektojn" + +#: data/ui/glabels-ui.xml.h:47 +msgid "Drawing toolbar" +msgstr "Ilarstango de desegno" + +#: data/ui/glabels-ui.xml.h:48 +msgid "Dump XML" +msgstr "Ŝutu XML" + +#: data/ui/glabels-ui.xml.h:49 +msgid "Dump the UI Xml description" +msgstr "Ŝutu priskribon de UI xml" + +#: data/ui/glabels-ui.xml.h:50 +msgid "Edit merge properties" +msgstr "Redaktu ecojn de kunfando" + +#: data/ui/glabels-ui.xml.h:54 +msgid "Flip object horizontally" +msgstr "Renversu objekton horizontale" + +#: data/ui/glabels-ui.xml.h:55 +msgid "Flip object vertically" +msgstr "Renversu objekton vertikale" + +#: data/ui/glabels-ui.xml.h:56 +msgid "Font name" +msgstr "Nomo de tiparo" + +#: data/ui/glabels-ui.xml.h:57 +msgid "Font selector" +msgstr "Elektilo de tiparo" + +#: data/ui/glabels-ui.xml.h:58 +msgid "Font size" +msgstr "Tipargrando" + +#: data/ui/glabels-ui.xml.h:59 +msgid "Icon and _Text" +msgstr "Ikono kaj _Teksto" + +#: data/ui/glabels-ui.xml.h:60 +msgid "Increase magnification" +msgstr "Pliigu zomon" + +#: data/ui/glabels-ui.xml.h:61 +msgid "Italic" +msgstr "Kursivo" + +#: data/ui/glabels-ui.xml.h:63 +msgid "Left align" +msgstr "LaÅ­liniigu maldekstren" + +#: data/ui/glabels-ui.xml.h:65 +msgid "Line width" +msgstr "Larĝo de linio" + +#: data/ui/glabels-ui.xml.h:66 +msgid "Lower object to bottom" +msgstr "Subentiru objekton ĝis la fundo" + +#: data/ui/glabels-ui.xml.h:67 +msgid "M_arkup" +msgstr "M_arkado" + +#: data/ui/glabels-ui.xml.h:68 +msgid "Main toolbar" +msgstr "Ĉefa ilarstango" + +#: data/ui/glabels-ui.xml.h:69 +msgid "Markup" +msgstr "Markaĵoj" + +#: data/ui/glabels-ui.xml.h:70 +msgid "Modify document properties" +msgstr "Radaktu ecojn de dokumento" + +#: data/ui/glabels-ui.xml.h:71 +msgid "New" +msgstr "Nova" + +#: data/ui/glabels-ui.xml.h:72 +msgid "Object property editor" +msgstr "Redaktilo de ecoj por objekto" + +#: data/ui/glabels-ui.xml.h:73 +msgid "Only show icons in the main toolbar" +msgstr "Videbligu nur ikonojn en ĉefa ilarstango" + +#: data/ui/glabels-ui.xml.h:75 +msgid "Open a file" +msgstr "Malfermu iun dosieron" + +#: data/ui/glabels-ui.xml.h:76 +msgid "Open the glabels manual" +msgstr "Malfermu manlibron de glabels" + +#: data/ui/glabels-ui.xml.h:77 +msgid "Paste" +msgstr "Enmetu" + +#: data/ui/glabels-ui.xml.h:78 +msgid "Paste the clipboard" +msgstr "Enmetu la poŝon" + +#: data/ui/glabels-ui.xml.h:79 +msgid "Pr_eferences..." +msgstr "A_gordoj..." + +#: data/ui/glabels-ui.xml.h:80 +msgid "Preferences" +msgstr "Agordoj" + +#: data/ui/glabels-ui.xml.h:82 +msgid "Print the current file" +msgstr "Presu la nunan dosieron" + +#: data/ui/glabels-ui.xml.h:83 +msgid "Proper_ties..." +msgstr "E_coj..." + +#: data/ui/glabels-ui.xml.h:84 +msgid "Properties" +msgstr "Ecoj" + +#: data/ui/glabels-ui.xml.h:85 +msgid "Property toolbar" +msgstr "Ilarstango de ecoj" + +#: data/ui/glabels-ui.xml.h:86 +msgid "Quit" +msgstr "Eliro" + +#: data/ui/glabels-ui.xml.h:87 +msgid "Quit the program" +msgstr "Eliru el programo" + +#: data/ui/glabels-ui.xml.h:88 +msgid "Raise object to top" +msgstr "Suprentiru objekton ĝis la pinto" + +#: data/ui/glabels-ui.xml.h:89 +msgid "Recent _Files" +msgstr "Fre_ŝaj Dosieroj" + +#: data/ui/glabels-ui.xml.h:90 +msgid "Redo" +msgstr "Refaru" + +#: data/ui/glabels-ui.xml.h:91 +msgid "Redo the undone action" +msgstr "Refaru la lastan malfaritan agon" + +#: data/ui/glabels-ui.xml.h:92 +msgid "Remove all selections" +msgstr "Formovu ĉiujn elektaĵojn" + +#: data/ui/glabels-ui.xml.h:94 +#, no-c-format +msgid "Restore scale to 100%" +msgstr "Reen 100%" + +#: data/ui/glabels-ui.xml.h:95 +msgid "Right align" +msgstr "laÅ­liniigu dekstren" + +#: data/ui/glabels-ui.xml.h:98 +msgid "Rotate object 90 clockwise" +msgstr "Turnu la objekton je 90° dekstroĝire" + +#: data/ui/glabels-ui.xml.h:99 +msgid "Rotate object 90 counter-clockwise" +msgstr "Turnu la objekton je 90° kontraÅ­montrile" + +#: data/ui/glabels-ui.xml.h:100 +msgid "Save" +msgstr "Konservu" + +#: data/ui/glabels-ui.xml.h:101 +msgid "Save As" +msgstr "Konservu kiel" + +#: data/ui/glabels-ui.xml.h:102 +msgid "Save _As..." +msgstr "Konservu kiel..." + +#: data/ui/glabels-ui.xml.h:103 +msgid "Save the current file" +msgstr "Konservu la nunan dosieron" + +#: data/ui/glabels-ui.xml.h:104 +msgid "Save the current file with a different name" +msgstr "Konservu la nunan dosieron per alia nomo" + +#: data/ui/glabels-ui.xml.h:105 +msgid "Select All" +msgstr "Elektu Ĉion" + +#: data/ui/glabels-ui.xml.h:106 +msgid "Select _All" +msgstr "Elektu _Ĉion" + +#: data/ui/glabels-ui.xml.h:107 +msgid "Select all objects" +msgstr "Elektu ĉiujn objektojn" + +#: data/ui/glabels-ui.xml.h:108 +msgid "Select, move and modify objects" +msgstr "Elektu, movu kaj redaktu objektojn" + +#: data/ui/glabels-ui.xml.h:110 +msgid "Set main toolbar button style according to desktop default" +msgstr "Agordu butonstilon de ĉefa ilarstango laÅ­ defaÅ­lto de labortablo" + +#: data/ui/glabels-ui.xml.h:111 +msgid "Show _Tooltips" +msgstr "Mon_tru Sugestojn" + +#: data/ui/glabels-ui.xml.h:112 +msgid "Show both icons and texts in the main toolbar" +msgstr "Vidigu kaj ikonojn kaj tekstojn en la ĉefa ilarstango" + +#: data/ui/glabels-ui.xml.h:113 +msgid "Show tooltips in the drawing toolbar" +msgstr "Vidigu sugestojn en la ilarstango de desegno" + +#: data/ui/glabels-ui.xml.h:114 +msgid "Show tooltips in the main toolbar" +msgstr "Vidigu sugestojn en la ĉefa ilarstango" + +#: data/ui/glabels-ui.xml.h:115 +msgid "Show tooltips in the property toolbar" +msgstr "Vidigu sugestojn en la ilarstango de ecoj" + +#: data/ui/glabels-ui.xml.h:116 +msgid "Template Designer" +msgstr "Desegnilo de Modeloj" + +#: data/ui/glabels-ui.xml.h:117 +msgid "Template _Designer..." +msgstr "_Desegnilo de Modeloj..." + +#: data/ui/glabels-ui.xml.h:118 +msgid "Text color" +msgstr "Koloro de teksto" + +#: data/ui/glabels-ui.xml.h:119 +msgid "U_n-select All" +msgstr "Malelektu Ĉio_n" + +#: data/ui/glabels-ui.xml.h:120 +msgid "Un-select All" +msgstr "Malelektu Ĉion" + +#: data/ui/glabels-ui.xml.h:121 +msgid "Undo" +msgstr "Malfaru" + +#: data/ui/glabels-ui.xml.h:122 +msgid "Undo the last action" +msgstr "Nuligu lastan agon" + +#: data/ui/glabels-ui.xml.h:123 +msgid "Zoom _1:1" +msgstr "Zomo je _1:1" + +#: data/ui/glabels-ui.xml.h:124 +msgid "Zoom _In" +msgstr "_Zomo" + +#: data/ui/glabels-ui.xml.h:125 +msgid "Zoom _Out" +msgstr "_Malzomo" + +#: data/ui/glabels-ui.xml.h:126 +msgid "Zoom to _fit" +msgstr "Alĝustigu" + +#: data/ui/glabels-ui.xml.h:127 +msgid "Zoom to fit window" +msgstr "Alĝustigu al la fenestro" + +#: data/ui/glabels-ui.xml.h:128 +msgid "_About..." +msgstr "_Pri..." + +#: data/ui/glabels-ui.xml.h:129 +msgid "_Bottoms" +msgstr "Su_be" + +#: data/ui/glabels-ui.xml.h:132 +msgid "_Close" +msgstr "_Fermu" + +#: data/ui/glabels-ui.xml.h:133 +msgid "_Contents" +msgstr "_Entenoj" + +#: data/ui/glabels-ui.xml.h:134 +msgid "_Copy" +msgstr "_Kopiu" + +#: data/ui/glabels-ui.xml.h:135 +msgid "_Create Object" +msgstr "_Kreu Objekton" + +#: data/ui/glabels-ui.xml.h:136 +msgid "_Debug" +msgstr "_Sencimigo" + +#: data/ui/glabels-ui.xml.h:138 +msgid "_Desktop Default" +msgstr "DefaÅ­lto por Labortabulo" + +#: data/ui/glabels-ui.xml.h:139 +msgid "_Drawing Toolbar" +msgstr "Ilarstango de _Desegno" + +#: data/ui/glabels-ui.xml.h:140 +msgid "_Edit" +msgstr "R_edaktu" + +#: data/ui/glabels-ui.xml.h:142 +msgid "_File" +msgstr "_Dosiero" + +#: data/ui/glabels-ui.xml.h:143 +msgid "_Grid" +msgstr "_Krado" + +#: data/ui/glabels-ui.xml.h:144 +msgid "_Help" +msgstr "_Helpilo" + +#: data/ui/glabels-ui.xml.h:145 +msgid "_Icon" +msgstr "_Ikono" + +#: data/ui/glabels-ui.xml.h:149 +msgid "_Main Toolbar" +msgstr "_Ĉefa Ilarstango" + +#: data/ui/glabels-ui.xml.h:150 +msgid "_Merge Properties..." +msgstr "_Kunfandu Ecojn..." + +#: data/ui/glabels-ui.xml.h:151 +msgid "_New" +msgstr "_Nova" + +#: data/ui/glabels-ui.xml.h:152 +msgid "_Objects" +msgstr "_Objektoj" + +#: data/ui/glabels-ui.xml.h:153 +msgid "_Open..." +msgstr "M_alfermu..." + +#: data/ui/glabels-ui.xml.h:155 +msgid "_Paste" +msgstr "_Enmetu" + +#: data/ui/glabels-ui.xml.h:156 +msgid "_Print..." +msgstr "_Presu..." + +#: data/ui/glabels-ui.xml.h:157 +msgid "_Property Toolbar" +msgstr "Ilarstango de Eco_j" + +#: data/ui/glabels-ui.xml.h:158 +msgid "_Quit" +msgstr "_Eliro" + +#: data/ui/glabels-ui.xml.h:161 +msgid "_Save" +msgstr "_Konservu" + +#: data/ui/glabels-ui.xml.h:165 +msgid "_View" +msgstr "_Videbligo" + +#: data/glade/prefs-dialog.glade.h:1 +msgid " " +msgstr " " + +#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 +#: data/glade/template-designer.glade.h:5 +msgid "*" +msgstr "*" + +#: data/glade/prefs-dialog.glade.h:3 +msgid "Default page size" +msgstr "DefaÅ­lta grando de paĝo" + +#: data/glade/prefs-dialog.glade.h:4 +msgid "Fill" +msgstr "Plenigo" + +#: data/glade/prefs-dialog.glade.h:5 +msgid "Line" +msgstr "Linio" + +#: data/glade/prefs-dialog.glade.h:6 +msgid "Text" +msgstr "Teksto" + +#: data/glade/prefs-dialog.glade.h:7 +msgid "Units" +msgstr "Unitoj" + +#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 +msgid "Alignment:" +msgstr "Alliniĝo:" + +#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 +msgid "Color:" +msgstr "Koloro:" + +#: data/glade/prefs-dialog.glade.h:10 +msgid "Font:" +msgstr "Tiparo:" + +#: data/glade/prefs-dialog.glade.h:11 +msgid "ISO A4" +msgstr "ISO A4" + +#: data/glade/prefs-dialog.glade.h:12 +msgid "Inches" +msgstr "Coloj" + +#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 +msgid "Line Spacing:" +msgstr "Interspaco:" + +#: data/glade/prefs-dialog.glade.h:14 +msgid "Locale" +msgstr "Nacia" + +#: data/glade/prefs-dialog.glade.h:15 +msgid "Millimeters" +msgstr "Milimetroj" + +#: data/glade/prefs-dialog.glade.h:16 +msgid "Object defaults" +msgstr "DefaÅ­ltoj de objekto" + +#: data/glade/prefs-dialog.glade.h:17 +msgid "Points" +msgstr "Punktoj" + +#: data/glade/prefs-dialog.glade.h:18 +msgid "Select default properties for new objects." +msgstr "Elektu defaÅ­ltajn ecojn por novaj objektoj." + +#: data/glade/prefs-dialog.glade.h:19 +msgid "Select locale specific behavior." +msgstr "Elektu nacian specifan agmanieron." + +#. Most popular (at top of list) +#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:29 +msgid "US Letter" +msgstr "US·Letero" + +#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 +#: data/glade/template-designer.glade.h:72 +msgid "Width:" +msgstr "Larĝo:" + +#: data/glade/object-editor.glade.h:2 +msgid "00000000000 00000" +msgstr "00000000000 00000" + +#: data/glade/object-editor.glade.h:3 +msgid "Xxx object properties" +msgstr "Xxx ecoj de objekto" + +#: data/glade/object-editor.glade.h:5 +msgid "Allow merge to automatically shrink text" +msgstr "" + +#: data/glade/object-editor.glade.h:6 +msgid "Angle:" +msgstr "Angulo:" + +#: data/glade/object-editor.glade.h:7 +msgid "Checksum" +msgstr "Kontrolsumo" + +#: data/glade/object-editor.glade.h:10 +msgid "Family:" +msgstr "Familio:" + +#: data/glade/object-editor.glade.h:12 +msgid "Fill" +msgstr "Plenigo" + +#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 +msgid "Height:" +msgstr "Alto:" + +#: data/glade/object-editor.glade.h:14 +msgid "Image" +msgstr "Bildo" + +#: data/glade/object-editor.glade.h:15 +msgid "Insert merge field" +msgstr "Enigu campon de kunfando" + +#: data/glade/object-editor.glade.h:17 +msgid "Length:" +msgstr "Longo:" + +#: data/glade/object-editor.glade.h:18 +msgid "Line" +msgstr "Linio" + +#: data/glade/object-editor.glade.h:20 +msgid "Literal:" +msgstr "Literalo:" + +#: data/glade/object-editor.glade.h:21 +msgid "Load image" +msgstr "Ŝargu bildon" + +#: data/glade/object-editor.glade.h:22 +msgid "Position" +msgstr "Lokiĝo" + +#: data/glade/object-editor.glade.h:23 +msgid "Reset image size" +msgstr "Restarigu grandon de bildo" + +#: data/glade/object-editor.glade.h:24 +msgid "Size" +msgstr "Grando" + +#: data/glade/object-editor.glade.h:25 +msgid "Size:" +msgstr "Grando:" + +#: data/glade/object-editor.glade.h:26 +msgid "Style" +msgstr "Stilo" + +#: data/glade/object-editor.glade.h:27 +msgid "Style:" +msgstr "Stilo:" + +#: data/glade/object-editor.glade.h:30 +msgid "X:" +msgstr "X:" + +#: data/glade/object-editor.glade.h:31 +msgid "Y:" +msgstr "Y:" + +#: data/glade/object-editor.glade.h:32 +msgid "degrees" +msgstr "gradoj" + +#: data/glade/object-editor.glade.h:33 +msgid "dialog1" +msgstr "fenestr1" + +#: data/glade/object-editor.glade.h:34 +msgid "digits:" +msgstr "ciferoj:" + +#: data/glade/object-editor.glade.h:35 +msgid "format:" +msgstr "formato:" + +#: data/glade/template-designer.glade.h:1 +msgid " " +msgstr " " + +#: data/glade/template-designer.glade.h:2 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "(es., \"Etichette di spedizione,\" \"Vizitkartoj,\" ...)" + +#: data/glade/template-designer.glade.h:3 +msgid "(e.g., 8163A)" +msgstr "(es. 8163A)" + +#: data/glade/template-designer.glade.h:4 +msgid "(e.g., Avery, Acme, ...)" +msgstr "(es. Avery, Acme, ...)" + +#: data/glade/template-designer.glade.h:6 +msgid "1. Outer radius:" +msgstr "1. Ekstera radiuso:" + +#: data/glade/template-designer.glade.h:7 +msgid "1. Radius:" +msgstr "1. Radiuso:" + +#: data/glade/template-designer.glade.h:8 +msgid "1. Width:" +msgstr "1. Larĝo:" + +#: data/glade/template-designer.glade.h:9 +msgid "2. Height:" +msgstr "2. Alto:" + +#: data/glade/template-designer.glade.h:10 +msgid "2. Inner radius:" +msgstr "2. Interna radiuso:" + +#: data/glade/template-designer.glade.h:11 +msgid "2. Waste (overprint allowed):" +msgstr "2. Forĵetaĵo (surskrivebla):" + +#: data/glade/template-designer.glade.h:12 +msgid "3. Clipping width:" +msgstr "" + +#: data/glade/template-designer.glade.h:13 +msgid "3. Margin" +msgstr "3. Marĝeno" + +#: data/glade/template-designer.glade.h:14 +msgid "3. Round (radius of corner):" +msgstr "3. Rondo (radiuso de angulo):" + +#: data/glade/template-designer.glade.h:15 +msgid "4. Clipping height:" +msgstr "" + +#: data/glade/template-designer.glade.h:16 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "4. Horiz. forĵetaĵo (surskrivebla):" + +#: data/glade/template-designer.glade.h:17 +msgid "5. Vert. waste (overprint allowed):" +msgstr "5. Vert. forĵetaĵo (surskrivebla):" + +#: data/glade/template-designer.glade.h:18 +msgid "5. Waste (overprint allowed):" +msgstr "5. Forĵetaĵo (surskrivebla):" + +#: data/glade/template-designer.glade.h:19 +msgid "6. Margin" +msgstr "6. Marĝeno" + +#: data/glade/template-designer.glade.h:20 +msgid "Brand/Manufacturer:" +msgstr "Marca/Produttore:" + +#: data/glade/template-designer.glade.h:21 +msgid "CD/DVD (including credit card CDs)" +msgstr "KD/DVD" + +#: data/glade/template-designer.glade.h:22 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "" +"Gratulojn!\n" +"\n" +"Vi finis Desegnilon de Modelojn por gLabels.\n" +"Se vi volas konservi tiun ĉi projekton, alklaku sur \"Apliku\".\n" +"\n" +"Male, alklaku sur \"Nuligu\" por nuligi\n" +"vian projekton tutan aÅ­ \"Retroen\" por ankoraÅ­ redakti tiun ĉi desegnon." + +#: data/glade/template-designer.glade.h:30 +msgid "Design Completed" +msgstr "Fino de Projektado" + +#: data/glade/template-designer.glade.h:31 +msgid "Distance from left edge (x0):" +msgstr "Distanco el maldekstra rando (x0):" + +#: data/glade/template-designer.glade.h:32 +msgid "Distance from top edge (y0):" +msgstr "Distanco el supra rando (y0):" + +#: data/glade/template-designer.glade.h:34 +msgid "Horizontal pitch (dx):" +msgstr "Horizontala kvanto (dx):" + +#: data/glade/template-designer.glade.h:35 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" + +#: data/glade/template-designer.glade.h:40 +msgid "Label Size (CD/DVD)" +msgstr "Grando de etikedo (KD/DVD)" + +#: data/glade/template-designer.glade.h:41 +msgid "Label Size (Round)" +msgstr "Grando de etikedo (Ronda)" + +#: data/glade/template-designer.glade.h:42 +msgid "Label or Card Shape" +msgstr "Formo de etikedo aÅ­ de karto" + +#: data/glade/template-designer.glade.h:43 +msgid "Label or Card Size (Rectangular)" +msgstr "Formo de etikedo aÅ­ de karto (Rektangula)" + +#: data/glade/template-designer.glade.h:44 +msgid "Layout #1" +msgstr "Aspekto #1" + +#: data/glade/template-designer.glade.h:45 +msgid "Layout #2" +msgstr "Aspekto #2" + +#: data/glade/template-designer.glade.h:46 +msgid "Layout(s)" +msgstr "Aspekto(j)" + +#: data/glade/template-designer.glade.h:47 +msgid "Name and Description" +msgstr "Nomo kaj Priskribo" + +#: data/glade/template-designer.glade.h:48 +msgid "Number across (nx):" +msgstr "Numero transverse (nx):" + +#: data/glade/template-designer.glade.h:49 +msgid "Number down (ny):" +msgstr "Numero sube (ny):" + +#: data/glade/template-designer.glade.h:50 +msgid "Number of Layouts" +msgstr "Nombro da Aspektoj" + +#: data/glade/template-designer.glade.h:51 +msgid "Number of layouts:" +msgstr "Nombro da aspektoj:" + +#: data/glade/template-designer.glade.h:52 +msgid "Page Size" +msgstr "Grando de paĝo" + +#: data/glade/template-designer.glade.h:54 +msgid "Part #:" +msgstr "Parto #:" + +#: data/glade/template-designer.glade.h:55 +msgid "" +"Please enter the following identifying information about the template " +"stationery." +msgstr "" + +#: data/glade/template-designer.glade.h:56 +msgid "Please enter the following layout information." +msgstr "Bonvolu enmeti menditajn informojn." + +#: data/glade/template-designer.glade.h:57 +msgid "" +"Please enter the following size parameters of a single label in your " +"template." +msgstr "" +"Bonvolu enmeti menditajn parametrojn de grando por unu etikedo en " +"la modelo." + +#: data/glade/template-designer.glade.h:58 +msgid "" +"Please enter the following size parameters of a single label or card in your " +"template." +msgstr "" +"Bonvolu enmeti menditajn parametrojn de grando por unu etikedo aÅ­ karto en " +"la modelo." + +#: data/glade/template-designer.glade.h:59 +msgid "Please select the basic shape of the labels or cards." +msgstr "" + +#: data/glade/template-designer.glade.h:60 +msgid "Please select the page size of the template stationery." +msgstr "Bonvolu elekti grandon de paĝo por modelo de skribvaroj." + +#: data/glade/template-designer.glade.h:61 +msgid "Print test sheet" +msgstr "Presu paĝon de elprovo" + +#: data/glade/template-designer.glade.h:62 +msgid "Rectangular or square (can have rounded corners)" +msgstr "Rektangula aÅ­ kvadra (ankaÅ­ kun rondaj anguloj)" + +#: data/glade/template-designer.glade.h:63 +msgid "Round" +msgstr "Ronda" + +#: data/glade/template-designer.glade.h:64 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" +"Modeloj necesas\n" +"du aspektojn." + +#: data/glade/template-designer.glade.h:66 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" +"Modeloj necesas nur \n" +"unu aspekton." + +#: data/glade/template-designer.glade.h:68 +msgid "Vertical pitch (dy):" +msgstr "Vertikala kvanto (dy):" + +#: data/glade/template-designer.glade.h:69 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" +"Bonvenon! Tiu ĉi estas Desegnilo de Modeloj por gLabels.\n" +"\n" +"Tio helpos vin por krei personigitan modelon por gLabels." + +#. Other ISO A series sizes +#: data/templates/paper-sizes.xml.h:2 +msgid "A0" +msgstr "A0" + +#: data/templates/paper-sizes.xml.h:3 +msgid "A1" +msgstr "A1" + +#: data/templates/paper-sizes.xml.h:4 +msgid "A10" +msgstr "A10" + +#: data/templates/paper-sizes.xml.h:5 +msgid "A2" +msgstr "A2" + +#: data/templates/paper-sizes.xml.h:6 +msgid "A3" +msgstr "A3" + +#: data/templates/paper-sizes.xml.h:7 +msgid "A4" +msgstr "A4" + +#: data/templates/paper-sizes.xml.h:8 +msgid "A5" +msgstr "A5" + +#: data/templates/paper-sizes.xml.h:9 +msgid "A6" +msgstr "A6" + +#: data/templates/paper-sizes.xml.h:10 +msgid "A7" +msgstr "A7" + +#: data/templates/paper-sizes.xml.h:11 +msgid "A8" +msgstr "A8" + +#: data/templates/paper-sizes.xml.h:12 +msgid "A9" +msgstr "A9" + +#. ISO B series sizes +#: data/templates/paper-sizes.xml.h:14 +msgid "B0" +msgstr "B0" + +#: data/templates/paper-sizes.xml.h:15 +msgid "B1" +msgstr "B1" + +#: data/templates/paper-sizes.xml.h:16 +msgid "B10" +msgstr "B10" + +#: data/templates/paper-sizes.xml.h:17 +msgid "B2" +msgstr "B2" + +#: data/templates/paper-sizes.xml.h:18 +msgid "B3" +msgstr "B3" + +#: data/templates/paper-sizes.xml.h:19 +msgid "B4" +msgstr "B4" + +#: data/templates/paper-sizes.xml.h:20 +msgid "B5" +msgstr "B5" + +#: data/templates/paper-sizes.xml.h:21 +msgid "B6" +msgstr "B6" + +#: data/templates/paper-sizes.xml.h:22 +msgid "B7" +msgstr "B7" + +#: data/templates/paper-sizes.xml.h:23 +msgid "B8" +msgstr "B8" + +#: data/templates/paper-sizes.xml.h:24 +msgid "B9" +msgstr "B9" + +#: data/templates/paper-sizes.xml.h:25 +msgid "US Executive" +msgstr "US Executive" + +#. Other US paper sizes +#: data/templates/paper-sizes.xml.h:27 +msgid "US Legal" +msgstr "US Legal" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:2 +#: data/templates/zweckform-iso-templates.xml.h:2 +msgid "Address Labels" +msgstr "Etikedo por adreso" + +#. =================================================================== +#. ============================================================ +#. =================================================================== +#. ====================================================== +#: data/templates/avery-us-templates.xml.h:4 +#: data/templates/avery-iso-templates.xml.h:4 +#: data/templates/zweckform-iso-templates.xml.h:6 +#: data/templates/misc-us-templates.xml.h:3 +#: data/templates/misc-iso-templates.xml.h:17 +msgid "Business Cards" +msgstr "Vizitkartoj" + +#: data/templates/avery-us-templates.xml.h:5 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "Etikedoj por KD/DVD (Etikedoj por diskoj)" + +#: data/templates/avery-us-templates.xml.h:6 +msgid "CD/DVD Labels (Spine Labels)" +msgstr "Etikedoj por KD/DVD (Etikedoj por diskoj)" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:8 +msgid "Diskette Labels" +msgstr "Etikedoj por disketoj" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:10 +msgid "Filing Labels" +msgstr "" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:12 +msgid "Full Sheet Labels" +msgstr "Paĝo plena da ekikedoj" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:14 +msgid "Large Round Labels" +msgstr "Grandaj rondigitaj etikedoj" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:16 +msgid "Name Badge Labels" +msgstr "Nomŝildetoj" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:18 +msgid "Return Address Labels" +msgstr "Etikedoj por adreso de sendinto" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:20 +msgid "Shipping Labels" +msgstr "Etikedoj por ekspedo" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:22 +msgid "Small Round Labels" +msgstr "Malgrandaj rondigitaj etikedoj" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:24 +msgid "Square Labels" +msgstr "Kvardaj etikedoj" + +#: data/templates/avery-us-templates.xml.h:25 +msgid "Video Tape Face Labels" +msgstr "Etikedoj por videokasedo (faco)" + +#: data/templates/avery-us-templates.xml.h:26 +msgid "Video Tape Spine Labels" +msgstr "Etikedoj por videokasedo (dorso)" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:2 +msgid "Address labels" +msgstr "Etikedoj por adreso" + +#. =============================================================== +#: data/templates/avery-iso-templates.xml.h:6 +msgid "CD Booklet" +msgstr "CD Booklet" + +#. =============================================================== +#: data/templates/avery-iso-templates.xml.h:8 +msgid "CD Inlet" +msgstr "CD Inlet" + +#. =============================================================== +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:10 +#: data/templates/zweckform-iso-templates.xml.h:8 +#: data/templates/misc-us-templates.xml.h:5 +#: data/templates/misc-iso-templates.xml.h:21 +msgid "CD/DVD Labels" +msgstr "Etikedoj por KD/DVD" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:12 +msgid "Diskette labels" +msgstr "Etikedoj por disketoj" + +#. =============================================================== +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:14 +#: data/templates/zweckform-iso-templates.xml.h:14 +#: data/templates/misc-iso-templates.xml.h:35 +msgid "Mailing Labels" +msgstr "Etikedoj por poŝto" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:16 +msgid "Mailing labels" +msgstr "Etikedoj por poŝto" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:18 +msgid "Mini Address Labels" +msgstr "Eta etikedoj por adreso" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:20 +msgid "Shipping labels" +msgstr "Etikedo por ekspedo" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:4 +msgid "Allround Labels" +msgstr "Plenrondaj etikedoj" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:10 +msgid "Correction and Cover-up Labels" +msgstr "Etikedoj por korektado kaj kovrado" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:12 +msgid "Lever Arch File Labels" +msgstr "Levilaj arkaj etikedoj por dosieroj" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:16 +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "QSL-Karten Etiketten 70mm x 50,8mm" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:18 +msgid "Rectangular Copier Labels" +msgstr "Rektangulaj etikedoj por kopiado" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:20 +#: data/templates/misc-iso-templates.xml.h:44 +msgid "Rectangular Labels" +msgstr "Rektangulaj Etikedoj" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:22 +msgid "Video Labels (back)" +msgstr "Etikedo por Video (retro)" + +#: data/templates/misc-us-templates.xml.h:1 +msgid "Business Card CD" +msgstr "Vizitkarto KD" + +#: data/templates/misc-us-templates.xml.h:4 +msgid "CD Template Rectangles" +msgstr "Modelaj Rektanguloj por KD" + +#: data/templates/misc-us-templates.xml.h:6 +msgid "CD/DVD Labels (Face Only)" +msgstr "Etikedoj por KD/DVD (nur faco)" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:7 +#: data/templates/misc-iso-templates.xml.h:23 +msgid "CD/DVD Labels (face only)" +msgstr "Etikedoj por KD/DVD (nur faco)" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:9 +msgid "Cassette Labels" +msgstr "Etikedoj por kasedoj" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:11 +msgid "DLT Labels" +msgstr "Etikedoj DLT" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:13 +msgid "Microtube labels" +msgstr "Mikrotubaj etikedoj" + +#: data/templates/misc-us-templates.xml.h:14 +msgid "Mini-CD Labels" +msgstr "Etikedoj por Mini-KD" + +#: data/templates/misc-us-templates.xml.h:15 +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "Etikedoj por PRO CD (nur KD-dorso)" + +#: data/templates/misc-us-templates.xml.h:16 +msgid "PRO CD Labels 2-up (Face only)" +msgstr "Etikedoj por PRO CD (nur faco)" + +#: data/templates/misc-us-templates.xml.h:17 +#: data/templates/misc-iso-templates.xml.h:42 +msgid "PRO CD Labels 2-up (face only)" +msgstr "Etikedoj por PRO CD (nur faco)" + +#: data/templates/misc-us-templates.xml.h:18 +msgid "Slimline CD Case (rightside up)" +msgstr "Subtila KD-ujo (dekstrosupra)" + +#: data/templates/misc-us-templates.xml.h:19 +msgid "Slimline CD Case (upside down)" +msgstr "Subtila KD-ujo (kaposuba)" + +#: data/templates/misc-iso-templates.xml.h:1 +msgid "Agipa 119488: Business Cards" +msgstr "Agipa 119488: Vizitkartoj" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:3 +msgid "Allround Labels --24" +msgstr "Plenrondaj etikedoj --24" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:5 +msgid "Allround Labels --44" +msgstr "Plenrondaj etikedoj --44" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:7 +msgid "Allround Labels --64" +msgstr "Plenrondaj etikedoj --64" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:9 +msgid "Allround Labels --65" +msgstr "Plenrondaj etikedoj --65" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:11 +msgid "Arch File Labels" +msgstr "Arkaj etikedoj por dosieroj" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:13 +msgid "Arch File Labels (large)" +msgstr "Arkaj etikedoj por dosieroj (grandaj)" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:15 +msgid "Arch File Labels (small)" +msgstr "Arkaj etikedoj por dosieroj (etaj)" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:19 +msgid "CD Labels" +msgstr "Etikedoj por KD" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:25 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "Etikedoj kun standarta formato por KD/DVD (nur faco)" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:27 +msgid "Diskette Labels (face only)" +msgstr "Etikedoj por disketoj (nur faco)" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:29 +msgid "EPSON Photo Stickers 16" +msgstr "EPSON Photo Stickers 16" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:31 +msgid "Etiketten" +msgstr "Etiketten" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:33 +msgid "Fridge Magnet Stickers" +msgstr "Magnetaĵoj por fridujo" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:37 +msgid "Mailing Labels --14" +msgstr "Etikedo por poŝto --14" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:39 +msgid "Mailing Labels-2 columns" +msgstr "Etikedo por poŝto kun 2 kolumnoj" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:41 +msgid "Mailing Labels-3 columns" +msgstr "Etikedo por poŝto kun 3 kolumnoj" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:46 +msgid "Video Labels (face only)" +msgstr "Etikedoj por video (nur frontispico)" + +#: data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers" +msgstr "Kreu etikedojn, vizitkartojn kaj kovrilojn de plurmediaĵoj" + +#: data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "gLabels Designer di etichetta" + +#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 +msgid "gLabels Project File" +msgstr "Dosiero de Projekto de gLabels" + diff --git a/po/es.po b/po/es.po new file mode 100644 index 00000000..9dc7ad40 --- /dev/null +++ b/po/es.po @@ -0,0 +1,2565 @@ +# Spanish translation of glabels. +# sergio rivadero , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: glabels 2.1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-01-22 14:03-0500\n" +"PO-Revision-Date: 2005-02-12 12:19-0300\n" +"Last-Translator: sergio rivadero \n" +"Language-Team: Spanish/Spain \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/glabels.c:116 +msgid "Could not initialize Bonobo!\n" +msgstr "No se puede inicializar Bonobo!\n" + +#: src/glabels-batch.c:52 +msgid "print this message" +msgstr "imprimir este mensaje" + +#: src/glabels-batch.c:54 +msgid "print the version of glabels-batch being used" +msgstr "imprimir la versión utilizada de glabels-batch" + +#: src/glabels-batch.c:56 +msgid "set output filename (default=\"output.ps\")" +msgstr "establecer nombre de archivo (predeterminado=\"output.ps\")" + +#: src/glabels-batch.c:56 src/glabels-batch.c:70 +msgid "filename" +msgstr "nombre de archivo" + +#: src/glabels-batch.c:58 +msgid "number of sheets (default=1)" +msgstr "número de hojas (predeterminado=1)" + +#: src/glabels-batch.c:58 +msgid "sheets" +msgstr "hojas" + +#: src/glabels-batch.c:60 +msgid "number of copies (default=1)" +msgstr "número de copias (predeterminado=1)" + +#: src/glabels-batch.c:60 +msgid "copies" +msgstr "copias" + +#: src/glabels-batch.c:62 +msgid "first label on first sheet (default=1)" +msgstr "primera etiqueta en primera hoja (predeterminado=1)" + +#: src/glabels-batch.c:62 +msgid "first" +msgstr "primero" + +#: src/glabels-batch.c:64 src/print-dialog.c:336 +msgid "print outlines (to test printer alignment)" +msgstr "imprimir un esbozo (para verificar la alineación de la impresora)" + +#: src/glabels-batch.c:66 src/print-dialog.c:344 +msgid "print in reverse (i.e. a mirror image)" +msgstr "impresión invertida (imagen espejo)" + +#: src/glabels-batch.c:68 src/print-dialog.c:351 +msgid "print crop marks" +msgstr "imprimir marcas de corte" + +#: src/glabels-batch.c:70 +msgid "input file for merging" +msgstr "archivo de entrada para combinar" + +#: src/glabels-batch.c:107 +msgid "[OPTION...] GLABELS_FILE..." +msgstr "[OPCION...] archivo-glabels..." + +#: src/glabels-batch.c:127 +#, c-format +msgid "missing glabels file\n" +msgstr "archivo glabels perdido\n" + +#: src/glabels-batch.c:158 +#, c-format +msgid "cannot perform document merge with glabels file %s\n" +msgstr "No se puede combinar el archivo %s\n" + +#: src/glabels-batch.c:182 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "No se puede abrir el archivo %s\n" + +#: src/window.c:244 +msgid "(none) - gLabels" +msgstr "(sin nombre) - gLabels" + +#: src/window.c:414 +msgid "(modified)" +msgstr "(modificado)" + +#: src/stock.c:65 data/ui/glabels-ui.xml.h:162 +msgid "_Select Mode" +msgstr "_Modo selección" + +#: src/stock.c:66 data/ui/glabels-ui.xml.h:163 +msgid "_Text" +msgstr "_Texto" + +#: src/stock.c:67 data/ui/glabels-ui.xml.h:148 +msgid "_Line" +msgstr "_Línea" + +#: src/stock.c:68 data/ui/glabels-ui.xml.h:130 +msgid "_Box" +msgstr "_Rectangulo" + +#: src/stock.c:69 data/ui/glabels-ui.xml.h:141 +msgid "_Ellipse" +msgstr "_Elipse" + +#: src/stock.c:70 data/ui/glabels-ui.xml.h:146 +msgid "_Image" +msgstr "_Imagen" + +#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 +msgid "Bar_code" +msgstr "_Código de barras" + +#: src/stock.c:72 +msgid "_Merge Properties" +msgstr "Propiedades de _fusión de datos" + +#: src/stock.c:73 +msgid "Object _Properties" +msgstr "Propiedades del objeto" + +#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 +msgid "Bring to _Front" +msgstr "Traer al _frente" + +#: src/stock.c:75 data/ui/glabels-ui.xml.h:109 +msgid "Send to _Back" +msgstr "Enviar al f_ondo" + +#: src/stock.c:76 data/ui/glabels-ui.xml.h:96 +msgid "Rotate _Left" +msgstr "Rotar a la _izquierda" + +#: src/stock.c:77 data/ui/glabels-ui.xml.h:97 +msgid "Rotate _Right" +msgstr "Rotar a la _derecha" + +#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 +msgid "Flip _Horizontally" +msgstr "Reflejar _horizontalmente" + +#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 +msgid "Flip _Vertically" +msgstr "Reflejar _verticalmente" + +#: src/stock.c:80 data/ui/glabels-ui.xml.h:147 +msgid "_Lefts" +msgstr "A la _izquierda" + +#: src/stock.c:81 data/ui/glabels-ui.xml.h:159 +msgid "_Rights" +msgstr "A la _derecha" + +#: src/stock.c:82 data/ui/glabels-ui.xml.h:131 +msgid "_Centers" +msgstr "_Centrado" + +#: src/stock.c:83 data/ui/glabels-ui.xml.h:164 +msgid "_Tops" +msgstr "_Superior" + +#: src/stock.c:84 +msgid "Bottoms" +msgstr "_Inferior" + +#: src/stock.c:85 +msgid "Centers" +msgstr "_Centrado" + +#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 +msgid "Label Ce_nter" +msgstr "Centro de la _etiqueta" + +#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 +msgid "Fill color" +msgstr "Color de relleno" + +#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 +msgid "Line color" +msgstr "Color de línea" + +#: src/stock.c:90 src/stock.c:92 +msgid "Linked" +msgstr "Enlazado" + +#: src/stock.c:91 src/stock.c:93 +msgid "Not Linked" +msgstr "No enlazado" + +#: src/ui-property-bar.c:345 src/object-editor.c:587 +msgid "Default" +msgstr "Predeterminado" + +#: src/ui-property-bar.c:360 src/object-editor.c:600 +msgid "No fill" +msgstr "Sin relleno" + +#: src/ui-property-bar.c:375 src/object-editor.c:593 +msgid "No line" +msgstr "Sin línea" + +#: src/ui-sidebar.c:180 +msgid "Object properties" +msgstr "Propiedades del objeto" + +#: src/commands.c:385 +msgid "" +"A label and business card creation program for GNOME.\n" +" \n" +"Glabels is free software; you can redistribute it and/or modify it under the " +"terms of the GNU General Public License as published by the Free Software " +"Foundation; either version 2 of the License, or (at your option) any later " +"version.\n" +" \n" +"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.\n" +msgstr "" +"Un programa de creación de etiquetas y tarjetas para GNOME.\n" +" \n" +"Glabels es software libre; Puede modificarlo y redistribuirlo bajo los " +"términos de la Licencia Pública General de GNU tal como es publicada por la " +"Free Software Foundation; ya sea la versión 2 de dicha licencia, o (a su " +"opción) cualquier otra versión posterior.\n" +" \n" +"Este programa se distribuye con la esperanza que le será útil, pero SIN " +"NINGUNA GARANTÍA; Para más detalles vea la Licencia Pública General de GNU.\n" + +#: src/commands.c:399 +msgid "See the file AUTHORS for additional credits," +msgstr "Vea el archivo AUTHORS, " + +#: src/commands.c:400 +msgid "or visit http://glabels.sourceforge.net/" +msgstr "o visite http://glabels.sourceforge.net/" + +#: src/commands.c:409 +msgid " " +msgstr " " + +#: src/commands.c:424 +msgid "glabels" +msgstr "glabels" + +#: src/file.c:100 +msgid "New Label or Card" +msgstr "Nueva etiqueta o tarjeta" + +#: src/file.c:132 src/file.c:304 +msgid "Media Type" +msgstr "Tipo de papel" + +#: src/file.c:138 src/file.c:310 +msgid "Label orientation" +msgstr "Orientación de la etiqueta" + +#: src/file.c:269 +msgid "Label properties" +msgstr "Propiedades de la etiqueta" + +#: src/file.c:452 src/file.c:870 +msgid "All files" +msgstr "Todos los archivos" + +#: src/file.c:457 src/file.c:875 +msgid "gLabels documents" +msgstr "Documentos glabels" + +#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 +msgid "Empty file name selection" +msgstr "Vaciar selección de nombre de archivo" + +#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 +msgid "Please select a file or supply a valid file name" +msgstr "Por favor seleccione un archivo o escriba un nombre de archivo válido" + +#: src/file.c:519 src/file.c:631 +msgid "File does not exist" +msgstr "Archivo no existe" + +#: src/file.c:563 data/ui/glabels-ui.xml.h:74 +msgid "Open" +msgstr "Abrir" + +#: src/file.c:565 +msgid "Open label" +msgstr "Abrir etiqueta" + +#: src/file.c:707 +#, c-format +msgid "Could not open file \"%s\"" +msgstr "No se puede abrir el archivo \"%s\"" + +#: src/file.c:715 +msgid "Not a supported file format" +msgstr "Formato de archivo no soportado" + +#: src/file.c:797 src/file.c:979 src/file.c:1174 +#, c-format +msgid "Could not save file \"%s\"" +msgstr "No se puede guardar el archivo \"%s\"" + +#: src/file.c:805 src/file.c:987 src/file.c:1182 +msgid "Error encountered during save. The file is still not saved." +msgstr "Se encontró un error al guardar. El archivo aún no está guardado." + +#: src/file.c:848 src/file.c:1048 +#, c-format +msgid "Save \"%s\" as" +msgstr "Guardar como \"%s\"" + +#: src/file.c:935 src/file.c:1131 +msgid "Please supply a valid file name" +msgstr "Debe proporcionar un nombre de archivo válido" + +#: src/file.c:952 src/file.c:1147 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "Sobreescribir el archivo \"%s\"?" + +#: src/file.c:960 src/file.c:1155 +msgid "File already exists." +msgstr "El archivo ya existe." + +#: src/file.c:1271 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "Guardar cambios del documento \"%s\" antes de cerrar?" + +#: src/file.c:1279 +msgid "Your changes will be lost if you don't save them." +msgstr "Sus cambios se perderán si no los guarda." + +#: src/file.c:1282 +msgid "Close without saving" +msgstr "Cerrar sin guardar" + +#. Should not happen +#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 +#: data/glade/object-editor.glade.h:37 +msgid "points" +msgstr "puntos" + +#: src/prefs.c:158 data/glade/object-editor.glade.h:36 +#: data/glade/template-designer.glade.h:74 +msgid "inches" +msgstr "pulgadas" + +#: src/prefs.c:160 +msgid "mm" +msgstr "mm" + +#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 +msgid "gLabels Preferences" +msgstr "Preferencias de gLabels" + +#. +#. * Submenu: Order +#. +#: src/view.c:3574 data/ui/glabels-ui.xml.h:154 +msgid "_Order" +msgstr "Or_den" + +#. +#. * Submenu: Rotate/Flip +#. +#: src/view.c:3595 data/ui/glabels-ui.xml.h:160 +msgid "_Rotate/Flip" +msgstr "_Rotar/Reflejar" + +#. +#. * Submenu: Align Horizontally +#. +#: src/view.c:3628 +msgid "Align _Horizontally" +msgstr "Alinear _horizontalmente" + +#. +#. * Submenu: Align Vertically +#. +#: src/view.c:3667 +msgid "Align _Vertically" +msgstr "Alinear _verticalmente" + +#: src/view.c:3728 data/ui/glabels-ui.xml.h:137 +msgid "_Delete" +msgstr "_Borrar" + +#. Build editor. +#: src/view-box.c:236 +msgid "Box object properties" +msgstr "Propiedades del rectángulo" + +#. Build editor. +#: src/view-ellipse.c:236 +msgid "Ellipse object properties" +msgstr "Propiedades del elipse" + +#. Build editor. +#: src/view-line.c:229 +msgid "Line object properties" +msgstr "Propiedades de la línea" + +#. Build editor. +#: src/view-image.c:223 +msgid "Image object properties" +msgstr "Propiedades de la imagen" + +#. Build editor. +#: src/view-text.c:251 +msgid "Text object properties" +msgstr "Propiedades del texto" + +#: src/view-text.c:571 data/glade/object-editor.glade.h:28 +msgid "Text" +msgstr "Texto" + +#. Build editor. +#: src/view-barcode.c:210 +msgid "Barcode object properties" +msgstr "Propiedades del código de barras" + +#: src/view-barcode.c:594 src/print.c:1125 +msgid "Invalid barcode data" +msgstr "Datos de código de barras no válidos" + +#: src/merge-properties-dialog.c:231 +msgid "Merge Properties" +msgstr "Propiedades de combinación de datos" + +#. ---- Source section ---- +#: src/merge-properties-dialog.c:237 +msgid "Source" +msgstr "Fuente" + +#: src/merge-properties-dialog.c:245 +msgid "Format:" +msgstr "Formato:" + +#. Location line +#: src/merge-properties-dialog.c:273 +msgid "Location:" +msgstr "Ubicación:" + +#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 +msgid "Select merge-database source" +msgstr "Seleccione la fuente de datos para combinar" + +#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 +msgid "N/A" +msgstr "N/D" + +#. ---- Sample Fields section ---- +#: src/merge-properties-dialog.c:300 +msgid "Record selection/preview:" +msgstr "Selección de registros/Vista previa" + +#: src/merge-properties-dialog.c:326 +msgid "Select" +msgstr "Seleccionar" + +#: src/merge-properties-dialog.c:334 +msgid "Record/Field" +msgstr "Registro/Campo" + +#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 +msgid "Data" +msgstr "Datos" + +#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:81 +msgid "Print" +msgstr "Imprimir" + +#: src/print-dialog.c:281 +msgid "_Job" +msgstr "_Trabajo" + +#: src/print-dialog.c:286 +msgid "P_rinter" +msgstr "_Impresora" + +#. ----------- Add simple-copies widget ------------ +#: src/print-dialog.c:314 +msgid "Copies" +msgstr "Copias" + +#. ------- Add merge control widget ------------ +#: src/print-dialog.c:322 +msgid "Document merge control" +msgstr "Control de combinación de documentos" + +#. ----------- Add custom print options area ------------ +#: src/print-dialog.c:330 +msgid "Options" +msgstr "Opciones" + +#: src/print-dialog.c:553 src/print-dialog.c:592 +msgid "Print preview" +msgstr "Previsualizar la impresión" + +#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 +msgid "gLabels Template Designer" +msgstr "Diseñador de plantillas gLabels" + +#: src/bc.c:60 +msgid "POSTNET (any)" +msgstr "POSTNET (cualquiera)" + +#: src/bc.c:63 +msgid "POSTNET-5 (ZIP only)" +msgstr "POSTNET-5 (solo código postal)" + +#: src/bc.c:66 +msgid "POSTNET-9 (ZIP+4)" +msgstr "POSTNET-9 (código postal+4)" + +#: src/bc.c:69 +msgid "POSTNET-11 (DPBC)" +msgstr "POSTNET-11 (DPBC)" + +#: src/bc.c:72 +msgid "EAN (any)" +msgstr "EAN (cualquiera)" + +#: src/bc.c:75 +msgid "EAN-8" +msgstr "EAN-8" + +#: src/bc.c:78 +msgid "EAN-8 +2" +msgstr "EAN-8 +2" + +#: src/bc.c:81 +msgid "EAN-8 +5" +msgstr "EAN-8 +5" + +#: src/bc.c:84 +msgid "EAN-13" +msgstr "EAN-13" + +#: src/bc.c:87 +msgid "EAN-13 +2" +msgstr "EAN-13 2" + +#: src/bc.c:90 +msgid "EAN-13 +5" +msgstr "EAN-13 +5" + +#: src/bc.c:93 +msgid "UPC (UPC-A or UPC-E)" +msgstr "UPC (UPC-A o UPC-E)" + +#: src/bc.c:96 +msgid "UPC-A" +msgstr "UPC-A" + +#: src/bc.c:99 +msgid "UPC-A +2" +msgstr "UPC-A +2" + +#: src/bc.c:102 +msgid "UPC-A +5" +msgstr "UPC-A +5" + +#: src/bc.c:105 +msgid "UPC-E" +msgstr "UPC-E" + +#: src/bc.c:108 +msgid "UPC-E +2" +msgstr "UPC-E +2" + +#: src/bc.c:111 +msgid "UPC-E +5" +msgstr "UPC-E +5" + +#: src/bc.c:114 +msgid "ISBN" +msgstr "ISBN" + +#: src/bc.c:117 +msgid "ISBN +5" +msgstr "ISBN +5" + +#: src/bc.c:120 +msgid "Code 39" +msgstr "Code 39" + +#: src/bc.c:123 +msgid "Code 128" +msgstr "Code 128" + +#: src/bc.c:126 +msgid "Code 128C" +msgstr "Code 128C" + +#: src/bc.c:129 +msgid "Code 128B" +msgstr "Code 128B" + +#: src/bc.c:132 +msgid "Interleaved 2 of 5" +msgstr "Intercalado 2 de 5" + +#: src/bc.c:135 +msgid "Codabar" +msgstr "Codabar" + +#: src/bc.c:138 +msgid "MSI" +msgstr "MSI" + +#: src/bc.c:141 +msgid "Plessey" +msgstr "Plessey" + +#: src/label.c:569 +msgid "Untitled" +msgstr "Sin título" + +#: src/xml-label.c:176 src/xml-label.c:213 +msgid "xmlParseFile error" +msgstr "error xmlParseFile" + +#: src/xml-label.c:250 +msgid "No document root" +msgstr "No hay documento raíz" + +#: src/xml-label.c:264 +msgid "Importing from glabels 0.1 format" +msgstr "Importando desde formato glabels 0.1" + +#: src/xml-label.c:272 +msgid "Importing from glabels 0.4 format" +msgstr "Importando desde formato glabels 0.4" + +#: src/xml-label.c:279 +msgid "Importing from glabels 1.91 format" +msgstr "Importando desde formato glabels 1.91" + +#: src/xml-label.c:282 +msgid "bad document, unknown glabels Namespace" +msgstr "documento de tipo erróneo, etiquetas glabels no encontradas" + +#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "Nodo raíz erróneo = \"%s\"" + +#: src/xml-label.c:348 src/xml-label-191.c:165 +#, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "Nodo erróneo en sección Document = \"%s\"" + +#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 +#, c-format +msgid "bad node = \"%s\"" +msgstr "Nodo erróneo = \"%s\"" + +#: src/xml-label.c:855 src/xml-label-191.c:624 +#, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "Nodo erróneo en sección Data = \"%s\"" + +#: src/xml-label.c:1030 libglabels/xml-template.c:535 +msgid "Utf8 conversion error." +msgstr "Conversión UTF-8 errónea" + +#: src/xml-label.c:1037 libglabels/xml-template.c:542 +msgid "Problem saving xml file." +msgstr "Problemas al guardar archivo xml" + +#. This should always be an id, but just in case a name +#. slips by! +#: src/xml-label-191.c:699 libglabels/xml-template.c:199 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "Código \"%s\" de tamaño de página desconocido, intentando como nombre." + +#: src/xml-label-191.c:709 libglabels/xml-template.c:209 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "Código \"%s\" o nombre de página desconocido" + +#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 +msgid "None" +msgstr "Ninguno" + +#: src/merge-init.c:53 +msgid "Text file with comma delimeters (CSV)" +msgstr "Texto separado con comas" + +#: src/merge-init.c:60 +msgid "Text file with colon delimeters" +msgstr "Texto separado con dos puntos" + +#: src/merge-init.c:67 +msgid "Text file with tab delimeters" +msgstr "Texto separado con tabuladores" + +#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 +msgid "File:" +msgstr "Archivo:" + +#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 +msgid "Key:" +msgstr "Clave:" + +#: src/wdgt-print-copies.c:179 +msgid "Sheets:" +msgstr "Hojas:" + +#: src/wdgt-print-copies.c:197 +msgid "Labels" +msgstr "Etiquetas" + +#: src/wdgt-print-copies.c:200 +msgid "from:" +msgstr "desde:" + +#: src/wdgt-print-copies.c:207 +msgid "to:" +msgstr "hasta:" + +#: src/wdgt-print-merge.c:178 +msgid "Start on label" +msgstr "Comenzar en la etiqueta" + +#: src/wdgt-print-merge.c:186 +msgid "on 1st sheet" +msgstr "en la primera hoja" + +#: src/wdgt-print-merge.c:195 +msgid "Copies:" +msgstr "Copias:" + +#: src/wdgt-print-merge.c:201 +msgid "Collate" +msgstr "Intercalar" + +#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 +msgid "Description:" +msgstr "Descripción:" + +#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 +msgid "Page size:" +msgstr "Tamaño de la página:" + +#: src/wdgt-media-select.c:290 +msgid "Label size:" +msgstr "Tamaño de la etiqueta:" + +#: src/wdgt-media-select.c:301 +msgid "Layout:" +msgstr "Disposición:" + +#: src/wdgt-media-select.c:578 +#, c-format +msgid "%d x %d (%d per sheet)" +msgstr "%d x %d (%d por hoja)" + +#: src/wdgt-media-select.c:582 +#, c-format +msgid "%d per sheet" +msgstr "%d por hoja" + +#: src/wdgt-media-select.c:614 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +#: src/wdgt-media-select.c:619 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 +#, c-format +msgid "%s %s diameter" +msgstr "Diámetro %s %s" + +#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 +#, c-format +msgid "%.5g %s diameter" +msgstr "Diámetro %.5g %s" + +#: src/wdgt-rotate-label.c:193 +msgid "Rotate" +msgstr "Rotar" + +#. This is the default custom color +#: src/mygal/color-palette.c:396 +msgid "custom" +msgstr "personalizado" + +#. "Custom" color - we'll pop up a GnomeColorPicker +#: src/mygal/color-palette.c:438 +msgid "Custom Color:" +msgstr "Color personalizado:" + +#: src/mygal/color-palette.c:446 +msgid "Choose Custom Color" +msgstr "Elegir color:" + +#: src/mygal/color-palette.c:579 +msgid "black" +msgstr "negro" + +#: src/mygal/color-palette.c:580 +msgid "light brown" +msgstr "marrón" + +#: src/mygal/color-palette.c:581 +msgid "brown gold" +msgstr "marrón oscuro" + +#: src/mygal/color-palette.c:582 +msgid "dark green #2" +msgstr "verde oscuro #2" + +#: src/mygal/color-palette.c:583 +msgid "navy" +msgstr "azul metalizado" + +#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 +msgid "dark blue" +msgstr "azul muy oscuro" + +#: src/mygal/color-palette.c:585 +msgid "purple #2" +msgstr "azul oscuro" + +#: src/mygal/color-palette.c:586 +msgid "very dark gray" +msgstr "verde muy oscuro" + +#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 +msgid "dark red" +msgstr "rojo oscuro" + +#: src/mygal/color-palette.c:590 +msgid "red-orange" +msgstr "anaranjado" + +#: src/mygal/color-palette.c:591 +msgid "gold" +msgstr "marrón claro" + +#: src/mygal/color-palette.c:592 +msgid "dark green" +msgstr "verde oscuro" + +#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 +msgid "dull blue" +msgstr "verde azulado" + +#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 +msgid "blue" +msgstr "azul" + +#: src/mygal/color-palette.c:595 +msgid "dull purple" +msgstr "violeta azulado" + +#: src/mygal/color-palette.c:596 +msgid "dark grey" +msgstr "gris oscuro" + +#: src/mygal/color-palette.c:599 +msgid "red" +msgstr "rojo" + +#: src/mygal/color-palette.c:600 +msgid "orange" +msgstr "naranja" + +#: src/mygal/color-palette.c:601 +msgid "lime" +msgstr "lima" + +#: src/mygal/color-palette.c:602 +msgid "dull green" +msgstr "verde opaco" + +#: src/mygal/color-palette.c:603 +msgid "dull blue #2" +msgstr "cyan" + +#: src/mygal/color-palette.c:604 +msgid "sky blue #2" +msgstr "celeste" + +#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 +msgid "purple" +msgstr "violeta" + +#: src/mygal/color-palette.c:606 +msgid "gray" +msgstr "gris" + +#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 +msgid "magenta" +msgstr "fucsia" + +#: src/mygal/color-palette.c:610 +msgid "bright orange" +msgstr "naranja claro" + +#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 +msgid "yellow" +msgstr "amarillo" + +#: src/mygal/color-palette.c:612 +msgid "green" +msgstr "verde" + +#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 +msgid "cyan" +msgstr "turquesa" + +#: src/mygal/color-palette.c:614 +msgid "bright blue" +msgstr "azul claro" + +#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 +msgid "red purple" +msgstr "borravino" + +#: src/mygal/color-palette.c:616 +msgid "light grey" +msgstr "gris claro" + +#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 +msgid "pink" +msgstr "rosa" + +#: src/mygal/color-palette.c:620 +msgid "light orange" +msgstr "naranja claro" + +#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 +msgid "light yellow" +msgstr "amarillo claro" + +#: src/mygal/color-palette.c:622 +msgid "light green" +msgstr "verde claro" + +#: src/mygal/color-palette.c:623 +msgid "light cyan" +msgstr "turquesa claro" + +#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 +msgid "light blue" +msgstr "celeste claro" + +#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 +msgid "light purple" +msgstr "violeta claro" + +#: src/mygal/color-palette.c:626 +msgid "white" +msgstr "blanco" + +#: src/mygal/color-palette.c:631 +msgid "purplish blue" +msgstr "azul purpurado" + +#: src/mygal/color-palette.c:635 +msgid "dark purple" +msgstr "violeta oscuro" + +#: src/mygal/color-palette.c:637 +msgid "sky blue" +msgstr "celeste" + +#: libglabels/template.c:848 +#, c-format +msgid "Generic %s full page" +msgstr "Página completa genérica %s" + +#: libglabels/template.c:897 +msgid "No template files found!" +msgstr "No se encontraron archivos de plantilla!" + +#. Create and append an "Other" entry. +#: libglabels/paper.c:67 +msgid "Other" +msgstr "Otros" + +#: libglabels/paper.c:361 +msgid "No paper files found!" +msgstr "No se encontró tipo de papel!" + +#: data/ui/glabels-ui.xml.h:1 +msgid "About glabels" +msgstr "Acerca de glabels" + +#: data/ui/glabels-ui.xml.h:2 +msgid "About..." +msgstr "Acerca de..." + +#: data/ui/glabels-ui.xml.h:3 +msgid "Align _Horizontal" +msgstr "Alineado _horizontal" + +#: data/ui/glabels-ui.xml.h:4 +msgid "Align _Vertical" +msgstr "Alineado _vertical" + +#: data/ui/glabels-ui.xml.h:5 +msgid "Align objects to bottoms" +msgstr "Alinear objetos por su parte inferior" + +#: data/ui/glabels-ui.xml.h:6 +msgid "Align objects to horizontal centers" +msgstr "Alinear objetos por su centro" + +#: data/ui/glabels-ui.xml.h:7 +msgid "Align objects to left edges" +msgstr "Alinear objetos por su lado izquierdo" + +#: data/ui/glabels-ui.xml.h:8 +msgid "Align objects to right edges" +msgstr "Alinear objetos por su lado derecho" + +#: data/ui/glabels-ui.xml.h:9 +msgid "Align objects to tops" +msgstr "Alinear objetos por su parte superior" + +#: data/ui/glabels-ui.xml.h:10 +msgid "Align objects to vertical centers" +msgstr "Alinear objetos por su centro" + +#: data/ui/glabels-ui.xml.h:12 +msgid "Bold" +msgstr "Negrita" + +#: data/ui/glabels-ui.xml.h:14 +msgid "Center align" +msgstr "Centrado" + +#: data/ui/glabels-ui.xml.h:15 +msgid "Center objects to horizontal label center" +msgstr "Centrar objetos con el centro horizontal de la etiqueta" + +#: data/ui/glabels-ui.xml.h:16 +msgid "Center objects to vertical label center" +msgstr "Centrar objetos con el centro vertical de la etiqueta" + +#: data/ui/glabels-ui.xml.h:17 +msgid "Change the visibility of markup lines in the current window" +msgstr "Cambiar la visibilidad de los márgenes" + +#: data/ui/glabels-ui.xml.h:18 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "Cambiar la visibilidad de la barra de dibujo" + +#: data/ui/glabels-ui.xml.h:19 +msgid "Change the visibility of the grid in the current window" +msgstr "Cambiar la visibilidad de la grilla" + +#: data/ui/glabels-ui.xml.h:20 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "Cambiar la visibilidad de la barra principal" + +#: data/ui/glabels-ui.xml.h:21 +msgid "Change the visibility of the property toolbar in the current window" +msgstr "Cambiar la visibilidad de la barra de propiedades" + +#: data/ui/glabels-ui.xml.h:22 +msgid "Close" +msgstr "Cerrar" + +#: data/ui/glabels-ui.xml.h:23 +msgid "Close the current file" +msgstr "Guardar el archivo en uso" + +#: data/ui/glabels-ui.xml.h:24 +msgid "Configure the application" +msgstr "Configurar aplicación" + +#: data/ui/glabels-ui.xml.h:25 +msgid "Contents" +msgstr "Contenido" + +#: data/ui/glabels-ui.xml.h:26 +msgid "Copy" +msgstr "Copiar" + +#: data/ui/glabels-ui.xml.h:27 +msgid "Copy the selection" +msgstr "Copiar la selección" + +#: data/ui/glabels-ui.xml.h:28 +msgid "Create a custom template" +msgstr "Crear una plantilla personalizada" + +#: data/ui/glabels-ui.xml.h:29 +msgid "Create a new document" +msgstr "Crear un nuevo documento" + +#: data/ui/glabels-ui.xml.h:30 +msgid "Create barcode object" +msgstr "Crear un objeto código de barras" + +#: data/ui/glabels-ui.xml.h:31 +msgid "Create box/rectangle object" +msgstr "Crear un cuadrado o rectángulo" + +#: data/ui/glabels-ui.xml.h:32 +msgid "Create ellipse/circle object" +msgstr "Crear un círculo o elipse" + +#: data/ui/glabels-ui.xml.h:33 +msgid "Create image object" +msgstr "Crear una imagen" + +#: data/ui/glabels-ui.xml.h:34 +msgid "Create line object" +msgstr "Crear una línea" + +#: data/ui/glabels-ui.xml.h:35 +msgid "Create text object" +msgstr "Crear un cuadro de texto" + +#: data/ui/glabels-ui.xml.h:36 +msgid "Cu_t" +msgstr "Cor_tar" + +#: data/ui/glabels-ui.xml.h:37 +msgid "Customize" +msgstr "Personalizar" + +#: data/ui/glabels-ui.xml.h:38 +msgid "Customize Drawing Toolbar" +msgstr "Personalizar barra de dibujo" + +#: data/ui/glabels-ui.xml.h:39 +msgid "Customize Main Toolbar" +msgstr "Personalizar barra principal" + +#: data/ui/glabels-ui.xml.h:40 +msgid "Customize Property Toolbar" +msgstr "Personalizar barra de propiedades" + +#: data/ui/glabels-ui.xml.h:41 +msgid "Customize toolbars" +msgstr "Personalizar barras de herramientas" + +#: data/ui/glabels-ui.xml.h:42 +msgid "Cut" +msgstr "Cortar" + +#: data/ui/glabels-ui.xml.h:43 +msgid "Cut the selection" +msgstr "Cortar la selección" + +#: data/ui/glabels-ui.xml.h:44 +msgid "Decrease magnification" +msgstr "Reducir escala" + +#: data/ui/glabels-ui.xml.h:45 +msgid "Delete" +msgstr "Borrar" + +#: data/ui/glabels-ui.xml.h:46 +msgid "Delete the selected objects" +msgstr "Borrar los objetos seleccionados" + +#: data/ui/glabels-ui.xml.h:47 +msgid "Drawing toolbar" +msgstr "Barra de dibujo" + +#: data/ui/glabels-ui.xml.h:48 +msgid "Dump XML" +msgstr "Volcar XML" + +#: data/ui/glabels-ui.xml.h:49 +msgid "Dump the UI Xml description" +msgstr "Volcar la descripción UI XML" + +#: data/ui/glabels-ui.xml.h:50 +msgid "Edit merge properties" +msgstr "Editar propiedades de combinación de datos" + +#: data/ui/glabels-ui.xml.h:54 +msgid "Flip object horizontally" +msgstr "Reflejar objeto horizontalmente" + +#: data/ui/glabels-ui.xml.h:55 +msgid "Flip object vertically" +msgstr "Reflejar objeto verticalmente" + +#: data/ui/glabels-ui.xml.h:56 +msgid "Font name" +msgstr "Fuente" + +#: data/ui/glabels-ui.xml.h:57 +msgid "Font selector" +msgstr "Selección de fuentes" + +#: data/ui/glabels-ui.xml.h:58 +msgid "Font size" +msgstr "Tamaño de fuente" + +#: data/ui/glabels-ui.xml.h:59 +msgid "Icon and _Text" +msgstr "Icono y _texto" + +#: data/ui/glabels-ui.xml.h:60 +msgid "Increase magnification" +msgstr "Aumentar escala" + +#: data/ui/glabels-ui.xml.h:61 +msgid "Italic" +msgstr "Itálica" + +#: data/ui/glabels-ui.xml.h:63 +msgid "Left align" +msgstr "Alineación izquierda" + +#: data/ui/glabels-ui.xml.h:65 +msgid "Line width" +msgstr "Ancho de línea" + +#: data/ui/glabels-ui.xml.h:66 +msgid "Lower object to bottom" +msgstr "Llevar objeto al fondo" + +#: data/ui/glabels-ui.xml.h:67 +msgid "M_arkup" +msgstr "_Margen" + +#: data/ui/glabels-ui.xml.h:68 +msgid "Main toolbar" +msgstr "Barra principal" + +#: data/ui/glabels-ui.xml.h:69 +msgid "Markup" +msgstr "Margen" + +#: data/ui/glabels-ui.xml.h:70 +msgid "Modify document properties" +msgstr "Modificar las propiedades del documento" + +#: data/ui/glabels-ui.xml.h:71 +msgid "New" +msgstr "Nuevo" + +#: data/ui/glabels-ui.xml.h:72 +msgid "Object property editor" +msgstr "Editor de propiedades de objeto" + +#: data/ui/glabels-ui.xml.h:73 +msgid "Only show icons in the main toolbar" +msgstr "Sólo mostrar iconos en la barra principal" + +#: data/ui/glabels-ui.xml.h:75 +msgid "Open a file" +msgstr "Abrir un archivo" + +#: data/ui/glabels-ui.xml.h:76 +msgid "Open the glabels manual" +msgstr "Abrir el manual de glabels" + +#: data/ui/glabels-ui.xml.h:77 +msgid "Paste" +msgstr "Pegar" + +#: data/ui/glabels-ui.xml.h:78 +msgid "Paste the clipboard" +msgstr "Pegar desde portapapeles" + +#: data/ui/glabels-ui.xml.h:79 +msgid "Pr_eferences..." +msgstr "Pre_ferencias..." + +#: data/ui/glabels-ui.xml.h:80 +msgid "Preferences" +msgstr "Preferencias" + +#: data/ui/glabels-ui.xml.h:82 +msgid "Print the current file" +msgstr "Imprimir el archivo en uso" + +#: data/ui/glabels-ui.xml.h:83 +msgid "Proper_ties..." +msgstr "_Propiedades..." + +#: data/ui/glabels-ui.xml.h:84 +msgid "Properties" +msgstr "Propiedades" + +#: data/ui/glabels-ui.xml.h:85 +msgid "Property toolbar" +msgstr "Barra de propiedades" + +#: data/ui/glabels-ui.xml.h:86 +msgid "Quit" +msgstr "Salir" + +#: data/ui/glabels-ui.xml.h:87 +msgid "Quit the program" +msgstr "Salir del programa" + +#: data/ui/glabels-ui.xml.h:88 +msgid "Raise object to top" +msgstr "Traer al frente" + +#: data/ui/glabels-ui.xml.h:89 +msgid "Recent _Files" +msgstr "Archivos _recientes" + +#: data/ui/glabels-ui.xml.h:90 +msgid "Redo" +msgstr "Rehacer" + +#: data/ui/glabels-ui.xml.h:91 +msgid "Redo the undone action" +msgstr "Repetir la última acción" + +#: data/ui/glabels-ui.xml.h:92 +msgid "Remove all selections" +msgstr "Eliminar todas las selecciones" + +#: data/ui/glabels-ui.xml.h:94 +#, no-c-format +msgid "Restore scale to 100%" +msgstr "Restablecer escala al 100%" + +#: data/ui/glabels-ui.xml.h:95 +msgid "Right align" +msgstr "Alineación derecha" + +#: data/ui/glabels-ui.xml.h:98 +msgid "Rotate object 90 clockwise" +msgstr "Rotar 90 grados a la derecha" + +#: data/ui/glabels-ui.xml.h:99 +msgid "Rotate object 90 counter-clockwise" +msgstr "Rotar 90 grados a la izquierda" + +#: data/ui/glabels-ui.xml.h:100 +msgid "Save" +msgstr "Guardar" + +#: data/ui/glabels-ui.xml.h:101 +msgid "Save As" +msgstr "Guardar como" + +#: data/ui/glabels-ui.xml.h:102 +msgid "Save _As..." +msgstr "Guardar _como..." + +#: data/ui/glabels-ui.xml.h:103 +msgid "Save the current file" +msgstr "Guardar el archivo en uso" + +#: data/ui/glabels-ui.xml.h:104 +msgid "Save the current file with a different name" +msgstr "Guardar archivo con otro nombre" + +#: data/ui/glabels-ui.xml.h:105 +msgid "Select All" +msgstr "_Deseleccionar todo" + +#: data/ui/glabels-ui.xml.h:106 +msgid "Select _All" +msgstr "Seleccionar t_odo" + +#: data/ui/glabels-ui.xml.h:107 +msgid "Select all objects" +msgstr "Seleccionar todos los objetos" + +#: data/ui/glabels-ui.xml.h:108 +msgid "Select, move and modify objects" +msgstr "Seleccionar, mover y modificar objetos" + +#: data/ui/glabels-ui.xml.h:110 +msgid "Set main toolbar button style according to desktop default" +msgstr "" +"Establecer apariencia de la barra principal según estilo predeterminado del " +"escitorio" + +#: data/ui/glabels-ui.xml.h:111 +msgid "Show _Tooltips" +msgstr "Mostrar indicadores" + +#: data/ui/glabels-ui.xml.h:112 +msgid "Show both icons and texts in the main toolbar" +msgstr "Mostrar iconos y texto en la barra principal" + +#: data/ui/glabels-ui.xml.h:113 +msgid "Show tooltips in the drawing toolbar" +msgstr "Mostrar indicadores en la barra de dibujo" + +#: data/ui/glabels-ui.xml.h:114 +msgid "Show tooltips in the main toolbar" +msgstr "Mostrar indicadores en la barra principal" + +#: data/ui/glabels-ui.xml.h:115 +msgid "Show tooltips in the property toolbar" +msgstr "Mostrar indicadores en la barra de propiedades" + +#: data/ui/glabels-ui.xml.h:116 +msgid "Template Designer" +msgstr "Diseñador de plantillas" + +#: data/ui/glabels-ui.xml.h:117 +msgid "Template _Designer..." +msgstr "_Diseñador de plantillas" + +#: data/ui/glabels-ui.xml.h:118 +msgid "Text color" +msgstr "Color de texto" + +#: data/ui/glabels-ui.xml.h:119 +msgid "U_n-select All" +msgstr "_Deseleccionar todo" + +#: data/ui/glabels-ui.xml.h:120 +msgid "Un-select All" +msgstr "Deseleccionar todo" + +#: data/ui/glabels-ui.xml.h:121 +msgid "Undo" +msgstr "Deshacer" + +#: data/ui/glabels-ui.xml.h:122 +msgid "Undo the last action" +msgstr "Deshcar la última acción" + +#: data/ui/glabels-ui.xml.h:123 +msgid "Zoom _1:1" +msgstr "Escala _1:1" + +#: data/ui/glabels-ui.xml.h:124 +msgid "Zoom _In" +msgstr "_Ampliar" + +#: data/ui/glabels-ui.xml.h:125 +msgid "Zoom _Out" +msgstr "_Reducir" + +#: data/ui/glabels-ui.xml.h:126 +msgid "Zoom to _fit" +msgstr "A_justar" + +#: data/ui/glabels-ui.xml.h:127 +msgid "Zoom to fit window" +msgstr "Ampliar hasta ajustar" + +#: data/ui/glabels-ui.xml.h:128 +msgid "_About..." +msgstr "_Acerca de..." + +# REVISAR +#: data/ui/glabels-ui.xml.h:129 +msgid "_Bottoms" +msgstr "" + +#: data/ui/glabels-ui.xml.h:132 +msgid "_Close" +msgstr "_Cerrar" + +#: data/ui/glabels-ui.xml.h:133 +msgid "_Contents" +msgstr "_Contenido" + +#: data/ui/glabels-ui.xml.h:134 +msgid "_Copy" +msgstr "_Copiar" + +#: data/ui/glabels-ui.xml.h:135 +msgid "_Create Object" +msgstr "Crear _objeto" + +#: data/ui/glabels-ui.xml.h:136 +msgid "_Debug" +msgstr "_Depurar" + +#: data/ui/glabels-ui.xml.h:138 +msgid "_Desktop Default" +msgstr "_Predeterminado del escritorio" + +#: data/ui/glabels-ui.xml.h:139 +msgid "_Drawing Toolbar" +msgstr "Barra de dibujo" + +#: data/ui/glabels-ui.xml.h:140 +msgid "_Edit" +msgstr "_Editar" + +#: data/ui/glabels-ui.xml.h:142 +msgid "_File" +msgstr "_Archivo" + +#: data/ui/glabels-ui.xml.h:143 +msgid "_Grid" +msgstr "_Grilla" + +#: data/ui/glabels-ui.xml.h:144 +msgid "_Help" +msgstr "A_yuda" + +#: data/ui/glabels-ui.xml.h:145 +msgid "_Icon" +msgstr "_Icono" + +#: data/ui/glabels-ui.xml.h:149 +msgid "_Main Toolbar" +msgstr "Barra principal" + +#: data/ui/glabels-ui.xml.h:150 +msgid "_Merge Properties..." +msgstr "Propiedades de _combinación de datos" + +#: data/ui/glabels-ui.xml.h:151 +msgid "_New" +msgstr "_Nuevo" + +#: data/ui/glabels-ui.xml.h:152 +msgid "_Objects" +msgstr "_Objetos" + +#: data/ui/glabels-ui.xml.h:153 +msgid "_Open..." +msgstr "_Abrir..." + +#: data/ui/glabels-ui.xml.h:155 +msgid "_Paste" +msgstr "_Pegar" + +#: data/ui/glabels-ui.xml.h:156 +msgid "_Print..." +msgstr "_Imprimir" + +#: data/ui/glabels-ui.xml.h:157 +msgid "_Property Toolbar" +msgstr "Barra de propedades" + +#: data/ui/glabels-ui.xml.h:158 +msgid "_Quit" +msgstr "_Salir" + +#: data/ui/glabels-ui.xml.h:161 +msgid "_Save" +msgstr "_Guardar" + +#: data/ui/glabels-ui.xml.h:165 +msgid "_View" +msgstr "_Ver" + +#: data/glade/prefs-dialog.glade.h:1 +msgid " " +msgstr " " + +#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 +#: data/glade/template-designer.glade.h:5 +msgid "*" +msgstr "*" + +#: data/glade/prefs-dialog.glade.h:3 +msgid "Default page size" +msgstr "Tamaño de página predeterminado" + +#: data/glade/prefs-dialog.glade.h:4 +msgid "Fill" +msgstr "Relleno" + +#: data/glade/prefs-dialog.glade.h:5 +msgid "Line" +msgstr "Línea" + +#: data/glade/prefs-dialog.glade.h:6 +msgid "Text" +msgstr "Texto" + +#: data/glade/prefs-dialog.glade.h:7 +msgid "Units" +msgstr "Medidas" + +#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 +msgid "Alignment:" +msgstr "Alineación:" + +#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 +msgid "Color:" +msgstr "Color:" + +#: data/glade/prefs-dialog.glade.h:10 +msgid "Font:" +msgstr "Fuente:" + +#: data/glade/prefs-dialog.glade.h:11 +msgid "ISO A4" +msgstr "ISO A4" + +#: data/glade/prefs-dialog.glade.h:12 +msgid "Inches" +msgstr "Pulgadas" + +#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 +msgid "Line Spacing:" +msgstr "Espaciado:" + +#: data/glade/prefs-dialog.glade.h:14 +msgid "Locale" +msgstr "Documento" + +#: data/glade/prefs-dialog.glade.h:15 +msgid "Millimeters" +msgstr "Milímetros" + +#: data/glade/prefs-dialog.glade.h:16 +msgid "Object defaults" +msgstr "Objetos" + +#: data/glade/prefs-dialog.glade.h:17 +msgid "Points" +msgstr "Puntos" + +#: data/glade/prefs-dialog.glade.h:18 +msgid "Select default properties for new objects." +msgstr "Seleccione las propiedades predeterminadoas para los nuevos objetos." + +#: data/glade/prefs-dialog.glade.h:19 +msgid "Select locale specific behavior." +msgstr "Seleccione las propiedades del documento." + +#. Most popular (at top of list) +#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:29 +msgid "US Letter" +msgstr "Carta" + +#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 +#: data/glade/template-designer.glade.h:72 +msgid "Width:" +msgstr "Ancho:" + +#: data/glade/object-editor.glade.h:2 +msgid "00000000000 00000" +msgstr "00000000000 00000" + +#: data/glade/object-editor.glade.h:3 +msgid "Xxx object properties" +msgstr "" +"Propiedades de objecto xxx" + +#: data/glade/object-editor.glade.h:5 +msgid "Allow merge to automatically shrink text" +msgstr "Permitir ampliar texto automáticamente" + +#: data/glade/object-editor.glade.h:6 +msgid "Angle:" +msgstr "Ángulo:" + +#: data/glade/object-editor.glade.h:7 +msgid "Checksum" +msgstr "Verificación" + +#: data/glade/object-editor.glade.h:10 +msgid "Family:" +msgstr "Familia:" + +#: data/glade/object-editor.glade.h:12 +msgid "Fill" +msgstr "Relleno" + +#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 +msgid "Height:" +msgstr "Alto:" + +#: data/glade/object-editor.glade.h:14 +msgid "Image" +msgstr "Imagen" + +#: data/glade/object-editor.glade.h:15 +msgid "Insert merge field" +msgstr "Insertar campo para combinar" + +#: data/glade/object-editor.glade.h:17 +msgid "Length:" +msgstr "Longitud:" + +#: data/glade/object-editor.glade.h:18 +msgid "Line" +msgstr "Línea" + +#: data/glade/object-editor.glade.h:20 +msgid "Literal:" +msgstr "Literal:" + +#: data/glade/object-editor.glade.h:21 +msgid "Load image" +msgstr "Cargar imagen" + +#: data/glade/object-editor.glade.h:22 +msgid "Position" +msgstr "Posición" + +#: data/glade/object-editor.glade.h:23 +msgid "Reset image size" +msgstr "Restablecer el tamaño de la imagen" + +#: data/glade/object-editor.glade.h:24 +msgid "Size" +msgstr "Tamaño" + +#: data/glade/object-editor.glade.h:25 +msgid "Size:" +msgstr "Tamaño:" + +#: data/glade/object-editor.glade.h:26 +msgid "Style" +msgstr "Estilo" + +#: data/glade/object-editor.glade.h:27 +msgid "Style:" +msgstr "Estilo:" + +#: data/glade/object-editor.glade.h:30 +msgid "X:" +msgstr "X:" + +#: data/glade/object-editor.glade.h:31 +msgid "Y:" +msgstr "Y:" + +#: data/glade/object-editor.glade.h:32 +msgid "degrees" +msgstr "grados" + +#: data/glade/object-editor.glade.h:33 +msgid "dialog1" +msgstr "dialogo1" + +#: data/glade/object-editor.glade.h:34 +msgid "digits:" +msgstr "dígitos:" + +#: data/glade/object-editor.glade.h:35 +msgid "format:" +msgstr "Formato:" + +#: data/glade/template-designer.glade.h:1 +msgid " " +msgstr " " + +#: data/glade/template-designer.glade.h:2 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "(por ej., \"Etiquetas para correo,\" \"Tarjetas de negocio,\" ...)" + +#: data/glade/template-designer.glade.h:3 +msgid "(e.g., 8163A)" +msgstr "(por ej., 8163A)" + +#: data/glade/template-designer.glade.h:4 +msgid "(e.g., Avery, Acme, ...)" +msgstr "(por ej., Avery, Acme, ...)" + +#: data/glade/template-designer.glade.h:6 +msgid "1. Outer radius:" +msgstr "1. Radio externo:" + +#: data/glade/template-designer.glade.h:7 +msgid "1. Radius:" +msgstr "1. Radio:" + +#: data/glade/template-designer.glade.h:8 +msgid "1. Width:" +msgstr "1. Ancho:" + +#: data/glade/template-designer.glade.h:9 +msgid "2. Height:" +msgstr "2. Alto:" + +#: data/glade/template-designer.glade.h:10 +msgid "2. Inner radius:" +msgstr "2. Radio interno:" + +#: data/glade/template-designer.glade.h:11 +msgid "2. Waste (overprint allowed):" +msgstr "2. Sobrante (sobreimpresión permitida):" + +#: data/glade/template-designer.glade.h:12 +msgid "3. Clipping width:" +msgstr "3. Ancho de recorte:" + +#: data/glade/template-designer.glade.h:13 +msgid "3. Margin" +msgstr "3. Márgen" + +#: data/glade/template-designer.glade.h:14 +msgid "3. Round (radius of corner):" +msgstr "3. Redondez (radio de las esquinas)" + +#: data/glade/template-designer.glade.h:15 +msgid "4. Clipping height:" +msgstr "4. Alto de recorte:" + +#: data/glade/template-designer.glade.h:16 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "4. Sobrante horizontal (sobreimpresión permitida):" + +#: data/glade/template-designer.glade.h:17 +msgid "5. Vert. waste (overprint allowed):" +msgstr "5. Sobrante vertical (sobreimpresión permitida):" + +#: data/glade/template-designer.glade.h:18 +msgid "5. Waste (overprint allowed):" +msgstr "5. Sobrante (sobreimpresión permitida):" + +#: data/glade/template-designer.glade.h:19 +msgid "6. Margin" +msgstr "6. Margen" + +#: data/glade/template-designer.glade.h:20 +msgid "Brand/Manufacturer:" +msgstr "Marca/Fabricante:" + +#: data/glade/template-designer.glade.h:21 +msgid "CD/DVD (including credit card CDs)" +msgstr "CD/DVD (incluyendo CD-tarjeta)" + +#: data/glade/template-designer.glade.h:22 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "" +"Fecilitaciones!\n" +" \n" +"Ha completado la plantilla.\n" +"Si desea guardar su diseño pulse en \"Aplicar\".\n" +" \n" +"Puede pulsar \"Cancelar\" para abandonar su diseño\n" +"o \"Atrás\" para volver a editarlo." + +#: data/glade/template-designer.glade.h:30 +msgid "Design Completed" +msgstr "Diseño completo" + +#: data/glade/template-designer.glade.h:31 +msgid "Distance from left edge (x0):" +msgstr "Distancia desde el borde izquierdo (x0):" + +#: data/glade/template-designer.glade.h:32 +msgid "Distance from top edge (y0):" +msgstr "Distancia desde el borde superior (y0):" + +#: data/glade/template-designer.glade.h:34 +msgid "Horizontal pitch (dx):" +msgstr "Desplazamiento horizontal (dx):" + +#: data/glade/template-designer.glade.h:35 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" +"¿Cuantas disposiciones tendrá su plantilla?\n" +"\n" +"Una disposición es un conjunto de etiquetas o tarjetas que se pueden ordenar " +"en una hoja.\n" +"La mayoría de las plantillas necesitan solo una disposición, como en el " +"primer ejemplo.\n" +"El segundo ejemplo muestra dos disposiciones." + +#: data/glade/template-designer.glade.h:40 +msgid "Label Size (CD/DVD)" +msgstr "Tamaño de etiqueta (CD/DVD)" + +#: data/glade/template-designer.glade.h:41 +msgid "Label Size (Round)" +msgstr "Tamaño de etiqueta (Redondeada):" + +#: data/glade/template-designer.glade.h:42 +msgid "Label or Card Shape" +msgstr "Forma de etiqueta o tarjeta" + +#: data/glade/template-designer.glade.h:43 +msgid "Label or Card Size (Rectangular)" +msgstr "Tamaño de etiqueta o tarjeta (rectangular)" + +#: data/glade/template-designer.glade.h:44 +msgid "Layout #1" +msgstr "Disposición 1:" + +#: data/glade/template-designer.glade.h:45 +msgid "Layout #2" +msgstr "Disposición 2:" + +#: data/glade/template-designer.glade.h:46 +msgid "Layout(s)" +msgstr "Disposicion(es):" + +#: data/glade/template-designer.glade.h:47 +msgid "Name and Description" +msgstr "Nombre y descripción:" + +#: data/glade/template-designer.glade.h:48 +msgid "Number across (nx):" +msgstr "Cantidad horizontal (nx):" + +#: data/glade/template-designer.glade.h:49 +msgid "Number down (ny):" +msgstr "Cantidad vertical (ny):" + +#: data/glade/template-designer.glade.h:50 +msgid "Number of Layouts" +msgstr "Cantidad de disposiciones" + +#: data/glade/template-designer.glade.h:51 +msgid "Number of layouts:" +msgstr "Cantidad de disposiciones:" + +#: data/glade/template-designer.glade.h:52 +msgid "Page Size" +msgstr "Tamaño de la página" + +#: data/glade/template-designer.glade.h:54 +msgid "Part #:" +msgstr "Número de parte:" + +#: data/glade/template-designer.glade.h:55 +msgid "" +"Please enter the following identifying information about the template " +"stationery." +msgstr "" +"Por favor ingrese la siguiente información que identifique la plantilla." + +#: data/glade/template-designer.glade.h:56 +msgid "Please enter the following layout information." +msgstr "Por favor ingrese la siguiente información sobre la disposición." + +#: data/glade/template-designer.glade.h:57 +msgid "" +"Please enter the following size parameters of a single label in your " +"template." +msgstr "Por favor ingrese las medidas de cada etiqueta de su plantilla." + +#: data/glade/template-designer.glade.h:58 +msgid "" +"Please enter the following size parameters of a single label or card in your " +"template." +msgstr "" +"Por favor ingrese los siguientes parámetros de tamaño para cada etiqueta en " +"su plantilla." + +#: data/glade/template-designer.glade.h:59 +msgid "Please select the basic shape of the labels or cards." +msgstr "Por favor seleccione la forma básica de las etiquetas o tarjetas." + +#: data/glade/template-designer.glade.h:60 +msgid "Please select the page size of the template stationery." +msgstr "Por favor seleccione el tamaño de la página para la plantilla." + +#: data/glade/template-designer.glade.h:61 +msgid "Print test sheet" +msgstr "Imprimir página de prueba" + +#: data/glade/template-designer.glade.h:62 +msgid "Rectangular or square (can have rounded corners)" +msgstr "Rectangular o cuadrada (puede tener bordes redondeados)" + +#: data/glade/template-designer.glade.h:63 +msgid "Round" +msgstr "Redonda" + +#: data/glade/template-designer.glade.h:64 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" +"Plantillas que necesitan\n" +"dos disposiciones." + +#: data/glade/template-designer.glade.h:66 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" +"Plantillas que necesitan\n" +"una disposición." + +#: data/glade/template-designer.glade.h:68 +msgid "Vertical pitch (dy):" +msgstr "Desplazamiento vertical (dy):" + +#: data/glade/template-designer.glade.h:69 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" +"Bienvenido al diseñador de plantillas de gLabels.\n" +"\n" +"Este diálogo le asistirá en la creación de una plantilla personalizada." + +#. Other ISO A series sizes +#: data/templates/paper-sizes.xml.h:2 +msgid "A0" +msgstr "A0" + +#: data/templates/paper-sizes.xml.h:3 +msgid "A1" +msgstr "A1" + +#: data/templates/paper-sizes.xml.h:4 +msgid "A10" +msgstr "A10" + +#: data/templates/paper-sizes.xml.h:5 +msgid "A2" +msgstr "A2" + +#: data/templates/paper-sizes.xml.h:6 +msgid "A3" +msgstr "A3" + +#: data/templates/paper-sizes.xml.h:7 +msgid "A4" +msgstr "A4" + +#: data/templates/paper-sizes.xml.h:8 +msgid "A5" +msgstr "A5" + +#: data/templates/paper-sizes.xml.h:9 +msgid "A6" +msgstr "A6" + +#: data/templates/paper-sizes.xml.h:10 +msgid "A7" +msgstr "A7" + +#: data/templates/paper-sizes.xml.h:11 +msgid "A8" +msgstr "A8" + +#: data/templates/paper-sizes.xml.h:12 +msgid "A9" +msgstr "A9" + +#. ISO B series sizes +#: data/templates/paper-sizes.xml.h:14 +msgid "B0" +msgstr "B0" + +#: data/templates/paper-sizes.xml.h:15 +msgid "B1" +msgstr "B1" + +#: data/templates/paper-sizes.xml.h:16 +msgid "B10" +msgstr "B10" + +#: data/templates/paper-sizes.xml.h:17 +msgid "B2" +msgstr "B2" + +#: data/templates/paper-sizes.xml.h:18 +msgid "B3" +msgstr "B3" + +#: data/templates/paper-sizes.xml.h:19 +msgid "B4" +msgstr "B4" + +#: data/templates/paper-sizes.xml.h:20 +msgid "B5" +msgstr "B5" + +#: data/templates/paper-sizes.xml.h:21 +msgid "B6" +msgstr "B6" + +#: data/templates/paper-sizes.xml.h:22 +msgid "B7" +msgstr "B7" + +#: data/templates/paper-sizes.xml.h:23 +msgid "B8" +msgstr "B8" + +#: data/templates/paper-sizes.xml.h:24 +msgid "B9" +msgstr "B9" + +#: data/templates/paper-sizes.xml.h:25 +msgid "US Executive" +msgstr "Ejecutivo" + +#. Other US paper sizes +#: data/templates/paper-sizes.xml.h:27 +msgid "US Legal" +msgstr "Legal" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:2 +#: data/templates/zweckform-iso-templates.xml.h:2 +msgid "Address Labels" +msgstr "Etiquetas de dirección" + +#. =================================================================== +#. ============================================================ +#. =================================================================== +#. ====================================================== +#: data/templates/avery-us-templates.xml.h:4 +#: data/templates/avery-iso-templates.xml.h:4 +#: data/templates/zweckform-iso-templates.xml.h:6 +#: data/templates/misc-us-templates.xml.h:3 +#: data/templates/misc-iso-templates.xml.h:17 +msgid "Business Cards" +msgstr "Tarjetas de negocio" + +#: data/templates/avery-us-templates.xml.h:5 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "Etiquetas de CD/DVD" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:7 +msgid "Diskette Labels" +msgstr "Etiquetas de diskettes" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:9 +msgid "Filing Labels" +msgstr "Etiquetas para archivado" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:11 +msgid "Full Sheet Labels" +msgstr "Etiquetas de página completa" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:13 +msgid "Large Round Labels" +msgstr "Etiquetas redondeadas grandes" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:15 +msgid "Name Badge Labels" +msgstr "Etiquetas de distintivos" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:17 +msgid "Return Address Labels" +msgstr "Etiquetas de dirección de remitente" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:19 +msgid "Shipping Labels" +msgstr "Etiquetas de envío" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:21 +msgid "Small Round Labels" +msgstr "Etiquetas redondeadas pequeñas" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:23 +msgid "Square Labels" +msgstr "Etiquetas cuadradas" + +#: data/templates/avery-us-templates.xml.h:24 +msgid "Video Tape Face Labels" +msgstr "Etiquetas de video (frente)" + +#: data/templates/avery-us-templates.xml.h:25 +msgid "Video Tape Spine Labels" +msgstr "Etiquetas de video (lateral)" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:2 +msgid "Address labels" +msgstr "Etiquetas de dirección" + +#. =============================================================== +#: data/templates/avery-iso-templates.xml.h:6 +msgid "CD Booklet" +msgstr "Tapa de CD" + +#. =============================================================== +#: data/templates/avery-iso-templates.xml.h:8 +msgid "CD Inlet" +msgstr "Interior de CD" + +#. =============================================================== +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:10 +#: data/templates/zweckform-iso-templates.xml.h:8 +#: data/templates/misc-us-templates.xml.h:5 +#: data/templates/misc-iso-templates.xml.h:21 +msgid "CD/DVD Labels" +msgstr "Etiquetas de CD/DVD" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:12 +msgid "Diskette labels" +msgstr "Etiquetas de disquette" + +#. =============================================================== +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:14 +#: data/templates/zweckform-iso-templates.xml.h:14 +#: data/templates/misc-iso-templates.xml.h:35 +msgid "Mailing Labels" +msgstr "Etiquetas de correo" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:16 +msgid "Mailing labels" +msgstr "Etiquetas de correo" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:18 +msgid "Mini Address Labels" +msgstr "Etiquetas de dirección pequeñas" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:20 +msgid "Shipping labels" +msgstr "Etiquetas de envío" + +# REVISAR +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:4 +msgid "Allround Labels" +msgstr "" + +# REVISAR +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:10 +msgid "Correction and Cover-up Labels" +msgstr "" + +# REVISAR +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:12 +msgid "Lever Arch File Labels" +msgstr "" + +# REVISAR +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:16 +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "" + +# REVISAR +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:18 +msgid "Rectangular Copier Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:20 +#: data/templates/misc-iso-templates.xml.h:44 +msgid "Rectangular Labels" +msgstr "Etiquetas rectangulares" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:22 +msgid "Video Labels (back)" +msgstr "Etiquetas de video (dorso)" + +#: data/templates/misc-us-templates.xml.h:1 +msgid "Business Card CD" +msgstr "CD-tarjeta" + +# REVISAR +#: data/templates/misc-us-templates.xml.h:4 +msgid "CD Template Rectangles" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:6 +msgid "CD/DVD Labels (Face Only)" +msgstr "Etiquetas CD/DVD (Sólo frente)" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:7 +#: data/templates/misc-iso-templates.xml.h:23 +msgid "CD/DVD Labels (face only)" +msgstr "Etiquetas CD/DVD (sólo frente)" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:9 +msgid "Cassette Labels" +msgstr "Etiquetas de casette" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:11 +msgid "DLT Labels" +msgstr "Etiquetas DLT" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:13 +msgid "Microtube labels" +msgstr "Etiquetas microtubo" + +#: data/templates/misc-us-templates.xml.h:14 +msgid "Mini-CD Labels" +msgstr "Etiquetas Mini-CD" + +# REVISAR +#: data/templates/misc-us-templates.xml.h:15 +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "" + +# REVISAR +#: data/templates/misc-us-templates.xml.h:16 +msgid "PRO CD Labels 2-up (Face only)" +msgstr "" + +# REVISAR +#: data/templates/misc-us-templates.xml.h:17 +#: data/templates/misc-iso-templates.xml.h:42 +msgid "PRO CD Labels 2-up (face only)" +msgstr "" + +# REVISAR +#: data/templates/misc-us-templates.xml.h:18 +msgid "Slimline CD Case (rightside up)" +msgstr "" + +# REVISAR +#: data/templates/misc-us-templates.xml.h:19 +msgid "Slimline CD Case (upside down)" +msgstr "" + +# REVISAR +#: data/templates/misc-iso-templates.xml.h:1 +msgid "Agipa 119488: Business Cards" +msgstr "" + +# REVISAR +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:3 +msgid "Allround Labels --24" +msgstr "" + +# REVISAR +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:5 +msgid "Allround Labels --44" +msgstr "" + +# REVISAR +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:7 +msgid "Allround Labels --64" +msgstr "" + +# REVISAR +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:9 +msgid "Allround Labels --65" +msgstr "" + +# REVISAR +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:11 +msgid "Arch File Labels" +msgstr "" + +# REVISAR +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:13 +msgid "Arch File Labels (large)" +msgstr "" + +# REVISAR +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:15 +msgid "Arch File Labels (small)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:19 +msgid "CD Labels" +msgstr "Etiquetas para CD" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:25 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "Etieuats CD/DVD Formato estándar (sólo frente)" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:27 +msgid "Diskette Labels (face only)" +msgstr "Etiquetas para disquette (sólo cara)" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:29 +msgid "EPSON Photo Stickers 16" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:31 +msgid "Etiketten" +msgstr "Etiketten" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:33 +msgid "Fridge Magnet Stickers" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:37 +msgid "Mailing Labels --14" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:39 +msgid "Mailing Labels-2 columns" +msgstr "Etiquetas de correo - 2 columnas" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:41 +msgid "Mailing Labels-3 columns" +msgstr "Etiquetas de correo - 3 columnas" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:46 +msgid "Video Labels (face only)" +msgstr "Etiqeutas de video (solo frente)" + +#: data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers" +msgstr "Crear etiquetas, tarjetas de negocios y portadas" + +#: data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "Diseñador de etiquetas gLabels" + +#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 +msgid "gLabels Project File" +msgstr "Archivo de projecto gLabels" + +#, fuzzy +#~ msgid "Object _Properties..." +#~ msgstr "Propiedades del texto" + +#~ msgid "Display units" +#~ msgstr "Mostrar unidades de medida" + +#~ msgid "Default page size" +#~ msgstr "Tamaño de página por omisión" + +#~ msgid "Outline" +#~ msgstr "Contorno" + +#~ msgid "Edit line object properties" +#~ msgstr "Modificar las propiedades del objeto línea" + +#~ msgid "Edit text object properties" +#~ msgstr "Modificar las propiedades del objeto texto" + +#~ msgid "Maintain current aspect ratio" +#~ msgstr "Mantener la proporción actual del aspecto" + +#, fuzzy +#~ msgid "Open %s" +#~ msgstr "Abrir" + +#~ msgid "Revert to saved copy of %s?" +#~ msgstr "¿ Recuperar la copia salvada de %s ?" + +#~ msgid "Unknown media type. Using default." +#~ msgstr "Tipo de papel desconocido. Utilizando el tipo por omisión." + +#~ msgid "" +#~ "``%s'' has been modified.\n" +#~ "\n" +#~ "Do you wish to save it?" +#~ msgstr "" +#~ "\"%s\" ha sido modificado.\n" +#~ "\n" +#~ "¿ Desea salvarlo ?" + +#~ msgid "Close / Save label as" +#~ msgstr "Cerrar / Salvar etiqueta como" + +#~ msgid "Label no longer valid!" +#~ msgstr "¡ La etiqueta ya no es válida !" + +#~ msgid "Error writing file" +#~ msgstr "Error salvando el archivo" + +#~ msgid "Edit properties..." +#~ msgstr "Modificar propiedades" + +#~ msgid "Appearance" +#~ msgstr "Apariencia" + +#~ msgid "Position/Size" +#~ msgstr "Posición/Tamaño" + +#~ msgid "Image format not currently supported" +#~ msgstr "Formato de imagen no soportado actualmente" + +#~ msgid "Barcode data" +#~ msgstr "Datos del código de barras" + +#~ msgid "%" +#~ msgstr "%" + +#~ msgid "Show text with barcode" +#~ msgstr "Mostrar texto con código de barras" + +#~ msgid "Fields" +#~ msgstr "Campos" + +#~ msgid "Column" +#~ msgstr "Columna" + +#~ msgid "Sample data" +#~ msgstr "Datos de ejemplo" + +#~ msgid "Make a new, empty label" +#~ msgstr "Crear una etiqueta vacía nueva" + +#~ msgid " New " +#~ msgstr "Nuevo" + +#~ msgid "New Label/Card" +#~ msgstr "Nueva tarjeta/etiqueta" + +#~ msgid " Open " +#~ msgstr " Abrir " + +#~ msgid " Save " +#~ msgstr " Guardar " + +#~ msgid " Print " +#~ msgstr " Imprimir " + +#~ msgid "Function is not implemented!" +#~ msgstr "¡ La funcionalidad no está aún implementada !" diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 00000000..c7476e04 --- /dev/null +++ b/po/fr.po @@ -0,0 +1,3311 @@ +# French translation of glabels. +# Copyright (C) 2001 Jim Evins +# Olivier Berger +# Florent Morel , 2001, 2004 +# +msgid "" +msgstr "" +"Project-Id-Version: glabels 2.0.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-06-14 15:22+0200\n" +"PO-Revision-Date: 2007-06-14 16:59+0200\n" +"Last-Translator: Claude Paroz \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../src/glabels.c:76 ../src/glabels-batch.c:70 +msgid "[FILE...]" +msgstr "[FICHIER...]" + +#: ../src/glabels.c:92 +msgid "- gLabels label designer" +msgstr "- créateur de patrons gLabels" + +#: ../src/glabels-batch.c:54 +msgid "set output filename (default=\"output.pdf\")" +msgstr "définit le fichier de sortie (défaut=\"output.pdf\")" + +#: ../src/glabels-batch.c:54 ../src/glabels-batch.c:68 +msgid "filename" +msgstr "nom de fichier" + +#: ../src/glabels-batch.c:56 +msgid "number of sheets (default=1)" +msgstr "nombre de pages (défaut=1)" + +# src/print_copies.c:193 +# src/print_copies.c:193 +# src/print_copies.c:171 +# src/print_copies.c:170 +#: ../src/glabels-batch.c:56 +msgid "sheets" +msgstr "feuilles" + +#: ../src/glabels-batch.c:58 +msgid "number of copies (default=1)" +msgstr "nombre de copies (défaut=1)" + +# src/print.c:153 +# src/print.c:153 +# src/print.c:146 +# src/print_dialog.c:104 +#: ../src/glabels-batch.c:58 +msgid "copies" +msgstr "copies" + +#: ../src/glabels-batch.c:60 +msgid "first label on first sheet (default=1)" +msgstr "première étiquette sur la première page (défaut=1)" + +#: ../src/glabels-batch.c:60 +msgid "first" +msgstr "première" + +# src/print.c:180 +# src/print.c:180 +# src/print.c:196 +# src/print_dialog.c:152 +#: ../src/glabels-batch.c:62 ../data/glade/print-custom-widget.glade.h:6 +msgid "print outlines (to test printer alignment)" +msgstr "imprimer des bordures (pour tester l'alignement de l'imprimante)" + +# src/print_dialog.c:160 +#: ../src/glabels-batch.c:64 ../data/glade/print-custom-widget.glade.h:5 +msgid "print in reverse (i.e. a mirror image)" +msgstr "imprimer à l'envers (i.e. une image miroir)" + +#: ../src/glabels-batch.c:66 ../data/glade/print-custom-widget.glade.h:4 +msgid "print crop marks" +msgstr "imprimer les guides de coupe" + +#: ../src/glabels-batch.c:68 +msgid "input file for merging" +msgstr "fichier d'entrée pour la fusion" + +#: ../src/glabels-batch.c:96 +msgid "- batch process gLabels label files" +msgstr "- traitement par lots de fichiers d'étiquettes gLabels" + +# src/file.c:214 +# src/file.c:214 +# src/file.c:249 +# src/file.c:249 +#: ../src/glabels-batch.c:142 +#, c-format +msgid "cannot perform document merge with glabels file %s\n" +msgstr "impossible d'effectuer une fusion de document avec le fichier glabels %s\n" + +# src/file.c:214 +# src/file.c:214 +# src/file.c:249 +# src/file.c:249 +#: ../src/glabels-batch.c:164 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "impossible d'ouvrir le fichier glabels %s\n" + +#: ../src/window.c:259 +msgid "(none) - gLabels" +msgstr "(vide) - gLabels" + +#: ../src/window.c:432 +msgid "(modified)" +msgstr "(modifié)" + +# src/display.c:1157 src/display.c:1205 +# src/display.c:1160 src/display.c:1208 +# src/menu.c:94 +# src/menu.c:94 +#: ../src/stock.c:72 +msgid "_Select Mode" +msgstr "Mode _sélection" + +# src/item_text.c:442 src/item_text.c:627 +# src/item_text.c:442 src/item_text.c:627 +# src/item_text.c:460 src/item_text.c:464 src/item_text.c:637 src/menu.c:100 +# src/item_text.c:460 src/item_text.c:464 src/item_text.c:637 src/menu.c:100 +#: ../src/stock.c:73 +msgid "_Text" +msgstr "_Texte" + +# src/item_line.c:271 +# src/item_line.c:271 +# src/item_line.c:256 src/menu.c:106 +# src/item_line.c:256 src/menu.c:106 +#: ../src/stock.c:74 +msgid "_Line" +msgstr "_Ligne" + +# src/menu.c:103 +# src/menu.c:103 +#: ../src/stock.c:75 +msgid "_Box" +msgstr "_Boîte" + +# src/menu.c:109 +# src/menu.c:109 +#: ../src/stock.c:76 +msgid "_Ellipse" +msgstr "_Ellipse" + +# src/item_image.c:283 +# src/item_image.c:283 +# src/item_image.c:268 src/menu.c:113 +# src/item_image.c:268 src/menu.c:113 +#: ../src/stock.c:77 +msgid "_Image" +msgstr "_Image" + +# src/item_barcode.c:316 +# src/item_barcode.c:317 +# src/menu.c:116 +# src/menu.c:116 +#: ../src/stock.c:78 +msgid "Bar_code" +msgstr "_Code-barre" + +# src/item_text.c:467 +# src/item_text.c:467 +# src/menu.c:132 src/menu.c:223 +# src/menu.c:132 src/menu.c:223 +#: ../src/stock.c:79 +msgid "_Merge Properties" +msgstr "Propriétés de _fusion" + +# src/item_text.c:467 +# src/item_text.c:467 +# src/item_text.c:482 +# src/item_text.c:482 +#: ../src/stock.c:80 +msgid "Object _Properties" +msgstr "_Propriétés de l'objet" + +# src/display.c:1167 src/display.c:1215 +# src/display.c:1170 src/display.c:1218 +# src/display.c:1181 src/display.c:1229 +# src/display.c:1196 src/display.c:1244 +#: ../src/stock.c:81 +msgid "Bring to _Front" +msgstr "_Avancer au premier plan" + +# src/display.c:1173 src/display.c:1221 +# src/display.c:1176 src/display.c:1224 +# src/display.c:1187 src/display.c:1235 +# src/display.c:1202 src/display.c:1250 +#: ../src/stock.c:82 +msgid "Send to _Back" +msgstr "_Reculer à l'arrière-plan" + +# src/rotate_select.c:187 +# src/rotate_select.c:187 +# src/rotate_select.c:167 +# src/rotate_select.c:169 +#: ../src/stock.c:83 +msgid "Rotate _Left" +msgstr "Rotation _gauche" + +# src/rotate_select.c:187 +# src/rotate_select.c:187 +# src/rotate_select.c:167 +# src/rotate_select.c:169 +#: ../src/stock.c:84 +msgid "Rotate _Right" +msgstr "Rotation _droite" + +#: ../src/stock.c:85 +msgid "Flip _Horizontally" +msgstr "Retourner _horizontalement" + +#: ../src/stock.c:86 +msgid "Flip _Vertically" +msgstr "Retourner _verticalement" + +#: ../src/stock.c:87 +msgid "_Lefts" +msgstr "_Gauches" + +#: ../src/stock.c:88 +msgid "_Rights" +msgstr "_Droites" + +#: ../src/stock.c:89 +msgid "_Centers" +msgstr "_Centres" + +# src/menu.c:157 +# src/menu.c:157 +#: ../src/stock.c:90 +msgid "_Tops" +msgstr "En _haut" + +#: ../src/stock.c:91 +msgid "Bottoms" +msgstr "En _bas" + +#: ../src/stock.c:92 +msgid "Centers" +msgstr "_Centré" + +#: ../src/stock.c:93 ../src/stock.c:94 +msgid "Label Ce_nter" +msgstr "Centre de l'étiquette" + +#: ../src/stock.c:95 ../data/glade/property-bar.glade.h:3 +msgid "Fill color" +msgstr "Couleur de remplissage" + +#: ../src/stock.c:96 ../data/glade/property-bar.glade.h:8 +msgid "Line color" +msgstr "Couleur de ligne" + +# src/item_line.c:271 +# src/item_line.c:271 +# src/item_line.c:256 src/menu.c:106 +# src/item_line.c:256 src/menu.c:106 +#: ../src/stock.c:97 ../src/stock.c:99 +msgid "Linked" +msgstr "Lié" + +# src/merge.c:80 +# src/merge.c:78 +#: ../src/stock.c:98 ../src/stock.c:100 +msgid "Not Linked" +msgstr "Non lié" + +# src/item_box.c:274 src/item_ellipse.c:279 +# src/item_box.c:274 src/item_ellipse.c:279 +# src/item_box.c:258 src/item_ellipse.c:260 +# src/item_box.c:258 src/item_ellipse.c:260 +#. Menu entries. +#: ../src/ui.c:93 +msgid "_File" +msgstr "_Fichier" + +#: ../src/ui.c:94 +msgid "Open Recent _Files" +msgstr "_Fichiers récents" + +#: ../src/ui.c:95 +msgid "_Edit" +msgstr "É_dition" + +# src/menu.c:50 +# src/menu.c:50 +# src/menu.c:50 +# src/menu.c:50 +#: ../src/ui.c:96 +msgid "_View" +msgstr "_Affichage" + +#: ../src/ui.c:97 +msgid "Customize Main Toolbar" +msgstr "Personnaliser le barre d'outils principale" + +#: ../src/ui.c:98 +msgid "Customize Drawing Toolbar" +msgstr "Personnaliser la barre d'outils dessin" + +#: ../src/ui.c:99 +msgid "Customize Properties Toolbar" +msgstr "Personnaliser la barre d'outils de propriétés" + +#: ../src/ui.c:100 +msgid "_Objects" +msgstr "_Objets" + +#: ../src/ui.c:101 +msgid "_Create" +msgstr "_Créer" + +#: ../src/ui.c:102 +msgid "_Order" +msgstr "_Ordre" + +# src/rotate_select.c:187 +# src/rotate_select.c:187 +# src/rotate_select.c:167 +# src/rotate_select.c:169 +#: ../src/ui.c:103 +msgid "_Rotate/Flip" +msgstr "_Rotation/Renversement" + +#: ../src/ui.c:104 +msgid "Align _Horizontal" +msgstr "Aligner _horizontalement" + +#: ../src/ui.c:105 +msgid "Align _Vertical" +msgstr "Aligner _verticalement" + +#: ../src/ui.c:106 +msgid "_Help" +msgstr "Aid_e" + +#. Popup entries. +#: ../src/ui.c:109 ../src/ui.c:110 +msgid "Context Menu" +msgstr "Menu contextuel" + +# src/menu.c:50 +# src/menu.c:50 +# src/menu.c:50 +# src/menu.c:50 +#: ../src/ui.c:115 +msgid "_New" +msgstr "_Nouveau" + +# src/tools.c:70 +# src/tools.c:70 +# src/menu.c:106 src/menu.c:197 +# src/menu.c:106 src/menu.c:197 +#: ../src/ui.c:117 +msgid "Create a new file" +msgstr "Crée un nouveau document" + +# src/file.c:178 +# src/file.c:178 +# src/file.c:211 +# src/file.c:211 +#: ../src/ui.c:122 +msgid "_Open..." +msgstr "_Ouvrir..." + +# src/menu.c:140 +# src/menu.c:140 +# src/menu.c:170 +# src/menu.c:170 +#: ../src/ui.c:124 +msgid "Open a file" +msgstr "Ouvre un fichier" + +# src/file.c:271 src/mdi.c:660 +# src/file.c:271 src/mdi.c:666 +# src/file.c:311 src/mdi.c:623 +# src/file.c:311 src/mdi.c:623 +#: ../src/ui.c:129 +msgid "_Save" +msgstr "_Enregistrer" + +# src/menu.c:142 +# src/menu.c:142 +# src/menu.c:172 +# src/menu.c:172 +#: ../src/ui.c:131 +msgid "Save current file" +msgstr "Enregistrer le fichier en cours" + +# src/file.c:271 src/mdi.c:660 +# src/file.c:271 src/mdi.c:666 +# src/file.c:311 src/mdi.c:623 +# src/file.c:311 src/mdi.c:623 +#: ../src/ui.c:136 +msgid "Save _As..." +msgstr "Enregistrer _sous..." + +#: ../src/ui.c:138 +msgid "Save the current file to a different name" +msgstr "Enregistre le fichier en cours avec un nom différent" + +# src/print.c:149 +# src/print.c:149 +# src/print.c:141 +# src/print_dialog.c:99 +#: ../src/ui.c:143 +msgid "_Print..." +msgstr "Im_primer..." + +# src/menu.c:145 +# src/menu.c:145 +# src/menu.c:175 +# src/menu.c:175 +#: ../src/ui.c:145 +msgid "Print the current file" +msgstr "Imprime le fichier en cours" + +# src/item_text.c:467 +# src/item_text.c:467 +# src/item_text.c:482 +# src/item_text.c:482 +#: ../src/ui.c:150 +msgid "Properties..." +msgstr "Propriétés..." + +# src/item_box.c:251 +# src/item_box.c:251 +# src/merge_properties.c:82 +# src/merge_properties.c:82 +#: ../src/ui.c:152 +msgid "Modify document properties" +msgstr "Modifier les propriétés du document" + +#: ../src/ui.c:157 +msgid "Template _Designer..." +msgstr "_Créateur de patrons..." + +# src/tools.c:70 +# src/tools.c:70 +# src/menu.c:106 src/menu.c:197 +# src/menu.c:106 src/menu.c:197 +#: ../src/ui.c:159 +msgid "Create a custom template" +msgstr "Créer un patron personnalisé" + +#: ../src/ui.c:164 +msgid "_Close" +msgstr "_Fermer" + +# src/menu.c:142 +# src/menu.c:142 +# src/menu.c:172 +# src/menu.c:172 +#: ../src/ui.c:166 +msgid "Close the current file" +msgstr "Ferme le fichier en cours" + +#: ../src/ui.c:171 +msgid "_Quit" +msgstr "_Quitter" + +#: ../src/ui.c:173 +msgid "Quit the program" +msgstr "Quitte le programme" + +#: ../src/ui.c:180 +msgid "Cut" +msgstr "Couper" + +#: ../src/ui.c:182 +msgid "Cut the selection" +msgstr "Coupe la sélection" + +#: ../src/ui.c:187 +msgid "Copy" +msgstr "Copier" + +# src/menu.c:86 +# src/menu.c:86 +# src/menu.c:86 +# src/menu.c:86 +#: ../src/ui.c:189 +msgid "Copy the selection" +msgstr "Copie la sélection" + +#: ../src/ui.c:194 +msgid "Paste" +msgstr "Coller" + +#: ../src/ui.c:196 +msgid "Paste the clipboard" +msgstr "Colle le presse-papiers" + +# src/display.c:1157 src/display.c:1205 +# src/display.c:1160 src/display.c:1208 +# src/display.c:1171 src/display.c:1219 +# src/display.c:1186 src/display.c:1234 +#: ../src/ui.c:201 +msgid "Delete" +msgstr "Supprimer" + +# src/tools.c:64 +# src/tools.c:64 +# src/menu.c:100 src/menu.c:191 +# src/menu.c:100 src/menu.c:191 +#: ../src/ui.c:203 +msgid "Delete the selected objects" +msgstr "Supprime les objets sélectionnés" + +# src/menu.c:86 +# src/menu.c:86 +# src/menu.c:85 +# src/menu.c:85 +#: ../src/ui.c:208 +msgid "Select All" +msgstr "Tout sélectionner" + +# src/tools.c:59 +# src/tools.c:59 +# src/menu.c:95 src/menu.c:186 +# src/menu.c:95 src/menu.c:186 +#: ../src/ui.c:210 +msgid "Select all objects" +msgstr "Sélectionne tous les objets" + +# src/menu.c:86 +# src/menu.c:86 +# src/menu.c:85 +# src/menu.c:85 +#: ../src/ui.c:215 +msgid "Un-select All" +msgstr "Désélectionner tout" + +# src/menu.c:86 +# src/menu.c:86 +# src/menu.c:86 +# src/menu.c:86 +#: ../src/ui.c:217 +msgid "Remove all selections" +msgstr "Annule toutes les sélections" + +# src/preferences.c:92 +# src/prefs.c:101 +# src/prefs.c:92 +# src/prefs.c:86 +#: ../src/ui.c:222 +msgid "Preferences" +msgstr "Préférences" + +#: ../src/ui.c:224 +msgid "Configure the application" +msgstr "Configure le logiciel" + +# src/tools.c:84 +# src/tools.c:84 +# src/menu.c:121 src/menu.c:211 +# src/menu.c:121 src/menu.c:211 +#: ../src/ui.c:231 +msgid "Zoom in" +msgstr "Zoom avant" + +#: ../src/ui.c:233 +msgid "Increase magnification" +msgstr "Augmente l'agrandissement" + +# src/tools.c:87 +# src/tools.c:87 +# src/menu.c:124 src/menu.c:214 +# src/menu.c:124 src/menu.c:214 +#: ../src/ui.c:238 +msgid "Zoom out" +msgstr "Zoom arrière" + +#: ../src/ui.c:240 +msgid "Decrease magnification" +msgstr "Réduit l'agrandissement" + +# src/tools.c:90 +# src/tools.c:90 +# src/menu.c:127 +# src/menu.c:127 +#: ../src/ui.c:245 +msgid "Zoom 1 to 1" +msgstr "Zoom 1:1" + +#: ../src/ui.c:247 +msgid "Restore scale to 100%" +msgstr "Remet l'échelle à 100%" + +# src/tools.c:90 +# src/tools.c:90 +# src/menu.c:127 src/menu.c:217 +# src/menu.c:127 src/menu.c:217 +#: ../src/ui.c:252 +msgid "Zoom to fit" +msgstr "Adapter le zoom à la taille de la fenêtre" + +#: ../src/ui.c:254 +msgid "Set scale to fit window" +msgstr "Adapte l'échelle à la taille de la fenêtre" + +# src/display.c:1157 src/display.c:1205 +# src/display.c:1160 src/display.c:1208 +# src/menu.c:94 +# src/menu.c:94 +#: ../src/ui.c:261 +msgid "Select Mode" +msgstr "Mode sélection" + +# src/tools.c:59 +# src/tools.c:59 +# src/menu.c:95 src/menu.c:186 +# src/menu.c:95 src/menu.c:186 +#: ../src/ui.c:263 +msgid "Select, move and modify objects" +msgstr "Sélectionne, déplace et modifie les objets" + +# src/item_text.c:442 src/item_text.c:627 +# src/item_text.c:442 src/item_text.c:627 +# src/item_text.c:460 src/item_text.c:464 src/item_text.c:637 src/menu.c:100 +# src/item_text.c:460 src/item_text.c:464 src/item_text.c:637 src/menu.c:100 +#: ../src/ui.c:268 ../src/view-text.c:525 +#: ../data/glade/object-editor.glade.h:32 +msgid "Text" +msgstr "Texte" + +# src/tools.c:64 +# src/tools.c:64 +# src/menu.c:100 src/menu.c:191 +# src/menu.c:100 src/menu.c:191 +#: ../src/ui.c:270 +msgid "Create text object" +msgstr "Crée un objet texte" + +# src/menu.c:103 +# src/menu.c:103 +#: ../src/ui.c:275 +msgid "Box" +msgstr "Boîte" + +# src/tools.c:67 +# src/tools.c:67 +# src/menu.c:103 src/menu.c:194 +# src/menu.c:103 src/menu.c:194 +#: ../src/ui.c:277 +msgid "Create box/rectangle object" +msgstr "Crée un objet boîte/rectangle" + +# src/item_line.c:271 +# src/item_line.c:271 +# src/item_line.c:256 src/menu.c:106 +# src/item_line.c:256 src/menu.c:106 +#: ../src/ui.c:282 ../data/glade/object-editor.glade.h:20 +msgid "Line" +msgstr "Ligne" + +# src/tools.c:70 +# src/tools.c:70 +# src/menu.c:106 src/menu.c:197 +# src/menu.c:106 src/menu.c:197 +#: ../src/ui.c:284 +msgid "Create line object" +msgstr "Crée un objet ligne" + +# src/menu.c:109 +# src/menu.c:109 +#: ../src/ui.c:289 +msgid "Ellipse" +msgstr "Ellipse" + +# src/tools.c:73 +# src/tools.c:73 +# src/menu.c:110 src/menu.c:200 +# src/menu.c:110 src/menu.c:200 +#: ../src/ui.c:291 +msgid "Create ellipse/circle object" +msgstr "Crée un objet ellipse/cercle" + +# src/item_image.c:283 +# src/item_image.c:283 +# src/item_image.c:268 src/menu.c:113 +# src/item_image.c:268 src/menu.c:113 +#: ../src/ui.c:296 ../data/glade/object-editor.glade.h:16 +msgid "Image" +msgstr "Image" + +# src/tools.c:76 +# src/tools.c:76 +# src/menu.c:113 src/menu.c:203 +# src/menu.c:113 src/menu.c:203 +#: ../src/ui.c:298 +msgid "Create image object" +msgstr "Crée un objet image" + +# src/item_barcode.c:316 +# src/item_barcode.c:317 +# src/menu.c:116 +# src/menu.c:116 +#: ../src/ui.c:303 +msgid "Barcode" +msgstr "Code-barre" + +# src/tools.c:79 +# src/tools.c:79 +# src/menu.c:116 src/menu.c:206 +# src/menu.c:116 src/menu.c:206 +#: ../src/ui.c:305 +msgid "Create barcode object" +msgstr "Crée un objet code-barre" + +# src/display.c:1167 src/display.c:1215 +# src/display.c:1170 src/display.c:1218 +# src/display.c:1181 src/display.c:1229 +# src/display.c:1196 src/display.c:1244 +#: ../src/ui.c:310 +msgid "Bring to front" +msgstr "Avancer au premier plan" + +#: ../src/ui.c:312 +msgid "Raise object to top" +msgstr "Remonte l'objet au plus haut niveau" + +# src/display.c:1173 src/display.c:1221 +# src/display.c:1176 src/display.c:1224 +# src/display.c:1187 src/display.c:1235 +# src/display.c:1202 src/display.c:1250 +#: ../src/ui.c:317 +msgid "Send to back" +msgstr "Reculer à l'arrière-plan" + +#: ../src/ui.c:319 +msgid "Lower object to bottom" +msgstr "Descend l'objet à l'arrière-plan" + +# src/rotate_select.c:187 +# src/rotate_select.c:187 +# src/rotate_select.c:167 +# src/rotate_select.c:169 +#: ../src/ui.c:324 +msgid "Rotate left" +msgstr "Rotation gauche" + +#: ../src/ui.c:326 +msgid "Rotate object 90 degrees counter-clockwise" +msgstr "Tourne l'objet de 90 degrés dans le sens inverse des aiguilles d'une montre" + +# src/rotate_select.c:187 +# src/rotate_select.c:187 +# src/rotate_select.c:167 +# src/rotate_select.c:169 +#: ../src/ui.c:331 +msgid "Rotate right" +msgstr "Rotation droite" + +#: ../src/ui.c:333 +msgid "Rotate object 90 degrees clockwise" +msgstr "Tourne l'objet de 90 degrés dans le sens des aiguilles d'une montre" + +#: ../src/ui.c:338 +msgid "Flip horizontally" +msgstr "Retourner horizontalement" + +#: ../src/ui.c:340 +msgid "Flip object horizontally" +msgstr "Retourne l'objet horizontalement" + +#: ../src/ui.c:345 +msgid "Flip vertically" +msgstr "Retourner verticalement" + +#: ../src/ui.c:347 +msgid "Flip object vertically" +msgstr "Retourne l'objet verticalement" + +# src/prop_text.c:277 +# src/prop_text.c:264 +# src/prop_text.c:248 +# src/prop_text.c:248 +#: ../src/ui.c:352 +msgid "Align left" +msgstr "Aligner à gauche" + +#: ../src/ui.c:354 +msgid "Align objects to left edges" +msgstr "Aligne les objets sur leur bordure gauche" + +#: ../src/ui.c:359 +msgid "Align right" +msgstr "Aligner à droite" + +#: ../src/ui.c:361 +msgid "Align objects to right edges" +msgstr "Aligne les objets sur leur bordure droite" + +#: ../src/ui.c:366 +msgid "Align horizontal center" +msgstr "Aligner centré horizontalement" + +#: ../src/ui.c:368 +msgid "Align objects to horizontal centers" +msgstr "Aligne horizontalement le centre des objets" + +#: ../src/ui.c:373 +msgid "Align tops" +msgstr "Aligner au sommet" + +#: ../src/ui.c:375 +msgid "Align objects to top edges" +msgstr "Aligne les objets d'après leur sommet" + +#: ../src/ui.c:380 +msgid "Align bottoms" +msgstr "Aligner à la base" + +#: ../src/ui.c:382 +msgid "Align objects to bottom edges" +msgstr "Aligne les objets d'après leur base" + +#: ../src/ui.c:387 +msgid "Align vertical center" +msgstr "Aligner centré verticalement" + +#: ../src/ui.c:389 +msgid "Align objects to vertical centers" +msgstr "Aligne verticalement le centre des objets" + +#: ../src/ui.c:394 +msgid "Center horizontally" +msgstr "Centrer horizontalement" + +#: ../src/ui.c:396 +msgid "Center objects to horizontal label center" +msgstr "Aligne les objets horizontalement au centre de l'étiquette" + +#: ../src/ui.c:401 +msgid "Center vertically" +msgstr "Centrer verticalement" + +#: ../src/ui.c:403 +msgid "Center objects to vertical label center" +msgstr "Aligne les objets verticalement au centre de l'étiquette" + +# src/item_text.c:467 +# src/item_text.c:467 +# src/menu.c:132 src/menu.c:223 +# src/menu.c:132 src/menu.c:223 +#: ../src/ui.c:408 +msgid "Merge properties" +msgstr "Propriétés de fusion" + +# src/item_image.c:272 +# src/item_image.c:272 +# src/menu.c:133 +# src/menu.c:133 +#: ../src/ui.c:410 +msgid "Edit merge properties" +msgstr "Édite les propriétés de fusion" + +#: ../src/ui.c:417 +msgid "Contents" +msgstr "Sommaire" + +# src/file.c:183 +# src/file.c:183 +# src/file.c:213 +# src/file.c:213 +#: ../src/ui.c:419 +msgid "Open glabels manual" +msgstr "Ouvre le manuel de glabels" + +#: ../src/ui.c:424 +msgid "About..." +msgstr "À propos..." + +#: ../src/ui.c:426 +msgid "About glabels" +msgstr "À propos de glabels" + +#: ../src/ui.c:436 +msgid "Property toolbar" +msgstr "Barre d'outils de propriétés" + +#: ../src/ui.c:438 +msgid "Change the visibility of the property toolbar in the current window" +msgstr "Afficher ou non la barre d'outils de propriétés dans la fenêtre actuelle" + +#: ../src/ui.c:444 ../src/ui.c:489 ../src/ui.c:497 +msgid "Show tooltips" +msgstr "Afficher les infos-bulles" + +#: ../src/ui.c:446 +msgid "Show tooltips for property toolbar" +msgstr "Afficher les info-bulles dans la barre d'outils de propriétés" + +#: ../src/ui.c:452 +msgid "Grid" +msgstr "Grille" + +#: ../src/ui.c:454 +msgid "Change the visibility of the grid in the current window" +msgstr "Afficher ou non la grille dans la fenêtre actuelle" + +# src/preferences.c:213 +#: ../src/ui.c:460 +msgid "Markup" +msgstr "Marges" + +#: ../src/ui.c:462 +msgid "Change the visibility of markup lines in the current window" +msgstr "Afficher ou non les lignes de marges dans la fenêtre actuelle" + +#: ../src/ui.c:473 +msgid "Main toolbar" +msgstr "Barre d'outils principale" + +#: ../src/ui.c:475 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "Afficher ou non la barre d'outils principale dans la fenêtre actuelle" + +#: ../src/ui.c:481 +msgid "Drawing toolbar" +msgstr "Barre d'outils dessin" + +#: ../src/ui.c:483 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "Afficher ou non la barre d'outils dessin dans la fenêtre actuelle" + +#: ../src/ui.c:491 +msgid "Show tooltips for main toolbar" +msgstr "Afficher les info-bulles dans la barre d'outils principale" + +#: ../src/ui.c:499 +msgid "Show tooltips for drawing toolbar" +msgstr "Afficher les info-bulles dans la barre d'outils de dessin" + +# src/display.c:1157 src/display.c:1205 +# src/display.c:1160 src/display.c:1208 +# src/display.c:1171 src/display.c:1219 +# src/display.c:1186 src/display.c:1234 +#: ../src/ui-property-bar.c:1235 ../src/object-editor.c:571 +#: ../src/object-editor.c:577 +msgid "Default" +msgstr "Par défaut" + +# src/merge.c:80 +# src/merge.c:78 +#: ../src/ui-property-bar.c:1242 ../src/object-editor.c:583 +msgid "No line" +msgstr "Pas de ligne" + +#: ../src/ui-property-bar.c:1250 ../src/object-editor.c:590 +msgid "No fill" +msgstr "Pas de remplissage" + +# src/item_text.c:467 +# src/item_text.c:467 +# src/item_text.c:482 +# src/item_text.c:482 +#: ../src/ui-sidebar.c:152 +msgid "Object properties" +msgstr "Propriétés de l'objet" + +#: ../src/ui-commands.c:1084 +msgid "Glabels includes contributions from:" +msgstr "Glabels contient des contributions de :" + +#: ../src/ui-commands.c:1090 +msgid "See the file AUTHORS for additional credits," +msgstr "Voir le fichier AUTHORS pour des remerciements supplémentaires," + +#: ../src/ui-commands.c:1091 +msgid "or visit http://glabels.sourceforge.net/" +msgstr "ou visitez http://glabels.sourceforge.net/" + +#: ../src/ui-commands.c:1103 +msgid "A label and business card creation program.\n" +msgstr "Un logiciel de création de cartes de visite et d'étiquettes.\n" + +#: ../src/ui-commands.c:1107 +msgid "translator-credits" +msgstr "" +"Olivier Berger \n" +"Florent Morel , 2001, 2004\n" +"Claude Paroz , 2007" + +# src/menu.c:185 +# src/menu.c:185 +# src/menu.c:290 +# src/menu.c:290 +#: ../src/ui-commands.c:1110 +msgid "" +"Glabels is free software; you can redistribute it and/or modify it\n" +"under the terms of the GNU General Public License as published by\n" +"the Free Software Foundation; either version 2 of the License, or\n" +"(at your option) any later version.\n" +"\n" +"This program is distributed in the hope that it will be useful, but\n" +"WITHOUT ANY WARRANTY; without even the implied warranty of\n" +"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See\n" +"the GNU General Public License for more details.\n" +msgstr "" +"Glabels est un logiciel libre ; vous pouvez le redistribuer et/ou le " +"modifier conformément aux dispositions de la Licence Publique Générale GNU, " +"telle que publiée par la Free Software Foundation ; version 2 de la licence, " +"ou encore (à votre choix) toute version ultérieure.\n" +" \n" +"Ce programme est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE " +"GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou " +"D'ADAPTATION A UN OBJET PARTICULIER. Pour plus de détails, voir la Licence " +"Publique Générale GNU.\n" + +# src/print_copies.c:210 +# src/print_copies.c:210 +# src/print_copies.c:188 +# src/print_copies.c:187 +#: ../src/ui-commands.c:1136 +msgid "glabels" +msgstr "glabels" + +# src/file.c:59 +# src/file.c:59 +# src/file.c:72 +# src/file.c:72 +#: ../src/file.c:90 +msgid "New Label or Card" +msgstr "Nouvelle étiquette ou carte" + +# src/item_text.c:467 +# src/item_text.c:467 +# src/item_text.c:482 +# src/item_text.c:482 +#: ../src/file.c:189 +msgid "Label properties" +msgstr "Propriétés de l'étiquette" + +#: ../src/file.c:288 ../src/file.c:574 +msgid "All files" +msgstr "Tous les fichiers" + +# src/preferences.c:92 +# src/prefs.c:101 +# src/prefs.c:92 +# src/prefs.c:86 +#: ../src/file.c:293 ../src/file.c:579 +msgid "gLabels documents" +msgstr "Documents gLabels" + +# src/menu.c:86 +# src/menu.c:86 +# src/menu.c:86 +# src/menu.c:86 +#: ../src/file.c:339 ../src/file.c:636 +msgid "Empty file name selection" +msgstr "Nom de fichier sélectionné vide" + +#: ../src/file.c:342 ../src/file.c:358 +msgid "Please select a file or supply a valid file name" +msgstr "Sélectionnez un fichier ou donnez un nom de fichier valide" + +#: ../src/file.c:355 +msgid "File does not exist" +msgstr "Ce fichier n'existe pas" + +# src/file.c:214 +# src/file.c:214 +# src/file.c:249 +# src/file.c:249 +# c-format +#: ../src/file.c:429 +#, c-format +msgid "Could not open file \"%s\"" +msgstr "Impossible d'ouvrir le fichier « %s »" + +#: ../src/file.c:432 +msgid "Not a supported file format" +msgstr "Format de fichier non pris en charge" + +# src/file.c:248 src/mdi.c:635 +# src/file.c:248 src/mdi.c:641 +# src/file.c:288 src/mdi.c:601 +# src/file.c:288 src/mdi.c:601 +#: ../src/file.c:509 ../src/file.c:686 +#, c-format +msgid "Could not save file \"%s\"" +msgstr "Impossible d'enregistrer « %s »" + +#: ../src/file.c:513 ../src/file.c:690 +msgid "Error encountered during save. The file is still not saved." +msgstr "" +"Erreur rencontrée durant l'enregistrement. Le fichier n'est toujours pas " +"enregistré. " + +# src/file.c:278 +# src/file.c:278 +# src/file.c:316 +# src/file.c:316 +#: ../src/file.c:552 +#, c-format +msgid "Save \"%s\" as" +msgstr "Enregistrer « %s » sous" + +# src/file.c:319 src/mdi.c:729 +# src/file.c:319 src/mdi.c:735 +# src/file.c:362 src/mdi.c:693 +# src/file.c:362 src/mdi.c:693 +#: ../src/file.c:639 +msgid "Please supply a valid file name" +msgstr "Donnez un nom de fichier valide" + +#: ../src/file.c:660 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "Écraser le fichier « %s » ?" + +#: ../src/file.c:664 +msgid "File already exists." +msgstr "Ce fichier existe déjà." + +#: ../src/file.c:760 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "Enregistrer les changements du document « %s » avant de fermer ?" + +#: ../src/file.c:764 +msgid "Your changes will be lost if you don't save them." +msgstr "Vos changements seront perdus si vous ne les enregistrez pas." + +#: ../src/file.c:767 +msgid "Close without saving" +msgstr "Fermer sans enregistrer" + +# src/print.c:171 +# src/prefs.c:463 src/prefs.c:470 src/prop_line.c:202 +# src/prefs.c:445 src/prefs.c:452 src/prop_line.c:183 +# src/prefs.c:448 src/prefs.c:455 src/prop_line.c:183 +#. Should not happen +#: ../src/prefs.c:158 ../src/prefs.c:165 +#: ../data/glade/object-editor.glade.h:43 +#: ../data/glade/prefs-dialog.glade.h:22 +msgid "points" +msgstr "points" + +# src/item_line.c:271 +# src/prefs.c:465 +# src/prefs.c:447 +# src/prefs.c:450 +#: ../src/prefs.c:160 ../data/glade/object-editor.glade.h:42 +#: ../data/glade/template-designer.glade.h:65 +msgid "inches" +msgstr "pouces" + +# src/prefs.c:467 +# src/prefs.c:449 +# src/prefs.c:452 +#: ../src/prefs.c:162 +msgid "mm" +msgstr "mm" + +# src/preferences.c:92 +# src/prefs.c:101 +# src/prefs.c:92 +# src/prefs.c:86 +#: ../src/prefs-dialog.c:162 ../data/glade/prefs-dialog.glade.h:21 +msgid "gLabels Preferences" +msgstr "Préférences de gLabels" + +# src/item_box.c:251 +# src/item_box.c:251 +# src/item_box.c:235 +# src/item_box.c:235 +#. Build editor. +#: ../src/view-box.c:178 +msgid "Box object properties" +msgstr "Propriétés de l'objet boîte" + +# src/item_ellipse.c:256 +# src/item_ellipse.c:256 +# src/item_ellipse.c:237 +# src/item_ellipse.c:237 +#. Build editor. +#: ../src/view-ellipse.c:178 +msgid "Ellipse object properties" +msgstr "Propriétés de l'objet ellipse" + +# src/item_box.c:251 +# src/item_box.c:251 +# src/item_box.c:235 +# src/item_box.c:235 +#. Build editor. +#: ../src/view-line.c:177 +msgid "Line object properties" +msgstr "Propriétés de l'objet ligne" + +# src/item_image.c:272 +# src/item_image.c:272 +# src/item_image.c:257 +# src/item_image.c:257 +#. Build editor. +#: ../src/view-image.c:177 +msgid "Image object properties" +msgstr "Propriétés de l'objet image" + +# src/item_box.c:251 +# src/item_box.c:251 +# src/item_box.c:235 +# src/item_box.c:235 +#. Build editor. +#: ../src/view-text.c:181 +msgid "Text object properties" +msgstr "Propriétés de l'objet texte" + +# src/item_barcode.c:299 +# src/item_barcode.c:299 +# src/item_barcode.c:287 +# src/item_barcode.c:287 +#. Build editor. +#: ../src/view-barcode.c:177 +msgid "Barcode object properties" +msgstr "Propriétés de l'objet code-barre" + +#: ../src/object-editor-image-page.c:270 +msgid "All Files" +msgstr "Tous les fichiers" + +# src/item_image.c:283 +# src/item_image.c:283 +# src/item_image.c:268 src/menu.c:113 +# src/item_image.c:268 src/menu.c:113 +#: ../src/object-editor-image-page.c:275 +msgid "All Images" +msgstr "Toutes les images" + +#: ../src/object-editor-image-page.c:290 +#, c-format +msgid "%s (*.%s)" +msgstr "%s (*.%s)" + +# src/item_text.c:467 +# src/item_text.c:467 +# src/menu.c:132 src/menu.c:223 +# src/menu.c:132 src/menu.c:223 +#: ../src/merge-properties-dialog.c:263 +msgid "Merge Properties" +msgstr "Propriétés de fusion" + +# src/merge_ui_text.c:170 +# src/merge_ui_text.c:170 +#: ../src/merge-properties-dialog.c:289 ../src/merge-properties-dialog.c:397 +msgid "Select merge-database source" +msgstr "Sélection du fichier de données pour la fusion" + +# src/merge_ui.c:207 src/merge_ui.c:242 src/merge_ui.c:387 src/merge_ui.c:428 +# src/merge_ui.c:207 src/merge_ui.c:242 src/merge_ui.c:387 src/merge_ui.c:428 +#: ../src/merge-properties-dialog.c:298 ../src/merge-properties-dialog.c:417 +msgid "N/A" +msgstr "Non défini" + +# src/display.c:1157 src/display.c:1205 +# src/display.c:1160 src/display.c:1208 +# src/menu.c:94 +# src/menu.c:94 +#: ../src/merge-properties-dialog.c:324 +msgid "Select" +msgstr "Sélectionner" + +#: ../src/merge-properties-dialog.c:332 +msgid "Record/Field" +msgstr "Enregistrements/Champs" + +# src/item_barcode.c:309 +# src/item_barcode.c:308 +# src/item_barcode.c:297 +# src/item_barcode.c:297 +#: ../src/merge-properties-dialog.c:340 ../data/glade/object-editor.glade.h:10 +msgid "Data" +msgstr "Données" + +# src/item_box.c:274 src/item_ellipse.c:279 +# src/item_box.c:274 src/item_ellipse.c:279 +# src/merge_properties.c:168 +# src/merge_properties.c:168 +#: ../src/merge-properties-dialog.c:410 +msgid "Fixed" +msgstr "" + +# src/print_copies.c:210 +# src/print_copies.c:210 +# src/print_copies.c:188 +# src/print_copies.c:187 +#: ../src/print-op.c:231 ../src/wdgt-print-copies.c:171 +msgid "Labels" +msgstr "Étiquettes" + +#: ../src/template-designer.c:357 +msgid "gLabels Template Designer" +msgstr "Créateur de patrons gLabels" + +#: ../src/template-designer.c:418 +msgid "Welcome" +msgstr "Bienvenue" + +# src/media_select.c:216 +# src/media_select.c:242 +# src/media_select.c:222 +# src/media_select.c:222 +#: ../src/template-designer.c:460 +msgid "Name and Description" +msgstr "Nom et description" + +# src/media_select.c:221 +# src/media_select.c:247 +# src/media_select.c:227 +# src/media_select.c:227 +#: ../src/template-designer.c:513 +msgid "Page Size" +msgstr "Taille de page" + +# src/file.c:59 +# src/file.c:59 +# src/file.c:72 +# src/file.c:72 +#: ../src/template-designer.c:584 +msgid "Label or Card Shape" +msgstr "Forme de carte ou d'étiquette" + +# src/file.c:59 +# src/file.c:59 +# src/file.c:72 +# src/file.c:72 +#: ../src/template-designer.c:634 +msgid "Label or Card Size" +msgstr "Taille de carte ou d'étiquette" + +# src/media_select.c:226 +# src/media_select.c:252 +# src/media_select.c:232 +# src/media_select.c:232 +#: ../src/template-designer.c:734 +msgid "Label Size (round)" +msgstr "Taille d'étiquette (ronde)" + +#: ../src/template-designer.c:817 +msgid "Label Size (CD/DVD)" +msgstr "Taille d'étiquette (CD/DVD)" + +#: ../src/template-designer.c:910 +msgid "Number of Layouts" +msgstr "Nombre de dispositions" + +# src/media_select.c:231 +# src/media_select.c:257 +# src/media_select.c:237 +# src/media_select.c:237 +#: ../src/template-designer.c:973 +msgid "Layout(s)" +msgstr "Disposition(s) :" + +#: ../src/template-designer.c:1084 +msgid "Design Completed" +msgstr "Création terminée" + +#: ../src/bc.c:67 +msgid "POSTNET (any)" +msgstr "POSTNET (tous)" + +#: ../src/bc.c:70 +msgid "POSTNET-5 (ZIP only)" +msgstr "POSTNET-5 (seulement ZIP)" + +#: ../src/bc.c:73 +msgid "POSTNET-9 (ZIP+4)" +msgstr "POSTNET-9 (ZIP+4)" + +#: ../src/bc.c:76 +msgid "POSTNET-11 (DPBC)" +msgstr "POSTNET-11 (DPBC)" + +#: ../src/bc.c:79 +msgid "EAN (any)" +msgstr "EAN (tous)" + +#: ../src/bc.c:82 +msgid "EAN-8" +msgstr "EAN-8" + +#: ../src/bc.c:85 +msgid "EAN-8 +2" +msgstr "EAN-8 +2" + +#: ../src/bc.c:88 +msgid "EAN-8 +5" +msgstr "EAN-8 +5" + +#: ../src/bc.c:91 +msgid "EAN-13" +msgstr "EAN-13" + +#: ../src/bc.c:94 +msgid "EAN-13 +2" +msgstr "EAN-13 +2" + +#: ../src/bc.c:97 +msgid "EAN-13 +5" +msgstr "EAN-13 +5" + +#: ../src/bc.c:100 +msgid "UPC (UPC-A or UPC-E)" +msgstr "UPC (UPC-A ou UPC-E)" + +#: ../src/bc.c:103 +msgid "UPC-A" +msgstr "UPC-A" + +#: ../src/bc.c:106 +msgid "UPC-A +2" +msgstr "UPC-A +2" + +#: ../src/bc.c:109 +msgid "UPC-A +5" +msgstr "UPC-A +5" + +#: ../src/bc.c:112 +msgid "UPC-E" +msgstr "UPC-E" + +#: ../src/bc.c:115 +msgid "UPC-E +2" +msgstr "UPC-E +2" + +#: ../src/bc.c:118 +msgid "UPC-E +5" +msgstr "UPC-E +5" + +#: ../src/bc.c:121 +msgid "ISBN" +msgstr "ISBN" + +#: ../src/bc.c:124 +msgid "ISBN +5" +msgstr "ISBN +5" + +#: ../src/bc.c:127 +msgid "Code 39" +msgstr "Code 39" + +#: ../src/bc.c:130 +msgid "Code 128" +msgstr "Code 128" + +#: ../src/bc.c:133 +msgid "Code 128C" +msgstr "Code 128C" + +#: ../src/bc.c:136 +msgid "Code 128B" +msgstr "Code 128B" + +#: ../src/bc.c:139 +msgid "Interleaved 2 of 5" +msgstr "Entrelacé 2 de 5" + +#: ../src/bc.c:142 +msgid "Codabar" +msgstr "Code-barre" + +#: ../src/bc.c:145 +msgid "MSI" +msgstr "MSI" + +#: ../src/bc.c:148 +msgid "Plessey" +msgstr "Plessey" + +#: ../src/bc.c:151 +msgid "IEC16022 (DataMatrix)" +msgstr "IEC16022 (DataMatrix)" + +#: ../src/label.c:513 +msgid "Untitled" +msgstr "Sans titre" + +# src/item_barcode.c:316 +# src/item_barcode.c:317 +# src/item_barcode.c:299 +# src/item_barcode.c:299 +#: ../src/label-barcode.c:415 +msgid "Barcode data empty" +msgstr "Données de code-barre vides" + +# src/item_barcode.c:564 src/item_barcode.c:588 src/print.c:641 +# src/item_barcode.c:570 src/item_barcode.c:594 src/print.c:641 +# src/item_barcode.c:549 src/item_barcode.c:572 src/print.c:799 +# src/item_barcode.c:549 src/item_barcode.c:572 src/print.c:600 +#: ../src/label-barcode.c:419 +msgid "Invalid barcode data" +msgstr "Données de code-barre invalides" + +# src/label.c:186 src/label.c:211 +# src/label.c:186 src/label.c:211 +# src/label.c:170 src/label.c:194 +# src/label.c:168 src/label.c:192 +#: ../src/xml-label.c:188 ../src/xml-label.c:225 +msgid "xmlParseFile error" +msgstr "erreur xmlParseFile" + +# src/label.c:243 +# src/label.c:244 +# src/label.c:225 +# src/label.c:223 +#: ../src/xml-label.c:262 +msgid "No document root" +msgstr "Pas de racine de document" + +#: ../src/xml-label.c:276 +msgid "Importing from glabels 0.1 format" +msgstr "Import depuis le format glabels 0.1" + +#: ../src/xml-label.c:284 +msgid "Importing from glabels 0.4 format" +msgstr "Import depuis le format glabels 0.4" + +# src/label.c:248 +# src/label.c:249 +# src/label.c:236 +# src/label.c:234 +#: ../src/xml-label.c:287 +msgid "bad document, unknown glabels Namespace" +msgstr "document de type erroné, espace de noms glabels inconnu" + +# src/label.c:253 +# src/label.c:254 +# src/label.c:241 +# src/label.c:239 +#: ../src/xml-label.c:315 ../src/xml-label-04.c:78 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "Mauvais noeud racine = \"%s\"" + +# src/label.c:253 +# src/label.c:254 +# src/label.c:241 +# src/label.c:239 +#: ../src/xml-label.c:352 +#, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "Mauvais noeud racine = \"%s\"" + +# src/label.c:298 +# src/label.c:301 +# src/label.c:294 +# src/label.c:290 +#: ../src/xml-label.c:397 ../src/xml-label-04.c:126 +#, c-format +msgid "bad node = \"%s\"" +msgstr "mauvais noeud = \"%s\"" + +# src/label.c:298 +# src/label.c:301 +# src/label.c:294 +# src/label.c:290 +#: ../src/xml-label.c:836 +#, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "mauvais noeud de données = \"%s\"" + +#: ../src/xml-label.c:1073 ../libglabels/xml-template.c:585 +msgid "Utf8 conversion error." +msgstr "Erreur de conversion Utf8" + +# src/label.c:487 +# src/label.c:493 +# src/label.c:589 +# src/label.c:587 +#: ../src/xml-label.c:1080 ../libglabels/xml-template.c:592 +msgid "Problem saving xml file." +msgstr "Problème de sauvegarde du fichier xml." + +# src/merge.c:80 +# src/merge.c:78 +#: ../src/merge.c:170 ../src/merge.c:211 ../src/merge.c:375 ../src/merge.c:378 +msgid "None" +msgstr "Aucun" + +# src/merge.c:98 +# src/merge.c:94 +#: ../src/merge-init.c:59 +msgid "Text file with comma delimeters (CSV)" +msgstr "Texte séparé par des virgules (CSV)" + +# src/merge.c:107 +# src/merge.c:102 +#: ../src/merge-init.c:66 +msgid "Text file with colon delimeters" +msgstr "Texte séparé par des deux-points" + +# src/merge.c:89 +# src/merge.c:86 +#: ../src/merge-init.c:73 +msgid "Text file with tab delimeters" +msgstr "Texte avec séparateurs de tabulation" + +#: ../src/merge-init.c:82 +msgid "Data from default Evolution Addressbook" +msgstr "Données du carnet d'adresses Evolution par défaut" + +#: ../src/merge-init.c:88 +msgid "Data from a file containing VCards" +msgstr "Données d'un fichier de VCards" + +#: ../src/merge-evolution.c:278 +msgid "Couldn't construct query" +msgstr "Impossible de construire la requête" + +# src/file.c:214 +# src/file.c:214 +# src/file.c:249 +# src/file.c:249 +# c-format +#: ../src/merge-evolution.c:284 ../src/merge-evolution.c:291 +#, c-format +msgid "Couldn't open addressbook: %s" +msgstr "Impossible d'ouvrir le carnet d'adresses : %s" + +# src/file.c:248 src/mdi.c:635 +# src/file.c:248 src/mdi.c:641 +# src/file.c:288 src/mdi.c:601 +# src/file.c:288 src/mdi.c:601 +#: ../src/merge-evolution.c:303 +#, c-format +msgid "Couldn't list available fields: %s" +msgstr "Impossible d'énumérer les champs disponibles : %s" + +#: ../src/merge-evolution.c:335 +#, c-format +msgid "Couldn't get contacts: %s" +msgstr "Impossible d'obtenir les contacts : %s" + +# src/print_copies.c:193 +# src/print_copies.c:193 +# src/print_copies.c:171 +# src/print_copies.c:170 +#: ../src/wdgt-print-copies.c:153 +msgid "Sheets:" +msgstr "Feuilles :" + +# src/print_copies.c:213 +# src/print_copies.c:213 +# src/print_copies.c:191 +# src/print_copies.c:190 +#: ../src/wdgt-print-copies.c:173 +msgid "from:" +msgstr "de :" + +# src/print_copies.c:221 +# src/print_copies.c:221 +# src/print_copies.c:199 +# src/print_copies.c:198 +#: ../src/wdgt-print-copies.c:179 +msgid "to:" +msgstr "à :" + +# src/print_copies_merge.c:197 +# src/print_merge.c:170 +#: ../src/wdgt-print-merge.c:154 +msgid "Start on label" +msgstr "Commencer par l'étiquette" + +# src/print_copies_merge.c:206 +# src/print_merge.c:179 +#: ../src/wdgt-print-merge.c:162 +msgid "on 1st sheet" +msgstr "en 1ère page" + +# src/print.c:153 +# src/print.c:153 +# src/print_copies_merge.c:173 +# src/print_merge.c:195 +#: ../src/wdgt-print-merge.c:171 +msgid "Copies:" +msgstr "Copies :" + +# src/rotate_select.c:187 +# src/rotate_select.c:187 +# src/print_copies_merge.c:186 +# src/print_merge.c:188 +#: ../src/wdgt-print-merge.c:177 +msgid "Collate" +msgstr "Assembler" + +#: ../src/wdgt-media-select.c:229 ../src/wdgt-media-select.c:238 +#: ../src/wdgt-media-select.c:241 ../src/wdgt-media-select.c:465 +#: ../src/wdgt-media-select.c:474 +msgid "Any" +msgstr "Tous" + +# src/media_select.c:515 +# src/media_select.c:481 +# src/media_select.c:353 +#: ../src/wdgt-media-select.c:499 +#, c-format +msgid "%d per sheet" +msgstr "%d par feuille" + +# src/media_select.c:522 +# src/media_select.c:488 +# src/media_select.c:367 +#: ../src/wdgt-media-select.c:529 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +# src/media_select.c:522 +# src/media_select.c:488 +# src/media_select.c:372 +#: ../src/wdgt-media-select.c:534 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: ../src/wdgt-media-select.c:545 ../src/wdgt-media-select.c:559 +#, c-format +msgid "%s %s diameter" +msgstr "%s %s diamètre" + +#: ../src/wdgt-media-select.c:549 ../src/wdgt-media-select.c:563 +#, c-format +msgid "%.5g %s diameter" +msgstr "%.5g %s diamètre" + +#: ../src/wdgt-media-select.c:638 +msgid "No match." +msgstr "Aucune correspondance." + +#: ../src/wdgt-media-select.c:639 +msgid "Try selecting a different page size or category." +msgstr "Essayez de sélectionner une taille ou une catégorie de page différente." + +# src/merge_ui_text.c:334 +# src/merge_ui_text.c:334 +#. This is the default custom color +#: ../src/mygal/color-palette.c:389 +msgid "custom" +msgstr "personnalisé" + +# src/prop_bc.c:204 src/prop_fill.c:186 src/prop_line.c:203 +# src/prop_text.c:263 +# src/prop_bc.c:210 src/prop_fill.c:184 src/prop_line.c:209 +# src/prop_text.c:247 +# src/prop_bc.c:188 src/prop_fill.c:166 src/prop_line.c:189 +# src/prop_text.c:234 +# src/prop_bc.c:188 src/prop_fill.c:166 src/prop_line.c:189 +# src/prop_text.c:234 +#. "Custom" color - we'll pop up a GtkColorButton +#: ../src/mygal/color-palette.c:431 +msgid "Custom Color:" +msgstr "Couleur personnalisée :" + +#: ../src/mygal/color-palette.c:439 +msgid "Choose Custom Color" +msgstr "Choisir une couleur personnalisée" + +#: ../src/mygal/color-palette.c:572 +msgid "black" +msgstr "noir" + +#: ../src/mygal/color-palette.c:573 +msgid "light brown" +msgstr "brun clair" + +#: ../src/mygal/color-palette.c:574 +msgid "brown gold" +msgstr "brun jaune" + +#: ../src/mygal/color-palette.c:575 +msgid "dark green #2" +msgstr "vert foncé n°2" + +#: ../src/mygal/color-palette.c:576 +msgid "navy" +msgstr "bleu marine" + +#: ../src/mygal/color-palette.c:577 ../src/mygal/color-palette.c:633 +msgid "dark blue" +msgstr "bleu foncé" + +#: ../src/mygal/color-palette.c:578 +msgid "purple #2" +msgstr "violet n°2" + +#: ../src/mygal/color-palette.c:579 +msgid "very dark gray" +msgstr "gris très foncé" + +#: ../src/mygal/color-palette.c:582 ../src/mygal/color-palette.c:638 +msgid "dark red" +msgstr "rouge foncé" + +#: ../src/mygal/color-palette.c:583 +msgid "red-orange" +msgstr "rouge orange" + +#: ../src/mygal/color-palette.c:584 +msgid "gold" +msgstr "jaune" + +#: ../src/mygal/color-palette.c:585 +msgid "dark green" +msgstr "vert foncé" + +#: ../src/mygal/color-palette.c:586 ../src/mygal/color-palette.c:639 +msgid "dull blue" +msgstr "bleu pâle" + +#: ../src/mygal/color-palette.c:587 ../src/mygal/color-palette.c:640 +msgid "blue" +msgstr "bleu" + +#: ../src/mygal/color-palette.c:588 +msgid "dull purple" +msgstr "violet pâle" + +#: ../src/mygal/color-palette.c:589 +msgid "dark grey" +msgstr "gris foncé" + +#: ../src/mygal/color-palette.c:592 +msgid "red" +msgstr "rouge" + +#: ../src/mygal/color-palette.c:593 +msgid "orange" +msgstr "orange" + +#: ../src/mygal/color-palette.c:594 +msgid "lime" +msgstr "tilleul" + +#: ../src/mygal/color-palette.c:595 +msgid "dull green" +msgstr "vert pâle" + +#: ../src/mygal/color-palette.c:596 +msgid "dull blue #2" +msgstr "bleu pâle n°2" + +#: ../src/mygal/color-palette.c:597 +msgid "sky blue #2" +msgstr "bleu ciel n°2" + +#: ../src/mygal/color-palette.c:598 ../src/mygal/color-palette.c:637 +msgid "purple" +msgstr "violet" + +#: ../src/mygal/color-palette.c:599 +msgid "gray" +msgstr "gris" + +# src/item_image.c:283 +# src/item_image.c:283 +# src/item_image.c:268 src/menu.c:113 +# src/item_image.c:268 src/menu.c:113 +#: ../src/mygal/color-palette.c:602 ../src/mygal/color-palette.c:634 +msgid "magenta" +msgstr "magenta" + +#: ../src/mygal/color-palette.c:603 +msgid "bright orange" +msgstr "orange vif" + +#: ../src/mygal/color-palette.c:604 ../src/mygal/color-palette.c:635 +msgid "yellow" +msgstr "jaune" + +# src/prop_vector.c:245 +# src/prop_vector.c:224 +# src/prop_vector.c:224 +#: ../src/mygal/color-palette.c:605 +msgid "green" +msgstr "vert" + +#: ../src/mygal/color-palette.c:606 ../src/mygal/color-palette.c:636 +msgid "cyan" +msgstr "cyan" + +#: ../src/mygal/color-palette.c:607 +msgid "bright blue" +msgstr "bleu vif" + +#: ../src/mygal/color-palette.c:608 ../src/mygal/color-palette.c:625 +msgid "red purple" +msgstr "rouge violet" + +#: ../src/mygal/color-palette.c:609 +msgid "light grey" +msgstr "gris clair" + +#: ../src/mygal/color-palette.c:612 ../src/mygal/color-palette.c:629 +msgid "pink" +msgstr "rose" + +#: ../src/mygal/color-palette.c:613 +msgid "light orange" +msgstr "orange clair" + +#: ../src/mygal/color-palette.c:614 ../src/mygal/color-palette.c:626 +msgid "light yellow" +msgstr "jaune clair" + +#: ../src/mygal/color-palette.c:615 +msgid "light green" +msgstr "vert clair" + +#: ../src/mygal/color-palette.c:616 +msgid "light cyan" +msgstr "cyan clair" + +#: ../src/mygal/color-palette.c:617 ../src/mygal/color-palette.c:627 +msgid "light blue" +msgstr "bleu clair" + +#: ../src/mygal/color-palette.c:618 ../src/mygal/color-palette.c:631 +msgid "light purple" +msgstr "violet clair" + +#: ../src/mygal/color-palette.c:619 +msgid "white" +msgstr "blanc" + +#: ../src/mygal/color-palette.c:624 +msgid "purplish blue" +msgstr "bleu violacé" + +#: ../src/mygal/color-palette.c:628 +msgid "dark purple" +msgstr "violet foncé" + +#: ../src/mygal/color-palette.c:630 +msgid "sky blue" +msgstr "bleu ciel" + +#: ../src/critical-error-handler.c:73 +msgid "gLabels Fatal Error!" +msgstr "Erreur fatale de gLabels !" + +# src/preferences.c:92 +# src/prefs.c:101 +# src/prefs.c:92 +# src/prefs.c:86 +#: ../src/warning-handler.c:73 +msgid "gLabels Error!" +msgstr "Erreur de gLabels !" + +#: ../libglabels/category.c:352 +msgid "" +"Unable to locate category definitions. Libglabels may not be installed " +"correctly!" +msgstr "Impossible de trouver les définitions de catégorie. Il se peut que Libglabels ne soit pas correctement installé." + +#: ../libglabels/template.c:940 +#, c-format +msgid "Generic %s full page" +msgstr "Page entière générique %s" + +#: ../libglabels/template.c:989 +msgid "" +"Unable to locate any template files. Libglabels may not be installed " +"correctly!" +msgstr "Impossible de trouver les fichiers modèles. Il se peut que Libglabels ne soit pas correctement installé." + +#. Create and append an "Other" entry. +#: ../libglabels/paper.c:76 +msgid "Other" +msgstr "Autre" + +#: ../libglabels/paper.c:461 +msgid "" +"Unable to locate paper size definitions. Libglabels may not be installed " +"correctly!" +msgstr "Impossible de trouver les définitions de tailles de papier. Il se peut que Libglabels ne soit pas correctement installé." + +#. This should always be an id, but just in case a name +#. slips by! +#: ../libglabels/xml-template.c:217 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "Taille de papier avec id « %s » inconnue, essai avec le nom" + +#: ../libglabels/xml-template.c:227 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "Identifiant ou nom de taille de papier « %s » inconnu" + +#: ../data/glade/merge-properties-dialog.glade.h:1 +msgid "Record selection/preview" +msgstr "Sélection/Aperçu des enregistrements" + +# src/merge_properties.c:131 +# src/merge_properties.c:131 +#: ../data/glade/merge-properties-dialog.glade.h:2 +msgid "Source" +msgstr "Source" + +# src/prop_text.c:214 +# src/prop_text.c:199 +# src/merge_properties.c:143 +# src/merge_properties.c:143 +#: ../data/glade/merge-properties-dialog.glade.h:3 +msgid "Format:" +msgstr "Format :" + +# src/merge_properties.c:158 +# src/merge_properties.c:158 +#: ../data/glade/merge-properties-dialog.glade.h:4 +msgid "Location:" +msgstr "Emplacement :" + +# src/menu.c:86 +# src/menu.c:86 +# src/menu.c:85 +# src/menu.c:85 +#: ../data/glade/merge-properties-dialog.glade.h:5 +msgid "Select all" +msgstr "Tout sélectionner" + +# src/menu.c:86 +# src/menu.c:86 +# src/menu.c:85 +# src/menu.c:85 +#: ../data/glade/merge-properties-dialog.glade.h:6 +msgid "Unselect all" +msgstr "Désélectionner tout" + +#: ../data/glade/merge-properties-dialog.glade.h:7 +#: ../data/glade/object-editor.glade.h:39 +msgid "dialog1" +msgstr "dialog1" + +# src/file.c:98 +# src/file.c:98 +# src/file.c:109 +# src/file.c:109 +#: ../data/glade/new-label-dialog.glade.h:1 +msgid "Label orientation" +msgstr "Orientation de l'étiquette" + +# src/file.c:87 +# src/file.c:87 +# src/file.c:98 +# src/file.c:98 +#: ../data/glade/new-label-dialog.glade.h:2 +msgid "Media type" +msgstr "Type de média" + +# src/prop_bc.c:202 +# src/prop_bc.c:182 +# src/prop_bc.c:182 +#: ../data/glade/object-editor.glade.h:2 +#, no-c-format +msgid "%" +msgstr "%" + +#: ../data/glade/object-editor.glade.h:3 +msgid "00000000000 00000" +msgstr "00000000000 00000" + +#: ../data/glade/object-editor.glade.h:4 +msgid "Xxx object properties" +msgstr "Xxx Propriétés de l'objet" + +# src/prop_text.c:277 +# src/prop_text.c:264 +# src/prop_text.c:248 +# src/prop_text.c:248 +#: ../data/glade/object-editor.glade.h:5 ../data/glade/prefs-dialog.glade.h:7 +msgid "Alignment:" +msgstr "Alignement :" + +#: ../data/glade/object-editor.glade.h:6 +msgid "Allow merge to automatically shrink text" +msgstr "Permettre à la fusion de diminuer automatiquement la taille du texte" + +# src/prop_vector.c:207 +# src/prop_vector.c:228 +# src/prop_vector.c:207 +# src/prop_vector.c:207 +#: ../data/glade/object-editor.glade.h:7 +msgid "Angle:" +msgstr "Angle :" + +#: ../data/glade/object-editor.glade.h:8 +msgid "Checksum" +msgstr "Somme de contrôle" + +# src/prop_bc.c:204 src/prop_fill.c:186 src/prop_line.c:203 +# src/prop_text.c:263 +# src/prop_bc.c:210 src/prop_fill.c:184 src/prop_line.c:209 +# src/prop_text.c:247 +# src/prop_bc.c:188 src/prop_fill.c:166 src/prop_line.c:189 +# src/prop_text.c:234 +# src/prop_bc.c:188 src/prop_fill.c:166 src/prop_line.c:189 +# src/prop_text.c:234 +#: ../data/glade/object-editor.glade.h:9 ../data/glade/prefs-dialog.glade.h:8 +msgid "Color:" +msgstr "Couleur :" + +#: ../data/glade/object-editor.glade.h:11 +msgid "Enable shadow" +msgstr "Activer l'ombrage" + +# src/item_box.c:274 src/item_ellipse.c:279 +# src/item_box.c:274 src/item_ellipse.c:279 +# src/item_box.c:258 src/item_ellipse.c:260 +# src/item_box.c:258 src/item_ellipse.c:260 +#: ../data/glade/object-editor.glade.h:12 +msgid "Family:" +msgstr "Famille :" + +# src/item_box.c:274 src/item_ellipse.c:279 +# src/item_box.c:274 src/item_ellipse.c:279 +# src/item_box.c:258 src/item_ellipse.c:260 +# src/item_box.c:258 src/item_ellipse.c:260 +#: ../data/glade/object-editor.glade.h:13 +msgid "File:" +msgstr "Fichier :" + +# src/item_box.c:274 src/item_ellipse.c:279 +# src/item_box.c:274 src/item_ellipse.c:279 +# src/item_box.c:258 src/item_ellipse.c:260 +# src/item_box.c:258 src/item_ellipse.c:260 +#: ../data/glade/object-editor.glade.h:14 +msgid "Fill" +msgstr "Remplissage" + +# src/prop_size.c:220 +# src/prop_size.c:198 +# src/prop_size.c:198 +#: ../data/glade/object-editor.glade.h:15 +#: ../data/glade/template-designer.glade.h:31 +msgid "Height:" +msgstr "Hauteur :" + +# src/prop_text_entry.c:196 +# src/prop_text_entry.c:196 +#: ../data/glade/object-editor.glade.h:17 +msgid "Insert merge field" +msgstr "Insérer un champ de fusion" + +# src/prop_bc_data.c:196 src/prop_text_entry.c:180 +# src/prop_bc_data.c:196 src/prop_text_entry.c:180 +#: ../data/glade/object-editor.glade.h:18 +msgid "Key:" +msgstr "Clé :" + +# src/prop_vector.c:196 +# src/prop_vector.c:202 +# src/prop_vector.c:183 +# src/prop_vector.c:183 +#: ../data/glade/object-editor.glade.h:19 +msgid "Length:" +msgstr "Longueur :" + +#: ../data/glade/object-editor.glade.h:21 +#: ../data/glade/prefs-dialog.glade.h:12 +msgid "Line Spacing:" +msgstr "Espacement :" + +# src/prop_bc_data.c:176 +# src/prop_bc_data.c:176 +#: ../data/glade/object-editor.glade.h:22 +msgid "Literal:" +msgstr "Littéral :" + +#: ../data/glade/object-editor.glade.h:23 +msgid "Opacity:" +msgstr "Opacité :" + +# src/item_barcode.c:362 src/item_barcode.c:365 src/item_box.c:291 +# src/item_ellipse.c:296 src/item_image.c:315 src/item_line.c:289 +# src/item_text.c:487 src/item_text.c:490 +# src/item_barcode.c:368 src/item_barcode.c:371 src/item_box.c:291 +# src/item_ellipse.c:296 src/item_image.c:315 src/item_line.c:289 +# src/item_text.c:487 src/item_text.c:490 +# src/item_barcode.c:345 src/item_barcode.c:348 src/item_box.c:275 +# src/item_ellipse.c:277 src/item_image.c:318 src/item_line.c:274 +# src/item_text.c:500 src/item_text.c:503 +# src/item_barcode.c:345 src/item_barcode.c:348 src/item_box.c:275 +# src/item_ellipse.c:277 src/item_image.c:318 src/item_line.c:274 +# src/item_text.c:500 src/item_text.c:503 +#: ../data/glade/object-editor.glade.h:24 +msgid "Position" +msgstr "Position" + +# src/item_image.c:341 +# src/item_image.c:340 +# src/item_image.c:342 +# src/item_image.c:342 +#: ../data/glade/object-editor.glade.h:25 +msgid "Reset image size" +msgstr "Restaurer la taille d'image" + +# src/menu.c:86 +# src/menu.c:86 +# src/menu.c:85 +# src/menu.c:85 +#: ../data/glade/object-editor.glade.h:26 +msgid "Select A File" +msgstr "Sélectionner un fichier" + +#: ../data/glade/object-editor.glade.h:27 +msgid "Shadow" +msgstr "Ombre" + +# src/item_box.c:302 src/item_ellipse.c:307 src/item_image.c:326 +# src/item_line.c:300 +# src/item_box.c:302 src/item_ellipse.c:307 src/item_image.c:326 +# src/item_line.c:300 +# src/item_box.c:286 src/item_ellipse.c:288 src/item_image.c:329 +# src/item_line.c:285 +# src/item_box.c:286 src/item_ellipse.c:288 src/item_image.c:329 +# src/item_line.c:285 +#: ../data/glade/object-editor.glade.h:28 +msgid "Size" +msgstr "Taille" + +# src/item_box.c:302 src/item_ellipse.c:307 src/item_image.c:326 +# src/item_line.c:300 +# src/item_box.c:302 src/item_ellipse.c:307 src/item_image.c:326 +# src/item_line.c:300 +# src/item_box.c:286 src/item_ellipse.c:288 src/item_image.c:329 +# src/item_line.c:285 +# src/item_box.c:286 src/item_ellipse.c:288 src/item_image.c:329 +# src/item_line.c:285 +#: ../data/glade/object-editor.glade.h:29 +msgid "Size:" +msgstr "Taille :" + +# src/item_barcode.c:347 +# src/item_barcode.c:353 +# src/item_barcode.c:330 +# src/item_barcode.c:330 +#: ../data/glade/object-editor.glade.h:30 +msgid "Style" +msgstr "Style" + +# src/item_barcode.c:347 +# src/item_barcode.c:353 +# src/item_barcode.c:330 +# src/item_barcode.c:330 +#: ../data/glade/object-editor.glade.h:31 +msgid "Style:" +msgstr "Style :" + +# src/prop_line.c:188 +# src/prop_line.c:187 src/prop_size.c:202 +# src/prop_line.c:169 src/prop_size.c:182 +# src/prop_line.c:169 src/prop_size.c:182 +#: ../data/glade/object-editor.glade.h:33 +#: ../data/glade/prefs-dialog.glade.h:20 +#: ../data/glade/template-designer.glade.h:62 +msgid "Width:" +msgstr "Largeur :" + +#: ../data/glade/object-editor.glade.h:34 +msgid "X Offset:" +msgstr "Décalage X :" + +# src/prop_position.c:192 +# src/prop_position.c:173 +# src/prop_position.c:173 +#: ../data/glade/object-editor.glade.h:35 +msgid "X:" +msgstr "X :" + +#: ../data/glade/object-editor.glade.h:36 +msgid "Y Offset:" +msgstr "Décalage Y :" + +# src/prop_position.c:212 +# src/prop_position.c:191 +# src/prop_position.c:191 +#: ../data/glade/object-editor.glade.h:37 +msgid "Y:" +msgstr "Y :" + +# src/prop_vector.c:245 +# src/prop_vector.c:224 +# src/prop_vector.c:224 +#: ../data/glade/object-editor.glade.h:38 +msgid "degrees" +msgstr "degrés" + +#: ../data/glade/object-editor.glade.h:40 +msgid "digits:" +msgstr "" + +# src/prop_text.c:214 +# src/prop_text.c:199 +# src/merge_properties.c:143 +# src/merge_properties.c:143 +#: ../data/glade/object-editor.glade.h:41 +msgid "format:" +msgstr "format :" + +#: ../data/glade/prefs-dialog.glade.h:1 +msgid " " +msgstr " " + +#: ../data/glade/prefs-dialog.glade.h:2 +msgid "Default page size" +msgstr "Taille de page par défaut" + +#: ../data/glade/prefs-dialog.glade.h:3 +msgid "Fill" +msgstr "Remplissage" + +#: ../data/glade/prefs-dialog.glade.h:4 +msgid "Line" +msgstr "Ligne" + +#: ../data/glade/prefs-dialog.glade.h:5 +msgid "Text" +msgstr "Texte" + +#: ../data/glade/prefs-dialog.glade.h:6 +msgid "Units" +msgstr "Unités" + +# src/prop_text.c:214 +# src/prop_text.c:199 +# src/prop_text.c:181 +# src/prop_text.c:181 +#: ../data/glade/prefs-dialog.glade.h:9 +msgid "Font:" +msgstr "Police :" + +#: ../data/glade/prefs-dialog.glade.h:10 +msgid "ISO A4" +msgstr "ISO A4" + +# src/prefs.c:265 +# src/prefs.c:243 +# src/prefs.c:237 +#: ../data/glade/prefs-dialog.glade.h:11 +msgid "Inches" +msgstr "Pouces" + +# src/prop_bc.c:189 +# src/prop_bc.c:187 +# src/prop_bc.c:168 +# src/prop_bc.c:168 +#: ../data/glade/prefs-dialog.glade.h:13 +msgid "Locale" +msgstr "Localisation" + +# src/prefs.c:271 +# src/prefs.c:250 +# src/prefs.c:244 +#: ../data/glade/prefs-dialog.glade.h:14 +msgid "Millimeters" +msgstr "Millimètres" + +#: ../data/glade/prefs-dialog.glade.h:15 +msgid "Object defaults" +msgstr "Paramètres par défaut pour les objets" + +# src/print.c:149 +# src/prefs.c:259 +# src/prefs.c:237 +# src/prefs.c:231 +#: ../data/glade/prefs-dialog.glade.h:16 +msgid "Points" +msgstr "Points" + +#: ../data/glade/prefs-dialog.glade.h:17 +msgid "Select default properties for new objects." +msgstr "Sélectionner les propriétés par défaut pour les nouveaux objets." + +#: ../data/glade/prefs-dialog.glade.h:18 +msgid "Select locale specific behavior." +msgstr "Sélectionnez les paramètres de localisation" + +#. Most popular (at top of list) +#: ../data/glade/prefs-dialog.glade.h:19 +#: ../data/templates/paper-sizes.xml.h:29 +msgid "US Letter" +msgstr "Letter US" + +# src/print.c:171 +# src/print.c:171 +# src/print.c:186 +# src/print_dialog.c:141 +#: ../data/glade/print-custom-widget.glade.h:1 +msgid "Options" +msgstr "Options" + +#: ../data/glade/print-custom-widget.glade.h:2 +msgid "Print control (Merge)" +msgstr "Contrôle d'impression (fusion)" + +#: ../data/glade/print-custom-widget.glade.h:3 +msgid "Print control (Simple)" +msgstr "Contrôle d'impression (simple)" + +#: ../data/glade/property-bar.glade.h:1 +msgid "Bold" +msgstr "Gras" + +# src/item_barcode.c:337 +# src/item_barcode.c:343 src/prefs.c:243 +# src/item_barcode.c:320 src/prefs.c:221 +# src/item_barcode.c:320 src/prefs.c:215 +#: ../data/glade/property-bar.glade.h:2 +msgid "Center align" +msgstr "Centrer" + +# src/mdi.c:482 +# src/mdi.c:488 +# src/mdi.c:459 +# src/mdi.c:459 +#: ../data/glade/property-bar.glade.h:4 +msgid "Font family" +msgstr "Famille de police" + +# src/mdi.c:482 +# src/mdi.c:488 +# src/mdi.c:459 +# src/mdi.c:459 +#: ../data/glade/property-bar.glade.h:5 +msgid "Font size" +msgstr "Taille de police" + +#: ../data/glade/property-bar.glade.h:6 +msgid "Italic" +msgstr "Italique" + +#: ../data/glade/property-bar.glade.h:7 +msgid "Left align" +msgstr "Aligner à gauche" + +#: ../data/glade/property-bar.glade.h:9 +msgid "Line width" +msgstr "Largeur de la ligne" + +#: ../data/glade/property-bar.glade.h:10 +msgid "Right align" +msgstr "Aligner à droite" + +#: ../data/glade/property-bar.glade.h:11 +msgid "Text Color" +msgstr "Couleur du texte" + +#: ../data/glade/property-bar.glade.h:12 +msgid "Text color" +msgstr "Couleur du texte" + +#: ../data/glade/template-designer.glade.h:1 +msgid " " +msgstr " " + +#: ../data/glade/template-designer.glade.h:2 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "(ex : « Étiquettes de publipostage », « Cartes de visite », ...)" + +#: ../data/glade/template-designer.glade.h:3 +msgid "(e.g., 8163A)" +msgstr "(ex : 8163A)" + +#: ../data/glade/template-designer.glade.h:4 +msgid "(e.g., Avery, Acme, ...)" +msgstr "(ex : Avery, Acme, ...)" + +#: ../data/glade/template-designer.glade.h:5 +msgid "1. Outer radius:" +msgstr "1. Rayon extérieur :" + +#: ../data/glade/template-designer.glade.h:6 +msgid "1. Radius:" +msgstr "1. Rayon :" + +# src/prop_line.c:188 +# src/prop_line.c:187 src/prop_size.c:202 +# src/prop_line.c:169 src/prop_size.c:182 +# src/prop_line.c:169 src/prop_size.c:182 +#: ../data/glade/template-designer.glade.h:7 +msgid "1. Width:" +msgstr "1. Largeur :" + +# src/prop_size.c:220 +# src/prop_size.c:198 +# src/prop_size.c:198 +#: ../data/glade/template-designer.glade.h:8 +msgid "2. Height:" +msgstr "2. Hauteur :" + +#: ../data/glade/template-designer.glade.h:9 +msgid "2. Inner radius:" +msgstr "2. Rayon Intérieur :" + +#: ../data/glade/template-designer.glade.h:10 +msgid "2. Waste (overprint allowed):" +msgstr "2. Déchet (impression en surcharge autorisée) :" + +#: ../data/glade/template-designer.glade.h:11 +msgid "3. Clipping width:" +msgstr "3. Largeur de rognure :" + +#: ../data/glade/template-designer.glade.h:12 +msgid "3. Margin" +msgstr "3. Marge" + +#: ../data/glade/template-designer.glade.h:13 +msgid "3. Round (radius of corner):" +msgstr "3. Arrondi (rayon du coin) :" + +#: ../data/glade/template-designer.glade.h:14 +msgid "4. Clipping height:" +msgstr "4. Hauteur de rognure :" + +#: ../data/glade/template-designer.glade.h:15 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "4. Déchet horiz. (impression en surcharge autorisée) :" + +#: ../data/glade/template-designer.glade.h:16 +msgid "5. Vert. waste (overprint allowed):" +msgstr "5. Déchet vert. (impression en surcharge autorisée) :" + +#: ../data/glade/template-designer.glade.h:17 +msgid "5. Waste (overprint allowed):" +msgstr "5. Déchet (impression en surcharge autorisée) :" + +#: ../data/glade/template-designer.glade.h:18 +msgid "6. Margin" +msgstr "6. Marge" + +#: ../data/glade/template-designer.glade.h:19 +msgid "Brand/Manufacturer:" +msgstr "Marque/Fabricant :" + +#: ../data/glade/template-designer.glade.h:20 +msgid "CD/DVD (including credit card CDs)" +msgstr "CD/DVD (y compris CD au format carte de crédit)" + +#: ../data/glade/template-designer.glade.h:21 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "" +"Félicitations !\n" +"Vous avez terminé la création d'un patron gLabels.\n" +"Si vous voulez accepter et sauver votre création, cliquez sur « Appliquer ».\n" +"\n" +"Dans le cas contraire, vous pouvez cliquer sur « Annuler » pour abandonner " +"votre création ou « Précédent » pour continuer d'éditer cette création." + +# src/media_select.c:216 +# src/media_select.c:242 +# src/media_select.c:222 +# src/media_select.c:222 +#: ../data/glade/template-designer.glade.h:28 +msgid "Description:" +msgstr "Description :" + +#: ../data/glade/template-designer.glade.h:29 +msgid "Distance from left edge (x0):" +msgstr "Distance par rapport au bord gauche (x0) :" + +#: ../data/glade/template-designer.glade.h:30 +msgid "Distance from top edge (y0):" +msgstr "Distance pas rapport au bord haut (y0) :" + +#: ../data/glade/template-designer.glade.h:32 +msgid "Horizontal pitch (dx):" +msgstr "Espacement horizontal (dx) :" + +#: ../data/glade/template-designer.glade.h:33 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" +"Combien de dispositions votre patron contiendra-t-il ?\n" +"\n" +"Une disposition est un ensemble d'étiquettes ou de cartes qui peuvent être " +"rangés sur une simple grille.\n" +"La plupart des patrons n'ont besoin que d'une disposition, comme pour le " +"premier exemple.\n" +"Le deuxième exemple illustre le cas où deux dispositions sont nécessaires." + +# src/media_select.c:231 +# src/media_select.c:257 +# src/media_select.c:237 +# src/media_select.c:237 +#: ../data/glade/template-designer.glade.h:38 +msgid "Layout #1" +msgstr "Disposition n°1" + +# src/media_select.c:231 +# src/media_select.c:257 +# src/media_select.c:237 +# src/media_select.c:237 +#: ../data/glade/template-designer.glade.h:39 +msgid "Layout #2" +msgstr "Disposition n°2" + +#: ../data/glade/template-designer.glade.h:40 +msgid "Number across (nx):" +msgstr "Nombre horizontalement (nx) :" + +#: ../data/glade/template-designer.glade.h:41 +msgid "Number down (ny):" +msgstr "Nombre verticalement (ny) :" + +#: ../data/glade/template-designer.glade.h:42 +msgid "Number of layouts:" +msgstr "Nombre de dispositions :" + +# src/media_select.c:221 +# src/media_select.c:247 +# src/media_select.c:227 +# src/media_select.c:227 +#: ../data/glade/template-designer.glade.h:43 +#: ../data/glade/wdgt-media-select.glade.h:2 +msgid "Page size:" +msgstr "Taille de page :" + +#: ../data/glade/template-designer.glade.h:44 +msgid "Part #:" +msgstr "N° Ref :" + +#: ../data/glade/template-designer.glade.h:45 +msgid "" +"Please enter the following identifying information about the template " +"stationery." +msgstr "Entrez les informations suivantes à propos du fabricant de papier." + +#: ../data/glade/template-designer.glade.h:46 +msgid "Please enter the following layout information." +msgstr "Entrez les informations suivantes sur la disposition." + +#: ../data/glade/template-designer.glade.h:47 +msgid "" +"Please enter the following size parameters of a single label in your " +"template." +msgstr "Entrez les paramètres de taille suivants pour une étiquette." + +#: ../data/glade/template-designer.glade.h:48 +msgid "" +"Please enter the following size parameters of a single label or card in your " +"template." +msgstr "Entrez les paramètres de taille suivant pour une carte ou une étiquette." + +#: ../data/glade/template-designer.glade.h:49 +msgid "Please select the basic shape of the labels or cards." +msgstr "Sélectionnez la forme de base des cartes ou des étiquettes." + +#: ../data/glade/template-designer.glade.h:50 +msgid "Please select the page size of the template stationery." +msgstr "Sélectionnez la taille du papier." + +# src/print_copies_merge.c:206 +# src/print_merge.c:179 +#: ../data/glade/template-designer.glade.h:51 +msgid "Print test sheet" +msgstr "Imprimer une page de tests" + +#: ../data/glade/template-designer.glade.h:52 +msgid "Rectangular or square (can have rounded corners)" +msgstr "Rectangulaire ou carré (éventuellement à bords arrondis)" + +#: ../data/glade/template-designer.glade.h:53 +msgid "Round" +msgstr "Rond" + +#: ../data/glade/template-designer.glade.h:54 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" +"Patron nécessitant\n" +"deux dispositions." + +#: ../data/glade/template-designer.glade.h:56 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" +"Patron nécessitant\n" +"une disposition." + +#: ../data/glade/template-designer.glade.h:58 +msgid "Vertical pitch (dy):" +msgstr "Espacement vertical (dy) :" + +#: ../data/glade/template-designer.glade.h:59 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" +"Bienvenue dans le créateur de patrons de gLabels.\n" +"Ce questionnaire va vous aider à créer un patron personnalisé pour glabels." + +#: ../data/glade/template-designer.glade.h:63 +msgid "cd_size_page" +msgstr "cd_size_page" + +#: ../data/glade/template-designer.glade.h:64 +msgid "finish_page" +msgstr "finish_page" + +#: ../data/glade/template-designer.glade.h:66 +msgid "layout_page" +msgstr "layout_page" + +#: ../data/glade/template-designer.glade.h:67 +msgid "name_page" +msgstr "name_page" + +#: ../data/glade/template-designer.glade.h:68 +msgid "nlayouts_page" +msgstr "nlayouts_page" + +#: ../data/glade/template-designer.glade.h:69 +msgid "pg_size_page" +msgstr "pg_size_page" + +#: ../data/glade/template-designer.glade.h:70 +msgid "rect_size_page" +msgstr "rect_size_page" + +#: ../data/glade/template-designer.glade.h:71 +msgid "round_size_page" +msgstr "round_size_page" + +#: ../data/glade/template-designer.glade.h:72 +msgid "shape_page" +msgstr "shape_page" + +#: ../data/glade/template-designer.glade.h:73 +msgid "start_page" +msgstr "start_page" + +#: ../data/glade/wdgt-media-select.glade.h:1 +msgid "Category:" +msgstr "Catégorie :" + +# src/rotate_select.c:187 +# src/rotate_select.c:187 +# src/rotate_select.c:167 +# src/rotate_select.c:169 +#: ../data/glade/wdgt-rotate-label.glade.h:1 +msgid "Rotate" +msgstr "Rotation" + +#. Other ISO A series sizes +#: ../data/templates/paper-sizes.xml.h:2 +msgid "A0" +msgstr "A0" + +#: ../data/templates/paper-sizes.xml.h:3 +msgid "A1" +msgstr "A1" + +#: ../data/templates/paper-sizes.xml.h:4 +msgid "A10" +msgstr "A10" + +#: ../data/templates/paper-sizes.xml.h:5 +msgid "A2" +msgstr "A2" + +#: ../data/templates/paper-sizes.xml.h:6 +msgid "A3" +msgstr "A3" + +#: ../data/templates/paper-sizes.xml.h:7 +msgid "A4" +msgstr "A4" + +#: ../data/templates/paper-sizes.xml.h:8 +msgid "A5" +msgstr "A5" + +#: ../data/templates/paper-sizes.xml.h:9 +msgid "A6" +msgstr "A6" + +#: ../data/templates/paper-sizes.xml.h:10 +msgid "A7" +msgstr "A7" + +#: ../data/templates/paper-sizes.xml.h:11 +msgid "A8" +msgstr "A8" + +#: ../data/templates/paper-sizes.xml.h:12 +msgid "A9" +msgstr "A9" + +#. ISO B series sizes +#: ../data/templates/paper-sizes.xml.h:14 +msgid "B0" +msgstr "B0" + +#: ../data/templates/paper-sizes.xml.h:15 +msgid "B1" +msgstr "B1" + +#: ../data/templates/paper-sizes.xml.h:16 +msgid "B10" +msgstr "B10" + +#: ../data/templates/paper-sizes.xml.h:17 +msgid "B2" +msgstr "B2" + +#: ../data/templates/paper-sizes.xml.h:18 +msgid "B3" +msgstr "B3" + +#: ../data/templates/paper-sizes.xml.h:19 +msgid "B4" +msgstr "B4" + +#: ../data/templates/paper-sizes.xml.h:20 +msgid "B5" +msgstr "B5" + +#: ../data/templates/paper-sizes.xml.h:21 +msgid "B6" +msgstr "B6" + +#: ../data/templates/paper-sizes.xml.h:22 +msgid "B7" +msgstr "B7" + +#: ../data/templates/paper-sizes.xml.h:23 +msgid "B8" +msgstr "B8" + +#: ../data/templates/paper-sizes.xml.h:24 +msgid "B9" +msgstr "B9" + +#: ../data/templates/paper-sizes.xml.h:25 +msgid "US Executive" +msgstr "Exécutif US" + +#. Other US paper sizes +#: ../data/templates/paper-sizes.xml.h:27 +msgid "US Legal" +msgstr "Légal US" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:2 +#: ../data/templates/zweckform-iso-templates.xml.h:2 +msgid "Address Labels" +msgstr "Étiquettes d'adresses" + +#. =================================================================== +#. ============================================================ +#. =================================================================== +#. ====================================================== +#: ../data/templates/avery-us-templates.xml.h:4 +#: ../data/templates/avery-iso-templates.xml.h:4 +#: ../data/templates/zweckform-iso-templates.xml.h:6 +#: ../data/templates/misc-us-templates.xml.h:4 +#: ../data/templates/misc-iso-templates.xml.h:12 +msgid "Business Cards" +msgstr "Cartes de visite" + +# src/print_copies.c:210 +# src/print_copies.c:210 +# src/print_copies.c:188 +# src/print_copies.c:187 +#. =================================================================== +#. =============================================================== +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:6 +#: ../data/templates/avery-iso-templates.xml.h:10 +#: ../data/templates/zweckform-iso-templates.xml.h:8 +#: ../data/templates/misc-us-templates.xml.h:8 +#: ../data/templates/misc-iso-templates.xml.h:16 +msgid "CD/DVD Labels" +msgstr "Étiquettes de CD/DVD" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:8 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "Étiquettes de CD/DVD (étiquettes de disque)" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:10 +msgid "CD/DVD Labels (Spine Labels)" +msgstr "Étiquettes de CD/DVD (étiquettes de boîtier)" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:12 +msgid "Diskette Labels" +msgstr "Étiquettes de disquette" + +# src/print_copies.c:210 +# src/print_copies.c:210 +# src/print_copies.c:188 +# src/print_copies.c:187 +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:14 +msgid "Filing Labels" +msgstr "" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:16 +msgid "Full Sheet Labels" +msgstr "" + +# src/print_copies_merge.c:197 +# src/print_merge.c:170 +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:18 +msgid "Large Round Labels" +msgstr "" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:20 +msgid "Name Badge Labels" +msgstr "" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:22 +msgid "Return Address Labels" +msgstr "Étiquettes d'adresse de retour" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:24 +msgid "Shipping Labels" +msgstr "Étiquettes postales" + +# src/print_copies_merge.c:197 +# src/print_merge.c:170 +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:26 +msgid "Small Round Labels" +msgstr "" + +# src/print_copies.c:210 +# src/print_copies.c:210 +# src/print_copies.c:188 +# src/print_copies.c:187 +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:28 +msgid "Square Labels" +msgstr "Étiquettes carrées" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:30 +msgid "Video Tape Face Labels" +msgstr "Étiquettes de face de cassette vidéo" + +#. =================================================================== +#: ../data/templates/avery-us-templates.xml.h:32 +msgid "Video Tape Spine Labels" +msgstr "Étiquettes de dos de cassette vidéo" + +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:2 +msgid "Address labels" +msgstr "Étiquettes d'adresse" + +#. =============================================================== +#: ../data/templates/avery-iso-templates.xml.h:6 +msgid "CD Booklet" +msgstr "Livret de CD" + +#. =============================================================== +#: ../data/templates/avery-iso-templates.xml.h:8 +msgid "CD Inlet" +msgstr "" + +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:12 +msgid "Diskette labels" +msgstr "Étiquettes de disquette" + +#. =============================================================== +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:14 +#: ../data/templates/zweckform-iso-templates.xml.h:14 +#: ../data/templates/misc-iso-templates.xml.h:30 +msgid "Mailing Labels" +msgstr "Étiquettes de publipostage" + +# src/print_copies.c:210 +# src/print_copies.c:210 +# src/print_copies.c:188 +# src/print_copies.c:187 +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:16 +msgid "Mailing labels" +msgstr "Étiquettes de publipostage" + +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:18 +msgid "Mini Address Labels" +msgstr "Étiquettes de mini-adresse" + +# src/file.c:183 +# src/file.c:183 +# src/file.c:213 +# src/file.c:213 +#. =================================================================== +#: ../data/templates/avery-iso-templates.xml.h:20 +msgid "Shipping labels" +msgstr "Étiquettes postales" + +#: ../data/templates/categories.xml.h:1 +msgid "Any card" +msgstr "Toute carte" + +# src/file.c:183 +# src/file.c:183 +# src/file.c:213 +# src/file.c:213 +#: ../data/templates/categories.xml.h:2 +msgid "Any label" +msgstr "Toute étiquette" + +#: ../data/templates/categories.xml.h:3 +msgid "Business cards" +msgstr "Cartes de visite" + +#: ../data/templates/categories.xml.h:4 +msgid "CD/DVD or other media" +msgstr "CD/DVD ou autre support" + +#: ../data/templates/categories.xml.h:5 +msgid "Mailing/shipping products" +msgstr "Produits d'expédition" + +#: ../data/templates/categories.xml.h:6 +msgid "Rectangular labels" +msgstr "Étiquettes rectangulaires" + +#: ../data/templates/categories.xml.h:7 +msgid "Round labels" +msgstr "Étiquettes arrondies" + +# src/print_copies_merge.c:197 +# src/print_merge.c:170 +#: ../data/templates/categories.xml.h:8 +msgid "Square labels" +msgstr "Étiquettes carrées" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:4 +#: ../data/templates/misc-iso-templates.xml.h:4 +msgid "Allround Labels" +msgstr "Étiquettes Allround" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:10 +msgid "Correction and Cover-up Labels" +msgstr "Étiquettes de correction et de recouvrement" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:12 +msgid "Lever Arch File Labels" +msgstr "" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:16 +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "Étiquettes de cartes QSL 70mm x 50,8mm" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:18 +msgid "Rectangular Copier Labels" +msgstr "" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:20 +#: ../data/templates/misc-iso-templates.xml.h:38 +msgid "Rectangular Labels" +msgstr "Étiquettes rectangulaires" + +#. =================================================================== +#: ../data/templates/zweckform-iso-templates.xml.h:22 +msgid "Video Labels (back)" +msgstr "Étiquettes vidéo (dos)" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:2 +msgid "Business Card CD" +msgstr "CD carte de visite" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:6 +msgid "CD Template Rectangles" +msgstr "" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:10 +msgid "CD/DVD Labels (Face Only)" +msgstr "Étiquettes de CD/DVD (face uniquement)" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:12 +#: ../data/templates/misc-iso-templates.xml.h:18 +msgid "CD/DVD Labels (face only)" +msgstr "Étiquettes de CD/DVD (face uniquement)" + +# src/print_copies.c:210 +# src/print_copies.c:210 +# src/print_copies.c:188 +# src/print_copies.c:187 +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:14 +msgid "Cassette Labels" +msgstr "Étiquettes de cassette" + +# src/print_copies.c:210 +# src/print_copies.c:210 +# src/print_copies.c:188 +# src/print_copies.c:187 +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:16 +msgid "DLT Labels" +msgstr "Étiquettes DLT" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:18 +msgid "Microtube labels" +msgstr "Étiquettes microtube" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:20 +msgid "Mini-CD Labels" +msgstr "Étiquettes mini-CD" + +#: ../data/templates/misc-us-templates.xml.h:21 +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "" + +#: ../data/templates/misc-us-templates.xml.h:22 +msgid "PRO CD Labels 2-up (Face only)" +msgstr "" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:24 +#: ../data/templates/misc-iso-templates.xml.h:36 +msgid "PRO CD Labels 2-up (face only)" +msgstr "" + +#. =================================================================== +#: ../data/templates/misc-us-templates.xml.h:26 +msgid "Slimline CD Case (rightside up)" +msgstr "" + +#: ../data/templates/misc-us-templates.xml.h:27 +msgid "Slimline CD Case (upside down)" +msgstr "" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:2 +msgid "Agipa 119488: Business Cards" +msgstr "Agipa 119488 : Cartes de visite" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:6 +msgid "Arch File Labels" +msgstr "Étiquettes de dossier d'archives" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:8 +msgid "Arch File Labels (large)" +msgstr "Étiquettes de dossier d'archives (grandes)" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:10 +msgid "Arch File Labels (small)" +msgstr "Étiquettes de dossier d'archives (petites)" + +# src/print_copies.c:210 +# src/print_copies.c:210 +# src/print_copies.c:188 +# src/print_copies.c:187 +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:14 +msgid "CD Labels" +msgstr "Étiquettes de CD" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:20 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "Format standard d'étiquettes de CD/DVD (face uniquement)" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:22 +msgid "Diskette Labels (face only)" +msgstr "Étiquettes de disquette (face uniquement)" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:24 +msgid "EPSON Photo Stickers 16" +msgstr "Autocollants EPSON Photo 16" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:26 +msgid "Etiketten" +msgstr "Étiquettes" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:28 +msgid "Fridge Magnet Stickers" +msgstr "Autocollants magnétiques" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:32 +msgid "Mailing Labels-2 columns" +msgstr "Étiquettes de publipostage (2 colonnes)" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:34 +msgid "Mailing Labels-3 columns" +msgstr "Étiquettes de publipostage (3 colonnes)" + +#. =================================================================== +#: ../data/templates/misc-iso-templates.xml.h:40 +msgid "Video Labels (face only)" +msgstr "Étiquettes de vidéos (face uniquement)" + +#: ../data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers" +msgstr "Crée des étiquettes et des cartes de visite" + +#: ../data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "Créateur d'étiquettes gLabels" + +# src/item_text.c:467 +# src/item_text.c:467 +# src/item_text.c:482 +# src/item_text.c:482 +#: ../data/mime/glabels.keys.in.h:1 ../data/mime/glabels.xml.in.h:1 +msgid "gLabels Project File" +msgstr "Fichier de projet gLabels" + +#: ../barcode-0.98/compat/getopt.c:583 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s : l'option « %s » ambiguë\n" + +#: ../barcode-0.98/compat/getopt.c:607 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s : l'option « --%s » n'autorise pas d'argument\n" + +#: ../barcode-0.98/compat/getopt.c:612 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s : l'option « %c%s » n'autorise pas d'argument\n" + +#: ../barcode-0.98/compat/getopt.c:629 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s : l'option « %s » exige un argument\n" + +#. --option +#: ../barcode-0.98/compat/getopt.c:658 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s : option « --%s » inconnue\n" + +#. +option or -option +#: ../barcode-0.98/compat/getopt.c:662 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s : option « %c%s » inconnue\n" + +#. 1003.2 specifies the format of this message. +#: ../barcode-0.98/compat/getopt.c:688 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s : option -- %c non autorisée\n" + +#: ../barcode-0.98/compat/getopt.c:691 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s : option -- %c non valide\n" + +#: ../barcode-0.98/compat/getopt.c:727 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s : l'option exige un argument -- %c\n" + diff --git a/po/it.po b/po/it.po new file mode 100644 index 00000000..09e23b7e --- /dev/null +++ b/po/it.po @@ -0,0 +1,2427 @@ +# translation of it.po to Italian +# Italian translation of glabels. +# Copyright (C) 2003 THE glabels'S COPYRIGHT HOLDER +# This file is distributed under the same license as the glabels package. +# Andrea , 2003. +# Daniele Medri , 2005. +# +# +msgid "" +msgstr "" +"Project-Id-Version: it\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-06-19 20:43-0400\n" +"PO-Revision-Date: 2005-06-27 09:34+0200\n" +"Last-Translator: Daniele Medri \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit" + +#: src/glabels.c:116 +msgid "Could not initialize Bonobo!\n" +msgstr "Non è possibile inizializzare Bonobo!\n" + +#: src/glabels-batch.c:52 +msgid "print this message" +msgstr "stampa questo messaggio" + +#: src/glabels-batch.c:54 +msgid "print the version of glabels-batch being used" +msgstr "stampa la versione di glabels batch utilizzata" + +#: src/glabels-batch.c:56 +msgid "set output filename (default=\"output.ps\")" +msgstr "imposta il nome del file di output (default=\"output.ps\")" + +#: src/glabels-batch.c:56 src/glabels-batch.c:70 +msgid "filename" +msgstr "nome file" + +#: src/glabels-batch.c:58 +msgid "number of sheets (default=1)" +msgstr "numero di fogli (default=1)" + +#: src/glabels-batch.c:58 +msgid "sheets" +msgstr "fogli" + +#: src/glabels-batch.c:60 +msgid "number of copies (default=1)" +msgstr "numero di copie (default=1)" + +#: src/glabels-batch.c:60 +msgid "copies" +msgstr "copie" + +#: src/glabels-batch.c:62 +msgid "first label on first sheet (default=1)" +msgstr "prima etichetta del primo foglio (default=1)" + +#: src/glabels-batch.c:62 +msgid "first" +msgstr "primo" + +#: src/glabels-batch.c:64 src/print-dialog.c:336 +msgid "print outlines (to test printer alignment)" +msgstr "stampa bordi (per provare l'allineamento della stampante)" + +#: src/glabels-batch.c:66 src/print-dialog.c:344 +msgid "print in reverse (i.e. a mirror image)" +msgstr "stampa al contrario (es. un'immagine riflessa)" + +#: src/glabels-batch.c:68 src/print-dialog.c:351 +msgid "print crop marks" +msgstr "stampa segni di taglio" + +#: src/glabels-batch.c:70 +msgid "input file for merging" +msgstr "file per la stampa unione" + +#: src/glabels-batch.c:107 +msgid "[OPTION...] GLABELS_FILE..." +msgstr "[OPTION...] GLABELS_FILE..." + +#: src/glabels-batch.c:127 +#, c-format +msgid "missing glabels file\n" +msgstr "file di glabels mancante\n" + +#: src/glabels-batch.c:158 +#, c-format +msgid "cannot perform document merge with glabels file %s\n" +msgstr "non è possibile unire i documenti con il file glabels %s\n" + +#: src/glabels-batch.c:182 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "non è possibile aprire il file glabels %s\n" + +#: src/window.c:244 +msgid "(none) - gLabels" +msgstr "(niente) - gLabels" + +#: src/window.c:414 +msgid "(modified)" +msgstr "(modificato)" + +#: src/stock.c:65 data/ui/glabels-ui.xml.h:162 +msgid "_Select Mode" +msgstr "Modalità di _selezione" + +#: src/stock.c:66 data/ui/glabels-ui.xml.h:163 +msgid "_Text" +msgstr "_Testo" + +#: src/stock.c:67 data/ui/glabels-ui.xml.h:148 +msgid "_Line" +msgstr "_Linea" + +#: src/stock.c:68 data/ui/glabels-ui.xml.h:130 +msgid "_Box" +msgstr "_Area" + +#: src/stock.c:69 data/ui/glabels-ui.xml.h:141 +msgid "_Ellipse" +msgstr "_Ellisse" + +#: src/stock.c:70 data/ui/glabels-ui.xml.h:146 +msgid "_Image" +msgstr "_Immagine" + +#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 +msgid "Bar_code" +msgstr "_Codice a barre" + +#: src/stock.c:72 +msgid "_Merge Properties" +msgstr "Proprietà di _unione" + +#: src/stock.c:73 +msgid "Object _Properties" +msgstr "_Proprietà·Oggetto" + +#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 +msgid "Bring to _Front" +msgstr "Porta in _primo piano" + +#: src/stock.c:75 data/ui/glabels-ui.xml.h:109 +msgid "Send to _Back" +msgstr "Porta in _secondo piano" + +#: src/stock.c:76 data/ui/glabels-ui.xml.h:96 +msgid "Rotate _Left" +msgstr "Ruota a sinistra" + +#: src/stock.c:77 data/ui/glabels-ui.xml.h:97 +msgid "Rotate _Right" +msgstr "Ruota a destra" + +#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 +msgid "Flip _Horizontally" +msgstr "Capovolgi _orizzontalmente" + +#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 +msgid "Flip _Vertically" +msgstr "Capovolgi _verticalmente" + +#: src/stock.c:80 data/ui/glabels-ui.xml.h:147 +msgid "_Lefts" +msgstr "_Sinistra" + +#: src/stock.c:81 data/ui/glabels-ui.xml.h:159 +msgid "_Rights" +msgstr "_Destra" + +#: src/stock.c:82 data/ui/glabels-ui.xml.h:131 +msgid "_Centers" +msgstr "_Centro" + +#: src/stock.c:83 data/ui/glabels-ui.xml.h:164 +msgid "_Tops" +msgstr "_In alto" + +#: src/stock.c:84 +msgid "Bottoms" +msgstr "In basso" + +#: src/stock.c:85 +msgid "Centers" +msgstr "Centrato" + +#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 +msgid "Label Ce_nter" +msgstr "Etichetta ce_ntrata" + +#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 +msgid "Fill color" +msgstr "Colore di riempimento" + +#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 +msgid "Line color" +msgstr "Colore Linea" + +#: src/stock.c:90 src/stock.c:92 +msgid "Linked" +msgstr "Collegato" + +#: src/stock.c:91 src/stock.c:93 +msgid "Not Linked" +msgstr "Nessun collegamento" + +#: src/ui-property-bar.c:345 src/object-editor.c:499 +msgid "Default" +msgstr "Predefinito" + +#: src/ui-property-bar.c:360 src/object-editor.c:512 +msgid "No fill" +msgstr "Nessun riempimento" + +#: src/ui-property-bar.c:375 src/object-editor.c:505 +msgid "No line" +msgstr "Nessuna linea" + +#: src/ui-sidebar.c:180 +msgid "Object properties" +msgstr "Proprietà oggetto" + +#: src/commands.c:385 +msgid "" +"A label and business card creation program for GNOME.\n" +" \n" +"Glabels is free software; you can redistribute it and/or modify it under the " +"terms of the GNU General Public License as published by the Free Software " +"Foundation; either version 2 of the License, or (at your option) any later " +"version.\n" +" \n" +"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.\n" +msgstr "" + +#: src/commands.c:399 +msgid "See the file AUTHORS for additional credits," +msgstr "Visualizza il file AUTHORS per informazioni aggiuntive." + +#: src/commands.c:400 +msgid "or visit http://glabels.sourceforge.net/" +msgstr "oppure visita http://glabels.sourceforge.net/" + +#: src/commands.c:409 +msgid " " +msgstr " " + +#: src/commands.c:424 +msgid "glabels" +msgstr "glabels" + +#: src/file.c:100 +msgid "New Label or Card" +msgstr "Nuova etichetta o scheda" + +#: src/file.c:132 src/file.c:304 +msgid "Media Type" +msgstr "Tipo media" + +#: src/file.c:138 src/file.c:310 +msgid "Label orientation" +msgstr "Orientazione etichetta" + +#: src/file.c:269 +msgid "Label properties" +msgstr "Proprietà etichetta" + +#: src/file.c:452 src/file.c:870 +msgid "All files" +msgstr "Tutti i file" + +#: src/file.c:457 src/file.c:875 +msgid "gLabels documents" +msgstr "Documenti di gLabels" + +#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 +msgid "Empty file name selection" +msgstr "Selezione di un nome file vuoto" + +#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 +msgid "Please select a file or supply a valid file name" +msgstr "Per piacere, indica un file o un nome valido" + +#: src/file.c:519 src/file.c:631 +msgid "File does not exist" +msgstr "Il file non esiste" + +#: src/file.c:563 data/ui/glabels-ui.xml.h:74 +msgid "Open" +msgstr "Apri" + +#: src/file.c:565 +msgid "Open label" +msgstr "Apri etichetta" + +#: src/file.c:707 +#, c-format +msgid "Could not open file \"%s\"" +msgstr "Non riesco ad aprire il file \"%s\"" + +#: src/file.c:715 +msgid "Not a supported file format" +msgstr "Non è un formato file supportato" + +#: src/file.c:797 src/file.c:979 src/file.c:1174 +#, c-format +msgid "Could not save file \"%s\"" +msgstr "Non riesco a salvare il file \"%s\"" + +#: src/file.c:805 src/file.c:987 src/file.c:1182 +msgid "Error encountered during save. The file is still not saved." +msgstr "" + +#: src/file.c:848 src/file.c:1048 +#, c-format +msgid "Save \"%s\" as" +msgstr "Salva \"%s\" come" + +#: src/file.c:935 src/file.c:1131 +msgid "Please supply a valid file name" +msgstr "Per piacere, indica un nome file valido" + +#: src/file.c:952 src/file.c:1147 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "Sovrascrivi il file \"%s\"?" + +#: src/file.c:960 src/file.c:1155 +msgid "File already exists." +msgstr "File già esistente." + +#: src/file.c:1271 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "Salva i cambiamenti al documento \"%s\" prima di chiudere?" + +#: src/file.c:1279 +msgid "Your changes will be lost if you don't save them." +msgstr "I tuoi cambiamenti andranno persi se non salvi." + +#: src/file.c:1282 +msgid "Close without saving" +msgstr "Chiudi senza salvare" + +#. Should not happen +#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 +#: data/glade/object-editor.glade.h:37 +msgid "points" +msgstr "punti" + +#: src/prefs.c:158 data/glade/object-editor.glade.h:36 +#: data/glade/template-designer.glade.h:74 +msgid "inches" +msgstr "pollici" + +#: src/prefs.c:160 +msgid "mm" +msgstr "mm" + +#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 +msgid "gLabels Preferences" +msgstr "Preferenze gLabels" + +#. +#. * Submenu: Order +#. +#: src/view.c:3574 data/ui/glabels-ui.xml.h:154 +msgid "_Order" +msgstr "_Ordine" + +#. +#. * Submenu: Rotate/Flip +#. +#: src/view.c:3595 data/ui/glabels-ui.xml.h:160 +msgid "_Rotate/Flip" +msgstr "_Ruota/capovolgi" + +#. +#. * Submenu: Align Horizontally +#. +#: src/view.c:3628 +msgid "Align _Horizontally" +msgstr "Allineamento _orizzontale" + +#. +#. * Submenu: Align Vertically +#. +#: src/view.c:3667 +msgid "Align _Vertically" +msgstr "Allineamento _verticale" + +#: src/view.c:3728 data/ui/glabels-ui.xml.h:137 +msgid "_Delete" +msgstr "Cancella" + +#. Build editor. +#: src/view-box.c:224 +msgid "Box object properties" +msgstr "Proprietà dell'oggetto area" + +#. Build editor. +#: src/view-ellipse.c:224 +msgid "Ellipse object properties" +msgstr "Proprietà dell'oggetto Ellisse" + +#. Build editor. +#: src/view-line.c:224 +msgid "Line object properties" +msgstr "Proprietà dell'oggetto Linea" + +#. Build editor. +#: src/view-image.c:223 +msgid "Image object properties" +msgstr "Proprietà dell'oggetto Immagine" + +#. Build editor. +#: src/view-text.c:251 +msgid "Text object properties" +msgstr "Proprietà dell'oggetto Testo" + +#: src/view-text.c:563 data/glade/object-editor.glade.h:28 +msgid "Text" +msgstr "Testo" + +#. Build editor. +#: src/view-barcode.c:210 +msgid "Barcode object properties" +msgstr "Proprietà dell'oggetto Codice a barre" + +#: src/view-barcode.c:580 src/print.c:1089 +msgid "Invalid barcode data" +msgstr "Codice a barre non valido" + +#: src/merge-properties-dialog.c:231 +msgid "Merge Properties" +msgstr "Proprietà di unione" + +#. ---- Source section ---- +#: src/merge-properties-dialog.c:237 +msgid "Source" +msgstr "Sorgente" + +#: src/merge-properties-dialog.c:245 +msgid "Format:" +msgstr "Formato:" + +#. Location line +#: src/merge-properties-dialog.c:273 +msgid "Location:" +msgstr "Posizione:" + +#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 +msgid "Select merge-database source" +msgstr "Seleziona sorgente unione-database" + +#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 +msgid "N/A" +msgstr "N/A" + +#. ---- Sample Fields section ---- +#: src/merge-properties-dialog.c:300 +msgid "Record selection/preview:" +msgstr "Selezione/anteprima record:" + +#: src/merge-properties-dialog.c:326 +msgid "Select" +msgstr "Seleziona" + +#: src/merge-properties-dialog.c:334 +msgid "Record/Field" +msgstr "Record/campo" + +#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 +msgid "Data" +msgstr "Dati" + +#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:81 +msgid "Print" +msgstr "Stampa" + +#: src/print-dialog.c:281 +msgid "_Job" +msgstr "Lavoro" + +#: src/print-dialog.c:286 +msgid "P_rinter" +msgstr "Stampante" + +#. ----------- Add simple-copies widget ------------ +#: src/print-dialog.c:314 +msgid "Copies" +msgstr "Copie" + +#. ------- Add merge control widget ------------ +#: src/print-dialog.c:322 +msgid "Document merge control" +msgstr "" + +#. ----------- Add custom print options area ------------ +#: src/print-dialog.c:330 +msgid "Options" +msgstr "Opzioni" + +#: src/print-dialog.c:553 src/print-dialog.c:592 +msgid "Print preview" +msgstr "Anteprima di stampa" + +#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 +msgid "gLabels Template Designer" +msgstr "Progettazione di modelli per gLabels" + +#: src/bc.c:60 +msgid "POSTNET (any)" +msgstr "POSTNET (qualsiasi)" + +#: src/bc.c:63 +msgid "POSTNET-5 (ZIP only)" +msgstr "POSTNET-5 (solo ZIP/CAP)" + +#: src/bc.c:66 +msgid "POSTNET-9 (ZIP+4)" +msgstr "POSTNET-9 (ZIP/CAP+4)" + +#: src/bc.c:69 +msgid "POSTNET-11 (DPBC)" +msgstr "POSTNET-11 (DPBC)" + +#: src/bc.c:72 +msgid "EAN (any)" +msgstr "EAN (qualsiasi)" + +#: src/bc.c:75 +msgid "EAN-8" +msgstr "EAN-8" + +#: src/bc.c:78 +msgid "EAN-8 +2" +msgstr "EAN-8 +2" + +#: src/bc.c:81 +msgid "EAN-8 +5" +msgstr "EAN-8 +5" + +#: src/bc.c:84 +msgid "EAN-13" +msgstr "EAN-13" + +#: src/bc.c:87 +msgid "EAN-13 +2" +msgstr "EAN-13 +2" + +#: src/bc.c:90 +msgid "EAN-13 +5" +msgstr "EAN-13 +5" + +#: src/bc.c:93 +msgid "UPC (UPC-A or UPC-E)" +msgstr "UPC (UPC-A o UPC-E)" + +#: src/bc.c:96 +msgid "UPC-A" +msgstr "UPC-A" + +#: src/bc.c:99 +msgid "UPC-A +2" +msgstr "UPC-A +2" + +#: src/bc.c:102 +msgid "UPC-A +5" +msgstr "UPC-A +5" + +#: src/bc.c:105 +msgid "UPC-E" +msgstr "UPC-E" + +#: src/bc.c:108 +msgid "UPC-E +2" +msgstr "UPC-E +2" + +#: src/bc.c:111 +msgid "UPC-E +5" +msgstr "UPC-E +5" + +#: src/bc.c:114 +msgid "ISBN" +msgstr "ISBN" + +#: src/bc.c:117 +msgid "ISBN +5" +msgstr "ISBN +5" + +#: src/bc.c:120 +msgid "Code 39" +msgstr "Code 39" + +#: src/bc.c:123 +msgid "Code 128" +msgstr "Code 128" + +#: src/bc.c:126 +msgid "Code 128C" +msgstr "Code 128C" + +#: src/bc.c:129 +msgid "Code 128B" +msgstr "Code 128B" + +#: src/bc.c:132 +msgid "Interleaved 2 of 5" +msgstr "" + +#: src/bc.c:135 +msgid "Codabar" +msgstr "Codabar" + +#: src/bc.c:138 +msgid "MSI" +msgstr "MSI" + +#: src/bc.c:141 +msgid "Plessey" +msgstr "Plessey" + +#: src/label.c:569 +msgid "Untitled" +msgstr "Senza nome" + +#: src/xml-label.c:176 src/xml-label.c:213 +msgid "xmlParseFile error" +msgstr "" + +#: src/xml-label.c:250 +msgid "No document root" +msgstr "Nessun documento radice" + +#: src/xml-label.c:264 +msgid "Importing from glabels 0.1 format" +msgstr "" + +#: src/xml-label.c:272 +msgid "Importing from glabels 0.4 format" +msgstr "" + +#: src/xml-label.c:279 +msgid "Importing from glabels 1.91 format" +msgstr "" + +#: src/xml-label.c:282 +msgid "bad document, unknown glabels Namespace" +msgstr "" + +#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "" + +#: src/xml-label.c:348 src/xml-label-191.c:165 +#, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "" + +#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 +#, c-format +msgid "bad node = \"%s\"" +msgstr "" + +#: src/xml-label.c:796 src/xml-label-191.c:605 +#, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "" + +#: src/xml-label.c:962 libglabels/xml-template.c:535 +msgid "Utf8 conversion error." +msgstr "Conversione di errore Utf8." + +#: src/xml-label.c:969 libglabels/xml-template.c:542 +msgid "Problem saving xml file." +msgstr "Problema nel salvataggio del file xml" + +#. This should always be an id, but just in case a name +#. slips by! +#: src/xml-label-191.c:680 libglabels/xml-template.c:199 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "" + +#: src/xml-label-191.c:690 libglabels/xml-template.c:209 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "" + +#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 +msgid "None" +msgstr "Nessuno" + +#: src/merge-init.c:53 +msgid "Text file with comma delimeters (CSV)" +msgstr "" + +#: src/merge-init.c:60 +msgid "Text file with colon delimeters" +msgstr "" + +#: src/merge-init.c:67 +msgid "Text file with tab delimeters" +msgstr "" + +#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 +msgid "File:" +msgstr "File:" + +#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 +msgid "Key:" +msgstr "Chiave:" + +#: src/wdgt-print-copies.c:179 +msgid "Sheets:" +msgstr "Fogli:" + +#: src/wdgt-print-copies.c:197 +msgid "Labels" +msgstr "Etichette" + +#: src/wdgt-print-copies.c:200 +msgid "from:" +msgstr "da:" + +#: src/wdgt-print-copies.c:207 +msgid "to:" +msgstr "a:" + +#: src/wdgt-print-merge.c:178 +msgid "Start on label" +msgstr "" + +#: src/wdgt-print-merge.c:186 +msgid "on 1st sheet" +msgstr "nel 1° foglio" + +#: src/wdgt-print-merge.c:195 +msgid "Copies:" +msgstr "Copie:" + +#: src/wdgt-print-merge.c:201 +msgid "Collate" +msgstr "Fascicoli" + +#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 +msgid "Description:" +msgstr "Descrizione:" + +#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 +msgid "Page size:" +msgstr "Dimensioni·pagina:" + +#: src/wdgt-media-select.c:290 +msgid "Label size:" +msgstr "Dimensioni etichetta:" + +#: src/wdgt-media-select.c:301 +msgid "Layout:" +msgstr "Layout:" + +#: src/wdgt-media-select.c:578 +#, c-format +msgid "%d x %d (%d per sheet)" +msgstr "%d x %d (%d per foglio)" + +#: src/wdgt-media-select.c:582 +#, c-format +msgid "%d per sheet" +msgstr "%d per foglio" + +#: src/wdgt-media-select.c:614 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +#: src/wdgt-media-select.c:619 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 +#, c-format +msgid "%s %s diameter" +msgstr "%s %s diametro" + +#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 +#, c-format +msgid "%.5g %s diameter" +msgstr "%.5g %s diametro" + +#: src/wdgt-rotate-label.c:193 +msgid "Rotate" +msgstr "Girare" + +#. This is the default custom color +#: src/mygal/color-palette.c:396 +msgid "custom" +msgstr "personalizzato" + +#. "Custom" color - we'll pop up a GnomeColorPicker +#: src/mygal/color-palette.c:438 +msgid "Custom Color:" +msgstr "Colore personalizzato:" + +#: src/mygal/color-palette.c:446 +msgid "Choose Custom Color" +msgstr "Scegli colore personalizzato" + +#: src/mygal/color-palette.c:579 +msgid "black" +msgstr "nero" + +#: src/mygal/color-palette.c:580 +msgid "light brown" +msgstr "Marrone chiaro" + +#: src/mygal/color-palette.c:581 +msgid "brown gold" +msgstr "" + +#: src/mygal/color-palette.c:582 +msgid "dark green #2" +msgstr "verde scuro #2" + +#: src/mygal/color-palette.c:583 +msgid "navy" +msgstr "" + +#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 +msgid "dark blue" +msgstr "blu scuro" + +#: src/mygal/color-palette.c:585 +msgid "purple #2" +msgstr "" + +#: src/mygal/color-palette.c:586 +msgid "very dark gray" +msgstr "" + +#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 +msgid "dark red" +msgstr "rosso scuro" + +#: src/mygal/color-palette.c:590 +msgid "red-orange" +msgstr "" + +#: src/mygal/color-palette.c:591 +msgid "gold" +msgstr "oro" + +#: src/mygal/color-palette.c:592 +msgid "dark green" +msgstr "verde scuro" + +#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 +msgid "dull blue" +msgstr "" + +#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 +msgid "blue" +msgstr "blu" + +#: src/mygal/color-palette.c:595 +msgid "dull purple" +msgstr "" + +#: src/mygal/color-palette.c:596 +msgid "dark grey" +msgstr "" + +#: src/mygal/color-palette.c:599 +msgid "red" +msgstr "rosso" + +#: src/mygal/color-palette.c:600 +msgid "orange" +msgstr "arancione" + +#: src/mygal/color-palette.c:601 +msgid "lime" +msgstr "tiglio" + +#: src/mygal/color-palette.c:602 +msgid "dull green" +msgstr "" + +#: src/mygal/color-palette.c:603 +msgid "dull blue #2" +msgstr "" + +#: src/mygal/color-palette.c:604 +msgid "sky blue #2" +msgstr "" + +#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 +msgid "purple" +msgstr "viola" + +#: src/mygal/color-palette.c:606 +msgid "gray" +msgstr "grigio" + +#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 +msgid "magenta" +msgstr "" + +#: src/mygal/color-palette.c:610 +msgid "bright orange" +msgstr "" + +#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 +msgid "yellow" +msgstr "giallo" + +#: src/mygal/color-palette.c:612 +msgid "green" +msgstr "verde" + +#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 +msgid "cyan" +msgstr "" + +#: src/mygal/color-palette.c:614 +msgid "bright blue" +msgstr "" + +#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 +msgid "red purple" +msgstr "" + +#: src/mygal/color-palette.c:616 +msgid "light grey" +msgstr "" + +#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 +msgid "pink" +msgstr "rosa" + +#: src/mygal/color-palette.c:620 +msgid "light orange" +msgstr "" + +#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 +msgid "light yellow" +msgstr "" + +#: src/mygal/color-palette.c:622 +msgid "light green" +msgstr "" + +#: src/mygal/color-palette.c:623 +msgid "light cyan" +msgstr "" + +#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 +msgid "light blue" +msgstr "blu chiaro" + +#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 +msgid "light purple" +msgstr "" + +#: src/mygal/color-palette.c:626 +msgid "white" +msgstr "bianco" + +#: src/mygal/color-palette.c:631 +msgid "purplish blue" +msgstr "" + +#: src/mygal/color-palette.c:635 +msgid "dark purple" +msgstr "" + +#: src/mygal/color-palette.c:637 +msgid "sky blue" +msgstr "" + +#: libglabels/template.c:848 +#, c-format +msgid "Generic %s full page" +msgstr "" + +#: libglabels/template.c:897 +msgid "No template files found!" +msgstr "Nessun modello trovato!" + +#. Create and append an "Other" entry. +#: libglabels/paper.c:67 +msgid "Other" +msgstr "Altro" + +#: libglabels/paper.c:361 +msgid "No paper files found!" +msgstr "Nessun file paper trovato!" + +#: data/ui/glabels-ui.xml.h:1 +msgid "About glabels" +msgstr "Informazioni su glabels" + +#: data/ui/glabels-ui.xml.h:2 +msgid "About..." +msgstr "Informazioni..." + +#: data/ui/glabels-ui.xml.h:3 +msgid "Align _Horizontal" +msgstr "Allineamento orizzontale" + +#: data/ui/glabels-ui.xml.h:4 +msgid "Align _Vertical" +msgstr "Allineamento _verticale" + +#: data/ui/glabels-ui.xml.h:5 +msgid "Align objects to bottoms" +msgstr "Allinea gli oggetti in basso" + +#: data/ui/glabels-ui.xml.h:6 +msgid "Align objects to horizontal centers" +msgstr "Allinea gli oggetti nel centro orizzontale" + +#: data/ui/glabels-ui.xml.h:7 +msgid "Align objects to left edges" +msgstr "" + +#: data/ui/glabels-ui.xml.h:8 +msgid "Align objects to right edges" +msgstr "" + +#: data/ui/glabels-ui.xml.h:9 +msgid "Align objects to tops" +msgstr "" + +#: data/ui/glabels-ui.xml.h:10 +msgid "Align objects to vertical centers" +msgstr "Allinea gli oggetti al centro verticale" + +#: data/ui/glabels-ui.xml.h:12 +msgid "Bold" +msgstr "Grassetto" + +#: data/ui/glabels-ui.xml.h:14 +msgid "Center align" +msgstr "Allineamento centrato" + +#: data/ui/glabels-ui.xml.h:15 +msgid "Center objects to horizontal label center" +msgstr "" + +#: data/ui/glabels-ui.xml.h:16 +msgid "Center objects to vertical label center" +msgstr "" + +#: data/ui/glabels-ui.xml.h:17 +msgid "Change the visibility of markup lines in the current window" +msgstr "" +"Cambia la visibilità delle linee di demarcazione nella finestra corrente" + +#: data/ui/glabels-ui.xml.h:18 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "Cambia la visibilità della barra degli strumenti di disegno nella finestra corrente" + +#: data/ui/glabels-ui.xml.h:19 +msgid "Change the visibility of the grid in the current window" +msgstr "Cambia la visibilità della griglia nella finestra corrente" + +#: data/ui/glabels-ui.xml.h:20 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "Cambia la visibilità della barra degli strumenti principale nella finestra corrente" + +#: data/ui/glabels-ui.xml.h:21 +msgid "Change the visibility of the property toolbar in the current window" +msgstr "" +"Cambia la visibilità della barra degli strumenti principale nella finestra " +"corrente" + +#: data/ui/glabels-ui.xml.h:22 +msgid "Close" +msgstr "Chiudi" + +#: data/ui/glabels-ui.xml.h:23 +msgid "Close the current file" +msgstr "Chiudi il file corrente" + +#: data/ui/glabels-ui.xml.h:24 +msgid "Configure the application" +msgstr "Configura l'applicazione" + +#: data/ui/glabels-ui.xml.h:25 +msgid "Contents" +msgstr "Contenuti" + +#: data/ui/glabels-ui.xml.h:26 +msgid "Copy" +msgstr "Copia" + +#: data/ui/glabels-ui.xml.h:27 +msgid "Copy the selection" +msgstr "Copia la selezione" + +#: data/ui/glabels-ui.xml.h:28 +msgid "Create a custom template" +msgstr "Crea un modello personalizzato" + +#: data/ui/glabels-ui.xml.h:29 +msgid "Create a new document" +msgstr "Crea un nuovo documento" + +#: data/ui/glabels-ui.xml.h:30 +msgid "Create barcode object" +msgstr "Crea oggetto codice a barre" + +#: data/ui/glabels-ui.xml.h:31 +msgid "Create box/rectangle object" +msgstr "Crea oggetto area/rettangolo" + +#: data/ui/glabels-ui.xml.h:32 +msgid "Create ellipse/circle object" +msgstr "Crea oggetto ellisse/cerchio" + +#: data/ui/glabels-ui.xml.h:33 +msgid "Create image object" +msgstr "Crea oggetto immagine" + +#: data/ui/glabels-ui.xml.h:34 +msgid "Create line object" +msgstr "Crea oggetto linea" + +#: data/ui/glabels-ui.xml.h:35 +msgid "Create text object" +msgstr "Crea oggeto testo" + +#: data/ui/glabels-ui.xml.h:36 +msgid "Cu_t" +msgstr "_Taglia" + +#: data/ui/glabels-ui.xml.h:37 +msgid "Customize" +msgstr "Personalizza" + +#: data/ui/glabels-ui.xml.h:38 +msgid "Customize Drawing Toolbar" +msgstr "Personalizza la barra degli strumenti di disegno" + +#: data/ui/glabels-ui.xml.h:39 +msgid "Customize Main Toolbar" +msgstr "Personalizza la barra degli strumenti principale" + +#: data/ui/glabels-ui.xml.h:40 +msgid "Customize Property Toolbar" +msgstr "Personalizza barra degli strumenti proprietà" + +#: data/ui/glabels-ui.xml.h:41 +msgid "Customize toolbars" +msgstr "Personalizza·le·barre degli strumenti" + +#: data/ui/glabels-ui.xml.h:42 +msgid "Cut" +msgstr "Taglia" + +#: data/ui/glabels-ui.xml.h:43 +msgid "Cut the selection" +msgstr "Taglia la selezione" + +#: data/ui/glabels-ui.xml.h:44 +msgid "Decrease magnification" +msgstr "Decrementa ingrandimento" + +#: data/ui/glabels-ui.xml.h:45 +msgid "Delete" +msgstr "Cancella" + +#: data/ui/glabels-ui.xml.h:46 +msgid "Delete the selected objects" +msgstr "Cancella gli oggetti selezionati" + +#: data/ui/glabels-ui.xml.h:47 +msgid "Drawing toolbar" +msgstr "Barra degli strumenti di disegno" + +#: data/ui/glabels-ui.xml.h:48 +msgid "Dump XML" +msgstr "Scarica XML" + +#: data/ui/glabels-ui.xml.h:49 +msgid "Dump the UI Xml description" +msgstr "" + +#: data/ui/glabels-ui.xml.h:50 +msgid "Edit merge properties" +msgstr "Modifica proprietà di unione" + +#: data/ui/glabels-ui.xml.h:54 +msgid "Flip object horizontally" +msgstr "Capovolgi oggetto orizzontalmente" + +#: data/ui/glabels-ui.xml.h:55 +msgid "Flip object vertically" +msgstr "Capovolgi oggetto verticalmente" + +#: data/ui/glabels-ui.xml.h:56 +msgid "Font name" +msgstr "Nome font" + +#: data/ui/glabels-ui.xml.h:57 +msgid "Font selector" +msgstr "Selettore font" + +#: data/ui/glabels-ui.xml.h:58 +msgid "Font size" +msgstr "Dimesione·font" + +#: data/ui/glabels-ui.xml.h:59 +msgid "Icon and _Text" +msgstr "Icone e _Testo" + +#: data/ui/glabels-ui.xml.h:60 +msgid "Increase magnification" +msgstr "Incrementa ingradimento" + +#: data/ui/glabels-ui.xml.h:61 +msgid "Italic" +msgstr "Corsivo" + +#: data/ui/glabels-ui.xml.h:63 +msgid "Left align" +msgstr "Allinea·a·sinistra" + +#: data/ui/glabels-ui.xml.h:65 +msgid "Line width" +msgstr "Larghezza linea" + +#: data/ui/glabels-ui.xml.h:66 +msgid "Lower object to bottom" +msgstr "" + +#: data/ui/glabels-ui.xml.h:67 +msgid "M_arkup" +msgstr "" + +#: data/ui/glabels-ui.xml.h:68 +msgid "Main toolbar" +msgstr "Barra degli strumenti principale" + +#: data/ui/glabels-ui.xml.h:69 +msgid "Markup" +msgstr "Marcatori" + +#: data/ui/glabels-ui.xml.h:70 +msgid "Modify document properties" +msgstr "Modifica le proprietà del documento" + +#: data/ui/glabels-ui.xml.h:71 +msgid "New" +msgstr "Nuovo" + +#: data/ui/glabels-ui.xml.h:72 +msgid "Object property editor" +msgstr "Editor delle proprietà per l'oggetto" + +#: data/ui/glabels-ui.xml.h:73 +msgid "Only show icons in the main toolbar" +msgstr "Visualizza solo le icone nella barra degli strumenti principale" + +#: data/ui/glabels-ui.xml.h:75 +msgid "Open a file" +msgstr "Apri un file" + +#: data/ui/glabels-ui.xml.h:76 +msgid "Open the glabels manual" +msgstr "Apri il manuale di glabels" + +#: data/ui/glabels-ui.xml.h:77 +msgid "Paste" +msgstr "Incolla" + +#: data/ui/glabels-ui.xml.h:78 +msgid "Paste the clipboard" +msgstr "Incolla gli appunti" + +#: data/ui/glabels-ui.xml.h:79 +msgid "Pr_eferences..." +msgstr "Pr_eferenze..." + +#: data/ui/glabels-ui.xml.h:80 +msgid "Preferences" +msgstr "Preferenze" + +#: data/ui/glabels-ui.xml.h:82 +msgid "Print the current file" +msgstr "Stampa il file corrente" + +#: data/ui/glabels-ui.xml.h:83 +msgid "Proper_ties..." +msgstr "Proprie_tà..." + +#: data/ui/glabels-ui.xml.h:84 +msgid "Properties" +msgstr "Proprietà" + +#: data/ui/glabels-ui.xml.h:85 +msgid "Property toolbar" +msgstr "Proprietà della barra degli strumenti" + +#: data/ui/glabels-ui.xml.h:86 +msgid "Quit" +msgstr "Esci" + +#: data/ui/glabels-ui.xml.h:87 +msgid "Quit the program" +msgstr "Esci dal programma" + +#: data/ui/glabels-ui.xml.h:88 +msgid "Raise object to top" +msgstr "" + +#: data/ui/glabels-ui.xml.h:89 +msgid "Recent _Files" +msgstr "_File Recenti" + +#: data/ui/glabels-ui.xml.h:90 +msgid "Redo" +msgstr "Ripeti" + +#: data/ui/glabels-ui.xml.h:91 +msgid "Redo the undone action" +msgstr "" + +#: data/ui/glabels-ui.xml.h:92 +msgid "Remove all selections" +msgstr "Rimuovi tutte le selezioni" + +#: data/ui/glabels-ui.xml.h:94 +#, no-c-format +msgid "Restore scale to 100%" +msgstr "Ripristina la scala al 100%" + +#: data/ui/glabels-ui.xml.h:95 +msgid "Right align" +msgstr "Allineamento a destra" + +#: data/ui/glabels-ui.xml.h:98 +msgid "Rotate object 90 clockwise" +msgstr "Ruota l'oggetto di 90° in verso orario" + +#: data/ui/glabels-ui.xml.h:99 +msgid "Rotate object 90 counter-clockwise" +msgstr "Ruota l'oggetto di 90° in verso antiorario" + +#: data/ui/glabels-ui.xml.h:100 +msgid "Save" +msgstr "Salva" + +#: data/ui/glabels-ui.xml.h:101 +msgid "Save As" +msgstr "Salva con nome" + +#: data/ui/glabels-ui.xml.h:102 +msgid "Save _As..." +msgstr "Salva _con nome..." + +#: data/ui/glabels-ui.xml.h:103 +msgid "Save the current file" +msgstr "Salva il file corrente" + +#: data/ui/glabels-ui.xml.h:104 +msgid "Save the current file with a different name" +msgstr "Salva il file corrente con un nome differente" + +#: data/ui/glabels-ui.xml.h:105 +msgid "Select All" +msgstr "Seleziona tutto" + +#: data/ui/glabels-ui.xml.h:106 +msgid "Select _All" +msgstr "Seleziona tutto" + +#: data/ui/glabels-ui.xml.h:107 +msgid "Select all objects" +msgstr "Seleziona tutti gli oggetti" + +#: data/ui/glabels-ui.xml.h:108 +msgid "Select, move and modify objects" +msgstr "Seleziona, muovi e modifica oggetti" + +#: data/ui/glabels-ui.xml.h:110 +msgid "Set main toolbar button style according to desktop default" +msgstr "" + +#: data/ui/glabels-ui.xml.h:111 +msgid "Show _Tooltips" +msgstr "Mostra suggerimenti" + +#: data/ui/glabels-ui.xml.h:112 +msgid "Show both icons and texts in the main toolbar" +msgstr "Mostra icone e testo nella barra degli strumenti principale" + +#: data/ui/glabels-ui.xml.h:113 +msgid "Show tooltips in the drawing toolbar" +msgstr "Mostra suggerimenti nella barra degli strumenti di disegno" + +#: data/ui/glabels-ui.xml.h:114 +msgid "Show tooltips in the main toolbar" +msgstr "Mostra suggerimenti nella barra degli strumenti principale" + +#: data/ui/glabels-ui.xml.h:115 +msgid "Show tooltips in the property toolbar" +msgstr "Mostra suggerimenti nella barra degli strumenti principale" + +#: data/ui/glabels-ui.xml.h:116 +msgid "Template Designer" +msgstr "Progettazione modelli" + +#: data/ui/glabels-ui.xml.h:117 +msgid "Template _Designer..." +msgstr "" + +#: data/ui/glabels-ui.xml.h:118 +msgid "Text color" +msgstr "Colore testo" + +#: data/ui/glabels-ui.xml.h:119 +msgid "U_n-select All" +msgstr "Deseleziona tutto" + +#: data/ui/glabels-ui.xml.h:120 +msgid "Un-select All" +msgstr "Deseleziona·tutto" + +#: data/ui/glabels-ui.xml.h:121 +msgid "Undo" +msgstr "Annulla" + +#: data/ui/glabels-ui.xml.h:122 +msgid "Undo the last action" +msgstr "Annulla l'ultima azione" + +#: data/ui/glabels-ui.xml.h:123 +msgid "Zoom _1:1" +msgstr "Zoom _1:1" + +#: data/ui/glabels-ui.xml.h:124 +msgid "Zoom _In" +msgstr "Zoom _in avanti" + +#: data/ui/glabels-ui.xml.h:125 +msgid "Zoom _Out" +msgstr "Zo_om indietro" + +#: data/ui/glabels-ui.xml.h:126 +msgid "Zoom to _fit" +msgstr "Adatta" + +#: data/ui/glabels-ui.xml.h:127 +msgid "Zoom to fit window" +msgstr "Adatta alla finestra" + +#: data/ui/glabels-ui.xml.h:128 +msgid "_About..." +msgstr "Informazioni..." + +#: data/ui/glabels-ui.xml.h:129 +msgid "_Bottoms" +msgstr "In basso" + +#: data/ui/glabels-ui.xml.h:132 +msgid "_Close" +msgstr "_Chiudi" + +#: data/ui/glabels-ui.xml.h:133 +msgid "_Contents" +msgstr "_Contenuti" + +#: data/ui/glabels-ui.xml.h:134 +msgid "_Copy" +msgstr "_Copia" + +#: data/ui/glabels-ui.xml.h:135 +msgid "_Create Object" +msgstr "_Crea Oggetto" + +#: data/ui/glabels-ui.xml.h:136 +msgid "_Debug" +msgstr "_Debug" + +#: data/ui/glabels-ui.xml.h:138 +msgid "_Desktop Default" +msgstr "Predefinito del desktop" + +#: data/ui/glabels-ui.xml.h:139 +msgid "_Drawing Toolbar" +msgstr "Barra degli strumenti di disegno" + +#: data/ui/glabels-ui.xml.h:140 +msgid "_Edit" +msgstr "_Modifica" + +#: data/ui/glabels-ui.xml.h:142 +msgid "_File" +msgstr "_File" + +#: data/ui/glabels-ui.xml.h:143 +msgid "_Grid" +msgstr "_Griglia" + +#: data/ui/glabels-ui.xml.h:144 +msgid "_Help" +msgstr "_Aiuto" + +#: data/ui/glabels-ui.xml.h:145 +msgid "_Icon" +msgstr "_Icone" + +#: data/ui/glabels-ui.xml.h:149 +msgid "_Main Toolbar" +msgstr "Barra degli stru_menti principale" + +#: data/ui/glabels-ui.xml.h:150 +msgid "_Merge Properties..." +msgstr "Proprietà di unione..." + +#: data/ui/glabels-ui.xml.h:151 +msgid "_New" +msgstr "_Nuovo" + +#: data/ui/glabels-ui.xml.h:152 +msgid "_Objects" +msgstr "_Oggetti" + +#: data/ui/glabels-ui.xml.h:153 +msgid "_Open..." +msgstr "_Apri..." + +#: data/ui/glabels-ui.xml.h:155 +msgid "_Paste" +msgstr "Incolla" + +#: data/ui/glabels-ui.xml.h:156 +msgid "_Print..." +msgstr "Stampa..." + +#: data/ui/glabels-ui.xml.h:157 +msgid "_Property Toolbar" +msgstr "Barra degli strumenti _proprietà" + +#: data/ui/glabels-ui.xml.h:158 +msgid "_Quit" +msgstr "_Esci" + +#: data/ui/glabels-ui.xml.h:161 +msgid "_Save" +msgstr "_Salva" + +#: data/ui/glabels-ui.xml.h:165 +msgid "_View" +msgstr "_Visualizza" + +#: data/glade/prefs-dialog.glade.h:1 +msgid " " +msgstr "" + +#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 +#: data/glade/template-designer.glade.h:5 +msgid "*" +msgstr "*" + +#: data/glade/prefs-dialog.glade.h:3 +msgid "Default page size" +msgstr "Dimensione pagina predefinita" + +#: data/glade/prefs-dialog.glade.h:4 +msgid "Fill" +msgstr "Riempimento" + +#: data/glade/prefs-dialog.glade.h:5 +msgid "Line" +msgstr "Linea" + +#: data/glade/prefs-dialog.glade.h:6 +msgid "Text" +msgstr "Testo" + +#: data/glade/prefs-dialog.glade.h:7 +msgid "Units" +msgstr "Unità" + +#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 +msgid "Alignment:" +msgstr "Allineamento:" + +#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 +msgid "Color:" +msgstr "Colore:" + +#: data/glade/prefs-dialog.glade.h:10 +msgid "Font:" +msgstr "Carattere:" + +#: data/glade/prefs-dialog.glade.h:11 +msgid "ISO A4" +msgstr "ISO A4" + +#: data/glade/prefs-dialog.glade.h:12 +msgid "Inches" +msgstr "Pollici" + +#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 +msgid "Line Spacing:" +msgstr "Spaziatura:" + +#: data/glade/prefs-dialog.glade.h:14 +msgid "Locale" +msgstr "Impostazioni nazionali" + +#: data/glade/prefs-dialog.glade.h:15 +msgid "Millimeters" +msgstr "Millimetri" + +#: data/glade/prefs-dialog.glade.h:16 +msgid "Object defaults" +msgstr "Proprietà oggetto" + +#: data/glade/prefs-dialog.glade.h:17 +msgid "Points" +msgstr "Punti" + +#: data/glade/prefs-dialog.glade.h:18 +msgid "Select default properties for new objects." +msgstr "Seleziona le proprietà predefinite per i nuovi oggetti." + +#: data/glade/prefs-dialog.glade.h:19 +msgid "Select locale specific behavior." +msgstr "" + +#. Most popular (at top of list) +#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:29 +msgid "US Letter" +msgstr "US·Letter" + +#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 +#: data/glade/template-designer.glade.h:72 +msgid "Width:" +msgstr "Larghezza:" + +#: data/glade/object-editor.glade.h:2 +msgid "00000000000 00000" +msgstr "" + +#: data/glade/object-editor.glade.h:3 +msgid "Xxx object properties" +msgstr "" + +#: data/glade/object-editor.glade.h:5 +msgid "Allow merge to automatically shrink text" +msgstr "" + +#: data/glade/object-editor.glade.h:6 +msgid "Angle:" +msgstr "Angolo:" + +#: data/glade/object-editor.glade.h:7 +msgid "Checksum" +msgstr "Checksum" + +#: data/glade/object-editor.glade.h:10 +msgid "Family:" +msgstr "Famiglia:" + +#: data/glade/object-editor.glade.h:12 +msgid "Fill" +msgstr "Riempimento" + +#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 +msgid "Height:" +msgstr "Altezza:" + +#: data/glade/object-editor.glade.h:14 +msgid "Image" +msgstr "Immagine" + +#: data/glade/object-editor.glade.h:15 +msgid "Insert merge field" +msgstr "Inserisci campo unione" + +#: data/glade/object-editor.glade.h:17 +msgid "Length:" +msgstr "Lunghezza:" + +#: data/glade/object-editor.glade.h:18 +msgid "Line" +msgstr "Linea" + +#: data/glade/object-editor.glade.h:20 +msgid "Literal:" +msgstr "Letterale:" + +#: data/glade/object-editor.glade.h:21 +msgid "Load image" +msgstr "Carica immagine" + +#: data/glade/object-editor.glade.h:22 +msgid "Position" +msgstr "Posizione" + +#: data/glade/object-editor.glade.h:23 +msgid "Reset image size" +msgstr "Ripristina dimensioni immagine" + +#: data/glade/object-editor.glade.h:24 +msgid "Size" +msgstr "Dimensioni" + +#: data/glade/object-editor.glade.h:25 +msgid "Size:" +msgstr "Dimensione:" + +#: data/glade/object-editor.glade.h:26 +msgid "Style" +msgstr "Stile" + +#: data/glade/object-editor.glade.h:27 +msgid "Style:" +msgstr "Stile:" + +#: data/glade/object-editor.glade.h:30 +msgid "X:" +msgstr "X:" + +#: data/glade/object-editor.glade.h:31 +msgid "Y:" +msgstr "Y:" + +#: data/glade/object-editor.glade.h:32 +msgid "degrees" +msgstr "gradi" + +#: data/glade/object-editor.glade.h:33 +msgid "dialog1" +msgstr "" + +#: data/glade/object-editor.glade.h:34 +msgid "digits:" +msgstr "cifre:" + +#: data/glade/object-editor.glade.h:35 +msgid "format:" +msgstr "formato:" + +#: data/glade/template-designer.glade.h:1 +msgid " " +msgstr "" + +#: data/glade/template-designer.glade.h:2 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "(es., \"Etichette di spedizione,\" \"Biglietti da visita,\" ...)" + +#: data/glade/template-designer.glade.h:3 +msgid "(e.g., 8163A)" +msgstr "(es. 8163A)" + +#: data/glade/template-designer.glade.h:4 +msgid "(e.g., Avery, Acme, ...)" +msgstr "(es. Avery, Acme, ...)" + +#: data/glade/template-designer.glade.h:6 +msgid "1. Outer radius:" +msgstr "1. raggio esterno:" + +#: data/glade/template-designer.glade.h:7 +msgid "1. Radius:" +msgstr "Raggio:" + +#: data/glade/template-designer.glade.h:8 +msgid "1. Width:" +msgstr "1. Larghezza:" + +#: data/glade/template-designer.glade.h:9 +msgid "2. Height:" +msgstr "2. Altezza:" + +#: data/glade/template-designer.glade.h:10 +msgid "2. Inner radius:" +msgstr "2. raggio interno:" + +#: data/glade/template-designer.glade.h:11 +msgid "2. Waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:12 +msgid "3. Clipping width:" +msgstr "" + +#: data/glade/template-designer.glade.h:13 +msgid "3. Margin" +msgstr "3. Margine" + +#: data/glade/template-designer.glade.h:14 +msgid "3. Round (radius of corner):" +msgstr "" + +#: data/glade/template-designer.glade.h:15 +msgid "4. Clipping height:" +msgstr "" + +#: data/glade/template-designer.glade.h:16 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:17 +msgid "5. Vert. waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:18 +msgid "5. Waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:19 +msgid "6. Margin" +msgstr "6. Margine" + +#: data/glade/template-designer.glade.h:20 +msgid "Brand/Manufacturer:" +msgstr "Marca/Produttore:" + +#: data/glade/template-designer.glade.h:21 +msgid "CD/DVD (including credit card CDs)" +msgstr "CD/DVD (inclusa copertina dei ringraziamenti)" + +#: data/glade/template-designer.glade.h:22 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "Congratulazioni!\n" +"\n" +"Hai completato il gLabels Template Designer.\n" +"Se vuoi salvare il tuo progetto fai clic su \"Applica\".\n" +"\n" +"In caso contrario, fai clic su \"Cancella\" per abbandonare\n" +"il tuo progetto o \"Indietro\" per continuare la progettazione." + +#: data/glade/template-designer.glade.h:30 +msgid "Design Completed" +msgstr "Progettazione completata" + +#: data/glade/template-designer.glade.h:31 +msgid "Distance from left edge (x0):" +msgstr "Distanza dal bordo sinistro (x0):" + +#: data/glade/template-designer.glade.h:32 +msgid "Distance from top edge (y0):" +msgstr "Distanza dal bordo in alto (y0):" + +#: data/glade/template-designer.glade.h:34 +msgid "Horizontal pitch (dx):" +msgstr "" + +#: data/glade/template-designer.glade.h:35 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" + +#: data/glade/template-designer.glade.h:40 +msgid "Label Size (CD/DVD)" +msgstr "Dimensione etichetta (CD/DVD)" + +#: data/glade/template-designer.glade.h:41 +msgid "Label Size (Round)" +msgstr "Dimensioni etichetta" + +#: data/glade/template-designer.glade.h:42 +msgid "Label or Card Shape" +msgstr "Forma dell'etichetta o della scheda" + +#: data/glade/template-designer.glade.h:43 +msgid "Label or Card Size (Rectangular)" +msgstr "" + +#: data/glade/template-designer.glade.h:44 +msgid "Layout #1" +msgstr "Layout #1" + +#: data/glade/template-designer.glade.h:45 +msgid "Layout #2" +msgstr "Layout #2" + +#: data/glade/template-designer.glade.h:46 +msgid "Layout(s)" +msgstr "Layout" + +#: data/glade/template-designer.glade.h:47 +msgid "Name and Description" +msgstr "Nome e descrizione" + +#: data/glade/template-designer.glade.h:48 +msgid "Number across (nx):" +msgstr "" + +#: data/glade/template-designer.glade.h:49 +msgid "Number down (ny):" +msgstr "" + +#: data/glade/template-designer.glade.h:50 +msgid "Number of Layouts" +msgstr "Numero di layout" + +#: data/glade/template-designer.glade.h:51 +msgid "Number of layouts:" +msgstr "Numero di layout:" + +#: data/glade/template-designer.glade.h:52 +msgid "Page Size" +msgstr "Dimensione pagina" + +#: data/glade/template-designer.glade.h:54 +msgid "Part #:" +msgstr "Parte #:" + +#: data/glade/template-designer.glade.h:55 +msgid "" +"Please enter the following identifying information about the template " +"stationery." +msgstr "" + +#: data/glade/template-designer.glade.h:56 +msgid "Please enter the following layout information." +msgstr "Per piacere, inserisci le seguenti informazioni." + +#: data/glade/template-designer.glade.h:57 +msgid "" +"Please enter the following size parameters of a single label in your " +"template." +msgstr "" + +#: data/glade/template-designer.glade.h:58 +msgid "" +"Please enter the following size parameters of a single label or card in your " +"template." +msgstr "" + +#: data/glade/template-designer.glade.h:59 +msgid "Please select the basic shape of the labels or cards." +msgstr "" + +#: data/glade/template-designer.glade.h:60 +msgid "Please select the page size of the template stationery." +msgstr "" + +#: data/glade/template-designer.glade.h:61 +msgid "Print test sheet" +msgstr "Stampa foglio di prova" + +#: data/glade/template-designer.glade.h:62 +msgid "Rectangular or square (can have rounded corners)" +msgstr "" + +#: data/glade/template-designer.glade.h:63 +msgid "Round" +msgstr "Rotonda" + +#: data/glade/template-designer.glade.h:64 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" + +#: data/glade/template-designer.glade.h:66 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" + +#: data/glade/template-designer.glade.h:68 +msgid "Vertical pitch (dy):" +msgstr "" + +#: data/glade/template-designer.glade.h:69 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" + +#. Other ISO A series sizes +#: data/templates/paper-sizes.xml.h:2 +msgid "A0" +msgstr "A0" + +#: data/templates/paper-sizes.xml.h:3 +msgid "A1" +msgstr "A1" + +#: data/templates/paper-sizes.xml.h:4 +msgid "A10" +msgstr "A10" + +#: data/templates/paper-sizes.xml.h:5 +msgid "A2" +msgstr "A2" + +#: data/templates/paper-sizes.xml.h:6 +msgid "A3" +msgstr "A3" + +#: data/templates/paper-sizes.xml.h:7 +msgid "A4" +msgstr "A4" + +#: data/templates/paper-sizes.xml.h:8 +msgid "A5" +msgstr "A5" + +#: data/templates/paper-sizes.xml.h:9 +msgid "A6" +msgstr "A6" + +#: data/templates/paper-sizes.xml.h:10 +msgid "A7" +msgstr "A7" + +#: data/templates/paper-sizes.xml.h:11 +msgid "A8" +msgstr "A8" + +#: data/templates/paper-sizes.xml.h:12 +msgid "A9" +msgstr "A9" + +#. ISO B series sizes +#: data/templates/paper-sizes.xml.h:14 +msgid "B0" +msgstr "B0" + +#: data/templates/paper-sizes.xml.h:15 +msgid "B1" +msgstr "B1" + +#: data/templates/paper-sizes.xml.h:16 +msgid "B10" +msgstr "B10" + +#: data/templates/paper-sizes.xml.h:17 +msgid "B2" +msgstr "B2" + +#: data/templates/paper-sizes.xml.h:18 +msgid "B3" +msgstr "B3" + +#: data/templates/paper-sizes.xml.h:19 +msgid "B4" +msgstr "B4" + +#: data/templates/paper-sizes.xml.h:20 +msgid "B5" +msgstr "B5" + +#: data/templates/paper-sizes.xml.h:21 +msgid "B6" +msgstr "B6" + +#: data/templates/paper-sizes.xml.h:22 +msgid "B7" +msgstr "B7" + +#: data/templates/paper-sizes.xml.h:23 +msgid "B8" +msgstr "B8" + +#: data/templates/paper-sizes.xml.h:24 +msgid "B9" +msgstr "B9" + +#: data/templates/paper-sizes.xml.h:25 +msgid "US Executive" +msgstr "US Executive" + +#. Other US paper sizes +#: data/templates/paper-sizes.xml.h:27 +msgid "US Legal" +msgstr "US Legale" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:2 +#: data/templates/zweckform-iso-templates.xml.h:2 +msgid "Address Labels" +msgstr "Etichette di indirizzo" + +#. =================================================================== +#. ============================================================ +#. =================================================================== +#. ====================================================== +#: data/templates/avery-us-templates.xml.h:4 +#: data/templates/avery-iso-templates.xml.h:4 +#: data/templates/zweckform-iso-templates.xml.h:6 +#: data/templates/misc-us-templates.xml.h:3 +#: data/templates/misc-iso-templates.xml.h:17 +msgid "Business Cards" +msgstr "Biglietti da visita" + +#: data/templates/avery-us-templates.xml.h:5 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "Etichette CD/DVD (Etichette Dischi)" + +#: data/templates/avery-us-templates.xml.h:6 +msgid "CD/DVD Labels (Spine Labels)" +msgstr "Etichette CD/DVD (Etichette dischi)" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:8 +msgid "Diskette Labels" +msgstr "Etichette per floppy" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:10 +msgid "Filing Labels" +msgstr "" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:12 +msgid "Full Sheet Labels" +msgstr "Pagina piena di etichette" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:14 +msgid "Large Round Labels" +msgstr "Etichetta con bordi arrotondati" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:16 +msgid "Name Badge Labels" +msgstr "" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:18 +msgid "Return Address Labels" +msgstr "Etichette con indirizzo del mittente" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:20 +msgid "Shipping Labels" +msgstr "Etichette di spedizione" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:22 +msgid "Small Round Labels" +msgstr "Etichette piccole con bordi arrotondati" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:24 +msgid "Square Labels" +msgstr "Etichette quadrate" + +#: data/templates/avery-us-templates.xml.h:25 +msgid "Video Tape Face Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:26 +msgid "Video Tape Spine Labels" +msgstr "" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:2 +msgid "Address labels" +msgstr "Etichette per indirizzo" + +#. =============================================================== +#: data/templates/avery-iso-templates.xml.h:6 +msgid "CD Booklet" +msgstr "CD Booklet" + +#. =============================================================== +#: data/templates/avery-iso-templates.xml.h:8 +msgid "CD Inlet" +msgstr "CD Inlet" + +#. =============================================================== +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:10 +#: data/templates/zweckform-iso-templates.xml.h:8 +#: data/templates/misc-us-templates.xml.h:5 +#: data/templates/misc-iso-templates.xml.h:21 +msgid "CD/DVD Labels" +msgstr "Etichette CD/DVD" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:12 +msgid "Diskette labels" +msgstr "" + +#. =============================================================== +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:14 +#: data/templates/zweckform-iso-templates.xml.h:14 +#: data/templates/misc-iso-templates.xml.h:35 +msgid "Mailing Labels" +msgstr "Etichette di spedizione" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:16 +msgid "Mailing labels" +msgstr "" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:18 +msgid "Mini Address Labels" +msgstr "Etichette Mini-indirizzo" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:20 +msgid "Shipping labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:4 +msgid "Allround Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:10 +msgid "Correction and Cover-up Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:12 +msgid "Lever Arch File Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:16 +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:18 +msgid "Rectangular Copier Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:20 +#: data/templates/misc-iso-templates.xml.h:44 +msgid "Rectangular Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:22 +msgid "Video Labels (back)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:1 +msgid "Business Card CD" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:4 +msgid "CD Template Rectangles" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:6 +msgid "CD/DVD Labels (Face Only)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:7 +#: data/templates/misc-iso-templates.xml.h:23 +msgid "CD/DVD Labels (face only)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:9 +msgid "Cassette Labels" +msgstr "Etichette per cassette" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:11 +msgid "DLT Labels" +msgstr "Etichette DLT" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:13 +msgid "Microtube labels" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:14 +msgid "Mini-CD Labels" +msgstr "Etichette Mini-CD" + +#: data/templates/misc-us-templates.xml.h:15 +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:16 +msgid "PRO CD Labels 2-up (Face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:17 +#: data/templates/misc-iso-templates.xml.h:42 +msgid "PRO CD Labels 2-up (face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:18 +msgid "Slimline CD Case (rightside up)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:19 +msgid "Slimline CD Case (upside down)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:1 +msgid "Agipa 119488: Business Cards" +msgstr "Agipa 119488: biglietti da visita" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:3 +msgid "Allround Labels --24" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:5 +msgid "Allround Labels --44" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:7 +msgid "Allround Labels --64" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:9 +msgid "Allround Labels --65" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:11 +msgid "Arch File Labels" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:13 +msgid "Arch File Labels (large)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:15 +msgid "Arch File Labels (small)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:19 +msgid "CD Labels" +msgstr "Etichette CD" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:25 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:27 +msgid "Diskette Labels (face only)" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:29 +msgid "EPSON Photo Stickers 16" +msgstr "EPSON Photo Stickers 16" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:31 +msgid "Etiketten" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:33 +msgid "Fridge Magnet Stickers" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:37 +msgid "Mailing Labels --14" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:39 +msgid "Mailing Labels-2 columns" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:41 +msgid "Mailing Labels-3 columns" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:46 +msgid "Video Labels (face only)" +msgstr "Etichette video (solo frontespizio)" + +#: data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers" +msgstr "Crea etichette, biglietti da visita e copertine" + +#: data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "gLabels Designer di etichetta" + +#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 +msgid "gLabels Project File" +msgstr "File di progetto di gLabels" + diff --git a/po/ja.po b/po/ja.po new file mode 100644 index 00000000..08b6b3d1 --- /dev/null +++ b/po/ja.po @@ -0,0 +1,2457 @@ +# glabels ja.po +# Copyright (C) 2001-2004 Free Software Foundation, Inc. +# Takeshi Aihana , 2001-2004. +# +msgid "" +msgstr "" +"Project-Id-Version: glabels 2.0.0\n" +"POT-Creation-Date: 2004-08-15 18:13-0400\n" +"PO-Revision-Date: 2004-08-11 08:44+0900\n" +"Last-Translator: Takeshi AIHANA \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/glabels.c:55 +msgid "Show view debugging messages." +msgstr "表示のデバッグ・メッセージを表示する" + +#: src/glabels.c:58 +msgid "Show item debugging messages." +msgstr "アイテムのデバッグ・メッセージを表示する" + +#: src/glabels.c:61 +msgid "Show printing debugging messages." +msgstr "印刷のデバッグ・メッセージを表示する" + +#: src/glabels.c:64 +msgid "Show prefs debugging messages." +msgstr "設定のデバッグ・メッセージを表示する" + +#: src/glabels.c:67 +msgid "Show file debugging messages." +msgstr "ファイルのデバッグ・メッセージを表示する" + +#: src/glabels.c:70 +msgid "Show document debugging messages." +msgstr "ドキュメントのデバッグ・メッセージを表示する" + +#: src/glabels.c:73 +msgid "Show template debugging messages." +msgstr "テンプレートのデバッグ・メッセージを表示する" + +#: src/glabels.c:76 +msgid "Show paper debugging messages." +msgstr "設定の用紙のデバッグ・メッセージを表示する" + +#: src/glabels.c:79 +msgid "Show xml debugging messages." +msgstr "XML のデバッグ・メッセージを表示する" + +#: src/glabels.c:82 +msgid "Show document merge debugging messages." +msgstr "ドキュメント結合のデバッグ・メッセージを表示する" + +#: src/glabels.c:85 +msgid "Show commands debugging messages." +msgstr "コマンドのデバッグ・メッセージを表示する" + +#: src/glabels.c:88 +msgid "Show undo debugging messages." +msgstr "Undo のデバッグ・メッセージを表示する" + +#: src/glabels.c:91 +msgid "Show recent debugging messages." +msgstr "最近開いたファイルのデバッグ・メッセージを表示する" + +#: src/glabels.c:94 +msgid "Show window debugging messages." +msgstr "ウィンドウのデバッグ・メッセージを表示する" + +#: src/glabels.c:97 +msgid "Show ui debugging messages." +msgstr "GUI のデバッグ・メッセージを表示する" + +#: src/glabels.c:100 +msgid "Show property_bar debugging messages." +msgstr "設定バーのデバッグ・メッセージを表示する" + +#: src/glabels.c:103 +msgid "Show media select widget debugging messages." +msgstr "メディア選択ウィジットのデバッグ・メッセージを表示する" + +#: src/glabels.c:106 +msgid "Show mini preview widget debugging messages." +msgstr "プレビュー・ウィジットのデバッグ・メッセージを表示する" + +#: src/glabels.c:109 +msgid "Show pixbuf cache debugging messages." +msgstr "pixbuf cache のデバッグ・メッセージを表示する" + +#: src/glabels.c:112 +msgid "Show widget debugging messages." +msgstr "ウィジットのデバッグ・メッセージを表示する" + +#: src/glabels.c:115 +msgid "Show object editor debugging messages." +msgstr "オブジェクト・エディタのデバッグメッセージを表示する" + +#: src/glabels.c:118 +msgid "Turn on all debugging messages." +msgstr "全てのデバッグ・メッセージを表示する" + +#: src/glabels.c:187 +msgid "Could not initialize Bonobo!\n" +msgstr "Bonobo を初期化することができませんでした!\n" + +#: src/glabels-batch.c:48 +msgid "print this message" +msgstr "このメッセージを表示する" + +#: src/glabels-batch.c:50 +msgid "print the version of glabels-batch being used" +msgstr "使用している gLabel のバージョンを表示する" + +#: src/glabels-batch.c:52 +msgid "set output filename (default=\"output.ps\")" +msgstr "出力するファイル名を指定する (デフォルト = \"output.ps\")" + +#: src/glabels-batch.c:52 +msgid "filename" +msgstr "ファイル名" + +#: src/glabels-batch.c:54 +msgid "number of sheets (default=1)" +msgstr "用紙の数 (デフォルト = 1)" + +#: src/glabels-batch.c:54 +msgid "sheets" +msgstr "用紙の数" + +#: src/glabels-batch.c:56 +msgid "number of copies (default=1)" +msgstr "コピーの数 (デフォルト = 1)" + +#: src/glabels-batch.c:56 +msgid "copies" +msgstr "コピーの数" + +#: src/glabels-batch.c:58 src/print-dialog.c:336 +msgid "print outlines (to test printer alignment)" +msgstr "アウトラインを印刷する (印刷時の配置を確認するため)" + +#: src/glabels-batch.c:60 src/print-dialog.c:344 +msgid "print in reverse (i.e. a mirror image)" +msgstr "(画像をミラーするように) 反転して印刷する" + +#: src/glabels-batch.c:96 +msgid "[OPTION...] GLABELS_FILE..." +msgstr "[オプション...] ファイル名..." + +#: src/glabels-batch.c:116 +#, c-format +msgid "missing glabels file\n" +msgstr "gLabel で使用するファイルがありません\n" + +#: src/glabels-batch.c:157 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "gLabel で使用するファイル %s が開けません\n" + +#: src/window.c:244 +msgid "(none) - gLabels" +msgstr "(なし) - gLabels" + +#: src/window.c:414 +msgid "(modified)" +msgstr "(変更済み)" + +#: src/stock.c:65 data/ui/glabels-ui.xml.h:165 +msgid "_Select Mode" +msgstr "選択モード(_S)" + +#: src/stock.c:66 data/ui/glabels-ui.xml.h:166 +msgid "_Text" +msgstr "文字(_T)" + +#: src/stock.c:67 data/ui/glabels-ui.xml.h:151 +msgid "_Line" +msgstr "直線(_L)" + +#: src/stock.c:68 data/ui/glabels-ui.xml.h:133 +msgid "_Box" +msgstr "矩形(_B)" + +#: src/stock.c:69 data/ui/glabels-ui.xml.h:144 +msgid "_Ellipse" +msgstr "楕円(_E)" + +#: src/stock.c:70 data/ui/glabels-ui.xml.h:149 +msgid "_Image" +msgstr "画像(_I)" + +#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 +msgid "Bar_code" +msgstr "バーコード(_C)" + +#: src/stock.c:72 +msgid "_Merge Properties" +msgstr "結合プロパティ(_M)" + +#: src/stock.c:73 +msgid "Object _Properties" +msgstr "オブジェクトのプロパティ(_P)" + +#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 +msgid "Bring to _Front" +msgstr "前に持ってくる(_F)" + +#: src/stock.c:75 data/ui/glabels-ui.xml.h:110 +msgid "Send to _Back" +msgstr "後ろにまわす(_B)" + +#: src/stock.c:76 data/ui/glabels-ui.xml.h:97 +msgid "Rotate _Left" +msgstr "左に回転(_L)" + +#: src/stock.c:77 data/ui/glabels-ui.xml.h:98 +msgid "Rotate _Right" +msgstr "右に回転(_R)" + +#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 +msgid "Flip _Horizontally" +msgstr "水平方向にフリップ(_H)" + +#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 +msgid "Flip _Vertically" +msgstr "垂直方向にフリップ(_V)" + +#: src/stock.c:80 data/ui/glabels-ui.xml.h:150 +msgid "_Lefts" +msgstr "左端(_L)" + +#: src/stock.c:81 data/ui/glabels-ui.xml.h:162 +msgid "_Rights" +msgstr "右端(_R)" + +#: src/stock.c:82 data/ui/glabels-ui.xml.h:134 +msgid "_Centers" +msgstr "中央(_C)" + +#: src/stock.c:83 data/ui/glabels-ui.xml.h:167 +msgid "_Tops" +msgstr "上端(_T)" + +#: src/stock.c:84 +msgid "Bottoms" +msgstr "下部" + +#: src/stock.c:85 +msgid "Centers" +msgstr "中央" + +#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 +msgid "Label Ce_nter" +msgstr "ラベルの中心(_N)" + +#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 +msgid "Fill color" +msgstr "色で塗りつぶします" + +#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 +msgid "Line color" +msgstr "線の色を選択します" + +#: src/stock.c:90 src/stock.c:92 +msgid "Linked" +msgstr "結合済" + +#: src/stock.c:91 src/stock.c:93 +msgid "Not Linked" +msgstr "結合なし" + +#: src/ui-property-bar.c:345 src/object-editor.c:499 +msgid "Default" +msgstr "デフォルト" + +#: src/ui-property-bar.c:360 src/object-editor.c:512 +msgid "No fill" +msgstr "塗りつぶさない" + +#: src/ui-property-bar.c:375 src/object-editor.c:505 +msgid "No line" +msgstr "線を消す" + +#: src/ui-sidebar.c:180 +msgid "Object properties" +msgstr "オブジェクトのプロパティ" + +#: src/commands.c:385 +msgid "" +"A label and business card creation program for GNOME.\n" +" \n" +"Glabels is free software; you can redistribute it and/or modify it under the " +"terms of the GNU General Public License as published by the Free Software " +"Foundation; either version 2 of the License, or (at your option) any later " +"version.\n" +" \n" +"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.\n" +msgstr "" +"GNOME 向けのラベル/ビジネスカードの作成プログラムです。\n" +"\n" +"Glabels はフリーソフトです。フリーソフトウェア財団が定める GNU 一般公有使用許" +"諾契約書の第2版もしくはそれ以降のバージョンの下で複製、改編、再配布が認められ" +"ています。\n" +"\n" +"このプログラムが役に立つことを望む中で配布されていますが、完全無保証です。販" +"売目的または商用目的の保証はありません。詳細については GNU 一般公有使用許諾契" +"約書を参照して下さい。\n" + +#: src/commands.c:399 +msgid "See the file AUTHORS for additional credits," +msgstr "補足のクレジットについては AUTHORS ファイルをご覧になるか、" + +#: src/commands.c:400 +msgid "or visit http://glabels.sourceforge.net/" +msgstr "または http://glabels.sourceforge.net/ を訪れてみて下さい。" + +#: src/commands.c:409 +msgid " " +msgstr " " + +#: src/commands.c:424 +msgid "glabels" +msgstr "gLabels" + +#: src/file.c:100 +msgid "New Label or Card" +msgstr "新規ラベルまたはカード" + +#: src/file.c:132 src/file.c:304 +msgid "Media Type" +msgstr "メディアの種類" + +#: src/file.c:138 src/file.c:310 +msgid "Label orientation" +msgstr "ラベルの向き" + +#: src/file.c:269 +msgid "Label properties" +msgstr "ラベルのプロパティ" + +#: src/file.c:452 src/file.c:870 +msgid "All files" +msgstr "全てのファイル" + +#: src/file.c:457 src/file.c:875 +msgid "gLabels documents" +msgstr "gLabels のドキュメント" + +#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 +msgid "Empty file name selection" +msgstr "ファイル名の入力欄が空です" + +#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 +msgid "Please select a file or supply a valid file name" +msgstr "既存のファイルを選択するか、または正しいファイル名を指定して下さい。" + +#: src/file.c:519 src/file.c:631 +msgid "File does not exist" +msgstr "ファイルがありません。" + +#: src/file.c:563 data/ui/glabels-ui.xml.h:75 +msgid "Open" +msgstr "開く" + +#: src/file.c:565 +msgid "Open label" +msgstr "ラベルを開きます" + +#: src/file.c:707 +#, c-format +msgid "Could not open file \"%s\"" +msgstr "ファイル \"%s\" が開けませんでした" + +#: src/file.c:715 +msgid "Not a supported file format" +msgstr "サポートしていないファイル形式です。" + +#: src/file.c:797 src/file.c:979 src/file.c:1174 +#, c-format +msgid "Could not save file \"%s\"" +msgstr "ファイル \"%s\" を保存できませんでした" + +#: src/file.c:805 src/file.c:987 src/file.c:1182 +msgid "Error encountered during save. The file is still not saved." +msgstr "データ保存中にエラーが発生しました。データはまだ保存されていません。" + +#: src/file.c:848 src/file.c:1048 +#, c-format +msgid "Save \"%s\" as" +msgstr "\"%s\" に名前を付けて保存" + +#: src/file.c:935 src/file.c:1131 +msgid "Please supply a valid file name" +msgstr "正しいファイル名を指定して下さい" + +#: src/file.c:952 src/file.c:1147 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "ファイル \"%s\" に上書きしますか?" + +#: src/file.c:960 src/file.c:1155 +msgid "File already exists." +msgstr "ファイルが既に存在します。" + +#: src/file.c:1271 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "終了する前にドキュメント \"%s\" に対する変更を保存しますか?" + +#: src/file.c:1279 +msgid "Your changes will be lost if you don't save them." +msgstr "保存しないと変更したデータを失うことになります。" + +#: src/file.c:1282 +msgid "Close without saving" +msgstr "保存せずに閉じる" + +#. Should not happen +#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 +#: data/glade/object-editor.glade.h:37 +msgid "points" +msgstr "ポイント" + +#: src/prefs.c:158 data/glade/object-editor.glade.h:36 +#: data/glade/template-designer.glade.h:74 +msgid "inches" +msgstr "[インチ]" + +#: src/prefs.c:160 +msgid "mm" +msgstr "[ミリ]" + +#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 +msgid "gLabels Preferences" +msgstr "gLabels の設定" + +#. +#. * Submenu: Order +#. +#: src/view.c:3570 data/ui/glabels-ui.xml.h:157 +msgid "_Order" +msgstr "順序(_O)" + +#. +#. * Submenu: Rotate/Flip +#. +#: src/view.c:3591 data/ui/glabels-ui.xml.h:163 +msgid "_Rotate/Flip" +msgstr "回転/フリップ(_R)" + +#. +#. * Submenu: Align Horizontally +#. +#: src/view.c:3624 +msgid "Align _Horizontally" +msgstr "水平方向に配置(_H)" + +#. +#. * Submenu: Align Vertically +#. +#: src/view.c:3663 +msgid "Align _Vertically" +msgstr "垂直方向に配置(_V)" + +#: src/view.c:3724 data/ui/glabels-ui.xml.h:140 +msgid "_Delete" +msgstr "削除(_D)" + +#. Build editor. +#: src/view-box.c:223 +msgid "Box object properties" +msgstr "矩形オブジェクトのプロパティ" + +#. Build editor. +#: src/view-ellipse.c:223 +msgid "Ellipse object properties" +msgstr "楕円オブジェクトのプロパティ" + +#. Build editor. +#: src/view-line.c:223 +msgid "Line object properties" +msgstr "直線オブジェクトのプロパティ" + +#. Build editor. +#: src/view-image.c:222 +msgid "Image object properties" +msgstr "画像オブジェクトのプロパティ" + +#. Build editor. +#: src/view-text.c:250 +msgid "Text object properties" +msgstr "文字オブジェクトのプロパティ" + +#: src/view-text.c:562 data/glade/object-editor.glade.h:28 +msgid "Text" +msgstr "文字" + +#. Build editor. +#: src/view-barcode.c:209 +msgid "Barcode object properties" +msgstr "バーコード・オブジェクトのプロパティ" + +#: src/view-barcode.c:579 src/print.c:1088 +msgid "Invalid barcode data" +msgstr "おかしなバーコード・データ" + +#: src/merge-properties-dialog.c:231 +msgid "Merge Properties" +msgstr "結合プロパティ" + +#. ---- Source section ---- +#: src/merge-properties-dialog.c:237 +msgid "Source" +msgstr "ソース" + +#: src/merge-properties-dialog.c:245 +msgid "Format:" +msgstr "書式:" + +#. Location line +#: src/merge-properties-dialog.c:273 +msgid "Location:" +msgstr "場所:" + +#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 +msgid "Select merge-database source" +msgstr "結合データベース・ソースの選択" + +#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 +msgid "N/A" +msgstr "N/A" + +#. ---- Sample Fields section ---- +#: src/merge-properties-dialog.c:300 +msgid "Record selection/preview:" +msgstr "選択範囲/プレビューの記録:" + +#: src/merge-properties-dialog.c:326 +msgid "Select" +msgstr "選択" + +#: src/merge-properties-dialog.c:334 +msgid "Record/Field" +msgstr "レコード/フィールド" + +#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 +msgid "Data" +msgstr "データ" + +#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:82 +msgid "Print" +msgstr "印刷" + +#: src/print-dialog.c:281 +msgid "_Job" +msgstr "ジョブ(_J)" + +#: src/print-dialog.c:286 +msgid "P_rinter" +msgstr "プリンタ(_R)" + +#. ----------- Add simple-copies widget ------------ +#: src/print-dialog.c:314 +msgid "Copies" +msgstr "コピー" + +#. ------- Add merge control widget ------------ +#: src/print-dialog.c:322 +msgid "Document merge control" +msgstr "ドキュメントをコントロールにマージする" + +#. ----------- Add custom print options area ------------ +#: src/print-dialog.c:330 +msgid "Options" +msgstr "オプション" + +#: src/print-dialog.c:351 +msgid "print crop marks" +msgstr "端のマークを揃えて印刷する" + +#: src/print-dialog.c:553 src/print-dialog.c:592 +msgid "Print preview" +msgstr "印刷プレビュー" + +#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 +msgid "gLabels Template Designer" +msgstr "gLabels テンプレート・デザイナ" + +#: src/bc.c:60 +msgid "POSTNET (any)" +msgstr "POSTNET (何でも)" + +#: src/bc.c:63 +msgid "POSTNET-5 (ZIP only)" +msgstr "POSTNET-5 (ZIP のみ)" + +#: src/bc.c:66 +msgid "POSTNET-9 (ZIP+4)" +msgstr "POSTNET-9 (ZIP+4)" + +#: src/bc.c:69 +msgid "POSTNET-11 (DPBC)" +msgstr "POSTNET-11 (DPBC)" + +#: src/bc.c:72 +msgid "EAN (any)" +msgstr "EAN (何でも)" + +#: src/bc.c:75 +msgid "EAN-8" +msgstr "EAN-8" + +#: src/bc.c:78 +msgid "EAN-8 +2" +msgstr "EAN-8 +2" + +#: src/bc.c:81 +msgid "EAN-8 +5" +msgstr "EAN-8 +5" + +#: src/bc.c:84 +msgid "EAN-13" +msgstr "EAN-13" + +#: src/bc.c:87 +msgid "EAN-13 +2" +msgstr "EAN-13 +2" + +#: src/bc.c:90 +msgid "EAN-13 +5" +msgstr "EAN-13 +5" + +#: src/bc.c:93 +msgid "UPC (UPC-A or UPC-E)" +msgstr "UPC (UPC-A または UPC-E)" + +#: src/bc.c:96 +msgid "UPC-A" +msgstr "UPC-A" + +#: src/bc.c:99 +msgid "UPC-A +2" +msgstr "UPC-A +2" + +#: src/bc.c:102 +msgid "UPC-A +5" +msgstr "UPC-A +5" + +#: src/bc.c:105 +msgid "UPC-E" +msgstr "UPC-E" + +#: src/bc.c:108 +msgid "UPC-E +2" +msgstr "UPC-E +2" + +#: src/bc.c:111 +msgid "UPC-E +5" +msgstr "UPC-E +5" + +#: src/bc.c:114 +msgid "ISBN" +msgstr "ISBN" + +#: src/bc.c:117 +msgid "ISBN +5" +msgstr "ISBN +5" + +#: src/bc.c:120 +msgid "Code 39" +msgstr "Code 39" + +#: src/bc.c:123 +msgid "Code 128" +msgstr "Code 128" + +#: src/bc.c:126 +msgid "Code 128C" +msgstr "Code 128C" + +#: src/bc.c:129 +msgid "Code 128B" +msgstr "Code 128B" + +#: src/bc.c:132 +msgid "Interleaved 2 of 5" +msgstr "綴じ込み 2/5" + +#: src/bc.c:135 +msgid "Codabar" +msgstr "Codabar" + +#: src/bc.c:138 +msgid "MSI" +msgstr "MSI" + +#: src/bc.c:141 +msgid "Plessey" +msgstr "Plessey" + +#: src/label.c:569 +msgid "Untitled" +msgstr "タイトルなし" + +#: src/xml-label.c:176 src/xml-label.c:213 +msgid "xmlParseFile error" +msgstr "xmlParseFile エラー" + +#: src/xml-label.c:250 +msgid "No document root" +msgstr "root ドキュメントではありません" + +#: src/xml-label.c:264 +msgid "Importing from glabels 0.1 format" +msgstr "gLabels 0.1 形式からインポートする" + +#: src/xml-label.c:272 +msgid "Importing from glabels 0.4 format" +msgstr "gLabels 0.4 形式からインポートする" + +#: src/xml-label.c:279 +msgid "Importing from glabels 1.91 format" +msgstr "gLabels 1.91 形式からインポートする" + +#: src/xml-label.c:282 +msgid "bad document, unknown glabels Namespace" +msgstr "ドキュメントの種類が間違っています。Glabels 名前空間が見つかりません。" + +#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "おかしな root のノード = \"%s\"" + +#: src/xml-label.c:348 src/xml-label-191.c:165 +#, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "Document ノードにおかしな root のノード = \"%s\"" + +#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 +#, c-format +msgid "bad node = \"%s\"" +msgstr "おかしなノード = \"%s\"" + +#: src/xml-label.c:796 src/xml-label-191.c:605 +#, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "Data ノードにおかしなノード = \"%s\"" + +#: src/xml-label.c:962 libglabels/xml-template.c:535 +msgid "Utf8 conversion error." +msgstr "Utf8 変換エラーです。" + +#: src/xml-label.c:969 libglabels/xml-template.c:542 +msgid "Problem saving xml file." +msgstr "XML ファイルの保存で問題があります" + +#. This should always be an id, but just in case a name +#. slips by! +#: src/xml-label-191.c:680 libglabels/xml-template.c:199 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "不明なページ・サイズの ID \"%s\" です。名前として扱います。" + +#: src/xml-label-191.c:690 libglabels/xml-template.c:209 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "不明なページ・サイズの ID または名前 \"%s\" です。" + +#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 +msgid "None" +msgstr "なし" + +#: src/merge-init.c:53 +msgid "Text file with comma delimeters (CSV)" +msgstr "コンマで区切ったテキスト・ファイル (CSV)" + +#: src/merge-init.c:60 +msgid "Text file with colon delimeters" +msgstr "コロンで区切ったテキスト・ファイル" + +#: src/merge-init.c:67 +msgid "Text file with tab delimeters" +msgstr "タブで区切ったテキスト・ファイル" + +#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 +msgid "File:" +msgstr "ファイル:" + +#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 +msgid "Key:" +msgstr "キー:" + +#: src/wdgt-print-copies.c:179 +msgid "Sheets:" +msgstr "用紙:" + +#: src/wdgt-print-copies.c:197 +msgid "Labels" +msgstr "ラベル" + +#: src/wdgt-print-copies.c:200 +msgid "from:" +msgstr "開始:" + +#: src/wdgt-print-copies.c:207 +msgid "to:" +msgstr "終了:" + +#: src/wdgt-print-merge.c:178 +msgid "Start on label" +msgstr "ラベルの開始" + +#: src/wdgt-print-merge.c:186 +msgid "on 1st sheet" +msgstr "(最初のシート)" + +#: src/wdgt-print-merge.c:195 +msgid "Copies:" +msgstr "コピー:" + +#: src/wdgt-print-merge.c:201 +msgid "Collate" +msgstr "製本" + +#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 +msgid "Description:" +msgstr "説明:" + +#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 +msgid "Page size:" +msgstr "用紙のサイズ:" + +#: src/wdgt-media-select.c:290 +msgid "Label size:" +msgstr "ラベルのサイズ:" + +#: src/wdgt-media-select.c:301 +msgid "Layout:" +msgstr "レイアウト:" + +#: src/wdgt-media-select.c:578 +#, c-format +msgid "%d x %d (%d per sheet)" +msgstr "%d x %d (%d 個/シート)" + +#: src/wdgt-media-select.c:582 +#, c-format +msgid "%d per sheet" +msgstr "%d /シート" + +#: src/wdgt-media-select.c:614 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +#: src/wdgt-media-select.c:619 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 +#, c-format +msgid "%s %s diameter" +msgstr "%s %s 倍率" + +#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 +#, c-format +msgid "%.5g %s diameter" +msgstr "%.5g %s 倍率" + +#: src/wdgt-rotate-label.c:193 +msgid "Rotate" +msgstr "回転させる" + +#. This is the default custom color +#: src/mygal/color-palette.c:396 +msgid "custom" +msgstr "カスタム" + +#. "Custom" color - we'll pop up a GnomeColorPicker +#: src/mygal/color-palette.c:438 +msgid "Custom Color:" +msgstr "カスタム色:" + +#: src/mygal/color-palette.c:446 +msgid "Choose Custom Color" +msgstr "カスタム・カラーの選択" + +#: src/mygal/color-palette.c:579 +msgid "black" +msgstr "黒" + +#: src/mygal/color-palette.c:580 +msgid "light brown" +msgstr "淡い茶" + +#: src/mygal/color-palette.c:581 +msgid "brown gold" +msgstr "茶銀" + +#: src/mygal/color-palette.c:582 +msgid "dark green #2" +msgstr "暗い緑 #2" + +#: src/mygal/color-palette.c:583 +msgid "navy" +msgstr "ネービー" + +#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 +msgid "dark blue" +msgstr "暗い青" + +#: src/mygal/color-palette.c:585 +msgid "purple #2" +msgstr "ç´« #2" + +#: src/mygal/color-palette.c:586 +msgid "very dark gray" +msgstr "とても暗い灰" + +#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 +msgid "dark red" +msgstr "暗い赤" + +#: src/mygal/color-palette.c:590 +msgid "red-orange" +msgstr "赤みの橙" + +#: src/mygal/color-palette.c:591 +msgid "gold" +msgstr "金" + +#: src/mygal/color-palette.c:592 +msgid "dark green" +msgstr "暗い緑" + +#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 +msgid "dull blue" +msgstr "くすんだ青" + +#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 +msgid "blue" +msgstr "青" + +#: src/mygal/color-palette.c:595 +msgid "dull purple" +msgstr "くすんだ紫" + +#: src/mygal/color-palette.c:596 +msgid "dark grey" +msgstr "暗い灰" + +#: src/mygal/color-palette.c:599 +msgid "red" +msgstr "赤" + +#: src/mygal/color-palette.c:600 +msgid "orange" +msgstr "橙" + +#: src/mygal/color-palette.c:601 +msgid "lime" +msgstr "ライム" + +#: src/mygal/color-palette.c:602 +msgid "dull green" +msgstr "くすんだ緑" + +#: src/mygal/color-palette.c:603 +msgid "dull blue #2" +msgstr "くすんだ青 #2" + +#: src/mygal/color-palette.c:604 +msgid "sky blue #2" +msgstr "スカイブルー #2" + +#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 +msgid "purple" +msgstr "ç´«" + +#: src/mygal/color-palette.c:606 +msgid "gray" +msgstr "灰" + +#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 +msgid "magenta" +msgstr "マゼンタ" + +#: src/mygal/color-palette.c:610 +msgid "bright orange" +msgstr "明るい橙" + +#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 +msgid "yellow" +msgstr "黄" + +#: src/mygal/color-palette.c:612 +msgid "green" +msgstr "緑" + +#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 +msgid "cyan" +msgstr "シアン" + +#: src/mygal/color-palette.c:614 +msgid "bright blue" +msgstr "明るい青" + +#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 +msgid "red purple" +msgstr "赤紫" + +#: src/mygal/color-palette.c:616 +msgid "light grey" +msgstr "淡い灰" + +#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 +msgid "pink" +msgstr "ピンク" + +#: src/mygal/color-palette.c:620 +msgid "light orange" +msgstr "淡い橙" + +#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 +msgid "light yellow" +msgstr "淡い黄" + +#: src/mygal/color-palette.c:622 +msgid "light green" +msgstr "淡い緑" + +#: src/mygal/color-palette.c:623 +msgid "light cyan" +msgstr "淡いシアン" + +#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 +msgid "light blue" +msgstr "淡い青" + +#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 +msgid "light purple" +msgstr "淡い紫" + +#: src/mygal/color-palette.c:626 +msgid "white" +msgstr "白" + +#: src/mygal/color-palette.c:631 +msgid "purplish blue" +msgstr "紫みの青" + +#: src/mygal/color-palette.c:635 +msgid "dark purple" +msgstr "暗い紫" + +#: src/mygal/color-palette.c:637 +msgid "sky blue" +msgstr "スカイブルー" + +#: libglabels/template.c:848 +#, c-format +msgid "Generic %s full page" +msgstr "Generic %s フル・ページ" + +#: libglabels/template.c:897 +msgid "No template files found!" +msgstr "テンプレート・ファイルが見つかりません!" + +#. Create and append an "Other" entry. +#: libglabels/paper.c:67 +msgid "Other" +msgstr "その他" + +#: libglabels/paper.c:361 +msgid "No paper files found!" +msgstr "用紙ふぃあるが見つかりません!" + +#: data/ui/glabels-ui.xml.h:1 +msgid "About glabels" +msgstr "gLabels について" + +#: data/ui/glabels-ui.xml.h:2 +msgid "About..." +msgstr "情報..." + +#: data/ui/glabels-ui.xml.h:3 +msgid "Align _Horizontal" +msgstr "水平方向に配置(_H)" + +#: data/ui/glabels-ui.xml.h:4 +msgid "Align _Vertical" +msgstr "垂直方向に配置(_V)" + +#: data/ui/glabels-ui.xml.h:5 +msgid "Align objects to bottoms" +msgstr "オブジェクトを下端に配置します" + +#: data/ui/glabels-ui.xml.h:6 +msgid "Align objects to horizontal centers" +msgstr "オブジェクトを水平方向の中心に配置します" + +#: data/ui/glabels-ui.xml.h:7 +msgid "Align objects to left edges" +msgstr "オブジェクトを左端に配置します" + +#: data/ui/glabels-ui.xml.h:8 +msgid "Align objects to right edges" +msgstr "オブジェクトを右端に配置します" + +#: data/ui/glabels-ui.xml.h:9 +msgid "Align objects to tops" +msgstr "オブジェクトを上端に配置します" + +#: data/ui/glabels-ui.xml.h:10 +msgid "Align objects to vertical centers" +msgstr "オブジェクトを垂直方向の中心に配置します" + +#: data/ui/glabels-ui.xml.h:12 +msgid "Bold" +msgstr "文字を太字にします" + +#: data/ui/glabels-ui.xml.h:14 +msgid "Center align" +msgstr "中央に揃えます" + +#: data/ui/glabels-ui.xml.h:15 +msgid "Center objects to horizontal label center" +msgstr "オブジェクトをラベルの中心に水平移動します" + +#: data/ui/glabels-ui.xml.h:16 +msgid "Center objects to vertical label center" +msgstr "オブジェクトをラベルの中心に垂直移動します" + +#: data/ui/glabels-ui.xml.h:17 +msgid "Change the visibility of markup lines in the current window" +msgstr "ラベルの外枠線の表示/非表示を変更します" + +#: data/ui/glabels-ui.xml.h:18 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "ツールバーの表示/非表示を変更します" + +#: data/ui/glabels-ui.xml.h:19 +msgid "Change the visibility of the grid in the current window" +msgstr "ラベルのグリッド (格子線) の表示/非表示を変更します" + +#: data/ui/glabels-ui.xml.h:20 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "メイン・ツールバーの表示/非表示を変更します" + +#: data/ui/glabels-ui.xml.h:21 +msgid "Change the visibility of the property toolbar in the current window" +msgstr "プロパティ・ツールバーの表示/非表示を変更します" + +#: data/ui/glabels-ui.xml.h:22 +msgid "Close" +msgstr "閉じる" + +#: data/ui/glabels-ui.xml.h:23 +msgid "Close the current file" +msgstr "このファイルを閉じます" + +#: data/ui/glabels-ui.xml.h:24 +msgid "Configure the application" +msgstr "gLabel の設定を変更します" + +#: data/ui/glabels-ui.xml.h:25 +msgid "Contents" +msgstr "目次" + +#: data/ui/glabels-ui.xml.h:26 +msgid "Copy" +msgstr "コピー" + +#: data/ui/glabels-ui.xml.h:27 +msgid "Copy the selection" +msgstr "選択範囲をコピーします" + +#: data/ui/glabels-ui.xml.h:28 +msgid "Create a custom template" +msgstr "カスタム・テンプレートを生成します" + +#: data/ui/glabels-ui.xml.h:29 +msgid "Create a new document" +msgstr "新しいドキュメントを作成します" + +#: data/ui/glabels-ui.xml.h:30 +msgid "Create barcode object" +msgstr "バーコード・オブジェクトを作成します" + +#: data/ui/glabels-ui.xml.h:31 +msgid "Create box/rectangle object" +msgstr "四角/三角のオブジェクトを作成します" + +#: data/ui/glabels-ui.xml.h:32 +msgid "Create ellipse/circle object" +msgstr "楕円/円オブジェクトを作成します" + +#: data/ui/glabels-ui.xml.h:33 +msgid "Create image object" +msgstr "画像オブジェクトを作成します" + +#: data/ui/glabels-ui.xml.h:34 +msgid "Create line object" +msgstr "直線オブジェクトを作成します" + +#: data/ui/glabels-ui.xml.h:35 +msgid "Create text object" +msgstr "文字オブジェクトを作成します" + +#: data/ui/glabels-ui.xml.h:36 +msgid "Cu_t" +msgstr "切り取り(_T)" + +#: data/ui/glabels-ui.xml.h:37 +msgid "Customize" +msgstr "カスタマイズ" + +#: data/ui/glabels-ui.xml.h:38 +msgid "Customize Drawing Toolbar" +msgstr "ツールバー" + +#: data/ui/glabels-ui.xml.h:39 +msgid "Customize Main Toolbar" +msgstr "メイン・ツールバー" + +#: data/ui/glabels-ui.xml.h:40 +msgid "Customize Property Toolbar" +msgstr "プロパティ・ツールバー" + +#: data/ui/glabels-ui.xml.h:41 +msgid "Customize toolbars" +msgstr "ツールバーのカスタマイズ" + +#: data/ui/glabels-ui.xml.h:42 +msgid "Cut" +msgstr "切り取り" + +#: data/ui/glabels-ui.xml.h:43 +msgid "Cut the selection" +msgstr "選択範囲を切り取ります" + +#: data/ui/glabels-ui.xml.h:44 +msgid "Decrease magnification" +msgstr "拡大率を下げます" + +#: data/ui/glabels-ui.xml.h:45 +msgid "Delete" +msgstr "削除" + +#: data/ui/glabels-ui.xml.h:46 +msgid "Delete the selected objects" +msgstr "選択したオブジェクトを削除します" + +#: data/ui/glabels-ui.xml.h:47 +msgid "Drawing toolbar" +msgstr "ツールバーの表示方法" + +#: data/ui/glabels-ui.xml.h:48 +msgid "Dump XML" +msgstr "XML のダンプ" + +#: data/ui/glabels-ui.xml.h:49 +msgid "Dump the UI Xml description" +msgstr "GUI の XML 記述をダンプ表示します" + +#: data/ui/glabels-ui.xml.h:50 +msgid "Edit merge properties" +msgstr "結合プロパティを編集します" + +#: data/ui/glabels-ui.xml.h:54 +msgid "Flip object horizontally" +msgstr "オブジェクトを水平方向にひっくり返します" + +#: data/ui/glabels-ui.xml.h:55 +msgid "Flip object vertically" +msgstr "オブジェクトを垂直方向にひっくり返します" + +#: data/ui/glabels-ui.xml.h:56 +msgid "Font name" +msgstr "フォント名です" + +#: data/ui/glabels-ui.xml.h:57 +msgid "Font selector" +msgstr "フォント・セレクタ" + +#: data/ui/glabels-ui.xml.h:58 +msgid "Font size" +msgstr "フォント・サイズです" + +#: data/ui/glabels-ui.xml.h:59 +msgid "Icon and _Text" +msgstr "アイコンとラベル(_T)" + +#: data/ui/glabels-ui.xml.h:60 +msgid "Increase magnification" +msgstr "拡大率を上げます" + +#: data/ui/glabels-ui.xml.h:61 +msgid "Italic" +msgstr "文字を斜体にします" + +#: data/ui/glabels-ui.xml.h:63 +msgid "Left align" +msgstr "左に寄せませす" + +#: data/ui/glabels-ui.xml.h:65 +msgid "Line width" +msgstr "線の幅を選択します" + +#: data/ui/glabels-ui.xml.h:66 +msgid "Lower object to bottom" +msgstr "オブジェクトを後ろに回します" + +#: data/ui/glabels-ui.xml.h:67 +msgid "M_arkup" +msgstr "マークアップ(_A)" + +#: data/ui/glabels-ui.xml.h:68 +msgid "Main toolbar" +msgstr "メイン・ツールバー" + +#: data/ui/glabels-ui.xml.h:69 +msgid "Markup" +msgstr "マークアップ" + +#: data/ui/glabels-ui.xml.h:70 +msgid "Modify document properties" +msgstr "ドキュメントのプロパティを修正します" + +#: data/ui/glabels-ui.xml.h:71 +msgid "New" +msgstr "新規" + +#: data/ui/glabels-ui.xml.h:72 +msgid "Object property editor" +msgstr "オブジェクト・プロパティのエディタ" + +#: data/ui/glabels-ui.xml.h:73 +msgid "Only show icons in the drawing toolbar" +msgstr "ツールバーの中にアイコンのみ表示します" + +#: data/ui/glabels-ui.xml.h:74 +msgid "Only show icons in the main toolbar" +msgstr "メイン・ツールバーの中にアイコンのみ表示します" + +#: data/ui/glabels-ui.xml.h:76 +msgid "Open a file" +msgstr "ファイルを開きます" + +#: data/ui/glabels-ui.xml.h:77 +msgid "Open the glabels manual" +msgstr "gLabeles のマニュアルを開きます" + +#: data/ui/glabels-ui.xml.h:78 +msgid "Paste" +msgstr "貼り付け" + +#: data/ui/glabels-ui.xml.h:79 +msgid "Paste the clipboard" +msgstr "クリップボードの内容を貼り付けます" + +#: data/ui/glabels-ui.xml.h:80 +msgid "Pr_eferences..." +msgstr "設定(_E)..." + +#: data/ui/glabels-ui.xml.h:81 +msgid "Preferences" +msgstr "gLabel の設定" + +#: data/ui/glabels-ui.xml.h:83 +msgid "Print the current file" +msgstr "このファイルを印刷します" + +#: data/ui/glabels-ui.xml.h:84 +msgid "Proper_ties..." +msgstr "プロパティ(_T)..." + +#: data/ui/glabels-ui.xml.h:85 +msgid "Properties" +msgstr "プロパティ" + +#: data/ui/glabels-ui.xml.h:86 +msgid "Property toolbar" +msgstr "プロパティのツールバー" + +#: data/ui/glabels-ui.xml.h:87 +msgid "Quit" +msgstr "終了" + +#: data/ui/glabels-ui.xml.h:88 +msgid "Quit the program" +msgstr "gLabels を終了します" + +#: data/ui/glabels-ui.xml.h:89 +msgid "Raise object to top" +msgstr "オブジェクトを前に持ってきます" + +#: data/ui/glabels-ui.xml.h:90 +msgid "Recent _Files" +msgstr "最近開いたファイル(_F)" + +#: data/ui/glabels-ui.xml.h:91 +msgid "Redo" +msgstr "やり直し" + +#: data/ui/glabels-ui.xml.h:92 +msgid "Redo the undone action" +msgstr "完了していない操作をやり直します" + +#: data/ui/glabels-ui.xml.h:93 +msgid "Remove all selections" +msgstr "選択範囲を解除します" + +#: data/ui/glabels-ui.xml.h:95 +#, no-c-format +msgid "Restore scale to 100%" +msgstr "拡大率を 100% に戻します" + +#: data/ui/glabels-ui.xml.h:96 +msgid "Right align" +msgstr "右に寄せます" + +#: data/ui/glabels-ui.xml.h:99 +msgid "Rotate object 90 clockwise" +msgstr "オブジェクトを時計回りに 90°回転させます" + +#: data/ui/glabels-ui.xml.h:100 +msgid "Rotate object 90 counter-clockwise" +msgstr "オブジェクトを反時計回りに 90°回転させます" + +#: data/ui/glabels-ui.xml.h:101 +msgid "Save" +msgstr "保存" + +#: data/ui/glabels-ui.xml.h:102 +msgid "Save As" +msgstr "名前を付けて保存" + +#: data/ui/glabels-ui.xml.h:103 +msgid "Save _As..." +msgstr "別名で保存(_A)..." + +#: data/ui/glabels-ui.xml.h:104 +msgid "Save the current file" +msgstr "このファイルを保存します" + +#: data/ui/glabels-ui.xml.h:105 +msgid "Save the current file with a different name" +msgstr "このデータに別の名前を付けて保存します" + +#: data/ui/glabels-ui.xml.h:106 +msgid "Select All" +msgstr "全て選択" + +#: data/ui/glabels-ui.xml.h:107 +msgid "Select _All" +msgstr "全て選択(_A)" + +#: data/ui/glabels-ui.xml.h:108 +msgid "Select all objects" +msgstr "全てのオブジェクトを選択します" + +#: data/ui/glabels-ui.xml.h:109 +msgid "Select, move and modify objects" +msgstr "オブジェクトの選択、移動、編集を行います" + +#: data/ui/glabels-ui.xml.h:111 +msgid "Set drawing toolbar button style according to desktop default" +msgstr "デスクトップの設定に従ってツールバーを表示します" + +#: data/ui/glabels-ui.xml.h:112 +msgid "Set main toolbar button style according to desktop default" +msgstr "デスクトップの設定に従ってメイン・ツールバーを表示します" + +#: data/ui/glabels-ui.xml.h:113 +msgid "Show _Tooltips" +msgstr "ツールチップの表示(_T)" + +#: data/ui/glabels-ui.xml.h:114 +msgid "Show both icons and texts in the drawing toolbar" +msgstr "ツールバーにアイコンとラベルの両方を表示します" + +#: data/ui/glabels-ui.xml.h:115 +msgid "Show both icons and texts in the main toolbar" +msgstr "メイン・ツールバーにアイコンとラベルの両方を表示します" + +#: data/ui/glabels-ui.xml.h:116 +msgid "Show tooltips in the drawing toolbar" +msgstr "ツールバーにツールチップを表示します" + +#: data/ui/glabels-ui.xml.h:117 +msgid "Show tooltips in the main toolbar" +msgstr "メイン・ツールバーにツールチップを表示します" + +#: data/ui/glabels-ui.xml.h:118 +msgid "Show tooltips in the property toolbar" +msgstr "プロパティ・ツールバーにツールチップを表示します" + +#: data/ui/glabels-ui.xml.h:119 +msgid "Template Designer" +msgstr "テンプレート・デザイナ" + +#: data/ui/glabels-ui.xml.h:120 +msgid "Template _Designer..." +msgstr "テンプレート・デザイナ(_D)..." + +#: data/ui/glabels-ui.xml.h:121 +msgid "Text color" +msgstr "文字の色を選択します" + +#: data/ui/glabels-ui.xml.h:122 +msgid "U_n-select All" +msgstr "全て選択解除(_N)" + +#: data/ui/glabels-ui.xml.h:123 +msgid "Un-select All" +msgstr "全て選択解除" + +#: data/ui/glabels-ui.xml.h:124 +msgid "Undo" +msgstr "元に戻す" + +#: data/ui/glabels-ui.xml.h:125 +msgid "Undo the last action" +msgstr "最後の操作を取り消します" + +#: data/ui/glabels-ui.xml.h:126 +msgid "Zoom _1:1" +msgstr "拡大率 1:1(_1)" + +#: data/ui/glabels-ui.xml.h:127 +msgid "Zoom _In" +msgstr "拡大(_I)" + +#: data/ui/glabels-ui.xml.h:128 +msgid "Zoom _Out" +msgstr "縮小(_O)" + +#: data/ui/glabels-ui.xml.h:129 +msgid "Zoom to _fit" +msgstr "ウィンドウにあわせる(_F)" + +#: data/ui/glabels-ui.xml.h:130 +msgid "Zoom to fit window" +msgstr "ウィンドウのサイズに合わせます" + +#: data/ui/glabels-ui.xml.h:131 +msgid "_About..." +msgstr "情報(_A)..." + +#: data/ui/glabels-ui.xml.h:132 +msgid "_Bottoms" +msgstr "下部(_B)" + +#: data/ui/glabels-ui.xml.h:135 +msgid "_Close" +msgstr "閉じる(_C)" + +#: data/ui/glabels-ui.xml.h:136 +msgid "_Contents" +msgstr "目次(_C)" + +#: data/ui/glabels-ui.xml.h:137 +msgid "_Copy" +msgstr "複写(_C)" + +#: data/ui/glabels-ui.xml.h:138 +msgid "_Create Object" +msgstr "オブジェクトの生成(_C)" + +#: data/ui/glabels-ui.xml.h:139 +msgid "_Debug" +msgstr "デバッグ(_D)" + +#: data/ui/glabels-ui.xml.h:141 +msgid "_Desktop Default" +msgstr "デスクトップ設定(_D)" + +#: data/ui/glabels-ui.xml.h:142 +msgid "_Drawing Toolbar" +msgstr "ツールバー(_D)" + +#: data/ui/glabels-ui.xml.h:143 +msgid "_Edit" +msgstr "編集(_E)" + +#: data/ui/glabels-ui.xml.h:145 +msgid "_File" +msgstr "ファイル(_F)" + +#: data/ui/glabels-ui.xml.h:146 +msgid "_Grid" +msgstr "グリッド(_G)" + +#: data/ui/glabels-ui.xml.h:147 +msgid "_Help" +msgstr "ヘルプ(_H)" + +#: data/ui/glabels-ui.xml.h:148 +msgid "_Icon" +msgstr "アイコン(_I)" + +#: data/ui/glabels-ui.xml.h:152 +msgid "_Main Toolbar" +msgstr "メイン・ツールバー(_M)" + +#: data/ui/glabels-ui.xml.h:153 +msgid "_Merge Properties..." +msgstr "結合プロパティ(_M)..." + +#: data/ui/glabels-ui.xml.h:154 +msgid "_New" +msgstr "新規(_N)" + +#: data/ui/glabels-ui.xml.h:155 +msgid "_Objects" +msgstr "オブジェクト(_O)" + +#: data/ui/glabels-ui.xml.h:156 +msgid "_Open..." +msgstr "開く(_O)..." + +#: data/ui/glabels-ui.xml.h:158 +msgid "_Paste" +msgstr "貼り付け(_P)" + +#: data/ui/glabels-ui.xml.h:159 +msgid "_Print..." +msgstr "印刷(_P)..." + +#: data/ui/glabels-ui.xml.h:160 +msgid "_Property Toolbar" +msgstr "プロパティ・ツールバー(_P)" + +#: data/ui/glabels-ui.xml.h:161 +msgid "_Quit" +msgstr "終了(_Q)" + +#: data/ui/glabels-ui.xml.h:164 +msgid "_Save" +msgstr "保存(_S)" + +#: data/ui/glabels-ui.xml.h:168 +msgid "_View" +msgstr "表示(_V)" + +#: data/glade/prefs-dialog.glade.h:1 +msgid " " +msgstr " " + +#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 +#: data/glade/template-designer.glade.h:5 +msgid "*" +msgstr "*" + +#: data/glade/prefs-dialog.glade.h:3 +msgid "Default page size" +msgstr "ページ・サイズの初期値" + +#: data/glade/prefs-dialog.glade.h:4 +msgid "Fill" +msgstr "塗りつぶし" + +#: data/glade/prefs-dialog.glade.h:5 +msgid "Line" +msgstr "線" + +#: data/glade/prefs-dialog.glade.h:6 +msgid "Text" +msgstr "文字" + +#: data/glade/prefs-dialog.glade.h:7 +msgid "Units" +msgstr "単位" + +#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 +msgid "Alignment:" +msgstr "位置:" + +#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 +msgid "Color:" +msgstr "色:" + +#: data/glade/prefs-dialog.glade.h:10 +msgid "Font:" +msgstr "フォント:" + +#: data/glade/prefs-dialog.glade.h:11 +msgid "ISO A4" +msgstr "ISO A4 版" + +#: data/glade/prefs-dialog.glade.h:12 +msgid "Inches" +msgstr "インチ" + +#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 +msgid "Line Spacing:" +msgstr "行間:" + +#: data/glade/prefs-dialog.glade.h:14 +msgid "Locale" +msgstr "ローケル" + +#: data/glade/prefs-dialog.glade.h:15 +msgid "Millimeters" +msgstr "ミリ" + +#: data/glade/prefs-dialog.glade.h:16 +msgid "Object defaults" +msgstr "オブジェクトのデフォルト" + +#: data/glade/prefs-dialog.glade.h:17 +msgid "Points" +msgstr "ポイント" + +#: data/glade/prefs-dialog.glade.h:18 +msgid "Select default properties for new objects." +msgstr "新規に作成するオブジェクトのデフォルト値を選択して下さい。" + +#: data/glade/prefs-dialog.glade.h:19 +msgid "Select locale specific behavior." +msgstr "利用する言語 (ロケール) に依存する動作を選択して下さい。" + +#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:25 +msgid "US Letter" +msgstr "US レター" + +#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 +#: data/glade/template-designer.glade.h:72 +msgid "Width:" +msgstr "幅:" + +#: data/glade/object-editor.glade.h:2 +msgid "00000000000 00000" +msgstr "00000000000 00000" + +#: data/glade/object-editor.glade.h:3 +msgid "Xxx object properties" +msgstr "" +"Xxx オブジェクトのプロパティ" + +#: data/glade/object-editor.glade.h:5 +msgid "Allow merge to automatically shrink text" +msgstr "自動的に文字を小さくして結合できるようにする" + +#: data/glade/object-editor.glade.h:6 +msgid "Angle:" +msgstr "角度:" + +#: data/glade/object-editor.glade.h:7 +msgid "Checksum" +msgstr "チェックサム" + +#: data/glade/object-editor.glade.h:10 +msgid "Family:" +msgstr "ファミリ:" + +#: data/glade/object-editor.glade.h:12 +msgid "Fill" +msgstr "塗りつぶし" + +#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 +msgid "Height:" +msgstr "高さ:" + +#: data/glade/object-editor.glade.h:14 +msgid "Image" +msgstr "画像" + +#: data/glade/object-editor.glade.h:15 +msgid "Insert merge field" +msgstr "結合フィールドの挿入" + +#: data/glade/object-editor.glade.h:17 +msgid "Length:" +msgstr "長さ:" + +#: data/glade/object-editor.glade.h:18 +msgid "Line" +msgstr "直線" + +#: data/glade/object-editor.glade.h:20 +msgid "Literal:" +msgstr "リテラル:" + +#: data/glade/object-editor.glade.h:21 +msgid "Load image" +msgstr "画像の読み込み" + +#: data/glade/object-editor.glade.h:22 +msgid "Position" +msgstr "位置" + +#: data/glade/object-editor.glade.h:23 +msgid "Reset image size" +msgstr "画像サイズのリセット" + +#: data/glade/object-editor.glade.h:24 +msgid "Size" +msgstr "サイズ" + +#: data/glade/object-editor.glade.h:25 +msgid "Size:" +msgstr "サイズ:" + +#: data/glade/object-editor.glade.h:26 +msgid "Style" +msgstr "スタイル" + +#: data/glade/object-editor.glade.h:27 +msgid "Style:" +msgstr "スタイル:" + +#: data/glade/object-editor.glade.h:30 +msgid "X:" +msgstr "X:" + +#: data/glade/object-editor.glade.h:31 +msgid "Y:" +msgstr "Y:" + +#: data/glade/object-editor.glade.h:32 +msgid "degrees" +msgstr "度" + +#: data/glade/object-editor.glade.h:33 +msgid "dialog1" +msgstr "dialog1" + +#: data/glade/object-editor.glade.h:34 +msgid "digits:" +msgstr "桁数:" + +#: data/glade/object-editor.glade.h:35 +msgid "format:" +msgstr "書式:" + +#: data/glade/template-designer.glade.h:1 +msgid " " +msgstr " " + +#: data/glade/template-designer.glade.h:2 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "(例: \"封筒のラベル\", \"名刺\", ...)" + +#: data/glade/template-designer.glade.h:3 +msgid "(e.g., 8163A)" +msgstr "(例: 8163A)" + +#: data/glade/template-designer.glade.h:4 +msgid "(e.g., Avery, Acme, ...)" +msgstr "(例: Avery, Acme, ...)" + +#: data/glade/template-designer.glade.h:6 +msgid "1. Outer radius:" +msgstr "1. 外径:" + +#: data/glade/template-designer.glade.h:7 +msgid "1. Radius:" +msgstr "1. 半径:" + +#: data/glade/template-designer.glade.h:8 +msgid "1. Width:" +msgstr "1. 幅:" + +#: data/glade/template-designer.glade.h:9 +msgid "2. Height:" +msgstr "2. 高さ:" + +#: data/glade/template-designer.glade.h:10 +msgid "2. Inner radius:" +msgstr "2. インナーの半径:" + +#: data/glade/template-designer.glade.h:11 +msgid "2. Waste (overprint allowed):" +msgstr "2. 余分な部分 (重ね刷り可):" + +#: data/glade/template-designer.glade.h:12 +msgid "3. Clipping width:" +msgstr "3. クリッピングの幅:" + +#: data/glade/template-designer.glade.h:13 +msgid "3. Margin" +msgstr "3. 余白" + +#: data/glade/template-designer.glade.h:14 +msgid "3. Round (radius of corner):" +msgstr "3. コーナー (角度):" + +#: data/glade/template-designer.glade.h:15 +msgid "4. Clipping height:" +msgstr "4. クリッピングの高さ:" + +#: data/glade/template-designer.glade.h:16 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "4. 水平方向の余分な部分 (重ね刷り可):" + +#: data/glade/template-designer.glade.h:17 +msgid "5. Vert. waste (overprint allowed):" +msgstr "5. 垂直方向の余分な部分 (重ね刷り可):" + +#: data/glade/template-designer.glade.h:18 +msgid "5. Waste (overprint allowed):" +msgstr "5. 余分な部分 (重ね刷り可):" + +#: data/glade/template-designer.glade.h:19 +msgid "6. Margin" +msgstr "6. 余白" + +#: data/glade/template-designer.glade.h:20 +msgid "Brand/Manufacturer:" +msgstr "ブランド/製造元:" + +#: data/glade/template-designer.glade.h:21 +msgid "CD/DVD (including credit card CDs)" +msgstr "CD/DVD の形 (含むクレジット・カード CD)" + +#: data/glade/template-designer.glade.h:22 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "" +"おめでとうございます!\n" +"\n" +"gLabels テンプレートの生成が完了しました。\n" +"このデザインを採用し保存する場合は、[適用] をクリックして下さい。\n" +"\n" +"[キャンセル] をクリックするとデザインを破棄することができます。\n" +"または [戻る] をクリックするとやり直すことが可能です。" + +#: data/glade/template-designer.glade.h:30 +msgid "Design Completed" +msgstr "デザインが完了しました" + +#: data/glade/template-designer.glade.h:31 +msgid "Distance from left edge (x0):" +msgstr "左上隅からの距離 (x0):" + +#: data/glade/template-designer.glade.h:32 +msgid "Distance from top edge (y0):" +msgstr "左上隅からの距離 (y0):" + +#: data/glade/template-designer.glade.h:34 +msgid "Horizontal pitch (dx):" +msgstr "水平方向のピッチ (dx):" + +#: data/glade/template-designer.glade.h:35 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" +"何個のラベルをテンプレートの中に作成しますか?\n" +"\n" +"レイアウトはラベルまたはカードの集まりで、それらを格子状に配置することができ" +"ます。\n" +"最初のサンプルのように、ほとんどのテンプレートではレイアウトは一つで十分で" +"す。\n" +"二番目のサンプルでは、二つのレイアウトが必要な場合を図にしたものです。" + +#: data/glade/template-designer.glade.h:40 +msgid "Label Size (CD/DVD)" +msgstr "ラベルのサイズ (CD/DVD)" + +#: data/glade/template-designer.glade.h:41 +msgid "Label Size (Round)" +msgstr "ラベルのサイズ (円)" + +#: data/glade/template-designer.glade.h:42 +msgid "Label or Card Shape" +msgstr "ラベルまたはカードの形状" + +#: data/glade/template-designer.glade.h:43 +msgid "Label or Card Size (Rectangular)" +msgstr "ラベルまたはカードのサイズ (長方形)" + +#: data/glade/template-designer.glade.h:44 +msgid "Layout #1" +msgstr "レイアウト #1:" + +#: data/glade/template-designer.glade.h:45 +msgid "Layout #2" +msgstr "レイアウト #2:" + +#: data/glade/template-designer.glade.h:46 +msgid "Layout(s)" +msgstr "レイアウト" + +#: data/glade/template-designer.glade.h:47 +msgid "Name and Description" +msgstr "名前と説明" + +#: data/glade/template-designer.glade.h:48 +msgid "Number across (nx):" +msgstr "横方向の数 (nx):" + +#: data/glade/template-designer.glade.h:49 +msgid "Number down (ny):" +msgstr "縦方向の数 (ny):" + +#: data/glade/template-designer.glade.h:50 +msgid "Number of Layouts" +msgstr "レイアウトの数" + +#: data/glade/template-designer.glade.h:51 +msgid "Number of layouts:" +msgstr "レイアウトの数:" + +#: data/glade/template-designer.glade.h:52 +msgid "Page Size" +msgstr "用紙のサイズ" + +#: data/glade/template-designer.glade.h:54 +msgid "Part #:" +msgstr "パート番号" + +#: data/glade/template-designer.glade.h:55 +msgid "" +"Please enter the following identifying information about the template " +"stationery." +msgstr "テンプレートの識別情報を入力して下さい。" + +#: data/glade/template-designer.glade.h:56 +msgid "Please enter the following layout information." +msgstr "レイアウト情報を入力して下さい。" + +#: data/glade/template-designer.glade.h:57 +msgid "" +"Please enter the following size parameters of a single label in your " +"template." +msgstr "テンプレートのラベル単体のサイズをそれぞれ入力して下さい。" + +#: data/glade/template-designer.glade.h:58 +msgid "" +"Please enter the following size parameters of a single label or card in your " +"template." +msgstr "テンプレートのラベルまたはカード単体のサイズをそれぞれ入力して下さい。" + +#: data/glade/template-designer.glade.h:59 +msgid "Please select the basic shape of the labels or cards." +msgstr "ラベルまたはカードの基本的な形状を選択して下さい。" + +#: data/glade/template-designer.glade.h:60 +msgid "Please select the page size of the template stationery." +msgstr "テンプレート用紙のサイズを選択して下さい。" + +#: data/glade/template-designer.glade.h:61 +msgid "Print test sheet" +msgstr "用紙のテスト印刷" + +#: data/glade/template-designer.glade.h:62 +msgid "Rectangular or square (can have rounded corners)" +msgstr "長方形または正方形 (コーナーを丸くすることも可)" + +#: data/glade/template-designer.glade.h:63 +msgid "Round" +msgstr "円" + +#: data/glade/template-designer.glade.h:64 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" +"レイアウトが二つ必要な\n" +"テンプレート" + +#: data/glade/template-designer.glade.h:66 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" +"レイアウトが一つだけで\n" +"十分なレイアウト" + +#: data/glade/template-designer.glade.h:68 +msgid "Vertical pitch (dy):" +msgstr "垂直方向のピッチ (dy):" + +#: data/glade/template-designer.glade.h:69 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" +"gLabels のテンプレート・デザイナへようこそ。\n" +"\n" +"このデザイナでは gLabels のカスタム・テンプレートの作成をお手伝いします。" + +#: data/templates/paper-sizes.xml.h:1 +msgid "A0" +msgstr "A0版" + +#: data/templates/paper-sizes.xml.h:2 +msgid "A1" +msgstr "A1版" + +#: data/templates/paper-sizes.xml.h:3 +msgid "A10" +msgstr "A10版" + +#: data/templates/paper-sizes.xml.h:4 +msgid "A2" +msgstr "A2版" + +#: data/templates/paper-sizes.xml.h:5 +msgid "A3" +msgstr "A3版" + +#: data/templates/paper-sizes.xml.h:6 +msgid "A4" +msgstr "A4版" + +#: data/templates/paper-sizes.xml.h:7 +msgid "A5" +msgstr "A5版" + +#: data/templates/paper-sizes.xml.h:8 +msgid "A6" +msgstr "A6版" + +#: data/templates/paper-sizes.xml.h:9 +msgid "A7" +msgstr "A7版" + +#: data/templates/paper-sizes.xml.h:10 +msgid "A8" +msgstr "A8版" + +#: data/templates/paper-sizes.xml.h:11 +msgid "A9" +msgstr "A9版" + +#: data/templates/paper-sizes.xml.h:12 +msgid "B0" +msgstr "B0版" + +#: data/templates/paper-sizes.xml.h:13 +msgid "B1" +msgstr "B1版" + +#: data/templates/paper-sizes.xml.h:14 +msgid "B10" +msgstr "B10版" + +#: data/templates/paper-sizes.xml.h:15 +msgid "B2" +msgstr "B2版" + +#: data/templates/paper-sizes.xml.h:16 +msgid "B3" +msgstr "B3版" + +#: data/templates/paper-sizes.xml.h:17 +msgid "B4" +msgstr "B4版" + +#: data/templates/paper-sizes.xml.h:18 +msgid "B5" +msgstr "B5版" + +#: data/templates/paper-sizes.xml.h:19 +msgid "B6" +msgstr "B6版" + +#: data/templates/paper-sizes.xml.h:20 +msgid "B7" +msgstr "B7版" + +#: data/templates/paper-sizes.xml.h:21 +msgid "B8" +msgstr "B8版" + +#: data/templates/paper-sizes.xml.h:22 +msgid "B9" +msgstr "B9版" + +#: data/templates/paper-sizes.xml.h:23 +msgid "US Executive" +msgstr "US エグゼクティブ" + +#: data/templates/paper-sizes.xml.h:24 +msgid "US Legal" +msgstr "US リーガル" + +#: data/templates/avery-us-templates.xml.h:1 +#: data/templates/zweckform-iso-templates.xml.h:1 +msgid "Address Labels" +msgstr "宛名のラベル" + +#: data/templates/avery-us-templates.xml.h:2 +#: data/templates/avery-iso-templates.xml.h:2 +#: data/templates/zweckform-iso-templates.xml.h:3 +#: data/templates/misc-us-templates.xml.h:2 +#: data/templates/misc-iso-templates.xml.h:9 +msgid "Business Cards" +msgstr "名刺" + +#: data/templates/avery-us-templates.xml.h:3 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "CD/DVD のラベル (Disc ラベル)" + +#: data/templates/avery-us-templates.xml.h:4 +msgid "Diskette Labels" +msgstr "フロッピーのラベル" + +#: data/templates/avery-us-templates.xml.h:5 +msgid "Filing Labels" +msgstr "ファイル・バインダーのラベル" + +#: data/templates/avery-us-templates.xml.h:6 +msgid "Full Sheet Labels" +msgstr "全用紙のラベル" + +#: data/templates/avery-us-templates.xml.h:7 +msgid "Large Round Labels" +msgstr "大きな矩形のラベル" + +#: data/templates/avery-us-templates.xml.h:8 +msgid "Name Badge Labels" +msgstr "名前つきバッジのラベル" + +#: data/templates/avery-us-templates.xml.h:9 +msgid "Return Address Labels" +msgstr "返信用宛名のラベル" + +#: data/templates/avery-us-templates.xml.h:10 +msgid "Shipping Labels" +msgstr "出荷ラベル" + +#: data/templates/avery-us-templates.xml.h:11 +msgid "Small Round Labels" +msgstr "小さな矩形のラベル" + +#: data/templates/avery-us-templates.xml.h:12 +msgid "Square Labels" +msgstr "矩形のラベル" + +#: data/templates/avery-us-templates.xml.h:13 +msgid "Video Tape Face Labels" +msgstr "ビデオ・テープの表面ラベル" + +#: data/templates/avery-us-templates.xml.h:14 +msgid "Video Tape Spine Labels" +msgstr "ビデオ・テープの背面ラベル" + +#: data/templates/avery-iso-templates.xml.h:1 +msgid "Address labels" +msgstr "宛名のラベル" + +#: data/templates/avery-iso-templates.xml.h:3 +msgid "CD Booklet" +msgstr "CD の小冊子" + +#: data/templates/avery-iso-templates.xml.h:4 +msgid "CD Inlet" +msgstr "CD のインレット" + +#: data/templates/avery-iso-templates.xml.h:5 +#: data/templates/zweckform-iso-templates.xml.h:4 +#: data/templates/misc-us-templates.xml.h:4 +#: data/templates/misc-iso-templates.xml.h:10 +msgid "CD/DVD Labels" +msgstr "CD/DVD のラベル" + +#: data/templates/avery-iso-templates.xml.h:6 +msgid "Diskette labels" +msgstr "フロッピーのラベル" + +#: data/templates/avery-iso-templates.xml.h:7 +#: data/templates/zweckform-iso-templates.xml.h:7 +#: data/templates/misc-iso-templates.xml.h:17 +msgid "Mailing Labels" +msgstr "封筒のラベル" + +#: data/templates/avery-iso-templates.xml.h:8 +msgid "Mailing labels" +msgstr "封筒のラベル" + +#: data/templates/avery-iso-templates.xml.h:9 +msgid "Mini Address Labels" +msgstr "小さな宛名のラベル" + +#: data/templates/avery-iso-templates.xml.h:10 +msgid "Shipping labels" +msgstr "出荷ラベル" + +#: data/templates/zweckform-iso-templates.xml.h:2 +msgid "Allround Labels" +msgstr "汎用的なラベル" + +#: data/templates/zweckform-iso-templates.xml.h:5 +msgid "Correction and Cover-up Labels" +msgstr "コレクションとカバーのラベル" + +#: data/templates/zweckform-iso-templates.xml.h:6 +msgid "Lever Arch File Labels" +msgstr "レバー・アーチ・ファイルのラベル" + +#: data/templates/zweckform-iso-templates.xml.h:8 +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "QSL-Karten Etiketten (70mm x 50.8mm)" + +#: data/templates/zweckform-iso-templates.xml.h:9 +msgid "Rectangular Copier Labels" +msgstr "長方形のコピー機のラベル" + +#: data/templates/zweckform-iso-templates.xml.h:10 +#: data/templates/misc-iso-templates.xml.h:22 +msgid "Rectangular Labels" +msgstr "長方形のラベル" + +#: data/templates/zweckform-iso-templates.xml.h:11 +msgid "Video Labels (back)" +msgstr "ビデオのラベル (裏側)" + +#: data/templates/misc-us-templates.xml.h:1 +msgid "Business Card CD" +msgstr "名刺 CD" + +#: data/templates/misc-us-templates.xml.h:3 +msgid "CD Template Rectangles" +msgstr "CD テンプレート (長方形)" + +#: data/templates/misc-us-templates.xml.h:5 +msgid "CD/DVD Labels (Face Only)" +msgstr "CD/DVD のラベル (外側のみ)" + +#: data/templates/misc-us-templates.xml.h:6 +#: data/templates/misc-iso-templates.xml.h:11 +msgid "CD/DVD Labels (face only)" +msgstr "CD/DVD のラベル (外側のみ)" + +#: data/templates/misc-us-templates.xml.h:7 +msgid "DLT Labels" +msgstr "DLT のラベル" + +#: data/templates/misc-us-templates.xml.h:8 +msgid "Microtube labels" +msgstr "マイクロチューブのラベル" + +#: data/templates/misc-us-templates.xml.h:9 +msgid "Mini-CD Labels" +msgstr "ミニ CD のラベル" + +#: data/templates/misc-us-templates.xml.h:10 +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "PRO CD のラベル二枚 (CD 格納ケースのみ)" + +#: data/templates/misc-us-templates.xml.h:11 +msgid "PRO CD Labels 2-up (Face only)" +msgstr "PRO CD ラベル二枚 (外側のみ)" + +#: data/templates/misc-us-templates.xml.h:12 +#: data/templates/misc-iso-templates.xml.h:21 +msgid "PRO CD Labels 2-up (face only)" +msgstr "PRO CD ラベル二枚 (外側のみ)" + +#: data/templates/misc-us-templates.xml.h:13 +msgid "Slimline CD Case (rightside up)" +msgstr "薄い CD フォルダ (右側)" + +#: data/templates/misc-us-templates.xml.h:14 +msgid "Slimline CD Case (upside down)" +msgstr "薄い CD フォルダ (上側)" + +#: data/templates/misc-iso-templates.xml.h:1 +msgid "Agipa 119488: Business Cards" +msgstr "Agipa 119488: 名刺" + +#: data/templates/misc-iso-templates.xml.h:2 +msgid "Allround Labels --24" +msgstr "汎用的なラベル --24" + +#: data/templates/misc-iso-templates.xml.h:3 +msgid "Allround Labels --44" +msgstr "汎用的なラベル --44" + +#: data/templates/misc-iso-templates.xml.h:4 +msgid "Allround Labels --64" +msgstr "汎用的なラベル --64" + +#: data/templates/misc-iso-templates.xml.h:5 +msgid "Allround Labels --65" +msgstr "汎用的なラベル --65" + +#: data/templates/misc-iso-templates.xml.h:6 +msgid "Arch File Labels" +msgstr "アーチ・ファイルのラベル" + +#: data/templates/misc-iso-templates.xml.h:7 +msgid "Arch File Labels (large)" +msgstr "アーチ・ファイルのラベル (大)" + +#: data/templates/misc-iso-templates.xml.h:8 +msgid "Arch File Labels (small)" +msgstr "アーチ・ファイルのラベル (小)" + +#: data/templates/misc-iso-templates.xml.h:12 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "CD/DVD のラベル標準書式 (外側のみ)" + +#: data/templates/misc-iso-templates.xml.h:13 +msgid "Diskette Labels (face only)" +msgstr "フロッピーのラベル (外側のみ)" + +#: data/templates/misc-iso-templates.xml.h:14 +msgid "EPSON Photo Stickers 16" +msgstr "EPSON フォト・ステッカー 16" + +#: data/templates/misc-iso-templates.xml.h:15 +msgid "Etiketten" +msgstr "Etiketten" + +#: data/templates/misc-iso-templates.xml.h:16 +msgid "Fridge Magnet Stickers" +msgstr "冷蔵庫に貼る磁気ステッカ" + +#: data/templates/misc-iso-templates.xml.h:18 +msgid "Mailing Labels --14" +msgstr "封筒のラベル --14" + +#: data/templates/misc-iso-templates.xml.h:19 +msgid "Mailing Labels-2 columns" +msgstr "封筒のラベル (二列)" + +#: data/templates/misc-iso-templates.xml.h:20 +msgid "Mailing Labels-3 columns" +msgstr "封筒のラベル (三列)" + +#: data/templates/misc-iso-templates.xml.h:23 +msgid "Video Labels (face only)" +msgstr "ビデオのラベル (外側のみ)" + +#: data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers" +msgstr "ラベルや名刺、メディアのカバーを生成します" + +#: data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "gLabels ラベル・デザイナ" + +#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 +msgid "gLabels Project File" +msgstr "gLabels のプロジェクト・ファイル" diff --git a/po/ko.po b/po/ko.po new file mode 100644 index 00000000..f908f70a --- /dev/null +++ b/po/ko.po @@ -0,0 +1,2543 @@ +# gLabels 한국어 번역 파일입니다. +# +# +msgid "" +msgstr "" +"Project-Id-Version: glabels 2.3. pre0svn\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-08-15 18:13-0400\n" +"PO-Revision-Date: 2008-02-26 10:59+0900\n" +"Last-Translator: YunSeok Choi \n" +"Language-Team: none\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/glabels.c:55 +msgid "Show view debugging messages." +msgstr "보기의 디버깅 메시지를 보이기" + +#: src/glabels.c:58 +msgid "Show item debugging messages." +msgstr "아이템 디버깅 메시지를 보이기" + +#: src/glabels.c:61 +msgid "Show printing debugging messages." +msgstr "인쇄 디버깅 메시지를 보이기" + +#: src/glabels.c:64 +msgid "Show prefs debugging messages." +msgstr "Prefs 디버깅 메시지를 보이기" + +#: src/glabels.c:67 +msgid "Show file debugging messages." +msgstr "파일 디버깅 메시지를 보이기" + +#: src/glabels.c:70 +msgid "Show document debugging messages." +msgstr "문서 디버깅 메시지를 보이기" + +#: src/glabels.c:73 +msgid "Show template debugging messages." +msgstr "Template 디버깅 메시지를 보이기" + +#: src/glabels.c:76 +msgid "Show paper debugging messages." +msgstr "Paper 디버깅 메시지를 보이기" + +#: src/glabels.c:79 +msgid "Show xml debugging messages." +msgstr "XML 디버깅 메시지를 보이기" + +#: src/glabels.c:82 +msgid "Show document merge debugging messages." +msgstr "Document 여백 디버깅 메시지를 보이기" + +#: src/glabels.c:85 +msgid "Show commands debugging messages." +msgstr "Command 디버깅 메시지를 보이기" + +#: src/glabels.c:88 +msgid "Show undo debugging messages." +msgstr "Undo 디버깅 메시지를 보이기" + +#: src/glabels.c:91 +msgid "Show recent debugging messages." +msgstr "최근의 디버깅 메시지를 보이기" + +#: src/glabels.c:94 +msgid "Show window debugging messages." +msgstr "윈도우 디버깅 메시지를 보이기" + +#: src/glabels.c:97 +msgid "Show ui debugging messages." +msgstr "GUI 디버깅 메시지를 보이기" + +#: src/glabels.c:100 +msgid "Show property_bar debugging messages." +msgstr "속성도구 디버깅 메시지를 보이기" + +#: src/glabels.c:103 +msgid "Show media select widget debugging messages." +msgstr "선택 제품 미디어 디버깅 메시지를 보이기" + +#: src/glabels.c:106 +msgid "Show mini preview widget debugging messages." +msgstr "제품 작게 미리보기 디버깅 메시지를 보이기" + +#: src/glabels.c:109 +msgid "Show pixbuf cache debugging messages." +msgstr "pixbuf cache 디버깅 메시지를 보이기" + +#: src/glabels.c:112 +msgid "Show widget debugging messages." +msgstr "제품 디버깅 메시지를 보이기" + +#: src/glabels.c:115 +msgid "Show object editor debugging messages." +msgstr "개채 편집기 디버깅 메시지를 보이기" + +#: src/glabels.c:118 +msgid "Turn on all debugging messages." +msgstr "모든 디버깅 메시지 켜기" + +#: src/glabels.c:187 +msgid "Could not initialize Bonobo!\n" +msgstr "Bonobo 초기화 할 수 없음!\n" + +#: src/glabels-batch.c:48 +msgid "print this message" +msgstr "이 메시지를 인쇄" + +#: src/glabels-batch.c:50 +msgid "print the version of glabels-batch being used" +msgstr "gLabel-batch 버전 인쇄" + +#: src/glabels-batch.c:52 +msgid "set output filename (default=\"output.ps\")" +msgstr "출력 파일이름 지정 (기본 = \"output.ps\")" + +#: src/glabels-batch.c:52 +msgid "filename" +msgstr "파일이름" + +#: src/glabels-batch.c:54 +msgid "number of sheets (default=1)" +msgstr "용지 수(기본= 1)" + +#: src/glabels-batch.c:54 +msgid "sheets" +msgstr "용지" + +#: src/glabels-batch.c:56 +msgid "number of copies (default=1)" +msgstr "복사 수(기본= 1)" + +#: src/glabels-batch.c:56 +msgid "copies" +msgstr "복사" + +#: src/glabels-batch.c:58 +#: src/print-dialog.c:336 +msgid "print outlines (to test printer alignment)" +msgstr "외곽선 인쇄 (프린터 정렬 테스트)" + +#: src/glabels-batch.c:60 +#: src/print-dialog.c:344 +msgid "print in reverse (i.e. a mirror image)" +msgstr "거꾸로 인쇄 (거울 효과)" + +#: src/glabels-batch.c:96 +msgid "[OPTION...] GLABELS_FILE..." +msgstr "[옵션...] gLabels 파일..." + +#: src/glabels-batch.c:116 +#, c-format +msgid "missing glabels file\n" +msgstr "gLabel 파일이 보이지 않음\n" + +#: src/glabels-batch.c:157 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "gLabel 파일 %s 을(를) 열 수 없습니다.\n" + +#: src/window.c:244 +msgid "(none) - gLabels" +msgstr "(없음) - gLabels" + +#: src/window.c:414 +msgid "(modified)" +msgstr "(수정됨)" + +#: src/stock.c:65 +#: data/ui/glabels-ui.xml.h:165 +msgid "_Select Mode" +msgstr "모드 선택(_S)" + +#: src/stock.c:66 +#: data/ui/glabels-ui.xml.h:166 +msgid "_Text" +msgstr "글자(_T)" + +#: src/stock.c:67 +#: data/ui/glabels-ui.xml.h:151 +msgid "_Line" +msgstr "선(_L)" + +#: src/stock.c:68 +#: data/ui/glabels-ui.xml.h:133 +msgid "_Box" +msgstr "사각형(_B)" + +#: src/stock.c:69 +#: data/ui/glabels-ui.xml.h:144 +msgid "_Ellipse" +msgstr "타원(_E)" + +#: src/stock.c:70 +#: data/ui/glabels-ui.xml.h:149 +msgid "_Image" +msgstr "그림(_I)" + +#: src/stock.c:71 +#: data/ui/glabels-ui.xml.h:11 +msgid "Bar_code" +msgstr "바코드(_C)" + +#: src/stock.c:72 +msgid "_Merge Properties" +msgstr "여백 속성(_M)" + +#: src/stock.c:73 +msgid "Object _Properties" +msgstr "항목 속성(_P)" + +#: src/stock.c:74 +#: data/ui/glabels-ui.xml.h:13 +msgid "Bring to _Front" +msgstr "앞으로 내기(_F)" + +#: src/stock.c:75 +#: data/ui/glabels-ui.xml.h:110 +msgid "Send to _Back" +msgstr "뒤로 보내기(_B)" + +#: src/stock.c:76 +#: data/ui/glabels-ui.xml.h:97 +msgid "Rotate _Left" +msgstr "왼쪽으로 회전(_L)" + +#: src/stock.c:77 +#: data/ui/glabels-ui.xml.h:98 +msgid "Rotate _Right" +msgstr "오른쪽으로 회전(_R)" + +#: src/stock.c:78 +#: data/ui/glabels-ui.xml.h:52 +msgid "Flip _Horizontally" +msgstr "수직 뒤집기(_H)" + +#: src/stock.c:79 +#: data/ui/glabels-ui.xml.h:53 +msgid "Flip _Vertically" +msgstr "수평 뒤집기(_V)" + +#: src/stock.c:80 +#: data/ui/glabels-ui.xml.h:150 +msgid "_Lefts" +msgstr "좌측(_L)" + +#: src/stock.c:81 +#: data/ui/glabels-ui.xml.h:162 +msgid "_Rights" +msgstr "우측(_R)" + +#: src/stock.c:82 +#: data/ui/glabels-ui.xml.h:134 +msgid "_Centers" +msgstr "중앙(_C)" + +#: src/stock.c:83 +#: data/ui/glabels-ui.xml.h:167 +msgid "_Tops" +msgstr "상위(_T)" + +#: src/stock.c:84 +msgid "Bottoms" +msgstr "하위" + +#: src/stock.c:85 +msgid "Centers" +msgstr "중앙" + +#: src/stock.c:86 +#: src/stock.c:87 +#: data/ui/glabels-ui.xml.h:62 +msgid "Label Ce_nter" +msgstr "라벨 중앙(_N)" + +#: src/stock.c:88 +#: data/ui/glabels-ui.xml.h:51 +msgid "Fill color" +msgstr "색 채우기" + +#: src/stock.c:89 +#: data/ui/glabels-ui.xml.h:64 +msgid "Line color" +msgstr "선 색상" + +#: src/stock.c:90 +#: src/stock.c:92 +msgid "Linked" +msgstr "연결" + +#: src/stock.c:91 +#: src/stock.c:93 +msgid "Not Linked" +msgstr "연결되지 않음" + +#: src/ui-property-bar.c:345 +#: src/object-editor.c:499 +msgid "Default" +msgstr "기본" + +#: src/ui-property-bar.c:360 +#: src/object-editor.c:512 +msgid "No fill" +msgstr "채우기 없음" + +#: src/ui-property-bar.c:375 +#: src/object-editor.c:505 +msgid "No line" +msgstr "선 없음" + +#: src/ui-sidebar.c:180 +msgid "Object properties" +msgstr "항목 속성" + +#: src/commands.c:385 +msgid "" +"A label and business card creation program for GNOME.\n" +" \n" +"Glabels is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n" +" \n" +"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.\n" +msgstr "" +"GNOME 에서 Labelê³¼ 명함을 제작하는 프로그램입니다.\n" +"\n" +"Glabels는 자유소프트웨어 입니다; 여러분은 이 프로그램을 GNU(General Public License)에 따라 자유롭게 수정 배포 할 수 있습니다. 이 프로그램은 GNU의 Ver.2 를 따르고 있습니다. \n" +"\n" +"이 프로그램은 어떠한 저작권료 없이 사용되어 질 수 있습니다.(번역주 : 번역자는 GNU를 깊이 알지 못합니다. 이 부분의 번역에 지적하고픈 부분이 있다면 번역 자료와 함께 연락주십시오. xein@naver.com)\n" + +#: src/commands.c:399 +msgid "See the file AUTHORS for additional credits," +msgstr "참여 제작자 AUTHORS 파일을 보세요." + +#: src/commands.c:400 +msgid "or visit http://glabels.sourceforge.net/" +msgstr "또는 이곳을 방문 하세요. http://glabels.sourceforge.net/" + +#: src/commands.c:409 +msgid " " +msgstr " " + +#: src/commands.c:424 +msgid "glabels" +msgstr "gLabels" + +#: src/file.c:100 +msgid "New Label or Card" +msgstr "새 라벨 또는 카드" + +#: src/file.c:132 +#: src/file.c:304 +msgid "Media Type" +msgstr "매체 형식" + +#: src/file.c:138 +#: src/file.c:310 +msgid "Label orientation" +msgstr "라벨의 방향" + +#: src/file.c:269 +msgid "Label properties" +msgstr "라벨 속성" + +#: src/file.c:452 +#: src/file.c:870 +msgid "All files" +msgstr "모든 파일" + +#: src/file.c:457 +#: src/file.c:875 +msgid "gLabels documents" +msgstr "gLabels 문서" + +#: src/file.c:505 +#: src/file.c:617 +#: src/file.c:934 +#: src/file.c:1130 +msgid "Empty file name selection" +msgstr "비어있는 파일 이름" + +#: src/file.c:506 +#: src/file.c:520 +#: src/file.c:618 +#: src/file.c:632 +msgid "Please select a file or supply a valid file name" +msgstr "지원하는 파일을 선택하세요." + +#: src/file.c:519 +#: src/file.c:631 +msgid "File does not exist" +msgstr "파일이 없습니다." + +#: src/file.c:563 +#: data/ui/glabels-ui.xml.h:75 +msgid "Open" +msgstr "열기" + +#: src/file.c:565 +msgid "Open label" +msgstr "라벨 열기" + +#: src/file.c:707 +#, c-format +msgid "Could not open file \"%s\"" +msgstr "\"%s\" 파일을 열 수 없습니다." + +#: src/file.c:715 +msgid "Not a supported file format" +msgstr "지원되지 않는 파일 형식" + +#: src/file.c:797 +#: src/file.c:979 +#: src/file.c:1174 +#, c-format +msgid "Could not save file \"%s\"" +msgstr "\"%s\" 파일을 저장할 수 없습니다." + +#: src/file.c:805 +#: src/file.c:987 +#: src/file.c:1182 +msgid "Error encountered during save. The file is still not saved." +msgstr "저장하는데 오류가 발생했습니다. 파일을 저장하지 못했습니다." + +#: src/file.c:848 +#: src/file.c:1048 +#, c-format +msgid "Save \"%s\" as" +msgstr "\"%s\" 이름으로 저장" + +#: src/file.c:935 +#: src/file.c:1131 +msgid "Please supply a valid file name" +msgstr "유효한 파일이름이 필요합니다." + +#: src/file.c:952 +#: src/file.c:1147 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "\"%s\"파일이름으로 덮어쓰시겠습니까?" + +#: src/file.c:960 +#: src/file.c:1155 +msgid "File already exists." +msgstr "파일이름이 존재합니다." + +#: src/file.c:1271 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "닫기전에 바뀐부분을 \"%s\"이름으로 저장하시겠습니까?" + +#: src/file.c:1279 +msgid "Your changes will be lost if you don't save them." +msgstr "저장하지 않으면, 바뀐부분을 잃어버리게 됩니다." + +#: src/file.c:1282 +msgid "Close without saving" +msgstr "저장없이 닫기" + +#. Should not happen +#: src/prefs.c:156 +#: src/prefs.c:163 +#: data/glade/prefs-dialog.glade.h:23 +#: data/glade/object-editor.glade.h:37 +msgid "points" +msgstr "포인트" + +#: src/prefs.c:158 +#: data/glade/object-editor.glade.h:36 +#: data/glade/template-designer.glade.h:74 +msgid "inches" +msgstr "[인치]" + +#: src/prefs.c:160 +msgid "mm" +msgstr "[밀리미터]" + +#: src/prefs-dialog.c:248 +#: data/glade/prefs-dialog.glade.h:22 +msgid "gLabels Preferences" +msgstr "gLabels 환경설정" + +#. +#. * Submenu: Order +#. +#: src/view.c:3570 +#: data/ui/glabels-ui.xml.h:157 +msgid "_Order" +msgstr "순서(_O)" + +#. +#. * Submenu: Rotate/Flip +#. +#: src/view.c:3591 +#: data/ui/glabels-ui.xml.h:163 +msgid "_Rotate/Flip" +msgstr "회전/뒤집기(_R)" + +#. +#. * Submenu: Align Horizontally +#. +#: src/view.c:3624 +msgid "Align _Horizontally" +msgstr "가로로 정렬(_H)" + +#. +#. * Submenu: Align Vertically +#. +#: src/view.c:3663 +msgid "Align _Vertically" +msgstr "세로로 정렬(_V)" + +#: src/view.c:3724 +#: data/ui/glabels-ui.xml.h:140 +msgid "_Delete" +msgstr "삭제(_D)" + +#. Build editor. +#: src/view-box.c:223 +msgid "Box object properties" +msgstr "사각형 개체 속성" + +#. Build editor. +#: src/view-ellipse.c:223 +msgid "Ellipse object properties" +msgstr "타원 개체 속성" + +#. Build editor. +#: src/view-line.c:223 +msgid "Line object properties" +msgstr "선 개체 속성" + +#. Build editor. +#: src/view-image.c:222 +msgid "Image object properties" +msgstr "그림 개체 속성" + +#. Build editor. +#: src/view-text.c:250 +msgid "Text object properties" +msgstr "글자 개체 속성" + +#: src/view-text.c:562 +#: data/glade/object-editor.glade.h:28 +msgid "Text" +msgstr "글자" + +#. Build editor. +#: src/view-barcode.c:209 +msgid "Barcode object properties" +msgstr "바코드 개체 속성" + +#: src/view-barcode.c:579 +#: src/print.c:1088 +msgid "Invalid barcode data" +msgstr "잘못된 바코드 데이터" + +#: src/merge-properties-dialog.c:231 +msgid "Merge Properties" +msgstr "여백 속성" + +#. ---- Source section ---- +#: src/merge-properties-dialog.c:237 +msgid "Source" +msgstr "소스" + +#: src/merge-properties-dialog.c:245 +msgid "Format:" +msgstr "서식:" + +#. Location line +#: src/merge-properties-dialog.c:273 +msgid "Location:" +msgstr "장소:" + +#: src/merge-properties-dialog.c:282 +#: src/merge-properties-dialog.c:393 +msgid "Select merge-database source" +msgstr "병합 데이터베이스 소스 선택" + +#: src/merge-properties-dialog.c:289 +#: src/merge-properties-dialog.c:404 +msgid "N/A" +msgstr "N/A" + +#. ---- Sample Fields section ---- +#: src/merge-properties-dialog.c:300 +msgid "Record selection/preview:" +msgstr "선택 기록/미리보기:" + +#: src/merge-properties-dialog.c:326 +msgid "Select" +msgstr "선택" + +#: src/merge-properties-dialog.c:334 +msgid "Record/Field" +msgstr "기록/범위" + +#: src/merge-properties-dialog.c:342 +#: data/glade/object-editor.glade.h:9 +msgid "Data" +msgstr "데이터" + +#: src/print-dialog.c:266 +#: data/ui/glabels-ui.xml.h:82 +msgid "Print" +msgstr "인쇄" + +#: src/print-dialog.c:281 +msgid "_Job" +msgstr "작업(_J)" + +#: src/print-dialog.c:286 +msgid "P_rinter" +msgstr "프린터(_R)" + +#. ----------- Add simple-copies widget ------------ +#: src/print-dialog.c:314 +msgid "Copies" +msgstr "매수" + +#. ------- Add merge control widget ------------ +#: src/print-dialog.c:322 +msgid "Document merge control" +msgstr "문서 여백 제어" + +#. ----------- Add custom print options area ------------ +#: src/print-dialog.c:330 +msgid "Options" +msgstr "옵션" + +#: src/print-dialog.c:351 +msgid "print crop marks" +msgstr "자르기 표시 인쇄" + +#: src/print-dialog.c:553 +#: src/print-dialog.c:592 +msgid "Print preview" +msgstr "인쇄 미리보기" + +#: src/template-designer.c:409 +#: data/glade/template-designer.glade.h:73 +msgid "gLabels Template Designer" +msgstr "gLabels 서식 디자이너" + +#: src/bc.c:60 +msgid "POSTNET (any)" +msgstr "POSTNET (임의)" + +#: src/bc.c:63 +msgid "POSTNET-5 (ZIP only)" +msgstr "POSTNET-5 (ZIP만)" + +#: src/bc.c:66 +msgid "POSTNET-9 (ZIP+4)" +msgstr "POSTNET-9 (ZIP+4)" + +#: src/bc.c:69 +msgid "POSTNET-11 (DPBC)" +msgstr "POSTNET-11 (DPBC)" + +#: src/bc.c:72 +msgid "EAN (any)" +msgstr "EAN (임의)" + +#: src/bc.c:75 +msgid "EAN-8" +msgstr "EAN-8" + +#: src/bc.c:78 +msgid "EAN-8 +2" +msgstr "EAN-8 +2" + +#: src/bc.c:81 +msgid "EAN-8 +5" +msgstr "EAN-8 +5" + +#: src/bc.c:84 +msgid "EAN-13" +msgstr "EAN-13" + +#: src/bc.c:87 +msgid "EAN-13 +2" +msgstr "EAN-13 +2" + +#: src/bc.c:90 +msgid "EAN-13 +5" +msgstr "EAN-13 +5" + +#: src/bc.c:93 +msgid "UPC (UPC-A or UPC-E)" +msgstr "UPC (UPC-A 또는 UPC-E)" + +#: src/bc.c:96 +msgid "UPC-A" +msgstr "UPC-A" + +#: src/bc.c:99 +msgid "UPC-A +2" +msgstr "UPC-A +2" + +#: src/bc.c:102 +msgid "UPC-A +5" +msgstr "UPC-A +5" + +#: src/bc.c:105 +msgid "UPC-E" +msgstr "UPC-E" + +#: src/bc.c:108 +msgid "UPC-E +2" +msgstr "UPC-E +2" + +#: src/bc.c:111 +msgid "UPC-E +5" +msgstr "UPC-E +5" + +#: src/bc.c:114 +msgid "ISBN" +msgstr "ISBN" + +#: src/bc.c:117 +msgid "ISBN +5" +msgstr "ISBN +5" + +#: src/bc.c:120 +msgid "Code 39" +msgstr "Code 39" + +#: src/bc.c:123 +msgid "Code 128" +msgstr "Code 128" + +#: src/bc.c:126 +msgid "Code 128C" +msgstr "Code 128C" + +#: src/bc.c:129 +msgid "Code 128B" +msgstr "Code 128B" + +#: src/bc.c:132 +msgid "Interleaved 2 of 5" +msgstr "Interleaved 2 of 5" + +#: src/bc.c:135 +msgid "Codabar" +msgstr "Codabar" + +#: src/bc.c:138 +msgid "MSI" +msgstr "MSI" + +#: src/bc.c:141 +msgid "Plessey" +msgstr "Plessey" + +#: src/label.c:569 +msgid "Untitled" +msgstr "제목없음" + +#: src/xml-label.c:176 +#: src/xml-label.c:213 +msgid "xmlParseFile error" +msgstr "xmlParse파일 오류" + +#: src/xml-label.c:250 +msgid "No document root" +msgstr "root 문서가 아님" + +#: src/xml-label.c:264 +msgid "Importing from glabels 0.1 format" +msgstr "gLabels 0.1로 부터 가져오기" + +#: src/xml-label.c:272 +msgid "Importing from glabels 0.4 format" +msgstr "gLabels 0.4로 부터 가져오기" + +#: src/xml-label.c:279 +msgid "Importing from glabels 1.91 format" +msgstr "gLabels 1.91로 부터 가져오기" + +#: src/xml-label.c:282 +msgid "bad document, unknown glabels Namespace" +msgstr "잘못된 문서, 알 수 없는 Glabels 이름공간" + +#: src/xml-label.c:311 +#: src/xml-label-04.c:75 +#: src/xml-label-191.c:131 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "잘못된 Root 노드 = \"%s\"" + +#: src/xml-label.c:348 +#: src/xml-label-191.c:165 +#, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "문서 노드 내의 잘못된 노드 = \"%s\"" + +#: src/xml-label.c:393 +#: src/xml-label-04.c:123 +#: src/xml-label-191.c:197 +#, c-format +msgid "bad node = \"%s\"" +msgstr "잘못된 노드 = \"%s\"" + +#: src/xml-label.c:796 +#: src/xml-label-191.c:605 +#, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "데이터 노드 내의 잘못된 노드 = \"%s\"" + +#: src/xml-label.c:962 +#: libglabels/xml-template.c:535 +msgid "Utf8 conversion error." +msgstr "Utf8 변환 에러" + +#: src/xml-label.c:969 +#: libglabels/xml-template.c:542 +msgid "Problem saving xml file." +msgstr "XML 파일 저장에 문제가 있습니다." + +#. This should always be an id, but just in case a name +#. slips by! +#: src/xml-label-191.c:680 +#: libglabels/xml-template.c:199 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "알 수 없는 용지 크기 ID \"%s\"。名前として扱います。" + +#: src/xml-label-191.c:690 +#: libglabels/xml-template.c:209 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "알 수 없는 용지 크기 ID 또는 이름 \"%s\"" + +#: src/merge.c:172 +#: src/merge.c:213 +#: src/merge.c:399 +#: src/merge.c:402 +msgid "None" +msgstr "없음" + +#: src/merge-init.c:53 +msgid "Text file with comma delimeters (CSV)" +msgstr "콤마로 구분된 텍스트파일(CSV)" + +#: src/merge-init.c:60 +msgid "Text file with colon delimeters" +msgstr "콜론으로 구분된 텍스트 파일" + +#: src/merge-init.c:67 +msgid "Text file with tab delimeters" +msgstr "텝으로 구분된 텍스트 파일" + +#: src/wdgt-image-select.c:201 +#: data/glade/object-editor.glade.h:11 +msgid "File:" +msgstr "파일:" + +#: src/wdgt-image-select.c:245 +#: data/glade/object-editor.glade.h:16 +msgid "Key:" +msgstr "키:" + +#: src/wdgt-print-copies.c:179 +msgid "Sheets:" +msgstr "용지:" + +#: src/wdgt-print-copies.c:197 +msgid "Labels" +msgstr "라벨" + +#: src/wdgt-print-copies.c:200 +msgid "from:" +msgstr "부터:" + +#: src/wdgt-print-copies.c:207 +msgid "to:" +msgstr "에게:" + +#: src/wdgt-print-merge.c:178 +msgid "Start on label" +msgstr "라벨의 시작" + +#: src/wdgt-print-merge.c:186 +msgid "on 1st sheet" +msgstr "첫번째 용지에서" + +#: src/wdgt-print-merge.c:195 +msgid "Copies:" +msgstr "매수:" + +#: src/wdgt-print-merge.c:201 +msgid "Collate" +msgstr "제본" + +#: src/wdgt-media-select.c:269 +#: data/glade/template-designer.glade.h:29 +msgid "Description:" +msgstr "설명:" + +#: src/wdgt-media-select.c:279 +#: data/glade/template-designer.glade.h:53 +msgid "Page size:" +msgstr "용지 크기:" + +#: src/wdgt-media-select.c:290 +msgid "Label size:" +msgstr "라벨 크기:" + +#: src/wdgt-media-select.c:301 +msgid "Layout:" +msgstr "배치:" + +#: src/wdgt-media-select.c:578 +#, c-format +msgid "%d x %d (%d per sheet)" +msgstr "%d x %d (용지의 %d)" + +#: src/wdgt-media-select.c:582 +#, c-format +msgid "%d per sheet" +msgstr "용지의 %d" + +#: src/wdgt-media-select.c:614 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +#: src/wdgt-media-select.c:619 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: src/wdgt-media-select.c:630 +#: src/wdgt-media-select.c:644 +#, c-format +msgid "%s %s diameter" +msgstr "지름 %s %s" + +#: src/wdgt-media-select.c:634 +#: src/wdgt-media-select.c:648 +#, c-format +msgid "%.5g %s diameter" +msgstr "지름 %.5g %s" + +#: src/wdgt-rotate-label.c:193 +msgid "Rotate" +msgstr "회전" + +#. This is the default custom color +#: src/mygal/color-palette.c:396 +msgid "custom" +msgstr "임의의" + +#. "Custom" color - we'll pop up a GnomeColorPicker +#: src/mygal/color-palette.c:438 +msgid "Custom Color:" +msgstr "임의의 색상:" + +#: src/mygal/color-palette.c:446 +msgid "Choose Custom Color" +msgstr "임의의 색상 선택" + +#: src/mygal/color-palette.c:579 +msgid "black" +msgstr "검은색" + +#: src/mygal/color-palette.c:580 +msgid "light brown" +msgstr "밝은 갈색" + +#: src/mygal/color-palette.c:581 +msgid "brown gold" +msgstr "고동색" + +#: src/mygal/color-palette.c:582 +msgid "dark green #2" +msgstr "어두운 녹색 #2" + +#: src/mygal/color-palette.c:583 +msgid "navy" +msgstr "남색" + +#: src/mygal/color-palette.c:584 +#: src/mygal/color-palette.c:640 +msgid "dark blue" +msgstr "어두운 파랑색" + +#: src/mygal/color-palette.c:585 +msgid "purple #2" +msgstr "자주색 #2" + +#: src/mygal/color-palette.c:586 +msgid "very dark gray" +msgstr "매우 어두운 회색" + +#: src/mygal/color-palette.c:589 +#: src/mygal/color-palette.c:645 +msgid "dark red" +msgstr "어두운 빨강색" + +#: src/mygal/color-palette.c:590 +msgid "red-orange" +msgstr "적오렌지색" + +#: src/mygal/color-palette.c:591 +msgid "gold" +msgstr "금색" + +#: src/mygal/color-palette.c:592 +msgid "dark green" +msgstr "어두운 녹색" + +#: src/mygal/color-palette.c:593 +#: src/mygal/color-palette.c:646 +msgid "dull blue" +msgstr "탁한 파랑색" + +#: src/mygal/color-palette.c:594 +#: src/mygal/color-palette.c:647 +msgid "blue" +msgstr "파랑색" + +#: src/mygal/color-palette.c:595 +msgid "dull purple" +msgstr "탁한 자주색" + +#: src/mygal/color-palette.c:596 +msgid "dark grey" +msgstr "어두운 회색" + +#: src/mygal/color-palette.c:599 +msgid "red" +msgstr "빨강색" + +#: src/mygal/color-palette.c:600 +msgid "orange" +msgstr "오렌지색" + +#: src/mygal/color-palette.c:601 +msgid "lime" +msgstr "라임색" + +#: src/mygal/color-palette.c:602 +msgid "dull green" +msgstr "탁한 녹색" + +#: src/mygal/color-palette.c:603 +msgid "dull blue #2" +msgstr "탁한 파랑색#2" + +#: src/mygal/color-palette.c:604 +msgid "sky blue #2" +msgstr "하늘색 #2" + +#: src/mygal/color-palette.c:605 +#: src/mygal/color-palette.c:644 +msgid "purple" +msgstr "자주색" + +#: src/mygal/color-palette.c:606 +msgid "gray" +msgstr "회색" + +#: src/mygal/color-palette.c:609 +#: src/mygal/color-palette.c:641 +msgid "magenta" +msgstr "마젠타색" + +#: src/mygal/color-palette.c:610 +msgid "bright orange" +msgstr "밝은 오렌지색" + +#: src/mygal/color-palette.c:611 +#: src/mygal/color-palette.c:642 +msgid "yellow" +msgstr "노랑색" + +#: src/mygal/color-palette.c:612 +msgid "green" +msgstr "녹색" + +#: src/mygal/color-palette.c:613 +#: src/mygal/color-palette.c:643 +msgid "cyan" +msgstr "청록색" + +#: src/mygal/color-palette.c:614 +msgid "bright blue" +msgstr "밝은 파랑색" + +#: src/mygal/color-palette.c:615 +#: src/mygal/color-palette.c:632 +msgid "red purple" +msgstr "빨간 자주색" + +#: src/mygal/color-palette.c:616 +msgid "light grey" +msgstr "가벼운 회색" + +#: src/mygal/color-palette.c:619 +#: src/mygal/color-palette.c:636 +msgid "pink" +msgstr "분홍색" + +#: src/mygal/color-palette.c:620 +msgid "light orange" +msgstr "가벼운 오렌지색" + +#: src/mygal/color-palette.c:621 +#: src/mygal/color-palette.c:633 +msgid "light yellow" +msgstr "가벼운 노랑색" + +#: src/mygal/color-palette.c:622 +msgid "light green" +msgstr "가벼운 녹색" + +#: src/mygal/color-palette.c:623 +msgid "light cyan" +msgstr "가벼운 청록색" + +#: src/mygal/color-palette.c:624 +#: src/mygal/color-palette.c:634 +msgid "light blue" +msgstr "가벼운 바랑색" + +#: src/mygal/color-palette.c:625 +#: src/mygal/color-palette.c:638 +msgid "light purple" +msgstr "가벼운 자주색" + +#: src/mygal/color-palette.c:626 +msgid "white" +msgstr "흰색" + +#: src/mygal/color-palette.c:631 +msgid "purplish blue" +msgstr "자주빛 파랑색" + +#: src/mygal/color-palette.c:635 +msgid "dark purple" +msgstr "어두운 자주색" + +#: src/mygal/color-palette.c:637 +msgid "sky blue" +msgstr "하늘색" + +#: libglabels/template.c:848 +#, c-format +msgid "Generic %s full page" +msgstr "Generic %s 전면에 걸친" + +#: libglabels/template.c:897 +msgid "No template files found!" +msgstr "서식파일을 찾을 수 없음!" + +#. Create and append an "Other" entry. +#: libglabels/paper.c:67 +msgid "Other" +msgstr "직접지정" + +#: libglabels/paper.c:361 +msgid "No paper files found!" +msgstr "용지 파일을 찾을 수 없음!" + +#: data/ui/glabels-ui.xml.h:1 +msgid "About glabels" +msgstr "gLabels에 대해" + +#: data/ui/glabels-ui.xml.h:2 +msgid "About..." +msgstr "정보..." + +#: data/ui/glabels-ui.xml.h:3 +msgid "Align _Horizontal" +msgstr "세로로 정렬(_H)" + +#: data/ui/glabels-ui.xml.h:4 +msgid "Align _Vertical" +msgstr "가로로 정렬(_V)" + +#: data/ui/glabels-ui.xml.h:5 +msgid "Align objects to bottoms" +msgstr "개체 아래로 정렬" + +#: data/ui/glabels-ui.xml.h:6 +msgid "Align objects to horizontal centers" +msgstr "개체 세로 중앙으로 정렬" + +#: data/ui/glabels-ui.xml.h:7 +msgid "Align objects to left edges" +msgstr "개체 좌측 가장자리로 정렬" + +#: data/ui/glabels-ui.xml.h:8 +msgid "Align objects to right edges" +msgstr "개체 우측 가장자리로 정렬" + +#: data/ui/glabels-ui.xml.h:9 +msgid "Align objects to tops" +msgstr "개체 상위로 정렬" + +#: data/ui/glabels-ui.xml.h:10 +msgid "Align objects to vertical centers" +msgstr "개체 수평 중앙으로 정렬" + +#: data/ui/glabels-ui.xml.h:12 +msgid "Bold" +msgstr "굵게" + +#: data/ui/glabels-ui.xml.h:14 +msgid "Center align" +msgstr "중앙 정렬" + +#: data/ui/glabels-ui.xml.h:15 +msgid "Center objects to horizontal label center" +msgstr "중앙 개체를 수직라벨 중앙으로" + +#: data/ui/glabels-ui.xml.h:16 +msgid "Center objects to vertical label center" +msgstr "중앙 개체를 수평라벨 중상으로" + +#: data/ui/glabels-ui.xml.h:17 +msgid "Change the visibility of markup lines in the current window" +msgstr "현재 윈도우의 보이는 마크업 선 변경" + +#: data/ui/glabels-ui.xml.h:18 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "현재 윈도우의 보이는 그리기 도구 변경" + +#: data/ui/glabels-ui.xml.h:19 +msgid "Change the visibility of the grid in the current window" +msgstr "현재 윈도우의 보이는 그리드 변경" + +#: data/ui/glabels-ui.xml.h:20 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "현재 윈도우의 보이는 주 도구 변경" + +#: data/ui/glabels-ui.xml.h:21 +msgid "Change the visibility of the property toolbar in the current window" +msgstr "현재 윈도우의 보이는 속성 도구 변경" + +#: data/ui/glabels-ui.xml.h:22 +msgid "Close" +msgstr "닫기" + +#: data/ui/glabels-ui.xml.h:23 +msgid "Close the current file" +msgstr "현재 파일을 닫기" + +#: data/ui/glabels-ui.xml.h:24 +msgid "Configure the application" +msgstr "gLabel 구성" + +#: data/ui/glabels-ui.xml.h:25 +msgid "Contents" +msgstr "목차" + +#: data/ui/glabels-ui.xml.h:26 +msgid "Copy" +msgstr "복사" + +#: data/ui/glabels-ui.xml.h:27 +msgid "Copy the selection" +msgstr "선택 복사" + +#: data/ui/glabels-ui.xml.h:28 +msgid "Create a custom template" +msgstr "임의의 서식 만들기" + +#: data/ui/glabels-ui.xml.h:29 +msgid "Create a new document" +msgstr "새로운 문서 만들기" + +#: data/ui/glabels-ui.xml.h:30 +msgid "Create barcode object" +msgstr "바코드 개체 만들기" + +#: data/ui/glabels-ui.xml.h:31 +msgid "Create box/rectangle object" +msgstr "사각형/직사각형 개체 만들기" + +#: data/ui/glabels-ui.xml.h:32 +msgid "Create ellipse/circle object" +msgstr "타원/원형 개체 만들기" + +#: data/ui/glabels-ui.xml.h:33 +msgid "Create image object" +msgstr "그림 개체 만들기" + +#: data/ui/glabels-ui.xml.h:34 +msgid "Create line object" +msgstr "선 개체 만들기" + +#: data/ui/glabels-ui.xml.h:35 +msgid "Create text object" +msgstr "글자 개체 만들기" + +#: data/ui/glabels-ui.xml.h:36 +msgid "Cu_t" +msgstr "자르기(_T)" + +#: data/ui/glabels-ui.xml.h:37 +msgid "Customize" +msgstr "커스터마이즈" + +#: data/ui/glabels-ui.xml.h:38 +msgid "Customize Drawing Toolbar" +msgstr "그리기 도구 커스터마이즈" + +#: data/ui/glabels-ui.xml.h:39 +msgid "Customize Main Toolbar" +msgstr "주 도구 커스터마이즈" + +#: data/ui/glabels-ui.xml.h:40 +msgid "Customize Property Toolbar" +msgstr "속성 도구 커스터마이즈" + +#: data/ui/glabels-ui.xml.h:41 +msgid "Customize toolbars" +msgstr "도구 커스터마이즈" + +#: data/ui/glabels-ui.xml.h:42 +msgid "Cut" +msgstr "잘라내기" + +#: data/ui/glabels-ui.xml.h:43 +msgid "Cut the selection" +msgstr "선택한것 잘라내기" + +#: data/ui/glabels-ui.xml.h:44 +msgid "Decrease magnification" +msgstr "확대 감소" + +#: data/ui/glabels-ui.xml.h:45 +msgid "Delete" +msgstr "삭제" + +#: data/ui/glabels-ui.xml.h:46 +msgid "Delete the selected objects" +msgstr "선택한 개체 삭제" + +#: data/ui/glabels-ui.xml.h:47 +msgid "Drawing toolbar" +msgstr "그리기 도구" + +#: data/ui/glabels-ui.xml.h:48 +msgid "Dump XML" +msgstr "XML 덤프" + +#: data/ui/glabels-ui.xml.h:49 +msgid "Dump the GUI Xml description" +msgstr "GUI의 XML설명 덤프" + +#: data/ui/glabels-ui.xml.h:50 +msgid "Edit merge properties" +msgstr "여백 속성 편집" + +#: data/ui/glabels-ui.xml.h:54 +msgid "Flip object horizontally" +msgstr "수직 개체 뒤집기" + +#: data/ui/glabels-ui.xml.h:55 +msgid "Flip object vertically" +msgstr "수평 개체 뒤집기" + +#: data/ui/glabels-ui.xml.h:56 +msgid "Font name" +msgstr "글꼴" + +#: data/ui/glabels-ui.xml.h:57 +msgid "Font selector" +msgstr "글꼴 선택기" + +#: data/ui/glabels-ui.xml.h:58 +msgid "Font size" +msgstr "글꼴 크기" + +#: data/ui/glabels-ui.xml.h:59 +msgid "Icon and _Text" +msgstr "아이콘과 글자(_T)" + +#: data/ui/glabels-ui.xml.h:60 +msgid "Increase magnification" +msgstr "상승 확대" + +#: data/ui/glabels-ui.xml.h:61 +msgid "Italic" +msgstr "이탤릭" + +#: data/ui/glabels-ui.xml.h:63 +msgid "Left align" +msgstr "왼쪽 정렬" + +#: data/ui/glabels-ui.xml.h:65 +msgid "Line width" +msgstr "선 넓이" + +#: data/ui/glabels-ui.xml.h:66 +msgid "Lower object to bottom" +msgstr "개체를 하단으로 내리기" + +#: data/ui/glabels-ui.xml.h:67 +msgid "M_arkup" +msgstr "마크업(_A)" + +#: data/ui/glabels-ui.xml.h:68 +msgid "Main toolbar" +msgstr "주 도구" + +#: data/ui/glabels-ui.xml.h:69 +msgid "Markup" +msgstr "마크업" + +#: data/ui/glabels-ui.xml.h:70 +msgid "Modify document properties" +msgstr "문서 속성 고치기" + +#: data/ui/glabels-ui.xml.h:71 +msgid "New" +msgstr "새로 만들기" + +#: data/ui/glabels-ui.xml.h:72 +msgid "Object property editor" +msgstr "항목 속성 편집기" + +#: data/ui/glabels-ui.xml.h:73 +msgid "Only show icons in the drawing toolbar" +msgstr "그리기 도구에서 아이콘만 보이기" + +#: data/ui/glabels-ui.xml.h:74 +msgid "Only show icons in the main toolbar" +msgstr "주 도구에서 아이콘만 보이기" + +#: data/ui/glabels-ui.xml.h:76 +msgid "Open a file" +msgstr "파일 열기" + +#: data/ui/glabels-ui.xml.h:77 +msgid "Open the glabels manual" +msgstr "gLabeles 메뉴얼 열기" + +#: data/ui/glabels-ui.xml.h:78 +msgid "Paste" +msgstr "붙이기" + +#: data/ui/glabels-ui.xml.h:79 +msgid "Paste the clipboard" +msgstr "클립보드에 붙이기" + +#: data/ui/glabels-ui.xml.h:80 +msgid "Pr_eferences..." +msgstr "속성(_E)..." + +#: data/ui/glabels-ui.xml.h:81 +msgid "Preferences" +msgstr "설정" + +#: data/ui/glabels-ui.xml.h:83 +msgid "Print the current file" +msgstr "현재 파일을 인쇄" + +#: data/ui/glabels-ui.xml.h:84 +msgid "Proper_ties..." +msgstr "속성(_T)..." + +#: data/ui/glabels-ui.xml.h:85 +msgid "Properties" +msgstr "속성" + +#: data/ui/glabels-ui.xml.h:86 +msgid "Property toolbar" +msgstr "속성 도구" + +#: data/ui/glabels-ui.xml.h:87 +msgid "Quit" +msgstr "종료" + +#: data/ui/glabels-ui.xml.h:88 +msgid "Quit the program" +msgstr "gLabels을 종료" + +#: data/ui/glabels-ui.xml.h:89 +msgid "Raise object to top" +msgstr "개체를 상위로 올리기" + +#: data/ui/glabels-ui.xml.h:90 +msgid "Recent _Files" +msgstr "최근의 파일(_F)" + +#: data/ui/glabels-ui.xml.h:91 +msgid "Redo" +msgstr "재실행" + +#: data/ui/glabels-ui.xml.h:92 +msgid "Redo the undone action" +msgstr "재실행 할것 없음" + +#: data/ui/glabels-ui.xml.h:93 +msgid "Remove all selections" +msgstr "모든 선택사항 삭제" + +#: data/ui/glabels-ui.xml.h:95 +#, no-c-format +msgid "Restore scale to 100%" +msgstr "100%크기로 복구" + +#: data/ui/glabels-ui.xml.h:96 +msgid "Right align" +msgstr "오른쪽으로 정렬" + +#: data/ui/glabels-ui.xml.h:99 +msgid "Rotate object 90 clockwise" +msgstr "90° 시계방향으로 회전" + +#: data/ui/glabels-ui.xml.h:100 +msgid "Rotate object 90 counter-clockwise" +msgstr "90° 반시계방향으로 회전" + +#: data/ui/glabels-ui.xml.h:101 +msgid "Save" +msgstr "저장" + +#: data/ui/glabels-ui.xml.h:102 +msgid "Save As" +msgstr "다른 이름으로 저장" + +#: data/ui/glabels-ui.xml.h:103 +msgid "Save _As..." +msgstr "다른 이름으로 저장(_A)..." + +#: data/ui/glabels-ui.xml.h:104 +msgid "Save the current file" +msgstr "현재 파일이름으로 저장" + +#: data/ui/glabels-ui.xml.h:105 +msgid "Save the current file with a different name" +msgstr "현재파일을 다른이름으로 저장" + +#: data/ui/glabels-ui.xml.h:106 +msgid "Select All" +msgstr "모두 선택" + +#: data/ui/glabels-ui.xml.h:107 +msgid "Select _All" +msgstr "모두 선택(_A)" + +#: data/ui/glabels-ui.xml.h:108 +msgid "Select all objects" +msgstr "모든 개체 선택" + +#: data/ui/glabels-ui.xml.h:109 +msgid "Select, move and modify objects" +msgstr "선택, 개체 이동과 수정" + +#: data/ui/glabels-ui.xml.h:111 +msgid "Set drawing toolbar button style according to desktop default" +msgstr "기본 데스크탑 모양에 따라 그리기 도구 버튼 모양을 지정" + +#: data/ui/glabels-ui.xml.h:112 +msgid "Set main toolbar button style according to desktop default" +msgstr "기본 데스크탑 모양에 따라 주 도구 버튼 모양을 지정" + +#: data/ui/glabels-ui.xml.h:113 +msgid "Show _Tooltips" +msgstr "팁 보기(_T)" + +#: data/ui/glabels-ui.xml.h:114 +msgid "Show both icons and texts in the drawing toolbar" +msgstr "그리기 도구에 아이콘과 글자 보이기" + +#: data/ui/glabels-ui.xml.h:115 +msgid "Show both icons and texts in the main toolbar" +msgstr "주 도구에 아이콘 ê³¼ 글자 보이기" + +#: data/ui/glabels-ui.xml.h:116 +msgid "Show tooltips in the drawing toolbar" +msgstr "그리기 도구에 팁 보이기" + +#: data/ui/glabels-ui.xml.h:117 +msgid "Show tooltips in the main toolbar" +msgstr "주 도구에 팁 보이기" + +#: data/ui/glabels-ui.xml.h:118 +msgid "Show tooltips in the property toolbar" +msgstr "속성 도구에 팁 보이기" + +#: data/ui/glabels-ui.xml.h:119 +msgid "Template Designer" +msgstr "서식 디자이너" + +#: data/ui/glabels-ui.xml.h:120 +msgid "Template _Designer..." +msgstr "서식 디자이너(_D)..." + +#: data/ui/glabels-ui.xml.h:121 +msgid "Text color" +msgstr "글자 색상" + +#: data/ui/glabels-ui.xml.h:122 +msgid "U_n-select All" +msgstr "모든 선택 해제(_N)" + +#: data/ui/glabels-ui.xml.h:123 +msgid "Un-select All" +msgstr "모든 선택 해제" + +#: data/ui/glabels-ui.xml.h:124 +msgid "Undo" +msgstr "되돌리기" + +#: data/ui/glabels-ui.xml.h:125 +msgid "Undo the last action" +msgstr "마지막 동작으로 되돌리기" + +#: data/ui/glabels-ui.xml.h:126 +msgid "Zoom _1:1" +msgstr "1:1로 확대(_1)" + +#: data/ui/glabels-ui.xml.h:127 +msgid "Zoom _In" +msgstr "확대(_I)" + +#: data/ui/glabels-ui.xml.h:128 +msgid "Zoom _Out" +msgstr "축소(_O)" + +#: data/ui/glabels-ui.xml.h:129 +msgid "Zoom to _fit" +msgstr "맞춰서 확대(_F)" + +#: data/ui/glabels-ui.xml.h:130 +msgid "Zoom to fit window" +msgstr "윈도우에 맞춰서 확대" + +#: data/ui/glabels-ui.xml.h:131 +msgid "_About..." +msgstr "...에 대해(_A)" + +#: data/ui/glabels-ui.xml.h:132 +msgid "_Bottoms" +msgstr "아래(_B)" + +#: data/ui/glabels-ui.xml.h:135 +msgid "_Close" +msgstr "닫기(_C)" + +#: data/ui/glabels-ui.xml.h:136 +msgid "_Contents" +msgstr "목차(_C)" + +#: data/ui/glabels-ui.xml.h:137 +msgid "_Copy" +msgstr "복사(_C)" + +#: data/ui/glabels-ui.xml.h:138 +msgid "_Create Object" +msgstr "항목 만들기(_C)" + +#: data/ui/glabels-ui.xml.h:139 +msgid "_Debug" +msgstr "디버그(_D)" + +#: data/ui/glabels-ui.xml.h:141 +msgid "_Desktop Default" +msgstr "기본 데스크탑(_D)" + +#: data/ui/glabels-ui.xml.h:142 +msgid "_Drawing Toolbar" +msgstr "그리기 도구(_D)" + +#: data/ui/glabels-ui.xml.h:143 +msgid "_Edit" +msgstr "편집(_E)" + +#: data/ui/glabels-ui.xml.h:145 +msgid "_File" +msgstr "파일(_F)" + +#: data/ui/glabels-ui.xml.h:146 +msgid "_Grid" +msgstr "그리드(_G)" + +#: data/ui/glabels-ui.xml.h:147 +msgid "_Help" +msgstr "도움말(_H)" + +#: data/ui/glabels-ui.xml.h:148 +msgid "_Icon" +msgstr "아이콘(_I)" + +#: data/ui/glabels-ui.xml.h:152 +msgid "_Main Toolbar" +msgstr "주 도구(_M)" + +#: data/ui/glabels-ui.xml.h:153 +msgid "_Merge Properties..." +msgstr "여백 속성(_M)..." + +#: data/ui/glabels-ui.xml.h:154 +msgid "_New" +msgstr "새로 만들기(_N)" + +#: data/ui/glabels-ui.xml.h:155 +msgid "_Objects" +msgstr "항목(_O)" + +#: data/ui/glabels-ui.xml.h:156 +msgid "_Open..." +msgstr "열기(_O)..." + +#: data/ui/glabels-ui.xml.h:158 +msgid "_Paste" +msgstr "붙이기(_P)" + +#: data/ui/glabels-ui.xml.h:159 +msgid "_Print..." +msgstr "인쇄(_P)..." + +#: data/ui/glabels-ui.xml.h:160 +msgid "_Property Toolbar" +msgstr "속성 도구(_P)" + +#: data/ui/glabels-ui.xml.h:161 +msgid "_Quit" +msgstr "종료(_Q)" + +#: data/ui/glabels-ui.xml.h:164 +msgid "_Save" +msgstr "저장(_S)" + +#: data/ui/glabels-ui.xml.h:168 +msgid "_View" +msgstr "보기(_V)" + +#: data/glade/prefs-dialog.glade.h:1 +msgid " " +msgstr " " + +#: data/glade/prefs-dialog.glade.h:2 +#: data/glade/object-editor.glade.h:1 +#: data/glade/template-designer.glade.h:5 +msgid "*" +msgstr "*" + +#: data/glade/prefs-dialog.glade.h:3 +msgid "Default page size" +msgstr "기본 용지 크기" + +#: data/glade/prefs-dialog.glade.h:4 +msgid "Fill" +msgstr "채우기" + +#: data/glade/prefs-dialog.glade.h:5 +msgid "Line" +msgstr "선" + +#: data/glade/prefs-dialog.glade.h:6 +msgid "Text" +msgstr "글자" + +#: data/glade/prefs-dialog.glade.h:7 +msgid "Units" +msgstr "유닛" + +#: data/glade/prefs-dialog.glade.h:8 +#: data/glade/object-editor.glade.h:4 +msgid "Alignment:" +msgstr "위치:" + +#: data/glade/prefs-dialog.glade.h:9 +#: data/glade/object-editor.glade.h:8 +msgid "Color:" +msgstr "색상:" + +#: data/glade/prefs-dialog.glade.h:10 +msgid "Font:" +msgstr "글꼴:" + +#: data/glade/prefs-dialog.glade.h:11 +msgid "ISO A4" +msgstr "ISO A4 용지" + +#: data/glade/prefs-dialog.glade.h:12 +msgid "Inches" +msgstr "인치" + +#: data/glade/prefs-dialog.glade.h:13 +#: data/glade/object-editor.glade.h:19 +msgid "Line Spacing:" +msgstr "행간:" + +#: data/glade/prefs-dialog.glade.h:14 +msgid "Locale" +msgstr "로케일" + +#: data/glade/prefs-dialog.glade.h:15 +msgid "Millimeters" +msgstr "밀리미터" + +#: data/glade/prefs-dialog.glade.h:16 +msgid "Object defaults" +msgstr "기본 항목" + +#: data/glade/prefs-dialog.glade.h:17 +msgid "Points" +msgstr "포인트" + +#: data/glade/prefs-dialog.glade.h:18 +msgid "Select default properties for new objects." +msgstr "새 개체의 기본 속성을 선택" + +#: data/glade/prefs-dialog.glade.h:19 +msgid "Select locale specific behavior." +msgstr "구체적인 로케일을 선택" + +#: data/glade/prefs-dialog.glade.h:20 +#: data/templates/paper-sizes.xml.h:25 +msgid "US Letter" +msgstr "US Letter" + +#: data/glade/prefs-dialog.glade.h:21 +#: data/glade/object-editor.glade.h:29 +#: data/glade/template-designer.glade.h:72 +msgid "Width:" +msgstr "넓이:" + +#: data/glade/object-editor.glade.h:2 +msgid "00000000000 00000" +msgstr "00000000000 00000" + +#: data/glade/object-editor.glade.h:3 +msgid "Xxx object properties" +msgstr "Xxx 개체 속성" + +#: data/glade/object-editor.glade.h:5 +msgid "Allow merge to automatically shrink text" +msgstr "자동으로 축소한 글자에 병합" + +#: data/glade/object-editor.glade.h:6 +msgid "Angle:" +msgstr "각도:" + +#: data/glade/object-editor.glade.h:7 +msgid "Checksum" +msgstr "체크섬" + +#: data/glade/object-editor.glade.h:10 +msgid "Family:" +msgstr "패밀리:" + +#: data/glade/object-editor.glade.h:12 +msgid "Fill" +msgstr "채우기" + +#: data/glade/object-editor.glade.h:13 +#: data/glade/template-designer.glade.h:33 +msgid "Height:" +msgstr "높이:" + +#: data/glade/object-editor.glade.h:14 +msgid "Image" +msgstr "그림" + +#: data/glade/object-editor.glade.h:15 +msgid "Insert merge field" +msgstr "병합 필드 삽입" + +#: data/glade/object-editor.glade.h:17 +msgid "Length:" +msgstr "길이:" + +#: data/glade/object-editor.glade.h:18 +msgid "Line" +msgstr "선" + +#: data/glade/object-editor.glade.h:20 +msgid "Literal:" +msgstr "Literal:" + +#: data/glade/object-editor.glade.h:21 +msgid "Load image" +msgstr "그림 불러옴" + +#: data/glade/object-editor.glade.h:22 +msgid "Position" +msgstr "위치" + +#: data/glade/object-editor.glade.h:23 +msgid "Reset image size" +msgstr "그림크기 재설정" + +#: data/glade/object-editor.glade.h:24 +msgid "Size" +msgstr "크기" + +#: data/glade/object-editor.glade.h:25 +msgid "Size:" +msgstr "크기:" + +#: data/glade/object-editor.glade.h:26 +msgid "Style" +msgstr "모양" + +#: data/glade/object-editor.glade.h:27 +msgid "Style:" +msgstr "모양:" + +#: data/glade/object-editor.glade.h:30 +msgid "X:" +msgstr "X:" + +#: data/glade/object-editor.glade.h:31 +msgid "Y:" +msgstr "Y:" + +#: data/glade/object-editor.glade.h:32 +msgid "degrees" +msgstr "degrees" + +#: data/glade/object-editor.glade.h:33 +msgid "dialog1" +msgstr "dialog1" + +#: data/glade/object-editor.glade.h:34 +msgid "digits:" +msgstr "digits:" + +#: data/glade/object-editor.glade.h:35 +msgid "format:" +msgstr "서식:" + +#: data/glade/template-designer.glade.h:1 +msgid " " +msgstr " " + +#: data/glade/template-designer.glade.h:2 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "(예: \"주소라벨\", \"명함\", ...)" + +#: data/glade/template-designer.glade.h:3 +msgid "(e.g., 8163A)" +msgstr "(예: 8163A)" + +#: data/glade/template-designer.glade.h:4 +msgid "(e.g., Avery, Acme, ...)" +msgstr "(예: Avery, Acme, ...)" + +#: data/glade/template-designer.glade.h:6 +msgid "1. Outer radius:" +msgstr "1. 바깥 반지름:" + +#: data/glade/template-designer.glade.h:7 +msgid "1. Radius:" +msgstr "1. 반지름:" + +#: data/glade/template-designer.glade.h:8 +msgid "1. Width:" +msgstr "1. 넓이:" + +#: data/glade/template-designer.glade.h:9 +msgid "2. Height:" +msgstr "2. 높이:" + +#: data/glade/template-designer.glade.h:10 +msgid "2. Inner radius:" +msgstr "2. 안쪽 반지름:" + +#: data/glade/template-designer.glade.h:11 +msgid "2. Waste (overprint allowed):" +msgstr "2. 여백 (겹친 인쇄 허용):" + +#: data/glade/template-designer.glade.h:12 +msgid "3. Clipping width:" +msgstr "3. 오려내기 넓이:" + +#: data/glade/template-designer.glade.h:13 +msgid "3. Margin" +msgstr "3. 여백" + +#: data/glade/template-designer.glade.h:14 +msgid "3. Round (radius of corner):" +msgstr "3. 둥글기 (귀퉁이 각도):" + +#: data/glade/template-designer.glade.h:15 +msgid "4. Clipping height:" +msgstr "4. 오려내기 높이:" + +#: data/glade/template-designer.glade.h:16 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "4. 좌우 여백 (겹친 인쇄 허용):" + +#: data/glade/template-designer.glade.h:17 +msgid "5. Vert. waste (overprint allowed):" +msgstr "5. 아래위 여백 (겹친 인쇄 허용):" + +#: data/glade/template-designer.glade.h:18 +msgid "5. Waste (overprint allowed):" +msgstr "5. 여백 (겹친 인쇄 허용):" + +#: data/glade/template-designer.glade.h:19 +msgid "6. Margin" +msgstr "6. 라벨 내 여백" + +#: data/glade/template-designer.glade.h:20 +msgid "Brand/Manufacturer:" +msgstr "상표/제조업체:" + +#: data/glade/template-designer.glade.h:21 +msgid "CD/DVD (including credit card CDs)" +msgstr "CD/DVD (credit card CD 포함)" + +#: data/glade/template-designer.glade.h:22 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "" +"축하드립니다!\n" +"\n" +"gLabels 서식문서 디자이너로 서식 만들기를 마쳤습니다.\n" +"새로 만든 서식을 저장하기 원한다면 \"적용\" 을 누르세요.\n" +"\n" +"\"취소\"를 누르면 만든것을 버리게 됩니다.\n" +"또는 \"뒤로\"를 선택하여 만든것을 편집 할 수 있습니다." + +#: data/glade/template-designer.glade.h:30 +msgid "Design Completed" +msgstr "서식 디자인 완료됨" + +#: data/glade/template-designer.glade.h:31 +msgid "Distance from left edge (x0):" +msgstr "왼쪽 가장자리 부터 (x0):" + +#: data/glade/template-designer.glade.h:32 +msgid "Distance from top edge (y0):" +msgstr "위쪽 가장자리 부터 (y0):" + +#: data/glade/template-designer.glade.h:34 +msgid "Horizontal pitch (dx):" +msgstr "수평 pitch (dx):" + +#: data/glade/template-designer.glade.h:35 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" +"서식을 얼마나 포함합니까?\n" +"\n" +"레이아웃 서식 개수 지정을 통해 두개 이내의 레이아웃을 만들 수 있습니다.\n" +"보통은 아래 첫번째 예제처럼 한개의 레이아웃을 필요로 하지만,\n" +"어떤것은 두번째 예제처럼 두개의 레이아웃을 필요로 하는것도 있습니다." + +#: data/glade/template-designer.glade.h:40 +msgid "Label Size (CD/DVD)" +msgstr "라벨 크기(CD/DVD)" + +#: data/glade/template-designer.glade.h:41 +msgid "Label Size (Round)" +msgstr "라벨 크기 (둥글기)" + +#: data/glade/template-designer.glade.h:42 +msgid "Label or Card Shape" +msgstr "라벨 또는 카드 외형" + +#: data/glade/template-designer.glade.h:43 +msgid "Label or Card Size (Rectangular)" +msgstr "라벨 또는 카드 크기(직사각형)" + +#: data/glade/template-designer.glade.h:44 +msgid "Layout #1" +msgstr "레이아웃 #1:" + +#: data/glade/template-designer.glade.h:45 +msgid "Layout #2" +msgstr "레이아웃 #2:" + +#: data/glade/template-designer.glade.h:46 +msgid "Layout(s)" +msgstr "레이아웃" + +#: data/glade/template-designer.glade.h:47 +msgid "Name and Description" +msgstr "이름과 설명" + +#: data/glade/template-designer.glade.h:48 +msgid "Number across (nx):" +msgstr "가로 개수 (nx):" + +#: data/glade/template-designer.glade.h:49 +msgid "Number down (ny):" +msgstr "세로 개수 (ny):" + +#: data/glade/template-designer.glade.h:50 +msgid "Number of Layouts" +msgstr "레이아웃 선택" + +#: data/glade/template-designer.glade.h:51 +msgid "Number of layouts:" +msgstr "레이아웃 선택:" + +#: data/glade/template-designer.glade.h:52 +msgid "Page Size" +msgstr "용지 크기" + +#: data/glade/template-designer.glade.h:54 +msgid "Part #:" +msgstr "라벨분류:" + +#: data/glade/template-designer.glade.h:55 +msgid "Please enter the following identifying information about the template stationery." +msgstr "입력 상자에 기본 서식 정보를 입력하세요." + +#: data/glade/template-designer.glade.h:56 +msgid "Please enter the following layout information." +msgstr "레이아웃 정보를 입력하세요." + +#: data/glade/template-designer.glade.h:57 +msgid "Please enter the following size parameters of a single label in your template." +msgstr "라벨서식의 치수를 입력하세요." + +#: data/glade/template-designer.glade.h:58 +msgid "Please enter the following size parameters of a single label or card in your template." +msgstr "라벨서식 또는 카드서식의 치수를 입력하세요." + +#: data/glade/template-designer.glade.h:59 +msgid "Please select the basic shape of the labels or cards." +msgstr "라벨 또는 카드의 기본 형태를 선택하세요." + +#: data/glade/template-designer.glade.h:60 +msgid "Please select the page size of the template stationery." +msgstr "서식 용지의 크기 선택" + +#: data/glade/template-designer.glade.h:61 +msgid "Print test sheet" +msgstr "용지 테스트 인쇄" + +#: data/glade/template-designer.glade.h:62 +msgid "Rectangular or square (can have rounded corners)" +msgstr "직사각형 또는 정사각형(마무리를 둥글게 만들 수 있음)" + +#: data/glade/template-designer.glade.h:63 +msgid "Round" +msgstr "둥근형" + +#: data/glade/template-designer.glade.h:64 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" +"2. 두개의 레이아웃\n" +"서식 필요" + +#: data/glade/template-designer.glade.h:66 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" +"1. 한개의 레이아웃\n" +"서식 필요" + +#: data/glade/template-designer.glade.h:68 +msgid "Vertical pitch (dy):" +msgstr "수직 pitch (dy):" + +#: data/glade/template-designer.glade.h:69 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" +"gLabels 서식 제작기에 어서오세요.\n" +"\n" +"차근차근 gLabels의 사용자 서식을 쉽게 만들 수 있게 도와드립니다. " + +#: data/templates/paper-sizes.xml.h:1 +msgid "A0" +msgstr "A0용지" + +#: data/templates/paper-sizes.xml.h:2 +msgid "A1" +msgstr "A1용지" + +#: data/templates/paper-sizes.xml.h:3 +msgid "A10" +msgstr "A10용지" + +#: data/templates/paper-sizes.xml.h:4 +msgid "A2" +msgstr "A2용지" + +#: data/templates/paper-sizes.xml.h:5 +msgid "A3" +msgstr "A3용지" + +#: data/templates/paper-sizes.xml.h:6 +msgid "A4" +msgstr "A4용지" + +#: data/templates/paper-sizes.xml.h:7 +msgid "A5" +msgstr "A5용지" + +#: data/templates/paper-sizes.xml.h:8 +msgid "A6" +msgstr "A6용지" + +#: data/templates/paper-sizes.xml.h:9 +msgid "A7" +msgstr "A7용지" + +#: data/templates/paper-sizes.xml.h:10 +msgid "A8" +msgstr "A8용지" + +#: data/templates/paper-sizes.xml.h:11 +msgid "A9" +msgstr "A9용지" + +#: data/templates/paper-sizes.xml.h:12 +msgid "B0" +msgstr "B0용지" + +#: data/templates/paper-sizes.xml.h:13 +msgid "B1" +msgstr "B1용지" + +#: data/templates/paper-sizes.xml.h:14 +msgid "B10" +msgstr "B10용지" + +#: data/templates/paper-sizes.xml.h:15 +msgid "B2" +msgstr "B2용지" + +#: data/templates/paper-sizes.xml.h:16 +msgid "B3" +msgstr "B3용지" + +#: data/templates/paper-sizes.xml.h:17 +msgid "B4" +msgstr "B4용지" + +#: data/templates/paper-sizes.xml.h:18 +msgid "B5" +msgstr "B5용지" + +#: data/templates/paper-sizes.xml.h:19 +msgid "B6" +msgstr "B6용지" + +#: data/templates/paper-sizes.xml.h:20 +msgid "B7" +msgstr "B7용지" + +#: data/templates/paper-sizes.xml.h:21 +msgid "B8" +msgstr "B8용지" + +#: data/templates/paper-sizes.xml.h:22 +msgid "B9" +msgstr "B9용지" + +#: data/templates/paper-sizes.xml.h:23 +msgid "US Executive" +msgstr "US Executive" + +#: data/templates/paper-sizes.xml.h:24 +msgid "US Legal" +msgstr "US Legal" + +#: data/templates/avery-us-templates.xml.h:1 +#: data/templates/zweckform-iso-templates.xml.h:1 +msgid "Address Labels" +msgstr "주소 라벨" + +#: data/templates/avery-us-templates.xml.h:2 +#: data/templates/avery-iso-templates.xml.h:2 +#: data/templates/zweckform-iso-templates.xml.h:3 +#: data/templates/misc-us-templates.xml.h:2 +#: data/templates/misc-iso-templates.xml.h:9 +msgid "Business Cards" +msgstr "명함" + +#: data/templates/avery-us-templates.xml.h:3 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "CD/DVD 라벨 (Disc 라벨)" + +#: data/templates/avery-us-templates.xml.h:4 +msgid "Diskette Labels" +msgstr "디스크 라벨" + +#: data/templates/avery-us-templates.xml.h:5 +msgid "Filing Labels" +msgstr "출원 라벨" + +#: data/templates/avery-us-templates.xml.h:6 +msgid "Full Sheet Labels" +msgstr "Full Sheet 라벨" + +#: data/templates/avery-us-templates.xml.h:7 +msgid "Large Round Labels" +msgstr "큰 원형 라벨" + +#: data/templates/avery-us-templates.xml.h:8 +msgid "Name Badge Labels" +msgstr "Name Badge 라벨" + +#: data/templates/avery-us-templates.xml.h:9 +msgid "Return Address Labels" +msgstr "반송 주소용 라벨" + +#: data/templates/avery-us-templates.xml.h:10 +msgid "Shipping Labels" +msgstr "출하 라벨" + +#: data/templates/avery-us-templates.xml.h:11 +msgid "Small Round Labels" +msgstr "작은 원형 라벨" + +#: data/templates/avery-us-templates.xml.h:12 +msgid "Square Labels" +msgstr "구형 라벨" + +#: data/templates/avery-us-templates.xml.h:13 +msgid "Video Tape Face Labels" +msgstr "비디오 테입 앞면 라벨" + +#: data/templates/avery-us-templates.xml.h:14 +msgid "Video Tape Spine Labels" +msgstr "비디오 테입 옆면 라벨" + +#: data/templates/avery-iso-templates.xml.h:1 +msgid "Address labels" +msgstr "주소 라벨" + +#: data/templates/avery-iso-templates.xml.h:3 +msgid "CD Booklet" +msgstr "CD Booklet" + +#: data/templates/avery-iso-templates.xml.h:4 +msgid "CD Inlet" +msgstr "CD Inlet" + +#: data/templates/avery-iso-templates.xml.h:5 +#: data/templates/zweckform-iso-templates.xml.h:4 +#: data/templates/misc-us-templates.xml.h:4 +#: data/templates/misc-iso-templates.xml.h:10 +msgid "CD/DVD Labels" +msgstr "CD/DVD 라벨" + +#: data/templates/avery-iso-templates.xml.h:6 +msgid "Diskette labels" +msgstr "디스크 라벨" + +#: data/templates/avery-iso-templates.xml.h:7 +#: data/templates/zweckform-iso-templates.xml.h:7 +#: data/templates/misc-iso-templates.xml.h:17 +msgid "Mailing Labels" +msgstr "봉투 라벨" + +#: data/templates/avery-iso-templates.xml.h:8 +msgid "Mailing labels" +msgstr "봉투 라벨" + +#: data/templates/avery-iso-templates.xml.h:9 +msgid "Mini Address Labels" +msgstr "작은 주소라벨" + +#: data/templates/avery-iso-templates.xml.h:10 +msgid "Shipping labels" +msgstr "출하 라벨" + +#: data/templates/zweckform-iso-templates.xml.h:2 +msgid "Allround Labels" +msgstr "Allround 라벨" + +#: data/templates/zweckform-iso-templates.xml.h:5 +msgid "Correction and Cover-up Labels" +msgstr "수집 ê³¼ Cover-up 라벨" + +#: data/templates/zweckform-iso-templates.xml.h:6 +msgid "Lever Arch File Labels" +msgstr "Lever Arch 파일 라벨" + +#: data/templates/zweckform-iso-templates.xml.h:8 +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "QSL-Karten Etiketten (70mm x 50.8mm)" + +#: data/templates/zweckform-iso-templates.xml.h:9 +msgid "Rectangular Copier Labels" +msgstr "분류표기 라벨" + +#: data/templates/zweckform-iso-templates.xml.h:10 +#: data/templates/misc-iso-templates.xml.h:22 +msgid "Rectangular Labels" +msgstr "직사각형 라벨" + +#: data/templates/zweckform-iso-templates.xml.h:11 +msgid "Video Labels (back)" +msgstr "비디오 라벨 (뒤)" + +#: data/templates/misc-us-templates.xml.h:1 +msgid "Business Card CD" +msgstr "명함 CD" + +#: data/templates/misc-us-templates.xml.h:3 +msgid "CD Template Rectangles" +msgstr "CD 서식 (직사각형)" + +#: data/templates/misc-us-templates.xml.h:5 +msgid "CD/DVD Labels (Face Only)" +msgstr "CD/DVD 라벨 (표지만)" + +#: data/templates/misc-us-templates.xml.h:6 +#: data/templates/misc-iso-templates.xml.h:11 +msgid "CD/DVD Labels (face only)" +msgstr "CD/DVD 라벨 (표지만)" + +#: data/templates/misc-us-templates.xml.h:7 +msgid "DLT Labels" +msgstr "DLT 라벨" + +#: data/templates/misc-us-templates.xml.h:8 +msgid "Microtube labels" +msgstr "Microtube 라벨" + +#: data/templates/misc-us-templates.xml.h:9 +msgid "Mini-CD Labels" +msgstr "Mini-CD 라벨" + +#: data/templates/misc-us-templates.xml.h:10 +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "PRO CD 라벨 2-up (CD 세로표지 전용)" + +#: data/templates/misc-us-templates.xml.h:11 +msgid "PRO CD Labels 2-up (Face only)" +msgstr "PRO CD 라벨 2-up (표지만)" + +#: data/templates/misc-us-templates.xml.h:12 +#: data/templates/misc-iso-templates.xml.h:21 +msgid "PRO CD Labels 2-up (face only)" +msgstr "PRO CD 라벨 2-up (표지만)" + +#: data/templates/misc-us-templates.xml.h:13 +msgid "Slimline CD Case (rightside up)" +msgstr "Slimline CD 케이스 (우측옆)" + +#: data/templates/misc-us-templates.xml.h:14 +msgid "Slimline CD Case (upside down)" +msgstr "Slimline CD 케이스(상위)" + +#: data/templates/misc-iso-templates.xml.h:1 +msgid "Agipa 119488: Business Cards" +msgstr "Agipa 119488: 명함" + +#: data/templates/misc-iso-templates.xml.h:2 +msgid "Allround Labels --24" +msgstr "Allround 라벨 --24" + +#: data/templates/misc-iso-templates.xml.h:3 +msgid "Allround Labels --44" +msgstr "Allround 라벨 --44" + +#: data/templates/misc-iso-templates.xml.h:4 +msgid "Allround Labels --64" +msgstr "Allround 라벨 --64" + +#: data/templates/misc-iso-templates.xml.h:5 +msgid "Allround Labels --65" +msgstr "Allround 라벨 --65" + +#: data/templates/misc-iso-templates.xml.h:6 +msgid "Arch File Labels" +msgstr "Arch 파일 라벨" + +#: data/templates/misc-iso-templates.xml.h:7 +msgid "Arch File Labels (large)" +msgstr "Arch 파일 라벨 (큰것)" + +#: data/templates/misc-iso-templates.xml.h:8 +msgid "Arch File Labels (small)" +msgstr "Arch 파일 라벨 (작은것)" + +#: data/templates/misc-iso-templates.xml.h:12 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "기본 CD/DVD 라벨 (표지만)" + +#: data/templates/misc-iso-templates.xml.h:13 +msgid "Diskette Labels (face only)" +msgstr "디스켓 라벨 (표지만)" + +#: data/templates/misc-iso-templates.xml.h:14 +msgid "EPSON Photo Stickers 16" +msgstr "EPSON 포토 스티커 16" + +#: data/templates/misc-iso-templates.xml.h:15 +msgid "Etiketten" +msgstr "Etiketten" + +#: data/templates/misc-iso-templates.xml.h:16 +msgid "Fridge Magnet Stickers" +msgstr "Fridge Magnet 스티커" + +#: data/templates/misc-iso-templates.xml.h:18 +msgid "Mailing Labels --14" +msgstr "봉투 라벨 --14" + +#: data/templates/misc-iso-templates.xml.h:19 +msgid "Mailing Labels-2 columns" +msgstr "주소 라벨 (2형)" + +#: data/templates/misc-iso-templates.xml.h:20 +msgid "Mailing Labels-3 columns" +msgstr "주소라벨 (3형)" + +#: data/templates/misc-iso-templates.xml.h:23 +msgid "Video Labels (face only)" +msgstr "비디오 라벨 (표지만)" + +#: data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers" +msgstr "라벨, 명함 그리고 미디어 커버 만들기" + +#: data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "gLabels 라벨 디자이너" + +#: data/mime/glabels.keys.in.h:1 +#: data/mime/glabels.xml.in.h:1 +msgid "gLabels Project File" +msgstr "gLabels 프로젝트 파일" + diff --git a/po/pl.po b/po/pl.po new file mode 100644 index 00000000..d67a9065 --- /dev/null +++ b/po/pl.po @@ -0,0 +1,2650 @@ +# Polish translation for gLabels +# Copyright (C) 2002 Free Software Foundation, Inc. +# Arkadiusz Lipiec , 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: gLabels\n" +"POT-Creation-Date: 2004-08-08 00:43-0400\n" +"PO-Revision-Date: 2002-07-23 11:43+0100\n" +"Last-Translator: Arkadiusz Lipiec \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/glabels.c:55 +msgid "Show view debugging messages." +msgstr "" + +#: src/glabels.c:58 +msgid "Show item debugging messages." +msgstr "" + +#: src/glabels.c:61 +msgid "Show printing debugging messages." +msgstr "" + +#: src/glabels.c:64 +msgid "Show prefs debugging messages." +msgstr "" + +#: src/glabels.c:67 +msgid "Show file debugging messages." +msgstr "" + +#: src/glabels.c:70 +msgid "Show document debugging messages." +msgstr "" + +#: src/glabels.c:73 +msgid "Show template debugging messages." +msgstr "" + +#: src/glabels.c:76 +msgid "Show paper debugging messages." +msgstr "" + +#: src/glabels.c:79 +msgid "Show xml debugging messages." +msgstr "" + +#: src/glabels.c:82 +msgid "Show document merge debugging messages." +msgstr "" + +#: src/glabels.c:85 +msgid "Show commands debugging messages." +msgstr "" + +#: src/glabels.c:88 +msgid "Show undo debugging messages." +msgstr "" + +#: src/glabels.c:91 +msgid "Show recent debugging messages." +msgstr "" + +#: src/glabels.c:94 +msgid "Show window debugging messages." +msgstr "" + +#: src/glabels.c:97 +msgid "Show ui debugging messages." +msgstr "" + +#: src/glabels.c:100 +msgid "Show property_bar debugging messages." +msgstr "" + +#: src/glabels.c:103 +msgid "Show media select widget debugging messages." +msgstr "" + +#: src/glabels.c:106 +msgid "Show mini preview widget debugging messages." +msgstr "" + +#: src/glabels.c:109 +msgid "Show pixbuf cache debugging messages." +msgstr "" + +#: src/glabels.c:112 +msgid "Show widget debugging messages." +msgstr "" + +#: src/glabels.c:115 +msgid "Show object editor debugging messages." +msgstr "" + +#: src/glabels.c:118 +msgid "Turn on all debugging messages." +msgstr "" + +#: src/glabels.c:187 +msgid "Could not initialize Bonobo!\n" +msgstr "" + +#: src/glabels-batch.c:48 +msgid "print this message" +msgstr "wy¶wietla ten komunikat" + +#: src/glabels-batch.c:50 +msgid "print the version of glabels-batch being used" +msgstr "wy¶wietla aktualnie u¿ywan± wersjê glabel-batch" + +#: src/glabels-batch.c:52 +msgid "set output filename (default=\"output.ps\")" +msgstr "okre¶l nazwê pliku wyj¶ciowego (domy¶lnie=\"output.ps\")" + +#: src/glabels-batch.c:52 +msgid "filename" +msgstr "nazwa pliku" + +#: src/glabels-batch.c:54 +msgid "number of sheets (default=1)" +msgstr "liczba arkuszy (domy¶lnie=1)" + +#: src/glabels-batch.c:54 +msgid "sheets" +msgstr "arkusz(e/y)" + +#: src/glabels-batch.c:56 +msgid "number of copies (default=1)" +msgstr "liczba kopii (domy¶lnie=1)" + +#: src/glabels-batch.c:56 +msgid "copies" +msgstr "kopi(a/e/i)" + +#: src/glabels-batch.c:58 src/print-dialog.c:336 +msgid "print outlines (to test printer alignment)" +msgstr "drukowanie ramek (w celu przetestowania wyrównania)" + +#: src/glabels-batch.c:60 src/print-dialog.c:344 +msgid "print in reverse (i.e. a mirror image)" +msgstr "drukowanie odwrócone (np. odbicie zwierciadlane)" + +#: src/glabels-batch.c:96 +msgid "[OPTION...] GLABELS_FILE..." +msgstr "[OPCJA...] PLIK_GLABELS..." + +#: src/glabels-batch.c:116 +msgid "missing glabels file\n" +msgstr "brak pliku glabels\n" + +#: src/glabels-batch.c:157 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "nie mo¿na otworzyæ pliku glabels o nazwie %s\n" + +#: src/window.c:244 +msgid "(none) - gLabels" +msgstr "" + +#: src/window.c:414 +msgid "(modified)" +msgstr "" + +#: src/stock.c:65 data/ui/glabels-ui.xml.h:165 +#, fuzzy +msgid "_Select Mode" +msgstr "Wybierz" + +#: src/stock.c:66 data/ui/glabels-ui.xml.h:166 +#, fuzzy +msgid "_Text" +msgstr "Tekst" + +#: src/stock.c:67 data/ui/glabels-ui.xml.h:151 +#, fuzzy +msgid "_Line" +msgstr "Linia" + +#: src/stock.c:68 data/ui/glabels-ui.xml.h:133 +#, fuzzy +msgid "_Box" +msgstr "Skrzynka" + +#: src/stock.c:69 data/ui/glabels-ui.xml.h:144 +#, fuzzy +msgid "_Ellipse" +msgstr "Elipsa" + +#: src/stock.c:70 data/ui/glabels-ui.xml.h:149 +#, fuzzy +msgid "_Image" +msgstr "Obraz" + +#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 +#, fuzzy +msgid "Bar_code" +msgstr "Kod paskowy" + +#: src/stock.c:72 +#, fuzzy +msgid "_Merge Properties" +msgstr "W³a¶ciwo¶ci z³±czania" + +#: src/stock.c:73 +#, fuzzy +msgid "Object _Properties" +msgstr "W³a¶ciwo¶ci tekstu" + +#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 +#, fuzzy +msgid "Bring to _Front" +msgstr "Przesun na wierzch" + +#: src/stock.c:75 data/ui/glabels-ui.xml.h:110 +#, fuzzy +msgid "Send to _Back" +msgstr "Przesuñ w dó³" + +#: src/stock.c:76 data/ui/glabels-ui.xml.h:97 +#, fuzzy +msgid "Rotate _Left" +msgstr "Obróæ" + +#: src/stock.c:77 data/ui/glabels-ui.xml.h:98 +#, fuzzy +msgid "Rotate _Right" +msgstr "Obróæ" + +#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 +msgid "Flip _Horizontally" +msgstr "" + +#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 +msgid "Flip _Vertically" +msgstr "" + +#: src/stock.c:80 data/ui/glabels-ui.xml.h:150 +msgid "_Lefts" +msgstr "" + +#: src/stock.c:81 data/ui/glabels-ui.xml.h:162 +msgid "_Rights" +msgstr "" + +#: src/stock.c:82 data/ui/glabels-ui.xml.h:134 +msgid "_Centers" +msgstr "" + +#: src/stock.c:83 data/ui/glabels-ui.xml.h:167 +#, fuzzy +msgid "_Tops" +msgstr "_Narzêdzia" + +#: src/stock.c:84 +msgid "Bottoms" +msgstr "" + +#: src/stock.c:85 +msgid "Centers" +msgstr "" + +#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 +msgid "Label Ce_nter" +msgstr "" + +#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 +msgid "Fill color" +msgstr "" + +#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 +msgid "Line color" +msgstr "" + +#: src/stock.c:90 src/stock.c:92 +#, fuzzy +msgid "Linked" +msgstr "Linia" + +#: src/stock.c:91 src/stock.c:93 +#, fuzzy +msgid "Not Linked" +msgstr "Brak" + +#: src/ui-property-bar.c:345 src/object-editor.c:499 +#, fuzzy +msgid "Default" +msgstr "Usuñ" + +#: src/ui-property-bar.c:360 src/object-editor.c:512 +msgid "No fill" +msgstr "" + +#: src/ui-property-bar.c:375 src/object-editor.c:505 +#, fuzzy +msgid "No line" +msgstr "Brak" + +#: src/ui-sidebar.c:180 +#, fuzzy +msgid "Object properties" +msgstr "W³a¶ciwo¶ci tekstu" + +#: src/commands.c:385 +msgid "" +"A label and business card creation program for GNOME.\n" +" \n" +"Glabels is free software; you can redistribute it and/or modify it under the " +"terms of the GNU General Public License as published by the Free Software " +"Foundation; either version 2 of the License, or (at your option) any later " +"version.\n" +" \n" +"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.\n" +msgstr "" +"Program do tworzenia etykiet i wizytówek dla GNOME.\n" +"\n" +"Glabels jest oprogramowaniem wolnodostêpnym, mo¿na rozpowszechniaæ go lub/" +"imodyfikowaæ na zasadach Licencji Publicznej GNU opublikowanej przez Free " +"Software Foundation; zarówno w wersji 2 tej licencji, jak (do wyboru) i " +"dowolnej pó¼niejszej wersji.\n" +"\n" +"Ten program jest rozpowszechniany w nadziei u¿yteczno¶ci, lecz BEZ ¯ADNEJ " +"GWARANCJI; nawet wynikaj±cej z RÊKOJMI lub U¯YWANIA W OKRE¦LONYM CELU. " +"Zajrzyj do Licencji Publicznej GNU aby uzyskaæ wiêcej szczegó³ów.\n" + +#: src/commands.c:399 +msgid "See the file AUTHORS for additional credits," +msgstr "" + +#: src/commands.c:400 +msgid "or visit http://glabels.sourceforge.net/" +msgstr "" + +#: src/commands.c:409 +msgid " " +msgstr "" + +#: src/commands.c:424 +#, fuzzy +msgid "glabels" +msgstr "Etykiety" + +#: src/file.c:100 +msgid "New Label or Card" +msgstr "Nowa etykieta lub karta" + +#: src/file.c:132 src/file.c:304 +msgid "Media Type" +msgstr "Typ no¶nika" + +#: src/file.c:138 src/file.c:310 +msgid "Label orientation" +msgstr "U³o¿enie etykiety" + +#: src/file.c:269 +#, fuzzy +msgid "Label properties" +msgstr "W³a¶ciwo¶ci tekstu" + +#: src/file.c:452 src/file.c:870 +msgid "All files" +msgstr "" + +#: src/file.c:457 src/file.c:875 +#, fuzzy +msgid "gLabels documents" +msgstr "Glabels: Preferencje" + +#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 +#, fuzzy +msgid "Empty file name selection" +msgstr "Usuwa wszelkie zaznaczenia" + +#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 +msgid "Please select a file or supply a valid file name" +msgstr "" + +#: src/file.c:519 src/file.c:631 +msgid "File does not exist" +msgstr "" + +#: src/file.c:563 data/ui/glabels-ui.xml.h:75 +msgid "Open" +msgstr "Otwórz" + +#: src/file.c:565 +msgid "Open label" +msgstr "Otwórz etykietê" + +#: src/file.c:707 +#, fuzzy, c-format +msgid "Could not open file \"%s\"" +msgstr "Nie mo¿na otworzyæ pliku" + +#: src/file.c:715 +msgid "Not a supported file format" +msgstr "" + +#: src/file.c:797 src/file.c:979 src/file.c:1174 +#, fuzzy, c-format +msgid "Could not save file \"%s\"" +msgstr "Nie mo¿na zapisaæ pliku" + +#: src/file.c:805 src/file.c:987 src/file.c:1182 +msgid "Error encountered during save. The file is still not saved." +msgstr "" + +#: src/file.c:848 src/file.c:1048 +#, fuzzy, c-format +msgid "Save \"%s\" as" +msgstr "Zapisz etykietê jako" + +#: src/file.c:935 src/file.c:1131 +#, fuzzy +msgid "Please supply a valid file name" +msgstr "Nale¿y podaæ nazwê pliku" + +#: src/file.c:952 src/file.c:1147 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "" + +#: src/file.c:960 src/file.c:1155 +msgid "File already exists." +msgstr "" + +#: src/file.c:1271 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "" + +#: src/file.c:1279 +msgid "Your changes will be lost if you don't save them." +msgstr "" + +#: src/file.c:1282 +msgid "Close without saving" +msgstr "" + +#. Should not happen +#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 +#: data/glade/object-editor.glade.h:37 +msgid "points" +msgstr "punkty(-ów)" + +#: src/prefs.c:158 data/glade/object-editor.glade.h:36 +#: data/glade/template-designer.glade.h:74 +msgid "inches" +msgstr "cali" + +#: src/prefs.c:160 +msgid "mm" +msgstr "mm" + +#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 +#, fuzzy +msgid "gLabels Preferences" +msgstr "Glabels: Preferencje" + +#. +#. * Submenu: Order +#. +#: src/view.c:3570 data/ui/glabels-ui.xml.h:157 +msgid "_Order" +msgstr "" + +#. +#. * Submenu: Rotate/Flip +#. +#: src/view.c:3591 data/ui/glabels-ui.xml.h:163 +#, fuzzy +msgid "_Rotate/Flip" +msgstr "Obróæ" + +#. +#. * Submenu: Align Horizontally +#. +#: src/view.c:3624 +msgid "Align _Horizontally" +msgstr "" + +#. +#. * Submenu: Align Vertically +#. +#: src/view.c:3663 +msgid "Align _Vertically" +msgstr "" + +#: src/view.c:3724 data/ui/glabels-ui.xml.h:140 +#, fuzzy +msgid "_Delete" +msgstr "Usuñ" + +#. Build editor. +#: src/view-box.c:223 +#, fuzzy +msgid "Box object properties" +msgstr "Modyfikacja w³a¶ciwo¶ci skrzynki" + +#. Build editor. +#: src/view-ellipse.c:223 +#, fuzzy +msgid "Ellipse object properties" +msgstr "Modyfikacja w³a¶ciwo¶ci elipsy" + +#. Build editor. +#: src/view-line.c:223 +#, fuzzy +msgid "Line object properties" +msgstr "Modyfikacja w³a¶ciwo¶ci skrzynki" + +#. Build editor. +#: src/view-image.c:222 +#, fuzzy +msgid "Image object properties" +msgstr "Modyfikacja w³a¶ciwo¶ci obrazu" + +#. Build editor. +#: src/view-text.c:250 +#, fuzzy +msgid "Text object properties" +msgstr "Modyfikacja w³a¶ciwo¶ci skrzynki" + +#: src/view-text.c:562 data/glade/object-editor.glade.h:28 +msgid "Text" +msgstr "Tekst" + +#. Build editor. +#: src/view-barcode.c:209 +#, fuzzy +msgid "Barcode object properties" +msgstr "Modyfikacja w³a¶ciwo¶ci kodu paskowego" + +#: src/view-barcode.c:579 src/print.c:1088 +#, fuzzy +msgid "Invalid barcode data" +msgstr "Niepoprawny kod paskowy" + +#: src/merge-properties-dialog.c:231 +#, fuzzy +msgid "Merge Properties" +msgstr "W³a¶ciwo¶ci z³±czania" + +#. ---- Source section ---- +#: src/merge-properties-dialog.c:237 +msgid "Source" +msgstr "¬ród³o" + +#: src/merge-properties-dialog.c:245 +msgid "Format:" +msgstr "Format:" + +#. Location line +#: src/merge-properties-dialog.c:273 +msgid "Location:" +msgstr "Po³o¿enie:" + +#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 +msgid "Select merge-database source" +msgstr "Wybierz ¼ród³o bazy danych z³±czania " + +#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 +msgid "N/A" +msgstr "N/A" + +#. ---- Sample Fields section ---- +#: src/merge-properties-dialog.c:300 +msgid "Record selection/preview:" +msgstr "" + +#: src/merge-properties-dialog.c:326 +msgid "Select" +msgstr "Wybierz" + +#: src/merge-properties-dialog.c:334 +msgid "Record/Field" +msgstr "" + +#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 +msgid "Data" +msgstr "Dane" + +#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:82 +msgid "Print" +msgstr "Wydrukuj" + +#: src/print-dialog.c:281 +msgid "_Job" +msgstr "" + +#: src/print-dialog.c:286 +#, fuzzy +msgid "P_rinter" +msgstr "Wydrukuj" + +#. ----------- Add simple-copies widget ------------ +#: src/print-dialog.c:314 +msgid "Copies" +msgstr "Kopie" + +#. ------- Add merge control widget ------------ +#: src/print-dialog.c:322 +msgid "Document merge control" +msgstr "Kontrola z³±czania dokumentów" + +#. ----------- Add custom print options area ------------ +#: src/print-dialog.c:330 +msgid "Options" +msgstr "Opcje" + +#: src/print-dialog.c:351 +msgid "print crop marks" +msgstr "" + +#: src/print-dialog.c:553 src/print-dialog.c:592 +msgid "Print preview" +msgstr "Podgl±d wydruku" + +#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 +msgid "gLabels Template Designer" +msgstr "" + +#: src/bc.c:60 +msgid "POSTNET (any)" +msgstr "" + +#: src/bc.c:63 +msgid "POSTNET-5 (ZIP only)" +msgstr "" + +#: src/bc.c:66 +msgid "POSTNET-9 (ZIP+4)" +msgstr "" + +#: src/bc.c:69 +msgid "POSTNET-11 (DPBC)" +msgstr "" + +#: src/bc.c:72 +msgid "EAN (any)" +msgstr "" + +#: src/bc.c:75 +msgid "EAN-8" +msgstr "" + +#: src/bc.c:78 +msgid "EAN-8 +2" +msgstr "" + +#: src/bc.c:81 +msgid "EAN-8 +5" +msgstr "" + +#: src/bc.c:84 +msgid "EAN-13" +msgstr "" + +#: src/bc.c:87 +msgid "EAN-13 +2" +msgstr "" + +#: src/bc.c:90 +msgid "EAN-13 +5" +msgstr "" + +#: src/bc.c:93 +msgid "UPC (UPC-A or UPC-E)" +msgstr "" + +#: src/bc.c:96 +msgid "UPC-A" +msgstr "" + +#: src/bc.c:99 +msgid "UPC-A +2" +msgstr "" + +#: src/bc.c:102 +msgid "UPC-A +5" +msgstr "" + +#: src/bc.c:105 +msgid "UPC-E" +msgstr "" + +#: src/bc.c:108 +msgid "UPC-E +2" +msgstr "" + +#: src/bc.c:111 +msgid "UPC-E +5" +msgstr "" + +#: src/bc.c:114 +msgid "ISBN" +msgstr "" + +#: src/bc.c:117 +msgid "ISBN +5" +msgstr "" + +#: src/bc.c:120 +msgid "Code 39" +msgstr "" + +#: src/bc.c:123 +msgid "Code 128" +msgstr "" + +#: src/bc.c:126 +msgid "Code 128C" +msgstr "" + +#: src/bc.c:129 +msgid "Code 128B" +msgstr "" + +#: src/bc.c:132 +msgid "Interleaved 2 of 5" +msgstr "" + +#: src/bc.c:135 +msgid "Codabar" +msgstr "" + +#: src/bc.c:138 +msgid "MSI" +msgstr "" + +#: src/bc.c:141 +msgid "Plessey" +msgstr "" + +#: src/label.c:569 +msgid "Untitled" +msgstr "" + +#: src/xml-label.c:176 src/xml-label.c:213 +msgid "xmlParseFile error" +msgstr "b³±d przetwarzania pliku xml" + +#: src/xml-label.c:250 +msgid "No document root" +msgstr "Brak g³ównego dokumentu" + +#: src/xml-label.c:264 +msgid "Importing from glabels 0.1 format" +msgstr "" + +#: src/xml-label.c:272 +msgid "Importing from glabels 0.4 format" +msgstr "" + +#: src/xml-label.c:279 +msgid "Importing from glabels 1.91 format" +msgstr "" + +#: src/xml-label.c:282 +#, fuzzy +msgid "bad document, unknown glabels Namespace" +msgstr "" +"dokument jest niepoprawnego typu, nie odnaleziono przestrzeni nazw glabels" + +#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "Niepoprawny wêze³ g³ówny = \"%s\"" + +#: src/xml-label.c:348 src/xml-label-191.c:165 +#, fuzzy, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "Niepoprawny wêze³ g³ówny = \"%s\"" + +#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 +#, c-format +msgid "bad node = \"%s\"" +msgstr "niepoprawny wêze³ = \"%s\"" + +#: src/xml-label.c:796 src/xml-label-191.c:605 +#, fuzzy, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "niepoprawny wêze³ = \"%s\"" + +#: src/xml-label.c:962 libglabels/xml-template.c:528 +msgid "Utf8 conversion error." +msgstr "" + +#: src/xml-label.c:969 libglabels/xml-template.c:535 +msgid "Problem saving xml file." +msgstr "Problem podczas zapisu pliku xml." + +#. This should always be an id, but just in case a name +#. slips by! +#: src/xml-label-191.c:680 libglabels/xml-template.c:192 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "" + +#: src/xml-label-191.c:690 libglabels/xml-template.c:202 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "" + +#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 +msgid "None" +msgstr "Brak" + +#: src/merge-init.c:53 +#, fuzzy +msgid "Text file with comma delimeters (CSV)" +msgstr "Tekst oddzielony przecinkami (CSV)" + +#: src/merge-init.c:60 +#, fuzzy +msgid "Text file with colon delimeters" +msgstr "Tekst oddzielany dwukropkami" + +#: src/merge-init.c:67 +#, fuzzy +msgid "Text file with tab delimeters" +msgstr "Tekst oddzielony tabulacjami" + +#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 +#, fuzzy +msgid "File:" +msgstr "Wype³nienie" + +#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 +msgid "Key:" +msgstr "Klucz:" + +#: src/wdgt-print-copies.c:179 +msgid "Sheets:" +msgstr "Arkusze:" + +#: src/wdgt-print-copies.c:197 +msgid "Labels" +msgstr "Etykiety" + +#: src/wdgt-print-copies.c:200 +msgid "from:" +msgstr "od:" + +#: src/wdgt-print-copies.c:207 +msgid "to:" +msgstr "do:" + +#: src/wdgt-print-merge.c:178 +msgid "Start on label" +msgstr "Rozpocznij od etykiety" + +#: src/wdgt-print-merge.c:186 +msgid "on 1st sheet" +msgstr "na pierwszym arkuszu" + +#: src/wdgt-print-merge.c:195 +msgid "Copies:" +msgstr "Kopie:" + +#: src/wdgt-print-merge.c:201 +msgid "Collate" +msgstr "Uk³adanie" + +#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 +msgid "Description:" +msgstr "Opis:" + +#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 +msgid "Page size:" +msgstr "Rozmiar strony:" + +#: src/wdgt-media-select.c:290 +msgid "Label size:" +msgstr "Rozmiar etykiety:" + +#: src/wdgt-media-select.c:301 +msgid "Layout:" +msgstr "Wygl±d:" + +#: src/wdgt-media-select.c:578 +#, c-format +msgid "%d x %d (%d per sheet)" +msgstr "%d x %d (%d na arkusz)" + +#: src/wdgt-media-select.c:582 +#, fuzzy, c-format +msgid "%d per sheet" +msgstr "%d x %d (%d na arkusz)" + +#: src/wdgt-media-select.c:614 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +#: src/wdgt-media-select.c:619 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 +#, c-format +msgid "%s %s diameter" +msgstr "" + +#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 +#, c-format +msgid "%.5g %s diameter" +msgstr "" + +#: src/wdgt-rotate-label.c:193 +msgid "Rotate" +msgstr "Obróæ" + +#. This is the default custom color +#: src/mygal/color-palette.c:396 +#, fuzzy +msgid "custom" +msgstr "W³asny klucz pola" + +#. "Custom" color - we'll pop up a GnomeColorPicker +#: src/mygal/color-palette.c:438 +#, fuzzy +msgid "Custom Color:" +msgstr "Kolor:" + +#: src/mygal/color-palette.c:446 +msgid "Choose Custom Color" +msgstr "" + +#: src/mygal/color-palette.c:579 +msgid "black" +msgstr "" + +#: src/mygal/color-palette.c:580 +msgid "light brown" +msgstr "" + +#: src/mygal/color-palette.c:581 +msgid "brown gold" +msgstr "" + +#: src/mygal/color-palette.c:582 +msgid "dark green #2" +msgstr "" + +#: src/mygal/color-palette.c:583 +msgid "navy" +msgstr "" + +#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 +msgid "dark blue" +msgstr "" + +#: src/mygal/color-palette.c:585 +msgid "purple #2" +msgstr "" + +#: src/mygal/color-palette.c:586 +msgid "very dark gray" +msgstr "" + +#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 +msgid "dark red" +msgstr "" + +#: src/mygal/color-palette.c:590 +msgid "red-orange" +msgstr "" + +#: src/mygal/color-palette.c:591 +msgid "gold" +msgstr "" + +#: src/mygal/color-palette.c:592 +msgid "dark green" +msgstr "" + +#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 +msgid "dull blue" +msgstr "" + +#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 +msgid "blue" +msgstr "" + +#: src/mygal/color-palette.c:595 +msgid "dull purple" +msgstr "" + +#: src/mygal/color-palette.c:596 +msgid "dark grey" +msgstr "" + +#: src/mygal/color-palette.c:599 +msgid "red" +msgstr "" + +#: src/mygal/color-palette.c:600 +msgid "orange" +msgstr "" + +#: src/mygal/color-palette.c:601 +msgid "lime" +msgstr "" + +#: src/mygal/color-palette.c:602 +msgid "dull green" +msgstr "" + +#: src/mygal/color-palette.c:603 +msgid "dull blue #2" +msgstr "" + +#: src/mygal/color-palette.c:604 +msgid "sky blue #2" +msgstr "" + +#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 +msgid "purple" +msgstr "" + +#: src/mygal/color-palette.c:606 +msgid "gray" +msgstr "" + +#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 +#, fuzzy +msgid "magenta" +msgstr "Obraz" + +#: src/mygal/color-palette.c:610 +msgid "bright orange" +msgstr "" + +#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 +msgid "yellow" +msgstr "" + +#: src/mygal/color-palette.c:612 +#, fuzzy +msgid "green" +msgstr "stopni(e)" + +#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 +msgid "cyan" +msgstr "" + +#: src/mygal/color-palette.c:614 +msgid "bright blue" +msgstr "" + +#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 +msgid "red purple" +msgstr "" + +#: src/mygal/color-palette.c:616 +msgid "light grey" +msgstr "" + +#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 +msgid "pink" +msgstr "" + +#: src/mygal/color-palette.c:620 +msgid "light orange" +msgstr "" + +#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 +msgid "light yellow" +msgstr "" + +#: src/mygal/color-palette.c:622 +msgid "light green" +msgstr "" + +#: src/mygal/color-palette.c:623 +msgid "light cyan" +msgstr "" + +#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 +msgid "light blue" +msgstr "" + +#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 +msgid "light purple" +msgstr "" + +#: src/mygal/color-palette.c:626 +msgid "white" +msgstr "" + +#: src/mygal/color-palette.c:631 +msgid "purplish blue" +msgstr "" + +#: src/mygal/color-palette.c:635 +msgid "dark purple" +msgstr "" + +#: src/mygal/color-palette.c:637 +msgid "sky blue" +msgstr "" + +#: libglabels/template.c:848 +#, c-format +msgid "Generic %s full page" +msgstr "" + +#: libglabels/template.c:897 +msgid "No template files found!" +msgstr "Nie znaleziono pliku szablonu!" + +#. Create and append an "Other" entry. +#: libglabels/paper.c:67 +msgid "Other" +msgstr "" + +#: libglabels/paper.c:361 +#, fuzzy +msgid "No paper files found!" +msgstr "Nie znaleziono pliku szablonu!" + +#: data/ui/glabels-ui.xml.h:1 +msgid "About glabels" +msgstr "" + +#: data/ui/glabels-ui.xml.h:2 +msgid "About..." +msgstr "" + +#: data/ui/glabels-ui.xml.h:3 +msgid "Align _Horizontal" +msgstr "" + +#: data/ui/glabels-ui.xml.h:4 +msgid "Align _Vertical" +msgstr "" + +#: data/ui/glabels-ui.xml.h:5 +msgid "Align objects to bottoms" +msgstr "" + +#: data/ui/glabels-ui.xml.h:6 +msgid "Align objects to horizontal centers" +msgstr "" + +#: data/ui/glabels-ui.xml.h:7 +msgid "Align objects to left edges" +msgstr "" + +#: data/ui/glabels-ui.xml.h:8 +msgid "Align objects to right edges" +msgstr "" + +#: data/ui/glabels-ui.xml.h:9 +msgid "Align objects to tops" +msgstr "" + +#: data/ui/glabels-ui.xml.h:10 +msgid "Align objects to vertical centers" +msgstr "" + +#: data/ui/glabels-ui.xml.h:12 +msgid "Bold" +msgstr "" + +#: data/ui/glabels-ui.xml.h:14 +#, fuzzy +msgid "Center align" +msgstr "Ogólne" + +#: data/ui/glabels-ui.xml.h:15 +msgid "Center objects to horizontal label center" +msgstr "" + +#: data/ui/glabels-ui.xml.h:16 +msgid "Center objects to vertical label center" +msgstr "" + +#: data/ui/glabels-ui.xml.h:17 +msgid "Change the visibility of markup lines in the current window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:18 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:19 +msgid "Change the visibility of the grid in the current window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:20 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:21 +msgid "Change the visibility of the property toolbar in the current window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:22 +msgid "Close" +msgstr "" + +#: data/ui/glabels-ui.xml.h:23 +#, fuzzy +msgid "Close the current file" +msgstr "Zapisuje bie¿±cy plik" + +#: data/ui/glabels-ui.xml.h:24 +msgid "Configure the application" +msgstr "" + +#: data/ui/glabels-ui.xml.h:25 +msgid "Contents" +msgstr "" + +#: data/ui/glabels-ui.xml.h:26 +msgid "Copy" +msgstr "" + +#: data/ui/glabels-ui.xml.h:27 +#, fuzzy +msgid "Copy the selection" +msgstr "Usuwa wszelkie zaznaczenia" + +#: data/ui/glabels-ui.xml.h:28 +#, fuzzy +msgid "Create a custom template" +msgstr "Tworzy liniê" + +#: data/ui/glabels-ui.xml.h:29 +#, fuzzy +msgid "Create a new document" +msgstr "Tworzy liniê" + +#: data/ui/glabels-ui.xml.h:30 +msgid "Create barcode object" +msgstr "Tworzy kod paskowy" + +#: data/ui/glabels-ui.xml.h:31 +msgid "Create box/rectangle object" +msgstr "Tworzy skrzynkê/prostok±t" + +#: data/ui/glabels-ui.xml.h:32 +msgid "Create ellipse/circle object" +msgstr "Tworzy elipsê/okr±g" + +#: data/ui/glabels-ui.xml.h:33 +msgid "Create image object" +msgstr "Tworzy obraz" + +#: data/ui/glabels-ui.xml.h:34 +msgid "Create line object" +msgstr "Tworzy liniê" + +#: data/ui/glabels-ui.xml.h:35 +msgid "Create text object" +msgstr "Tworzy obiekt tekstowy" + +#: data/ui/glabels-ui.xml.h:36 +msgid "Cu_t" +msgstr "" + +#: data/ui/glabels-ui.xml.h:37 +#, fuzzy +msgid "Customize" +msgstr "W³asny klucz pola" + +#: data/ui/glabels-ui.xml.h:38 +msgid "Customize Drawing Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:39 +msgid "Customize Main Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:40 +msgid "Customize Property Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:41 +msgid "Customize toolbars" +msgstr "" + +#: data/ui/glabels-ui.xml.h:42 +msgid "Cut" +msgstr "" + +#: data/ui/glabels-ui.xml.h:43 +msgid "Cut the selection" +msgstr "" + +#: data/ui/glabels-ui.xml.h:44 +msgid "Decrease magnification" +msgstr "" + +#: data/ui/glabels-ui.xml.h:45 +msgid "Delete" +msgstr "Usuñ" + +#: data/ui/glabels-ui.xml.h:46 +#, fuzzy +msgid "Delete the selected objects" +msgstr "Tworzy obiekt tekstowy" + +#: data/ui/glabels-ui.xml.h:47 +msgid "Drawing toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:48 +msgid "Dump XML" +msgstr "" + +#: data/ui/glabels-ui.xml.h:49 +msgid "Dump the UI Xml description" +msgstr "" + +#: data/ui/glabels-ui.xml.h:50 +msgid "Edit merge properties" +msgstr "Modyfikuje w³a¶ciwo¶ci z³±czania" + +#: data/ui/glabels-ui.xml.h:54 +msgid "Flip object horizontally" +msgstr "" + +#: data/ui/glabels-ui.xml.h:55 +msgid "Flip object vertically" +msgstr "" + +#: data/ui/glabels-ui.xml.h:56 +#, fuzzy +msgid "Font name" +msgstr "Nie zapisuj" + +#: data/ui/glabels-ui.xml.h:57 +#, fuzzy +msgid "Font selector" +msgstr "Usuwa wszelkie zaznaczenia" + +#: data/ui/glabels-ui.xml.h:58 +#, fuzzy +msgid "Font size" +msgstr "Nie zapisuj" + +#: data/ui/glabels-ui.xml.h:59 +msgid "Icon and _Text" +msgstr "" + +#: data/ui/glabels-ui.xml.h:60 +msgid "Increase magnification" +msgstr "" + +#: data/ui/glabels-ui.xml.h:61 +msgid "Italic" +msgstr "" + +#: data/ui/glabels-ui.xml.h:63 +msgid "Left align" +msgstr "" + +#: data/ui/glabels-ui.xml.h:65 +msgid "Line width" +msgstr "" + +#: data/ui/glabels-ui.xml.h:66 +msgid "Lower object to bottom" +msgstr "" + +#: data/ui/glabels-ui.xml.h:67 +msgid "M_arkup" +msgstr "" + +#: data/ui/glabels-ui.xml.h:68 +msgid "Main toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:69 +msgid "Markup" +msgstr "" + +#: data/ui/glabels-ui.xml.h:70 +#, fuzzy +msgid "Modify document properties" +msgstr "Modyfikacja w³a¶ciwo¶ci z³±czania dokumentów" + +#: data/ui/glabels-ui.xml.h:71 +#, fuzzy +msgid "New" +msgstr "_Nowa" + +#: data/ui/glabels-ui.xml.h:72 +#, fuzzy +msgid "Object property editor" +msgstr "W³a¶ciwo¶ci tekstu" + +#: data/ui/glabels-ui.xml.h:73 +msgid "Only show icons in the drawing toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:74 +msgid "Only show icons in the main toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:76 +msgid "Open a file" +msgstr "Otwiera plik" + +#: data/ui/glabels-ui.xml.h:77 +#, fuzzy +msgid "Open the glabels manual" +msgstr "Otwórz etykietê" + +#: data/ui/glabels-ui.xml.h:78 +msgid "Paste" +msgstr "" + +#: data/ui/glabels-ui.xml.h:79 +msgid "Paste the clipboard" +msgstr "" + +#: data/ui/glabels-ui.xml.h:80 +#, fuzzy +msgid "Pr_eferences..." +msgstr "Glabels: Preferencje" + +#: data/ui/glabels-ui.xml.h:81 +#, fuzzy +msgid "Preferences" +msgstr "Glabels: Preferencje" + +#: data/ui/glabels-ui.xml.h:83 +#, fuzzy +msgid "Print the current file" +msgstr "Drukuje bie¿±cy plik" + +#: data/ui/glabels-ui.xml.h:84 +#, fuzzy +msgid "Proper_ties..." +msgstr "W³a¶ciwo¶ci tekstu" + +#: data/ui/glabels-ui.xml.h:85 +#, fuzzy +msgid "Properties" +msgstr "W³a¶ciwo¶ci tekstu" + +#: data/ui/glabels-ui.xml.h:86 +msgid "Property toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:87 +msgid "Quit" +msgstr "" + +#: data/ui/glabels-ui.xml.h:88 +msgid "Quit the program" +msgstr "" + +#: data/ui/glabels-ui.xml.h:89 +msgid "Raise object to top" +msgstr "" + +#: data/ui/glabels-ui.xml.h:90 +msgid "Recent _Files" +msgstr "" + +#: data/ui/glabels-ui.xml.h:91 +msgid "Redo" +msgstr "" + +#: data/ui/glabels-ui.xml.h:92 +msgid "Redo the undone action" +msgstr "" + +#: data/ui/glabels-ui.xml.h:93 +msgid "Remove all selections" +msgstr "Usuwa wszelkie zaznaczenia" + +#: data/ui/glabels-ui.xml.h:95 +#, no-c-format +msgid "Restore scale to 100%" +msgstr "" + +#: data/ui/glabels-ui.xml.h:96 +msgid "Right align" +msgstr "" + +#: data/ui/glabels-ui.xml.h:99 +msgid "Rotate object 90 clockwise" +msgstr "" + +#: data/ui/glabels-ui.xml.h:100 +msgid "Rotate object 90 counter-clockwise" +msgstr "" + +#: data/ui/glabels-ui.xml.h:101 +#, fuzzy +msgid "Save" +msgstr "Zapisz jako" + +#: data/ui/glabels-ui.xml.h:102 +msgid "Save As" +msgstr "Zapisz jako" + +#: data/ui/glabels-ui.xml.h:103 +#, fuzzy +msgid "Save _As..." +msgstr "Zapisz jako" + +#: data/ui/glabels-ui.xml.h:104 +#, fuzzy +msgid "Save the current file" +msgstr "Zapisuje bie¿±cy plik" + +#: data/ui/glabels-ui.xml.h:105 +msgid "Save the current file with a different name" +msgstr "" + +#: data/ui/glabels-ui.xml.h:106 +#, fuzzy +msgid "Select All" +msgstr "O_dznacz wszystko" + +#: data/ui/glabels-ui.xml.h:107 +#, fuzzy +msgid "Select _All" +msgstr "O_dznacz wszystko" + +#: data/ui/glabels-ui.xml.h:108 +#, fuzzy +msgid "Select all objects" +msgstr "Wybierz, przeno¶ i modyfikuj obiekty" + +#: data/ui/glabels-ui.xml.h:109 +msgid "Select, move and modify objects" +msgstr "Wybierz, przeno¶ i modyfikuj obiekty" + +#: data/ui/glabels-ui.xml.h:111 +msgid "Set drawing toolbar button style according to desktop default" +msgstr "" + +#: data/ui/glabels-ui.xml.h:112 +msgid "Set main toolbar button style according to desktop default" +msgstr "" + +#: data/ui/glabels-ui.xml.h:113 +msgid "Show _Tooltips" +msgstr "" + +#: data/ui/glabels-ui.xml.h:114 +msgid "Show both icons and texts in the drawing toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:115 +msgid "Show both icons and texts in the main toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:116 +msgid "Show tooltips in the drawing toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:117 +msgid "Show tooltips in the main toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:118 +msgid "Show tooltips in the property toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:119 +msgid "Template Designer" +msgstr "" + +#: data/ui/glabels-ui.xml.h:120 +msgid "Template _Designer..." +msgstr "" + +#: data/ui/glabels-ui.xml.h:121 +msgid "Text color" +msgstr "" + +#: data/ui/glabels-ui.xml.h:122 +#, fuzzy +msgid "U_n-select All" +msgstr "O_dznacz wszystko" + +#: data/ui/glabels-ui.xml.h:123 +#, fuzzy +msgid "Un-select All" +msgstr "O_dznacz wszystko" + +#: data/ui/glabels-ui.xml.h:124 +msgid "Undo" +msgstr "" + +#: data/ui/glabels-ui.xml.h:125 +msgid "Undo the last action" +msgstr "" + +#: data/ui/glabels-ui.xml.h:126 +#, fuzzy +msgid "Zoom _1:1" +msgstr "Powiêkszenie 1:1" + +#: data/ui/glabels-ui.xml.h:127 +#, fuzzy +msgid "Zoom _In" +msgstr "Powiêksz" + +#: data/ui/glabels-ui.xml.h:128 +#, fuzzy +msgid "Zoom _Out" +msgstr "Pomniejsz" + +#: data/ui/glabels-ui.xml.h:129 +#, fuzzy +msgid "Zoom to _fit" +msgstr "Powiêksza 1:1" + +#: data/ui/glabels-ui.xml.h:130 +msgid "Zoom to fit window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:131 +msgid "_About..." +msgstr "" + +#: data/ui/glabels-ui.xml.h:132 +msgid "_Bottoms" +msgstr "" + +#: data/ui/glabels-ui.xml.h:135 +msgid "_Close" +msgstr "" + +#: data/ui/glabels-ui.xml.h:136 +msgid "_Contents" +msgstr "" + +#: data/ui/glabels-ui.xml.h:137 +msgid "_Copy" +msgstr "" + +#: data/ui/glabels-ui.xml.h:138 +#, fuzzy +msgid "_Create Object" +msgstr "Tworzy obiekt tekstowy" + +#: data/ui/glabels-ui.xml.h:139 +msgid "_Debug" +msgstr "" + +#: data/ui/glabels-ui.xml.h:141 +msgid "_Desktop Default" +msgstr "" + +#: data/ui/glabels-ui.xml.h:142 +msgid "_Drawing Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:143 +msgid "_Edit" +msgstr "" + +#: data/ui/glabels-ui.xml.h:145 +#, fuzzy +msgid "_File" +msgstr "Wype³nienie" + +#: data/ui/glabels-ui.xml.h:146 +msgid "_Grid" +msgstr "" + +#: data/ui/glabels-ui.xml.h:147 +msgid "_Help" +msgstr "" + +#: data/ui/glabels-ui.xml.h:148 +msgid "_Icon" +msgstr "" + +#: data/ui/glabels-ui.xml.h:152 +msgid "_Main Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:153 +#, fuzzy +msgid "_Merge Properties..." +msgstr "W³a¶ciwo¶ci z³±czania" + +#: data/ui/glabels-ui.xml.h:154 +msgid "_New" +msgstr "_Nowa" + +#: data/ui/glabels-ui.xml.h:155 +msgid "_Objects" +msgstr "" + +#: data/ui/glabels-ui.xml.h:156 +#, fuzzy +msgid "_Open..." +msgstr "Otwórz" + +#: data/ui/glabels-ui.xml.h:158 +msgid "_Paste" +msgstr "" + +#: data/ui/glabels-ui.xml.h:159 +#, fuzzy +msgid "_Print..." +msgstr "Wydrukuj" + +#: data/ui/glabels-ui.xml.h:160 +msgid "_Property Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:161 +msgid "_Quit" +msgstr "" + +#: data/ui/glabels-ui.xml.h:164 +#, fuzzy +msgid "_Save" +msgstr "Zapisz jako" + +#: data/ui/glabels-ui.xml.h:168 +#, fuzzy +msgid "_View" +msgstr "_Nowa" + +#: data/glade/prefs-dialog.glade.h:1 +msgid " " +msgstr "" + +#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 +#: data/glade/template-designer.glade.h:5 +msgid "*" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:3 +msgid "Default page size" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:4 +msgid "Fill" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:5 +msgid "Line" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:6 +msgid "Text" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:7 +msgid "Units" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 +msgid "Alignment:" +msgstr "Wyrównanie:" + +#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 +msgid "Color:" +msgstr "Kolor:" + +#: data/glade/prefs-dialog.glade.h:10 +msgid "Font:" +msgstr "Czcionka:" + +#: data/glade/prefs-dialog.glade.h:11 +msgid "ISO A4" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:12 +msgid "Inches" +msgstr "Cale" + +#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 +msgid "Line Spacing:" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:14 +#, fuzzy +msgid "Locale" +msgstr "Skala" + +#: data/glade/prefs-dialog.glade.h:15 +msgid "Millimeters" +msgstr "Milimetry" + +#: data/glade/prefs-dialog.glade.h:16 +msgid "Object defaults" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:17 +msgid "Points" +msgstr "Punkty" + +#: data/glade/prefs-dialog.glade.h:18 +msgid "Select default properties for new objects." +msgstr "" + +#: data/glade/prefs-dialog.glade.h:19 +msgid "Select locale specific behavior." +msgstr "" + +#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:25 +msgid "US Letter" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 +#: data/glade/template-designer.glade.h:72 +msgid "Width:" +msgstr "Szeroko¶æ:" + +#: data/glade/object-editor.glade.h:2 +msgid "00000000000 00000" +msgstr "" + +#: data/glade/object-editor.glade.h:3 +msgid "Xxx object properties" +msgstr "" + +#: data/glade/object-editor.glade.h:5 +msgid "Allow merge to automatically shrink text" +msgstr "" + +#: data/glade/object-editor.glade.h:6 +msgid "Angle:" +msgstr "K±t" + +#: data/glade/object-editor.glade.h:7 +msgid "Checksum" +msgstr "" + +#: data/glade/object-editor.glade.h:10 +#, fuzzy +msgid "Family:" +msgstr "Wype³nienie" + +#: data/glade/object-editor.glade.h:12 +msgid "Fill" +msgstr "Wype³nienie" + +#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 +msgid "Height:" +msgstr "Wysoko¶æ:" + +#: data/glade/object-editor.glade.h:14 +msgid "Image" +msgstr "Obraz" + +#: data/glade/object-editor.glade.h:15 +msgid "Insert merge field" +msgstr "Wstaw pole z³±czenia" + +#: data/glade/object-editor.glade.h:17 +msgid "Length:" +msgstr "D³ugo¶æ:" + +#: data/glade/object-editor.glade.h:18 +msgid "Line" +msgstr "Linia" + +#: data/glade/object-editor.glade.h:20 +msgid "Literal:" +msgstr "Litera³:" + +#: data/glade/object-editor.glade.h:21 +msgid "Load image" +msgstr "" + +#: data/glade/object-editor.glade.h:22 +msgid "Position" +msgstr "Pozycja" + +#: data/glade/object-editor.glade.h:23 +msgid "Reset image size" +msgstr "Wyzeruj rozmiar obrazu" + +#: data/glade/object-editor.glade.h:24 +msgid "Size" +msgstr "Rozmiar" + +#: data/glade/object-editor.glade.h:25 +#, fuzzy +msgid "Size:" +msgstr "Rozmiar" + +#: data/glade/object-editor.glade.h:26 +#, fuzzy +msgid "Style" +msgstr "Styl" + +#: data/glade/object-editor.glade.h:27 +#, fuzzy +msgid "Style:" +msgstr "Styl" + +#: data/glade/object-editor.glade.h:30 +msgid "X:" +msgstr "X:" + +#: data/glade/object-editor.glade.h:31 +msgid "Y:" +msgstr "Y:" + +#: data/glade/object-editor.glade.h:32 +msgid "degrees" +msgstr "stopni(e)" + +#: data/glade/object-editor.glade.h:33 +msgid "dialog1" +msgstr "" + +#: data/glade/object-editor.glade.h:34 +msgid "digits:" +msgstr "" + +#: data/glade/object-editor.glade.h:35 +#, fuzzy +msgid "format:" +msgstr "Format:" + +#: data/glade/template-designer.glade.h:1 +msgid " " +msgstr "" + +#: data/glade/template-designer.glade.h:2 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "" + +#: data/glade/template-designer.glade.h:3 +msgid "(e.g., 8163A)" +msgstr "" + +#: data/glade/template-designer.glade.h:4 +msgid "(e.g., Avery, Acme, ...)" +msgstr "" + +#: data/glade/template-designer.glade.h:6 +msgid "1. Outer radius:" +msgstr "" + +#: data/glade/template-designer.glade.h:7 +msgid "1. Radius:" +msgstr "" + +#: data/glade/template-designer.glade.h:8 +#, fuzzy +msgid "1. Width:" +msgstr "Szeroko¶æ:" + +#: data/glade/template-designer.glade.h:9 +#, fuzzy +msgid "2. Height:" +msgstr "Wysoko¶æ:" + +#: data/glade/template-designer.glade.h:10 +msgid "2. Inner radius:" +msgstr "" + +#: data/glade/template-designer.glade.h:11 +msgid "2. Waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:12 +msgid "3. Clipping width:" +msgstr "" + +#: data/glade/template-designer.glade.h:13 +msgid "3. Margin" +msgstr "" + +#: data/glade/template-designer.glade.h:14 +msgid "3. Round (radius of corner):" +msgstr "" + +#: data/glade/template-designer.glade.h:15 +msgid "4. Clipping height:" +msgstr "" + +#: data/glade/template-designer.glade.h:16 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:17 +msgid "5. Vert. waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:18 +msgid "5. Waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:19 +msgid "6. Margin" +msgstr "" + +#: data/glade/template-designer.glade.h:20 +msgid "Brand/Manufacturer:" +msgstr "" + +#: data/glade/template-designer.glade.h:21 +msgid "CD/DVD (including credit card CDs)" +msgstr "" + +#: data/glade/template-designer.glade.h:22 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "" + +#: data/glade/template-designer.glade.h:30 +msgid "Design Completed" +msgstr "" + +#: data/glade/template-designer.glade.h:31 +msgid "Distance from left edge (x0):" +msgstr "" + +#: data/glade/template-designer.glade.h:32 +msgid "Distance from top edge (y0):" +msgstr "" + +#: data/glade/template-designer.glade.h:34 +msgid "Horizontal pitch (dx):" +msgstr "" + +#: data/glade/template-designer.glade.h:35 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" + +#: data/glade/template-designer.glade.h:40 +msgid "Label Size (CD/DVD)" +msgstr "" + +#: data/glade/template-designer.glade.h:41 +#, fuzzy +msgid "Label Size (Round)" +msgstr "Rozmiar etykiety:" + +#: data/glade/template-designer.glade.h:42 +#, fuzzy +msgid "Label or Card Shape" +msgstr "Nowa etykieta lub karta" + +#: data/glade/template-designer.glade.h:43 +msgid "Label or Card Size (Rectangular)" +msgstr "" + +#: data/glade/template-designer.glade.h:44 +#, fuzzy +msgid "Layout #1" +msgstr "Wygl±d:" + +#: data/glade/template-designer.glade.h:45 +#, fuzzy +msgid "Layout #2" +msgstr "Wygl±d:" + +#: data/glade/template-designer.glade.h:46 +#, fuzzy +msgid "Layout(s)" +msgstr "Wygl±d:" + +#: data/glade/template-designer.glade.h:47 +#, fuzzy +msgid "Name and Description" +msgstr "Opis:" + +#: data/glade/template-designer.glade.h:48 +msgid "Number across (nx):" +msgstr "" + +#: data/glade/template-designer.glade.h:49 +msgid "Number down (ny):" +msgstr "" + +#: data/glade/template-designer.glade.h:50 +msgid "Number of Layouts" +msgstr "" + +#: data/glade/template-designer.glade.h:51 +msgid "Number of layouts:" +msgstr "" + +#: data/glade/template-designer.glade.h:52 +#, fuzzy +msgid "Page Size" +msgstr "Rozmiar strony:" + +#: data/glade/template-designer.glade.h:54 +msgid "Part #:" +msgstr "" + +#: data/glade/template-designer.glade.h:55 +msgid "" +"Please enter the following identifying information about the template " +"stationery." +msgstr "" + +#: data/glade/template-designer.glade.h:56 +msgid "Please enter the following layout information." +msgstr "" + +#: data/glade/template-designer.glade.h:57 +msgid "" +"Please enter the following size parameters of a single label in your " +"template." +msgstr "" + +#: data/glade/template-designer.glade.h:58 +msgid "" +"Please enter the following size parameters of a single label or card in your " +"template." +msgstr "" + +#: data/glade/template-designer.glade.h:59 +msgid "Please select the basic shape of the labels or cards." +msgstr "" + +#: data/glade/template-designer.glade.h:60 +msgid "Please select the page size of the template stationery." +msgstr "" + +#: data/glade/template-designer.glade.h:61 +#, fuzzy +msgid "Print test sheet" +msgstr "na pierwszym arkuszu" + +#: data/glade/template-designer.glade.h:62 +msgid "Rectangular or square (can have rounded corners)" +msgstr "" + +#: data/glade/template-designer.glade.h:63 +msgid "Round" +msgstr "" + +#: data/glade/template-designer.glade.h:64 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" + +#: data/glade/template-designer.glade.h:66 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" + +#: data/glade/template-designer.glade.h:68 +msgid "Vertical pitch (dy):" +msgstr "" + +#: data/glade/template-designer.glade.h:69 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" + +#: data/templates/paper-sizes.xml.h:1 +msgid "A0" +msgstr "" + +#: data/templates/paper-sizes.xml.h:2 +msgid "A1" +msgstr "" + +#: data/templates/paper-sizes.xml.h:3 +msgid "A10" +msgstr "" + +#: data/templates/paper-sizes.xml.h:4 +msgid "A2" +msgstr "" + +#: data/templates/paper-sizes.xml.h:5 +msgid "A3" +msgstr "" + +#: data/templates/paper-sizes.xml.h:6 +msgid "A4" +msgstr "" + +#: data/templates/paper-sizes.xml.h:7 +msgid "A5" +msgstr "" + +#: data/templates/paper-sizes.xml.h:8 +msgid "A6" +msgstr "" + +#: data/templates/paper-sizes.xml.h:9 +msgid "A7" +msgstr "" + +#: data/templates/paper-sizes.xml.h:10 +msgid "A8" +msgstr "" + +#: data/templates/paper-sizes.xml.h:11 +msgid "A9" +msgstr "" + +#: data/templates/paper-sizes.xml.h:12 +msgid "B0" +msgstr "" + +#: data/templates/paper-sizes.xml.h:13 +msgid "B1" +msgstr "" + +#: data/templates/paper-sizes.xml.h:14 +msgid "B10" +msgstr "" + +#: data/templates/paper-sizes.xml.h:15 +msgid "B2" +msgstr "" + +#: data/templates/paper-sizes.xml.h:16 +msgid "B3" +msgstr "" + +#: data/templates/paper-sizes.xml.h:17 +msgid "B4" +msgstr "" + +#: data/templates/paper-sizes.xml.h:18 +msgid "B5" +msgstr "" + +#: data/templates/paper-sizes.xml.h:19 +msgid "B6" +msgstr "" + +#: data/templates/paper-sizes.xml.h:20 +msgid "B7" +msgstr "" + +#: data/templates/paper-sizes.xml.h:21 +msgid "B8" +msgstr "" + +#: data/templates/paper-sizes.xml.h:22 +msgid "B9" +msgstr "" + +#: data/templates/paper-sizes.xml.h:23 +msgid "US Executive" +msgstr "" + +#: data/templates/paper-sizes.xml.h:24 +msgid "US Legal" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:1 +#: data/templates/zweckform-iso-templates.xml.h:1 +msgid "Address Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:2 +#: data/templates/avery-iso-templates.xml.h:2 +#: data/templates/zweckform-iso-templates.xml.h:3 +#: data/templates/misc-us-templates.xml.h:2 +#: data/templates/misc-iso-templates.xml.h:9 +msgid "Business Cards" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:3 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:4 +msgid "Diskette Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:5 +#, fuzzy +msgid "Filing Labels" +msgstr "Etykiety" + +#: data/templates/avery-us-templates.xml.h:6 +msgid "Full Sheet Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:7 +#, fuzzy +msgid "Large Round Labels" +msgstr "Rozpocznij od etykiety" + +#: data/templates/avery-us-templates.xml.h:8 +msgid "Name Badge Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:9 +msgid "Return Address Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:10 +msgid "Shipping Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:11 +#, fuzzy +msgid "Small Round Labels" +msgstr "Rozpocznij od etykiety" + +#: data/templates/avery-us-templates.xml.h:12 +#, fuzzy +msgid "Square Labels" +msgstr "Etykiety" + +#: data/templates/avery-us-templates.xml.h:13 +msgid "Video Tape Face Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:14 +msgid "Video Tape Spine Labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:1 +msgid "Address labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:3 +msgid "CD Booklet" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:4 +msgid "CD Inlet" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:5 +#: data/templates/zweckform-iso-templates.xml.h:4 +#: data/templates/misc-us-templates.xml.h:4 +#: data/templates/misc-iso-templates.xml.h:10 +#, fuzzy +msgid "CD/DVD Labels" +msgstr "Etykiety" + +#: data/templates/avery-iso-templates.xml.h:6 +msgid "Diskette labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:7 +#: data/templates/zweckform-iso-templates.xml.h:7 +#: data/templates/misc-iso-templates.xml.h:17 +msgid "Mailing Labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:8 +#, fuzzy +msgid "Mailing labels" +msgstr "Etykiety" + +#: data/templates/avery-iso-templates.xml.h:9 +msgid "Mini Address Labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:10 +#, fuzzy +msgid "Shipping labels" +msgstr "Otwórz etykietê" + +#: data/templates/zweckform-iso-templates.xml.h:2 +msgid "Allround Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:5 +msgid "Correction and Cover-up Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:6 +msgid "Lever Arch File Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:8 +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:9 +msgid "Rectangular Copier Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:10 +#: data/templates/misc-iso-templates.xml.h:22 +msgid "Rectangular Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:11 +msgid "Video Labels (back)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:1 +msgid "Business Card CD" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:3 +msgid "CD Template Rectangles" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:5 +msgid "CD/DVD Labels (Face Only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:6 +#: data/templates/misc-iso-templates.xml.h:11 +msgid "CD/DVD Labels (face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:7 +#, fuzzy +msgid "DLT Labels" +msgstr "Etykiety" + +#: data/templates/misc-us-templates.xml.h:8 +msgid "Microtube labels" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:9 +msgid "Mini-CD Labels" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:10 +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:11 +msgid "PRO CD Labels 2-up (Face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:12 +#: data/templates/misc-iso-templates.xml.h:21 +msgid "PRO CD Labels 2-up (face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:13 +msgid "Slimline CD Case (rightside up)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:14 +msgid "Slimline CD Case (upside down)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:1 +msgid "Agipa 119488: Business Cards" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:2 +msgid "Allround Labels --24" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:3 +msgid "Allround Labels --44" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:4 +msgid "Allround Labels --64" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:5 +msgid "Allround Labels --65" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:6 +msgid "Arch File Labels" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:7 +msgid "Arch File Labels (large)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:8 +msgid "Arch File Labels (small)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:12 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:13 +msgid "Diskette Labels (face only)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:14 +msgid "EPSON Photo Stickers 16" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:15 +msgid "Etiketten" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:16 +msgid "Fridge Magnet Stickers" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:18 +msgid "Mailing Labels --14" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:19 +msgid "Mailing Labels-2 columns" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:20 +msgid "Mailing Labels-3 columns" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:23 +msgid "Video Labels (face only)" +msgstr "" + +#: data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers." +msgstr "" + +#: data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "" + +#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 +#, fuzzy +msgid "gLabels Project File" +msgstr "W³a¶ciwo¶ci tekstu" + +#, fuzzy +#~ msgid "Object _Properties..." +#~ msgstr "W³a¶ciwo¶ci tekstu" + +#~ msgid "Display units" +#~ msgstr "Jednostki wy¶wietlania" + +#~ msgid "Default page size" +#~ msgstr "Domy¶lny rozmiar strony" + +#~ msgid "Outline" +#~ msgstr "Ramka" + +#~ msgid "Edit line object properties" +#~ msgstr "Modyfikacja w³a¶ciwo¶ci linii" + +#~ msgid "Edit text object properties" +#~ msgstr "Modyfikacja w³a¶ciowo¶ci tekstu" + +#~ msgid "Maintain current aspect ratio" +#~ msgstr "Utrzymywanie aktualnych proporcji" + +#, fuzzy +#~ msgid "CD Labels" +#~ msgstr "Etykiety" + +#, fuzzy +#~ msgid "Open %s" +#~ msgstr "Otwórz" + +#~ msgid "Revert to saved copy of %s?" +#~ msgstr "Przywróciæ zapisan± kopiê pliku %s?" + +#~ msgid "Unknown media type. Using default." +#~ msgstr "Nieznany typ no¶nika. U¿yto warto¶ci domy¶lnych." + +#~ msgid "" +#~ "``%s'' has been modified.\n" +#~ "\n" +#~ "Do you wish to save it?" +#~ msgstr "" +#~ "Plik \"%s\" zosta³ zmodyfikowany.\n" +#~ "\n" +#~ "Czy chcesz go zapisaæ?" + +#~ msgid "Close / Save label as" +#~ msgstr "Zamyka / Zapisuje etykietê jako" + +#~ msgid "Label no longer valid!" +#~ msgstr "Etykieta nie jest ju¿ poprawna!" + +#~ msgid "Error writing file" +#~ msgstr "B³±d podczas zapisu pliku" + +#~ msgid "Edit properties..." +#~ msgstr "Modyfikuj w³a¶ciwo¶ci..." + +#~ msgid "Appearance" +#~ msgstr "Wygl±d" + +#~ msgid "Position/Size" +#~ msgstr "Pozycja/Rozmiar" + +#~ msgid "Image format not currently supported" +#~ msgstr "Format obrazu aktualnie nie jest obs³ugiwany" + +#~ msgid "Barcode data" +#~ msgstr "Dane kodu paskowego" + +#~ msgid "%" +#~ msgstr "%" + +#~ msgid "Show text with barcode" +#~ msgstr "Wy¶wietlanie tekstu z kodem paskowym" + +#~ msgid "Fields" +#~ msgstr "Pola" + +#~ msgid "Column" +#~ msgstr "Kolumna" + +#~ msgid "Sample data" +#~ msgstr "Próbne dane" + +#~ msgid "Make a new, empty label" +#~ msgstr "Tworzy now±, pust± etykietê" + +#~ msgid " New " +#~ msgstr " Nowa " + +#~ msgid "New Label/Card" +#~ msgstr "Nowa Etykieta/Karta" + +#~ msgid " Open " +#~ msgstr " Otwórz " + +#~ msgid " Save " +#~ msgstr " Zapisz " + +#~ msgid " Print " +#~ msgstr " Wydrukuj " + +#~ msgid "Function is not implemented!" +#~ msgstr "Funkcja nie jest zaimplementowana!" diff --git a/po/pt_BR.po b/po/pt_BR.po new file mode 100644 index 00000000..2c1568eb --- /dev/null +++ b/po/pt_BR.po @@ -0,0 +1,2624 @@ +# Brazilian Portuguese translation of Glabels. +# Copyright (C) 2001 Jim Evins +# Paulo R. Ormenese , 2001. +# +msgid "" +msgstr "" +"Project-Id-Version: glabels 1.91.0\n" +"POT-Creation-Date: 2004-08-08 00:43-0400\n" +"PO-Revision-Date: 2003-01-03 23:15-0300\n" +"Last-Translator: Paulo R. Ormenese \n" +"Language-Team: Brazilian portuguese <>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/glabels.c:55 +msgid "Show view debugging messages." +msgstr "Exibe mensagens de depuração de visualização." + +#: src/glabels.c:58 +msgid "Show item debugging messages." +msgstr "Exibe mensagens de depuração de item." + +#: src/glabels.c:61 +msgid "Show printing debugging messages." +msgstr "Exibe mensagens de depuração de impressão." + +#: src/glabels.c:64 +msgid "Show prefs debugging messages." +msgstr "Exibe mensagens de depuração de preferências." + +#: src/glabels.c:67 +msgid "Show file debugging messages." +msgstr "Exibe mensagens de depuração de arquivo." + +#: src/glabels.c:70 +msgid "Show document debugging messages." +msgstr "Exibe mensagens de depuração de documeto." + +#: src/glabels.c:73 +msgid "Show template debugging messages." +msgstr "Exibe mensagens de depuração de modelo." + +#: src/glabels.c:76 +#, fuzzy +msgid "Show paper debugging messages." +msgstr "Exibe mensagens de depuração de preferências." + +#: src/glabels.c:79 +msgid "Show xml debugging messages." +msgstr "Exibe mensagens de depuração de xml." + +#: src/glabels.c:82 +msgid "Show document merge debugging messages." +msgstr "Exibe mensagens de depuração de fusão de documento." + +#: src/glabels.c:85 +msgid "Show commands debugging messages." +msgstr "Exibe mensagens de depuração de comandos." + +#: src/glabels.c:88 +msgid "Show undo debugging messages." +msgstr "Exibe mensagens de depuração de desfazer." + +#: src/glabels.c:91 +msgid "Show recent debugging messages." +msgstr "Exibe mensagens de depuração de recentes" + +#: src/glabels.c:94 +msgid "Show window debugging messages." +msgstr "Exibe mensagens de depuração de janela." + +#: src/glabels.c:97 +msgid "Show ui debugging messages." +msgstr "Exibe mensagens de depuração de ui." + +#: src/glabels.c:100 +#, fuzzy +msgid "Show property_bar debugging messages." +msgstr "Exibe mensagens de depuração de preferências." + +#: src/glabels.c:103 +msgid "Show media select widget debugging messages." +msgstr "Exibe mensagens de depuração de widget de seleção de mídia." + +#: src/glabels.c:106 +msgid "Show mini preview widget debugging messages." +msgstr "Exibe mensagens de depuração de widget de mini previsão." + +#: src/glabels.c:109 +#, fuzzy +msgid "Show pixbuf cache debugging messages." +msgstr "Exibe mensagens de depuração de visualização." + +#: src/glabels.c:112 +msgid "Show widget debugging messages." +msgstr "Exibe mensagens de depuração de widget." + +#: src/glabels.c:115 +#, fuzzy +msgid "Show object editor debugging messages." +msgstr "Exibe mensagens de depuração de recentes" + +#: src/glabels.c:118 +msgid "Turn on all debugging messages." +msgstr "Ativa todas as mensagens de depuração." + +#: src/glabels.c:187 +msgid "Could not initialize Bonobo!\n" +msgstr "Impossível inicializar Bonobo!\n" + +#: src/glabels-batch.c:48 +msgid "print this message" +msgstr "mostra esta mensagem" + +#: src/glabels-batch.c:50 +msgid "print the version of glabels-batch being used" +msgstr "mostra a versão de glabels-batch que está sendo usada" + +#: src/glabels-batch.c:52 +msgid "set output filename (default=\"output.ps\")" +msgstr "define o nome do arquivo de saída (padrão=\"output.ps\")" + +#: src/glabels-batch.c:52 +msgid "filename" +msgstr "nome_de_arquivo" + +#: src/glabels-batch.c:54 +msgid "number of sheets (default=1)" +msgstr "número de páginas (padrão=1)" + +#: src/glabels-batch.c:54 +msgid "sheets" +msgstr "páginas" + +#: src/glabels-batch.c:56 +msgid "number of copies (default=1)" +msgstr "número de cópias (padrão=1)" + +#: src/glabels-batch.c:56 +msgid "copies" +msgstr "cópias" + +#: src/glabels-batch.c:58 src/print-dialog.c:336 +msgid "print outlines (to test printer alignment)" +msgstr "imprimir contornos (testar alinhamento da impressora)" + +#: src/glabels-batch.c:60 src/print-dialog.c:344 +msgid "print in reverse (i.e. a mirror image)" +msgstr "imprimir ao contrário (como uma imagem de espelho)" + +#: src/glabels-batch.c:96 +msgid "[OPTION...] GLABELS_FILE..." +msgstr "[OPÇÃO...] ARQUIVO_GLABELS..." + +#: src/glabels-batch.c:116 +msgid "missing glabels file\n" +msgstr "faltando arquivo glabels\n" + +#: src/glabels-batch.c:157 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "impossível abrir o arquivo glabels %s\n" + +#: src/window.c:244 +msgid "(none) - gLabels" +msgstr "(sem nome) - gLabels" + +#: src/window.c:414 +msgid "(modified)" +msgstr "(modificado)" + +#: src/stock.c:65 data/ui/glabels-ui.xml.h:165 +msgid "_Select Mode" +msgstr "_Selecionar Modo" + +#: src/stock.c:66 data/ui/glabels-ui.xml.h:166 +msgid "_Text" +msgstr "_Texto" + +#: src/stock.c:67 data/ui/glabels-ui.xml.h:151 +msgid "_Line" +msgstr "_Linha" + +#: src/stock.c:68 data/ui/glabels-ui.xml.h:133 +msgid "_Box" +msgstr "_Caixa" + +#: src/stock.c:69 data/ui/glabels-ui.xml.h:144 +msgid "_Ellipse" +msgstr "_Elipse" + +#: src/stock.c:70 data/ui/glabels-ui.xml.h:149 +msgid "_Image" +msgstr "_Imagem" + +#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 +msgid "Bar_code" +msgstr "_Código barras" + +#: src/stock.c:72 +msgid "_Merge Properties" +msgstr "Propriedades de _Fusão" + +#: src/stock.c:73 +msgid "Object _Properties" +msgstr "_Propriedades de Objeto" + +#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 +msgid "Bring to _Front" +msgstr "Trazer para _Frente" + +#: src/stock.c:75 data/ui/glabels-ui.xml.h:110 +msgid "Send to _Back" +msgstr "Enviar para _trás" + +#: src/stock.c:76 data/ui/glabels-ui.xml.h:97 +msgid "Rotate _Left" +msgstr "Girar _Esquerda" + +#: src/stock.c:77 data/ui/glabels-ui.xml.h:98 +msgid "Rotate _Right" +msgstr "Girar _Direita" + +#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 +msgid "Flip _Horizontally" +msgstr "Refletir _Horizontalmente" + +#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 +msgid "Flip _Vertically" +msgstr "Refletir _Verticalmente" + +#: src/stock.c:80 data/ui/glabels-ui.xml.h:150 +msgid "_Lefts" +msgstr "_Esquerdas" + +#: src/stock.c:81 data/ui/glabels-ui.xml.h:162 +msgid "_Rights" +msgstr "_Direitas" + +#: src/stock.c:82 data/ui/glabels-ui.xml.h:134 +msgid "_Centers" +msgstr "C_entros" + +#: src/stock.c:83 data/ui/glabels-ui.xml.h:167 +msgid "_Tops" +msgstr "_Topos" + +#: src/stock.c:84 +msgid "Bottoms" +msgstr "Bases" + +#: src/stock.c:85 +msgid "Centers" +msgstr "Centros" + +#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 +msgid "Label Ce_nter" +msgstr "Ce_ntro Etiqueta" + +#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 +msgid "Fill color" +msgstr "" + +#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 +msgid "Line color" +msgstr "" + +#: src/stock.c:90 src/stock.c:92 +#, fuzzy +msgid "Linked" +msgstr "Linha" + +#: src/stock.c:91 src/stock.c:93 +#, fuzzy +msgid "Not Linked" +msgstr "Nenhum" + +#: src/ui-property-bar.c:345 src/object-editor.c:499 +#, fuzzy +msgid "Default" +msgstr "Apagar" + +#: src/ui-property-bar.c:360 src/object-editor.c:512 +msgid "No fill" +msgstr "" + +#: src/ui-property-bar.c:375 src/object-editor.c:505 +#, fuzzy +msgid "No line" +msgstr "Nenhum" + +#: src/ui-sidebar.c:180 +#, fuzzy +msgid "Object properties" +msgstr "_Propriedades de Objeto" + +#: src/commands.c:385 +msgid "" +"A label and business card creation program for GNOME.\n" +" \n" +"Glabels is free software; you can redistribute it and/or modify it under the " +"terms of the GNU General Public License as published by the Free Software " +"Foundation; either version 2 of the License, or (at your option) any later " +"version.\n" +" \n" +"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.\n" +msgstr "" +"Um programa para criação de etiquetas e cartões de negócios para o GNOME.\n" +"\n" +"Glabels é software livre; você pode redistribuí-lo e/ou modificá-lo sob os " +"termos da Licença Pública Geral GNU conforme publicada pela Free Software " +"Foundation; ou a versão 2 da Licença, ou (sob sua opção) qualquer versão " +"posterior.\n" +"\n" +"Este programa é distribuido na esperança de que seja útil, mas SEM QUALQUER " +"GARANTIA; sem mesmo as garantias implícitas de COMERCIALIZAÇÃO ou AJUSTES A " +"UM PROPÓSITO PARTICULAR. Veja a Licença Pública Geral GNU para mais " +"detalhes.\n" + +#: src/commands.c:399 +msgid "See the file AUTHORS for additional credits," +msgstr "Veja o arquivo AUTHORS para ver créditos adicionais," + +#: src/commands.c:400 +#, fuzzy +msgid "or visit http://glabels.sourceforge.net/" +msgstr "ou visite http://snaught.com/glabels" + +#: src/commands.c:409 +msgid " " +msgstr "" + +#: src/commands.c:424 +msgid "glabels" +msgstr "glabels" + +#: src/file.c:100 +msgid "New Label or Card" +msgstr "Nova Etiqueta ou Cartão" + +#: src/file.c:132 src/file.c:304 +msgid "Media Type" +msgstr "Tipo de mídia" + +#: src/file.c:138 src/file.c:310 +msgid "Label orientation" +msgstr "Orientação da etiqueta" + +#: src/file.c:269 +#, fuzzy +msgid "Label properties" +msgstr "_Propriedades de Objeto" + +#: src/file.c:452 src/file.c:870 +msgid "All files" +msgstr "" + +#: src/file.c:457 src/file.c:875 +#, fuzzy +msgid "gLabels documents" +msgstr "Preferências do gLabels" + +#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 +msgid "Empty file name selection" +msgstr "Seleção de nome de arquivo vazia" + +#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 +msgid "Please select a file or supply a valid file name" +msgstr "Por favor, selecione um arquivo ou forneça um nome de arquivo válido" + +#: src/file.c:519 src/file.c:631 +msgid "File does not exist" +msgstr "Arquivo inexistente" + +#: src/file.c:563 data/ui/glabels-ui.xml.h:75 +msgid "Open" +msgstr "Abrir" + +#: src/file.c:565 +msgid "Open label" +msgstr "Abrir etiqueta" + +#: src/file.c:707 +#, c-format +msgid "Could not open file \"%s\"" +msgstr "Impossível abrir o arquivo \"%s\"" + +#: src/file.c:715 +msgid "Not a supported file format" +msgstr "Formato de arquivo não suportado" + +#: src/file.c:797 src/file.c:979 src/file.c:1174 +#, c-format +msgid "Could not save file \"%s\"" +msgstr "Impossível salvar o arquivo \"%s\"" + +#: src/file.c:805 src/file.c:987 src/file.c:1182 +msgid "Error encountered during save. The file is still not saved." +msgstr "Erro encontrado ao salvar. O arquivo ainda não foi salvo." + +#: src/file.c:848 src/file.c:1048 +#, c-format +msgid "Save \"%s\" as" +msgstr "Salvar \"%s\" como" + +#: src/file.c:935 src/file.c:1131 +msgid "Please supply a valid file name" +msgstr "Por favor, forneça um nome de arquivo válido" + +#: src/file.c:952 src/file.c:1147 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "Sobrescrever o arquivo \"%s\"?" + +#: src/file.c:960 src/file.c:1155 +msgid "File already exists." +msgstr "O arquivo já existe." + +#: src/file.c:1271 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "Salvar modificações no documento \"%s\" antes de fechar?" + +#: src/file.c:1279 +msgid "Your changes will be lost if you don't save them." +msgstr "Suas modificações serão perdidas se você não salvá-las." + +#: src/file.c:1282 +msgid "Close without saving" +msgstr "Fechar sem salvar" + +#. Should not happen +#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 +#: data/glade/object-editor.glade.h:37 +msgid "points" +msgstr "pontos" + +#: src/prefs.c:158 data/glade/object-editor.glade.h:36 +#: data/glade/template-designer.glade.h:74 +msgid "inches" +msgstr "poleg." + +#: src/prefs.c:160 +msgid "mm" +msgstr "mm" + +#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 +msgid "gLabels Preferences" +msgstr "Preferências do gLabels" + +#. +#. * Submenu: Order +#. +#: src/view.c:3570 data/ui/glabels-ui.xml.h:157 +msgid "_Order" +msgstr "_Ordenar" + +#. +#. * Submenu: Rotate/Flip +#. +#: src/view.c:3591 data/ui/glabels-ui.xml.h:163 +msgid "_Rotate/Flip" +msgstr "_Girar/Refletir" + +#. +#. * Submenu: Align Horizontally +#. +#: src/view.c:3624 +msgid "Align _Horizontally" +msgstr "Alinhar _Horizontalmente" + +#. +#. * Submenu: Align Vertically +#. +#: src/view.c:3663 +msgid "Align _Vertically" +msgstr "Alinhar _Verticalmente" + +#: src/view.c:3724 data/ui/glabels-ui.xml.h:140 +msgid "_Delete" +msgstr "_Apagar" + +#. Build editor. +#: src/view-box.c:223 +#, fuzzy +msgid "Box object properties" +msgstr "Editar propriedades do objeto caixa" + +#. Build editor. +#: src/view-ellipse.c:223 +#, fuzzy +msgid "Ellipse object properties" +msgstr "Editar propriedades do objeto elipse" + +#. Build editor. +#: src/view-line.c:223 +#, fuzzy +msgid "Line object properties" +msgstr "Edita propriedades do objeto" + +#. Build editor. +#: src/view-image.c:222 +#, fuzzy +msgid "Image object properties" +msgstr "Editar propriedades do objeto imagem" + +#. Build editor. +#: src/view-text.c:250 +#, fuzzy +msgid "Text object properties" +msgstr "Edita propriedades do objeto" + +#: src/view-text.c:562 data/glade/object-editor.glade.h:28 +msgid "Text" +msgstr "Texto" + +#. Build editor. +#: src/view-barcode.c:209 +#, fuzzy +msgid "Barcode object properties" +msgstr "Editar propriedades do objeto código de barras" + +#: src/view-barcode.c:579 src/print.c:1088 +#, fuzzy +msgid "Invalid barcode data" +msgstr "Código de barras inválido" + +#: src/merge-properties-dialog.c:231 +msgid "Merge Properties" +msgstr "Propriedades de Fusão" + +#. ---- Source section ---- +#: src/merge-properties-dialog.c:237 +msgid "Source" +msgstr "Fonte" + +#: src/merge-properties-dialog.c:245 +msgid "Format:" +msgstr "Formato:" + +#. Location line +#: src/merge-properties-dialog.c:273 +msgid "Location:" +msgstr "Localização" + +#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 +msgid "Select merge-database source" +msgstr "Selecione a fonte da base de dados da fusão" + +#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 +msgid "N/A" +msgstr "Não definido" + +#. ---- Sample Fields section ---- +#: src/merge-properties-dialog.c:300 +msgid "Record selection/preview:" +msgstr "Seleção/previsão de registro:" + +#: src/merge-properties-dialog.c:326 +msgid "Select" +msgstr "Selecionar" + +#: src/merge-properties-dialog.c:334 +msgid "Record/Field" +msgstr "Registro/Campo" + +#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 +msgid "Data" +msgstr "Dado" + +#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:82 +msgid "Print" +msgstr "Imprimir" + +#: src/print-dialog.c:281 +msgid "_Job" +msgstr "_Trabalho" + +#: src/print-dialog.c:286 +msgid "P_rinter" +msgstr "Imp_ressora" + +#. ----------- Add simple-copies widget ------------ +#: src/print-dialog.c:314 +msgid "Copies" +msgstr "Cópias" + +#. ------- Add merge control widget ------------ +#: src/print-dialog.c:322 +msgid "Document merge control" +msgstr "Controle de fusão do documento" + +#. ----------- Add custom print options area ------------ +#: src/print-dialog.c:330 +msgid "Options" +msgstr "Opções" + +#: src/print-dialog.c:351 +msgid "print crop marks" +msgstr "" + +#: src/print-dialog.c:553 src/print-dialog.c:592 +msgid "Print preview" +msgstr "Visualizar impressão" + +#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 +msgid "gLabels Template Designer" +msgstr "" + +#: src/bc.c:60 +msgid "POSTNET (any)" +msgstr "" + +#: src/bc.c:63 +msgid "POSTNET-5 (ZIP only)" +msgstr "" + +#: src/bc.c:66 +msgid "POSTNET-9 (ZIP+4)" +msgstr "" + +#: src/bc.c:69 +msgid "POSTNET-11 (DPBC)" +msgstr "" + +#: src/bc.c:72 +msgid "EAN (any)" +msgstr "" + +#: src/bc.c:75 +msgid "EAN-8" +msgstr "" + +#: src/bc.c:78 +msgid "EAN-8 +2" +msgstr "" + +#: src/bc.c:81 +msgid "EAN-8 +5" +msgstr "" + +#: src/bc.c:84 +msgid "EAN-13" +msgstr "" + +#: src/bc.c:87 +msgid "EAN-13 +2" +msgstr "" + +#: src/bc.c:90 +msgid "EAN-13 +5" +msgstr "" + +#: src/bc.c:93 +msgid "UPC (UPC-A or UPC-E)" +msgstr "" + +#: src/bc.c:96 +msgid "UPC-A" +msgstr "" + +#: src/bc.c:99 +msgid "UPC-A +2" +msgstr "" + +#: src/bc.c:102 +msgid "UPC-A +5" +msgstr "" + +#: src/bc.c:105 +msgid "UPC-E" +msgstr "" + +#: src/bc.c:108 +msgid "UPC-E +2" +msgstr "" + +#: src/bc.c:111 +msgid "UPC-E +5" +msgstr "" + +#: src/bc.c:114 +msgid "ISBN" +msgstr "" + +#: src/bc.c:117 +msgid "ISBN +5" +msgstr "" + +#: src/bc.c:120 +msgid "Code 39" +msgstr "" + +#: src/bc.c:123 +msgid "Code 128" +msgstr "" + +#: src/bc.c:126 +msgid "Code 128C" +msgstr "" + +#: src/bc.c:129 +msgid "Code 128B" +msgstr "" + +#: src/bc.c:132 +msgid "Interleaved 2 of 5" +msgstr "" + +#: src/bc.c:135 +msgid "Codabar" +msgstr "" + +#: src/bc.c:138 +msgid "MSI" +msgstr "" + +#: src/bc.c:141 +msgid "Plessey" +msgstr "" + +#: src/label.c:569 +msgid "Untitled" +msgstr "Sem_título" + +#: src/xml-label.c:176 src/xml-label.c:213 +msgid "xmlParseFile error" +msgstr "erro: xmlParseFile" + +#: src/xml-label.c:250 +msgid "No document root" +msgstr "Sem raiz do documento" + +#: src/xml-label.c:264 +msgid "Importing from glabels 0.1 format" +msgstr "Importando do formato do glabels 0.1" + +#: src/xml-label.c:272 +msgid "Importing from glabels 0.4 format" +msgstr "Importando do formato do glabels 0.4" + +#: src/xml-label.c:279 +#, fuzzy +msgid "Importing from glabels 1.91 format" +msgstr "Importando do formato do glabels 0.1" + +#: src/xml-label.c:282 +msgid "bad document, unknown glabels Namespace" +msgstr "documento ruim, espaço de nome glabels não encontrado" + +#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "Nó raiz ruim = \"%s\"" + +#: src/xml-label.c:348 src/xml-label-191.c:165 +#, fuzzy, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "Nó raiz ruim = \"%s\"" + +#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 +#, c-format +msgid "bad node = \"%s\"" +msgstr "nó ruim = \"%s\"" + +#: src/xml-label.c:796 src/xml-label-191.c:605 +#, fuzzy, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "nó ruim = \"%s\"" + +#: src/xml-label.c:962 libglabels/xml-template.c:528 +msgid "Utf8 conversion error." +msgstr "" + +#: src/xml-label.c:969 libglabels/xml-template.c:535 +msgid "Problem saving xml file." +msgstr "Problema salvando arquivo xml." + +#. This should always be an id, but just in case a name +#. slips by! +#: src/xml-label-191.c:680 libglabels/xml-template.c:192 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "" + +#: src/xml-label-191.c:690 libglabels/xml-template.c:202 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "" + +#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 +msgid "None" +msgstr "Nenhum" + +#: src/merge-init.c:53 +msgid "Text file with comma delimeters (CSV)" +msgstr "Arquivo texto separado com vírgulas (CSV)" + +#: src/merge-init.c:60 +msgid "Text file with colon delimeters" +msgstr "Arquivo texto separado com dois pontos" + +#: src/merge-init.c:67 +msgid "Text file with tab delimeters" +msgstr "Arquivo texto separado com tab" + +#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 +msgid "File:" +msgstr "Arquivo:" + +#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 +msgid "Key:" +msgstr "Chave:" + +#: src/wdgt-print-copies.c:179 +msgid "Sheets:" +msgstr "Páginas:" + +#: src/wdgt-print-copies.c:197 +msgid "Labels" +msgstr "Etiquetas" + +#: src/wdgt-print-copies.c:200 +msgid "from:" +msgstr "de:" + +#: src/wdgt-print-copies.c:207 +msgid "to:" +msgstr "até:" + +#: src/wdgt-print-merge.c:178 +msgid "Start on label" +msgstr "Iniciar na etiqueta" + +#: src/wdgt-print-merge.c:186 +msgid "on 1st sheet" +msgstr "na primeira folha" + +#: src/wdgt-print-merge.c:195 +msgid "Copies:" +msgstr "Cópias:" + +#: src/wdgt-print-merge.c:201 +msgid "Collate" +msgstr "Ordenar" + +#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 +msgid "Description:" +msgstr "Descrição:" + +#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 +msgid "Page size:" +msgstr "Tamanho da página:" + +#: src/wdgt-media-select.c:290 +msgid "Label size:" +msgstr "Tamanho da etiqueta:" + +#: src/wdgt-media-select.c:301 +msgid "Layout:" +msgstr "Disposição:" + +#: src/wdgt-media-select.c:578 +#, c-format +msgid "%d x %d (%d per sheet)" +msgstr "%d x %d (%d por página)" + +#: src/wdgt-media-select.c:582 +#, c-format +msgid "%d per sheet" +msgstr "%d por página" + +#: src/wdgt-media-select.c:614 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +#: src/wdgt-media-select.c:619 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 +#, c-format +msgid "%s %s diameter" +msgstr "%s %s diâmetro" + +#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 +#, c-format +msgid "%.5g %s diameter" +msgstr "%.5g %s diâmetro" + +#: src/wdgt-rotate-label.c:193 +msgid "Rotate" +msgstr "Girar" + +#. This is the default custom color +#: src/mygal/color-palette.c:396 +#, fuzzy +msgid "custom" +msgstr "Personalizar" + +#. "Custom" color - we'll pop up a GnomeColorPicker +#: src/mygal/color-palette.c:438 +#, fuzzy +msgid "Custom Color:" +msgstr "Personaliza barras de ferramentas" + +#: src/mygal/color-palette.c:446 +msgid "Choose Custom Color" +msgstr "" + +#: src/mygal/color-palette.c:579 +msgid "black" +msgstr "" + +#: src/mygal/color-palette.c:580 +msgid "light brown" +msgstr "" + +#: src/mygal/color-palette.c:581 +msgid "brown gold" +msgstr "" + +#: src/mygal/color-palette.c:582 +msgid "dark green #2" +msgstr "" + +#: src/mygal/color-palette.c:583 +msgid "navy" +msgstr "" + +#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 +msgid "dark blue" +msgstr "" + +#: src/mygal/color-palette.c:585 +msgid "purple #2" +msgstr "" + +#: src/mygal/color-palette.c:586 +msgid "very dark gray" +msgstr "" + +#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 +msgid "dark red" +msgstr "" + +#: src/mygal/color-palette.c:590 +msgid "red-orange" +msgstr "" + +#: src/mygal/color-palette.c:591 +msgid "gold" +msgstr "" + +#: src/mygal/color-palette.c:592 +msgid "dark green" +msgstr "" + +#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 +msgid "dull blue" +msgstr "" + +#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 +msgid "blue" +msgstr "" + +#: src/mygal/color-palette.c:595 +msgid "dull purple" +msgstr "" + +#: src/mygal/color-palette.c:596 +msgid "dark grey" +msgstr "" + +#: src/mygal/color-palette.c:599 +msgid "red" +msgstr "" + +#: src/mygal/color-palette.c:600 +msgid "orange" +msgstr "" + +#: src/mygal/color-palette.c:601 +msgid "lime" +msgstr "" + +#: src/mygal/color-palette.c:602 +msgid "dull green" +msgstr "" + +#: src/mygal/color-palette.c:603 +msgid "dull blue #2" +msgstr "" + +#: src/mygal/color-palette.c:604 +msgid "sky blue #2" +msgstr "" + +#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 +msgid "purple" +msgstr "" + +#: src/mygal/color-palette.c:606 +msgid "gray" +msgstr "" + +#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 +#, fuzzy +msgid "magenta" +msgstr "Imagem" + +#: src/mygal/color-palette.c:610 +msgid "bright orange" +msgstr "" + +#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 +msgid "yellow" +msgstr "" + +#: src/mygal/color-palette.c:612 +#, fuzzy +msgid "green" +msgstr "graus" + +#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 +msgid "cyan" +msgstr "" + +#: src/mygal/color-palette.c:614 +msgid "bright blue" +msgstr "" + +#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 +msgid "red purple" +msgstr "" + +#: src/mygal/color-palette.c:616 +msgid "light grey" +msgstr "" + +#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 +msgid "pink" +msgstr "" + +#: src/mygal/color-palette.c:620 +msgid "light orange" +msgstr "" + +#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 +msgid "light yellow" +msgstr "" + +#: src/mygal/color-palette.c:622 +msgid "light green" +msgstr "" + +#: src/mygal/color-palette.c:623 +msgid "light cyan" +msgstr "" + +#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 +msgid "light blue" +msgstr "" + +#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 +msgid "light purple" +msgstr "" + +#: src/mygal/color-palette.c:626 +msgid "white" +msgstr "" + +#: src/mygal/color-palette.c:631 +msgid "purplish blue" +msgstr "" + +#: src/mygal/color-palette.c:635 +msgid "dark purple" +msgstr "" + +#: src/mygal/color-palette.c:637 +msgid "sky blue" +msgstr "" + +#: libglabels/template.c:848 +#, c-format +msgid "Generic %s full page" +msgstr "Página completa %s genérico" + +#: libglabels/template.c:897 +msgid "No template files found!" +msgstr "Nenhum arquivo modelo encontrado!" + +#. Create and append an "Other" entry. +#: libglabels/paper.c:67 +msgid "Other" +msgstr "" + +#: libglabels/paper.c:361 +#, fuzzy +msgid "No paper files found!" +msgstr "Nenhum arquivo modelo encontrado!" + +#: data/ui/glabels-ui.xml.h:1 +msgid "About glabels" +msgstr "Sobre glabels" + +#: data/ui/glabels-ui.xml.h:2 +msgid "About..." +msgstr "Sobre..." + +#: data/ui/glabels-ui.xml.h:3 +msgid "Align _Horizontal" +msgstr "Alinhar _Horizontal" + +#: data/ui/glabels-ui.xml.h:4 +msgid "Align _Vertical" +msgstr "Alinhar _Vertical" + +#: data/ui/glabels-ui.xml.h:5 +msgid "Align objects to bottoms" +msgstr "Alinha objetos pelas bases" + +#: data/ui/glabels-ui.xml.h:6 +msgid "Align objects to horizontal centers" +msgstr "Alinha objetos pelos centros horizontais" + +#: data/ui/glabels-ui.xml.h:7 +msgid "Align objects to left edges" +msgstr "Alinha objetos pelas bordas esquerdas" + +#: data/ui/glabels-ui.xml.h:8 +msgid "Align objects to right edges" +msgstr "Alinha objetos pelas bordas direitas" + +#: data/ui/glabels-ui.xml.h:9 +msgid "Align objects to tops" +msgstr "Alinha objetos pelos topos" + +#: data/ui/glabels-ui.xml.h:10 +msgid "Align objects to vertical centers" +msgstr "Alinha objetos pelos centros verticais" + +#: data/ui/glabels-ui.xml.h:12 +msgid "Bold" +msgstr "" + +#: data/ui/glabels-ui.xml.h:14 +#, fuzzy +msgid "Center align" +msgstr "Centros" + +#: data/ui/glabels-ui.xml.h:15 +msgid "Center objects to horizontal label center" +msgstr "Centra objetos no centro horizontal da etiqueta" + +#: data/ui/glabels-ui.xml.h:16 +msgid "Center objects to vertical label center" +msgstr "Centra objetos no centro vertical da etiqueta" + +#: data/ui/glabels-ui.xml.h:17 +msgid "Change the visibility of markup lines in the current window" +msgstr "Muda a visibilidade das linhas de marcação na janela atual" + +#: data/ui/glabels-ui.xml.h:18 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "Muda a visibilidade da barra de ferramentas de desenho na janela atual" + +#: data/ui/glabels-ui.xml.h:19 +msgid "Change the visibility of the grid in the current window" +msgstr "Muda a visibilidade da grade na janela atual" + +#: data/ui/glabels-ui.xml.h:20 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "Muda a visibilidade da barra de ferramentas principal na janela atual" + +#: data/ui/glabels-ui.xml.h:21 +#, fuzzy +msgid "Change the visibility of the property toolbar in the current window" +msgstr "Muda a visibilidade da barra de ferramentas principal na janela atual" + +#: data/ui/glabels-ui.xml.h:22 +msgid "Close" +msgstr "Fechar" + +#: data/ui/glabels-ui.xml.h:23 +msgid "Close the current file" +msgstr "Fechar o arquivo atual" + +#: data/ui/glabels-ui.xml.h:24 +msgid "Configure the application" +msgstr "Configurar a aplicação" + +#: data/ui/glabels-ui.xml.h:25 +msgid "Contents" +msgstr "Conteúdo" + +#: data/ui/glabels-ui.xml.h:26 +msgid "Copy" +msgstr "Copiar" + +#: data/ui/glabels-ui.xml.h:27 +msgid "Copy the selection" +msgstr "Copia a seleção" + +#: data/ui/glabels-ui.xml.h:28 +#, fuzzy +msgid "Create a custom template" +msgstr "Cria um novo documento" + +#: data/ui/glabels-ui.xml.h:29 +msgid "Create a new document" +msgstr "Cria um novo documento" + +#: data/ui/glabels-ui.xml.h:30 +msgid "Create barcode object" +msgstr "Criar objeto código de barras" + +#: data/ui/glabels-ui.xml.h:31 +msgid "Create box/rectangle object" +msgstr "Criar objeto caixa/retângulo" + +#: data/ui/glabels-ui.xml.h:32 +msgid "Create ellipse/circle object" +msgstr "Criar objeto elipse/círculo" + +#: data/ui/glabels-ui.xml.h:33 +msgid "Create image object" +msgstr "Criar objeto imagem" + +#: data/ui/glabels-ui.xml.h:34 +msgid "Create line object" +msgstr "Criar objeto linha" + +#: data/ui/glabels-ui.xml.h:35 +msgid "Create text object" +msgstr "Criar objeto texto" + +#: data/ui/glabels-ui.xml.h:36 +msgid "Cu_t" +msgstr "Cor_tar" + +#: data/ui/glabels-ui.xml.h:37 +msgid "Customize" +msgstr "Personalizar" + +#: data/ui/glabels-ui.xml.h:38 +msgid "Customize Drawing Toolbar" +msgstr "Personaliza barra de ferramentas de desenho" + +#: data/ui/glabels-ui.xml.h:39 +msgid "Customize Main Toolbar" +msgstr "Personaliza barra de ferramentas principal" + +#: data/ui/glabels-ui.xml.h:40 +#, fuzzy +msgid "Customize Property Toolbar" +msgstr "Personaliza barras de ferramentas" + +#: data/ui/glabels-ui.xml.h:41 +msgid "Customize toolbars" +msgstr "Personaliza barras de ferramentas" + +#: data/ui/glabels-ui.xml.h:42 +msgid "Cut" +msgstr "Cortar" + +#: data/ui/glabels-ui.xml.h:43 +msgid "Cut the selection" +msgstr "Corta a seleção" + +#: data/ui/glabels-ui.xml.h:44 +msgid "Decrease magnification" +msgstr "Diminuir aumento" + +#: data/ui/glabels-ui.xml.h:45 +msgid "Delete" +msgstr "Apagar" + +#: data/ui/glabels-ui.xml.h:46 +msgid "Delete the selected objects" +msgstr "Apaga os objetos selecionados" + +#: data/ui/glabels-ui.xml.h:47 +msgid "Drawing toolbar" +msgstr "Barra de ferramentas de desenho" + +#: data/ui/glabels-ui.xml.h:48 +msgid "Dump XML" +msgstr "Descarregar XML" + +#: data/ui/glabels-ui.xml.h:49 +msgid "Dump the UI Xml description" +msgstr "Descarrega a descrição da UI Xml" + +#: data/ui/glabels-ui.xml.h:50 +msgid "Edit merge properties" +msgstr "Editar propriedades de fusão" + +#: data/ui/glabels-ui.xml.h:54 +msgid "Flip object horizontally" +msgstr "Reflete objeto horizontalmente" + +#: data/ui/glabels-ui.xml.h:55 +msgid "Flip object vertically" +msgstr "Reflete objeto verticalmente" + +#: data/ui/glabels-ui.xml.h:56 +#, fuzzy +msgid "Font name" +msgstr "Não salve" + +#: data/ui/glabels-ui.xml.h:57 +#, fuzzy +msgid "Font selector" +msgstr "Copia a seleção" + +#: data/ui/glabels-ui.xml.h:58 +#, fuzzy +msgid "Font size" +msgstr "Não salve" + +#: data/ui/glabels-ui.xml.h:59 +msgid "Icon and _Text" +msgstr "Ícone e _Texto" + +#: data/ui/glabels-ui.xml.h:60 +msgid "Increase magnification" +msgstr "Aumentar aumento" + +#: data/ui/glabels-ui.xml.h:61 +msgid "Italic" +msgstr "" + +#: data/ui/glabels-ui.xml.h:63 +msgid "Left align" +msgstr "" + +#: data/ui/glabels-ui.xml.h:65 +msgid "Line width" +msgstr "" + +#: data/ui/glabels-ui.xml.h:66 +msgid "Lower object to bottom" +msgstr "Abaixa objeto à base" + +#: data/ui/glabels-ui.xml.h:67 +msgid "M_arkup" +msgstr "M_arcação" + +#: data/ui/glabels-ui.xml.h:68 +msgid "Main toolbar" +msgstr "Barra de ferramentas principal" + +#: data/ui/glabels-ui.xml.h:69 +msgid "Markup" +msgstr "Marcação" + +#: data/ui/glabels-ui.xml.h:70 +#, fuzzy +msgid "Modify document properties" +msgstr "Editar propriedades de fusão do documento" + +#: data/ui/glabels-ui.xml.h:71 +msgid "New" +msgstr "Novo" + +#: data/ui/glabels-ui.xml.h:72 +#, fuzzy +msgid "Object property editor" +msgstr "_Propriedades de Objeto" + +#: data/ui/glabels-ui.xml.h:73 +msgid "Only show icons in the drawing toolbar" +msgstr "Exibe somente ícones na barra de ferramentas de desenho" + +#: data/ui/glabels-ui.xml.h:74 +msgid "Only show icons in the main toolbar" +msgstr "Exibe somente ícones na barra de ferramentas principal" + +#: data/ui/glabels-ui.xml.h:76 +msgid "Open a file" +msgstr "Abrir um arquivo" + +#: data/ui/glabels-ui.xml.h:77 +msgid "Open the glabels manual" +msgstr "Abre o manual do glabels" + +#: data/ui/glabels-ui.xml.h:78 +msgid "Paste" +msgstr "Colar" + +#: data/ui/glabels-ui.xml.h:79 +msgid "Paste the clipboard" +msgstr "Cola a área de transferência" + +#: data/ui/glabels-ui.xml.h:80 +msgid "Pr_eferences..." +msgstr "Pr_eferências..." + +#: data/ui/glabels-ui.xml.h:81 +msgid "Preferences" +msgstr "Preferências" + +#: data/ui/glabels-ui.xml.h:83 +msgid "Print the current file" +msgstr "Imprime o arquivo atual" + +#: data/ui/glabels-ui.xml.h:84 +#, fuzzy +msgid "Proper_ties..." +msgstr "Propriedades" + +#: data/ui/glabels-ui.xml.h:85 +msgid "Properties" +msgstr "Propriedades" + +#: data/ui/glabels-ui.xml.h:86 +msgid "Property toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:87 +msgid "Quit" +msgstr "Sair" + +#: data/ui/glabels-ui.xml.h:88 +msgid "Quit the program" +msgstr "Sai do programa" + +#: data/ui/glabels-ui.xml.h:89 +msgid "Raise object to top" +msgstr "Sobe objetos ao topo" + +#: data/ui/glabels-ui.xml.h:90 +msgid "Recent _Files" +msgstr "_Arquivos recentes" + +#: data/ui/glabels-ui.xml.h:91 +msgid "Redo" +msgstr "Refazer" + +#: data/ui/glabels-ui.xml.h:92 +msgid "Redo the undone action" +msgstr "Refaz a ação desfeita" + +#: data/ui/glabels-ui.xml.h:93 +msgid "Remove all selections" +msgstr "Remover todas as seleções" + +#: data/ui/glabels-ui.xml.h:95 +#, no-c-format +msgid "Restore scale to 100%" +msgstr "Restaura escala para 100%" + +#: data/ui/glabels-ui.xml.h:96 +msgid "Right align" +msgstr "" + +#: data/ui/glabels-ui.xml.h:99 +msgid "Rotate object 90 clockwise" +msgstr "Gira objeto 90 sentido horário" + +#: data/ui/glabels-ui.xml.h:100 +msgid "Rotate object 90 counter-clockwise" +msgstr "Gira objeto 90 sentido anti-horário" + +#: data/ui/glabels-ui.xml.h:101 +msgid "Save" +msgstr "Salvar" + +#: data/ui/glabels-ui.xml.h:102 +msgid "Save As" +msgstr "Salvar como" + +#: data/ui/glabels-ui.xml.h:103 +msgid "Save _As..." +msgstr "Salvar _como..." + +#: data/ui/glabels-ui.xml.h:104 +msgid "Save the current file" +msgstr "Salva o arquivo atual" + +#: data/ui/glabels-ui.xml.h:105 +msgid "Save the current file with a different name" +msgstr "Salva o arquivo atual com um nome diferente" + +#: data/ui/glabels-ui.xml.h:106 +msgid "Select All" +msgstr "Selecionar Tudo" + +#: data/ui/glabels-ui.xml.h:107 +msgid "Select _All" +msgstr "Selecionar _Tudo" + +#: data/ui/glabels-ui.xml.h:108 +msgid "Select all objects" +msgstr "Seleciona todos os objetos" + +#: data/ui/glabels-ui.xml.h:109 +msgid "Select, move and modify objects" +msgstr "Seleciona, movimenta e modifica objetos" + +#: data/ui/glabels-ui.xml.h:111 +msgid "Set drawing toolbar button style according to desktop default" +msgstr "" +"Define estilo de botão da barra de ferramentas de desenho de acordo com " +"padrão do desktop" + +#: data/ui/glabels-ui.xml.h:112 +msgid "Set main toolbar button style according to desktop default" +msgstr "" +"Define estilo de botão da barra de ferramentas principal de acordo com " +"padrão do desktop" + +#: data/ui/glabels-ui.xml.h:113 +msgid "Show _Tooltips" +msgstr "Exibir _Dicas" + +#: data/ui/glabels-ui.xml.h:114 +#, fuzzy +msgid "Show both icons and texts in the drawing toolbar" +msgstr "Exibe dicas na barra de ferramentas de desenho" + +#: data/ui/glabels-ui.xml.h:115 +#, fuzzy +msgid "Show both icons and texts in the main toolbar" +msgstr "Exibe dicas na barra de ferramentas principal" + +#: data/ui/glabels-ui.xml.h:116 +msgid "Show tooltips in the drawing toolbar" +msgstr "Exibe dicas na barra de ferramentas de desenho" + +#: data/ui/glabels-ui.xml.h:117 +msgid "Show tooltips in the main toolbar" +msgstr "Exibe dicas na barra de ferramentas principal" + +#: data/ui/glabels-ui.xml.h:118 +#, fuzzy +msgid "Show tooltips in the property toolbar" +msgstr "Exibe dicas na barra de ferramentas principal" + +#: data/ui/glabels-ui.xml.h:119 +msgid "Template Designer" +msgstr "" + +#: data/ui/glabels-ui.xml.h:120 +msgid "Template _Designer..." +msgstr "" + +#: data/ui/glabels-ui.xml.h:121 +msgid "Text color" +msgstr "" + +#: data/ui/glabels-ui.xml.h:122 +msgid "U_n-select All" +msgstr "D_esmarcar Tudo" + +#: data/ui/glabels-ui.xml.h:123 +msgid "Un-select All" +msgstr "Desmarcar Tudo" + +#: data/ui/glabels-ui.xml.h:124 +msgid "Undo" +msgstr "Desfazer" + +#: data/ui/glabels-ui.xml.h:125 +msgid "Undo the last action" +msgstr "Desfaz a última ação" + +#: data/ui/glabels-ui.xml.h:126 +msgid "Zoom _1:1" +msgstr "Zoom _1:1" + +#: data/ui/glabels-ui.xml.h:127 +msgid "Zoom _In" +msgstr "M_ais Zoom" + +#: data/ui/glabels-ui.xml.h:128 +msgid "Zoom _Out" +msgstr "M_enos Zoom" + +#: data/ui/glabels-ui.xml.h:129 +#, fuzzy +msgid "Zoom to _fit" +msgstr "Zoom para 1:1" + +#: data/ui/glabels-ui.xml.h:130 +msgid "Zoom to fit window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:131 +msgid "_About..." +msgstr "_Sobre..." + +#: data/ui/glabels-ui.xml.h:132 +msgid "_Bottoms" +msgstr "_Bases" + +#: data/ui/glabels-ui.xml.h:135 +msgid "_Close" +msgstr "_Fechar" + +#: data/ui/glabels-ui.xml.h:136 +msgid "_Contents" +msgstr "_Conteúdo" + +#: data/ui/glabels-ui.xml.h:137 +msgid "_Copy" +msgstr "_Copiar" + +#: data/ui/glabels-ui.xml.h:138 +msgid "_Create Object" +msgstr "_Criar Objeto" + +#: data/ui/glabels-ui.xml.h:139 +msgid "_Debug" +msgstr "_Depurar" + +#: data/ui/glabels-ui.xml.h:141 +msgid "_Desktop Default" +msgstr "Padrão _Desktop" + +#: data/ui/glabels-ui.xml.h:142 +msgid "_Drawing Toolbar" +msgstr "Barra de _Desenho" + +#: data/ui/glabels-ui.xml.h:143 +msgid "_Edit" +msgstr "_Editar" + +#: data/ui/glabels-ui.xml.h:145 +msgid "_File" +msgstr "_Arquivo" + +#: data/ui/glabels-ui.xml.h:146 +msgid "_Grid" +msgstr "_Grade" + +#: data/ui/glabels-ui.xml.h:147 +msgid "_Help" +msgstr "A_juda" + +#: data/ui/glabels-ui.xml.h:148 +msgid "_Icon" +msgstr "_Ícone" + +#: data/ui/glabels-ui.xml.h:152 +msgid "_Main Toolbar" +msgstr "Barra _Principal" + +#: data/ui/glabels-ui.xml.h:153 +msgid "_Merge Properties..." +msgstr "Propriedades de _Fusão..." + +#: data/ui/glabels-ui.xml.h:154 +msgid "_New" +msgstr "_Novo" + +#: data/ui/glabels-ui.xml.h:155 +msgid "_Objects" +msgstr "_Objetos" + +#: data/ui/glabels-ui.xml.h:156 +msgid "_Open..." +msgstr "_Abrir..." + +#: data/ui/glabels-ui.xml.h:158 +msgid "_Paste" +msgstr "_Colar" + +#: data/ui/glabels-ui.xml.h:159 +msgid "_Print..." +msgstr "Im_primir..." + +#: data/ui/glabels-ui.xml.h:160 +#, fuzzy +msgid "_Property Toolbar" +msgstr "Barra de _Desenho" + +#: data/ui/glabels-ui.xml.h:161 +msgid "_Quit" +msgstr "_Sair" + +#: data/ui/glabels-ui.xml.h:164 +msgid "_Save" +msgstr "_Salvar" + +#: data/ui/glabels-ui.xml.h:168 +msgid "_View" +msgstr "_Visualizar" + +#: data/glade/prefs-dialog.glade.h:1 +msgid " " +msgstr "" + +#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 +#: data/glade/template-designer.glade.h:5 +msgid "*" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:3 +msgid "Default page size" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:4 +msgid "Fill" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:5 +msgid "Line" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:6 +msgid "Text" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:7 +msgid "Units" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 +msgid "Alignment:" +msgstr "Alinhamento:" + +#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 +msgid "Color:" +msgstr "Cor:" + +#: data/glade/prefs-dialog.glade.h:10 +msgid "Font:" +msgstr "Fonte:" + +#: data/glade/prefs-dialog.glade.h:11 +msgid "ISO A4" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:12 +msgid "Inches" +msgstr "Polegadas" + +#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 +msgid "Line Spacing:" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:14 +msgid "Locale" +msgstr "Local" + +#: data/glade/prefs-dialog.glade.h:15 +msgid "Millimeters" +msgstr "Milímetros" + +#: data/glade/prefs-dialog.glade.h:16 +msgid "Object defaults" +msgstr "Padrões do objeto" + +#: data/glade/prefs-dialog.glade.h:17 +msgid "Points" +msgstr "Pontos" + +#: data/glade/prefs-dialog.glade.h:18 +msgid "Select default properties for new objects." +msgstr "Selecione as propriedades padrões para novos objetos." + +#: data/glade/prefs-dialog.glade.h:19 +msgid "Select locale specific behavior." +msgstr "Selecione comportamento específico do local." + +#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:25 +msgid "US Letter" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 +#: data/glade/template-designer.glade.h:72 +msgid "Width:" +msgstr "Largura:" + +#: data/glade/object-editor.glade.h:2 +msgid "00000000000 00000" +msgstr "" + +#: data/glade/object-editor.glade.h:3 +msgid "Xxx object properties" +msgstr "" + +#: data/glade/object-editor.glade.h:5 +msgid "Allow merge to automatically shrink text" +msgstr "" + +#: data/glade/object-editor.glade.h:6 +msgid "Angle:" +msgstr "Ângulo:" + +#: data/glade/object-editor.glade.h:7 +msgid "Checksum" +msgstr "" + +#: data/glade/object-editor.glade.h:10 +#, fuzzy +msgid "Family:" +msgstr "Arquivo:" + +#: data/glade/object-editor.glade.h:12 +msgid "Fill" +msgstr "Preencher" + +#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 +msgid "Height:" +msgstr "Altura:" + +#: data/glade/object-editor.glade.h:14 +msgid "Image" +msgstr "Imagem" + +#: data/glade/object-editor.glade.h:15 +msgid "Insert merge field" +msgstr "Inserir campo de fusão" + +#: data/glade/object-editor.glade.h:17 +msgid "Length:" +msgstr "Comprimento:" + +#: data/glade/object-editor.glade.h:18 +msgid "Line" +msgstr "Linha" + +#: data/glade/object-editor.glade.h:20 +msgid "Literal:" +msgstr "Literal:" + +#: data/glade/object-editor.glade.h:21 +msgid "Load image" +msgstr "" + +#: data/glade/object-editor.glade.h:22 +msgid "Position" +msgstr "Posição" + +#: data/glade/object-editor.glade.h:23 +msgid "Reset image size" +msgstr "Redefinir tamanho da imagem" + +#: data/glade/object-editor.glade.h:24 +msgid "Size" +msgstr "Tamanho" + +#: data/glade/object-editor.glade.h:25 +#, fuzzy +msgid "Size:" +msgstr "Tamanho" + +#: data/glade/object-editor.glade.h:26 +#, fuzzy +msgid "Style" +msgstr "Estilo:" + +#: data/glade/object-editor.glade.h:27 +msgid "Style:" +msgstr "Estilo:" + +#: data/glade/object-editor.glade.h:30 +msgid "X:" +msgstr "X:" + +#: data/glade/object-editor.glade.h:31 +msgid "Y:" +msgstr "Y:" + +#: data/glade/object-editor.glade.h:32 +msgid "degrees" +msgstr "graus" + +#: data/glade/object-editor.glade.h:33 +msgid "dialog1" +msgstr "" + +#: data/glade/object-editor.glade.h:34 +msgid "digits:" +msgstr "" + +#: data/glade/object-editor.glade.h:35 +#, fuzzy +msgid "format:" +msgstr "Formato:" + +#: data/glade/template-designer.glade.h:1 +msgid " " +msgstr "" + +#: data/glade/template-designer.glade.h:2 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "" + +#: data/glade/template-designer.glade.h:3 +msgid "(e.g., 8163A)" +msgstr "" + +#: data/glade/template-designer.glade.h:4 +msgid "(e.g., Avery, Acme, ...)" +msgstr "" + +#: data/glade/template-designer.glade.h:6 +msgid "1. Outer radius:" +msgstr "" + +#: data/glade/template-designer.glade.h:7 +msgid "1. Radius:" +msgstr "" + +#: data/glade/template-designer.glade.h:8 +#, fuzzy +msgid "1. Width:" +msgstr "Largura:" + +#: data/glade/template-designer.glade.h:9 +#, fuzzy +msgid "2. Height:" +msgstr "Altura:" + +#: data/glade/template-designer.glade.h:10 +msgid "2. Inner radius:" +msgstr "" + +#: data/glade/template-designer.glade.h:11 +msgid "2. Waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:12 +msgid "3. Clipping width:" +msgstr "" + +#: data/glade/template-designer.glade.h:13 +msgid "3. Margin" +msgstr "" + +#: data/glade/template-designer.glade.h:14 +msgid "3. Round (radius of corner):" +msgstr "" + +#: data/glade/template-designer.glade.h:15 +msgid "4. Clipping height:" +msgstr "" + +#: data/glade/template-designer.glade.h:16 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:17 +msgid "5. Vert. waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:18 +msgid "5. Waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:19 +msgid "6. Margin" +msgstr "" + +#: data/glade/template-designer.glade.h:20 +msgid "Brand/Manufacturer:" +msgstr "" + +#: data/glade/template-designer.glade.h:21 +msgid "CD/DVD (including credit card CDs)" +msgstr "" + +#: data/glade/template-designer.glade.h:22 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "" + +#: data/glade/template-designer.glade.h:30 +msgid "Design Completed" +msgstr "" + +#: data/glade/template-designer.glade.h:31 +msgid "Distance from left edge (x0):" +msgstr "" + +#: data/glade/template-designer.glade.h:32 +msgid "Distance from top edge (y0):" +msgstr "" + +#: data/glade/template-designer.glade.h:34 +msgid "Horizontal pitch (dx):" +msgstr "" + +#: data/glade/template-designer.glade.h:35 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" + +#: data/glade/template-designer.glade.h:40 +msgid "Label Size (CD/DVD)" +msgstr "" + +#: data/glade/template-designer.glade.h:41 +#, fuzzy +msgid "Label Size (Round)" +msgstr "Tamanho da etiqueta:" + +#: data/glade/template-designer.glade.h:42 +#, fuzzy +msgid "Label or Card Shape" +msgstr "Nova Etiqueta ou Cartão" + +#: data/glade/template-designer.glade.h:43 +msgid "Label or Card Size (Rectangular)" +msgstr "" + +#: data/glade/template-designer.glade.h:44 +#, fuzzy +msgid "Layout #1" +msgstr "Disposição:" + +#: data/glade/template-designer.glade.h:45 +#, fuzzy +msgid "Layout #2" +msgstr "Disposição:" + +#: data/glade/template-designer.glade.h:46 +#, fuzzy +msgid "Layout(s)" +msgstr "Disposição:" + +#: data/glade/template-designer.glade.h:47 +#, fuzzy +msgid "Name and Description" +msgstr "Descrição:" + +#: data/glade/template-designer.glade.h:48 +msgid "Number across (nx):" +msgstr "" + +#: data/glade/template-designer.glade.h:49 +msgid "Number down (ny):" +msgstr "" + +#: data/glade/template-designer.glade.h:50 +msgid "Number of Layouts" +msgstr "" + +#: data/glade/template-designer.glade.h:51 +msgid "Number of layouts:" +msgstr "" + +#: data/glade/template-designer.glade.h:52 +#, fuzzy +msgid "Page Size" +msgstr "Tamanho da página:" + +#: data/glade/template-designer.glade.h:54 +msgid "Part #:" +msgstr "" + +#: data/glade/template-designer.glade.h:55 +msgid "" +"Please enter the following identifying information about the template " +"stationery." +msgstr "" + +#: data/glade/template-designer.glade.h:56 +msgid "Please enter the following layout information." +msgstr "" + +#: data/glade/template-designer.glade.h:57 +msgid "" +"Please enter the following size parameters of a single label in your " +"template." +msgstr "" + +#: data/glade/template-designer.glade.h:58 +msgid "" +"Please enter the following size parameters of a single label or card in your " +"template." +msgstr "" + +#: data/glade/template-designer.glade.h:59 +msgid "Please select the basic shape of the labels or cards." +msgstr "" + +#: data/glade/template-designer.glade.h:60 +msgid "Please select the page size of the template stationery." +msgstr "" + +#: data/glade/template-designer.glade.h:61 +#, fuzzy +msgid "Print test sheet" +msgstr "na primeira folha" + +#: data/glade/template-designer.glade.h:62 +msgid "Rectangular or square (can have rounded corners)" +msgstr "" + +#: data/glade/template-designer.glade.h:63 +msgid "Round" +msgstr "" + +#: data/glade/template-designer.glade.h:64 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" + +#: data/glade/template-designer.glade.h:66 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" + +#: data/glade/template-designer.glade.h:68 +msgid "Vertical pitch (dy):" +msgstr "" + +#: data/glade/template-designer.glade.h:69 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" + +#: data/templates/paper-sizes.xml.h:1 +msgid "A0" +msgstr "" + +#: data/templates/paper-sizes.xml.h:2 +msgid "A1" +msgstr "" + +#: data/templates/paper-sizes.xml.h:3 +msgid "A10" +msgstr "" + +#: data/templates/paper-sizes.xml.h:4 +msgid "A2" +msgstr "" + +#: data/templates/paper-sizes.xml.h:5 +msgid "A3" +msgstr "" + +#: data/templates/paper-sizes.xml.h:6 +msgid "A4" +msgstr "" + +#: data/templates/paper-sizes.xml.h:7 +msgid "A5" +msgstr "" + +#: data/templates/paper-sizes.xml.h:8 +msgid "A6" +msgstr "" + +#: data/templates/paper-sizes.xml.h:9 +msgid "A7" +msgstr "" + +#: data/templates/paper-sizes.xml.h:10 +msgid "A8" +msgstr "" + +#: data/templates/paper-sizes.xml.h:11 +msgid "A9" +msgstr "" + +#: data/templates/paper-sizes.xml.h:12 +msgid "B0" +msgstr "" + +#: data/templates/paper-sizes.xml.h:13 +msgid "B1" +msgstr "" + +#: data/templates/paper-sizes.xml.h:14 +msgid "B10" +msgstr "" + +#: data/templates/paper-sizes.xml.h:15 +msgid "B2" +msgstr "" + +#: data/templates/paper-sizes.xml.h:16 +msgid "B3" +msgstr "" + +#: data/templates/paper-sizes.xml.h:17 +msgid "B4" +msgstr "" + +#: data/templates/paper-sizes.xml.h:18 +msgid "B5" +msgstr "" + +#: data/templates/paper-sizes.xml.h:19 +msgid "B6" +msgstr "" + +#: data/templates/paper-sizes.xml.h:20 +msgid "B7" +msgstr "" + +#: data/templates/paper-sizes.xml.h:21 +msgid "B8" +msgstr "" + +#: data/templates/paper-sizes.xml.h:22 +msgid "B9" +msgstr "" + +#: data/templates/paper-sizes.xml.h:23 +msgid "US Executive" +msgstr "" + +#: data/templates/paper-sizes.xml.h:24 +msgid "US Legal" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:1 +#: data/templates/zweckform-iso-templates.xml.h:1 +msgid "Address Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:2 +#: data/templates/avery-iso-templates.xml.h:2 +#: data/templates/zweckform-iso-templates.xml.h:3 +#: data/templates/misc-us-templates.xml.h:2 +#: data/templates/misc-iso-templates.xml.h:9 +msgid "Business Cards" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:3 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:4 +msgid "Diskette Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:5 +#, fuzzy +msgid "Filing Labels" +msgstr "Etiquetas" + +#: data/templates/avery-us-templates.xml.h:6 +msgid "Full Sheet Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:7 +#, fuzzy +msgid "Large Round Labels" +msgstr "Iniciar na etiqueta" + +#: data/templates/avery-us-templates.xml.h:8 +msgid "Name Badge Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:9 +msgid "Return Address Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:10 +msgid "Shipping Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:11 +#, fuzzy +msgid "Small Round Labels" +msgstr "Iniciar na etiqueta" + +#: data/templates/avery-us-templates.xml.h:12 +#, fuzzy +msgid "Square Labels" +msgstr "Etiquetas" + +#: data/templates/avery-us-templates.xml.h:13 +msgid "Video Tape Face Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:14 +msgid "Video Tape Spine Labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:1 +msgid "Address labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:3 +msgid "CD Booklet" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:4 +msgid "CD Inlet" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:5 +#: data/templates/zweckform-iso-templates.xml.h:4 +#: data/templates/misc-us-templates.xml.h:4 +#: data/templates/misc-iso-templates.xml.h:10 +#, fuzzy +msgid "CD/DVD Labels" +msgstr "Etiquetas" + +#: data/templates/avery-iso-templates.xml.h:6 +#, fuzzy +msgid "Diskette labels" +msgstr "Sobre glabels" + +#: data/templates/avery-iso-templates.xml.h:7 +#: data/templates/zweckform-iso-templates.xml.h:7 +#: data/templates/misc-iso-templates.xml.h:17 +msgid "Mailing Labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:8 +#, fuzzy +msgid "Mailing labels" +msgstr "glabels" + +#: data/templates/avery-iso-templates.xml.h:9 +msgid "Mini Address Labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:10 +#, fuzzy +msgid "Shipping labels" +msgstr "Abrir etiqueta" + +#: data/templates/zweckform-iso-templates.xml.h:2 +#, fuzzy +msgid "Allround Labels" +msgstr "Sobre glabels" + +#: data/templates/zweckform-iso-templates.xml.h:5 +msgid "Correction and Cover-up Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:6 +msgid "Lever Arch File Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:8 +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:9 +msgid "Rectangular Copier Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:10 +#: data/templates/misc-iso-templates.xml.h:22 +msgid "Rectangular Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:11 +msgid "Video Labels (back)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:1 +msgid "Business Card CD" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:3 +msgid "CD Template Rectangles" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:5 +msgid "CD/DVD Labels (Face Only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:6 +#: data/templates/misc-iso-templates.xml.h:11 +msgid "CD/DVD Labels (face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:7 +#, fuzzy +msgid "DLT Labels" +msgstr "Etiquetas" + +#: data/templates/misc-us-templates.xml.h:8 +#, fuzzy +msgid "Microtube labels" +msgstr "Sobre glabels" + +#: data/templates/misc-us-templates.xml.h:9 +msgid "Mini-CD Labels" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:10 +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:11 +msgid "PRO CD Labels 2-up (Face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:12 +#: data/templates/misc-iso-templates.xml.h:21 +msgid "PRO CD Labels 2-up (face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:13 +msgid "Slimline CD Case (rightside up)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:14 +msgid "Slimline CD Case (upside down)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:1 +msgid "Agipa 119488: Business Cards" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:2 +msgid "Allround Labels --24" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:3 +msgid "Allround Labels --44" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:4 +msgid "Allround Labels --64" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:5 +msgid "Allround Labels --65" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:6 +msgid "Arch File Labels" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:7 +msgid "Arch File Labels (large)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:8 +msgid "Arch File Labels (small)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:12 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:13 +msgid "Diskette Labels (face only)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:14 +msgid "EPSON Photo Stickers 16" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:15 +msgid "Etiketten" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:16 +msgid "Fridge Magnet Stickers" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:18 +msgid "Mailing Labels --14" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:19 +msgid "Mailing Labels-2 columns" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:20 +msgid "Mailing Labels-3 columns" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:23 +msgid "Video Labels (face only)" +msgstr "" + +#: data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers." +msgstr "" + +#: data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "" + +#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 +#, fuzzy +msgid "gLabels Project File" +msgstr "_Propriedades de Objeto" + +#~ msgid "Object _Properties..." +#~ msgstr "_Propriedades do Objeto..." + +#~ msgid "Display units" +#~ msgstr "Exibir unidades" + +#~ msgid "Default page size" +#~ msgstr "Tamanho de página padrão" + +#~ msgid "Outline" +#~ msgstr "Contorno" + +#~ msgid "Edit line object properties" +#~ msgstr "Editar propriedades do objeto linha" + +#~ msgid "Edit text object properties" +#~ msgstr "Editar propriedades do objeto texto" + +#~ msgid "Edit text:" +#~ msgstr "Editar texto:" + +#~ msgid "Maintain current aspect ratio" +#~ msgstr "Manter taxa de aspecto atual" + +#, fuzzy +#~ msgid "CD Labels" +#~ msgstr "Etiquetas" + +#~ msgid "Open %s" +#~ msgstr "Abrir %s" + +#~ msgid "Scale:" +#~ msgstr "Escala:" + +#~ msgid "%" +#~ msgstr "%" + +#~ msgid "Show text with barcode" +#~ msgstr "Exibir texto com código de barras" + +#~ msgid "Edit properties..." +#~ msgstr "Editar propriedades..." + +#~ msgid "Fields" +#~ msgstr "Campos" + +#~ msgid "Column" +#~ msgstr "Coluna" + +#~ msgid "Custom field key" +#~ msgstr "Chave do campo específico" + +#~ msgid "Sample data" +#~ msgstr "Dado de amostra" + +#~ msgid "Revert to saved copy of %s?" +#~ msgstr "Reverter para a cópia gravada de %s?" + +#~ msgid "Unknown media type. Using default." +#~ msgstr "Tipo de mídia desconhecido. Usando padrão." + +#~ msgid "" +#~ "``%s'' has been modified.\n" +#~ "\n" +#~ "Do you wish to save it?" +#~ msgstr "" +#~ "``%s'' foi modificado.\n" +#~ "\n" +#~ "Deseja salvá-lo?" + +#~ msgid "Close / Save label as" +#~ msgstr "Fechar / Salvar etiqueta como" + +#~ msgid "Label no longer valid!" +#~ msgstr "Etiqueta não é mais válida" + +#~ msgid "Error writing file" +#~ msgstr "Erro gravando o arquivo" + +#~ msgid "Appearance" +#~ msgstr "Aparência" + +#~ msgid "Position/Size" +#~ msgstr "Posição/Tamanho" + +#~ msgid "Image format not currently supported" +#~ msgstr "Formato de imagem não suportado atualmente" + +#~ msgid "Barcode data" +#~ msgstr "Dado do Código de Barras:" + +#~ msgid "General" +#~ msgstr "Geral" + +#~ msgid "Make a new, empty label" +#~ msgstr "Criar uma etiqueta nova, vazia" + +#~ msgid " New " +#~ msgstr " Novo " + +#~ msgid "New Label/Card" +#~ msgstr "Nova Etiqueta/Cartão" + +#~ msgid " Open " +#~ msgstr " Abrir " + +#~ msgid " Save " +#~ msgstr " Salvar " + +#~ msgid " Print " +#~ msgstr " Imprimir " + +#~ msgid "Function is not implemented!" +#~ msgstr "Função não está implementada!" + +#~ msgid "Function is not yet implemented!" +#~ msgstr "Função ainda não implementada!" diff --git a/po/ru.po b/po/ru.po new file mode 100644 index 00000000..40067b12 --- /dev/null +++ b/po/ru.po @@ -0,0 +1,2459 @@ +# Russian translation of glabels. +# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# Vitaly Lipatov , 2002, 2003, 2004, 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: glabels 2.1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-01-22 14:03-0500\n" +"PO-Revision-Date: 2005-04-10 02:18MSK\n" +"Last-Translator: Vitaly Lipatov \n" +"Language-Team: Russian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.10\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: src/glabels.c:116 +msgid "Could not initialize Bonobo!\n" +msgstr "Невозможно инициализировать Bonobo!\n" + +#: src/glabels-batch.c:52 +msgid "print this message" +msgstr "напечатать это сообщение" + +#: src/glabels-batch.c:54 +msgid "print the version of glabels-batch being used" +msgstr "выводит версию используемого glabels-batch" + +#: src/glabels-batch.c:56 +msgid "set output filename (default=\"output.ps\")" +msgstr "установить название выходного файла (по умолчанию - \"output.ps\"" + +#: src/glabels-batch.c:56 src/glabels-batch.c:70 +msgid "filename" +msgstr "название" + +#: src/glabels-batch.c:58 +msgid "number of sheets (default=1)" +msgstr "количество страниц (по умолчанию - 1)" + +#: src/glabels-batch.c:58 +msgid "sheets" +msgstr "страниц" + +#: src/glabels-batch.c:60 +msgid "number of copies (default=1)" +msgstr "количество копий (по умолчанию - 1)" + +#: src/glabels-batch.c:60 +msgid "copies" +msgstr "копий" + +#: src/glabels-batch.c:62 +msgid "first label on first sheet (default=1)" +msgstr "первая этикетка на первой странице (по умолчанию - 1)" + +#: src/glabels-batch.c:62 +msgid "first" +msgstr "первое" + +#: src/glabels-batch.c:64 src/print-dialog.c:336 +msgid "print outlines (to test printer alignment)" +msgstr "печатать контуры этикеток" + +#: src/glabels-batch.c:66 src/print-dialog.c:344 +msgid "print in reverse (i.e. a mirror image)" +msgstr "печатать перевёрнуто (как отражается в зеркале)" + +#: src/glabels-batch.c:68 src/print-dialog.c:351 +msgid "print crop marks" +msgstr "печатать метки для обрезки" + +#: src/glabels-batch.c:70 +msgid "input file for merging" +msgstr "входной файл для объединения" + +#: src/glabels-batch.c:107 +msgid "[OPTION...] GLABELS_FILE..." +msgstr "[ПАРАМЕТРЫ...] файл_glabels..." + +#: src/glabels-batch.c:127 +#, c-format +msgid "missing glabels file\n" +msgstr "не указан файл glabels\n" + +#: src/glabels-batch.c:158 +msgid "cannot perform document merge with glabels file %s\n" +msgstr "невозможно выполнить объединение документа с файлом glabels %s\n" + +#: src/glabels-batch.c:182 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "невозможно открыть файл %s\n" + +#: src/window.c:244 +msgid "(none) - gLabels" +msgstr "(ничего) - gLabels" + +#: src/window.c:414 +msgid "(modified)" +msgstr "(изменено)" + +#: src/stock.c:65 data/ui/glabels-ui.xml.h:162 +msgid "_Select Mode" +msgstr "_Режим выбора" + +#: src/stock.c:66 data/ui/glabels-ui.xml.h:163 +msgid "_Text" +msgstr "_Текст" + +#: src/stock.c:67 data/ui/glabels-ui.xml.h:148 +msgid "_Line" +msgstr "_Линия" + +#: src/stock.c:68 data/ui/glabels-ui.xml.h:130 +msgid "_Box" +msgstr "_Прямоугольник" + +#: src/stock.c:69 data/ui/glabels-ui.xml.h:141 +msgid "_Ellipse" +msgstr "_Эллипс" + +#: src/stock.c:70 data/ui/glabels-ui.xml.h:146 +msgid "_Image" +msgstr "_Изображение" + +#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 +msgid "Bar_code" +msgstr "_Штрих-код" + +#: src/stock.c:72 +msgid "_Merge Properties" +msgstr "Свойства _объединения" + +#: src/stock.c:73 +msgid "Object _Properties" +msgstr "_Свойства объекта" + +#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 +msgid "Bring to _Front" +msgstr "На _передний план" + +#: src/stock.c:75 data/ui/glabels-ui.xml.h:109 +msgid "Send to _Back" +msgstr "На _задний план" + +#: src/stock.c:76 data/ui/glabels-ui.xml.h:96 +msgid "Rotate _Left" +msgstr "Повернуть на_лево" + +#: src/stock.c:77 data/ui/glabels-ui.xml.h:97 +msgid "Rotate _Right" +msgstr "Повернуть на_право" + +#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 +msgid "Flip _Horizontally" +msgstr "Отразить _горизонтально" + +#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 +msgid "Flip _Vertically" +msgstr "Отразить _вертикально" + +#: src/stock.c:80 data/ui/glabels-ui.xml.h:147 +msgid "_Lefts" +msgstr "С_лева" + +#: src/stock.c:81 data/ui/glabels-ui.xml.h:159 +msgid "_Rights" +msgstr "С_права" + +#: src/stock.c:82 data/ui/glabels-ui.xml.h:131 +msgid "_Centers" +msgstr "По _центру" + +#: src/stock.c:83 data/ui/glabels-ui.xml.h:164 +msgid "_Tops" +msgstr "По _верху" + +#: src/stock.c:84 +msgid "Bottoms" +msgstr "По низу" + +#: src/stock.c:85 +msgid "Centers" +msgstr "По центру" + +#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 +msgid "Label Ce_nter" +msgstr "_Центр этикетки" + +#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 +msgid "Fill color" +msgstr "Цвет заливки" + +#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 +msgid "Line color" +msgstr "Цвет линии" + +#: src/stock.c:90 src/stock.c:92 +msgid "Linked" +msgstr "Прикреплено" + +#: src/stock.c:91 src/stock.c:93 +msgid "Not Linked" +msgstr "Не прикреплено" + +#: src/ui-property-bar.c:345 src/object-editor.c:587 +msgid "Default" +msgstr "По умолчанию" + +#: src/ui-property-bar.c:360 src/object-editor.c:600 +msgid "No fill" +msgstr "Не заполнять" + +#: src/ui-property-bar.c:375 src/object-editor.c:593 +msgid "No line" +msgstr "Нет линии" + +#: src/ui-sidebar.c:180 +msgid "Object properties" +msgstr "Свойства объекта" + +#: src/commands.c:385 +msgid "" +"A label and business card creation program for GNOME.\n" +" \n" +"Glabels is free software; you can redistribute it and/or modify it under the " +"terms of the GNU General Public License as published by the Free Software " +"Foundation; either version 2 of the License, or (at your option) any later " +"version.\n" +" \n" +"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.\n" +msgstr "" +"Программа создания этикеток и визиток для GNOME\n" +" \n" +"Glabels является свободным программным обеспечением; вы вправе " +"распространять её и/или модифицировать в соответствии с условиями версии 2 " +"либо по вашему выбору более поздней версии Стандартной Общественной Лицензии " +"GNU, опубликованной Free Software Foundation.\n" +" \n" +"Мы распространяем данную программу в надежде на то, что она будет вам " +"полезной, однако НЕ ПРЕДОСТАВЛЯЕМ НА НЕЁ НИКАКИХ ГАРАНТИЙ, в том числе " +"ГАРАНТИИ ТОВАРНОГО СОСТОЯНИЯ ПРИ ПРОДАЖЕ и ПРИГОДНОСТИ ДЛЯ ИСПОЛЬЗОВАНИЯ В " +"КОНКРЕТНЫХ ЦЕЛЯХ. Для получения более подробной информации ознакомьтесь со " +"Стандартной Общественной Лицензией GNU.\n" + +#: src/commands.c:399 +msgid "See the file AUTHORS for additional credits," +msgstr "Смотрите в файл AUTHORS для дополнительной информации," + +#: src/commands.c:400 +msgid "or visit http://glabels.sourceforge.net/" +msgstr "или посетите сайт http://glabels.sourceforge.net/" + +#: src/commands.c:409 +msgid " " +msgstr "" + +#: src/commands.c:424 +msgid "glabels" +msgstr "glabels" + +#: src/file.c:100 +msgid "New Label or Card" +msgstr "Новая этикетка или визитка" + +#: src/file.c:132 src/file.c:304 +msgid "Media Type" +msgstr "Размер бумаги" + +#: src/file.c:138 src/file.c:310 +msgid "Label orientation" +msgstr "Расположение этикетки" + +#: src/file.c:269 +msgid "Label properties" +msgstr "Свойства этикетки" + +#: src/file.c:452 src/file.c:870 +msgid "All files" +msgstr "Все файлы" + +#: src/file.c:457 src/file.c:875 +msgid "gLabels documents" +msgstr "Документы gLabels" + +#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 +msgid "Empty file name selection" +msgstr "Пустой выбор файла" + +#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 +msgid "Please select a file or supply a valid file name" +msgstr "Выберите файл или введите корректное название файла" + +#: src/file.c:519 src/file.c:631 +msgid "File does not exist" +msgstr "Файл не существует" + +#: src/file.c:563 data/ui/glabels-ui.xml.h:74 +msgid "Open" +msgstr "Открыть" + +#: src/file.c:565 +msgid "Open label" +msgstr "Открыть этикетку" + +#: src/file.c:707 +#, c-format +msgid "Could not open file \"%s\"" +msgstr "Невозможно открыть файл \"%s\"" + +#: src/file.c:715 +msgid "Not a supported file format" +msgstr "Файл неподдерживаемого формата" + +#: src/file.c:797 src/file.c:979 src/file.c:1174 +#, c-format +msgid "Could not save file \"%s\"" +msgstr "Невозможно сохранить файл \"%s\"" + +#: src/file.c:805 src/file.c:987 src/file.c:1182 +msgid "Error encountered during save. The file is still not saved." +msgstr "Произошла ошибка при сохранении файла. Файл всё ещё не сохранён." + +#: src/file.c:848 src/file.c:1048 +#, c-format +msgid "Save \"%s\" as" +msgstr "Сохранить \"%s\" как" + +#: src/file.c:935 src/file.c:1131 +msgid "Please supply a valid file name" +msgstr "Укажите корректное название файла" + +#: src/file.c:952 src/file.c:1147 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "Перезаписать файл \"%s\"?" + +#: src/file.c:960 src/file.c:1155 +msgid "File already exists." +msgstr "Файл уже существует." + +#: src/file.c:1271 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "Сохранить изменения в документе \"%s\" перед закрытием?" + +#: src/file.c:1279 +msgid "Your changes will be lost if you don't save them." +msgstr "Все изменения будут потеряны, если вы их не сохраните." + +#: src/file.c:1282 +msgid "Close without saving" +msgstr "Закрыть без сохранения" + +#. Should not happen +#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 +#: data/glade/object-editor.glade.h:37 +msgid "points" +msgstr "точек" + +#: src/prefs.c:158 data/glade/object-editor.glade.h:36 +#: data/glade/template-designer.glade.h:74 +msgid "inches" +msgstr "дюймов" + +#: src/prefs.c:160 +msgid "mm" +msgstr "мм" + +#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 +msgid "gLabels Preferences" +msgstr "Параметры gLabels" + +#. +#. * Submenu: Order +#. +#: src/view.c:3574 data/ui/glabels-ui.xml.h:154 +msgid "_Order" +msgstr "_Порядок" + +#. +#. * Submenu: Rotate/Flip +#. +#: src/view.c:3595 data/ui/glabels-ui.xml.h:160 +msgid "_Rotate/Flip" +msgstr "_Повернуть/Отразить" + +#. +#. * Submenu: Align Horizontally +#. +#: src/view.c:3628 +msgid "Align _Horizontally" +msgstr "Выровнять _горизонтально" + +#. +#. * Submenu: Align Vertically +#. +#: src/view.c:3667 +msgid "Align _Vertically" +msgstr "Выровнять _вертикально" + +#: src/view.c:3728 data/ui/glabels-ui.xml.h:137 +msgid "_Delete" +msgstr "У_далить" + +#. Build editor. +#: src/view-box.c:236 +msgid "Box object properties" +msgstr "Свойства прямоугольника" + +#. Build editor. +#: src/view-ellipse.c:236 +msgid "Ellipse object properties" +msgstr "Свойства эллипса" + +#. Build editor. +#: src/view-line.c:229 +msgid "Line object properties" +msgstr "Свойство линии" + +#. Build editor. +#: src/view-image.c:223 +msgid "Image object properties" +msgstr "Свойства изображения" + +#. Build editor. +#: src/view-text.c:251 +msgid "Text object properties" +msgstr "Свойства текста" + +#: src/view-text.c:571 data/glade/object-editor.glade.h:28 +msgid "Text" +msgstr "Текст" + +#. Build editor. +#: src/view-barcode.c:210 +msgid "Barcode object properties" +msgstr "Свойства объекта типа штрих-код" + +#: src/view-barcode.c:594 src/print.c:1125 +msgid "Invalid barcode data" +msgstr "Неверные данные штрих-кода" + +#: src/merge-properties-dialog.c:231 +msgid "Merge Properties" +msgstr "Свойства объединения" + +#. ---- Source section ---- +#: src/merge-properties-dialog.c:237 +msgid "Source" +msgstr "Источник" + +#: src/merge-properties-dialog.c:245 +msgid "Format:" +msgstr "Формат:" + +#. Location line +#: src/merge-properties-dialog.c:273 +msgid "Location:" +msgstr "Расположение:" + +#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 +msgid "Select merge-database source" +msgstr "Выбрать источник данных для объединения" + +#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 +msgid "N/A" +msgstr "Недоступно" + +#. ---- Sample Fields section ---- +#: src/merge-properties-dialog.c:300 +msgid "Record selection/preview:" +msgstr "Просмотр и выбор записей:" + +#: src/merge-properties-dialog.c:326 +msgid "Select" +msgstr "Выбран" + +#: src/merge-properties-dialog.c:334 +msgid "Record/Field" +msgstr "Запись/Поле" + +#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 +msgid "Data" +msgstr "Данные" + +#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:81 +msgid "Print" +msgstr "Напечатать" + +#: src/print-dialog.c:281 +msgid "_Job" +msgstr "_Задание" + +#: src/print-dialog.c:286 +msgid "P_rinter" +msgstr "П_ринтер" + +#. ----------- Add simple-copies widget ------------ +#: src/print-dialog.c:314 +msgid "Copies" +msgstr "Копий" + +#. ------- Add merge control widget ------------ +#: src/print-dialog.c:322 +msgid "Document merge control" +msgstr "Управление объединением" + +#. ----------- Add custom print options area ------------ +#: src/print-dialog.c:330 +msgid "Options" +msgstr "Параметры" + +#: src/print-dialog.c:553 src/print-dialog.c:592 +msgid "Print preview" +msgstr "Просмотреть" + +#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 +msgid "gLabels Template Designer" +msgstr "Дизайнер шаблонов gLabels" + +#: src/bc.c:60 +msgid "POSTNET (any)" +msgstr "POSTNET (любой)" + +#: src/bc.c:63 +msgid "POSTNET-5 (ZIP only)" +msgstr "POSTNET-5 (только почтовый индекс)" + +#: src/bc.c:66 +msgid "POSTNET-9 (ZIP+4)" +msgstr "POSTNET-9 (ZIP+4)" + +#: src/bc.c:69 +msgid "POSTNET-11 (DPBC)" +msgstr "POSTNET-11 (DPBC)" + +#: src/bc.c:72 +msgid "EAN (any)" +msgstr "EAN (любой)" + +#: src/bc.c:75 +msgid "EAN-8" +msgstr "EAN-8" + +#: src/bc.c:78 +msgid "EAN-8 +2" +msgstr "EAN-8 +2" + +#: src/bc.c:81 +msgid "EAN-8 +5" +msgstr "EAN-8 +5" + +#: src/bc.c:84 +msgid "EAN-13" +msgstr "EAN-13" + +#: src/bc.c:87 +msgid "EAN-13 +2" +msgstr "EAN-13 +2" + +#: src/bc.c:90 +msgid "EAN-13 +5" +msgstr "EAN-13 +5" + +#: src/bc.c:93 +msgid "UPC (UPC-A or UPC-E)" +msgstr "UPC (UPC-A or UPC-E)" + +#: src/bc.c:96 +msgid "UPC-A" +msgstr "UPC-A" + +#: src/bc.c:99 +msgid "UPC-A +2" +msgstr "UPC-A +2" + +#: src/bc.c:102 +msgid "UPC-A +5" +msgstr "UPC-A +5" + +#: src/bc.c:105 +msgid "UPC-E" +msgstr "UPC-E" + +#: src/bc.c:108 +msgid "UPC-E +2" +msgstr "UPC-E +2" + +#: src/bc.c:111 +msgid "UPC-E +5" +msgstr "UPC-E +5" + +#: src/bc.c:114 +msgid "ISBN" +msgstr "ISBN" + +#: src/bc.c:117 +msgid "ISBN +5" +msgstr "ISBN +5" + +#: src/bc.c:120 +msgid "Code 39" +msgstr "Code 39" + +#: src/bc.c:123 +msgid "Code 128" +msgstr "Code 128" + +#: src/bc.c:126 +msgid "Code 128C" +msgstr "Code 128C" + +#: src/bc.c:129 +msgid "Code 128B" +msgstr "Code 128B" + +#: src/bc.c:132 +msgid "Interleaved 2 of 5" +msgstr "Interleaved 2 of 5" + +#: src/bc.c:135 +msgid "Codabar" +msgstr "" + +#: src/bc.c:138 +msgid "MSI" +msgstr "MSI" + +#: src/bc.c:141 +msgid "Plessey" +msgstr "" + +#: src/label.c:569 +msgid "Untitled" +msgstr "Без названия" + +#: src/xml-label.c:176 src/xml-label.c:213 +msgid "xmlParseFile error" +msgstr "Ошибка при разборе файла XML" + +#: src/xml-label.c:250 +msgid "No document root" +msgstr "Нет корня документа" + +#: src/xml-label.c:264 +msgid "Importing from glabels 0.1 format" +msgstr "Импортируем из файла glabels версии 0.1" + +#: src/xml-label.c:272 +msgid "Importing from glabels 0.4 format" +msgstr "Импортируем из файла glabels версии 0.4" + +#: src/xml-label.c:279 +msgid "Importing from glabels 1.91 format" +msgstr "Импортируем из формата glabels версии 1.91" + +#: src/xml-label.c:282 +msgid "bad document, unknown glabels Namespace" +msgstr "документ неверного типа, неизвестное пространство имён glabels" + +#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "Неверный корневой узел = \"%s\"" + +#: src/xml-label.c:348 src/xml-label-191.c:165 +#, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "Неверный узел в узле документа= \"%s\"" + +#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 +#, c-format +msgid "bad node = \"%s\"" +msgstr "неверный узел = \"%s\"" + +#: src/xml-label.c:855 src/xml-label-191.c:624 +#, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "неверный узел в узле данных= \"%s\"" + +#: src/xml-label.c:1030 libglabels/xml-template.c:535 +msgid "Utf8 conversion error." +msgstr "Ошибка преобразования UTF8." + +#: src/xml-label.c:1037 libglabels/xml-template.c:542 +msgid "Problem saving xml file." +msgstr "Проблемы при сохранении файла XML" + +#. This should always be an id, but just in case a name +#. slips by! +#: src/xml-label-191.c:699 libglabels/xml-template.c:199 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "Неизвестный идентификатор размера страницы \"%s\", пробуем как название" + +#: src/xml-label-191.c:709 libglabels/xml-template.c:209 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "Неизвестный идентификатор размера страницы или название \"%s\"" + +#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 +msgid "None" +msgstr "Ничего" + +#: src/merge-init.c:53 +msgid "Text file with comma delimeters (CSV)" +msgstr "Текст с разделителем \"запятая\" (CSV)" + +#: src/merge-init.c:60 +msgid "Text file with colon delimeters" +msgstr "Текст с разделителем \"двоеточие\"" + +#: src/merge-init.c:67 +msgid "Text file with tab delimeters" +msgstr "Текст с разделителем \"символ табуляции\"" + +#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 +msgid "File:" +msgstr "Файл:" + +#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 +msgid "Key:" +msgstr "Ключ:" + +#: src/wdgt-print-copies.c:179 +msgid "Sheets:" +msgstr "Листов:" + +#: src/wdgt-print-copies.c:197 +msgid "Labels" +msgstr "Этикетки" + +#: src/wdgt-print-copies.c:200 +msgid "from:" +msgstr "с:" + +#: src/wdgt-print-copies.c:207 +msgid "to:" +msgstr "до:" + +#: src/wdgt-print-merge.c:178 +msgid "Start on label" +msgstr "Начать с этикетки" + +#: src/wdgt-print-merge.c:186 +msgid "on 1st sheet" +msgstr "на первом листе" + +#: src/wdgt-print-merge.c:195 +msgid "Copies:" +msgstr "Копий:" + +#: src/wdgt-print-merge.c:201 +msgid "Collate" +msgstr "Собирать" + +#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 +msgid "Description:" +msgstr "Описание:" + +#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 +msgid "Page size:" +msgstr "Размер страницы:" + +#: src/wdgt-media-select.c:290 +msgid "Label size:" +msgstr "Размер этикетки:" + +#: src/wdgt-media-select.c:301 +msgid "Layout:" +msgstr "Формат:" + +#: src/wdgt-media-select.c:578 +#, c-format +msgid "%d x %d (%d per sheet)" +msgstr "%d x %d (%d на лист)" + +#: src/wdgt-media-select.c:582 +#, c-format +msgid "%d per sheet" +msgstr "%d на лист" + +#: src/wdgt-media-select.c:614 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +#: src/wdgt-media-select.c:619 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 +#, c-format +msgid "%s %s diameter" +msgstr "%s %s диаметр" + +#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 +#, c-format +msgid "%.5g %s diameter" +msgstr "%.5g %s диаметр" + +#: src/wdgt-rotate-label.c:193 +msgid "Rotate" +msgstr "Повернуть" + +#. This is the default custom color +#: src/mygal/color-palette.c:396 +msgid "custom" +msgstr "выборочно" + +#. "Custom" color - we'll pop up a GnomeColorPicker +#: src/mygal/color-palette.c:438 +msgid "Custom Color:" +msgstr "Пользовательский цвет:" + +#: src/mygal/color-palette.c:446 +msgid "Choose Custom Color" +msgstr "Выберите пользовательский цвет" + +#: src/mygal/color-palette.c:579 +msgid "black" +msgstr "чёрный" + +#: src/mygal/color-palette.c:580 +msgid "light brown" +msgstr "светло-коричневый" + +#: src/mygal/color-palette.c:581 +msgid "brown gold" +msgstr "золотой коричневый" + +#: src/mygal/color-palette.c:582 +msgid "dark green #2" +msgstr "чёрно-зелёный ?2" + +#: src/mygal/color-palette.c:583 +msgid "navy" +msgstr "морской" + +#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 +msgid "dark blue" +msgstr "тёмно-синий" + +#: src/mygal/color-palette.c:585 +msgid "purple #2" +msgstr "пурпурный ?2" + +#: src/mygal/color-palette.c:586 +msgid "very dark gray" +msgstr "очень тёмно-серый" + +#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 +msgid "dark red" +msgstr "тёмно-красный" + +#: src/mygal/color-palette.c:590 +msgid "red-orange" +msgstr "красно-оранжевый" + +#: src/mygal/color-palette.c:591 +msgid "gold" +msgstr "золотой" + +#: src/mygal/color-palette.c:592 +msgid "dark green" +msgstr "тёмно-зелёный" + +#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 +msgid "dull blue" +msgstr "тускло-синий" + +#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 +msgid "blue" +msgstr "синий" + +#: src/mygal/color-palette.c:595 +msgid "dull purple" +msgstr "тускло-пурпурный" + +#: src/mygal/color-palette.c:596 +msgid "dark grey" +msgstr "тёмно-серый" + +#: src/mygal/color-palette.c:599 +msgid "red" +msgstr "красный" + +#: src/mygal/color-palette.c:600 +msgid "orange" +msgstr "оранжевый" + +#: src/mygal/color-palette.c:601 +msgid "lime" +msgstr "лимонный" + +#: src/mygal/color-palette.c:602 +msgid "dull green" +msgstr "тускло-зелёный" + +#: src/mygal/color-palette.c:603 +msgid "dull blue #2" +msgstr "туско-синий ?2" + +#: src/mygal/color-palette.c:604 +msgid "sky blue #2" +msgstr "небесно-синий ?2" + +#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 +msgid "purple" +msgstr "пурпурный" + +#: src/mygal/color-palette.c:606 +msgid "gray" +msgstr "серый" + +#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 +msgid "magenta" +msgstr "малиновый" + +#: src/mygal/color-palette.c:610 +msgid "bright orange" +msgstr "ярко-оранжевый" + +#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 +msgid "yellow" +msgstr "жёлтый" + +#: src/mygal/color-palette.c:612 +msgid "green" +msgstr "зелёный" + +#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 +msgid "cyan" +msgstr "циан" + +#: src/mygal/color-palette.c:614 +msgid "bright blue" +msgstr "ярко-синий" + +#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 +msgid "red purple" +msgstr "красно-пурпурный" + +#: src/mygal/color-palette.c:616 +msgid "light grey" +msgstr "светло-серый" + +#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 +msgid "pink" +msgstr "розовый" + +#: src/mygal/color-palette.c:620 +msgid "light orange" +msgstr "светло-оранжевый" + +#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 +msgid "light yellow" +msgstr "светло-жёлтый" + +#: src/mygal/color-palette.c:622 +msgid "light green" +msgstr "светло-зелёный" + +#: src/mygal/color-palette.c:623 +msgid "light cyan" +msgstr "светло-циан" + +#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 +msgid "light blue" +msgstr "светло-синий" + +#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 +msgid "light purple" +msgstr "светло-пурпурный" + +#: src/mygal/color-palette.c:626 +msgid "white" +msgstr "белый" + +#: src/mygal/color-palette.c:631 +msgid "purplish blue" +msgstr "пурпурно-синий" + +#: src/mygal/color-palette.c:635 +msgid "dark purple" +msgstr "тёмно-пурпурный" + +#: src/mygal/color-palette.c:637 +msgid "sky blue" +msgstr "небесно-синий" + +#: libglabels/template.c:848 +#, c-format +msgid "Generic %s full page" +msgstr "Основная %s полная страница" + +#: libglabels/template.c:897 +msgid "No template files found!" +msgstr "Не найдены файлы шаблона!" + +#. Create and append an "Other" entry. +#: libglabels/paper.c:67 +msgid "Other" +msgstr "Другой" + +#: libglabels/paper.c:361 +msgid "No paper files found!" +msgstr "Не найдены файлы описания бумаги!" + +#: data/ui/glabels-ui.xml.h:1 +msgid "About glabels" +msgstr "О gLabels" + +#: data/ui/glabels-ui.xml.h:2 +msgid "About..." +msgstr "О программе..." + +#: data/ui/glabels-ui.xml.h:3 +msgid "Align _Horizontal" +msgstr "Выровнять по _горизонтали" + +#: data/ui/glabels-ui.xml.h:4 +msgid "Align _Vertical" +msgstr "Выровнять по _вертикали" + +#: data/ui/glabels-ui.xml.h:5 +msgid "Align objects to bottoms" +msgstr "Выровнять объекты по низам" + +#: data/ui/glabels-ui.xml.h:6 +msgid "Align objects to horizontal centers" +msgstr "Выровнять объекты по горизонтальным центрам" + +#: data/ui/glabels-ui.xml.h:7 +msgid "Align objects to left edges" +msgstr "Выровнять объекты по левому краю" + +#: data/ui/glabels-ui.xml.h:8 +msgid "Align objects to right edges" +msgstr "Выровнять объекты по правому краю" + +#: data/ui/glabels-ui.xml.h:9 +msgid "Align objects to tops" +msgstr "Выровнять объекты по верхам" + +#: data/ui/glabels-ui.xml.h:10 +msgid "Align objects to vertical centers" +msgstr "Выровнять объекты по вертикальным центрам" + +#: data/ui/glabels-ui.xml.h:12 +msgid "Bold" +msgstr "Жирный" + +#: data/ui/glabels-ui.xml.h:14 +msgid "Center align" +msgstr "Выровнять по центру" + +#: data/ui/glabels-ui.xml.h:15 +msgid "Center objects to horizontal label center" +msgstr "Центрировать объекты по центру горизонтальной метки" + +#: data/ui/glabels-ui.xml.h:16 +msgid "Center objects to vertical label center" +msgstr "Центрировать объекты по центру вертикальной метки" + +#: data/ui/glabels-ui.xml.h:17 +msgid "Change the visibility of markup lines in the current window" +msgstr "Изменить видимость линии разметки в текущем окне" + +#: data/ui/glabels-ui.xml.h:18 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "Изменить видимость панели инструментов для рисования в текущем окне" + +#: data/ui/glabels-ui.xml.h:19 +msgid "Change the visibility of the grid in the current window" +msgstr "Изменить видимость сетки в текущем окне" + +#: data/ui/glabels-ui.xml.h:20 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "Изменить видимость главной панели инструментов в текущем окне" + +#: data/ui/glabels-ui.xml.h:21 +msgid "Change the visibility of the property toolbar in the current window" +msgstr "Изменить видимость панели свойств в текущем окне" + +#: data/ui/glabels-ui.xml.h:22 +msgid "Close" +msgstr "Закрыть" + +#: data/ui/glabels-ui.xml.h:23 +msgid "Close the current file" +msgstr "Закрыть текущий файл" + +#: data/ui/glabels-ui.xml.h:24 +msgid "Configure the application" +msgstr "Настроить программу" + +#: data/ui/glabels-ui.xml.h:25 +msgid "Contents" +msgstr "Содержание справки" + +#: data/ui/glabels-ui.xml.h:26 +msgid "Copy" +msgstr "Запомнить" + +#: data/ui/glabels-ui.xml.h:27 +msgid "Copy the selection" +msgstr "Запомнить выделенное" + +#: data/ui/glabels-ui.xml.h:28 +msgid "Create a custom template" +msgstr "Создать свой шаблон" + +#: data/ui/glabels-ui.xml.h:29 +msgid "Create a new document" +msgstr "Создать новый документ" + +#: data/ui/glabels-ui.xml.h:30 +msgid "Create barcode object" +msgstr "Разместить штрих-код" + +#: data/ui/glabels-ui.xml.h:31 +msgid "Create box/rectangle object" +msgstr "Разместить прямоугольник" + +#: data/ui/glabels-ui.xml.h:32 +msgid "Create ellipse/circle object" +msgstr "Разместить эллипс/круг" + +#: data/ui/glabels-ui.xml.h:33 +msgid "Create image object" +msgstr "Разместить растровое изображение" + +#: data/ui/glabels-ui.xml.h:34 +msgid "Create line object" +msgstr "Разместить линию" + +#: data/ui/glabels-ui.xml.h:35 +msgid "Create text object" +msgstr "Разместить текст" + +#: data/ui/glabels-ui.xml.h:36 +msgid "Cu_t" +msgstr "_Вырезать" + +#: data/ui/glabels-ui.xml.h:37 +msgid "Customize" +msgstr "Настроить" + +#: data/ui/glabels-ui.xml.h:38 +msgid "Customize Drawing Toolbar" +msgstr "Настроить панель рисования" + +#: data/ui/glabels-ui.xml.h:39 +msgid "Customize Main Toolbar" +msgstr "Настроить панель инструментов" + +#: data/ui/glabels-ui.xml.h:40 +msgid "Customize Property Toolbar" +msgstr "Настроить панель свойств" + +#: data/ui/glabels-ui.xml.h:41 +msgid "Customize toolbars" +msgstr "Настроить панель инструментов" + +#: data/ui/glabels-ui.xml.h:42 +msgid "Cut" +msgstr "Вырезать" + +#: data/ui/glabels-ui.xml.h:43 +msgid "Cut the selection" +msgstr "Вырезать выделенное" + +#: data/ui/glabels-ui.xml.h:44 +msgid "Decrease magnification" +msgstr "Уменьшить" + +#: data/ui/glabels-ui.xml.h:45 +msgid "Delete" +msgstr "Удалить" + +#: data/ui/glabels-ui.xml.h:46 +msgid "Delete the selected objects" +msgstr "Удалить выбранные объекты" + +#: data/ui/glabels-ui.xml.h:47 +msgid "Drawing toolbar" +msgstr "Панель рисования" + +#: data/ui/glabels-ui.xml.h:48 +msgid "Dump XML" +msgstr "Дамп XML" + +#: data/ui/glabels-ui.xml.h:49 +msgid "Dump the UI Xml description" +msgstr "Дамп XML-описания UI" + +#: data/ui/glabels-ui.xml.h:50 +msgid "Edit merge properties" +msgstr "Изменить свойства объединения" + +#: data/ui/glabels-ui.xml.h:54 +msgid "Flip object horizontally" +msgstr "Отразить объект горизонтально" + +#: data/ui/glabels-ui.xml.h:55 +msgid "Flip object vertically" +msgstr "Отразить объект вертикально" + +#: data/ui/glabels-ui.xml.h:56 +msgid "Font name" +msgstr "Название шрифта" + +#: data/ui/glabels-ui.xml.h:57 +msgid "Font selector" +msgstr "Выбор шрифта" + +#: data/ui/glabels-ui.xml.h:58 +msgid "Font size" +msgstr "Размер шрифта" + +#: data/ui/glabels-ui.xml.h:59 +msgid "Icon and _Text" +msgstr "Пиктограмма и _Текст" + +#: data/ui/glabels-ui.xml.h:60 +msgid "Increase magnification" +msgstr "Увеличить" + +#: data/ui/glabels-ui.xml.h:61 +msgid "Italic" +msgstr "Курсив" + +#: data/ui/glabels-ui.xml.h:63 +msgid "Left align" +msgstr "Выровнять слева" + +#: data/ui/glabels-ui.xml.h:65 +msgid "Line width" +msgstr "Толщина линии" + +#: data/ui/glabels-ui.xml.h:66 +msgid "Lower object to bottom" +msgstr "Переместить объект на задний план" + +#: data/ui/glabels-ui.xml.h:67 +msgid "M_arkup" +msgstr "_Разметка" + +#: data/ui/glabels-ui.xml.h:68 +msgid "Main toolbar" +msgstr "Показывать панель инструментов" + +#: data/ui/glabels-ui.xml.h:69 +msgid "Markup" +msgstr "Разметка" + +#: data/ui/glabels-ui.xml.h:70 +msgid "Modify document properties" +msgstr "Изменить свойства документа" + +#: data/ui/glabels-ui.xml.h:71 +msgid "New" +msgstr "Создать" + +#: data/ui/glabels-ui.xml.h:72 +msgid "Object property editor" +msgstr "Редактор свойств объекта" + +#: data/ui/glabels-ui.xml.h:73 +msgid "Only show icons in the main toolbar" +msgstr "Показывать только картинки в главной панели инструментов" + +#: data/ui/glabels-ui.xml.h:75 +msgid "Open a file" +msgstr "Открыть файл" + +#: data/ui/glabels-ui.xml.h:76 +msgid "Open the glabels manual" +msgstr "Открыть руководство по glabels" + +#: data/ui/glabels-ui.xml.h:77 +msgid "Paste" +msgstr "Вставить" + +#: data/ui/glabels-ui.xml.h:78 +msgid "Paste the clipboard" +msgstr "Вставить из буфера" + +#: data/ui/glabels-ui.xml.h:79 +msgid "Pr_eferences..." +msgstr "_Настроить..." + +#: data/ui/glabels-ui.xml.h:80 +msgid "Preferences" +msgstr "Параметры" + +#: data/ui/glabels-ui.xml.h:82 +msgid "Print the current file" +msgstr "Напечатать текущий файл" + +#: data/ui/glabels-ui.xml.h:83 +msgid "Proper_ties..." +msgstr "Свойс_тва..." + +#: data/ui/glabels-ui.xml.h:84 +msgid "Properties" +msgstr "Свойства" + +#: data/ui/glabels-ui.xml.h:85 +msgid "Property toolbar" +msgstr "Панель свойств" + +#: data/ui/glabels-ui.xml.h:86 +msgid "Quit" +msgstr "Выйти" + +#: data/ui/glabels-ui.xml.h:87 +msgid "Quit the program" +msgstr "Выйти из программы" + +#: data/ui/glabels-ui.xml.h:88 +msgid "Raise object to top" +msgstr "Переместить объект на передний план" + +#: data/ui/glabels-ui.xml.h:89 +msgid "Recent _Files" +msgstr "Недавние _файлы" + +#: data/ui/glabels-ui.xml.h:90 +msgid "Redo" +msgstr "Повторить" + +#: data/ui/glabels-ui.xml.h:91 +msgid "Redo the undone action" +msgstr "Повторить отменённое действие" + +#: data/ui/glabels-ui.xml.h:92 +msgid "Remove all selections" +msgstr "Удалить всё выделенное" + +#: data/ui/glabels-ui.xml.h:94 +#, no-c-format +msgid "Restore scale to 100%" +msgstr "Масштаб 1:1" + +#: data/ui/glabels-ui.xml.h:95 +msgid "Right align" +msgstr "Выровнять справа" + +#: data/ui/glabels-ui.xml.h:98 +msgid "Rotate object 90 clockwise" +msgstr "Повернуть объект на 90 градусов по часовой стрелке" + +#: data/ui/glabels-ui.xml.h:99 +msgid "Rotate object 90 counter-clockwise" +msgstr "Повернуть объект на 90 градусов против часовой стрелке" + +#: data/ui/glabels-ui.xml.h:100 +msgid "Save" +msgstr "Сохранить" + +#: data/ui/glabels-ui.xml.h:101 +msgid "Save As" +msgstr "Сохранить как" + +#: data/ui/glabels-ui.xml.h:102 +msgid "Save _As..." +msgstr "Сохранить _как..." + +#: data/ui/glabels-ui.xml.h:103 +msgid "Save the current file" +msgstr "Сохранить текущий файл" + +#: data/ui/glabels-ui.xml.h:104 +msgid "Save the current file with a different name" +msgstr "Сохранить текущий файл под другим именем" + +#: data/ui/glabels-ui.xml.h:105 +msgid "Select All" +msgstr "Выбрать всё" + +#: data/ui/glabels-ui.xml.h:106 +msgid "Select _All" +msgstr "Выбрать вс_ё" + +#: data/ui/glabels-ui.xml.h:107 +msgid "Select all objects" +msgstr "Выбрать все объекты" + +#: data/ui/glabels-ui.xml.h:108 +msgid "Select, move and modify objects" +msgstr "Выбрать, переместить или изменить объекты" + +#: data/ui/glabels-ui.xml.h:110 +msgid "Set main toolbar button style according to desktop default" +msgstr "" +"Установить стиль кнопок главной панели инструментов согласно настройкам " +"рабочего стола" + +#: data/ui/glabels-ui.xml.h:111 +msgid "Show _Tooltips" +msgstr "Показывать _подсказки" + +#: data/ui/glabels-ui.xml.h:112 +msgid "Show both icons and texts in the main toolbar" +msgstr "Показывать и пиктограммы и текст в главной панели инструментов" + +#: data/ui/glabels-ui.xml.h:113 +msgid "Show tooltips in the drawing toolbar" +msgstr "Показывать подсказки в панели рисования" + +#: data/ui/glabels-ui.xml.h:114 +msgid "Show tooltips in the main toolbar" +msgstr "Показывать подсказки в главной панели инструментов" + +#: data/ui/glabels-ui.xml.h:115 +msgid "Show tooltips in the property toolbar" +msgstr "Показывать подсказки на панели свойств" + +#: data/ui/glabels-ui.xml.h:116 +msgid "Template Designer" +msgstr "Дизайнер шаблонов" + +#: data/ui/glabels-ui.xml.h:117 +msgid "Template _Designer..." +msgstr "Дизайнер _Шаблонов..." + +#: data/ui/glabels-ui.xml.h:118 +msgid "Text color" +msgstr "Цвет текста" + +#: data/ui/glabels-ui.xml.h:119 +msgid "U_n-select All" +msgstr "_Снять выделение со всего" + +#: data/ui/glabels-ui.xml.h:120 +msgid "Un-select All" +msgstr "_Снять выделение со всего" + +#: data/ui/glabels-ui.xml.h:121 +msgid "Undo" +msgstr "Отменить" + +#: data/ui/glabels-ui.xml.h:122 +msgid "Undo the last action" +msgstr "Отменить последнее действие" + +#: data/ui/glabels-ui.xml.h:123 +msgid "Zoom _1:1" +msgstr "Масштаб _1:1" + +#: data/ui/glabels-ui.xml.h:124 +msgid "Zoom _In" +msgstr "У_величить" + +#: data/ui/glabels-ui.xml.h:125 +msgid "Zoom _Out" +msgstr "У_меньшить" + +#: data/ui/glabels-ui.xml.h:126 +msgid "Zoom to _fit" +msgstr "Уместить целиком в окно" + +#: data/ui/glabels-ui.xml.h:127 +msgid "Zoom to fit window" +msgstr "Изменить масштаб, чтобы изображение было видно полностью" + +#: data/ui/glabels-ui.xml.h:128 +msgid "_About..." +msgstr "_О программе..." + +#: data/ui/glabels-ui.xml.h:129 +msgid "_Bottoms" +msgstr "По _низу" + +#: data/ui/glabels-ui.xml.h:132 +msgid "_Close" +msgstr "_Закрыть" + +#: data/ui/glabels-ui.xml.h:133 +msgid "_Contents" +msgstr "_Содержание справки" + +#: data/ui/glabels-ui.xml.h:134 +msgid "_Copy" +msgstr "_Запомнить" + +#: data/ui/glabels-ui.xml.h:135 +msgid "_Create Object" +msgstr "_Создать объект" + +#: data/ui/glabels-ui.xml.h:136 +msgid "_Debug" +msgstr "_Отладка" + +#: data/ui/glabels-ui.xml.h:138 +msgid "_Desktop Default" +msgstr "_Согласно настройкам рабочего стола" + +#: data/ui/glabels-ui.xml.h:139 +msgid "_Drawing Toolbar" +msgstr "Показывать панель _рисования" + +#: data/ui/glabels-ui.xml.h:140 +msgid "_Edit" +msgstr "_Правка" + +#: data/ui/glabels-ui.xml.h:142 +msgid "_File" +msgstr "_Файл" + +#: data/ui/glabels-ui.xml.h:143 +msgid "_Grid" +msgstr "_Сетка" + +#: data/ui/glabels-ui.xml.h:144 +msgid "_Help" +msgstr "_Справка" + +#: data/ui/glabels-ui.xml.h:145 +msgid "_Icon" +msgstr "_Пиктограмма" + +#: data/ui/glabels-ui.xml.h:149 +msgid "_Main Toolbar" +msgstr "Показывать панель _инструментов" + +#: data/ui/glabels-ui.xml.h:150 +msgid "_Merge Properties..." +msgstr "_Свойства объединения..." + +#: data/ui/glabels-ui.xml.h:151 +msgid "_New" +msgstr "_Создать" + +#: data/ui/glabels-ui.xml.h:152 +msgid "_Objects" +msgstr "_Объекты" + +#: data/ui/glabels-ui.xml.h:153 +msgid "_Open..." +msgstr "_Открыть..." + +#: data/ui/glabels-ui.xml.h:155 +msgid "_Paste" +msgstr "Вст_авить" + +#: data/ui/glabels-ui.xml.h:156 +msgid "_Print..." +msgstr "_Напечатать..." + +#: data/ui/glabels-ui.xml.h:157 +msgid "_Property Toolbar" +msgstr "Показывать панель с_войств" + +#: data/ui/glabels-ui.xml.h:158 +msgid "_Quit" +msgstr "В_ыйти" + +#: data/ui/glabels-ui.xml.h:161 +msgid "_Save" +msgstr "_Сохранить" + +#: data/ui/glabels-ui.xml.h:165 +msgid "_View" +msgstr "_Вид" + +#: data/glade/prefs-dialog.glade.h:1 +msgid " " +msgstr " " + +#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 +#: data/glade/template-designer.glade.h:5 +msgid "*" +msgstr "*" + +#: data/glade/prefs-dialog.glade.h:3 +msgid "Default page size" +msgstr "Размер страницы по умолчанию" + +#: data/glade/prefs-dialog.glade.h:4 +msgid "Fill" +msgstr "Заполнение" + +#: data/glade/prefs-dialog.glade.h:5 +msgid "Line" +msgstr "Линия" + +#: data/glade/prefs-dialog.glade.h:6 +msgid "Text" +msgstr "Текст" + +#: data/glade/prefs-dialog.glade.h:7 +msgid "Units" +msgstr "Единицы измерения" + +#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 +msgid "Alignment:" +msgstr "Выравнивание:" + +#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 +msgid "Color:" +msgstr "Цвет:" + +#: data/glade/prefs-dialog.glade.h:10 +msgid "Font:" +msgstr "Шрифт:" + +#: data/glade/prefs-dialog.glade.h:11 +msgid "ISO A4" +msgstr "ISO A4" + +#: data/glade/prefs-dialog.glade.h:12 +msgid "Inches" +msgstr "Дюймы" + +#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 +msgid "Line Spacing:" +msgstr "" +"Межстрочный\n" +"интервал:" + +#: data/glade/prefs-dialog.glade.h:14 +msgid "Locale" +msgstr "Локаль" + +#: data/glade/prefs-dialog.glade.h:15 +msgid "Millimeters" +msgstr "Миллиметры" + +#: data/glade/prefs-dialog.glade.h:16 +msgid "Object defaults" +msgstr "Настройки объектов по умолчанию" + +#: data/glade/prefs-dialog.glade.h:17 +msgid "Points" +msgstr "Пункты" + +#: data/glade/prefs-dialog.glade.h:18 +msgid "Select default properties for new objects." +msgstr "Укажите свойства новых объектов по умолчанию." + +#: data/glade/prefs-dialog.glade.h:19 +msgid "Select locale specific behavior." +msgstr "Укажите ваши предпочтения." + +#. Most popular (at top of list) +#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:29 +msgid "US Letter" +msgstr "US Letter" + +#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 +#: data/glade/template-designer.glade.h:72 +msgid "Width:" +msgstr "Ширина:" + +#: data/glade/object-editor.glade.h:2 +msgid "00000000000 00000" +msgstr "00000000000 00000" + +#: data/glade/object-editor.glade.h:3 +msgid "Xxx object properties" +msgstr "Xxx свойства объекта" + +#: data/glade/object-editor.glade.h:5 +msgid "Allow merge to automatically shrink text" +msgstr "Разрешить автоматически уменьшать текст при объединении" + +#: data/glade/object-editor.glade.h:6 +msgid "Angle:" +msgstr "Угол:" + +#: data/glade/object-editor.glade.h:7 +msgid "Checksum" +msgstr "Контрольная сумма" + +#: data/glade/object-editor.glade.h:10 +msgid "Family:" +msgstr "Семейство:" + +#: data/glade/object-editor.glade.h:12 +msgid "Fill" +msgstr "Заполнение" + +#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 +msgid "Height:" +msgstr "Высота:" + +#: data/glade/object-editor.glade.h:14 +msgid "Image" +msgstr "Изображение" + +#: data/glade/object-editor.glade.h:15 +msgid "Insert merge field" +msgstr "Вставить объединительное поле" + +#: data/glade/object-editor.glade.h:17 +msgid "Length:" +msgstr "Длина:" + +#: data/glade/object-editor.glade.h:18 +msgid "Line" +msgstr "Линия" + +#: data/glade/object-editor.glade.h:20 +msgid "Literal:" +msgstr "Буквально:" + +#: data/glade/object-editor.glade.h:21 +msgid "Load image" +msgstr "Загрузить изображение" + +#: data/glade/object-editor.glade.h:22 +msgid "Position" +msgstr "Расположение" + +#: data/glade/object-editor.glade.h:23 +msgid "Reset image size" +msgstr "Установить размер изображения по умолчанию" + +#: data/glade/object-editor.glade.h:24 +msgid "Size" +msgstr "Размер" + +#: data/glade/object-editor.glade.h:25 +msgid "Size:" +msgstr "Размер:" + +#: data/glade/object-editor.glade.h:26 +msgid "Style" +msgstr "Стиль:" + +#: data/glade/object-editor.glade.h:27 +msgid "Style:" +msgstr "Стиль:" + +#: data/glade/object-editor.glade.h:30 +msgid "X:" +msgstr "X:" + +#: data/glade/object-editor.glade.h:31 +msgid "Y:" +msgstr "Y:" + +#: data/glade/object-editor.glade.h:32 +msgid "degrees" +msgstr "градусов" + +#: data/glade/object-editor.glade.h:33 +msgid "dialog1" +msgstr "dialog1" + +#: data/glade/object-editor.glade.h:34 +msgid "digits:" +msgstr "цифры:" + +#: data/glade/object-editor.glade.h:35 +msgid "format:" +msgstr "формат:" + +#: data/glade/template-designer.glade.h:1 +msgid " " +msgstr " " + +#: data/glade/template-designer.glade.h:2 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "(например, \"Почтовые этикетки,\" \"Визитные карточки,\" ...)" + +#: data/glade/template-designer.glade.h:3 +msgid "(e.g., 8163A)" +msgstr "(e.g., 8163A)" + +#: data/glade/template-designer.glade.h:4 +msgid "(e.g., Avery, Acme, ...)" +msgstr "(e.g., Avery, Acme, ...)" + +#: data/glade/template-designer.glade.h:6 +msgid "1. Outer radius:" +msgstr "1. Наружный радиус:" + +#: data/glade/template-designer.glade.h:7 +msgid "1. Radius:" +msgstr "1. Радиус:" + +#: data/glade/template-designer.glade.h:8 +msgid "1. Width:" +msgstr "1. Ширина:" + +#: data/glade/template-designer.glade.h:9 +msgid "2. Height:" +msgstr "2. Высота:" + +#: data/glade/template-designer.glade.h:10 +msgid "2. Inner radius:" +msgstr "2. Внутренний радиус:" + +#: data/glade/template-designer.glade.h:11 +msgid "2. Waste (overprint allowed):" +msgstr "2. Пустое поле (на нём можно будет печать):" + +#: data/glade/template-designer.glade.h:12 +msgid "3. Clipping width:" +msgstr "3. Ширина для обрезки:" + +#: data/glade/template-designer.glade.h:13 +msgid "3. Margin" +msgstr "3. Поле" + +#: data/glade/template-designer.glade.h:14 +msgid "3. Round (radius of corner):" +msgstr "3. Округлость (радиус вершины):" + +#: data/glade/template-designer.glade.h:15 +msgid "4. Clipping height:" +msgstr "4. Высота обрезки:" + +#: data/glade/template-designer.glade.h:16 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "4. Пустое гориз. пространство (может быть заполнено):" + +#: data/glade/template-designer.glade.h:17 +msgid "5. Vert. waste (overprint allowed):" +msgstr "5. Пустое верт. пространство (может быть заполнено):" + +#: data/glade/template-designer.glade.h:18 +msgid "5. Waste (overprint allowed):" +msgstr "5. Пустое пространство (может быть заполнено):" + +#: data/glade/template-designer.glade.h:19 +msgid "6. Margin" +msgstr "6. Поле" + +#: data/glade/template-designer.glade.h:20 +msgid "Brand/Manufacturer:" +msgstr "Производитель или торговая марка:" + +#: data/glade/template-designer.glade.h:21 +msgid "CD/DVD (including credit card CDs)" +msgstr "CD/DVD (включая CD размером с визитку)" + +#: data/glade/template-designer.glade.h:22 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "" +"Поздравляем!\n" +"\n" +"Вы завершили создание шаблона в gLabels.\n" +"Чтобы сохранить разработку, нажмите \"Применить\"\n" +"\n" +"Также вы можете нажать \"Отменить\", чтобы не сохранять, или \"Назад\", " +"чтобы продолжить редактирование." + +#: data/glade/template-designer.glade.h:30 +msgid "Design Completed" +msgstr "Оформление завершено" + +#: data/glade/template-designer.glade.h:31 +msgid "Distance from left edge (x0):" +msgstr "Расстояние от левого угла (x0):" + +#: data/glade/template-designer.glade.h:32 +msgid "Distance from top edge (y0):" +msgstr "Расстояние от верхнего угла (y0)" + +#: data/glade/template-designer.glade.h:34 +msgid "Horizontal pitch (dx):" +msgstr "Интервал по горизонтали (dx):" + +#: data/glade/template-designer.glade.h:35 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" +"Сколько форм будет содержать шаблон? \n" +"\n" +"Форма - это набор этикеток или визиток, которые можут быть распределены по " +"простой сетке.\n" +"Большинству шаблонов требуется только одна форма, как в первом примере.\n" +"Второй пример иллюстрирует случай, когда необходимо применять две формы." + +#: data/glade/template-designer.glade.h:40 +msgid "Label Size (CD/DVD)" +msgstr "Размер метки (CD/DVD)" + +#: data/glade/template-designer.glade.h:41 +msgid "Label Size (Round)" +msgstr "Размер метки (диаметр)" + +#: data/glade/template-designer.glade.h:42 +msgid "Label or Card Shape" +msgstr "Форма этикетки или визитки" + +#: data/glade/template-designer.glade.h:43 +msgid "Label or Card Size (Rectangular)" +msgstr "Развер этикетки или визитки (прямоугольник)" + +#: data/glade/template-designer.glade.h:44 +msgid "Layout #1" +msgstr "Форма #1" + +#: data/glade/template-designer.glade.h:45 +msgid "Layout #2" +msgstr "Форма #2" + +#: data/glade/template-designer.glade.h:46 +msgid "Layout(s)" +msgstr "Формы" + +#: data/glade/template-designer.glade.h:47 +msgid "Name and Description" +msgstr "Название и Описание" + +#: data/glade/template-designer.glade.h:48 +msgid "Number across (nx):" +msgstr "По горизонтали (nx):" + +#: data/glade/template-designer.glade.h:49 +msgid "Number down (ny):" +msgstr "По вертикали (ny):" + +#: data/glade/template-designer.glade.h:50 +msgid "Number of Layouts" +msgstr "Количество форм" + +#: data/glade/template-designer.glade.h:51 +msgid "Number of layouts:" +msgstr "Количество форм:" + +#: data/glade/template-designer.glade.h:52 +msgid "Page Size" +msgstr "Размер страницы" + +#: data/glade/template-designer.glade.h:54 +msgid "Part #:" +msgstr "Часть #:" + +#: data/glade/template-designer.glade.h:55 +msgid "" +"Please enter the following identifying information about the template " +"stationery." +msgstr "Укажите следующую идентификационную информацию о ." + +#: data/glade/template-designer.glade.h:56 +msgid "Please enter the following layout information." +msgstr "Введите следующую информацию об оформлении." + +#: data/glade/template-designer.glade.h:57 +msgid "" +"Please enter the following size parameters of a single label in your " +"template." +msgstr "Введите геометрические размеры одиночной этикетки в вашем шаблоне." + +#: data/glade/template-designer.glade.h:58 +msgid "" +"Please enter the following size parameters of a single label or card in your " +"template." +msgstr "" +"Введите геометрические размеры одиночной этикетки или визитки в вашем " +"шаблоне." + +#: data/glade/template-designer.glade.h:59 +msgid "Please select the basic shape of the labels or cards." +msgstr "Выберите основную фигуру этикетки или карточки." + +#: data/glade/template-designer.glade.h:60 +msgid "Please select the page size of the template stationery." +msgstr "Выберите размер страницы для шаблона." + +#: data/glade/template-designer.glade.h:61 +msgid "Print test sheet" +msgstr "Напечатать тестовую страницу" + +#: data/glade/template-designer.glade.h:62 +msgid "Rectangular or square (can have rounded corners)" +msgstr "Прямоугольник или квадрат (может иметь скруглённые края)" + +#: data/glade/template-designer.glade.h:63 +msgid "Round" +msgstr "Круг" + +#: data/glade/template-designer.glade.h:64 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" +"Для данного шаблона\n" +"требуется две формы." + +#: data/glade/template-designer.glade.h:66 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" +"Для данного шаблона требуется\n" +"только одна форма." + +#: data/glade/template-designer.glade.h:68 +msgid "Vertical pitch (dy):" +msgstr "Интервал по вертикали (dy):" + +#: data/glade/template-designer.glade.h:69 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" +"Добро пожаловать в Дизайнер шаблонов gLabels.\n" +"\n" +"Этот диалог будет сопровождать вас в создании вашего собственного шаблона " +"gLabels." + +#. Other ISO A series sizes +#: data/templates/paper-sizes.xml.h:2 +msgid "A0" +msgstr "A0" + +#: data/templates/paper-sizes.xml.h:3 +msgid "A1" +msgstr "A1" + +#: data/templates/paper-sizes.xml.h:4 +msgid "A10" +msgstr "A10" + +#: data/templates/paper-sizes.xml.h:5 +msgid "A2" +msgstr "A2" + +#: data/templates/paper-sizes.xml.h:6 +msgid "A3" +msgstr "A3" + +#: data/templates/paper-sizes.xml.h:7 +msgid "A4" +msgstr "A4" + +#: data/templates/paper-sizes.xml.h:8 +msgid "A5" +msgstr "A5" + +#: data/templates/paper-sizes.xml.h:9 +msgid "A6" +msgstr "A6" + +#: data/templates/paper-sizes.xml.h:10 +msgid "A7" +msgstr "A7" + +#: data/templates/paper-sizes.xml.h:11 +msgid "A8" +msgstr "A8" + +#: data/templates/paper-sizes.xml.h:12 +msgid "A9" +msgstr "A9" + +#. ISO B series sizes +#: data/templates/paper-sizes.xml.h:14 +msgid "B0" +msgstr "B0" + +#: data/templates/paper-sizes.xml.h:15 +msgid "B1" +msgstr "B1" + +#: data/templates/paper-sizes.xml.h:16 +msgid "B10" +msgstr "B10" + +#: data/templates/paper-sizes.xml.h:17 +msgid "B2" +msgstr "B2" + +#: data/templates/paper-sizes.xml.h:18 +msgid "B3" +msgstr "B3" + +#: data/templates/paper-sizes.xml.h:19 +msgid "B4" +msgstr "B4" + +#: data/templates/paper-sizes.xml.h:20 +msgid "B5" +msgstr "B5" + +#: data/templates/paper-sizes.xml.h:21 +msgid "B6" +msgstr "B6" + +#: data/templates/paper-sizes.xml.h:22 +msgid "B7" +msgstr "B7" + +#: data/templates/paper-sizes.xml.h:23 +msgid "B8" +msgstr "B8" + +#: data/templates/paper-sizes.xml.h:24 +msgid "B9" +msgstr "B9" + +#: data/templates/paper-sizes.xml.h:25 +msgid "US Executive" +msgstr "US Executive" + +#. Other US paper sizes +#: data/templates/paper-sizes.xml.h:27 +msgid "US Legal" +msgstr "US Legal" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:2 +#: data/templates/zweckform-iso-templates.xml.h:2 +msgid "Address Labels" +msgstr "Этикетка с адресом" + +#. =================================================================== +#. ============================================================ +#. =================================================================== +#. ====================================================== +#: data/templates/avery-us-templates.xml.h:4 +#: data/templates/avery-iso-templates.xml.h:4 +#: data/templates/zweckform-iso-templates.xml.h:6 +#: data/templates/misc-us-templates.xml.h:3 +#: data/templates/misc-iso-templates.xml.h:17 +msgid "Business Cards" +msgstr "Визитные карточки" + +#: data/templates/avery-us-templates.xml.h:5 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "Метки для CD/DVD (Наклейки на диск)" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:7 +msgid "Diskette Labels" +msgstr "Наклейки на дискеты" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:9 +msgid "Filing Labels" +msgstr "Заполняемые этикетки" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:11 +msgid "Full Sheet Labels" +msgstr "Этикетки на всю страницу" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:13 +msgid "Large Round Labels" +msgstr "Этикетки с большим закруглением" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:15 +msgid "Name Badge Labels" +msgstr "Именной бейджик" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:17 +msgid "Return Address Labels" +msgstr "Наклейка для обратного адреса" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:19 +msgid "Shipping Labels" +msgstr "Ценники" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:21 +msgid "Small Round Labels" +msgstr "Маленькие круглые этикетки" + +#. =================================================================== +#: data/templates/avery-us-templates.xml.h:23 +msgid "Square Labels" +msgstr "Прямоугольные этикетки" + +#: data/templates/avery-us-templates.xml.h:24 +msgid "Video Tape Face Labels" +msgstr "Лицевые наклейки на видеокассету" + +#: data/templates/avery-us-templates.xml.h:25 +msgid "Video Tape Spine Labels" +msgstr "Торцевые наклейки на видеокассету" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:2 +msgid "Address labels" +msgstr "Адресные наклейки" + +#. =============================================================== +#: data/templates/avery-iso-templates.xml.h:6 +msgid "CD Booklet" +msgstr "Вкладыш в CD" + +#. =============================================================== +#: data/templates/avery-iso-templates.xml.h:8 +#, fuzzy +msgid "CD Inlet" +msgstr "CD" + +#. =============================================================== +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:10 +#: data/templates/zweckform-iso-templates.xml.h:8 +#: data/templates/misc-us-templates.xml.h:5 +#: data/templates/misc-iso-templates.xml.h:21 +msgid "CD/DVD Labels" +msgstr "Этикетки для CD/DVD" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:12 +msgid "Diskette labels" +msgstr "Наклейки на дискеты" + +#. =============================================================== +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:14 +#: data/templates/zweckform-iso-templates.xml.h:14 +#: data/templates/misc-iso-templates.xml.h:35 +msgid "Mailing Labels" +msgstr "Почтовые этикетки" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:16 +msgid "Mailing labels" +msgstr "Почтовые наклейки" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:18 +msgid "Mini Address Labels" +msgstr "Маленькие наклейки с адресом" + +#. =================================================================== +#: data/templates/avery-iso-templates.xml.h:20 +msgid "Shipping labels" +msgstr "Ценники" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:4 +msgid "Allround Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:10 +msgid "Correction and Cover-up Labels" +msgstr "Исправляющие и покрывающие метки" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:12 +#, fuzzy +msgid "Lever Arch File Labels" +msgstr "Файл" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:16 +#, fuzzy +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "x" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:18 +msgid "Rectangular Copier Labels" +msgstr "" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:20 +#: data/templates/misc-iso-templates.xml.h:44 +msgid "Rectangular Labels" +msgstr "Прямоугольные метки" + +#. =================================================================== +#: data/templates/zweckform-iso-templates.xml.h:22 +msgid "Video Labels (back)" +msgstr "Видеонаклейки (оборотная сторона)" + +#: data/templates/misc-us-templates.xml.h:1 +msgid "Business Card CD" +msgstr "Визитная карточка на CD" + +#: data/templates/misc-us-templates.xml.h:4 +msgid "CD Template Rectangles" +msgstr "Прямоугольный шаблон для CD" + +#: data/templates/misc-us-templates.xml.h:6 +msgid "CD/DVD Labels (Face Only)" +msgstr "Наклейки для CD/DVD (лицевая сторона)" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:7 +#: data/templates/misc-iso-templates.xml.h:23 +msgid "CD/DVD Labels (face only)" +msgstr "Вкладыши CD/DVD (лицевая сторона)" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:9 +msgid "Cassette Labels" +msgstr "Наклейки на кассеты" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:11 +msgid "DLT Labels" +msgstr "Этикетки на DLT" + +#. =================================================================== +#: data/templates/misc-us-templates.xml.h:13 +msgid "Microtube labels" +msgstr "Этикетки для Microtube" + +#: data/templates/misc-us-templates.xml.h:14 +msgid "Mini-CD Labels" +msgstr "Этикетки для Мини-CD" + +#: data/templates/misc-us-templates.xml.h:15 +#, fuzzy +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "CD CD" + +#: data/templates/misc-us-templates.xml.h:16 +#, fuzzy +msgid "PRO CD Labels 2-up (Face only)" +msgstr "CD" + +#: data/templates/misc-us-templates.xml.h:17 +#: data/templates/misc-iso-templates.xml.h:42 +#, fuzzy +msgid "PRO CD Labels 2-up (face only)" +msgstr "CD" + +#: data/templates/misc-us-templates.xml.h:18 +msgid "Slimline CD Case (rightside up)" +msgstr "Тонкие коробки для CD (правая сторона вверху)" + +#: data/templates/misc-us-templates.xml.h:19 +msgid "Slimline CD Case (upside down)" +msgstr "Тонкие коробки для CD (кверх ногами)" + +#: data/templates/misc-iso-templates.xml.h:1 +msgid "Agipa 119488: Business Cards" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:3 +msgid "Allround Labels --24" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:5 +msgid "Allround Labels --44" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:7 +msgid "Allround Labels --64" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:9 +msgid "Allround Labels --65" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:11 +#, fuzzy +msgid "Arch File Labels" +msgstr "Файл" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:13 +#, fuzzy +msgid "Arch File Labels (large)" +msgstr "Файл большой" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:15 +#, fuzzy +msgid "Arch File Labels (small)" +msgstr "Файл маленький" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:19 +msgid "CD Labels" +msgstr "Этикетки для CD" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:25 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "Наклейки стандартного формата для CD/DVD (лицевая сторона)" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:27 +msgid "Diskette Labels (face only)" +msgstr "Наклейки для дискет (лицевая сторона)" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:29 +msgid "EPSON Photo Stickers 16" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:31 +msgid "Etiketten" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:33 +msgid "Fridge Magnet Stickers" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:37 +msgid "Mailing Labels --14" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:39 +msgid "Mailing Labels-2 columns" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:41 +msgid "Mailing Labels-3 columns" +msgstr "" + +#. =================================================================== +#: data/templates/misc-iso-templates.xml.h:46 +msgid "Video Labels (face only)" +msgstr "Наклейки на видеокассеты (лицевая сторона)" + +#: data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers" +msgstr "Создание этикеток, визитных карточек и вкладышей для дисков" + +#: data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "Дизайнер этикеток gLabels" + +#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 +msgid "gLabels Project File" +msgstr "Файл проекта gLabels" + diff --git a/po/zh_TW.Big5.po b/po/zh_TW.Big5.po new file mode 100644 index 00000000..485e1ccc --- /dev/null +++ b/po/zh_TW.Big5.po @@ -0,0 +1,2650 @@ +# Traditional Chinese Translation for glabels +# Copyright (C) 2002 Free Software Foundation, Inc. +# Shell Hung , 2002 +# +msgid "" +msgstr "" +"Project-Id-Version: glabels 0.4.4\n" +"POT-Creation-Date: 2004-08-08 00:43-0400\n" +"PO-Revision-Date: 2002-07-14 18:30+0800\n" +"Last-Translator: Shell Hung \n" +"Language-Team: zh-l10n \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=big5\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/glabels.c:55 +msgid "Show view debugging messages." +msgstr "" + +#: src/glabels.c:58 +msgid "Show item debugging messages." +msgstr "" + +#: src/glabels.c:61 +msgid "Show printing debugging messages." +msgstr "" + +#: src/glabels.c:64 +msgid "Show prefs debugging messages." +msgstr "" + +#: src/glabels.c:67 +msgid "Show file debugging messages." +msgstr "" + +#: src/glabels.c:70 +msgid "Show document debugging messages." +msgstr "" + +#: src/glabels.c:73 +msgid "Show template debugging messages." +msgstr "" + +#: src/glabels.c:76 +msgid "Show paper debugging messages." +msgstr "" + +#: src/glabels.c:79 +msgid "Show xml debugging messages." +msgstr "" + +#: src/glabels.c:82 +msgid "Show document merge debugging messages." +msgstr "" + +#: src/glabels.c:85 +msgid "Show commands debugging messages." +msgstr "" + +#: src/glabels.c:88 +msgid "Show undo debugging messages." +msgstr "" + +#: src/glabels.c:91 +msgid "Show recent debugging messages." +msgstr "" + +#: src/glabels.c:94 +msgid "Show window debugging messages." +msgstr "" + +#: src/glabels.c:97 +msgid "Show ui debugging messages." +msgstr "" + +#: src/glabels.c:100 +msgid "Show property_bar debugging messages." +msgstr "" + +#: src/glabels.c:103 +msgid "Show media select widget debugging messages." +msgstr "" + +#: src/glabels.c:106 +msgid "Show mini preview widget debugging messages." +msgstr "" + +#: src/glabels.c:109 +msgid "Show pixbuf cache debugging messages." +msgstr "" + +#: src/glabels.c:112 +msgid "Show widget debugging messages." +msgstr "" + +#: src/glabels.c:115 +msgid "Show object editor debugging messages." +msgstr "" + +#: src/glabels.c:118 +msgid "Turn on all debugging messages." +msgstr "" + +#: src/glabels.c:187 +msgid "Could not initialize Bonobo!\n" +msgstr "" + +#: src/glabels-batch.c:48 +msgid "print this message" +msgstr "¦C¦L³o­Ó°T®§" + +#: src/glabels-batch.c:50 +msgid "print the version of glabels-batch being used" +msgstr "¦C¦L¥X glabels-batch ªºª©¥»¸ê°T" + +#: src/glabels-batch.c:52 +msgid "set output filename (default=\"output.ps\")" +msgstr "³]©w¿é¥XÀɦWºÙ (¹w³]¬°\"output.ps\")" + +#: src/glabels-batch.c:52 +msgid "filename" +msgstr "ÀɮצWºÙ" + +#: src/glabels-batch.c:54 +msgid "number of sheets (default=1)" +msgstr "¯È±i¼Æ¥Ø (¹w³]¬° 1)" + +#: src/glabels-batch.c:54 +msgid "sheets" +msgstr "¯È±i" + +#: src/glabels-batch.c:56 +msgid "number of copies (default=1)" +msgstr "¥÷¼Æ (¹w³]¬° 1)" + +#: src/glabels-batch.c:56 +msgid "copies" +msgstr "¥÷¼Æ" + +#: src/glabels-batch.c:58 src/print-dialog.c:336 +msgid "print outlines (to test printer alignment)" +msgstr "¦L¥X¥~Ãä (´ú¸Õ¥´¦L¾÷°Ñ¼Æ)" + +#: src/glabels-batch.c:60 src/print-dialog.c:344 +msgid "print in reverse (i.e. a mirror image)" +msgstr "¤Ï¤è¦V¦C¦L (¦p­Ë¦V¼v¹³)" + +#: src/glabels-batch.c:96 +msgid "[OPTION...] GLABELS_FILE..." +msgstr "[¿ï¶µ...] GLABELS_FILE..." + +#: src/glabels-batch.c:116 +msgid "missing glabels file\n" +msgstr "¨S¦³¿é¤J glabels ªºÀÉ®×\n" + +#: src/glabels-batch.c:157 +#, c-format +msgid "cannot open glabels file %s\n" +msgstr "¶}±ÒÀÉ®×¥¢±Ñ %s\n" + +#: src/window.c:244 +msgid "(none) - gLabels" +msgstr "" + +#: src/window.c:414 +msgid "(modified)" +msgstr "" + +#: src/stock.c:65 data/ui/glabels-ui.xml.h:165 +#, fuzzy +msgid "_Select Mode" +msgstr "¿ï¾Ü" + +#: src/stock.c:66 data/ui/glabels-ui.xml.h:166 +#, fuzzy +msgid "_Text" +msgstr "¤å¦r" + +#: src/stock.c:67 data/ui/glabels-ui.xml.h:151 +#, fuzzy +msgid "_Line" +msgstr "½u" + +#: src/stock.c:68 data/ui/glabels-ui.xml.h:133 +#, fuzzy +msgid "_Box" +msgstr "²°¤l" + +#: src/stock.c:69 data/ui/glabels-ui.xml.h:144 +#, fuzzy +msgid "_Ellipse" +msgstr "¾ò¶ê§Î" + +#: src/stock.c:70 data/ui/glabels-ui.xml.h:149 +#, fuzzy +msgid "_Image" +msgstr "¹Ï¹³" + +#: src/stock.c:71 data/ui/glabels-ui.xml.h:11 +#, fuzzy +msgid "Bar_code" +msgstr "¼Æ½X±ø" + +#: src/stock.c:72 +#, fuzzy +msgid "_Merge Properties" +msgstr "¦X¨Ö³]©w" + +#: src/stock.c:73 +#, fuzzy +msgid "Object _Properties" +msgstr "¤å¦r¼Ë»ª" + +#: src/stock.c:74 data/ui/glabels-ui.xml.h:13 +#, fuzzy +msgid "Bring to _Front" +msgstr "±a¥X¨ì«e­±" + +#: src/stock.c:75 data/ui/glabels-ui.xml.h:110 +#, fuzzy +msgid "Send to _Back" +msgstr "©ñ¦b³Ì©³" + +#: src/stock.c:76 data/ui/glabels-ui.xml.h:97 +#, fuzzy +msgid "Rotate _Left" +msgstr "±ÛÂà" + +#: src/stock.c:77 data/ui/glabels-ui.xml.h:98 +#, fuzzy +msgid "Rotate _Right" +msgstr "±ÛÂà" + +#: src/stock.c:78 data/ui/glabels-ui.xml.h:52 +msgid "Flip _Horizontally" +msgstr "" + +#: src/stock.c:79 data/ui/glabels-ui.xml.h:53 +msgid "Flip _Vertically" +msgstr "" + +#: src/stock.c:80 data/ui/glabels-ui.xml.h:150 +msgid "_Lefts" +msgstr "" + +#: src/stock.c:81 data/ui/glabels-ui.xml.h:162 +msgid "_Rights" +msgstr "" + +#: src/stock.c:82 data/ui/glabels-ui.xml.h:134 +msgid "_Centers" +msgstr "" + +#: src/stock.c:83 data/ui/glabels-ui.xml.h:167 +#, fuzzy +msgid "_Tops" +msgstr "¤u¨ã (&_T)" + +#: src/stock.c:84 +msgid "Bottoms" +msgstr "" + +#: src/stock.c:85 +msgid "Centers" +msgstr "" + +#: src/stock.c:86 src/stock.c:87 data/ui/glabels-ui.xml.h:62 +msgid "Label Ce_nter" +msgstr "" + +#: src/stock.c:88 data/ui/glabels-ui.xml.h:51 +msgid "Fill color" +msgstr "" + +#: src/stock.c:89 data/ui/glabels-ui.xml.h:64 +msgid "Line color" +msgstr "" + +#: src/stock.c:90 src/stock.c:92 +#, fuzzy +msgid "Linked" +msgstr "½u" + +#: src/stock.c:91 src/stock.c:93 +#, fuzzy +msgid "Not Linked" +msgstr "¨S¦³" + +#: src/ui-property-bar.c:345 src/object-editor.c:499 +#, fuzzy +msgid "Default" +msgstr "§R°£" + +#: src/ui-property-bar.c:360 src/object-editor.c:512 +msgid "No fill" +msgstr "" + +#: src/ui-property-bar.c:375 src/object-editor.c:505 +#, fuzzy +msgid "No line" +msgstr "¨S¦³" + +#: src/ui-sidebar.c:180 +#, fuzzy +msgid "Object properties" +msgstr "¤å¦r¼Ë»ª" + +#: src/commands.c:385 +msgid "" +"A label and business card creation program for GNOME.\n" +" \n" +"Glabels is free software; you can redistribute it and/or modify it under the " +"terms of the GNU General Public License as published by the Free Software " +"Foundation; either version 2 of the License, or (at your option) any later " +"version.\n" +" \n" +"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.\n" +msgstr "" +"A label and business card creation program for GNOME.\n" +" \n" +"Glabels is free software; you can redistribute it and/or modify it under the " +"terms of the GNU General Public License as published by the Free Software " +"Foundation; either version 2 of the License, or (at your option) any later " +"version.\n" +" \n" +"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.\n" + +#: src/commands.c:399 +msgid "See the file AUTHORS for additional credits," +msgstr "" + +#: src/commands.c:400 +msgid "or visit http://glabels.sourceforge.net/" +msgstr "" + +#: src/commands.c:409 +msgid " " +msgstr "" + +#: src/commands.c:424 +#, fuzzy +msgid "glabels" +msgstr "¼Ðñ" + +#: src/file.c:100 +msgid "New Label or Card" +msgstr "·s¼W¼Ðñ©Î¥d" + +#: src/file.c:132 src/file.c:304 +msgid "Media Type" +msgstr "´CÅéºØÃþ" + +#: src/file.c:138 src/file.c:310 +msgid "Label orientation" +msgstr "¼Ðñ¤è¦V" + +#: src/file.c:269 +#, fuzzy +msgid "Label properties" +msgstr "¤å¦r¼Ë»ª" + +#: src/file.c:452 src/file.c:870 +msgid "All files" +msgstr "" + +#: src/file.c:457 src/file.c:875 +#, fuzzy +msgid "gLabels documents" +msgstr "Glabels: ³]©w­È" + +#: src/file.c:505 src/file.c:617 src/file.c:934 src/file.c:1130 +#, fuzzy +msgid "Empty file name selection" +msgstr "²¾°£©Ò¦³¿ï¾Ü¶µ" + +#: src/file.c:506 src/file.c:520 src/file.c:618 src/file.c:632 +msgid "Please select a file or supply a valid file name" +msgstr "" + +#: src/file.c:519 src/file.c:631 +msgid "File does not exist" +msgstr "" + +#: src/file.c:563 data/ui/glabels-ui.xml.h:75 +msgid "Open" +msgstr "¶}±Ò" + +#: src/file.c:565 +msgid "Open label" +msgstr "¶}±Ò¼Ðñ" + +#: src/file.c:707 +#, fuzzy, c-format +msgid "Could not open file \"%s\"" +msgstr "¶}±ÒÀÉ®×¥¢±Ñ" + +#: src/file.c:715 +msgid "Not a supported file format" +msgstr "" + +#: src/file.c:797 src/file.c:979 src/file.c:1174 +#, fuzzy, c-format +msgid "Could not save file \"%s\"" +msgstr "¤£¯àÀx¦sÀÉ®×" + +#: src/file.c:805 src/file.c:987 src/file.c:1182 +msgid "Error encountered during save. The file is still not saved." +msgstr "" + +#: src/file.c:848 src/file.c:1048 +#, fuzzy, c-format +msgid "Save \"%s\" as" +msgstr "Àx¦s¼Ðñ¬°..." + +#: src/file.c:935 src/file.c:1131 +#, fuzzy +msgid "Please supply a valid file name" +msgstr "½Ð¥²»Ý¿é¤JÀɮצWºÙ" + +#: src/file.c:952 src/file.c:1147 +#, c-format +msgid "Overwrite file \"%s\"?" +msgstr "" + +#: src/file.c:960 src/file.c:1155 +msgid "File already exists." +msgstr "" + +#: src/file.c:1271 +#, c-format +msgid "Save changes to document \"%s\" before closing?" +msgstr "" + +#: src/file.c:1279 +msgid "Your changes will be lost if you don't save them." +msgstr "" + +#: src/file.c:1282 +msgid "Close without saving" +msgstr "" + +#. Should not happen +#: src/prefs.c:156 src/prefs.c:163 data/glade/prefs-dialog.glade.h:23 +#: data/glade/object-editor.glade.h:37 +msgid "points" +msgstr "ÂI" + +#: src/prefs.c:158 data/glade/object-editor.glade.h:36 +#: data/glade/template-designer.glade.h:74 +msgid "inches" +msgstr "­^¤o" + +#: src/prefs.c:160 +msgid "mm" +msgstr "mm" + +#: src/prefs-dialog.c:248 data/glade/prefs-dialog.glade.h:22 +#, fuzzy +msgid "gLabels Preferences" +msgstr "Glabels: ³]©w­È" + +#. +#. * Submenu: Order +#. +#: src/view.c:3570 data/ui/glabels-ui.xml.h:157 +msgid "_Order" +msgstr "" + +#. +#. * Submenu: Rotate/Flip +#. +#: src/view.c:3591 data/ui/glabels-ui.xml.h:163 +#, fuzzy +msgid "_Rotate/Flip" +msgstr "±ÛÂà" + +#. +#. * Submenu: Align Horizontally +#. +#: src/view.c:3624 +msgid "Align _Horizontally" +msgstr "" + +#. +#. * Submenu: Align Vertically +#. +#: src/view.c:3663 +msgid "Align _Vertically" +msgstr "" + +#: src/view.c:3724 data/ui/glabels-ui.xml.h:140 +#, fuzzy +msgid "_Delete" +msgstr "§R°£" + +#. Build editor. +#: src/view-box.c:223 +#, fuzzy +msgid "Box object properties" +msgstr "­×§ï¤è¶ôª«¥ó³]©w" + +#. Build editor. +#: src/view-ellipse.c:223 +#, fuzzy +msgid "Ellipse object properties" +msgstr "­×§ï¾ò¶êª«¥ó³]©w" + +#. Build editor. +#: src/view-line.c:223 +#, fuzzy +msgid "Line object properties" +msgstr "­×§ï¤è¶ôª«¥ó³]©w" + +#. Build editor. +#: src/view-image.c:222 +#, fuzzy +msgid "Image object properties" +msgstr "­×§ï¹Ï¹³ª«¥ó³]©w" + +#. Build editor. +#: src/view-text.c:250 +#, fuzzy +msgid "Text object properties" +msgstr "­×§ï¤è¶ôª«¥ó³]©w" + +#: src/view-text.c:562 data/glade/object-editor.glade.h:28 +msgid "Text" +msgstr "¤å¦r" + +#. Build editor. +#: src/view-barcode.c:209 +#, fuzzy +msgid "Barcode object properties" +msgstr "­×§ï¼Æ½X±øª«¥ó³]©w" + +#: src/view-barcode.c:579 src/print.c:1088 +#, fuzzy +msgid "Invalid barcode data" +msgstr "¤£¥¿½Tªº¼Æ½X±ø" + +#: src/merge-properties-dialog.c:231 +#, fuzzy +msgid "Merge Properties" +msgstr "¦X¨Ö³]©w" + +#. ---- Source section ---- +#: src/merge-properties-dialog.c:237 +msgid "Source" +msgstr "¨Ó·½ÀÉ" + +#: src/merge-properties-dialog.c:245 +msgid "Format:" +msgstr "®æ¦¡:" + +#. Location line +#: src/merge-properties-dialog.c:273 +msgid "Location:" +msgstr "¦ì¸m:" + +#: src/merge-properties-dialog.c:282 src/merge-properties-dialog.c:393 +msgid "Select merge-database source" +msgstr "¿ï¾Ü¦X¨Ö¸ê®Æ®w¨Ó·½" + +#: src/merge-properties-dialog.c:289 src/merge-properties-dialog.c:404 +msgid "N/A" +msgstr "N/A" + +#. ---- Sample Fields section ---- +#: src/merge-properties-dialog.c:300 +msgid "Record selection/preview:" +msgstr "" + +#: src/merge-properties-dialog.c:326 +msgid "Select" +msgstr "¿ï¾Ü" + +#: src/merge-properties-dialog.c:334 +msgid "Record/Field" +msgstr "" + +#: src/merge-properties-dialog.c:342 data/glade/object-editor.glade.h:9 +msgid "Data" +msgstr "¸ê®Æ" + +#: src/print-dialog.c:266 data/ui/glabels-ui.xml.h:82 +msgid "Print" +msgstr "¦C¦L" + +#: src/print-dialog.c:281 +msgid "_Job" +msgstr "" + +#: src/print-dialog.c:286 +#, fuzzy +msgid "P_rinter" +msgstr "¦C¦L" + +#. ----------- Add simple-copies widget ------------ +#: src/print-dialog.c:314 +msgid "Copies" +msgstr "¥÷¼Æ" + +#. ------- Add merge control widget ------------ +#: src/print-dialog.c:322 +msgid "Document merge control" +msgstr "¤å¥ó¦X¨Ö±±¨î" + +#. ----------- Add custom print options area ------------ +#: src/print-dialog.c:330 +msgid "Options" +msgstr "³]©w" + +#: src/print-dialog.c:351 +msgid "print crop marks" +msgstr "" + +#: src/print-dialog.c:553 src/print-dialog.c:592 +msgid "Print preview" +msgstr "¹wÄý¦C¦L" + +#: src/template-designer.c:409 data/glade/template-designer.glade.h:73 +msgid "gLabels Template Designer" +msgstr "" + +#: src/bc.c:60 +msgid "POSTNET (any)" +msgstr "" + +#: src/bc.c:63 +msgid "POSTNET-5 (ZIP only)" +msgstr "" + +#: src/bc.c:66 +msgid "POSTNET-9 (ZIP+4)" +msgstr "" + +#: src/bc.c:69 +msgid "POSTNET-11 (DPBC)" +msgstr "" + +#: src/bc.c:72 +msgid "EAN (any)" +msgstr "" + +#: src/bc.c:75 +msgid "EAN-8" +msgstr "" + +#: src/bc.c:78 +msgid "EAN-8 +2" +msgstr "" + +#: src/bc.c:81 +msgid "EAN-8 +5" +msgstr "" + +#: src/bc.c:84 +msgid "EAN-13" +msgstr "" + +#: src/bc.c:87 +msgid "EAN-13 +2" +msgstr "" + +#: src/bc.c:90 +msgid "EAN-13 +5" +msgstr "" + +#: src/bc.c:93 +msgid "UPC (UPC-A or UPC-E)" +msgstr "" + +#: src/bc.c:96 +msgid "UPC-A" +msgstr "" + +#: src/bc.c:99 +msgid "UPC-A +2" +msgstr "" + +#: src/bc.c:102 +msgid "UPC-A +5" +msgstr "" + +#: src/bc.c:105 +msgid "UPC-E" +msgstr "" + +#: src/bc.c:108 +msgid "UPC-E +2" +msgstr "" + +#: src/bc.c:111 +msgid "UPC-E +5" +msgstr "" + +#: src/bc.c:114 +msgid "ISBN" +msgstr "" + +#: src/bc.c:117 +msgid "ISBN +5" +msgstr "" + +#: src/bc.c:120 +msgid "Code 39" +msgstr "" + +#: src/bc.c:123 +msgid "Code 128" +msgstr "" + +#: src/bc.c:126 +msgid "Code 128C" +msgstr "" + +#: src/bc.c:129 +msgid "Code 128B" +msgstr "" + +#: src/bc.c:132 +msgid "Interleaved 2 of 5" +msgstr "" + +#: src/bc.c:135 +msgid "Codabar" +msgstr "" + +#: src/bc.c:138 +msgid "MSI" +msgstr "" + +#: src/bc.c:141 +msgid "Plessey" +msgstr "" + +#: src/label.c:569 +msgid "Untitled" +msgstr "" + +#: src/xml-label.c:176 src/xml-label.c:213 +msgid "xmlParseFile error" +msgstr "xmlParseFile ¿ù»~" + +#: src/xml-label.c:250 +msgid "No document root" +msgstr "¨S¦³¤å¥ó©lºÝ" + +#: src/xml-label.c:264 +msgid "Importing from glabels 0.1 format" +msgstr "" + +#: src/xml-label.c:272 +msgid "Importing from glabels 0.4 format" +msgstr "" + +#: src/xml-label.c:279 +msgid "Importing from glabels 1.91 format" +msgstr "" + +#: src/xml-label.c:282 +#, fuzzy +msgid "bad document, unknown glabels Namespace" +msgstr "¤£¥¿½Tªº¤å¥óºØÃþ, §ä¤£¨ì glabels ®æ¦¡" + +#: src/xml-label.c:311 src/xml-label-04.c:75 src/xml-label-191.c:131 +#, c-format +msgid "Bad root node = \"%s\"" +msgstr "¿ù»~ªº°ò½X = \"%s\"" + +#: src/xml-label.c:348 src/xml-label-191.c:165 +#, fuzzy, c-format +msgid "bad node in Document node = \"%s\"" +msgstr "¿ù»~ªº°ò½X = \"%s\"" + +#: src/xml-label.c:393 src/xml-label-04.c:123 src/xml-label-191.c:197 +#, c-format +msgid "bad node = \"%s\"" +msgstr "¿ù»~ªº¸`ÂI = \"%s\"" + +#: src/xml-label.c:796 src/xml-label-191.c:605 +#, fuzzy, c-format +msgid "bad node in Data node = \"%s\"" +msgstr "¿ù»~ªº¸`ÂI = \"%s\"" + +#: src/xml-label.c:962 libglabels/xml-template.c:528 +msgid "Utf8 conversion error." +msgstr "" + +#: src/xml-label.c:969 libglabels/xml-template.c:535 +msgid "Problem saving xml file." +msgstr "Àx¦s XML Àɮ׮ɵo¥Í¿ù»~." + +#. This should always be an id, but just in case a name +#. slips by! +#: src/xml-label-191.c:680 libglabels/xml-template.c:192 +#, c-format +msgid "Unknown page size id \"%s\", trying as name" +msgstr "" + +#: src/xml-label-191.c:690 libglabels/xml-template.c:202 +#, c-format +msgid "Unknown page size id or name \"%s\"" +msgstr "" + +#: src/merge.c:172 src/merge.c:213 src/merge.c:399 src/merge.c:402 +msgid "None" +msgstr "¨S¦³" + +#: src/merge-init.c:53 +#, fuzzy +msgid "Text file with comma delimeters (CSV)" +msgstr "¥H³r¸¹¤À®æ (CSV)" + +#: src/merge-init.c:60 +#, fuzzy +msgid "Text file with colon delimeters" +msgstr "¥H«_¸¹¤À®æ" + +#: src/merge-init.c:67 +#, fuzzy +msgid "Text file with tab delimeters" +msgstr "¥H [TAB] ¬°¤À®æ" + +#: src/wdgt-image-select.c:201 data/glade/object-editor.glade.h:11 +#, fuzzy +msgid "File:" +msgstr "¶ñº¡" + +#: src/wdgt-image-select.c:245 data/glade/object-editor.glade.h:16 +msgid "Key:" +msgstr "¸ê®Æ­È:" + +#: src/wdgt-print-copies.c:179 +msgid "Sheets:" +msgstr "¯È±i:" + +#: src/wdgt-print-copies.c:197 +msgid "Labels" +msgstr "¼Ðñ" + +#: src/wdgt-print-copies.c:200 +msgid "from:" +msgstr "¥Ñ:" + +#: src/wdgt-print-copies.c:207 +msgid "to:" +msgstr "¨ì:" + +#: src/wdgt-print-merge.c:178 +msgid "Start on label" +msgstr "¥Ñ¸Tñ¶}¯Å" + +#: src/wdgt-print-merge.c:186 +msgid "on 1st sheet" +msgstr "¦b­º±i¯È" + +#: src/wdgt-print-merge.c:195 +msgid "Copies:" +msgstr "¥÷¼Æ:" + +#: src/wdgt-print-merge.c:201 +msgid "Collate" +msgstr "®Õ¹ï" + +#: src/wdgt-media-select.c:269 data/glade/template-designer.glade.h:29 +msgid "Description:" +msgstr "´y­z:" + +#: src/wdgt-media-select.c:279 data/glade/template-designer.glade.h:53 +msgid "Page size:" +msgstr "¯È±i¤j¤p:" + +#: src/wdgt-media-select.c:290 +msgid "Label size:" +msgstr "¼Ðñ¤j¤p:" + +#: src/wdgt-media-select.c:301 +msgid "Layout:" +msgstr "ª©­±:" + +#: src/wdgt-media-select.c:578 +#, c-format +msgid "%d x %d (%d per sheet)" +msgstr "%d x %d (¨C­¶ %d)" + +#: src/wdgt-media-select.c:582 +#, fuzzy, c-format +msgid "%d per sheet" +msgstr "%d x %d (¨C­¶ %d)" + +#: src/wdgt-media-select.c:614 +#, c-format +msgid "%s x %s %s" +msgstr "%s x %s %s" + +#: src/wdgt-media-select.c:619 +#, c-format +msgid "%.5g x %.5g %s" +msgstr "%.5g x %.5g %s" + +#: src/wdgt-media-select.c:630 src/wdgt-media-select.c:644 +#, c-format +msgid "%s %s diameter" +msgstr "" + +#: src/wdgt-media-select.c:634 src/wdgt-media-select.c:648 +#, c-format +msgid "%.5g %s diameter" +msgstr "" + +#: src/wdgt-rotate-label.c:193 +msgid "Rotate" +msgstr "±ÛÂà" + +#. This is the default custom color +#: src/mygal/color-palette.c:396 +#, fuzzy +msgid "custom" +msgstr "¦Û­qÄæ¦ìÆ_" + +#. "Custom" color - we'll pop up a GnomeColorPicker +#: src/mygal/color-palette.c:438 +#, fuzzy +msgid "Custom Color:" +msgstr "ÃC¦â:" + +#: src/mygal/color-palette.c:446 +msgid "Choose Custom Color" +msgstr "" + +#: src/mygal/color-palette.c:579 +msgid "black" +msgstr "" + +#: src/mygal/color-palette.c:580 +msgid "light brown" +msgstr "" + +#: src/mygal/color-palette.c:581 +msgid "brown gold" +msgstr "" + +#: src/mygal/color-palette.c:582 +msgid "dark green #2" +msgstr "" + +#: src/mygal/color-palette.c:583 +msgid "navy" +msgstr "" + +#: src/mygal/color-palette.c:584 src/mygal/color-palette.c:640 +msgid "dark blue" +msgstr "" + +#: src/mygal/color-palette.c:585 +msgid "purple #2" +msgstr "" + +#: src/mygal/color-palette.c:586 +msgid "very dark gray" +msgstr "" + +#: src/mygal/color-palette.c:589 src/mygal/color-palette.c:645 +msgid "dark red" +msgstr "" + +#: src/mygal/color-palette.c:590 +msgid "red-orange" +msgstr "" + +#: src/mygal/color-palette.c:591 +msgid "gold" +msgstr "" + +#: src/mygal/color-palette.c:592 +msgid "dark green" +msgstr "" + +#: src/mygal/color-palette.c:593 src/mygal/color-palette.c:646 +msgid "dull blue" +msgstr "" + +#: src/mygal/color-palette.c:594 src/mygal/color-palette.c:647 +msgid "blue" +msgstr "" + +#: src/mygal/color-palette.c:595 +msgid "dull purple" +msgstr "" + +#: src/mygal/color-palette.c:596 +msgid "dark grey" +msgstr "" + +#: src/mygal/color-palette.c:599 +msgid "red" +msgstr "" + +#: src/mygal/color-palette.c:600 +msgid "orange" +msgstr "" + +#: src/mygal/color-palette.c:601 +msgid "lime" +msgstr "" + +#: src/mygal/color-palette.c:602 +msgid "dull green" +msgstr "" + +#: src/mygal/color-palette.c:603 +msgid "dull blue #2" +msgstr "" + +#: src/mygal/color-palette.c:604 +msgid "sky blue #2" +msgstr "" + +#: src/mygal/color-palette.c:605 src/mygal/color-palette.c:644 +msgid "purple" +msgstr "" + +#: src/mygal/color-palette.c:606 +msgid "gray" +msgstr "" + +#: src/mygal/color-palette.c:609 src/mygal/color-palette.c:641 +#, fuzzy +msgid "magenta" +msgstr "¹Ï¹³" + +#: src/mygal/color-palette.c:610 +msgid "bright orange" +msgstr "" + +#: src/mygal/color-palette.c:611 src/mygal/color-palette.c:642 +msgid "yellow" +msgstr "" + +#: src/mygal/color-palette.c:612 +#, fuzzy +msgid "green" +msgstr "«×¼Æ" + +#: src/mygal/color-palette.c:613 src/mygal/color-palette.c:643 +msgid "cyan" +msgstr "" + +#: src/mygal/color-palette.c:614 +msgid "bright blue" +msgstr "" + +#: src/mygal/color-palette.c:615 src/mygal/color-palette.c:632 +msgid "red purple" +msgstr "" + +#: src/mygal/color-palette.c:616 +msgid "light grey" +msgstr "" + +#: src/mygal/color-palette.c:619 src/mygal/color-palette.c:636 +msgid "pink" +msgstr "" + +#: src/mygal/color-palette.c:620 +msgid "light orange" +msgstr "" + +#: src/mygal/color-palette.c:621 src/mygal/color-palette.c:633 +msgid "light yellow" +msgstr "" + +#: src/mygal/color-palette.c:622 +msgid "light green" +msgstr "" + +#: src/mygal/color-palette.c:623 +msgid "light cyan" +msgstr "" + +#: src/mygal/color-palette.c:624 src/mygal/color-palette.c:634 +msgid "light blue" +msgstr "" + +#: src/mygal/color-palette.c:625 src/mygal/color-palette.c:638 +msgid "light purple" +msgstr "" + +#: src/mygal/color-palette.c:626 +msgid "white" +msgstr "" + +#: src/mygal/color-palette.c:631 +msgid "purplish blue" +msgstr "" + +#: src/mygal/color-palette.c:635 +msgid "dark purple" +msgstr "" + +#: src/mygal/color-palette.c:637 +msgid "sky blue" +msgstr "" + +#: libglabels/template.c:848 +#, c-format +msgid "Generic %s full page" +msgstr "" + +#: libglabels/template.c:897 +msgid "No template files found!" +msgstr "§ä¤£¨ì¼Ëª©ÀÉ®× !" + +#. Create and append an "Other" entry. +#: libglabels/paper.c:67 +msgid "Other" +msgstr "" + +#: libglabels/paper.c:361 +#, fuzzy +msgid "No paper files found!" +msgstr "§ä¤£¨ì¼Ëª©ÀÉ®× !" + +#: data/ui/glabels-ui.xml.h:1 +msgid "About glabels" +msgstr "" + +#: data/ui/glabels-ui.xml.h:2 +msgid "About..." +msgstr "" + +#: data/ui/glabels-ui.xml.h:3 +msgid "Align _Horizontal" +msgstr "" + +#: data/ui/glabels-ui.xml.h:4 +msgid "Align _Vertical" +msgstr "" + +#: data/ui/glabels-ui.xml.h:5 +msgid "Align objects to bottoms" +msgstr "" + +#: data/ui/glabels-ui.xml.h:6 +msgid "Align objects to horizontal centers" +msgstr "" + +#: data/ui/glabels-ui.xml.h:7 +msgid "Align objects to left edges" +msgstr "" + +#: data/ui/glabels-ui.xml.h:8 +msgid "Align objects to right edges" +msgstr "" + +#: data/ui/glabels-ui.xml.h:9 +msgid "Align objects to tops" +msgstr "" + +#: data/ui/glabels-ui.xml.h:10 +msgid "Align objects to vertical centers" +msgstr "" + +#: data/ui/glabels-ui.xml.h:12 +msgid "Bold" +msgstr "" + +#: data/ui/glabels-ui.xml.h:14 +#, fuzzy +msgid "Center align" +msgstr "¤@¯ë" + +#: data/ui/glabels-ui.xml.h:15 +msgid "Center objects to horizontal label center" +msgstr "" + +#: data/ui/glabels-ui.xml.h:16 +msgid "Center objects to vertical label center" +msgstr "" + +#: data/ui/glabels-ui.xml.h:17 +msgid "Change the visibility of markup lines in the current window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:18 +msgid "Change the visibility of the drawing toolbar in the current window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:19 +msgid "Change the visibility of the grid in the current window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:20 +msgid "Change the visibility of the main toolbar in the current window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:21 +msgid "Change the visibility of the property toolbar in the current window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:22 +msgid "Close" +msgstr "" + +#: data/ui/glabels-ui.xml.h:23 +#, fuzzy +msgid "Close the current file" +msgstr "Àx¦s²{¦bÀÉ®×" + +#: data/ui/glabels-ui.xml.h:24 +msgid "Configure the application" +msgstr "" + +#: data/ui/glabels-ui.xml.h:25 +msgid "Contents" +msgstr "" + +#: data/ui/glabels-ui.xml.h:26 +msgid "Copy" +msgstr "" + +#: data/ui/glabels-ui.xml.h:27 +#, fuzzy +msgid "Copy the selection" +msgstr "²¾°£©Ò¦³¿ï¾Ü¶µ" + +#: data/ui/glabels-ui.xml.h:28 +#, fuzzy +msgid "Create a custom template" +msgstr "µe½uª«¥ó" + +#: data/ui/glabels-ui.xml.h:29 +#, fuzzy +msgid "Create a new document" +msgstr "µe½uª«¥ó" + +#: data/ui/glabels-ui.xml.h:30 +msgid "Create barcode object" +msgstr "«Ø¥ß¼Æ½X±ø" + +#: data/ui/glabels-ui.xml.h:31 +msgid "Create box/rectangle object" +msgstr "«Ø¥ß·sªº²°¤l/¤è§Îª«¥ó" + +#: data/ui/glabels-ui.xml.h:32 +msgid "Create ellipse/circle object" +msgstr "«Ø¥ß¾ò¶ê§Î/¹Ï§Îª«¥ó" + +#: data/ui/glabels-ui.xml.h:33 +msgid "Create image object" +msgstr "«Ø¥ß¼v¹³ª«¥ó" + +#: data/ui/glabels-ui.xml.h:34 +msgid "Create line object" +msgstr "µe½uª«¥ó" + +#: data/ui/glabels-ui.xml.h:35 +msgid "Create text object" +msgstr "«Ø¥ß·sªº¤å¦rª«¥ó" + +#: data/ui/glabels-ui.xml.h:36 +msgid "Cu_t" +msgstr "" + +#: data/ui/glabels-ui.xml.h:37 +#, fuzzy +msgid "Customize" +msgstr "¦Û­qÄæ¦ìÆ_" + +#: data/ui/glabels-ui.xml.h:38 +msgid "Customize Drawing Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:39 +msgid "Customize Main Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:40 +msgid "Customize Property Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:41 +msgid "Customize toolbars" +msgstr "" + +#: data/ui/glabels-ui.xml.h:42 +msgid "Cut" +msgstr "" + +#: data/ui/glabels-ui.xml.h:43 +msgid "Cut the selection" +msgstr "" + +#: data/ui/glabels-ui.xml.h:44 +msgid "Decrease magnification" +msgstr "" + +#: data/ui/glabels-ui.xml.h:45 +msgid "Delete" +msgstr "§R°£" + +#: data/ui/glabels-ui.xml.h:46 +#, fuzzy +msgid "Delete the selected objects" +msgstr "«Ø¥ß·sªº¤å¦rª«¥ó" + +#: data/ui/glabels-ui.xml.h:47 +msgid "Drawing toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:48 +msgid "Dump XML" +msgstr "" + +#: data/ui/glabels-ui.xml.h:49 +msgid "Dump the UI Xml description" +msgstr "" + +#: data/ui/glabels-ui.xml.h:50 +msgid "Edit merge properties" +msgstr "­×§ï¦X¨Ö³]©w" + +#: data/ui/glabels-ui.xml.h:54 +msgid "Flip object horizontally" +msgstr "" + +#: data/ui/glabels-ui.xml.h:55 +msgid "Flip object vertically" +msgstr "" + +#: data/ui/glabels-ui.xml.h:56 +#, fuzzy +msgid "Font name" +msgstr "¤£­nÀx¦s" + +#: data/ui/glabels-ui.xml.h:57 +#, fuzzy +msgid "Font selector" +msgstr "²¾°£©Ò¦³¿ï¾Ü¶µ" + +#: data/ui/glabels-ui.xml.h:58 +#, fuzzy +msgid "Font size" +msgstr "¤£­nÀx¦s" + +#: data/ui/glabels-ui.xml.h:59 +msgid "Icon and _Text" +msgstr "" + +#: data/ui/glabels-ui.xml.h:60 +msgid "Increase magnification" +msgstr "" + +#: data/ui/glabels-ui.xml.h:61 +msgid "Italic" +msgstr "" + +#: data/ui/glabels-ui.xml.h:63 +msgid "Left align" +msgstr "" + +#: data/ui/glabels-ui.xml.h:65 +msgid "Line width" +msgstr "" + +#: data/ui/glabels-ui.xml.h:66 +msgid "Lower object to bottom" +msgstr "" + +#: data/ui/glabels-ui.xml.h:67 +msgid "M_arkup" +msgstr "" + +#: data/ui/glabels-ui.xml.h:68 +msgid "Main toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:69 +msgid "Markup" +msgstr "" + +#: data/ui/glabels-ui.xml.h:70 +#, fuzzy +msgid "Modify document properties" +msgstr "­×§ï¤å¥ó¦X¨Ö³]©w" + +#: data/ui/glabels-ui.xml.h:71 +#, fuzzy +msgid "New" +msgstr "·s¼W (&_N)" + +#: data/ui/glabels-ui.xml.h:72 +#, fuzzy +msgid "Object property editor" +msgstr "¤å¦r¼Ë»ª" + +#: data/ui/glabels-ui.xml.h:73 +msgid "Only show icons in the drawing toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:74 +msgid "Only show icons in the main toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:76 +msgid "Open a file" +msgstr "¶}±ÒÀÉ®×" + +#: data/ui/glabels-ui.xml.h:77 +#, fuzzy +msgid "Open the glabels manual" +msgstr "¶}±Ò¼Ðñ" + +#: data/ui/glabels-ui.xml.h:78 +msgid "Paste" +msgstr "" + +#: data/ui/glabels-ui.xml.h:79 +msgid "Paste the clipboard" +msgstr "" + +#: data/ui/glabels-ui.xml.h:80 +#, fuzzy +msgid "Pr_eferences..." +msgstr "Glabels: ³]©w­È" + +#: data/ui/glabels-ui.xml.h:81 +#, fuzzy +msgid "Preferences" +msgstr "Glabels: ³]©w­È" + +#: data/ui/glabels-ui.xml.h:83 +#, fuzzy +msgid "Print the current file" +msgstr "¦C¦L²{¦³ÀÉ®×" + +#: data/ui/glabels-ui.xml.h:84 +#, fuzzy +msgid "Proper_ties..." +msgstr "¤å¦r¼Ë»ª" + +#: data/ui/glabels-ui.xml.h:85 +#, fuzzy +msgid "Properties" +msgstr "¤å¦r¼Ë»ª" + +#: data/ui/glabels-ui.xml.h:86 +msgid "Property toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:87 +msgid "Quit" +msgstr "" + +#: data/ui/glabels-ui.xml.h:88 +msgid "Quit the program" +msgstr "" + +#: data/ui/glabels-ui.xml.h:89 +msgid "Raise object to top" +msgstr "" + +#: data/ui/glabels-ui.xml.h:90 +msgid "Recent _Files" +msgstr "" + +#: data/ui/glabels-ui.xml.h:91 +msgid "Redo" +msgstr "" + +#: data/ui/glabels-ui.xml.h:92 +msgid "Redo the undone action" +msgstr "" + +#: data/ui/glabels-ui.xml.h:93 +msgid "Remove all selections" +msgstr "²¾°£©Ò¦³¿ï¾Ü¶µ" + +#: data/ui/glabels-ui.xml.h:95 +#, no-c-format +msgid "Restore scale to 100%" +msgstr "" + +#: data/ui/glabels-ui.xml.h:96 +msgid "Right align" +msgstr "" + +#: data/ui/glabels-ui.xml.h:99 +msgid "Rotate object 90 clockwise" +msgstr "" + +#: data/ui/glabels-ui.xml.h:100 +msgid "Rotate object 90 counter-clockwise" +msgstr "" + +#: data/ui/glabels-ui.xml.h:101 +#, fuzzy +msgid "Save" +msgstr "¥t¦s¬°..." + +#: data/ui/glabels-ui.xml.h:102 +msgid "Save As" +msgstr "¥t¦s¬°..." + +#: data/ui/glabels-ui.xml.h:103 +#, fuzzy +msgid "Save _As..." +msgstr "¥t¦s¬°..." + +#: data/ui/glabels-ui.xml.h:104 +#, fuzzy +msgid "Save the current file" +msgstr "Àx¦s²{¦bÀÉ®×" + +#: data/ui/glabels-ui.xml.h:105 +msgid "Save the current file with a different name" +msgstr "" + +#: data/ui/glabels-ui.xml.h:106 +#, fuzzy +msgid "Select All" +msgstr "¤Ï¿ï¾Ü¥þ³¡ (&_N)" + +#: data/ui/glabels-ui.xml.h:107 +#, fuzzy +msgid "Select _All" +msgstr "¤Ï¿ï¾Ü¥þ³¡ (&_N)" + +#: data/ui/glabels-ui.xml.h:108 +#, fuzzy +msgid "Select all objects" +msgstr "¿ï¾Ü, ²¾°Ê¤Î­×§ïª«¥ó" + +#: data/ui/glabels-ui.xml.h:109 +msgid "Select, move and modify objects" +msgstr "¿ï¾Ü, ²¾°Ê¤Î­×§ïª«¥ó" + +#: data/ui/glabels-ui.xml.h:111 +msgid "Set drawing toolbar button style according to desktop default" +msgstr "" + +#: data/ui/glabels-ui.xml.h:112 +msgid "Set main toolbar button style according to desktop default" +msgstr "" + +#: data/ui/glabels-ui.xml.h:113 +msgid "Show _Tooltips" +msgstr "" + +#: data/ui/glabels-ui.xml.h:114 +msgid "Show both icons and texts in the drawing toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:115 +msgid "Show both icons and texts in the main toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:116 +msgid "Show tooltips in the drawing toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:117 +msgid "Show tooltips in the main toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:118 +msgid "Show tooltips in the property toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:119 +msgid "Template Designer" +msgstr "" + +#: data/ui/glabels-ui.xml.h:120 +msgid "Template _Designer..." +msgstr "" + +#: data/ui/glabels-ui.xml.h:121 +msgid "Text color" +msgstr "" + +#: data/ui/glabels-ui.xml.h:122 +#, fuzzy +msgid "U_n-select All" +msgstr "¤Ï¿ï¾Ü¥þ³¡ (&_N)" + +#: data/ui/glabels-ui.xml.h:123 +#, fuzzy +msgid "Un-select All" +msgstr "¤Ï¿ï¾Ü¥þ³¡ (&_N)" + +#: data/ui/glabels-ui.xml.h:124 +msgid "Undo" +msgstr "" + +#: data/ui/glabels-ui.xml.h:125 +msgid "Undo the last action" +msgstr "" + +#: data/ui/glabels-ui.xml.h:126 +#, fuzzy +msgid "Zoom _1:1" +msgstr "1:1 Åã¥Ü" + +#: data/ui/glabels-ui.xml.h:127 +#, fuzzy +msgid "Zoom _In" +msgstr "©ñ¤j" + +#: data/ui/glabels-ui.xml.h:128 +#, fuzzy +msgid "Zoom _Out" +msgstr "ÁY¤p" + +#: data/ui/glabels-ui.xml.h:129 +#, fuzzy +msgid "Zoom to _fit" +msgstr "1:1 Åã¥Ü" + +#: data/ui/glabels-ui.xml.h:130 +msgid "Zoom to fit window" +msgstr "" + +#: data/ui/glabels-ui.xml.h:131 +msgid "_About..." +msgstr "" + +#: data/ui/glabels-ui.xml.h:132 +msgid "_Bottoms" +msgstr "" + +#: data/ui/glabels-ui.xml.h:135 +msgid "_Close" +msgstr "" + +#: data/ui/glabels-ui.xml.h:136 +msgid "_Contents" +msgstr "" + +#: data/ui/glabels-ui.xml.h:137 +msgid "_Copy" +msgstr "" + +#: data/ui/glabels-ui.xml.h:138 +#, fuzzy +msgid "_Create Object" +msgstr "«Ø¥ß·sªº¤å¦rª«¥ó" + +#: data/ui/glabels-ui.xml.h:139 +msgid "_Debug" +msgstr "" + +#: data/ui/glabels-ui.xml.h:141 +msgid "_Desktop Default" +msgstr "" + +#: data/ui/glabels-ui.xml.h:142 +msgid "_Drawing Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:143 +msgid "_Edit" +msgstr "" + +#: data/ui/glabels-ui.xml.h:145 +#, fuzzy +msgid "_File" +msgstr "¶ñº¡" + +#: data/ui/glabels-ui.xml.h:146 +msgid "_Grid" +msgstr "" + +#: data/ui/glabels-ui.xml.h:147 +msgid "_Help" +msgstr "" + +#: data/ui/glabels-ui.xml.h:148 +msgid "_Icon" +msgstr "" + +#: data/ui/glabels-ui.xml.h:152 +msgid "_Main Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:153 +#, fuzzy +msgid "_Merge Properties..." +msgstr "¦X¨Ö³]©w" + +#: data/ui/glabels-ui.xml.h:154 +msgid "_New" +msgstr "·s¼W (&_N)" + +#: data/ui/glabels-ui.xml.h:155 +msgid "_Objects" +msgstr "" + +#: data/ui/glabels-ui.xml.h:156 +#, fuzzy +msgid "_Open..." +msgstr "¶}±Ò" + +#: data/ui/glabels-ui.xml.h:158 +msgid "_Paste" +msgstr "" + +#: data/ui/glabels-ui.xml.h:159 +#, fuzzy +msgid "_Print..." +msgstr "¦C¦L" + +#: data/ui/glabels-ui.xml.h:160 +msgid "_Property Toolbar" +msgstr "" + +#: data/ui/glabels-ui.xml.h:161 +msgid "_Quit" +msgstr "" + +#: data/ui/glabels-ui.xml.h:164 +#, fuzzy +msgid "_Save" +msgstr "¥t¦s¬°..." + +#: data/ui/glabels-ui.xml.h:168 +#, fuzzy +msgid "_View" +msgstr "·s¼W (&_N)" + +#: data/glade/prefs-dialog.glade.h:1 +msgid " " +msgstr "" + +#: data/glade/prefs-dialog.glade.h:2 data/glade/object-editor.glade.h:1 +#: data/glade/template-designer.glade.h:5 +msgid "*" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:3 +msgid "Default page size" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:4 +msgid "Fill" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:5 +msgid "Line" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:6 +msgid "Text" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:7 +msgid "Units" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:8 data/glade/object-editor.glade.h:4 +msgid "Alignment:" +msgstr "¹ï¸m:" + +#: data/glade/prefs-dialog.glade.h:9 data/glade/object-editor.glade.h:8 +msgid "Color:" +msgstr "ÃC¦â:" + +#: data/glade/prefs-dialog.glade.h:10 +msgid "Font:" +msgstr "¦r«¬:" + +#: data/glade/prefs-dialog.glade.h:11 +msgid "ISO A4" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:12 +msgid "Inches" +msgstr "­^¤o" + +#: data/glade/prefs-dialog.glade.h:13 data/glade/object-editor.glade.h:19 +msgid "Line Spacing:" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:14 +#, fuzzy +msgid "Locale" +msgstr "¤ñ¨Ò:" + +#: data/glade/prefs-dialog.glade.h:15 +msgid "Millimeters" +msgstr "²@¦Ì" + +#: data/glade/prefs-dialog.glade.h:16 +msgid "Object defaults" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:17 +msgid "Points" +msgstr "ÂI" + +#: data/glade/prefs-dialog.glade.h:18 +msgid "Select default properties for new objects." +msgstr "" + +#: data/glade/prefs-dialog.glade.h:19 +msgid "Select locale specific behavior." +msgstr "" + +#: data/glade/prefs-dialog.glade.h:20 data/templates/paper-sizes.xml.h:25 +msgid "US Letter" +msgstr "" + +#: data/glade/prefs-dialog.glade.h:21 data/glade/object-editor.glade.h:29 +#: data/glade/template-designer.glade.h:72 +msgid "Width:" +msgstr "Áï«×:" + +#: data/glade/object-editor.glade.h:2 +msgid "00000000000 00000" +msgstr "" + +#: data/glade/object-editor.glade.h:3 +msgid "Xxx object properties" +msgstr "" + +#: data/glade/object-editor.glade.h:5 +msgid "Allow merge to automatically shrink text" +msgstr "" + +#: data/glade/object-editor.glade.h:6 +msgid "Angle:" +msgstr "¨¤«×:" + +#: data/glade/object-editor.glade.h:7 +msgid "Checksum" +msgstr "" + +#: data/glade/object-editor.glade.h:10 +#, fuzzy +msgid "Family:" +msgstr "¶ñº¡" + +#: data/glade/object-editor.glade.h:12 +msgid "Fill" +msgstr "¶ñº¡" + +#: data/glade/object-editor.glade.h:13 data/glade/template-designer.glade.h:33 +msgid "Height:" +msgstr "°ª«×:" + +#: data/glade/object-editor.glade.h:14 +msgid "Image" +msgstr "¹Ï¹³" + +#: data/glade/object-editor.glade.h:15 +msgid "Insert merge field" +msgstr "´¡¤J¦X¨Ö¦C" + +#: data/glade/object-editor.glade.h:17 +msgid "Length:" +msgstr "ªø«×:" + +#: data/glade/object-editor.glade.h:18 +msgid "Line" +msgstr "½u" + +#: data/glade/object-editor.glade.h:20 +msgid "Literal:" +msgstr "¤å¦r:" + +#: data/glade/object-editor.glade.h:21 +msgid "Load image" +msgstr "" + +#: data/glade/object-editor.glade.h:22 +msgid "Position" +msgstr "¦ì¸m" + +#: data/glade/object-editor.glade.h:23 +msgid "Reset image size" +msgstr "­«³]¹Ï¹³¤j¤p" + +#: data/glade/object-editor.glade.h:24 +msgid "Size" +msgstr "¤j¤p" + +#: data/glade/object-editor.glade.h:25 +#, fuzzy +msgid "Size:" +msgstr "¤j¤p" + +#: data/glade/object-editor.glade.h:26 +#, fuzzy +msgid "Style" +msgstr "¼Ë¦¡" + +#: data/glade/object-editor.glade.h:27 +#, fuzzy +msgid "Style:" +msgstr "¼Ë¦¡" + +#: data/glade/object-editor.glade.h:30 +msgid "X:" +msgstr "X:" + +#: data/glade/object-editor.glade.h:31 +msgid "Y:" +msgstr "Y:" + +#: data/glade/object-editor.glade.h:32 +msgid "degrees" +msgstr "«×¼Æ" + +#: data/glade/object-editor.glade.h:33 +msgid "dialog1" +msgstr "" + +#: data/glade/object-editor.glade.h:34 +msgid "digits:" +msgstr "" + +#: data/glade/object-editor.glade.h:35 +#, fuzzy +msgid "format:" +msgstr "®æ¦¡:" + +#: data/glade/template-designer.glade.h:1 +msgid " " +msgstr "" + +#: data/glade/template-designer.glade.h:2 +msgid "(e.g., \"Mailing Labels,\" \"Business Cards,\" ...)" +msgstr "" + +#: data/glade/template-designer.glade.h:3 +msgid "(e.g., 8163A)" +msgstr "" + +#: data/glade/template-designer.glade.h:4 +msgid "(e.g., Avery, Acme, ...)" +msgstr "" + +#: data/glade/template-designer.glade.h:6 +msgid "1. Outer radius:" +msgstr "" + +#: data/glade/template-designer.glade.h:7 +msgid "1. Radius:" +msgstr "" + +#: data/glade/template-designer.glade.h:8 +#, fuzzy +msgid "1. Width:" +msgstr "Áï«×:" + +#: data/glade/template-designer.glade.h:9 +#, fuzzy +msgid "2. Height:" +msgstr "°ª«×:" + +#: data/glade/template-designer.glade.h:10 +msgid "2. Inner radius:" +msgstr "" + +#: data/glade/template-designer.glade.h:11 +msgid "2. Waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:12 +msgid "3. Clipping width:" +msgstr "" + +#: data/glade/template-designer.glade.h:13 +msgid "3. Margin" +msgstr "" + +#: data/glade/template-designer.glade.h:14 +msgid "3. Round (radius of corner):" +msgstr "" + +#: data/glade/template-designer.glade.h:15 +msgid "4. Clipping height:" +msgstr "" + +#: data/glade/template-designer.glade.h:16 +msgid "4. Horiz. waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:17 +msgid "5. Vert. waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:18 +msgid "5. Waste (overprint allowed):" +msgstr "" + +#: data/glade/template-designer.glade.h:19 +msgid "6. Margin" +msgstr "" + +#: data/glade/template-designer.glade.h:20 +msgid "Brand/Manufacturer:" +msgstr "" + +#: data/glade/template-designer.glade.h:21 +msgid "CD/DVD (including credit card CDs)" +msgstr "" + +#: data/glade/template-designer.glade.h:22 +msgid "" +"Congratulations!\n" +"\n" +"You have completed the gLabels Template Designer.\n" +"If you wish to accept and save your design, click \"Apply.\"\n" +"\n" +"Otherwise, you may click \"Cancel\" to abandon your design\n" +"or \"Back\" to continue editing this design." +msgstr "" + +#: data/glade/template-designer.glade.h:30 +msgid "Design Completed" +msgstr "" + +#: data/glade/template-designer.glade.h:31 +msgid "Distance from left edge (x0):" +msgstr "" + +#: data/glade/template-designer.glade.h:32 +msgid "Distance from top edge (y0):" +msgstr "" + +#: data/glade/template-designer.glade.h:34 +msgid "Horizontal pitch (dx):" +msgstr "" + +#: data/glade/template-designer.glade.h:35 +msgid "" +"How many layouts will your template contain? \n" +"\n" +"A layout is a set of labels or cards that can be arranged in a simple grid.\n" +"Most templates only need one layout, as in the first example.\n" +"The second example illustrates when two layouts are needed." +msgstr "" + +#: data/glade/template-designer.glade.h:40 +msgid "Label Size (CD/DVD)" +msgstr "" + +#: data/glade/template-designer.glade.h:41 +#, fuzzy +msgid "Label Size (Round)" +msgstr "¼Ðñ¤j¤p:" + +#: data/glade/template-designer.glade.h:42 +#, fuzzy +msgid "Label or Card Shape" +msgstr "·s¼W¼Ðñ©Î¥d" + +#: data/glade/template-designer.glade.h:43 +msgid "Label or Card Size (Rectangular)" +msgstr "" + +#: data/glade/template-designer.glade.h:44 +#, fuzzy +msgid "Layout #1" +msgstr "ª©­±:" + +#: data/glade/template-designer.glade.h:45 +#, fuzzy +msgid "Layout #2" +msgstr "ª©­±:" + +#: data/glade/template-designer.glade.h:46 +#, fuzzy +msgid "Layout(s)" +msgstr "ª©­±:" + +#: data/glade/template-designer.glade.h:47 +#, fuzzy +msgid "Name and Description" +msgstr "´y­z:" + +#: data/glade/template-designer.glade.h:48 +msgid "Number across (nx):" +msgstr "" + +#: data/glade/template-designer.glade.h:49 +msgid "Number down (ny):" +msgstr "" + +#: data/glade/template-designer.glade.h:50 +msgid "Number of Layouts" +msgstr "" + +#: data/glade/template-designer.glade.h:51 +msgid "Number of layouts:" +msgstr "" + +#: data/glade/template-designer.glade.h:52 +#, fuzzy +msgid "Page Size" +msgstr "¯È±i¤j¤p:" + +#: data/glade/template-designer.glade.h:54 +msgid "Part #:" +msgstr "" + +#: data/glade/template-designer.glade.h:55 +msgid "" +"Please enter the following identifying information about the template " +"stationery." +msgstr "" + +#: data/glade/template-designer.glade.h:56 +msgid "Please enter the following layout information." +msgstr "" + +#: data/glade/template-designer.glade.h:57 +msgid "" +"Please enter the following size parameters of a single label in your " +"template." +msgstr "" + +#: data/glade/template-designer.glade.h:58 +msgid "" +"Please enter the following size parameters of a single label or card in your " +"template." +msgstr "" + +#: data/glade/template-designer.glade.h:59 +msgid "Please select the basic shape of the labels or cards." +msgstr "" + +#: data/glade/template-designer.glade.h:60 +msgid "Please select the page size of the template stationery." +msgstr "" + +#: data/glade/template-designer.glade.h:61 +#, fuzzy +msgid "Print test sheet" +msgstr "¦b­º±i¯È" + +#: data/glade/template-designer.glade.h:62 +msgid "Rectangular or square (can have rounded corners)" +msgstr "" + +#: data/glade/template-designer.glade.h:63 +msgid "Round" +msgstr "" + +#: data/glade/template-designer.glade.h:64 +msgid "" +"Templates needing\n" +"two layouts." +msgstr "" + +#: data/glade/template-designer.glade.h:66 +msgid "" +"Templates needing only\n" +"one layout." +msgstr "" + +#: data/glade/template-designer.glade.h:68 +msgid "Vertical pitch (dy):" +msgstr "" + +#: data/glade/template-designer.glade.h:69 +msgid "" +"Welcome to the gLabels Template Designer.\n" +"\n" +"This dialog will assist you in the creation of a custom gLabels template." +msgstr "" + +#: data/templates/paper-sizes.xml.h:1 +msgid "A0" +msgstr "" + +#: data/templates/paper-sizes.xml.h:2 +msgid "A1" +msgstr "" + +#: data/templates/paper-sizes.xml.h:3 +msgid "A10" +msgstr "" + +#: data/templates/paper-sizes.xml.h:4 +msgid "A2" +msgstr "" + +#: data/templates/paper-sizes.xml.h:5 +msgid "A3" +msgstr "" + +#: data/templates/paper-sizes.xml.h:6 +msgid "A4" +msgstr "" + +#: data/templates/paper-sizes.xml.h:7 +msgid "A5" +msgstr "" + +#: data/templates/paper-sizes.xml.h:8 +msgid "A6" +msgstr "" + +#: data/templates/paper-sizes.xml.h:9 +msgid "A7" +msgstr "" + +#: data/templates/paper-sizes.xml.h:10 +msgid "A8" +msgstr "" + +#: data/templates/paper-sizes.xml.h:11 +msgid "A9" +msgstr "" + +#: data/templates/paper-sizes.xml.h:12 +msgid "B0" +msgstr "" + +#: data/templates/paper-sizes.xml.h:13 +msgid "B1" +msgstr "" + +#: data/templates/paper-sizes.xml.h:14 +msgid "B10" +msgstr "" + +#: data/templates/paper-sizes.xml.h:15 +msgid "B2" +msgstr "" + +#: data/templates/paper-sizes.xml.h:16 +msgid "B3" +msgstr "" + +#: data/templates/paper-sizes.xml.h:17 +msgid "B4" +msgstr "" + +#: data/templates/paper-sizes.xml.h:18 +msgid "B5" +msgstr "" + +#: data/templates/paper-sizes.xml.h:19 +msgid "B6" +msgstr "" + +#: data/templates/paper-sizes.xml.h:20 +msgid "B7" +msgstr "" + +#: data/templates/paper-sizes.xml.h:21 +msgid "B8" +msgstr "" + +#: data/templates/paper-sizes.xml.h:22 +msgid "B9" +msgstr "" + +#: data/templates/paper-sizes.xml.h:23 +msgid "US Executive" +msgstr "" + +#: data/templates/paper-sizes.xml.h:24 +msgid "US Legal" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:1 +#: data/templates/zweckform-iso-templates.xml.h:1 +msgid "Address Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:2 +#: data/templates/avery-iso-templates.xml.h:2 +#: data/templates/zweckform-iso-templates.xml.h:3 +#: data/templates/misc-us-templates.xml.h:2 +#: data/templates/misc-iso-templates.xml.h:9 +msgid "Business Cards" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:3 +msgid "CD/DVD Labels (Disc Labels)" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:4 +msgid "Diskette Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:5 +#, fuzzy +msgid "Filing Labels" +msgstr "¼Ðñ" + +#: data/templates/avery-us-templates.xml.h:6 +msgid "Full Sheet Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:7 +#, fuzzy +msgid "Large Round Labels" +msgstr "¥Ñ¸Tñ¶}¯Å" + +#: data/templates/avery-us-templates.xml.h:8 +msgid "Name Badge Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:9 +msgid "Return Address Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:10 +msgid "Shipping Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:11 +#, fuzzy +msgid "Small Round Labels" +msgstr "¥Ñ¸Tñ¶}¯Å" + +#: data/templates/avery-us-templates.xml.h:12 +#, fuzzy +msgid "Square Labels" +msgstr "¼Ðñ" + +#: data/templates/avery-us-templates.xml.h:13 +msgid "Video Tape Face Labels" +msgstr "" + +#: data/templates/avery-us-templates.xml.h:14 +msgid "Video Tape Spine Labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:1 +msgid "Address labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:3 +msgid "CD Booklet" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:4 +msgid "CD Inlet" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:5 +#: data/templates/zweckform-iso-templates.xml.h:4 +#: data/templates/misc-us-templates.xml.h:4 +#: data/templates/misc-iso-templates.xml.h:10 +#, fuzzy +msgid "CD/DVD Labels" +msgstr "¼Ðñ" + +#: data/templates/avery-iso-templates.xml.h:6 +msgid "Diskette labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:7 +#: data/templates/zweckform-iso-templates.xml.h:7 +#: data/templates/misc-iso-templates.xml.h:17 +msgid "Mailing Labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:8 +#, fuzzy +msgid "Mailing labels" +msgstr "¼Ðñ" + +#: data/templates/avery-iso-templates.xml.h:9 +msgid "Mini Address Labels" +msgstr "" + +#: data/templates/avery-iso-templates.xml.h:10 +#, fuzzy +msgid "Shipping labels" +msgstr "¶}±Ò¼Ðñ" + +#: data/templates/zweckform-iso-templates.xml.h:2 +msgid "Allround Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:5 +msgid "Correction and Cover-up Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:6 +msgid "Lever Arch File Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:8 +msgid "QSL-Karten Etiketten 70mm x 50,8mm" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:9 +msgid "Rectangular Copier Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:10 +#: data/templates/misc-iso-templates.xml.h:22 +msgid "Rectangular Labels" +msgstr "" + +#: data/templates/zweckform-iso-templates.xml.h:11 +msgid "Video Labels (back)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:1 +msgid "Business Card CD" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:3 +msgid "CD Template Rectangles" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:5 +msgid "CD/DVD Labels (Face Only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:6 +#: data/templates/misc-iso-templates.xml.h:11 +msgid "CD/DVD Labels (face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:7 +#, fuzzy +msgid "DLT Labels" +msgstr "¼Ðñ" + +#: data/templates/misc-us-templates.xml.h:8 +msgid "Microtube labels" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:9 +msgid "Mini-CD Labels" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:10 +msgid "PRO CD Labels 2-up (CD spine only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:11 +msgid "PRO CD Labels 2-up (Face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:12 +#: data/templates/misc-iso-templates.xml.h:21 +msgid "PRO CD Labels 2-up (face only)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:13 +msgid "Slimline CD Case (rightside up)" +msgstr "" + +#: data/templates/misc-us-templates.xml.h:14 +msgid "Slimline CD Case (upside down)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:1 +msgid "Agipa 119488: Business Cards" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:2 +msgid "Allround Labels --24" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:3 +msgid "Allround Labels --44" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:4 +msgid "Allround Labels --64" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:5 +msgid "Allround Labels --65" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:6 +msgid "Arch File Labels" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:7 +msgid "Arch File Labels (large)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:8 +msgid "Arch File Labels (small)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:12 +msgid "CD/DVD Labels Standard Format (face only)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:13 +msgid "Diskette Labels (face only)" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:14 +msgid "EPSON Photo Stickers 16" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:15 +msgid "Etiketten" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:16 +msgid "Fridge Magnet Stickers" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:18 +msgid "Mailing Labels --14" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:19 +msgid "Mailing Labels-2 columns" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:20 +msgid "Mailing Labels-3 columns" +msgstr "" + +#: data/templates/misc-iso-templates.xml.h:23 +msgid "Video Labels (face only)" +msgstr "" + +#: data/desktop/glabels.desktop.in.h:1 +msgid "Create labels, business cards and media covers." +msgstr "" + +#: data/desktop/glabels.desktop.in.h:2 +msgid "gLabels Label Designer" +msgstr "" + +#: data/mime/glabels.keys.in.h:1 data/mime/glabels.xml.in.h:1 +#, fuzzy +msgid "gLabels Project File" +msgstr "¤å¦r¼Ë»ª" + +#, fuzzy +#~ msgid "Object _Properties..." +#~ msgstr "¤å¦r¼Ë»ª" + +#~ msgid "Display units" +#~ msgstr "Åã¥Ü³æ¦ì" + +#~ msgid "Default page size" +#~ msgstr "¹w³]¯È±i¤j¤p" + +#~ msgid "Outline" +#~ msgstr "¥~Ãä" + +#~ msgid "Edit line object properties" +#~ msgstr "­×§ï½uª«¥óªº³]©w" + +#~ msgid "Edit text object properties" +#~ msgstr "­×§ï¤å¦rª«¥óªº³]©w" + +#~ msgid "Maintain current aspect ratio" +#~ msgstr "«O¯d²{¦³ªº¤j¤p¤ñ¨Ò" + +#, fuzzy +#~ msgid "CD Labels" +#~ msgstr "¼Ðñ" + +#, fuzzy +#~ msgid "Open %s" +#~ msgstr "¶}±Ò" + +#~ msgid "Revert to saved copy of %s?" +#~ msgstr "­n¸ü¤J¤wÀx¦sªº³Æ¥÷ %s ?" + +#~ msgid "Unknown media type. Using default." +#~ msgstr "¤£©úªº´CÅéÃþ§Î. ¨Ï¥Î¹w³]." + +#~ msgid "" +#~ "``%s'' has been modified.\n" +#~ "\n" +#~ "Do you wish to save it?" +#~ msgstr "" +#~ "``%s`` ¤w³Q­×§ï.\n" +#~ "\n" +#~ "­n²{¦bÀx¦s¶Ü ?" + +#~ msgid "Close / Save label as" +#~ msgstr "Ãö³¬ / Àx¦s¼Ðñ¬°..." + +#~ msgid "Label no longer valid!" +#~ msgstr "¼Ðñ¨Ã¤£¬O¥¿½T¥iŪªº !" + +#~ msgid "Error writing file" +#~ msgstr "¦b¼g¤JÀɮ׮ɵo¥Í¿ù»~" + +#~ msgid "Edit properties..." +#~ msgstr "­×§ï³]©w..." + +#~ msgid "Appearance" +#~ msgstr "¼Ë»ª" + +#~ msgid "Position/Size" +#~ msgstr "¦ì¸m/¤j¤p" + +#~ msgid "Image format not currently supported" +#~ msgstr "¹Ï¹³®æ¦¡¨Ã¨S¦³¤ä´©" + +#~ msgid "Barcode data" +#~ msgstr "¼Æ½X±ø¸ê®Æ" + +#~ msgid "%" +#~ msgstr "%" + +#~ msgid "Show text with barcode" +#~ msgstr "Åã¥Ü¼Æ½X±ø¤å¦r" + +#~ msgid "Fields" +#~ msgstr "Äæ¦ì" + +#~ msgid "Column" +#~ msgstr "¦C" + +#~ msgid "Sample data" +#~ msgstr "¼Ë¥»¸ê®Æ" + +#~ msgid "Make a new, empty label" +#~ msgstr "»s§@·sÀÉ, ªÅªº¼Ëñ" + +#~ msgid " New " +#~ msgstr " ·s¼W " + +#~ msgid "New Label/Card" +#~ msgstr "·s¼W¼Ðñ/¥d" + +#~ msgid " Open " +#~ msgstr " ¶}±Ò " + +#~ msgid " Save " +#~ msgstr " Àx¦s " + +#~ msgid " Print " +#~ msgstr " ¦C¦L " + +#~ msgid "Function is not implemented!" +#~ msgstr "¥\¯à¥¼§¹¦¨ !" diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 00000000..d687e1ba --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,289 @@ +LIB_BARCODE_DIR = ../barcode-0.98 +LIB_IEC16022_DIR = ../iec16022-0.2.1 + +SUBDIRS= pixmaps stock-pixmaps mygal + +bin_PROGRAMS = glabels glabels-batch + +INCLUDES = \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(LIB_BARCODE_DIR) \ + -I$(LIB_IEC16022_DIR) \ + $(GLABELS_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) \ + -DPREFIX=\""$(prefix)"\" \ + -DSYSCONFDIR=\""$(sysconfdir)"\" \ + -DDATADIR=\""$(datadir)"\" \ + -DLIBDIR=\""$(libdir)"\" \ + -DGLABELS_LOCALEDIR=\""$(datadir)/locale"\" \ + -DGLABELS_GLADE_DIR=\""$(datadir)/glabels/glade/"\" \ + -DGLABELS_ICON_DIR=\""$(datadir)/pixmaps/"\" \ + -DGLABELS_PIXMAP_DIR=\""$(datadir)/pixmaps/glabels/"\" \ + -DG_LOG_DOMAIN=\""glabels\"" + +glabels_LDFLAGS = -export-dynamic + +glabels_LDADD = \ + $(GLABELS_LIBS) \ + ../libglabels/libglabels.la \ + mygal/libmygal.la \ + $(LIB_BARCODE_DIR)/libbarcode.la \ + $(LIB_IEC16022_DIR)/libiec16022.la + +glabels_batch_LDFLAGS = -export-dynamic + +glabels_batch_LDADD = \ + $(GLABELS_LIBS) \ + ../libglabels/libglabels.la \ + $(LIB_BARCODE_DIR)/libbarcode.la \ + $(LIB_IEC16022_DIR)/libiec16022.la + +BUILT_SOURCES = \ + marshal.c \ + marshal.h + +glabels_SOURCES = \ + glabels.c \ + warning-handler.c \ + warning-handler.h \ + critical-error-handler.c \ + critical-error-handler.h \ + window.c \ + window.h \ + stock.c \ + stock.h \ + ui.h \ + ui.c \ + ui-util.h \ + ui-util.c \ + ui-commands.h \ + ui-commands.c \ + ui-property-bar.h \ + ui-property-bar.c \ + ui-sidebar.h \ + ui-sidebar.c \ + file.h \ + file.c \ + new-label-dialog.h \ + new-label-dialog.c \ + recent.h \ + recent.c \ + prefs.c \ + prefs.h \ + prefs-model.c \ + prefs-model.h \ + prefs-dialog.c \ + prefs-dialog.h \ + hig.h \ + view.c \ + view.h \ + view-object.c \ + view-object.h \ + view-box.c \ + view-box.h \ + view-ellipse.c \ + view-ellipse.h \ + view-line.c \ + view-line.h \ + view-image.c \ + view-image.h \ + view-text.c \ + view-text.h \ + view-barcode.c \ + view-barcode.h \ + merge-properties-dialog.c \ + merge-properties-dialog.h \ + object-editor.c \ + object-editor.h \ + object-editor-private.h \ + object-editor-position-page.c \ + object-editor-size-page.c \ + object-editor-lsize-page.c \ + object-editor-line-page.c \ + object-editor-fill-page.c \ + object-editor-image-page.c \ + object-editor-text-page.c \ + object-editor-edit-page.c \ + object-editor-bc-page.c \ + object-editor-data-page.c \ + object-editor-shadow-page.c \ + print.c \ + print.h \ + print-op.c \ + print-op.h \ + template-designer.c \ + template-designer.h \ + bc.c \ + bc.h \ + bc-gnubarcode.c \ + bc-gnubarcode.h \ + bc-postnet.c \ + bc-postnet.h \ + bc-iec16022.c \ + bc-iec16022.h \ + label.c \ + label.h \ + label-object.c \ + label-object.h \ + label-text.c \ + label-text.h \ + label-box.c \ + label-box.h \ + label-line.c \ + label-line.h \ + label-ellipse.c \ + label-ellipse.h \ + label-image.c \ + label-image.h \ + label-barcode.c \ + label-barcode.h \ + xml-label.c \ + xml-label.h \ + xml-label-04.c \ + xml-label-04.h \ + pixbuf-cache.c \ + pixbuf-cache.h \ + base64.c \ + base64.h \ + merge.c \ + merge.h \ + merge-init.c \ + merge-init.h \ + merge-text.c \ + merge-text.h \ + merge-evolution.c \ + merge-evolution.h \ + merge-vcard.c \ + merge-vcard.h \ + text-node.c \ + text-node.h \ + mini-preview-pixbuf.c \ + mini-preview-pixbuf.h \ + mini-preview-pixbuf-cache.c \ + mini-preview-pixbuf-cache.h \ + wdgt-print-copies.c \ + wdgt-print-copies.h \ + wdgt-print-merge.c \ + wdgt-print-merge.h \ + wdgt-media-select.c \ + wdgt-media-select.h \ + wdgt-mini-preview.c \ + wdgt-mini-preview.h \ + wdgt-rotate-label.c \ + wdgt-rotate-label.h \ + wdgt-chain-button.c \ + wdgt-chain-button.h \ + cairo-label-path.c \ + cairo-label-path.h \ + cairo-markup-path.c \ + cairo-markup-path.h \ + cairo-ellipse-path.c \ + cairo-ellipse-path.h \ + util.c \ + util.h \ + color.c \ + color.h \ + debug.c \ + debug.h \ + $(BUILT_SOURCES) + + +glabels_batch_SOURCES = \ + glabels-batch.c \ + print.c \ + print.h \ + print-op.c \ + print-op.h \ + bc.c \ + bc.h \ + bc-gnubarcode.c \ + bc-gnubarcode.h \ + bc-postnet.c \ + bc-postnet.h \ + bc-iec16022.c \ + bc-iec16022.h \ + label.c \ + label.h \ + label-object.c \ + label-object.h \ + label-text.c \ + label-text.h \ + label-box.c \ + label-box.h \ + label-line.c \ + label-line.h \ + label-ellipse.c \ + label-ellipse.h \ + label-image.c \ + label-image.h \ + label-barcode.c \ + label-barcode.h \ + xml-label.c \ + xml-label.h \ + xml-label-04.c \ + xml-label-04.h \ + pixbuf-cache.c \ + pixbuf-cache.h \ + base64.c \ + base64.h \ + merge.c \ + merge.h \ + merge-init.c \ + merge-init.h \ + merge-text.c \ + merge-text.h \ + merge-evolution.c \ + merge-evolution.h \ + merge-vcard.c \ + merge-vcard.h \ + text-node.c \ + text-node.h \ + prefs.c \ + prefs.h \ + prefs-model.c \ + prefs-model.h \ + util.c \ + util.h \ + color.c \ + color.h \ + debug.c \ + debug.h \ + wdgt-print-copies.c \ + wdgt-print-copies.h \ + wdgt-print-merge.c \ + wdgt-print-merge.h \ + wdgt-mini-preview.c \ + wdgt-mini-preview.h \ + hig.h \ + cairo-label-path.c \ + cairo-label-path.h \ + cairo-ellipse-path.c \ + cairo-ellipse-path.h \ + $(BUILT_SOURCES) + +marshal.h: marshal.list $(GLIB_GENMARSHAL) + $(GLIB_GENMARSHAL) $< --header --prefix=gl_marshal > $@ + +marshal.c: marshal.list $(GLIB_GENMARSHAL) + echo "#include \"marshal.h\"" > $@ && \ + $(GLIB_GENMARSHAL) $< --body --prefix=gl_marshal >> $@ + +EXTRA_DIST = \ + marshal.list + +CLEANFILES = $(BUILT_SOURCES) + +$(bin_PROGRAMS): $(LIB_BARCODE_DIR)/libbarcode.la \ + $(LIB_IEC16022_DIR)/libiec16022.la \ + ../libglabels/libglabels.la + +$(LIB_BARCODE_DIR)/libbarcode.la: + cd $(LIB_BARCODE_DIR); $(MAKE) + +$(LIB_IEC16022_DIR)/libiec16022.la: + cd $(LIB_IEC16022_DIR); $(MAKE) + +../libglabels/libglabels.la: + cd ../libglabels; $(MAKE) + diff --git a/src/base64.c b/src/base64.c new file mode 100644 index 00000000..b3de985b --- /dev/null +++ b/src/base64.c @@ -0,0 +1,204 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * base64.c: GLabels base64 encode/decode module + * + * Copyright (C) 2003 Jim Evins + * + * This module is based on base64.c from fetchmail: + * + * Copyright (C)2002 by Eric S. Raymond. + * Portions are copyrighted by Carl E. Harris and George M. Sipe. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * This base 64 encoding is defined in RFC2045 section 6.8. + */ +#include + +#include "base64.h" + +#include +#include +#include + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +#define LINE_LENGTH 76 /* Must be <= 76 and must be a multiple of 4 */ +#define BAD -1 + +#define DECODE64(c) (isascii(c) ? base64val[c] : BAD) + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +static const gchar base64digits[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +static const gchar base64val[] = { + BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, + BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, + BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD, 62, BAD,BAD,BAD, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,BAD,BAD, BAD,BAD,BAD,BAD, + BAD, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,BAD, BAD,BAD,BAD,BAD, + BAD, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,BAD, BAD,BAD,BAD,BAD +}; + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + + +/*****************************************************************************/ +/* Encode to Base64 string. */ +/*****************************************************************************/ +gchar * +gl_base64_encode (const guchar *in, guint inlen) +{ + gchar *out, *p_out; + gint buf_size; + gint i; + + /* Calculate output buffer size */ + buf_size = 4*((inlen+2)/3); /* Encoded characters */ + buf_size += buf_size / LINE_LENGTH + 2; /* Line breaks */ + buf_size += 1; /* null termination */ + + /* Allocate output buffer */ + out = g_new0 (gchar, buf_size); + p_out=out; + + /* Now do the encoding */ + *p_out++ = '\n'; + for ( i=0; inlen >= 3; inlen-=3 ) { + + *p_out++ = base64digits[in[0] >> 2]; + *p_out++ = base64digits[((in[0] << 4) & 0x30) | (in[1] >> 4)]; + *p_out++ = base64digits[((in[1] << 2) & 0x3c) | (in[2] >> 6)]; + *p_out++ = base64digits[in[2] & 0x3f]; + in += 3; + + i += 4; + if ( (i % LINE_LENGTH) == 0 ) { + *p_out++ = '\n'; + } + + } + if (inlen > 0) { + guchar fragment; + + *p_out++ = base64digits[in[0] >> 2]; + fragment = (in[0] << 4) & 0x30; + if (inlen > 1) + fragment |= in[1] >> 4; + *p_out++ = base64digits[fragment]; + *p_out++ = (inlen < 2) ? '=' : base64digits[(in[1] << 2) & 0x3c]; + *p_out++ = '='; + + *p_out++ = '\n'; + } + *p_out++ = '\0'; + + return out; +} + +/*****************************************************************************/ +/* Decode from a Base64 string. */ +/*****************************************************************************/ +guchar * +gl_base64_decode (const gchar *in, guint *outlen) +{ + gchar *out, *p_out; + gint buf_size; + register guchar digit1, digit2, digit3, digit4; + + /* Calculate output buffer size */ + buf_size = strlen (in) * 3 / 4; + + /* Allocate output buffer */ + out = g_new0 (gchar, buf_size); + + *outlen = 0; + p_out = out; + + /* Skip non-printable characters */ + while ( (*in == '\n') || (*in == '\r') || (*in == ' ') ) { + in ++; + } + if (!*in) { + g_free (out); + return NULL; + } + + /* Now do the decoding */ + do { + digit1 = in[0]; + if (DECODE64(digit1) == BAD) { + g_free (out); + return NULL; + } + digit2 = in[1]; + if (DECODE64(digit2) == BAD) { + g_free (out); + return NULL; + } + digit3 = in[2]; + if (digit3 != '=' && DECODE64(digit3) == BAD) { + g_free (out); + return NULL; + } + digit4 = in[3]; + if (digit4 != '=' && DECODE64(digit4) == BAD) { + g_free (out); + return NULL; + } + in += 4; + + *p_out++ = (DECODE64(digit1)<<2) | (DECODE64(digit2) >> 4); + (*outlen)++; + if (digit3 != '=') + { + *p_out++ = ((DECODE64(digit2)<<4)&0xf0) | (DECODE64(digit3)>>2); + (*outlen)++; + if (digit4 != '=') + { + *p_out++ = ((DECODE64(digit3)<<6)&0xc0) | DECODE64(digit4); + (*outlen)++; + } + } + + /* Skip non-printable characters */ + while ( (*in == '\n') || (*in == '\r') || (*in == ' ') ) { + in ++; + } + + } while (*in && digit4 != '='); + + return (guchar *)out; +} + diff --git a/src/base64.h b/src/base64.h new file mode 100644 index 00000000..420d2a4c --- /dev/null +++ b/src/base64.h @@ -0,0 +1,45 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * base64.h: GLabels base64 encode/decode module + * + * Copyright (C) 2003 Jim Evins + * + * This module is based on base64.c from fetchmail: + * + * Copyright (C)2002 by Eric S. Raymond. + * Portions are copyrighted by Carl E. Harris and George M. Sipe. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __BASE64_H__ +#define __BASE64_H__ + +#include + +G_BEGIN_DECLS + +gchar *gl_base64_encode (const guchar *in, + guint inlen); + +guchar *gl_base64_decode (const gchar *in, + guint *outlen); + +G_END_DECLS + +#endif + diff --git a/src/bc-gnubarcode.c b/src/bc-gnubarcode.c new file mode 100644 index 00000000..2c84114b --- /dev/null +++ b/src/bc-gnubarcode.c @@ -0,0 +1,459 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * bc-gnubarcode.c: front-end to GNU-barcode-library module + * + * Copyright (C) 2001-2003 Jim Evins . + * + * Some of this code is borrowed from the postscript renderer (ps.c) + * from the GNU barcode library: + * + * Copyright (C) 1999 Alessaandro Rubini (rubini@gnu.org) + * Copyright (C) 1999 Prosa Srl. (prosa@prosa.it) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "bc-gnubarcode.h" + +#include +#include +#include +#include +#include + +#include "barcode.h" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ +#define SHRINK_AMOUNT 0.15 /* shrink bars to account for ink spreading */ +#define FONT_SCALE 0.95 /* Shrink fonts just a hair */ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ +static glBarcode *render_pass1 (struct Barcode_Item *bci, + gint flags); + +static gboolean is_length_valid (const gchar *digits, + gint n1, + gint n2); + +static gboolean is_length1_valid (const gchar *digits, + gint n1, + gint n2); + +static gboolean is_length2_valid (const gchar *digits, + gint n1, + gint n2); + + +/*****************************************************************************/ +/* Generate intermediate representation of barcode. */ +/*****************************************************************************/ +glBarcode * +gl_barcode_gnubarcode_new (const gchar *id, + gboolean text_flag, + gboolean checksum_flag, + gdouble w, + gdouble h, + const gchar *digits) +{ + glBarcode *gbc; + struct Barcode_Item *bci; + gint flags; + + /* Assign type flag. Pre-filter by length for subtypes. */ + if (g_strcasecmp (id, "EAN") == 0) { + flags = BARCODE_EAN; + } else if (g_strcasecmp (id, "EAN-8") == 0) { + if (!is_length_valid (digits, 7, 8)) { + return NULL; + } + flags = BARCODE_EAN; + } else if (g_strcasecmp (id, "EAN-8+2") == 0) { + if (!is_length1_valid (digits, 7, 8) || !is_length2_valid (digits, 2, 2)) { + return NULL; + } + flags = BARCODE_EAN; + } else if (g_strcasecmp (id, "EAN-8+5") == 0) { + if (!is_length1_valid (digits, 7, 8) || !is_length2_valid (digits, 5, 5)) { + return NULL; + } + flags = BARCODE_EAN; + } else if (g_strcasecmp (id, "EAN-13") == 0) { + if (!is_length_valid (digits, 12, 13)) { + return NULL; + } + flags = BARCODE_EAN; + } else if (g_strcasecmp (id, "EAN-13+2") == 0) { + if (!is_length1_valid (digits, 12,13) || !is_length2_valid (digits, 2,2)) { + return NULL; + } + flags = BARCODE_EAN; + } else if (g_strcasecmp (id, "EAN-13+5") == 0) { + if (!is_length1_valid (digits, 12,13) || !is_length2_valid (digits, 5,5)) { + return NULL; + } + flags = BARCODE_EAN; + } else if (g_strcasecmp (id, "UPC") == 0) { + flags = BARCODE_UPC; + } else if (g_strcasecmp (id, "UPC-A") == 0) { + if (!is_length_valid (digits, 11, 12)) { + return NULL; + } + flags = BARCODE_UPC; + } else if (g_strcasecmp (id, "UPC-A+2") == 0) { + if (!is_length1_valid (digits, 11,12) || !is_length2_valid (digits, 2,2)) { + return NULL; + } + flags = BARCODE_UPC; + } else if (g_strcasecmp (id, "UPC-A+5") == 0) { + if (!is_length1_valid (digits, 11,12) || !is_length2_valid (digits, 5,5)) { + return NULL; + } + flags = BARCODE_UPC; + } else if (g_strcasecmp (id, "UPC-E") == 0) { + if (!is_length_valid (digits, 6, 8)) { + return NULL; + } + flags = BARCODE_UPC; + } else if (g_strcasecmp (id, "UPC-E+2") == 0) { + if (!is_length1_valid (digits, 6, 8) || !is_length2_valid (digits, 2,2)) { + return NULL; + } + flags = BARCODE_UPC; + } else if (g_strcasecmp (id, "UPC-E+5") == 0) { + if (!is_length1_valid (digits, 6, 8) || !is_length2_valid (digits, 5,5)) { + return NULL; + } + flags = BARCODE_UPC; + } else if (g_strcasecmp (id, "ISBN") == 0) { + if (!is_length_valid (digits, 9, 10)) { + return NULL; + } + flags = BARCODE_ISBN; + } else if (g_strcasecmp (id, "ISBN+5") == 0) { + if (!is_length1_valid (digits, 9, 10) || !is_length2_valid (digits, 5,5)) { + return NULL; + } + flags = BARCODE_ISBN; + } else if (g_strcasecmp (id, "Code39") == 0) { + flags = BARCODE_39; + } else if (g_strcasecmp (id, "Code128") == 0) { + flags = BARCODE_128; + } else if (g_strcasecmp (id, "Code128C") == 0) { + flags = BARCODE_128C; + } else if (g_strcasecmp (id, "Code128B") == 0) { + flags = BARCODE_128B; + } else if (g_strcasecmp (id, "I25") == 0) { + flags = BARCODE_I25; + } else if (g_strcasecmp (id, "CBR") == 0) { + flags = BARCODE_CBR; + } else if (g_strcasecmp (id, "MSI") == 0) { + flags = BARCODE_MSI; + } else if (g_strcasecmp (id, "PLS") == 0) { + flags = BARCODE_PLS; + } else { + g_message( "Illegal barcode id %s", id ); + flags = BARCODE_ANY; + } + + + bci = Barcode_Create ((char *)digits); + + /* First encode using GNU Barcode library */ + if (!text_flag) { + flags |= BARCODE_NO_ASCII; + } + if (!checksum_flag) { + flags |= BARCODE_NO_CHECKSUM; + } + + bci->scalef = 0.0; + bci->width = w; + bci->height = h; + + Barcode_Encode (bci, flags); + if (!bci->partial || !bci->textinfo) { + Barcode_Delete (bci); + return NULL; + } + + /* now render with our custom back-end, + to create appropriate intermdediate format */ + gbc = render_pass1 (bci, flags); + + Barcode_Delete (bci); + return gbc; +} + +/*-------------------------------------------------------------------------- + * PRIVATE. Render to glBarcode intermediate representation of barcode. + * + * Some of this code is borrowed from the postscript renderer (ps.c) + * from the GNU barcode library: + * + * Copyright (C) 1999 Alessaandro Rubini (rubini@gnu.org) + * Copyright (C) 1999 Prosa Srl. (prosa@prosa.it) + * + *--------------------------------------------------------------------------*/ +static glBarcode * +render_pass1 (struct Barcode_Item *bci, + gint flags) +{ + gint validbits = BARCODE_NO_ASCII; + glBarcode *gbc; + glBarcodeLine *line; + glBarcodeChar *bchar; + gdouble scalef = 1.0; + gdouble x; + gint i, j, barlen; + gdouble f1, f2; + gint mode = '-'; /* text below bars */ + gdouble x0, y0, yr; + gchar *p, c; + + if (bci->width > (2*bci->margin)) { + bci->width -= 2*bci->margin; + } + if (bci->height > (2*bci->margin)) { + bci->height -= 2*bci->margin; + } + + /* If any flag is clear in "flags", inherit it from "bci->flags" */ + if (!(flags & BARCODE_NO_ASCII)) { + flags |= bci->flags & BARCODE_NO_ASCII; + } + flags = bci->flags = (flags & validbits) | (bci->flags & ~validbits); + + /* First calculate barlen */ + barlen = bci->partial[0] - '0'; + for (p = bci->partial + 1; *p != 0; p++) { + if (isdigit (*p)) { + barlen += *p - '0'; + } else { + if ((*p != '+') && (*p != '-')) { + barlen += *p - 'a' + 1; + } + } + } + + /* The scale factor depends on bar length */ + if (!bci->scalef) { + if (!bci->width) bci->width = barlen; /* default */ + scalef = bci->scalef = (double)bci->width / (double)barlen; + if (scalef < 0.5) scalef = 0.5; + } + + /* The width defaults to "just enough" */ + bci->width = barlen * scalef + 1; + + /* But it can be too small, in this case enlarge and center the area */ + if (bci->width < barlen * scalef) { + int wid = barlen * scalef + 1; + bci->xoff -= (wid - bci->width)/2 ; + bci->width = wid; + /* Can't extend too far on the left */ + if (bci->xoff < 0) { + bci->width += -bci->xoff; + bci->xoff = 0; + } + } + + /* The height defaults to 80 points (rescaled) */ + if (!bci->height) + bci->height = 80 * scalef; + + /* If too small (5 + text), reduce the scale factor and center */ + i = 5 + 10 * ((bci->flags & BARCODE_NO_ASCII)==0); + if (bci->height < i * scalef ) { +#if 0 + double scaleg = ((double)bci->height) / i; + int wid = bci->width * scaleg / scalef; + bci->xoff += (bci->width - wid)/2; + bci->width = wid; + scalef = scaleg; +#else + bci->height = i * scalef; +#endif + } + + gbc = g_new0 (glBarcode, 1); + + /* Now traverse the code string and create a list of lines */ + x = bci->margin + (bci->partial[0] - '0') * scalef; + for (p = bci->partial + 1, i = 1; *p != 0; p++, i++) { + /* special cases: '+' and '-' */ + if (*p == '+' || *p == '-') { + mode = *p; /* don't count it */ + i++; + continue; + } + /* j is the width of this bar/space */ + if (isdigit (*p)) + j = *p - '0'; + else + j = *p - 'a' + 1; + if (i % 2) { /* bar */ + x0 = x + (j * scalef) / 2; + y0 = bci->margin; + yr = bci->height; + if (!(bci->flags & BARCODE_NO_ASCII)) { /* leave space for text */ + if (mode == '-') { + /* text below bars: 10 or 5 points */ + yr -= (isdigit (*p) ? 10 : 5) * scalef; + } else { /* '+' */ + /* above bars: 10 or 0 from bottom, + and 10 from top */ + y0 += 10 * scalef; + yr -= (isdigit (*p) ? 20 : 10) * scalef; + } + } + line = g_new0 (glBarcodeLine, 1); + line->x = x0; + line->y = y0; + line->length = yr; + line->width = (j * scalef) - SHRINK_AMOUNT; + gbc->lines = g_list_append (gbc->lines, line); + } + x += j * scalef; + + } + + /* Now the text */ + mode = '-'; /* reinstantiate default */ + if (!(bci->flags & BARCODE_NO_ASCII)) { + for (p = bci->textinfo; p; p = strchr (p, ' ')) { + while (*p == ' ') + p++; + if (!*p) + break; + if (*p == '+' || *p == '-') { + mode = *p; + continue; + } + if (sscanf (p, "%lf:%lf:%c", &f1, &f2, &c) != 3) { + g_message ("impossible data: %s", p); + continue; + } + bchar = g_new0 (glBarcodeChar, 1); + bchar->x = f1 * scalef + bci->margin; + if (mode == '-') { + bchar->y = + bci->margin + bci->height - 8 * scalef; + } else { + bchar->y = bci->margin; + } + bchar->fsize = f2 * FONT_SCALE * scalef; + bchar->c = c; + gbc->chars = g_list_append (gbc->chars, bchar); + } + } + + /* Fill in other info */ + gbc->height = bci->height + 2.0 * bci->margin; + gbc->width = bci->width + 2.0 * bci->margin; + +#if 0 + g_print ("w=%f, h=%f\n", gbc->width, gbc->height); +#endif + + return gbc; +} + +/*--------------------------------------------------------------------------*/ +/* Validate specific length of string (for subtypes). */ +/*--------------------------------------------------------------------------*/ +static gboolean +is_length_valid (const gchar *digits, + gint n1, + gint n2) +{ + gchar *p; + gint i; + + if (!digits) { + return FALSE; + } + + for (p = (gchar *)digits, i=0; *p != 0; p++) { + if (g_ascii_isdigit (*p)) { + i++; + } + } + + return (i >= n1) && (i <= n2); +} + +/*--------------------------------------------------------------------------*/ +/* Validate specific length of string (for subtypes). */ +/*--------------------------------------------------------------------------*/ +static gboolean +is_length1_valid (const gchar *digits, + gint n1, + gint n2) +{ + gchar *p; + gint i; + + if (!digits) { + return FALSE; + } + + for (p = (gchar *)digits, i=0; !g_ascii_isspace (*p) && *p != 0; p++) { + if (g_ascii_isdigit (*p)) { + i++; + } + } + + return (i >= n1) && (i <= n2); +} + +/*--------------------------------------------------------------------------*/ +/* Validate specific length of second string (for subtypes). */ +/*--------------------------------------------------------------------------*/ +static gboolean +is_length2_valid (const gchar *digits, + gint n1, + gint n2) +{ + gchar *p; + gint i; + + if (!digits) { + return FALSE; + } + + for (p = (gchar *)digits; !g_ascii_isspace (*p) && (*p != 0); p++) { + /* Skip over 1st string */ + } + + for (i=0; *p != 0; p++) { + if (g_ascii_isdigit (*p)) { + i++; + } + } + + return (i >= n1) && (i <= n2); +} + diff --git a/src/bc-gnubarcode.h b/src/bc-gnubarcode.h new file mode 100644 index 00000000..1e91d998 --- /dev/null +++ b/src/bc-gnubarcode.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * bc_gnubarcode.h: front-end to GNU-barcode-library module header file + * + * Copyright (C) 2001-2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __BC_GNUBARCODE_H__ +#define __BC_GNUBARCODE_H__ + +#include "bc.h" + +G_BEGIN_DECLS + +glBarcode *gl_barcode_gnubarcode_new (const gchar *id, + gboolean text_flag, + gboolean checksum_flag, + gdouble w, + gdouble h, + const gchar *digits); + +G_END_DECLS + +#endif /* __BC_GNUBARCODE_H__ */ diff --git a/src/bc-iec16022.c b/src/bc-iec16022.c new file mode 100644 index 00000000..8fb87fc4 --- /dev/null +++ b/src/bc-iec16022.c @@ -0,0 +1,151 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * bc-iec16022.c: front-end to iec16022-library module + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "bc-iec16022.h" + +#include +#include +#include +#include + +#include "iec16022ecc200.h" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ +#define MIN_PIXEL_SIZE 1.0 + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ +static glBarcode *render_iec16022 (const gchar *grid, + gint i_width, + gint i_height, + gdouble w, + gdouble h); + +/*****************************************************************************/ +/* Generate intermediate representation of barcode. */ +/*****************************************************************************/ +glBarcode * +gl_barcode_iec16022_new (const gchar *id, + gboolean text_flag, + gboolean checksum_flag, + gdouble w, + gdouble h, + const gchar *digits) +{ + gchar *grid; + gint i_width, i_height; + glBarcode *gbc; + + if ( strlen (digits) == 0 ) + { + return NULL; + } + + i_width = 0; + i_height = 0; + + grid = (gchar *)iec16022ecc200 (&i_width, &i_height, NULL, + strlen (digits), (unsigned char *)digits, + NULL, NULL, NULL); + + /* now render with our custom back-end, + to create appropriate intermdediate format */ + gbc = render_iec16022 (grid, i_width, i_height, w, h); + + free (grid); + return gbc; +} + +/*-------------------------------------------------------------------------- + * PRIVATE. Render to glBarcode intermediate representation of barcode. + *--------------------------------------------------------------------------*/ +static glBarcode * +render_iec16022 (const gchar *grid, + gint i_width, + gint i_height, + gdouble w, + gdouble h) +{ + glBarcode *gbc; + glBarcodeLine *line; + gint x, y; + gdouble aspect_ratio, pixel_size; + + /* Treat requested size as a bounding box, scale to maintain aspect + * ratio while fitting it in this bounding box. */ + aspect_ratio = (gdouble)i_height / (gdouble)i_width; + if ( h > w*aspect_ratio ) { + h = w * aspect_ratio; + } else { + w = h / aspect_ratio; + } + + /* Now determine pixel size. */ + pixel_size = w / i_width; + if ( pixel_size < MIN_PIXEL_SIZE ) + { + pixel_size = MIN_PIXEL_SIZE; + } + + gbc = g_new0 (glBarcode, 1); + + /* Now traverse the code string and create a list of boxes */ + for ( y = i_height-1; y >= 0; y-- ) + { + + for ( x = 0; x < i_width; x++ ) + { + + if (*grid++) + { + line = g_new0 (glBarcodeLine, 1); + line->x = x*pixel_size + pixel_size/2.0; + line->y = y*pixel_size; + line->length = pixel_size; + line->width = pixel_size; + gbc->lines = g_list_append (gbc->lines, line); + } + + } + + } + + /* Fill in other info */ + gbc->height = i_height * pixel_size; + gbc->width = i_width * pixel_size; + +#if 0 + g_print ("w=%f, h=%f\n", gbc->width, gbc->height); +#endif + + return gbc; +} + diff --git a/src/bc-iec16022.h b/src/bc-iec16022.h new file mode 100644 index 00000000..099387ac --- /dev/null +++ b/src/bc-iec16022.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * bc_iec16022.h: front-end to iec16022-library module header file + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __BC_IEC16022_H__ +#define __BC_IEC16022_H__ + +#include "bc.h" + +G_BEGIN_DECLS + +glBarcode *gl_barcode_iec16022_new (const gchar *id, + gboolean text_flag, + gboolean checksum_flag, + gdouble w, + gdouble h, + const gchar *digits); + +G_END_DECLS + +#endif /* __BC_IEC16022_H__ */ diff --git a/src/bc-postnet.c b/src/bc-postnet.c new file mode 100644 index 00000000..5b710c09 --- /dev/null +++ b/src/bc-postnet.c @@ -0,0 +1,222 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * bc_postnet.c: GLabels POSTNET barcode module + * + * Copyright (C) 2001-2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * This module implements the POSTNET barcode specified in the USPS + * publication 25, Mar 2001. + */ + +#include + +#include "bc-postnet.h" + +#include +#include +#include +#include + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ +#define POSTNET_BAR_WIDTH 1.25 +#define POSTNET_FULLBAR_HEIGHT 9.00 +#define POSTNET_HALFBAR_HEIGHT 3.50 +#define POSTNET_BAR_PITCH 3.25 +#define POSTNET_HORIZ_MARGIN 9.00 +#define POSTNET_VERT_MARGIN 3.00 + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ +static gchar *symbols[] = { + /* 0 */ "11000", + /* 1 */ "00011", + /* 2 */ "00101", + /* 3 */ "00110", + /* 4 */ "01001", + /* 5 */ "01010", + /* 6 */ "01100", + /* 7 */ "10001", + /* 8 */ "10010", + /* 9 */ "10100", +}; + +static gchar *frame_symbol = "1"; + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ +static gchar *postnet_code (const gchar *digits); + +static gboolean is_length_valid (const gchar *digits, + gint n); + + +/****************************************************************************/ +/* Generate list of lines that form the barcode for the given digits. */ +/****************************************************************************/ +glBarcode * +gl_barcode_postnet_new (const gchar *id, + gboolean text_flag, + gboolean checksum_flag, + gdouble w, + gdouble h, + const gchar *digits) +{ + gchar *code, *p; + glBarcode *gbc; + glBarcodeLine *line; + gdouble x; + + /* Validate code length for all subtypes. */ + if ( (g_strcasecmp (id, "POSTNET") == 0) ) { + if (!is_length_valid (digits, 5) && + !is_length_valid (digits, 9) && + !is_length_valid (digits, 11)) { + return NULL; + } + } + if ( (g_strcasecmp (id, "POSTNET-5") == 0) ) { + if (!is_length_valid (digits, 5)) { + return NULL; + } + } + if ( (g_strcasecmp (id, "POSTNET-9") == 0) ) { + if (!is_length_valid (digits, 9)) { + return NULL; + } + } + if ( (g_strcasecmp (id, "POSTNET-11") == 0) ) { + if (!is_length_valid (digits, 11)) { + return NULL; + } + } + if ( (g_strcasecmp (id, "CEPNET") == 0) ) { + if (!is_length_valid (digits, 8)) { + return NULL; + } + } + + /* First get code string */ + code = postnet_code (digits); + if (code == NULL) { + return NULL; + } + + gbc = g_new0 (glBarcode, 1); + + /* Now traverse the code string and create a list of lines */ + x = POSTNET_HORIZ_MARGIN; + for (p = code; *p != 0; p++) { + line = g_new0 (glBarcodeLine, 1); + line->x = x; + line->y = POSTNET_VERT_MARGIN; + if (*p == '0') { + line->y += + POSTNET_FULLBAR_HEIGHT - POSTNET_HALFBAR_HEIGHT; + line->length = POSTNET_HALFBAR_HEIGHT; + } else { + line->length = POSTNET_FULLBAR_HEIGHT; + } + line->width = POSTNET_BAR_WIDTH; + + gbc->lines = g_list_append (gbc->lines, line); + + x += POSTNET_BAR_PITCH; + } + + g_free (code); + + gbc->width = x + POSTNET_HORIZ_MARGIN; + gbc->height = POSTNET_FULLBAR_HEIGHT + 2 * POSTNET_VERT_MARGIN; + + gbc->chars = NULL; + + return gbc; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Generate string of symbols, representing barcode. */ +/*--------------------------------------------------------------------------*/ +static gchar * +postnet_code (const gchar *digits) +{ + gchar *p; + gint len; + gint d, sum; + GString *code; + gchar *ret; + + /* Left frame bar */ + code = g_string_new (frame_symbol); + + sum = 0; + for (p = (gchar *)digits, len = 0; (*p != 0) && (len < 11); p++) { + if (g_ascii_isdigit (*p)) { + /* Only translate valid characters (0-9) */ + d = (*p) - '0'; + sum += d; + code = g_string_append (code, symbols[d]); + len++; + } + } + + /* Create correction character */ + d = (10 - (sum % 10)) % 10; + code = g_string_append (code, symbols[d]); + + /* Right frame bar */ + code = g_string_append (code, frame_symbol); + + ret = g_strdup (code->str); + g_string_free (code, TRUE); + + return ret; +} + +/*--------------------------------------------------------------------------*/ +/* Validate specific length of string (for subtypes). */ +/*--------------------------------------------------------------------------*/ +static gboolean +is_length_valid (const gchar *digits, + gint n) +{ + gchar *p; + gint i; + + if (!digits) { + return FALSE; + } + + for (p = (gchar *)digits, i=0; *p != 0; p++) { + if (g_ascii_isdigit (*p)) { + i++; + } + } + + return (i == n); +} + diff --git a/src/bc-postnet.h b/src/bc-postnet.h new file mode 100644 index 00000000..6e642ab2 --- /dev/null +++ b/src/bc-postnet.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * bc_postnet.h: GLabels POSTNET barcode module header file + * + * Copyright (C) 2001-2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __BC_POSTNET_H__ +#define __BC_POSTNET_H__ + +#include "bc.h" + +G_BEGIN_DECLS + +glBarcode *gl_barcode_postnet_new (const gchar *id, + gboolean text_flag, + gboolean checksum_flag, + gdouble w, + gdouble h, + const gchar *digits); + +G_END_DECLS + +#endif /* __BC_POSTNET_H__ */ diff --git a/src/bc.c b/src/bc.c new file mode 100644 index 00000000..bcb427f5 --- /dev/null +++ b/src/bc.c @@ -0,0 +1,386 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * bc.c: GLabels barcode module + * + * Copyright (C) 2001-2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "bc.h" + +#include +#include +#include +#include + +#include "bc-postnet.h" +#include "bc-gnubarcode.h" +#include "bc-iec16022.h" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +typedef struct { + gchar *id; + gchar *name; + glBarcodeNewFunc new; + gboolean can_text; + gboolean text_optional; + gboolean can_checksum; + gboolean checksum_optional; + gchar *default_digits; + gboolean can_freeform; + guint prefered_n; +} Backend; + + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +static const Backend backends[] = { + + { "POSTNET", N_("POSTNET (any)"), gl_barcode_postnet_new, + FALSE, FALSE, TRUE, FALSE, "12345-6789-12", FALSE, 11}, + + { "POSTNET-5", N_("POSTNET-5 (ZIP only)"), gl_barcode_postnet_new, + FALSE, FALSE, TRUE, FALSE, "12345", FALSE, 5}, + + { "POSTNET-9", N_("POSTNET-9 (ZIP+4)"), gl_barcode_postnet_new, + FALSE, FALSE, TRUE, FALSE, "12345-6789", FALSE, 9}, + + { "POSTNET-11", N_("POSTNET-11 (DPBC)"), gl_barcode_postnet_new, + FALSE, FALSE, TRUE, FALSE, "12345-6789-12", FALSE, 11}, + + { "CEPNET", N_("CEPNET"), gl_barcode_postnet_new, + FALSE, FALSE, TRUE, FALSE, "12345-678", FALSE, 8}, + + { "EAN", N_("EAN (any)"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "000000000000 00000", FALSE, 17}, + + { "EAN-8", N_("EAN-8"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "0000000", FALSE, 7}, + + { "EAN-8+2", N_("EAN-8 +2"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "0000000 00", FALSE, 9}, + + { "EAN-8+5", N_("EAN-8 +5"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "0000000 00000", FALSE, 12}, + + { "EAN-13", N_("EAN-13"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "000000000000", FALSE, 12}, + + { "EAN-13+2", N_("EAN-13 +2"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "000000000000 00", FALSE, 14}, + + { "EAN-13+5", N_("EAN-13 +5"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "000000000000 00000", FALSE, 17}, + + { "UPC", N_("UPC (UPC-A or UPC-E)"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "00000000000 00000", FALSE, 16}, + + { "UPC-A", N_("UPC-A"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "00000000000", FALSE, 11}, + + { "UPC-A+2", N_("UPC-A +2"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "00000000000 00", FALSE, 13}, + + { "UPC-A+5", N_("UPC-A +5"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "00000000000 00000", FALSE, 16}, + + { "UPC-E", N_("UPC-E"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "000000", FALSE, 6}, + + { "UPC-E+2", N_("UPC-E +2"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "000000 00", FALSE, 8}, + + { "UPC-E+5", N_("UPC-E +5"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "000000 00000", FALSE, 11}, + + { "ISBN", N_("ISBN"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, TRUE, "0-00000-000-0", FALSE, 10}, + + { "ISBN+5", N_("ISBN +5"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, TRUE, "0-00000-000-0 00000", FALSE, 15}, + + { "Code39", N_("Code 39"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, + + { "Code128", N_("Code 128"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, + + { "Code128C", N_("Code 128C"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, FALSE, "0000000000", TRUE, 10}, + + { "Code128B", N_("Code 128B"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, + + { "I25", N_("Interleaved 2 of 5"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, + + { "CBR", N_("Codabar"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, + + { "MSI", N_("MSI"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, + + { "PLS", N_("Plessey"), gl_barcode_gnubarcode_new, + TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10}, + + { "IEC16022", N_("IEC16022 (DataMatrix)"), gl_barcode_iec16022_new, + FALSE, FALSE, TRUE, FALSE, "12345678", TRUE, 8}, + + { NULL, NULL, NULL, FALSE, FALSE, FALSE, FALSE, NULL, FALSE, 0} + +}; + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + + +/*---------------------------------------------------------------------------*/ +/* Convert id to index into above table. */ +/*---------------------------------------------------------------------------*/ +static gint +id_to_index (const gchar *id) +{ + gint i; + + if (id == 0) { + return 0; /* NULL request default. I.e., the first element. */ + } + + for (i=0; backends[i].id != NULL; i++) { + if (g_strcasecmp (id, backends[i].id) == 0) { + return i; + } + } + + g_message( "Unknown barcode id \"%s\"", id ); + return 0; +} + +/*---------------------------------------------------------------------------*/ +/* Convert name to index into above table. */ +/*---------------------------------------------------------------------------*/ +static gint +name_to_index (const gchar *name) +{ + gint i; + + g_return_val_if_fail (name!=NULL, 0); + + for (i=0; backends[i].id != NULL; i++) { + if (g_strcasecmp (name, backends[i].name) == 0) { + return i; + } + } + + g_message( "Unknown barcode name \"%s\"", name ); + return 0; +} + +/*****************************************************************************/ +/* Call appropriate barcode backend to create barcode in intermediate format.*/ +/*****************************************************************************/ +glBarcode * +gl_barcode_new (const gchar *id, + gboolean text_flag, + gboolean checksum_flag, + gdouble w, + gdouble h, + const gchar *digits) +{ + glBarcode *gbc; + gint i; + + g_return_val_if_fail (digits!=NULL, NULL); + + i = id_to_index (id); + gbc = backends[i].new (backends[i].id, + text_flag, + checksum_flag, + w, + h, + digits); + + return gbc; +} + +/*****************************************************************************/ +/* Free previously created barcode. */ +/*****************************************************************************/ +void +gl_barcode_free (glBarcode **gbc) +{ + GList *p; + + if (*gbc != NULL) { + + for (p = (*gbc)->lines; p != NULL; p = p->next) { + g_free (p->data); + p->data = NULL; + } + g_list_free ((*gbc)->lines); + (*gbc)->lines = NULL; + + for (p = (*gbc)->chars; p != NULL; p = p->next) { + g_free (p->data); + p->data = NULL; + } + g_list_free ((*gbc)->chars); + (*gbc)->chars = NULL; + + g_free (*gbc); + *gbc = NULL; + } +} + +/*****************************************************************************/ +/* Get a list of names for valid barcode styles. */ +/*****************************************************************************/ +GList * +gl_barcode_get_styles_list (void) +{ + gint i; + GList *list = NULL; + + for (i=0; backends[i].id != NULL; i++) { + list = g_list_append (list, g_strdup (backends[i].name)); + } + + return list; +} + +/*****************************************************************************/ +/* Free up a previously allocated list of style names. */ +/*****************************************************************************/ +void +gl_barcode_free_styles_list (GList *styles_list) +{ + GList *p; + + for (p=styles_list; p != NULL; p=p->next) { + g_free (p->data); + p->data = NULL; + } + + g_list_free (styles_list); +} + + +/*****************************************************************************/ +/* Return an appropriate set of digits for the given barcode style. */ +/*****************************************************************************/ +gchar * +gl_barcode_default_digits (const gchar *id, + guint n) +{ + int i; + + i = id_to_index (id); + + if (backends[i].can_freeform) { + + return g_strnfill (MAX (n,1), '0'); + + } else { + + return g_strdup (backends[i].default_digits); + + } +} + +/*****************************************************************************/ +/* Query text capabilities. */ +/*****************************************************************************/ +gboolean +gl_barcode_can_text (const gchar *id) +{ + return backends[id_to_index (id)].can_text; +} + +gboolean +gl_barcode_text_optional (const gchar *id) +{ + return backends[id_to_index (id)].text_optional; +} + +/*****************************************************************************/ +/* Query checksum capabilities. */ +/*****************************************************************************/ +gboolean +gl_barcode_can_csum (const gchar *id) +{ + return backends[id_to_index (id)].can_checksum; +} + +gboolean +gl_barcode_csum_optional (const gchar *id) +{ + return backends[id_to_index (id)].checksum_optional; +} + + +/*****************************************************************************/ +/* Query if freeform input is allowed. */ +/*****************************************************************************/ +gboolean +gl_barcode_can_freeform (const gchar *id) +{ + return backends[id_to_index (id)].can_freeform; +} + +/*****************************************************************************/ +/* Query prefered number of digits of input. */ +/*****************************************************************************/ +guint +gl_barcode_get_prefered_n (const gchar *id) +{ + return backends[id_to_index (id)].prefered_n; +} + +/*****************************************************************************/ +/* Convert style to text. */ +/*****************************************************************************/ +const gchar * +gl_barcode_id_to_name (const gchar *id) +{ + return backends[id_to_index (id)].name; +} + +/*****************************************************************************/ +/* Convert name to style. */ +/*****************************************************************************/ +const gchar * +gl_barcode_name_to_id (const gchar *name) +{ + g_return_val_if_fail (name!=NULL, backends[0].id); + + return backends[name_to_index (name)].id; +} diff --git a/src/bc.h b/src/bc.h new file mode 100644 index 00000000..f46d8897 --- /dev/null +++ b/src/bc.h @@ -0,0 +1,90 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * bc.h: GLabels barcode module header file + * + * Copyright (C) 2001-2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __BC_H__ +#define __BC_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +typedef struct { + gdouble x, y, length, width; +} glBarcodeLine; + +typedef struct { + gdouble x, y, fsize; + gchar c; +} glBarcodeChar; + +typedef struct { + gdouble width, height; + GList *lines; /* List of glBarcodeLine */ + GList *chars; /* List of glBarcodeChar */ +} glBarcode; + +typedef glBarcode *(*glBarcodeNewFunc) (const gchar *id, + gboolean text_flag, + gboolean checksum_flag, + gdouble w, + gdouble h, + const gchar *digits); + + +#define GL_BARCODE_FONT_FAMILY "Sans" +#define GL_BARCODE_FONT_WEIGHT PANGO_WEIGHT_NORMAL + + +glBarcode *gl_barcode_new (const gchar *id, + gboolean text_flag, + gboolean checksum_flag, + gdouble w, + gdouble h, + const gchar *digits); + +void gl_barcode_free (glBarcode **bc); + +GList *gl_barcode_get_styles_list (void); +void gl_barcode_free_styles_list (GList *styles_list); + +gchar *gl_barcode_default_digits (const gchar *id, + guint n); + +gboolean gl_barcode_can_text (const gchar *id); +gboolean gl_barcode_text_optional (const gchar *id); + +gboolean gl_barcode_can_csum (const gchar *id); +gboolean gl_barcode_csum_optional (const gchar *id); + +gboolean gl_barcode_can_freeform (const gchar *id); +guint gl_barcode_get_prefered_n (const gchar *id); + +const gchar *gl_barcode_id_to_name (const gchar *id); +const gchar *gl_barcode_name_to_id (const gchar *name); + +G_END_DECLS + +#endif /* __BC_H__ */ + diff --git a/src/cairo-ellipse-path.c b/src/cairo-ellipse-path.c new file mode 100644 index 00000000..3a4cb888 --- /dev/null +++ b/src/cairo-ellipse-path.c @@ -0,0 +1,79 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * cairo_ellipse_path.c: Cairo ellipse path module + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "cairo-ellipse-path.h" + +#include +#include + +#include "debug.h" + +/*===========================================*/ +/* Private macros and constants. */ +/*===========================================*/ + +#define ARC_FINE 2 + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + + + +/*****************************************************************************/ +/* Create ellipse path */ +/*****************************************************************************/ +void +gl_cairo_ellipse_path (cairo_t *cr, + gdouble rx, + gdouble ry) +{ + gdouble x, y; + gint i_theta; + + gl_debug (DEBUG_VIEW, "START"); + + cairo_new_path (cr); + cairo_move_to (cr, 2*rx, ry); + for (i_theta = ARC_FINE; i_theta <= 360; i_theta += ARC_FINE) { + x = rx + rx * cos (i_theta * G_PI / 180.0); + y = ry + ry * sin (i_theta * G_PI / 180.0); + cairo_line_to (cr, x, y); + } + cairo_close_path (cr); + + gl_debug (DEBUG_VIEW, "END"); +} + + diff --git a/src/cairo-ellipse-path.h b/src/cairo-ellipse-path.h new file mode 100644 index 00000000..3c6a7568 --- /dev/null +++ b/src/cairo-ellipse-path.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * cairo_ellipse_path.h: Cairo ellipse path module header file + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __CAIRO_ELLIPSE_PATH_H__ +#define __CAIRO_ELLIPSE_PATH_H__ + +#include +#include + +G_BEGIN_DECLS + +void gl_cairo_ellipse_path (cairo_t *cr, + gdouble rx, + gdouble ry); + + +G_END_DECLS + +#endif diff --git a/src/cairo-label-path.c b/src/cairo-label-path.c new file mode 100644 index 00000000..1bc194ac --- /dev/null +++ b/src/cairo-label-path.c @@ -0,0 +1,263 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * cairo_label_path.c: Cairo label path module + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "cairo-label-path.h" + +#include +#include + +#include "debug.h" + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_cairo_rect_label_path (cairo_t *cr, + lglTemplate *template, + gboolean rotate_flag, + gboolean waste_flag); +static void gl_cairo_round_label_path (cairo_t *cr, + lglTemplate *template, + gboolean rotate_flag, + gboolean waste_flag); +static void gl_cairo_cd_label_path (cairo_t *cr, + lglTemplate *template, + gboolean rotate_flag, + gboolean waste_flag); + + +/*--------------------------------------------------------------------------*/ +/* Create label path */ +/*--------------------------------------------------------------------------*/ +void +gl_cairo_label_path (cairo_t *cr, + lglTemplate *template, + gboolean rotate_flag, + gboolean waste_flag) +{ + const lglTemplateFrame *frame; + + gl_debug (DEBUG_PATH, "START"); + + frame = (lglTemplateFrame *)template->frames->data; + + switch (frame->shape) { + + case LGL_TEMPLATE_FRAME_SHAPE_RECT: + gl_cairo_rect_label_path (cr, template, rotate_flag, waste_flag); + break; + + case LGL_TEMPLATE_FRAME_SHAPE_ROUND: + gl_cairo_round_label_path (cr, template, rotate_flag, waste_flag); + break; + + case LGL_TEMPLATE_FRAME_SHAPE_CD: + gl_cairo_cd_label_path (cr, template, rotate_flag, waste_flag); + break; + + default: + g_message ("Unknown label style"); + break; + } + + gl_debug (DEBUG_PATH, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* Create rectangular label path */ +/*--------------------------------------------------------------------------*/ +static void +gl_cairo_rect_label_path (cairo_t *cr, + lglTemplate *template, + gboolean rotate_flag, + gboolean waste_flag) +{ + const lglTemplateFrame *frame; + gdouble w, h, r; + gdouble x_waste, y_waste; + + gl_debug (DEBUG_PATH, "START"); + + frame = (lglTemplateFrame *)template->frames->data; + r = frame->rect.r; + + x_waste = 0.0; + y_waste = 0.0; + + if (rotate_flag) + { + lgl_template_frame_get_size (frame, &h, &w); + if (waste_flag) + { + x_waste = frame->rect.y_waste; + y_waste = frame->rect.x_waste; + } + } + else + { + lgl_template_frame_get_size (frame, &w, &h); + if (waste_flag) + { + x_waste = frame->rect.x_waste; + y_waste = frame->rect.y_waste; + } + } + + + if ( r == 0.0 ) + { + cairo_rectangle (cr, -x_waste, -y_waste, w+x_waste, h+y_waste); + } + else + { + cairo_new_path (cr); + cairo_arc_negative (cr, r-x_waste, r-y_waste, r, 3*G_PI/2, G_PI); + cairo_arc_negative (cr, r-x_waste, h-r+y_waste, r, G_PI, G_PI/2); + cairo_arc_negative (cr, w-r+x_waste, h-r+y_waste, r, G_PI/2, 0.); + cairo_arc_negative (cr, w-r+x_waste, r-y_waste, r, 2*G_PI, 3*G_PI/2); + cairo_close_path (cr); + } + + gl_debug (DEBUG_PATH, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* Create round label path */ +/*--------------------------------------------------------------------------*/ +static void +gl_cairo_round_label_path (cairo_t *cr, + lglTemplate *template, + gboolean rotate_flag, + gboolean waste_flag) +{ + const lglTemplateFrame *frame; + gdouble w, h; + gdouble waste; + + gl_debug (DEBUG_PATH, "START"); + + frame = (lglTemplateFrame *)template->frames->data; + + if (rotate_flag) + { + lgl_template_frame_get_size (frame, &h, &w); + } + else + { + lgl_template_frame_get_size (frame, &w, &h); + } + + if (waste_flag) + { + waste = frame->round.waste; + } + else + { + waste = 0.0; + } + + cairo_arc (cr, w/2, h/2, w/2+waste, 0.0, 2*G_PI); + cairo_close_path (cr); + + gl_debug (DEBUG_PATH, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* Create cd label path */ +/*--------------------------------------------------------------------------*/ +static void +gl_cairo_cd_label_path (cairo_t *cr, + lglTemplate *template, + gboolean rotate_flag, + gboolean waste_flag) +{ + const lglTemplateFrame *frame; + gdouble w, h; + gdouble xc, yc; + gdouble r1, r2; + gdouble theta1, theta2; + gdouble waste; + + gl_debug (DEBUG_PATH, "START"); + + frame = (lglTemplateFrame *)template->frames->data; + + if (rotate_flag) + { + lgl_template_frame_get_size (frame, &h, &w); + } + else + { + lgl_template_frame_get_size (frame, &w, &h); + } + + xc = w/2.0; + yc = h/2.0; + + r1 = frame->cd.r1; + r2 = frame->cd.r2; + + if (waste_flag) + { + waste = frame->cd.waste; + } + else + { + waste = 0.0; + } + + /* + * Outer path (may be clipped in the case of a business card type CD) + */ + theta1 = acos (w / (2.0*r1)); + theta2 = asin (h / (2.0*r1)); + + cairo_new_path (cr); + cairo_arc (cr, xc, yc, r1+waste, theta1, theta2); + cairo_arc (cr, xc, yc, r1+waste, G_PI-theta2, G_PI-theta1); + cairo_arc (cr, xc, yc, r1+waste, G_PI+theta1, G_PI+theta2); + cairo_arc (cr, xc, yc, r1+waste, 2*G_PI-theta2, 2*G_PI-theta1); + cairo_close_path (cr); + + + /* + * Inner path (hole) + */ + cairo_new_sub_path (cr); + cairo_arc (cr, xc, yc, r2-waste, 0.0, 2*G_PI); + cairo_close_path (cr); + + gl_debug (DEBUG_PATH, "END"); +} + diff --git a/src/cairo-label-path.h b/src/cairo-label-path.h new file mode 100644 index 00000000..ad0495f5 --- /dev/null +++ b/src/cairo-label-path.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * cairo_label_path.h: Cairo label path module header file + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __CAIRO_LABEL_PATH_H__ +#define __CAIRO_LABEL_PATH_H__ + +#include +#include + +G_BEGIN_DECLS + +void gl_cairo_label_path (cairo_t *cr, + lglTemplate *template, + gboolean rotate_flag, + gboolean waste_flag); + +G_END_DECLS + +#endif diff --git a/src/cairo-markup-path.c b/src/cairo-markup-path.c new file mode 100644 index 00000000..04a2a68f --- /dev/null +++ b/src/cairo-markup-path.c @@ -0,0 +1,315 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * cairo_markup_path.c: Cairo markup path module + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "cairo-markup-path.h" + +#include +#include + +#include "debug.h" + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_cairo_markup_margin_path (cairo_t *cr, + const lglTemplateMarkup *markup, + glLabel *label); + +static void gl_cairo_markup_margin_rect_path (cairo_t *cr, + const lglTemplateMarkup *markup, + glLabel *label); + +static void gl_cairo_markup_margin_round_path (cairo_t *cr, + const lglTemplateMarkup *markup, + glLabel *label); + +static void gl_cairo_markup_margin_cd_path (cairo_t *cr, + const lglTemplateMarkup *markup, + glLabel *label); + +static void gl_cairo_markup_line_path (cairo_t *cr, + const lglTemplateMarkup *markup); + +static void gl_cairo_markup_circle_path (cairo_t *cr, + const lglTemplateMarkup *markup); + +static void gl_cairo_markup_rect_path (cairo_t *cr, + const lglTemplateMarkup *markup); + + +/*--------------------------------------------------------------------------*/ +/* Create markup path */ +/*--------------------------------------------------------------------------*/ +void +gl_cairo_markup_path (cairo_t *cr, + const lglTemplateMarkup *markup, + glLabel *label) +{ + gl_debug (DEBUG_PATH, "START"); + + switch (markup->type) { + case LGL_TEMPLATE_MARKUP_MARGIN: + gl_cairo_markup_margin_path (cr, markup, label); + break; + case LGL_TEMPLATE_MARKUP_LINE: + gl_cairo_markup_line_path (cr, markup); + break; + case LGL_TEMPLATE_MARKUP_CIRCLE: + gl_cairo_markup_circle_path (cr, markup); + break; + case LGL_TEMPLATE_MARKUP_RECT: + gl_cairo_markup_rect_path (cr, markup); + break; + default: + g_message ("Unknown template markup type"); + break; + } + + gl_debug (DEBUG_PATH, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw margin markup. */ +/*---------------------------------------------------------------------------*/ +static void +gl_cairo_markup_margin_path (cairo_t *cr, + const lglTemplateMarkup *markup, + glLabel *label) +{ + const lglTemplateFrame *frame; + + gl_debug (DEBUG_PATH, "START"); + + frame = (lglTemplateFrame *)label->template->frames->data; + + switch (frame->shape) { + + case LGL_TEMPLATE_FRAME_SHAPE_RECT: + gl_cairo_markup_margin_rect_path (cr, markup, label); + break; + + case LGL_TEMPLATE_FRAME_SHAPE_ROUND: + gl_cairo_markup_margin_round_path (cr, markup, label); + break; + + case LGL_TEMPLATE_FRAME_SHAPE_CD: + gl_cairo_markup_margin_cd_path (cr, markup, label); + break; + + default: + g_message ("Unknown template label style"); + break; + } + + gl_debug (DEBUG_PATH, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw simple recangular margin. */ +/*---------------------------------------------------------------------------*/ +static void +gl_cairo_markup_margin_rect_path (cairo_t *cr, + const lglTemplateMarkup *markup, + glLabel *label) +{ + const lglTemplateFrame *frame; + gdouble w, h, r, m; + + gl_debug (DEBUG_PATH, "START"); + + frame = (lglTemplateFrame *)label->template->frames->data; + + m = markup->margin.size; + + lgl_template_frame_get_size (frame, &w, &h); + w = w - 2*m; + h = h - 2*m; + r = MAX (frame->rect.r - m, 0.0); + + if ( r == 0.0 ) + { + cairo_rectangle (cr, m, m, w, h); + } + else + { + cairo_new_path (cr); + cairo_arc_negative (cr, m+r, m+r, r, 3*G_PI/2, G_PI); + cairo_arc_negative (cr, m+r, m+h-r, r, G_PI, G_PI/2); + cairo_arc_negative (cr, m+w-r, m+h-r, r, G_PI/2, 0.); + cairo_arc_negative (cr, m+w-r, m+r, r, 2*G_PI, 3*G_PI/2); + cairo_close_path (cr); + } + + gl_debug (DEBUG_PATH, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw round margin. */ +/*---------------------------------------------------------------------------*/ +static void +gl_cairo_markup_margin_round_path (cairo_t *cr, + const lglTemplateMarkup *markup, + glLabel *label) +{ + const lglTemplateFrame *frame; + gdouble r, m; + + gl_debug (DEBUG_PATH, "START"); + + frame = (lglTemplateFrame *)label->template->frames->data; + + r = frame->round.r; + m = markup->margin.size; + + cairo_arc (cr, r, r, r-m, 0, 2*G_PI); + cairo_close_path (cr); + + gl_debug (DEBUG_PATH, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw CD margins. */ +/*---------------------------------------------------------------------------*/ +static void +gl_cairo_markup_margin_cd_path (cairo_t *cr, + const lglTemplateMarkup *markup, + glLabel *label) +{ + const lglTemplateFrame *frame; + gdouble m, r1, r2; + gdouble theta1, theta2; + gdouble xc, yc; + gdouble w, h; + + gl_debug (DEBUG_PATH, "START"); + + frame = (lglTemplateFrame *)label->template->frames->data; + + lgl_template_frame_get_size (frame, &w, &h); + xc = w/2.0; + yc = h/2.0; + + m = markup->margin.size; + r1 = frame->cd.r1 - m; + r2 = frame->cd.r2 + m; + + + /* + * Outer path (may be clipped) + */ + theta1 = acos ((w-2*m) / (2.0*r1)); + theta2 = asin ((h-2*m) / (2.0*r1)); + + cairo_new_path (cr); + cairo_arc (cr, xc, yc, r1, theta1, theta2); + cairo_arc (cr, xc, yc, r1, G_PI-theta2, G_PI-theta1); + cairo_arc (cr, xc, yc, r1, G_PI+theta1, G_PI+theta2); + cairo_arc (cr, xc, yc, r1, 2*G_PI-theta2, 2*G_PI-theta1); + cairo_close_path (cr); + + + /* Inner path (hole) */ + cairo_new_sub_path (cr); + cairo_arc (cr, xc, yc, r2, 0.0, 2*G_PI); + cairo_close_path (cr); + + gl_debug (DEBUG_PATH, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw line markup. */ +/*---------------------------------------------------------------------------*/ +static void +gl_cairo_markup_line_path (cairo_t *cr, + const lglTemplateMarkup *markup) +{ + gl_debug (DEBUG_PATH, "START"); + + cairo_move_to (cr, markup->line.x1, markup->line.y1); + cairo_line_to (cr, markup->line.x2, markup->line.y2); + + gl_debug (DEBUG_PATH, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw circle markup. */ +/*---------------------------------------------------------------------------*/ +static void +gl_cairo_markup_circle_path (cairo_t *cr, + const lglTemplateMarkup *markup) +{ + gl_debug (DEBUG_PATH, "START"); + + cairo_arc (cr, + markup->circle.x0, markup->circle.y0, + markup->circle.r, + 0.0, 2*G_PI); + cairo_close_path (cr); + + gl_debug (DEBUG_PATH, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw rect markup. */ +/*---------------------------------------------------------------------------*/ +static void +gl_cairo_markup_rect_path (cairo_t *cr, + const lglTemplateMarkup *markup) +{ + gdouble x1 = markup->rect.x1; + gdouble y1 = markup->rect.y1; + gdouble w = markup->rect.w; + gdouble h = markup->rect.h; + gdouble r = markup->rect.r; + + gl_debug (DEBUG_PATH, "START"); + + if ( r == 0.0 ) + { + cairo_rectangle (cr, x1, y1, w, h); + } + else + { + cairo_new_path (cr); + cairo_arc_negative (cr, x1+r, y1+r, r, 3*G_PI/2, G_PI); + cairo_arc_negative (cr, x1+r, y1+h-r, r, G_PI, G_PI/2); + cairo_arc_negative (cr, x1+w-r, y1+h-r, r, G_PI/2, 0.); + cairo_arc_negative (cr, x1+w-r, y1+r, r, 2*G_PI, 3*G_PI/2); + cairo_close_path (cr); + } + + gl_debug (DEBUG_PATH, "END"); +} + diff --git a/src/cairo-markup-path.h b/src/cairo-markup-path.h new file mode 100644 index 00000000..9dfab554 --- /dev/null +++ b/src/cairo-markup-path.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * cairo_markup_path.h: Cairo markup path module header file + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __CAIRO_MARKUP_PATH_H__ +#define __CAIRO_MARKUP_PATH_H__ + +#include +#include +#include "label.h" + +G_BEGIN_DECLS + +void gl_cairo_markup_path (cairo_t *cr, + const lglTemplateMarkup *markup, + glLabel *label); + +G_END_DECLS + +#endif diff --git a/src/color.c b/src/color.c new file mode 100644 index 00000000..e4bf3bdf --- /dev/null +++ b/src/color.c @@ -0,0 +1,249 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * color.c: various small utilities for dealing with canvas colors + * + * Copyright (C) 2002-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "color.h" + +#include + +/*****************************************************************************/ +/* Apply given opacity to given color. */ +/*****************************************************************************/ +guint +gl_color_set_opacity (guint color, + gdouble opacity) +{ + guint new_color; + + new_color = (color & 0xFFFFFF00) | (((guint)(255.0*opacity)) & 0xFF); + + return new_color; +} + +/*****************************************************************************/ +/* Resolve actual shadow color by adjusting opacity. */ +/*****************************************************************************/ +guint +gl_color_shadow (guint base_color, + gdouble opacity, + guint object_color) +{ + guint color; + + color = gl_color_set_opacity (base_color, + opacity * GL_COLOR_F_ALPHA (object_color)); + + return color; +} + +/*****************************************************************************/ +/* Convert gLabels color into a GdkColor */ +/*****************************************************************************/ +GdkColor * +gl_color_to_gdk_color (guint color) +{ + GdkColor *gdk_color = NULL; + + if ( GL_COLOR_F_ALPHA (color) ) + { + gdk_color = g_new0 (GdkColor, 1); + + gdk_color->red = GL_COLOR_F_RED (color) * 65535; + gdk_color->green = GL_COLOR_F_GREEN (color) * 65535; + gdk_color->blue = GL_COLOR_F_BLUE (color) * 65535; + } + + return gdk_color; +} + +/*****************************************************************************/ +/* Convert GdkColor into a gLabels color */ +/*****************************************************************************/ +guint +gl_color_from_gdk_color (GdkColor *gdk_color) +{ + guint color = GL_COLOR_NONE; + + if ( gdk_color ) + { + color = GL_COLOR ((gdk_color->red >>8), + (gdk_color->green >>8), + (gdk_color->blue >>8)); + } + + return color; +} + +/****************************************************************************/ +/* Create a single color node with default color. */ +/****************************************************************************/ +glColorNode * +gl_color_node_new_default (void) +{ + glColorNode* color_node; + + color_node = g_new0(glColorNode,1); + + color_node->field_flag = FALSE; + color_node->color = GL_COLOR_NONE; + color_node->key = NULL; + + return color_node; +} + +/****************************************************************************/ +/* Copy a single color node. */ +/****************************************************************************/ +glColorNode * +gl_color_node_dup (glColorNode *src) +{ + glColorNode *dst; + + if ( src == NULL ) return NULL; + + dst = g_new0 (glColorNode, 1); + + dst->field_flag = src->field_flag; + if (src->key != NULL) + { + dst->key = g_strdup (src->key); + } + else + { + dst->key = NULL; + } + dst->color = src->color; + + return dst; +} + +/****************************************************************************/ +/* Compare 2 color nodes for equality. */ +/****************************************************************************/ +gboolean +gl_color_node_equal (glColorNode *color_node1, + glColorNode *color_node2) +{ + /* First take care of the case of either or both being NULL. */ + if ( color_node1 == NULL ) + { + return ( color_node2 == NULL ); + } + else + { + if ( color_node2 == NULL ) + { + return FALSE; + } + } + + /* Bail if field flags differ. */ + if ( color_node1->field_flag != color_node2->field_flag ) + { + return FALSE; + } + + /* Now take care of the case of either or both color fields being different. */ + if ( color_node1->color != color_node2->color ) + { + return FALSE; + } + + /* Then take care of the case of either or both key fields being NULL. */ + if ( color_node1->key == NULL ) + { + return ( color_node2->key == NULL ); + } + else + { + if ( color_node2->key == NULL ) + { + return FALSE; + } + } + + /* Field flags are identical, so now compare the keys. */ + return (strcmp (color_node1->key, color_node2->key) == 0); +} + +/****************************************************************************/ +/* Expand single node into representative color. */ +/****************************************************************************/ +guint +gl_color_node_expand (glColorNode *color_node, + glMergeRecord *record) +{ + gchar *text; + GdkColor *gdk_color; + guint color; + + if (color_node->field_flag) + { + if (record == NULL) + { + return GL_COLOR_NONE; + } + else + { + text = gl_merge_eval_key (record, color_node->key); + if (text != NULL) + { + gdk_color = g_new0 (GdkColor, 1); + if (gdk_color_parse (text, gdk_color)) + { + color = gl_color_from_gdk_color (gdk_color); + g_free (gdk_color); + return color; + } + else + { + g_free (gdk_color); + return GL_COLOR_NONE; + } + } + else + { + return GL_COLOR_NONE; + } + } + } + else + { + return color_node->color; + } +} + +/****************************************************************************/ +/* Free a single color node. */ +/****************************************************************************/ +void +gl_color_node_free (glColorNode **color_node) +{ + if ( *color_node == NULL ) return; + + g_free ((*color_node)->key); + (*color_node)->key = NULL; + g_free (*color_node); + *color_node = NULL; +} diff --git a/src/color.h b/src/color.h new file mode 100644 index 00000000..c4403ad5 --- /dev/null +++ b/src/color.h @@ -0,0 +1,119 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * color.h: various small utilities for dealing with canvas colors + * + * Copyright (C) 2002-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __COLOR_H__ +#define __COLOR_H__ + +#include "merge.h" +#include + +G_BEGIN_DECLS + +/* + * gLabels stores colors as a 32-bit unsigned integer in RGBA format (MSByte = Red) + */ +#define GL_COLOR(r,g,b) ( (((unsigned int) (r) & 0xff) << 24) \ + | (((unsigned int) (g) & 0xff) << 16) \ + | (((unsigned int) (b) & 0xff) << 8) \ + | 0xff ) + +#define GL_COLOR_A(r,g,b,a) ( (((unsigned int) (r) & 0xff) << 24) \ + | (((unsigned int) (g) & 0xff) << 16) \ + | (((unsigned int) (b) & 0xff) << 8) \ + | ( (unsigned int) (a) & 0xff ) ) + + +#define GL_COLOR_NONE GL_COLOR_A(0,0,0,0) +#define GL_COLOR_FILL_MERGE_DEFAULT GL_COLOR_A(255,255,255,128) +#define GL_COLOR_MERGE_DEFAULT GL_COLOR_A(0,0,0,128) +#define GL_COLOR_SHADOW_DEFAULT GL_COLOR(0,0,0) +#define GL_COLOR_SHADOW_MERGE_DEFAULT GL_COLOR_A(0,0,0,255) + + +/* + * Extract components as floating point (0.0 .. 1.0) + */ +#define GL_COLOR_F_RED(x) ( (((x)>>24) & 0xff) / 255.0 ) +#define GL_COLOR_F_GREEN(x) ( (((x)>>16) & 0xff) / 255.0 ) +#define GL_COLOR_F_BLUE(x) ( (((x)>>8) & 0xff) / 255.0 ) +#define GL_COLOR_F_ALPHA(x) ( ( (x) & 0xff) / 255.0 ) + +/* + * Extract arguments for cairo_set_source_rgb() + */ +#define GL_COLOR_RGB_ARGS(x) \ + GL_COLOR_F_RED(x), \ + GL_COLOR_F_GREEN(x), \ + GL_COLOR_F_BLUE(x) + +/* + * Extract arguments for cairo_set_source_rgba() + */ +#define GL_COLOR_RGBA_ARGS(x) \ + GL_COLOR_F_RED(x), \ + GL_COLOR_F_GREEN(x), \ + GL_COLOR_F_BLUE(x), \ + GL_COLOR_F_ALPHA(x) + + + + +guint gl_color_set_opacity (guint color, + gdouble opacity); + +guint gl_color_shadow (guint base_color, + gdouble opacity, + guint object_color); + +/* + * Routines to convert to/from GdkColor. + */ +GdkColor *gl_color_to_gdk_color (guint color); + +guint gl_color_from_gdk_color (GdkColor *gdk_color); + + + +/* + * Color nodes + */ +typedef struct { + gboolean field_flag; + guint color; + gchar *key; +} glColorNode; + +glColorNode *gl_color_node_new_default (void); + +glColorNode *gl_color_node_dup (glColorNode *color_node); +gboolean gl_color_node_equal (glColorNode *color_node1, + glColorNode *color_node2); +guint gl_color_node_expand (glColorNode *color_node, + glMergeRecord *record); +void gl_color_node_free (glColorNode **color_node); + + +G_END_DECLS + +#endif /* __COLOR_H__ */ diff --git a/src/critical-error-handler.c b/src/critical-error-handler.c new file mode 100644 index 00000000..69a88665 --- /dev/null +++ b/src/critical-error-handler.c @@ -0,0 +1,83 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * critical-error-handler.c: critical error handler + * + * Copyright (C) 2005 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include + +#include "critical-error-handler.h" + +#include +#include +#include +#include +#include + +static void critical_error_handler (const gchar *log_domain, + GLogLevelFlags log_level, + const gchar *message, + gpointer user_data); + + +/***************************************************************************/ +/* Initialize error handler. */ +/***************************************************************************/ +void +gl_critical_error_handler_init (void) +{ + g_log_set_handler ("LibGlabels", + G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, + critical_error_handler, + "libglabels"); + + g_log_set_handler (G_LOG_DOMAIN, + G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, + critical_error_handler, + "glabels"); +} + +/*-------------------------------------------------------------------------*/ +/* PRIVATE. Actual error handler. */ +/*-------------------------------------------------------------------------*/ +static void +critical_error_handler (const gchar *log_domain, + GLogLevelFlags log_level, + const gchar *message, + gpointer user_data) +{ + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_NONE, + _("gLabels Fatal Error!")); + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + "%s", message); + gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_QUIT, 0); + + gtk_dialog_run (GTK_DIALOG (dialog)); + + abort (); +} + diff --git a/src/critical-error-handler.h b/src/critical-error-handler.h new file mode 100644 index 00000000..890db9b5 --- /dev/null +++ b/src/critical-error-handler.h @@ -0,0 +1,36 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * critical-error-handler.h: critical error handler header file + * + * Copyright (C) 2005 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __CRITICAL_ERROR_HANDLER_H__ +#define __CRITICAL_ERROR_HANDLER_H__ + +#include + +G_BEGIN_DECLS + +void gl_critical_error_handler_init (void); + +G_END_DECLS + +#endif diff --git a/src/debug.c b/src/debug.c new file mode 100644 index 00000000..eea3fe5d --- /dev/null +++ b/src/debug.c @@ -0,0 +1,129 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * debug.c: GLabels debug module + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * This file is based on gedit-debug.c from gedit2: + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * + */ + +#include "debug.h" + +#include +#include +#include +#include + +glDebugSection debug_flags = GLABELS_DEBUG_NONE; + +/****************************************************************************/ +/* Initialize debug flags, based on environmental variables. */ +/****************************************************************************/ +void +gl_debug_init (void) +{ + if (g_getenv ("GLABELS_DEBUG") != NULL) + { + /* enable all debugging */ + debug_flags = ~GLABELS_DEBUG_NONE; + return; + } + + if (g_getenv ("GLABELS_DEBUG_VIEW") != NULL) + debug_flags |= GLABELS_DEBUG_VIEW; + if (g_getenv ("GLABELS_DEBUG_ITEM") != NULL) + debug_flags |= GLABELS_DEBUG_ITEM; + if (g_getenv ("GLABELS_DEBUG_PRINT") != NULL) + debug_flags |= GLABELS_DEBUG_PRINT; + if (g_getenv ("GLABELS_DEBUG_PREFS") != NULL) + debug_flags |= GLABELS_DEBUG_PREFS; + if (g_getenv ("GLABELS_DEBUG_FILE") != NULL) + debug_flags |= GLABELS_DEBUG_FILE; + if (g_getenv ("GLABELS_DEBUG_LABEL") != NULL) + debug_flags |= GLABELS_DEBUG_LABEL; + if (g_getenv ("GLABELS_DEBUG_TEMPLATE") != NULL) + debug_flags |= GLABELS_DEBUG_TEMPLATE; + if (g_getenv ("GLABELS_DEBUG_PAPER") != NULL) + debug_flags |= GLABELS_DEBUG_PAPER; + if (g_getenv ("GLABELS_DEBUG_XML") != NULL) + debug_flags |= GLABELS_DEBUG_XML; + if (g_getenv ("GLABELS_DEBUG_MERGE") != NULL) + debug_flags |= GLABELS_DEBUG_MERGE; + if (g_getenv ("GLABELS_DEBUG_UNDO") != NULL) + debug_flags |= GLABELS_DEBUG_UNDO; + if (g_getenv ("GLABELS_DEBUG_RECENT") != NULL) + debug_flags |= GLABELS_DEBUG_RECENT; + if (g_getenv ("GLABELS_DEBUG_COMMANDS") != NULL) + debug_flags |= GLABELS_DEBUG_COMMANDS; + if (g_getenv ("GLABELS_DEBUG_WINDOW") != NULL) + debug_flags |= GLABELS_DEBUG_WINDOW; + if (g_getenv ("GLABELS_DEBUG_UI") != NULL) + debug_flags |= GLABELS_DEBUG_UI; + if (g_getenv ("GLABELS_DEBUG_PROPERTY_BAR") != NULL) + debug_flags |= GLABELS_DEBUG_PROPERTY_BAR; + if (g_getenv ("GLABELS_DEBUG_MEDIA_SELECT") != NULL) + debug_flags |= GLABELS_DEBUG_MEDIA_SELECT; + if (g_getenv ("GLABELS_DEBUG_MINI_PREVIEW") != NULL) + debug_flags |= GLABELS_DEBUG_MINI_PREVIEW; + if (g_getenv ("GLABELS_DEBUG_PIXBUF_CACHE") != NULL) + debug_flags |= GLABELS_DEBUG_PIXBUF_CACHE; + if (g_getenv ("GLABELS_DEBUG_EDITOR") != NULL) + debug_flags |= GLABELS_DEBUG_EDITOR; + if (g_getenv ("GLABELS_DEBUG_WDGT") != NULL) + debug_flags |= GLABELS_DEBUG_WDGT; + if (g_getenv ("GLABELS_DEBUG_PATH") != NULL) + debug_flags |= GLABELS_DEBUG_PATH; +} + + +/****************************************************************************/ +/* Print debugging information. */ +/****************************************************************************/ +void +gl_debug (glDebugSection section, + const gchar *file, + gint line, + const gchar *function, + const gchar *format, + ...) +{ + if (debug_flags & section) + { + va_list args; + gchar *msg; + + g_return_if_fail (format != NULL); + + va_start (args, format); + msg = g_strdup_vprintf (format, args); + va_end (args); + + g_print ("%s:%d (%s) %s\n", file, line, function, msg); + + g_free (msg); + } + +} diff --git a/src/debug.h b/src/debug.h new file mode 100644 index 00000000..5840487d --- /dev/null +++ b/src/debug.h @@ -0,0 +1,110 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * debug.h: GLabels debug module + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * This file is based on gedit-debug.h from gedit2: + * + * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence + * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi + * + */ +#ifndef __DEBUG_H__ +#define __DEBUG_H__ + +#include + +G_BEGIN_DECLS + +/* + * Set an environmental var of the same name to turn on + * debugging output. Setting GLABELS_DEBUG will turn on all + * sections. + */ + +typedef enum { + GLABELS_DEBUG_NONE = 0, + GLABELS_DEBUG_VIEW = 1 << 0, + GLABELS_DEBUG_ITEM = 1 << 1, + GLABELS_DEBUG_PRINT = 1 << 2, + GLABELS_DEBUG_PREFS = 1 << 3, + GLABELS_DEBUG_FILE = 1 << 4, + GLABELS_DEBUG_LABEL = 1 << 5, + GLABELS_DEBUG_TEMPLATE = 1 << 6, + GLABELS_DEBUG_PAPER = 1 << 7, + GLABELS_DEBUG_XML = 1 << 8, + GLABELS_DEBUG_MERGE = 1 << 9, + GLABELS_DEBUG_UNDO = 1 << 10, + GLABELS_DEBUG_RECENT = 1 << 11, + GLABELS_DEBUG_COMMANDS = 1 << 12, + GLABELS_DEBUG_WINDOW = 1 << 13, + GLABELS_DEBUG_UI = 1 << 14, + GLABELS_DEBUG_PROPERTY_BAR = 1 << 15, + GLABELS_DEBUG_MEDIA_SELECT = 1 << 16, + GLABELS_DEBUG_MINI_PREVIEW = 1 << 17, + GLABELS_DEBUG_PIXBUF_CACHE = 1 << 18, + GLABELS_DEBUG_EDITOR = 1 << 19, + GLABELS_DEBUG_WDGT = 1 << 20, + GLABELS_DEBUG_PATH = 1 << 21, +} glDebugSection; + + +#ifndef __GNUC__ +#define __FUNCTION__ "" +#endif + +#define DEBUG_VIEW GLABELS_DEBUG_VIEW, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_ITEM GLABELS_DEBUG_ITEM, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_PRINT GLABELS_DEBUG_PRINT, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_PREFS GLABELS_DEBUG_PREFS, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_FILE GLABELS_DEBUG_FILE, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_LABEL GLABELS_DEBUG_LABEL, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_TEMPLATE GLABELS_DEBUG_TEMPLATE,__FILE__, __LINE__, __FUNCTION__ +#define DEBUG_PAPER GLABELS_DEBUG_PAPER, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_XML GLABELS_DEBUG_XML, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_MERGE GLABELS_DEBUG_MERGE, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_UNDO GLABELS_DEBUG_UNDO, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_RECENT GLABELS_DEBUG_RECENT, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_COMMANDS GLABELS_DEBUG_COMMANDS,__FILE__, __LINE__, __FUNCTION__ +#define DEBUG_WINDOW GLABELS_DEBUG_WINDOW, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_UI GLABELS_DEBUG_UI, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_PROPERTY_BAR GLABELS_DEBUG_PROPERTY_BAR, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_MEDIA_SELECT GLABELS_DEBUG_MEDIA_SELECT, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_MINI_PREVIEW GLABELS_DEBUG_MINI_PREVIEW, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_PIXBUF_CACHE GLABELS_DEBUG_PIXBUF_CACHE, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_EDITOR GLABELS_DEBUG_EDITOR, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_WDGT GLABELS_DEBUG_WDGT, __FILE__, __LINE__, __FUNCTION__ +#define DEBUG_PATH GLABELS_DEBUG_PATH, __FILE__, __LINE__, __FUNCTION__ + +void gl_debug_init (void); + +void gl_debug (glDebugSection section, + const gchar *file, + gint line, + const gchar *function, + const gchar *format, + ...); + +G_END_DECLS + +#endif /* __DEBUG_H__ */ diff --git a/src/file.c b/src/file.c new file mode 100644 index 00000000..86073e75 --- /dev/null +++ b/src/file.c @@ -0,0 +1,844 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * file.c: FILE menu dialog module + * + * Copyright (C) 2001 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "file.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "xml-label.h" +#include "recent.h" +#include "util.h" +#include "window.h" +#include "new-label-dialog.h" +#include "libglabels/libglabels.h" +#include "debug.h" + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/* Saved state for new dialog */ +static gchar *page_size = NULL; +static gchar *category = NULL; +static gchar *sheet_name = NULL; +static gboolean rotate_flag = FALSE; + +/* Saved state of file selectors */ +static gchar *open_path = NULL; +static gchar *save_path = NULL; + +/*===========================================*/ +/* Local function prototypes. */ +/*===========================================*/ +static void new_response (GtkDialog *dialog, + gint response, + gpointer user_data); + +static void properties_response (GtkDialog *dialog, + gint response, + gpointer user_data); + +static void open_response (GtkDialog *chooser, + gint response, + glWindow *window); +static void save_as_response (GtkDialog *chooser, + gint response, + glLabel *label); + + +/*****************************************************************************/ +/* "New" menu callback. */ +/*****************************************************************************/ +void +gl_file_new (glWindow *window) +{ + GtkWidget *dialog; + + gl_debug (DEBUG_FILE, "START"); + + g_return_if_fail (window && GTK_IS_WINDOW (window)); + + dialog = gl_new_label_dialog_new (GTK_WINDOW (window)); + gtk_window_set_title (GTK_WINDOW (dialog), _("New Label or Card")); + + g_object_set_data (G_OBJECT (dialog), "parent_window", window); + + g_signal_connect (G_OBJECT(dialog), "response", + G_CALLBACK (new_response), dialog); + + if (page_size != NULL) { + gl_new_label_dialog_set_filter_parameters (GL_NEW_LABEL_DIALOG (dialog), + page_size, + category); + } + if (sheet_name != NULL) { + gl_new_label_dialog_set_template_name (GL_NEW_LABEL_DIALOG (dialog), + sheet_name); + } + gl_new_label_dialog_set_rotate_state (GL_NEW_LABEL_DIALOG (dialog), rotate_flag); + + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + gtk_widget_show_all (GTK_WIDGET (dialog)); + + gl_debug (DEBUG_FILE, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. New "ok" button callback. */ +/*---------------------------------------------------------------------------*/ +static void +new_response (GtkDialog *dialog, + gint response, + gpointer user_data) +{ + lglTemplate *template; + glLabel *label; + glWindow *window; + GtkWidget *new_window; + + gl_debug (DEBUG_FILE, "START"); + + switch (response) { + + case GTK_RESPONSE_OK: + + gl_new_label_dialog_get_filter_parameters (GL_NEW_LABEL_DIALOG (dialog), + &page_size, + &category); + + if (sheet_name != NULL) + g_free (sheet_name); + sheet_name = + gl_new_label_dialog_get_template_name (GL_NEW_LABEL_DIALOG (dialog)); + + rotate_flag = + gl_new_label_dialog_get_rotate_state (GL_NEW_LABEL_DIALOG (dialog)); + + template = lgl_db_lookup_template_from_name (sheet_name); + + label = GL_LABEL(gl_label_new ()); + gl_label_set_template (label, template); + gl_label_set_rotate_flag (label, rotate_flag); + + lgl_template_free (template); + + window = + GL_WINDOW (g_object_get_data (G_OBJECT (dialog), + "parent_window")); + if ( gl_window_is_empty (window) ) { + gl_window_set_label (window, label); + } else { + new_window = gl_window_new_from_label (label); + gtk_widget_show_all (new_window); + } + + break; + + default: + break; + } + + gtk_widget_destroy (GTK_WIDGET (dialog)); + + gl_debug (DEBUG_FILE, "END"); +} + +/*****************************************************************************/ +/* "Properties" menu callback. */ +/*****************************************************************************/ +void +gl_file_properties (glLabel *label, + glWindow *window) +{ + GtkWidget *dialog; + gchar *name; + + gl_debug (DEBUG_FILE, "START"); + + g_return_if_fail (label && GL_IS_LABEL (label)); + g_return_if_fail (window && GTK_IS_WINDOW (window)); + + dialog = gl_new_label_dialog_new (GTK_WINDOW (window)); + gtk_window_set_title (GTK_WINDOW (dialog), _("Label properties")); + + g_object_set_data (G_OBJECT (dialog), "label", label); + + g_signal_connect (G_OBJECT(dialog), "response", + G_CALLBACK (properties_response), dialog); + + if (label->template->paper_id != NULL) { + gl_new_label_dialog_set_filter_parameters (GL_NEW_LABEL_DIALOG (dialog), + label->template->paper_id, + NULL); + } + name = lgl_template_get_name (label->template); + if (name != NULL) { + gl_new_label_dialog_set_template_name (GL_NEW_LABEL_DIALOG (dialog), name); + } + g_free (name); + + gl_new_label_dialog_set_rotate_state (GL_NEW_LABEL_DIALOG (dialog), + label->rotate_flag); + + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + gtk_widget_show_all (GTK_WIDGET (dialog)); + + gl_debug (DEBUG_FILE, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Properties "ok" button callback. */ +/*---------------------------------------------------------------------------*/ +static void +properties_response (GtkDialog *dialog, + gint response, + gpointer user_data) +{ + lglTemplate *template; + glLabel *label; + + gl_debug (DEBUG_FILE, "START"); + + switch (response) { + + case GTK_RESPONSE_OK: + + gl_new_label_dialog_get_filter_parameters (GL_NEW_LABEL_DIALOG (dialog), + &page_size, + &category); + + if (sheet_name != NULL) + g_free (sheet_name); + sheet_name = + gl_new_label_dialog_get_template_name (GL_NEW_LABEL_DIALOG (dialog)); + + rotate_flag = + gl_new_label_dialog_get_rotate_state (GL_NEW_LABEL_DIALOG (dialog)); + + template = lgl_db_lookup_template_from_name (sheet_name); + + label = GL_LABEL(g_object_get_data (G_OBJECT (dialog), "label")); + gl_label_set_template (label, template); + gl_label_set_rotate_flag (label, rotate_flag); + + break; + + default: + break; + } + + gtk_widget_destroy (GTK_WIDGET (dialog)); + + gl_debug (DEBUG_FILE, "END"); +} + +/*****************************************************************************/ +/* "Open" menu callback. */ +/*****************************************************************************/ +void +gl_file_open (glWindow *window) +{ + GtkWidget *chooser; + GtkFileFilter *filter; + + gl_debug (DEBUG_FILE, "START"); + + g_return_if_fail (window != NULL); + + chooser = gtk_file_chooser_dialog_new ("Open label", + GTK_WINDOW (window), + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + + /* Recover state of open dialog */ + if (open_path != NULL) { + gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(chooser), + open_path); + } + + filter = gtk_file_filter_new (); + gtk_file_filter_add_pattern (filter, "*"); + gtk_file_filter_set_name (filter, _("All files")); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); + + filter = gtk_file_filter_new (); + gtk_file_filter_add_pattern (filter, "*.glabels"); + gtk_file_filter_set_name (filter, _("gLabels documents")); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); + + gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser), filter); + + g_signal_connect (G_OBJECT (chooser), "response", + G_CALLBACK (open_response), window); + + /* show the dialog */ + gtk_widget_show (GTK_WIDGET (chooser)); + + gl_debug (DEBUG_FILE, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Open "response" callback. */ +/*---------------------------------------------------------------------------*/ +static void +open_response (GtkDialog *chooser, + gint response, + glWindow *window) +{ + gchar *raw_filename; + gchar *filename; + GtkWidget *dialog; + + gl_debug (DEBUG_FILE, "START"); + + g_return_if_fail (chooser && GTK_IS_FILE_CHOOSER (chooser)); + g_return_if_fail (window && GTK_IS_WINDOW (window)); + + switch (response) { + + case GTK_RESPONSE_ACCEPT: + /* get the filename */ + raw_filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(chooser)); + filename = g_filename_to_utf8 (raw_filename, -1, NULL, NULL, NULL); + + if (!raw_filename || + !filename || + g_file_test (raw_filename, G_FILE_TEST_IS_DIR)) { + + dialog = gtk_message_dialog_new (GTK_WINDOW(chooser), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_CLOSE, + _("Empty file name selection")); + gtk_message_dialog_format_secondary_text ( + GTK_MESSAGE_DIALOG (dialog), + _("Please select a file or supply a valid file name")); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + } else { + + if (!g_file_test (raw_filename, G_FILE_TEST_IS_REGULAR)) { + + dialog = gtk_message_dialog_new (GTK_WINDOW(chooser), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_CLOSE, + _("File does not exist")); + gtk_message_dialog_format_secondary_text ( + GTK_MESSAGE_DIALOG (dialog), + _("Please select a file or supply a valid file name")); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + + } else { + + if ( gl_file_open_real (filename, window) ) { + gtk_widget_destroy (GTK_WIDGET (chooser)); + } + + } + + } + + g_free (filename); + g_free (raw_filename); + break; + + default: + gtk_widget_destroy (GTK_WIDGET (chooser)); + break; + + } + + gl_debug (DEBUG_FILE, "END"); +} + + +/*****************************************************************************/ +/* "Open recent" menu callback. */ +/*****************************************************************************/ +void +gl_file_open_recent (const gchar *filename, + glWindow *window) +{ + gl_debug (DEBUG_FILE, ""); + + if (filename) { + gl_debug (DEBUG_FILE, "open recent: %s", filename); + + gl_file_open_real (filename, window); + } +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Open a file. */ +/*---------------------------------------------------------------------------*/ +gboolean +gl_file_open_real (const gchar *filename, + glWindow *window) +{ + gchar *abs_filename; + glLabel *label; + glXMLLabelStatus status; + GtkWidget *new_window; + + gl_debug (DEBUG_FILE, "START"); + + abs_filename = gl_util_make_absolute (filename); + label = gl_xml_label_open (abs_filename, &status); + if (!label) { + GtkWidget *dialog; + + gl_debug (DEBUG_FILE, "couldn't open file"); + + dialog = gtk_message_dialog_new (GTK_WINDOW (window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Could not open file \"%s\""), + filename); + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + _("Not a supported file format")); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + g_free (abs_filename); + + gl_debug (DEBUG_FILE, "END false"); + + return FALSE; + + } else { + + if ( gl_window_is_empty (GL_WINDOW(window)) ) { + gl_window_set_label (GL_WINDOW(window), label); + } else { + new_window = gl_window_new_from_label (label); + gtk_widget_show_all (new_window); + } + + gl_recent_add_utf8_filename (abs_filename); + + if (open_path != NULL) + g_free (open_path); + open_path = g_path_get_dirname (abs_filename); + g_free (abs_filename); + + gl_debug (DEBUG_FILE, "END true"); + + return TRUE; + + } +} + +/*****************************************************************************/ +/* "Save" menu callback. */ +/*****************************************************************************/ +gboolean +gl_file_save (glLabel *label, + glWindow *window) +{ + glXMLLabelStatus status; + gchar *filename = NULL; + + gl_debug (DEBUG_FILE, ""); + + g_return_val_if_fail (label != NULL, FALSE); + + if (gl_label_is_untitled (label)) + { + gl_debug (DEBUG_FILE, "Untitled"); + + return gl_file_save_as (label, window); + } + + if (!gl_label_is_modified (label)) + { + gl_debug (DEBUG_FILE, "Not modified"); + + return TRUE; + } + + filename = gl_label_get_filename (label); + g_return_val_if_fail (filename != NULL, FALSE); + + gl_xml_label_save (label, filename, &status); + + if (status != XML_LABEL_OK) + { + GtkWidget *dialog; + + gl_debug (DEBUG_FILE, "FAILED"); + + dialog = gtk_message_dialog_new (GTK_WINDOW (window), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Could not save file \"%s\""), + filename); + gtk_message_dialog_format_secondary_text ( + GTK_MESSAGE_DIALOG (dialog), + _("Error encountered during save. The file is still not saved.")); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + g_free (filename); + + return FALSE; + } + else + { + gl_debug (DEBUG_FILE, "OK"); + + gl_recent_add_utf8_filename (filename); + + g_free (filename); + + return TRUE; + } +} + +/*****************************************************************************/ +/* "Save As" menu callback. */ +/*****************************************************************************/ +gboolean +gl_file_save_as (glLabel *label, + glWindow *window) +{ + GtkWidget *chooser; + GtkFileFilter *filter; + gboolean saved_flag = FALSE; + gchar *name, *title; + + gl_debug (DEBUG_FILE, "START"); + + g_return_val_if_fail (label && GL_IS_LABEL(label), FALSE); + g_return_val_if_fail (window && GL_IS_WINDOW(window), FALSE); + + name = gl_label_get_short_name (label); + title = g_strdup_printf (_("Save \"%s\" as"), name); + g_free (name); + + chooser = gtk_file_chooser_dialog_new (title, + GTK_WINDOW (window), + GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, + NULL); + + gtk_window_set_modal (GTK_WINDOW (chooser), TRUE); + + g_free (title); + + /* Recover proper state of save-as dialog */ + if (save_path != NULL) { + gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(chooser), + save_path); + } + + filter = gtk_file_filter_new (); + gtk_file_filter_add_pattern (filter, "*"); + gtk_file_filter_set_name (filter, _("All files")); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); + + filter = gtk_file_filter_new (); + gtk_file_filter_add_pattern (filter, "*.glabels"); + gtk_file_filter_set_name (filter, _("gLabels documents")); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); + + gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser), filter); + + g_signal_connect (G_OBJECT (chooser), "response", + G_CALLBACK (save_as_response), label); + + g_object_set_data (G_OBJECT (chooser), "saved_flag", &saved_flag); + + /* show the dialog */ + gtk_widget_show (GTK_WIDGET (chooser)); + + /* Hold here and process events until we are done with this dialog. */ + /* This is so we can return a boolean result of our save attempt. */ + gtk_main (); + + gl_debug (DEBUG_FILE, "END"); + + /* Return flag as set by one of the above callbacks, TRUE = saved */ + return saved_flag; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. "Save As" ok button callback. */ +/*---------------------------------------------------------------------------*/ +static void +save_as_response (GtkDialog *chooser, + gint response, + glLabel *label) +{ + gchar *raw_filename, *filename, *full_filename; + GtkWidget *dialog; + glXMLLabelStatus status; + gboolean *saved_flag; + gboolean cancel_flag = FALSE; + + gl_debug (DEBUG_FILE, "START"); + + g_return_if_fail (GTK_IS_FILE_CHOOSER (chooser)); + + saved_flag = g_object_get_data (G_OBJECT(chooser), "saved_flag"); + + switch (response) { + + case GTK_RESPONSE_ACCEPT: + /* get the filename */ + raw_filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(chooser)); + + gl_debug (DEBUG_FILE, "raw_filename = \"%s\"", raw_filename); + + if (!raw_filename || g_file_test (raw_filename, G_FILE_TEST_IS_DIR)) { + + dialog = gtk_message_dialog_new (GTK_WINDOW(chooser), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_CLOSE, + _("Empty file name selection")); + gtk_message_dialog_format_secondary_text ( + GTK_MESSAGE_DIALOG (dialog), + _("Please supply a valid file name")); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + } else { + + full_filename = gl_util_add_extension (raw_filename); + + filename = g_filename_to_utf8 (full_filename, -1, + NULL, NULL, NULL); + + gl_debug (DEBUG_FILE, "filename = \"%s\"", filename); + + if (g_file_test (full_filename, G_FILE_TEST_IS_REGULAR)) { + gint ret; + + dialog = gtk_message_dialog_new (GTK_WINDOW(chooser), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_YES_NO, + _("Overwrite file \"%s\"?"), + filename); + gtk_message_dialog_format_secondary_text ( + GTK_MESSAGE_DIALOG (dialog), + _("File already exists.")); + + ret = gtk_dialog_run (GTK_DIALOG (dialog)); + if ( ret == GTK_RESPONSE_NO ) { + cancel_flag = TRUE; + } + gtk_widget_destroy (dialog); + } + + if (!cancel_flag) { + + gl_xml_label_save (label, filename, &status); + + gl_debug (DEBUG_FILE, "status of save = %d", status); + + if ( status != XML_LABEL_OK ) { + + dialog = gtk_message_dialog_new ( + GTK_WINDOW(chooser), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Could not save file \"%s\""), + filename); + gtk_message_dialog_format_secondary_text ( + GTK_MESSAGE_DIALOG (dialog), + _("Error encountered during save. The file is still not saved.")); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + } else { + + *saved_flag = TRUE; + + gl_recent_add_utf8_filename (filename); + + if (save_path != NULL) + g_free (save_path); + save_path = g_path_get_dirname (filename); + + gtk_widget_destroy (GTK_WIDGET (chooser)); + gtk_main_quit (); + } + + } + + g_free (filename); + g_free (full_filename); + } + + g_free (raw_filename); + break; + + default: + *saved_flag = FALSE; + gtk_widget_destroy (GTK_WIDGET (chooser)); + gtk_main_quit (); + break; + + } + + gl_debug (DEBUG_FILE, "END"); +} + + +/*****************************************************************************/ +/* "Close" menu callback. */ +/*****************************************************************************/ +gboolean +gl_file_close (glWindow *window) +{ + glView *view; + glLabel *label; + gboolean close = TRUE; + + gl_debug (DEBUG_FILE, "START"); + + g_return_val_if_fail (window && GL_IS_WINDOW(window), TRUE); + + if ( !gl_window_is_empty (window) ) { + + view = GL_VIEW(window->view); + label = view->label; + + if (gl_label_is_modified (label)) { + GtkWidget *dialog; + gchar *fname = NULL; + gint ret; + + fname = gl_label_get_short_name (label); + + dialog = gtk_message_dialog_new (GTK_WINDOW(window), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_NONE, + _("Save changes to document \"%s\" before closing?"), + fname); + gtk_message_dialog_format_secondary_text ( + GTK_MESSAGE_DIALOG (dialog), + _("Your changes will be lost if you don't save them.")); + + gtk_dialog_add_button (GTK_DIALOG (dialog), + _("Close without saving"), + GTK_RESPONSE_NO); + + gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); + + gtk_dialog_add_button (GTK_DIALOG (dialog), + GTK_STOCK_SAVE, GTK_RESPONSE_YES); + + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES); + + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + + ret = gtk_dialog_run (GTK_DIALOG (dialog)); + + gtk_widget_destroy (dialog); + + g_free (fname); + + switch (ret) + { + case GTK_RESPONSE_YES: + close = gl_file_save (label, window); + break; + case GTK_RESPONSE_NO: + close = TRUE; + break; + default: + close = FALSE; + } + + gl_debug (DEBUG_FILE, "CLOSE: %s", close ? "TRUE" : "FALSE"); + } + + } + + if (close) { + gtk_widget_destroy (GTK_WIDGET(window)); + + if ( gl_window_get_window_list () == NULL ) { + + gl_debug (DEBUG_FILE, "All windows closed."); + + gtk_main_quit (); + } + + } + + gl_debug (DEBUG_FILE, "END"); + + return close; +} + +/*****************************************************************************/ +/* "Exit" menu callback. */ +/*****************************************************************************/ +void +gl_file_exit (void) +{ + const GList *window_list; + GList *p, *p_next; + + gl_debug (DEBUG_FILE, "START"); + + window_list = gl_window_get_window_list (); + + for (p=(GList *)window_list; p != NULL; p=p_next) { + p_next = p->next; + + gl_file_close (GL_WINDOW(p->data)); + } + + gl_debug (DEBUG_FILE, "END"); +} diff --git a/src/file.h b/src/file.h new file mode 100644 index 00000000..ba826075 --- /dev/null +++ b/src/file.h @@ -0,0 +1,65 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * file.h: FILE menu dialog module header file + * + * Copyright (C) 2000 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __FILE_H__ +#define __FILE_H__ + +#include + +#include "label.h" +#include "window.h" + +G_BEGIN_DECLS + +void gl_file_new (glWindow *window); + + +void gl_file_properties (glLabel *label, + glWindow *window); + + +void gl_file_open (glWindow *window); + + +void gl_file_open_recent (const gchar *filename, + glWindow *window); + +gboolean gl_file_open_real (const gchar *filename, + glWindow *window); + + +gboolean gl_file_save (glLabel *label, + glWindow *window); + +gboolean gl_file_save_as (glLabel *label, + glWindow *window); + + +gboolean gl_file_close (glWindow *window); + +void gl_file_exit (void); + +G_END_DECLS + +#endif /* __FILE_H__ */ diff --git a/src/glabels-batch.c b/src/glabels-batch.c new file mode 100644 index 00000000..41ebf9d6 --- /dev/null +++ b/src/glabels-batch.c @@ -0,0 +1,173 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * glabels.c: main program module + * + * Copyright (C) 2001 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include +#include + +#include "merge-init.h" +#include "xml-label.h" +#include "print.h" +#include "print-op.h" +#include +#include "util.h" +#include "prefs.h" +#include "debug.h" + +/*============================================*/ +/* Private globals */ +/*============================================*/ +static gchar *output = "output.pdf"; +static gint n_copies = 1; +static gint n_sheets = 1; +static gint first = 1; +static gboolean outline_flag = FALSE; +static gboolean reverse_flag = FALSE; +static gboolean crop_marks_flag = FALSE; +static gchar *input = NULL; +static gchar **remaining_args = NULL; + +static GOptionEntry option_entries[] = { + {"output", 'o', 0, G_OPTION_ARG_STRING, &output, + N_("set output filename (default=\"output.pdf\")"), N_("filename")}, + {"sheets", 's', 0, G_OPTION_ARG_INT, &n_sheets, + N_("number of sheets (default=1)"), N_("sheets")}, + {"copies", 'c', 0, G_OPTION_ARG_INT, &n_copies, + N_("number of copies (default=1)"), N_("copies")}, + {"first", 'f', 0, G_OPTION_ARG_INT, &first, + N_("first label on first sheet (default=1)"), N_("first")}, + {"outline", 'l', 0, G_OPTION_ARG_NONE, &outline_flag, + N_("print outlines (to test printer alignment)"), NULL}, + {"reverse", 'r', 0, G_OPTION_ARG_NONE, &reverse_flag, + N_("print in reverse (i.e. a mirror image)"), NULL}, + {"cropmarks", 'C', 0, G_OPTION_ARG_NONE, &crop_marks_flag, + N_("print crop marks"), NULL}, + {"input", 'i', 0, G_OPTION_ARG_STRING, &input, + N_("input file for merging"), N_("filename")}, + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, + &remaining_args, NULL, N_("[FILE...]") }, + { NULL } +}; + + + +/*****************************************************************************/ +/* Main */ +/*****************************************************************************/ +int +main (int argc, char **argv) +{ + GOptionContext *option_context; + GnomeProgram *program; + GList *p, *file_list = NULL; + gchar *abs_fn; + glLabel *label = NULL; + glMerge *merge = NULL; + glXMLLabelStatus status; + glPrintOp *print_op; + gchar *utf8_filename; + + bindtextdomain (GETTEXT_PACKAGE, GLABELS_LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + option_context = g_option_context_new (_("- batch process gLabels label files")); + g_option_context_add_main_entries (option_context, option_entries, GETTEXT_PACKAGE); + + + /* Initialize minimal gnome program */ + program = gnome_program_init ("glabels-batch", VERSION, + LIBGNOME_MODULE, argc, argv, + GNOME_PARAM_GOPTION_CONTEXT, option_context, + GNOME_PROGRAM_STANDARD_PROPERTIES, + NULL); + + /* create file list */ + if (remaining_args != NULL) { + gint i, num_args; + + num_args = g_strv_length (remaining_args); + for (i = 0; i < num_args; ++i) { + utf8_filename = g_filename_to_utf8 (remaining_args[i], -1, NULL, NULL, NULL); + if (utf8_filename) + file_list = g_list_append (file_list, utf8_filename); + } + g_strfreev (remaining_args); + remaining_args = NULL; + } + + /* initialize components */ + gl_debug_init (); + gl_merge_init (); + lgl_db_init (); + gl_prefs_init (); + + /* now print the files */ + for (p = file_list; p; p = p->next) { + g_print ("LABEL FILE = %s\n", (gchar *) p->data); + label = gl_xml_label_open (p->data, &status); + + + if ( status == XML_LABEL_OK ) { + + if (input != NULL) { + merge = gl_label_get_merge (label); + if (merge != NULL) { + gl_merge_set_src(merge, input); + gl_label_set_merge(label, merge); + } else { + fprintf ( stderr, + _("cannot perform document merge with glabels file %s\n"), + (char *)p->data ); + } + } + abs_fn = gl_util_make_absolute ( output ); + print_op = gl_print_op_new_batch (label, + abs_fn, + n_sheets, + n_copies, + first, + outline_flag, + reverse_flag, + crop_marks_flag); + + gtk_print_operation_run (GTK_PRINT_OPERATION (print_op), + GTK_PRINT_OPERATION_ACTION_EXPORT, + NULL, + NULL); + + g_object_unref (label); + } + else { + fprintf ( stderr, _("cannot open glabels file %s\n"), + (char *)p->data ); + } + } + + g_list_free (file_list); + + return 0; +} + diff --git a/src/glabels.c b/src/glabels.c new file mode 100644 index 00000000..832b0821 --- /dev/null +++ b/src/glabels.c @@ -0,0 +1,218 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/** + * (GLABELS) Label and Business Card Creation program for GNOME + * + * glabels.c: GLabels main module + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include +#include +#include +#include + +#include "warning-handler.h" +#include "critical-error-handler.h" +#include "stock.h" +#include "merge-init.h" +#include "recent.h" +#include +#include "mini-preview-pixbuf-cache.h" +#include "prefs.h" +#include "debug.h" +#include "window.h" +#include "file.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +/*========================================================*/ +/* Private globals */ +/*========================================================*/ + +/*========================================================*/ +/* Local function prototypes */ +/*========================================================*/ +gboolean save_session_cb (GnomeClient *client, + gint phase, + GnomeRestartStyle save_style, + gint shutdown, + GnomeInteractStyle interact_style, + gint fast, + gpointer client_data); + +void client_die_cb (GnomeClient *client, + gpointer client_data); + +/****************************************************************************/ +/* main program */ +/****************************************************************************/ +int +main (int argc, char **argv) +{ + gchar **remaining_args = NULL; + GOptionEntry option_entries[] = { + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, + &remaining_args, NULL, N_("[FILE...]") }, + { NULL } + }; + + GOptionContext *option_context; + GnomeProgram *program; + gchar *icon_file; + GnomeClient *client; + GList *file_list = NULL, *p; + GtkWidget *win; + gchar *utf8_filename; + + bindtextdomain (GETTEXT_PACKAGE, GLABELS_LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + + option_context = g_option_context_new (_("- gLabels label designer")); + g_option_context_add_main_entries (option_context, option_entries, GETTEXT_PACKAGE); + + + /* Initialize gnome program */ + program = gnome_program_init ("glabels", VERSION, + LIBGNOMEUI_MODULE, argc, argv, + GNOME_PARAM_GOPTION_CONTEXT, option_context, + GNOME_PROGRAM_STANDARD_PROPERTIES, + NULL); + + /* Install GUI handlers for critical error and warning messages */ + gl_critical_error_handler_init(); + gl_warning_handler_init(); + + /* Set default icon */ + icon_file = GLABELS_ICON_DIR "glabels.png"; + if (!g_file_test (icon_file, G_FILE_TEST_EXISTS)) + { + g_message ("Could not find %s", icon_file); + } + else + { + gnome_window_icon_set_default_from_file (icon_file); + } + + + /* Initialize subsystems */ + gl_debug_init (); + gl_stock_init (); + lgl_db_init (); + gl_prefs_init (); + gl_mini_preview_pixbuf_cache_init (); + gl_merge_init (); + gl_recent_init (); + + + client = gnome_master_client(); + + g_signal_connect (G_OBJECT (client), "save_yourself", + G_CALLBACK (save_session_cb), + (gpointer)argv[0]); + + g_signal_connect (G_OBJECT (client), "die", + G_CALLBACK (client_die_cb), NULL); + + + /* Parse args and build the list of files to be loaded at startup */ + if (remaining_args != NULL) { + gint i, num_args; + + num_args = g_strv_length (remaining_args); + for (i = 0; i < num_args; ++i) { + utf8_filename = g_filename_to_utf8 (remaining_args[i], -1, NULL, NULL, NULL); + if (utf8_filename) + file_list = g_list_append (file_list, utf8_filename); + } + g_strfreev (remaining_args); + remaining_args = NULL; + } + + + /* Open files or create empty top-level window. */ + for (p = file_list; p; p = p->next) { + win = gl_window_new_from_file (p->data); + gtk_widget_show_all (win); + g_free (p->data); + } + if ( gl_window_get_window_list() == NULL ) { + win = gl_window_new (); + gtk_widget_show_all (win); + } + g_list_free (file_list); + + + /* Begin main loop */ + gtk_main(); + + g_object_unref (G_OBJECT (program)); + + return 0; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. "Save session" callback. */ +/*---------------------------------------------------------------------------*/ +gboolean save_session_cb (GnomeClient *client, + gint phase, + GnomeRestartStyle save_style, + gint shutdown, + GnomeInteractStyle interact_style, + gint fast, + gpointer client_data) +{ + gchar *argv[128]; + gint argc; + const GList *window_list; + GList *p; + glWindow *window; + glLabel *label; + + argv[0] = (gchar *)client_data; + argc = 1; + + window_list = gl_window_get_window_list(); + for ( p=(GList *)window_list; p != NULL; p=p->next ) { + window = GL_WINDOW(p->data); + if ( !gl_window_is_empty (window) ) { + label = GL_VIEW(window->view)->label; + argv[argc++] = gl_label_get_filename (label); + } + } + gnome_client_set_clone_command(client, argc, argv); + gnome_client_set_restart_command(client, argc, argv); + + return TRUE; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. "Die" callback. */ +/*---------------------------------------------------------------------------*/ +void client_die_cb (GnomeClient *client, + gpointer client_data) +{ + gl_file_exit (); +} + + diff --git a/src/hig.h b/src/hig.h new file mode 100644 index 00000000..6b4c2494 --- /dev/null +++ b/src/hig.h @@ -0,0 +1,35 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * hig.h: HIG inspired dialogs and layout tools + * + * Copyright (C) 2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __HIG_H__ +#define __HIG_H__ + +G_BEGIN_DECLS + +#define GL_HIG_PAD1 6 +#define GL_HIG_PAD2 12 + +G_END_DECLS + +#endif /* __HIG_H__ */ diff --git a/src/label-barcode.c b/src/label-barcode.c new file mode 100644 index 00000000..1f008ed5 --- /dev/null +++ b/src/label-barcode.c @@ -0,0 +1,483 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_barcode.c: GLabels label text object + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "label-barcode.h" + +#include +#include +#include +#include +#include +#include + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +#define FONT_SCALE (72.0/96.0) + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glLabelBarcodePrivate { + glTextNode *text_node; + gchar *id; + glColorNode *color_node; + gboolean text_flag; + gboolean checksum_flag; + guint format_digits; +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_label_barcode_finalize (GObject *object); + +static void copy (glLabelObject *dst_object, + glLabelObject *src_object); + +static void get_size (glLabelObject *object, + gdouble *w, + gdouble *h); + +static void set_line_color (glLabelObject *object, + glColorNode *line_color); + +static glColorNode *get_line_color (glLabelObject *object); + +static void draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glLabelBarcode, gl_label_barcode, GL_TYPE_LABEL_OBJECT); + +static void +gl_label_barcode_class_init (glLabelBarcodeClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); + + gl_label_barcode_parent_class = g_type_class_peek_parent (class); + + label_object_class->copy = copy; + label_object_class->get_size = get_size; + label_object_class->set_line_color = set_line_color; + label_object_class->get_line_color = get_line_color; + label_object_class->draw_object = draw_object; + label_object_class->draw_shadow = NULL; + + object_class->finalize = gl_label_barcode_finalize; +} + +static void +gl_label_barcode_init (glLabelBarcode *lbc) +{ + lbc->priv = g_new0 (glLabelBarcodePrivate, 1); + lbc->priv->color_node = gl_color_node_new_default (); + lbc->priv->text_node = gl_text_node_new_from_text (""); +} + +static void +gl_label_barcode_finalize (GObject *object) +{ + glLabelBarcode *lbc = GL_LABEL_BARCODE (object); + + g_return_if_fail (object && GL_IS_LABEL_BARCODE (object)); + + gl_text_node_free (&lbc->priv->text_node); + g_free (lbc->priv->id); + gl_color_node_free (&(lbc->priv->color_node)); + g_free (lbc->priv); + + G_OBJECT_CLASS (gl_label_barcode_parent_class)->finalize (object); +} + +/*****************************************************************************/ +/* NEW label "barcode" object. */ +/*****************************************************************************/ +GObject * +gl_label_barcode_new (glLabel *label) +{ + glLabelBarcode *lbc; + + lbc = g_object_new (gl_label_barcode_get_type(), NULL); + + gl_label_object_set_parent (GL_LABEL_OBJECT(lbc), label); + + return G_OBJECT (lbc); +} + +/*****************************************************************************/ +/* Copy object contents. */ +/*****************************************************************************/ +static void +copy (glLabelObject *dst_object, + glLabelObject *src_object) +{ + glLabelBarcode *lbc = (glLabelBarcode *)src_object; + glLabelBarcode *new_lbc = (glLabelBarcode *)dst_object; + glTextNode *text_node; + gchar *id; + gboolean text_flag; + gboolean checksum_flag; + glColorNode *color_node; + guint format_digits; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc)); + g_return_if_fail (new_lbc && GL_IS_LABEL_BARCODE (new_lbc)); + + text_node = gl_label_barcode_get_data (lbc); + gl_label_barcode_get_props (lbc, &id, &text_flag, &checksum_flag, &format_digits); + color_node = get_line_color (src_object); + + gl_label_barcode_set_data (new_lbc, text_node); + gl_label_barcode_set_props (new_lbc, id, text_flag, checksum_flag, format_digits); + set_line_color (dst_object, color_node); + + gl_color_node_free (&color_node); + gl_text_node_free (&text_node); + g_free (id); + + gl_debug (DEBUG_LABEL, "END"); +} + + +/*****************************************************************************/ +/* Set object params. */ +/*****************************************************************************/ +void +gl_label_barcode_set_data (glLabelBarcode *lbc, + glTextNode *text_node) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc)); + + if (!gl_text_node_equal (lbc->priv->text_node, text_node)) { + + gl_text_node_free (&lbc->priv->text_node); + lbc->priv->text_node = gl_text_node_dup (text_node); + + gl_label_object_emit_changed (GL_LABEL_OBJECT(lbc)); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +void +gl_label_barcode_set_props (glLabelBarcode *lbc, + gchar *id, + gboolean text_flag, + gboolean checksum_flag, + guint format_digits) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc)); + + if ( ((lbc->priv->id == NULL) && (id != NULL)) + || (g_strcasecmp (lbc->priv->id, id) != 0) + || (lbc->priv->text_flag != text_flag) + || (lbc->priv->checksum_flag != checksum_flag) + || (lbc->priv->format_digits != format_digits)) { + + lbc->priv->id = g_strdup (id); + lbc->priv->text_flag = text_flag; + lbc->priv->checksum_flag = checksum_flag; + lbc->priv->format_digits = format_digits; + + gl_label_object_emit_changed (GL_LABEL_OBJECT(lbc)); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + + +/*****************************************************************************/ +/* Get object params. */ +/*****************************************************************************/ +glTextNode * +gl_label_barcode_get_data (glLabelBarcode *lbc) +{ + g_return_val_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc), NULL); + + return gl_text_node_dup (lbc->priv->text_node); +} + +void +gl_label_barcode_get_props (glLabelBarcode *lbc, + gchar **id, + gboolean *text_flag, + gboolean *checksum_flag, + guint *format_digits) +{ + g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc)); + + *id = g_strdup (lbc->priv->id); + *text_flag = lbc->priv->text_flag; + *checksum_flag = lbc->priv->checksum_flag; + *format_digits = lbc->priv->format_digits; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Get object size method. */ +/*---------------------------------------------------------------------------*/ +static void +get_size (glLabelObject *object, + gdouble *w, + gdouble *h) +{ + glLabelBarcode *lbc = (glLabelBarcode *)object; + gchar *data; + gdouble w_parent, h_parent; + glBarcode *gbc; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (lbc && GL_IS_LABEL_BARCODE (lbc)); + + gl_label_object_get_raw_size (object, &w_parent, &h_parent); + + if (lbc->priv->text_node->field_flag) { + data = gl_barcode_default_digits (lbc->priv->id, + lbc->priv->format_digits); + } else { + data = gl_text_node_expand (lbc->priv->text_node, NULL); + } + + gbc = gl_barcode_new (lbc->priv->id, + lbc->priv->text_flag, + lbc->priv->checksum_flag, + w_parent, + h_parent, + data); + g_free (data); + + if ( gbc == NULL ) { + /* Try again with default digits. */ + data = gl_barcode_default_digits (lbc->priv->id, + lbc->priv->format_digits); + gbc = gl_barcode_new (lbc->priv->id, + lbc->priv->text_flag, + lbc->priv->checksum_flag, + w_parent, + h_parent, + data); + g_free (data); + } + + if ( gbc != NULL ) + { + *w = gbc->width; + *h = gbc->height; + } + else + { + /* If we still can't render, just set a default size. */ + *w = 144; + *h = 72; + } + + gl_barcode_free (&gbc); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set line color method. */ +/*---------------------------------------------------------------------------*/ +static void +set_line_color (glLabelObject *object, + glColorNode *line_color_node) +{ + glLabelBarcode *lbarcode = (glLabelBarcode *)object; + + g_return_if_fail (lbarcode && GL_IS_LABEL_BARCODE (lbarcode)); + + if ( !gl_color_node_equal(lbarcode->priv->color_node, line_color_node) ) { + + gl_color_node_free (&(lbarcode->priv->color_node)); + lbarcode->priv->color_node = gl_color_node_dup (line_color_node); + gl_label_object_emit_changed (GL_LABEL_OBJECT(lbarcode)); + } +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Get line color method. */ +/*---------------------------------------------------------------------------*/ +static glColorNode* +get_line_color (glLabelObject *object) +{ + glLabelBarcode *lbarcode = (glLabelBarcode *)object; + + g_return_val_if_fail (lbarcode && GL_IS_LABEL_BARCODE (lbarcode), NULL); + + return gl_color_node_dup (lbarcode->priv->color_node); +} + +/*****************************************************************************/ +/* Draw object method. */ +/*****************************************************************************/ +static void +draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + gdouble x0, y0; + cairo_matrix_t matrix; + glBarcode *gbc; + glBarcodeLine *line; + glBarcodeChar *bchar; + GList *li; + gdouble y_offset; + PangoLayout *layout; + PangoFontDescription *desc; + gchar *text, *cstring; + glTextNode *text_node; + gchar *id; + gboolean text_flag; + gboolean checksum_flag; + guint color; + glColorNode *color_node; + guint format_digits; + gdouble w, h; + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_object_get_position (object, &x0, &y0); + gl_label_object_get_matrix (object, &matrix); + + text_node = gl_label_barcode_get_data (GL_LABEL_BARCODE (object)); + gl_label_barcode_get_props (GL_LABEL_BARCODE (object), + &id, &text_flag, &checksum_flag, &format_digits); + + color_node = gl_label_object_get_line_color (object); + color = gl_color_node_expand (color_node, record); + if (color_node->field_flag && screen_flag) + { + color = GL_COLOR_MERGE_DEFAULT; + } + gl_color_node_free (&color_node); + + gl_label_object_get_size (object, &w, &h); + + text_node = gl_label_barcode_get_data(GL_LABEL_BARCODE(object)); + text = gl_text_node_expand (text_node, record); + if (text_node->field_flag && screen_flag) { + text = gl_barcode_default_digits (id, format_digits); + } + + gbc = gl_barcode_new (id, text_flag, checksum_flag, w, h, text); + + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (color)); + + if (gbc == NULL) { + + layout = pango_cairo_create_layout (cr); + + desc = pango_font_description_new (); + pango_font_description_set_family (desc, GL_BARCODE_FONT_FAMILY); + pango_font_description_set_size (desc, 12 * PANGO_SCALE * FONT_SCALE); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + if (text == NULL || *text == '\0') + { + pango_layout_set_text (layout, _("Barcode data empty"), -1); + } + else + { + pango_layout_set_text (layout, _("Invalid barcode data"), -1); + } + + cairo_move_to (cr, 0, 0); + pango_cairo_show_layout (cr, layout); + + g_object_unref (layout); + + } else { + + for (li = gbc->lines; li != NULL; li = li->next) { + line = (glBarcodeLine *) li->data; + + cairo_move_to (cr, line->x, line->y); + cairo_line_to (cr, line->x, line->y + line->length); + cairo_set_line_width (cr, line->width); + cairo_stroke (cr); + } + + for (li = gbc->chars; li != NULL; li = li->next) { + bchar = (glBarcodeChar *) li->data; + + layout = pango_cairo_create_layout (cr); + + desc = pango_font_description_new (); + pango_font_description_set_family (desc, GL_BARCODE_FONT_FAMILY); + pango_font_description_set_size (desc, bchar->fsize * PANGO_SCALE * FONT_SCALE); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + cstring = g_strdup_printf ("%c", bchar->c); + pango_layout_set_text (layout, cstring, -1); + g_free (cstring); + + y_offset = 0.2 * bchar->fsize; + + cairo_move_to (cr, bchar->x, bchar->y-y_offset); + pango_cairo_show_layout (cr, layout); + + g_object_unref (layout); + + } + + gl_barcode_free (&gbc); + + } + + g_free (text); + gl_text_node_free (&text_node); + g_free (id); + + gl_debug (DEBUG_LABEL, "END"); +} + diff --git a/src/label-barcode.h b/src/label-barcode.h new file mode 100644 index 00000000..4eda31da --- /dev/null +++ b/src/label-barcode.h @@ -0,0 +1,78 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_barcode.h: GLabels label barcode object + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LABEL_BARCODE_H__ +#define __LABEL_BARCODE_H__ + +#include "bc.h" +#include "text-node.h" +#include "label-object.h" + +G_BEGIN_DECLS + + +#define GL_TYPE_LABEL_BARCODE (gl_label_barcode_get_type ()) +#define GL_LABEL_BARCODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_BARCODE, glLabelBarcode)) +#define GL_LABEL_BARCODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_BARCODE, glLabelBarcodeClass)) +#define GL_IS_LABEL_BARCODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_BARCODE)) +#define GL_IS_LABEL_BARCODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_BARCODE)) + +typedef struct _glLabelBarcode glLabelBarcode; +typedef struct _glLabelBarcodeClass glLabelBarcodeClass; + +typedef struct _glLabelBarcodePrivate glLabelBarcodePrivate; + +struct _glLabelBarcode { + glLabelObject object; + + glLabelBarcodePrivate *priv; +}; + +struct _glLabelBarcodeClass { + glLabelObjectClass parent_class; +}; + + +GType gl_label_barcode_get_type (void) G_GNUC_CONST; + +GObject *gl_label_barcode_new (glLabel *label); + +void gl_label_barcode_set_data (glLabelBarcode *lbc, + glTextNode *text_node); +void gl_label_barcode_set_props (glLabelBarcode *lbc, + gchar *id, + gboolean text_flag, + gboolean checksum_flag, + guint format_digits); + +glTextNode *gl_label_barcode_get_data (glLabelBarcode *lbc); +void gl_label_barcode_get_props (glLabelBarcode *lbc, + gchar **id, + gboolean *text_flag, + gboolean *checksum_flag, + guint *format_digits); + +G_END_DECLS + +#endif /* __LABEL_BARCODE_H__ */ diff --git a/src/label-box.c b/src/label-box.c new file mode 100644 index 00000000..a42ad75b --- /dev/null +++ b/src/label-box.c @@ -0,0 +1,402 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_box.c: GLabels label box object + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "label-box.h" + +#include +#include +#include + +#include "debug.h" + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glLabelBoxPrivate { + gdouble line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_label_box_finalize (GObject *object); + +static void copy (glLabelObject *dst_object, + glLabelObject *src_object); + +static void set_fill_color (glLabelObject *object, + glColorNode *fill_color_node); + +static void set_line_color (glLabelObject *object, + glColorNode *line_color_node); + +static void set_line_width (glLabelObject *object, + gdouble line_width); + +static glColorNode* get_fill_color (glLabelObject *object); + +static glColorNode* get_line_color (glLabelObject *object); + +static gdouble get_line_width (glLabelObject *object); + +static void draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + +static void draw_shadow (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + + + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glLabelBox, gl_label_box, GL_TYPE_LABEL_OBJECT); + +static void +gl_label_box_class_init (glLabelBoxClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); + + gl_label_box_parent_class = g_type_class_peek_parent (class); + + label_object_class->copy = copy; + label_object_class->set_fill_color = set_fill_color; + label_object_class->set_line_color = set_line_color; + label_object_class->set_line_width = set_line_width; + label_object_class->get_fill_color = get_fill_color; + label_object_class->get_line_color = get_line_color; + label_object_class->get_line_width = get_line_width; + label_object_class->draw_object = draw_object; + label_object_class->draw_shadow = draw_shadow; + + object_class->finalize = gl_label_box_finalize; +} + +static void +gl_label_box_init (glLabelBox *lbox) +{ + lbox->priv = g_new0 (glLabelBoxPrivate, 1); + lbox->priv->line_color_node = gl_color_node_new_default (); + lbox->priv->fill_color_node = gl_color_node_new_default (); +} + +static void +gl_label_box_finalize (GObject *object) +{ + glLabelBox *lbox = GL_LABEL_BOX (object); + + g_return_if_fail (object && GL_IS_LABEL_BOX (object)); + + gl_color_node_free (&(lbox->priv->fill_color_node)); + gl_color_node_free (&(lbox->priv->line_color_node)); + g_free (lbox->priv); + + G_OBJECT_CLASS (gl_label_box_parent_class)->finalize (object); +} + +/*****************************************************************************/ +/* NEW label "box" object. */ +/*****************************************************************************/ +GObject * +gl_label_box_new (glLabel *label) +{ + glLabelBox *lbox; + + lbox = g_object_new (gl_label_box_get_type(), NULL); + + gl_label_object_set_parent (GL_LABEL_OBJECT(lbox), label); + + return G_OBJECT (lbox); +} + +/*****************************************************************************/ +/* Copy object contents. */ +/*****************************************************************************/ +static void +copy (glLabelObject *dst_object, + glLabelObject *src_object) +{ + glLabelBox *lbox = (glLabelBox *)src_object; + glLabelBox *new_lbox = (glLabelBox *)dst_object; + gdouble line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox)); + g_return_if_fail (new_lbox && GL_IS_LABEL_BOX (new_lbox)); + + line_width = get_line_width (src_object); + line_color_node = get_line_color (src_object); + fill_color_node = get_fill_color (src_object); + + set_line_width (dst_object, line_width); + set_line_color (dst_object, line_color_node); + set_fill_color (dst_object, fill_color_node); + + gl_color_node_free (&line_color_node); + gl_color_node_free (&fill_color_node); + + gl_debug (DEBUG_LABEL, "END"); +} + + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set fill color method. */ +/*---------------------------------------------------------------------------*/ +static void +set_fill_color (glLabelObject *object, + glColorNode *fill_color_node) +{ + glLabelBox *lbox = (glLabelBox *)object; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox)); + + if (!gl_color_node_equal (lbox->priv->fill_color_node, fill_color_node)) { + + gl_color_node_free (&(lbox->priv->fill_color_node)); + lbox->priv->fill_color_node = gl_color_node_dup (fill_color_node); + + gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox)); + } + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set line color method. */ +/*---------------------------------------------------------------------------*/ +static void +set_line_color (glLabelObject *object, + glColorNode *line_color_node) +{ + glLabelBox *lbox = (glLabelBox *)object; + + g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox)); + + if ( !gl_color_node_equal (lbox->priv->line_color_node, line_color_node )) { + gl_color_node_free (&(lbox->priv->line_color_node)); + lbox->priv->line_color_node = gl_color_node_dup (line_color_node); + gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox)); + } +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set line width method. */ +/*---------------------------------------------------------------------------*/ +static void +set_line_width (glLabelObject *object, + gdouble line_width) +{ + glLabelBox *lbox = (glLabelBox *)object; + + g_return_if_fail (lbox && GL_IS_LABEL_BOX (lbox)); + + if ( lbox->priv->line_width != line_width ) { + lbox->priv->line_width = line_width; + gl_label_object_emit_changed (GL_LABEL_OBJECT(lbox)); + } +} + + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Get fill color method. */ +/*---------------------------------------------------------------------------*/ +static gdouble +get_line_width (glLabelObject *object) +{ + glLabelBox *lbox = (glLabelBox *)object; + + g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0.0); + + return lbox->priv->line_width; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Get line color method. */ +/*---------------------------------------------------------------------------*/ +static glColorNode* +get_line_color (glLabelObject *object) +{ + glLabelBox *lbox = (glLabelBox *)object; + + g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0); + + return gl_color_node_dup (lbox->priv->line_color_node); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Get line width method. */ +/*---------------------------------------------------------------------------*/ +static glColorNode* +get_fill_color (glLabelObject *object) +{ + glLabelBox *lbox = (glLabelBox *)object; + + g_return_val_if_fail (lbox && GL_IS_LABEL_BOX (lbox), 0); + + return gl_color_node_dup (lbox->priv->fill_color_node); +} + +/*****************************************************************************/ +/* Draw object method. */ +/*****************************************************************************/ +static void +draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + gdouble w, h; + gdouble line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; + guint line_color; + guint fill_color; + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_object_get_size (object, &w, &h); + + line_width = gl_label_object_get_line_width (object); + + line_color_node = gl_label_object_get_line_color (object); + fill_color_node = gl_label_object_get_fill_color (object); + line_color = gl_color_node_expand (line_color_node, record); + fill_color = gl_color_node_expand (fill_color_node, record); + if (line_color_node->field_flag && screen_flag) + { + line_color = GL_COLOR_MERGE_DEFAULT; + } + if (fill_color_node->field_flag && screen_flag) + { + fill_color = GL_COLOR_FILL_MERGE_DEFAULT; + } + + + cairo_rectangle (cr, 0.0, 0.0, w, h); + + /* Paint fill color */ + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (fill_color)); + cairo_fill_preserve (cr); + + /* Draw outline */ + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (line_color)); + cairo_set_line_width (cr, line_width); + cairo_stroke (cr); + + gl_color_node_free (&line_color_node); + gl_color_node_free (&fill_color_node); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Draw shadow method. */ +/*****************************************************************************/ +static void +draw_shadow (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + gdouble w, h; + gdouble line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; + guint line_color; + guint fill_color; + glColorNode *shadow_color_node; + guint shadow_color; + gdouble shadow_opacity; + guint shadow_line_color; + guint shadow_fill_color; + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_object_get_size (object, &w, &h); + + line_width = gl_label_object_get_line_width (object); + + line_color_node = gl_label_object_get_line_color (object); + fill_color_node = gl_label_object_get_fill_color (object); + line_color = gl_color_node_expand (line_color_node, record); + fill_color = gl_color_node_expand (fill_color_node, record); + if (line_color_node->field_flag && screen_flag) + { + line_color = GL_COLOR_MERGE_DEFAULT; + } + if (fill_color_node->field_flag && screen_flag) + { + fill_color = GL_COLOR_FILL_MERGE_DEFAULT; + } + + shadow_color_node = gl_label_object_get_shadow_color (object); + shadow_color = gl_color_node_expand (shadow_color_node, record); + if (shadow_color_node->field_flag && screen_flag) + { + shadow_color = GL_COLOR_SHADOW_MERGE_DEFAULT; + } + shadow_opacity = gl_label_object_get_shadow_opacity (object); + shadow_line_color = gl_color_shadow (shadow_color, shadow_opacity, line_color_node->color); + shadow_fill_color = gl_color_shadow (shadow_color, shadow_opacity, fill_color_node->color); + + + cairo_rectangle (cr, 0.0, 0.0, w, h); + + + /* Draw fill shadow */ + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_fill_color)); + cairo_fill_preserve (cr); + + /* Draw outline shadow */ + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_line_color)); + cairo_set_line_width (cr, line_width); + cairo_stroke (cr); + + + gl_color_node_free (&line_color_node); + gl_color_node_free (&fill_color_node); + gl_color_node_free (&shadow_color_node); + + gl_debug (DEBUG_LABEL, "END"); +} + diff --git a/src/label-box.h b/src/label-box.h new file mode 100644 index 00000000..93b05a64 --- /dev/null +++ b/src/label-box.h @@ -0,0 +1,61 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_box.h: GLabels label box object + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LABEL_BOX_H__ +#define __LABEL_BOX_H__ + +#include "label-object.h" + + +G_BEGIN_DECLS + + +#define GL_TYPE_LABEL_BOX (gl_label_box_get_type ()) +#define GL_LABEL_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_BOX, glLabelBox)) +#define GL_LABEL_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_BOX, glLabelBoxClass)) +#define GL_IS_LABEL_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_BOX)) +#define GL_IS_LABEL_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_BOX)) + +typedef struct _glLabelBox glLabelBox; +typedef struct _glLabelBoxClass glLabelBoxClass; + +typedef struct _glLabelBoxPrivate glLabelBoxPrivate; + +struct _glLabelBox { + glLabelObject object; + + glLabelBoxPrivate *priv; +}; + +struct _glLabelBoxClass { + glLabelObjectClass parent_class; +}; + +GType gl_label_box_get_type (void) G_GNUC_CONST; + +GObject *gl_label_box_new (glLabel *label); + +G_END_DECLS + +#endif /* __LABEL_BOX_H__ */ diff --git a/src/label-ellipse.c b/src/label-ellipse.c new file mode 100644 index 00000000..fb21cbf2 --- /dev/null +++ b/src/label-ellipse.c @@ -0,0 +1,407 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_ellipse.c: GLabels label ellipse object + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "label-ellipse.h" + +#include +#include +#include +#include + +#include "cairo-ellipse-path.h" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glLabelEllipsePrivate { + gdouble line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_label_ellipse_finalize (GObject *object); + +static void copy (glLabelObject *dst_object, + glLabelObject *src_object); + +static void set_fill_color (glLabelObject *object, + glColorNode *fill_color_node); + +static void set_line_color (glLabelObject *object, + glColorNode *line_color_node); + +static void set_line_width (glLabelObject *object, + gdouble line_width); + +static glColorNode* get_fill_color (glLabelObject *object); + +static glColorNode* get_line_color (glLabelObject *object); + +static gdouble get_line_width (glLabelObject *object); + +static void draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + +static void draw_shadow (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glLabelEllipse, gl_label_ellipse, GL_TYPE_LABEL_OBJECT); + +static void +gl_label_ellipse_class_init (glLabelEllipseClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); + + gl_label_ellipse_parent_class = g_type_class_peek_parent (class); + + label_object_class->copy = copy; + label_object_class->set_fill_color = set_fill_color; + label_object_class->set_line_color = set_line_color; + label_object_class->set_line_width = set_line_width; + label_object_class->get_fill_color = get_fill_color; + label_object_class->get_line_color = get_line_color; + label_object_class->get_line_width = get_line_width; + label_object_class->draw_object = draw_object; + label_object_class->draw_shadow = draw_shadow; + + object_class->finalize = gl_label_ellipse_finalize; +} + +static void +gl_label_ellipse_init (glLabelEllipse *lellipse) +{ + lellipse->priv = g_new0 (glLabelEllipsePrivate, 1); + lellipse->priv->line_color_node = gl_color_node_new_default (); + lellipse->priv->fill_color_node = gl_color_node_new_default (); +} + +static void +gl_label_ellipse_finalize (GObject *object) +{ + glLabelEllipse *lellipse = GL_LABEL_ELLIPSE (object); + + g_return_if_fail (object && GL_IS_LABEL_ELLIPSE (object)); + + gl_color_node_free (&(lellipse->priv->line_color_node)); + gl_color_node_free (&(lellipse->priv->fill_color_node)); + g_free (lellipse->priv); + + G_OBJECT_CLASS (gl_label_ellipse_parent_class)->finalize (object); +} + +/*****************************************************************************/ +/* NEW label "ellipse" object. */ +/*****************************************************************************/ +GObject * +gl_label_ellipse_new (glLabel *label) +{ + glLabelEllipse *lellipse; + + lellipse = g_object_new (gl_label_ellipse_get_type(), NULL); + + gl_label_object_set_parent (GL_LABEL_OBJECT(lellipse), label); + + return G_OBJECT (lellipse); +} + +/*****************************************************************************/ +/* Copy object contents. */ +/*****************************************************************************/ +static void +copy (glLabelObject *dst_object, + glLabelObject *src_object) +{ + glLabelEllipse *lellipse = (glLabelEllipse *)src_object; + glLabelEllipse *new_lellipse = (glLabelEllipse *)dst_object; + gdouble line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse)); + g_return_if_fail (new_lellipse && GL_IS_LABEL_ELLIPSE (new_lellipse)); + + line_width = get_line_width (src_object); + line_color_node = get_line_color (src_object); + fill_color_node = get_fill_color (src_object); + + set_line_width (dst_object, line_width); + set_line_color (dst_object, line_color_node); + set_fill_color (dst_object, fill_color_node); + + gl_color_node_free (&line_color_node); + gl_color_node_free (&fill_color_node); + + gl_debug (DEBUG_LABEL, "END"); +} + + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set fill color method. */ +/*---------------------------------------------------------------------------*/ +static void +set_fill_color (glLabelObject *object, + glColorNode *fill_color_node) +{ + glLabelEllipse *lellipse = (glLabelEllipse *)object; + + g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse)); + + if (!gl_color_node_equal (lellipse->priv->fill_color_node, fill_color_node)) { + + gl_color_node_free (&(lellipse->priv->fill_color_node)); + lellipse->priv->fill_color_node = gl_color_node_dup (fill_color_node); + + gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse)); + } +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set line color method. */ +/*---------------------------------------------------------------------------*/ +static void +set_line_color (glLabelObject *object, + glColorNode *line_color_node) +{ + glLabelEllipse *lellipse = (glLabelEllipse *)object; + + g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse)); + + if ( !gl_color_node_equal (lellipse->priv->line_color_node, line_color_node) ) { + + gl_color_node_free (&(lellipse->priv->line_color_node)); + lellipse->priv->line_color_node = gl_color_node_dup (line_color_node); + + gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse)); + } +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set line width method. */ +/*---------------------------------------------------------------------------*/ +static void +set_line_width (glLabelObject *object, + gdouble line_width) +{ + glLabelEllipse *lellipse = (glLabelEllipse *)object; + + g_return_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse)); + + if ( lellipse->priv->line_width != line_width ) { + lellipse->priv->line_width = line_width; + gl_label_object_emit_changed (GL_LABEL_OBJECT(lellipse)); + } +} + + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Get fill color method. */ +/*---------------------------------------------------------------------------*/ +static gdouble +get_line_width (glLabelObject *object) +{ + glLabelEllipse *lellipse = (glLabelEllipse *)object; + + g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0.0); + + return lellipse->priv->line_width; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Get line color method. */ +/*---------------------------------------------------------------------------*/ +static glColorNode* +get_line_color (glLabelObject *object) +{ + glLabelEllipse *lellipse = (glLabelEllipse *)object; + + g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0); + + return gl_color_node_dup (lellipse->priv->line_color_node); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Get line width method. */ +/*---------------------------------------------------------------------------*/ +static glColorNode* +get_fill_color (glLabelObject *object) +{ + glLabelEllipse *lellipse = (glLabelEllipse *)object; + + g_return_val_if_fail (lellipse && GL_IS_LABEL_ELLIPSE (lellipse), 0); + + return gl_color_node_dup (lellipse->priv->fill_color_node); +} + +/*****************************************************************************/ +/* Draw object method. */ +/*****************************************************************************/ +static void +draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + gdouble w, h; + gdouble line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; + guint line_color; + guint fill_color; + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_object_get_size (object, &w, &h); + + line_width = gl_label_object_get_line_width (object); + + line_color_node = gl_label_object_get_line_color (object); + fill_color_node = gl_label_object_get_fill_color (object); + line_color = gl_color_node_expand (line_color_node, record); + fill_color = gl_color_node_expand (fill_color_node, record); + if (line_color_node->field_flag && screen_flag) + { + line_color = GL_COLOR_MERGE_DEFAULT; + } + if (fill_color_node->field_flag && screen_flag) + { + fill_color = GL_COLOR_FILL_MERGE_DEFAULT; + } + + + gl_cairo_ellipse_path (cr, w/2, h/2); + + /* Paint fill color */ + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (fill_color)); + cairo_fill_preserve (cr); + + /* Draw outline */ + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (line_color)); + cairo_set_line_width (cr, line_width); + cairo_stroke (cr); + + gl_color_node_free (&line_color_node); + gl_color_node_free (&fill_color_node); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Draw shadow method. */ +/*****************************************************************************/ +static void +draw_shadow (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + gdouble w, h; + gdouble line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; + guint line_color; + guint fill_color; + glColorNode *shadow_color_node; + guint shadow_color; + gdouble shadow_opacity; + guint shadow_line_color; + guint shadow_fill_color; + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_object_get_size (object, &w, &h); + + line_width = gl_label_object_get_line_width (object); + + line_color_node = gl_label_object_get_line_color (object); + fill_color_node = gl_label_object_get_fill_color (object); + line_color = gl_color_node_expand (line_color_node, record); + fill_color = gl_color_node_expand (fill_color_node, record); + if (line_color_node->field_flag && screen_flag) + { + line_color = GL_COLOR_MERGE_DEFAULT; + } + if (fill_color_node->field_flag && screen_flag) + { + fill_color = GL_COLOR_FILL_MERGE_DEFAULT; + } + + shadow_color_node = gl_label_object_get_shadow_color (object); + shadow_color = gl_color_node_expand (shadow_color_node, record); + if (shadow_color_node->field_flag && screen_flag) + { + shadow_color = GL_COLOR_SHADOW_MERGE_DEFAULT; + } + shadow_opacity = gl_label_object_get_shadow_opacity (object); + shadow_line_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, line_color_node->color); + shadow_fill_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, fill_color_node->color); + + + gl_cairo_ellipse_path (cr, w/2, h/2); + + + /* Draw fill shadow */ + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_fill_color)); + cairo_fill_preserve (cr); + + /* Draw outline shadow */ + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_line_color)); + cairo_set_line_width (cr, line_width); + cairo_stroke (cr); + + + gl_color_node_free (&line_color_node); + gl_color_node_free (&fill_color_node); + gl_color_node_free (&shadow_color_node); + + gl_debug (DEBUG_LABEL, "END"); +} + diff --git a/src/label-ellipse.h b/src/label-ellipse.h new file mode 100644 index 00000000..439ad5f9 --- /dev/null +++ b/src/label-ellipse.h @@ -0,0 +1,61 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_ellipse.h: GLabels label ellipse object + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LABEL_ELLIPSE_H__ +#define __LABEL_ELLIPSE_H__ + +#include "label-object.h" + + +G_BEGIN_DECLS + + +#define GL_TYPE_LABEL_ELLIPSE (gl_label_ellipse_get_type ()) +#define GL_LABEL_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_ELLIPSE, glLabelEllipse)) +#define GL_LABEL_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_ELLIPSE, glLabelEllipseClass)) +#define GL_IS_LABEL_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_ELLIPSE)) +#define GL_IS_LABEL_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_ELLIPSE)) + +typedef struct _glLabelEllipse glLabelEllipse; +typedef struct _glLabelEllipseClass glLabelEllipseClass; + +typedef struct _glLabelEllipsePrivate glLabelEllipsePrivate; + +struct _glLabelEllipse { + glLabelObject object; + + glLabelEllipsePrivate *priv; +}; + +struct _glLabelEllipseClass { + glLabelObjectClass parent_class; +}; + +GType gl_label_ellipse_get_type (void) G_GNUC_CONST; + +GObject *gl_label_ellipse_new (glLabel *label); + +G_END_DECLS + +#endif /* __LABEL_ELLIPSE_H__ */ diff --git a/src/label-image.c b/src/label-image.c new file mode 100644 index 00000000..9d0bcaf2 --- /dev/null +++ b/src/label-image.c @@ -0,0 +1,359 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_image.c: GLabels label image object + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "label-image.h" + +#include +#include +#include +#include + +#include "pixmaps/checkerboard.xpm" + +#include "debug.h" + + +#define MIN_IMAGE_SIZE 1.0 + + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glLabelImagePrivate { + glTextNode *filename; + GdkPixbuf *pixbuf; +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +static GdkPixbuf *default_pixbuf = NULL; + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_label_image_finalize (GObject *object); + +static void copy (glLabelObject *dst_object, + glLabelObject *src_object); + +static void set_size (glLabelObject *object, + gdouble w, + gdouble h); + +static void draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glLabelImage, gl_label_image, GL_TYPE_LABEL_OBJECT); + +static void +gl_label_image_class_init (glLabelImageClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); + + gl_label_image_parent_class = g_type_class_peek_parent (class); + + label_object_class->copy = copy; + label_object_class->set_size = set_size; + label_object_class->draw_object = draw_object; + label_object_class->draw_shadow = NULL; + + object_class->finalize = gl_label_image_finalize; +} + +static void +gl_label_image_init (glLabelImage *limage) +{ + GdkPixbuf *pixbuf; + + if ( default_pixbuf == NULL ) { + pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)checkerboard_xpm); + default_pixbuf = + gdk_pixbuf_scale_simple (pixbuf, 128, 128, GDK_INTERP_NEAREST); + g_object_unref (pixbuf); + } + + limage->priv = g_new0 (glLabelImagePrivate, 1); + + limage->priv->filename = g_new0 (glTextNode, 1); + + limage->priv->pixbuf = default_pixbuf; +} + +static void +gl_label_image_finalize (GObject *object) +{ + glLabelObject *lobject = GL_LABEL_OBJECT (object); + glLabelImage *limage = GL_LABEL_IMAGE (object);; + GHashTable *pixbuf_cache; + + g_return_if_fail (object && GL_IS_LABEL_IMAGE (object)); + + if (!limage->priv->filename->field_flag) { + pixbuf_cache = gl_label_get_pixbuf_cache (lobject->parent); + gl_pixbuf_cache_remove_pixbuf (pixbuf_cache, + limage->priv->filename->data); + } + gl_text_node_free (&limage->priv->filename); + g_free (limage->priv); + + G_OBJECT_CLASS (gl_label_image_parent_class)->finalize (object); +} + +/*****************************************************************************/ +/* NEW label "image" object. */ +/*****************************************************************************/ +GObject * +gl_label_image_new (glLabel *label) +{ + glLabelImage *limage; + + limage = g_object_new (gl_label_image_get_type(), NULL); + + gl_label_object_set_parent (GL_LABEL_OBJECT(limage), label); + + return G_OBJECT (limage); +} + +/*****************************************************************************/ +/* Copy object contents. */ +/*****************************************************************************/ +static void +copy (glLabelObject *dst_object, + glLabelObject *src_object) +{ + glLabelImage *limage = (glLabelImage *)src_object; + glLabelImage *new_limage = (glLabelImage *)dst_object; + glTextNode *filename; + GdkPixbuf *pixbuf; + GHashTable *pixbuf_cache; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (limage && GL_IS_LABEL_IMAGE (limage)); + g_return_if_fail (new_limage && GL_IS_LABEL_IMAGE (new_limage)); + + filename = gl_label_image_get_filename (limage); + + /* Make sure destination label has data suitably cached. */ + if ( !filename->field_flag && (filename->data != NULL) ) { + pixbuf = limage->priv->pixbuf; + if ( pixbuf != default_pixbuf ) { + pixbuf_cache = gl_label_get_pixbuf_cache (dst_object->parent); + gl_pixbuf_cache_add_pixbuf (pixbuf_cache, filename->data, pixbuf); + } + } + + gl_label_image_set_filename (new_limage, filename); + gl_text_node_free (&filename); + + gl_debug (DEBUG_LABEL, "END"); +} + + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set size method. */ +/*---------------------------------------------------------------------------*/ +static void +set_size (glLabelObject *object, + gdouble w, + gdouble h) +{ + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if (w < MIN_IMAGE_SIZE) + { + w = MIN_IMAGE_SIZE; + } + + if (h < MIN_IMAGE_SIZE) + { + h = MIN_IMAGE_SIZE; + } + + GL_LABEL_OBJECT_CLASS (gl_label_image_parent_class)->set_size (object, w, h); +} + + +/*****************************************************************************/ +/* Set object params. */ +/*****************************************************************************/ +void +gl_label_image_set_filename (glLabelImage *limage, + glTextNode *filename) +{ + glTextNode *old_filename; + GHashTable *pixbuf_cache; + GdkPixbuf *pixbuf; + gdouble image_w, image_h, aspect_ratio, w, h; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (limage && GL_IS_LABEL_IMAGE (limage)); + g_return_if_fail (filename != NULL); + + old_filename = limage->priv->filename; + + /* If Unchanged don't do anything */ + if ( gl_text_node_equal (filename, old_filename ) ) { + return; + } + + pixbuf_cache = gl_label_get_pixbuf_cache (GL_LABEL_OBJECT(limage)->parent); + + /* Remove reference to previous pixbuf from cache, if needed. */ + if ( !old_filename->field_flag && (old_filename->data != NULL) ) { + gl_pixbuf_cache_remove_pixbuf (pixbuf_cache, old_filename->data); + } + + /* Set new filename. */ + limage->priv->filename = gl_text_node_dup(filename); + gl_text_node_free (&old_filename); + + /* Now set the pixbuf. */ + if ( filename->field_flag || (filename->data == NULL) ) { + + limage->priv->pixbuf = default_pixbuf; + + } else { + + pixbuf = gl_pixbuf_cache_get_pixbuf (pixbuf_cache, filename->data); + + if (pixbuf != NULL) { + limage->priv->pixbuf = pixbuf; + } else { + limage->priv->pixbuf = default_pixbuf; + } + } + + /* Treat current size as a bounding box, scale image to maintain aspect + * ratio while fitting it in this bounding box. */ + image_w = gdk_pixbuf_get_width (limage->priv->pixbuf); + image_h = gdk_pixbuf_get_height (limage->priv->pixbuf); + aspect_ratio = image_h / image_w; + gl_label_object_get_size (GL_LABEL_OBJECT(limage), &w, &h); + if ( h > w*aspect_ratio ) { + h = w * aspect_ratio; + } else { + w = h / aspect_ratio; + } + gl_label_object_set_size (GL_LABEL_OBJECT(limage), w, h); + + gl_label_object_emit_changed (GL_LABEL_OBJECT(limage)); + + gl_debug (DEBUG_LABEL, "END"); +} + + +/*****************************************************************************/ +/* Get object params. */ +/*****************************************************************************/ +glTextNode * +gl_label_image_get_filename (glLabelImage *limage) +{ + g_return_val_if_fail (limage && GL_IS_LABEL_IMAGE (limage), NULL); + + return gl_text_node_dup (limage->priv->filename); +} + +const GdkPixbuf * +gl_label_image_get_pixbuf (glLabelImage *limage, + glMergeRecord *record) +{ + g_return_val_if_fail (limage && GL_IS_LABEL_IMAGE (limage), NULL); + + if ((record != NULL) && limage->priv->filename->field_flag) { + + GdkPixbuf *pixbuf = NULL; + gchar *real_filename; + + /* Indirect filename, re-evaluate for given record. */ + + real_filename = gl_merge_eval_key (record, + limage->priv->filename->data); + + if (real_filename != NULL) { + pixbuf = gdk_pixbuf_new_from_file (real_filename, NULL); + } + if ( pixbuf != NULL ) { + return pixbuf; + } else { + return default_pixbuf; + } + + } + + return limage->priv->pixbuf; + +} + +/*****************************************************************************/ +/* Draw object method. */ +/*****************************************************************************/ +static void +draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + gdouble x0, y0; + gdouble w, h; + const GdkPixbuf *pixbuf; + gint image_w, image_h; + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_object_get_size (object, &w, &h); + gl_label_object_get_position (object, &x0, &y0); + + pixbuf = gl_label_image_get_pixbuf (GL_LABEL_IMAGE (object), record); + image_w = gdk_pixbuf_get_width (pixbuf); + image_h = gdk_pixbuf_get_height (pixbuf); + + cairo_save (cr); + + cairo_rectangle (cr, 0.0, 0.0, w, h); + + cairo_scale (cr, w/image_w, h/image_h); + gdk_cairo_set_source_pixbuf (cr, (GdkPixbuf *)pixbuf, 0, 0); + cairo_fill (cr); + + cairo_restore (cr); + + gl_debug (DEBUG_LABEL, "END"); +} + + + diff --git a/src/label-image.h b/src/label-image.h new file mode 100644 index 00000000..a45f0c79 --- /dev/null +++ b/src/label-image.h @@ -0,0 +1,71 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_image.h: GLabels label image object + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LABEL_IMAGE_H__ +#define __LABEL_IMAGE_H__ + +#include "label-object.h" +#include "text-node.h" +#include "merge.h" +#include + +G_BEGIN_DECLS + + +#define GL_TYPE_LABEL_IMAGE (gl_label_image_get_type ()) +#define GL_LABEL_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_IMAGE, glLabelImage)) +#define GL_LABEL_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_IMAGE, glLabelImageClass)) +#define GL_IS_LABEL_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_IMAGE)) +#define GL_IS_LABEL_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_IMAGE)) + +typedef struct _glLabelImage glLabelImage; +typedef struct _glLabelImageClass glLabelImageClass; + +typedef struct _glLabelImagePrivate glLabelImagePrivate; + +struct _glLabelImage { + glLabelObject object; + + glLabelImagePrivate *priv; +}; + +struct _glLabelImageClass { + glLabelObjectClass parent_class; +}; + +GType gl_label_image_get_type (void) G_GNUC_CONST; + +GObject *gl_label_image_new (glLabel *label); + +void gl_label_image_set_filename (glLabelImage *limage, + glTextNode *filename); + +glTextNode *gl_label_image_get_filename (glLabelImage *limage); + +const GdkPixbuf *gl_label_image_get_pixbuf (glLabelImage *limage, + glMergeRecord *record); + +G_END_DECLS + +#endif /* __LABEL_IMAGE_H__ */ diff --git a/src/label-line.c b/src/label-line.c new file mode 100644 index 00000000..b3eae407 --- /dev/null +++ b/src/label-line.c @@ -0,0 +1,323 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_line.c: GLabels label line object + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "label-line.h" + +#include +#include +#include + +#include "debug.h" + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glLabelLinePrivate { + gdouble line_width; + glColorNode *line_color_node; +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_label_line_finalize (GObject *object); + +static void copy (glLabelObject *dst_object, + glLabelObject *src_object); + +static void set_line_color (glLabelObject *object, + glColorNode *line_color_node); + +static void set_line_width (glLabelObject *object, + gdouble line_width); + +static glColorNode *get_line_color (glLabelObject *object); + +static gdouble get_line_width (glLabelObject *object); + +static void draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + +static void draw_shadow (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glLabelLine, gl_label_line, GL_TYPE_LABEL_OBJECT); + +static void +gl_label_line_class_init (glLabelLineClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); + + gl_label_line_parent_class = g_type_class_peek_parent (class); + + label_object_class->copy = copy; + label_object_class->set_line_color = set_line_color; + label_object_class->set_line_width = set_line_width; + label_object_class->get_line_color = get_line_color; + label_object_class->get_line_width = get_line_width; + label_object_class->draw_object = draw_object; + label_object_class->draw_shadow = draw_shadow; + + object_class->finalize = gl_label_line_finalize; +} + +static void +gl_label_line_init (glLabelLine *lline) +{ + lline->priv = g_new0 (glLabelLinePrivate, 1); + lline->priv->line_color_node = gl_color_node_new_default (); +} + +static void +gl_label_line_finalize (GObject *object) +{ + glLabelLine *lline = GL_LABEL_LINE (object); + + g_return_if_fail (object && GL_IS_LABEL_LINE (object)); + + gl_color_node_free (&(lline->priv->line_color_node)); + g_free (lline->priv); + + G_OBJECT_CLASS (gl_label_line_parent_class)->finalize (object); +} + +/*****************************************************************************/ +/* NEW label "line" object. */ +/*****************************************************************************/ +GObject * +gl_label_line_new (glLabel *label) +{ + glLabelLine *lline; + + lline = g_object_new (gl_label_line_get_type(), NULL); + + gl_label_object_set_parent (GL_LABEL_OBJECT(lline), label); + + return G_OBJECT (lline); +} + +/*****************************************************************************/ +/* Copy object contents. */ +/*****************************************************************************/ +static void +copy (glLabelObject *dst_object, + glLabelObject *src_object) +{ + glLabelLine *lline = (glLabelLine *)src_object; + glLabelLine *new_lline = (glLabelLine *)dst_object; + gdouble line_width; + glColorNode *line_color_node; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (lline && GL_IS_LABEL_LINE (lline)); + g_return_if_fail (new_lline && GL_IS_LABEL_LINE (new_lline)); + + line_width = get_line_width (src_object); + line_color_node = get_line_color (src_object); + + set_line_width (dst_object, line_width); + set_line_color (dst_object, line_color_node); + + gl_color_node_free (&line_color_node); + + gl_debug (DEBUG_LABEL, "END"); +} + + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set line color method. */ +/*---------------------------------------------------------------------------*/ +static void +set_line_color (glLabelObject *object, + glColorNode *line_color_node) +{ + glLabelLine *lline = (glLabelLine *)object; + + g_return_if_fail (lline && GL_IS_LABEL_LINE (lline)); + + if ( !gl_color_node_equal (lline->priv->line_color_node, line_color_node)) { + + gl_color_node_free (&(lline->priv->line_color_node )); + lline->priv->line_color_node = gl_color_node_dup (line_color_node); + + gl_label_object_emit_changed (GL_LABEL_OBJECT(lline)); + } +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set line width method. */ +/*---------------------------------------------------------------------------*/ +static void +set_line_width (glLabelObject *object, + gdouble line_width) +{ + glLabelLine *lline = (glLabelLine *)object; + + g_return_if_fail (lline && GL_IS_LABEL_LINE (lline)); + + if ( lline->priv->line_width != line_width ) { + lline->priv->line_width = line_width; + gl_label_object_emit_changed (GL_LABEL_OBJECT(lline)); + } +} + + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Get line color method. */ +/*---------------------------------------------------------------------------*/ +static gdouble +get_line_width (glLabelObject *object) +{ + glLabelLine *lline = (glLabelLine *)object; + + g_return_val_if_fail (lline && GL_IS_LABEL_LINE (lline), 0.0); + + return lline->priv->line_width; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Get line width method. */ +/*---------------------------------------------------------------------------*/ +static glColorNode* +get_line_color (glLabelObject *object) +{ + glLabelLine *lline = (glLabelLine *)object; + + g_return_val_if_fail (lline && GL_IS_LABEL_LINE (lline), 0); + + return gl_color_node_dup (lline->priv->line_color_node); +} + +/*****************************************************************************/ +/* Draw object method. */ +/*****************************************************************************/ +static void +draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + gdouble w, h; + gdouble line_width; + glColorNode *line_color_node; + guint line_color; + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h); + + line_width = gl_label_object_get_line_width (object); + + line_color_node = gl_label_object_get_line_color (object); + line_color = gl_color_node_expand (line_color_node, record); + if (line_color_node->field_flag && screen_flag) + { + line_color = GL_COLOR_MERGE_DEFAULT; + } + + + cairo_move_to (cr, 0.0, 0.0); + cairo_line_to (cr, w, h); + + + /* Draw line */ + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (line_color)); + cairo_set_line_width (cr, line_width); + cairo_stroke (cr); + + gl_color_node_free (&line_color_node); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Draw shadow method. */ +/*****************************************************************************/ +static void +draw_shadow (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + gdouble w, h; + gdouble line_width; + glColorNode *line_color_node; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + guint shadow_line_color; + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h); + + line_width = gl_label_object_get_line_width (object); + + line_color_node = gl_label_object_get_line_color (object); + if (line_color_node->field_flag) + { + line_color_node->color = GL_COLOR_MERGE_DEFAULT; + } + + shadow_color_node = gl_label_object_get_shadow_color (object); + if (shadow_color_node->field_flag) + { + shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT; + } + shadow_opacity = gl_label_object_get_shadow_opacity (object); + shadow_line_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, line_color_node->color); + + + cairo_move_to (cr, 0.0, 0.0); + cairo_line_to (cr, w, h); + + + /* Draw outline shadow */ + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_line_color)); + cairo_set_line_width (cr, line_width); + cairo_stroke (cr); + + + gl_color_node_free (&line_color_node); + gl_color_node_free (&shadow_color_node); + + gl_debug (DEBUG_LABEL, "END"); +} + diff --git a/src/label-line.h b/src/label-line.h new file mode 100644 index 00000000..3b73e42e --- /dev/null +++ b/src/label-line.h @@ -0,0 +1,62 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_line.h: GLabels label line object + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LABEL_LINE_H__ +#define __LABEL_LINE_H__ + +#include "label-object.h" + + +G_BEGIN_DECLS + + +#define GL_TYPE_LABEL_LINE (gl_label_line_get_type ()) +#define GL_LABEL_LINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_LINE, glLabelLine)) +#define GL_LABEL_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_LINE, glLabelLineClass)) +#define GL_IS_LABEL_LINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_LINE)) +#define GL_IS_LABEL_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_LINE)) + +typedef struct _glLabelLine glLabelLine; +typedef struct _glLabelLineClass glLabelLineClass; + +typedef struct _glLabelLinePrivate glLabelLinePrivate; + +struct _glLabelLine { + glLabelObject object; + + glLabelLinePrivate *priv; +}; + +struct _glLabelLineClass { + glLabelObjectClass parent_class; +}; + +GType gl_label_line_get_type (void) G_GNUC_CONST; + +GObject *gl_label_line_new (glLabel *label); + + +G_END_DECLS + +#endif /* __LABEL_LINE_H__ */ diff --git a/src/label-object.c b/src/label-object.c new file mode 100644 index 00000000..fd79e28a --- /dev/null +++ b/src/label-object.c @@ -0,0 +1,1525 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_object.c: GLabels label object base class + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "label-object.h" + +#include +#include +#include +#include + +#include "marshal.h" + +#include "debug.h" + + +/*========================================================*/ +/* Private defines. */ +/*========================================================*/ + +#define DEFAULT_SHADOW_X_OFFSET (3.6) +#define DEFAULT_SHADOW_Y_OFFSET (3.6) +#define DEFAULT_SHADOW_OPACITY (0.5) + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glLabelObjectPrivate { + gchar *name; + gdouble x, y; + gdouble w, h; + cairo_matrix_t matrix; + + gdouble aspect_ratio; + + gboolean shadow_state; + gdouble shadow_x; + gdouble shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; +}; + +enum { + CHANGED, + MOVED, + FLIP_ROTATE, + TOP, + BOTTOM, + REMOVED, + LAST_SIGNAL +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +static guint signals[LAST_SIGNAL] = {0}; + +static guint instance = 0; + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_label_object_finalize (GObject *object); + +static void merge_changed_cb (glLabel *label, + glLabelObject *object); + +static void set_size (glLabelObject *object, + gdouble w, + gdouble h); + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glLabelObject, gl_label_object, G_TYPE_OBJECT); + +static void +gl_label_object_class_init (glLabelObjectClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_object_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_label_object_finalize; + + class->set_size = set_size; + + signals[CHANGED] = + g_signal_new ("changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelObjectClass, changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + signals[MOVED] = + g_signal_new ("moved", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelObjectClass, moved), + NULL, NULL, + gl_marshal_VOID__DOUBLE_DOUBLE, + G_TYPE_NONE, + 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE); + signals[FLIP_ROTATE] = + g_signal_new ("flip_rotate", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelObjectClass, flip_rotate), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + signals[TOP] = + g_signal_new ("top", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelObjectClass, top), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + signals[BOTTOM] = + g_signal_new ("bottom", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelObjectClass, bottom), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + signals[REMOVED] = + g_signal_new ("removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelObjectClass, removed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +static void +gl_label_object_init (glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, "START"); + + object->priv = g_new0 (glLabelObjectPrivate, 1); + + object->priv->name = g_strdup_printf ("object%d", instance++); + + cairo_matrix_init_identity (&object->priv->matrix); + + object->priv->shadow_state = FALSE; + object->priv->shadow_x = DEFAULT_SHADOW_X_OFFSET; + object->priv->shadow_y = DEFAULT_SHADOW_Y_OFFSET; + object->priv->shadow_color_node = gl_color_node_new_default (); + object->priv->shadow_opacity = DEFAULT_SHADOW_OPACITY; + + gl_debug (DEBUG_LABEL, "END"); +} + +static void +gl_label_object_finalize (GObject *object) +{ + glLabelObject *label_object = GL_LABEL_OBJECT (object); + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + g_free (label_object->priv->name); + g_free (label_object->priv); + + G_OBJECT_CLASS (gl_label_object_parent_class)->finalize (object); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* New label object. */ +/*****************************************************************************/ +GObject * +gl_label_object_new (glLabel *label) +{ + glLabelObject *object; + + gl_debug (DEBUG_LABEL, "START"); + + object = g_object_new (gl_label_object_get_type(), NULL); + + gl_label_object_set_parent (object, label); + + gl_debug (DEBUG_LABEL, "END"); + + return G_OBJECT (object); +} + +/*****************************************************************************/ +/* Duplicate object. */ +/*****************************************************************************/ +glLabelObject * +gl_label_object_dup (glLabelObject *src_object, + glLabel *label) +{ + glLabelObject *dst_object; + gdouble x, y, w, h; + cairo_matrix_t matrix; + gboolean shadow_state; + gdouble shadow_x, shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (src_object && GL_IS_LABEL_OBJECT (src_object), NULL); + + dst_object = g_object_new (G_OBJECT_TYPE(src_object), NULL); + + gl_label_object_set_parent (dst_object, label); + + gl_label_object_get_position (src_object, &x, &y); + gl_label_object_get_size (src_object, &w, &h); + gl_label_object_get_matrix (src_object, &matrix); + gl_label_object_get_shadow_offset (src_object, &shadow_x, &shadow_y); + shadow_color_node = gl_label_object_get_shadow_color (src_object); + shadow_opacity = gl_label_object_get_shadow_opacity (src_object); + shadow_state = gl_label_object_get_shadow_state (src_object); + + gl_label_object_set_position (dst_object, x, y); + gl_label_object_set_size (dst_object, w, h); + gl_label_object_set_matrix (dst_object, &matrix); + gl_label_object_set_shadow_offset (dst_object, shadow_x, shadow_y); + gl_label_object_set_shadow_color (dst_object, shadow_color_node); + gl_label_object_set_shadow_opacity (dst_object, shadow_opacity); + gl_label_object_set_shadow_state (dst_object, shadow_state); + + gl_color_node_free (&shadow_color_node); + + if ( GL_LABEL_OBJECT_GET_CLASS(src_object)->copy != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(src_object)->copy (dst_object, src_object); + + } + + gl_debug (DEBUG_LABEL, "END"); + + return dst_object; +} + +/*****************************************************************************/ +/* Emit "changed" signal (for derived objects). */ +/*****************************************************************************/ +void +gl_label_object_emit_changed (glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + g_signal_emit (G_OBJECT(object), signals[CHANGED], 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Set parent label of object. */ +/*****************************************************************************/ +void +gl_label_object_set_parent (glLabelObject *object, + glLabel *label) +{ + glLabel *old_parent; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + g_return_if_fail (label && GL_IS_LABEL (label)); + + old_parent = object->parent; + if ( old_parent != NULL ) { + g_signal_handlers_disconnect_by_func (old_parent, + G_CALLBACK(merge_changed_cb), + object); + gl_label_remove_object( old_parent, object ); + } + gl_label_add_object( label, object ); + + g_signal_connect (G_OBJECT(label), "merge_changed", + G_CALLBACK(merge_changed_cb), object); + + g_signal_emit (G_OBJECT(object), signals[CHANGED], 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Get parent label of object. */ +/*****************************************************************************/ +glLabel * +gl_label_object_get_parent (glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), NULL); + + gl_debug (DEBUG_LABEL, "END"); + + return object->parent; +} + +/*****************************************************************************/ +/* Set remove object from parent. */ +/*****************************************************************************/ +void +gl_label_object_remove (glLabelObject *object) +{ + glLabel *parent; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + parent = object->parent; + if ( parent != NULL ) { + g_signal_handlers_disconnect_by_func (parent, + G_CALLBACK(merge_changed_cb), + object); + gl_label_remove_object (parent, object); + + g_signal_emit (G_OBJECT(object), signals[REMOVED], 0); + + g_object_unref (G_OBJECT(object)); + } + + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Set name of object. */ +/*****************************************************************************/ +void +gl_label_object_set_name (glLabelObject *object, + gchar *name) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + g_free(object->priv->name); + object->priv->name = name; + + g_signal_emit (G_OBJECT(object), signals[CHANGED], 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Get name of object. */ +/*****************************************************************************/ +gchar * +gl_label_object_get_name (glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), NULL); + + gl_debug (DEBUG_LABEL, "END"); + + return g_strdup(object->priv->name); +} + +/*****************************************************************************/ +/* Set position of object. */ +/*****************************************************************************/ +void +gl_label_object_set_position (glLabelObject *object, + gdouble x, + gdouble y) +{ + gdouble dx, dy; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( (x != object->priv->x) || (y != object->priv->y) ) { + + dx = x - object->priv->x; + dy = y - object->priv->y; + + object->priv->x = x; + object->priv->y = y; + + g_signal_emit (G_OBJECT(object), signals[MOVED], 0, dx, dy); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Set position of object relative to old position. */ +/*****************************************************************************/ +void +gl_label_object_set_position_relative (glLabelObject *object, + gdouble dx, + gdouble dy) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( (dx != 0.0) || (dy != 0.0) ) { + + object->priv->x += dx; + object->priv->y += dy; + + gl_debug (DEBUG_LABEL, " x = %f, y= %f", + object->priv->x, + object->priv->y); + + g_signal_emit (G_OBJECT(object), signals[MOVED], 0, dx, dy); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Get position of object. */ +/*****************************************************************************/ +void +gl_label_object_get_position (glLabelObject *object, + gdouble *x, + gdouble *y) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + *x = object->priv->x; + *y = object->priv->y; + + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Default set size method. */ +/*---------------------------------------------------------------------------*/ +static void +set_size (glLabelObject *object, + gdouble w, + gdouble h) +{ + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( (object->priv->w != w) || (object->priv->h != h) ) { + + object->priv->w = w; + object->priv->h = h; + + g_signal_emit (G_OBJECT(object), signals[CHANGED], 0); + } +} + +/*****************************************************************************/ +/* Set size of object. */ +/*****************************************************************************/ +void +gl_label_object_set_size (glLabelObject *object, + gdouble w, + gdouble h) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_size != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_size (object, w, h); + + object->priv->aspect_ratio = h / w; + + } + + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Set size of object honoring current aspect ratio. */ +/*****************************************************************************/ +void +gl_label_object_set_size_honor_aspect (glLabelObject *object, + gdouble w, + gdouble h) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( h > w*object->priv->aspect_ratio ) { + + h = w * object->priv->aspect_ratio; + + } else { + + w = h / object->priv->aspect_ratio; + + } + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_size != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_size (object, w, h); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Get raw size method (don't let object content adjust size). */ +/*****************************************************************************/ +void +gl_label_object_get_raw_size (glLabelObject *object, + gdouble *w, + gdouble *h) +{ + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + *w = object->priv->w; + *h = object->priv->h; +} + +/*****************************************************************************/ +/* Get size of object. */ +/*****************************************************************************/ +void +gl_label_object_get_size (glLabelObject *object, + gdouble *w, + gdouble *h) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_size != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->get_size (object, w, h); + + } else { + + gl_label_object_get_raw_size (object, w, h); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Get extent of object. */ +/*****************************************************************************/ +void +gl_label_object_get_extent (glLabelObject *object, + glLabelRegion *region) +{ + gdouble w, h; + gdouble line_w; + gdouble xa1, ya1, xa2, ya2, xa3, ya3, xa4, ya4; + cairo_matrix_t matrix; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + gl_label_object_get_size (object, &w, &h); + line_w = gl_label_object_get_line_width (object); + + /* setup untransformed corners of bounding box, account for line width */ + xa1 = - line_w/2; + ya1 = - line_w/2; + xa2 = w + line_w/2; + ya2 = - line_w/2; + xa3 = w + line_w/2; + ya3 = h + line_w/2; + xa4 = - line_w/2; + ya4 = h + line_w/2; + + /* transform these points */ + gl_label_object_get_matrix (object, &matrix); + cairo_matrix_transform_point (&matrix, &xa1, &ya1); + cairo_matrix_transform_point (&matrix, &xa2, &ya2); + cairo_matrix_transform_point (&matrix, &xa3, &ya3); + cairo_matrix_transform_point (&matrix, &xa4, &ya4); + + /* now find the maximum extent of these points in x and y */ + region->x1 = MIN (xa1, MIN (xa2, MIN (xa3, xa4))) + object->priv->x; + region->y1 = MIN (ya1, MIN (ya2, MIN (ya3, ya4))) + object->priv->y; + region->x2 = MAX (xa1, MAX (xa2, MAX (xa3, xa4))) + object->priv->x; + region->y2 = MAX (ya1, MAX (ya2, MAX (ya3, ya4))) + object->priv->y; + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Can text properties be set for this object? */ +/*****************************************************************************/ +gboolean +gl_label_object_can_text (glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_font_family != NULL ) { + + return TRUE; + + } else { + + return FALSE; + + } + +} + +/*****************************************************************************/ +/* Set font family for all text contained in object. */ +/*****************************************************************************/ +void +gl_label_object_set_font_family (glLabelObject *object, + const gchar *font_family) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_font_family != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_font_family (object, font_family); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Set font size for all text contained in object. */ +/****************************************************************************/ +void +gl_label_object_set_font_size (glLabelObject *object, + gdouble font_size) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_font_size != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_font_size (object, font_size); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Set font weight for all text contained in object. */ +/****************************************************************************/ +void +gl_label_object_set_font_weight (glLabelObject *object, + PangoWeight font_weight) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_font_weight != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_font_weight (object, font_weight); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Set font italic flag for all text contained in object. */ +/****************************************************************************/ +void +gl_label_object_set_font_italic_flag (glLabelObject *object, + gboolean font_italic_flag) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_font_italic_flag != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_font_italic_flag (object, + font_italic_flag); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Set text alignment for all text contained in object. */ +/****************************************************************************/ +void +gl_label_object_set_text_alignment (glLabelObject *object, + PangoAlignment text_alignment) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_text_alignment != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_text_alignment (object, + text_alignment); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Set text line spacing for all text contained in object. */ +/****************************************************************************/ +void +gl_label_object_set_text_line_spacing (glLabelObject *object, + gdouble text_line_spacing) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_text_line_spacing != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_text_line_spacing (object, text_line_spacing); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Set text color for all text contained in object. */ +/****************************************************************************/ +void +gl_label_object_set_text_color (glLabelObject *object, + glColorNode *text_color_node) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_text_color != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_text_color (object, text_color_node); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Get font family for all text contained in object. */ +/*****************************************************************************/ +gchar * +gl_label_object_get_font_family (glLabelObject *object) +{ + gchar *ret = NULL; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), NULL); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_family != NULL ) { + + /* We have an object specific method, use it */ + ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_family (object); + + } + + gl_debug (DEBUG_LABEL, "END"); + + return ret; +} + +/****************************************************************************/ +/* Get font size for all text contained in object. */ +/****************************************************************************/ +gdouble +gl_label_object_get_font_size (glLabelObject *object) +{ + gdouble ret = 0.0; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0.0); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_size != NULL ) { + + /* We have an object specific method, use it */ + ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_size (object); + + } + + gl_debug (DEBUG_LABEL, "END"); + + return ret; +} + +/****************************************************************************/ +/* Get font weight for all text contained in object. */ +/****************************************************************************/ +PangoWeight +gl_label_object_get_font_weight (glLabelObject *object) +{ + PangoWeight ret = PANGO_WEIGHT_NORMAL; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), PANGO_WEIGHT_NORMAL); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_weight != NULL ) { + + /* We have an object specific method, use it */ + ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_weight (object); + + } + + gl_debug (DEBUG_LABEL, "END"); + + return ret; +} + +/****************************************************************************/ +/* Get font italic flag for all text contained in object. */ +/****************************************************************************/ +gboolean +gl_label_object_get_font_italic_flag (glLabelObject *object) +{ + gboolean ret = FALSE; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_font_italic_flag != NULL ) { + + /* We have an object specific method, use it */ + ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_font_italic_flag (object); + + } + + gl_debug (DEBUG_LABEL, "END"); + + return ret; +} + +/****************************************************************************/ +/* Get text alignment for all text contained in object. */ +/****************************************************************************/ +PangoAlignment +gl_label_object_get_text_alignment (glLabelObject *object) +{ + PangoAlignment ret = PANGO_ALIGN_LEFT; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), PANGO_ALIGN_LEFT); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_text_alignment != NULL ) { + + /* We have an object specific method, use it */ + ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_text_alignment (object); + + } + + gl_debug (DEBUG_LABEL, "END"); + + return ret; +} + +/****************************************************************************/ +/* Get text line spacing for all text contained in object. */ +/****************************************************************************/ +gdouble +gl_label_object_get_text_line_spacing (glLabelObject *object) +{ + gdouble ret = 0.0; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0.0); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_text_line_spacing != NULL ) { + + /* We have an object specific method, use it */ + ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_text_line_spacing (object); + + } + + gl_debug (DEBUG_LABEL, "END"); + + return ret; +} + +/****************************************************************************/ +/* Get text color for all text contained in object. */ +/****************************************************************************/ +glColorNode* +gl_label_object_get_text_color (glLabelObject *object) +{ + glColorNode *ret = NULL; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_text_color != NULL ) { + + /* We have an object specific method, use it */ + ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_text_color (object); + + } + + gl_debug (DEBUG_LABEL, "END"); + + return ret; +} + +/*****************************************************************************/ +/* Can fill properties be set for this object? */ +/*****************************************************************************/ +gboolean +gl_label_object_can_fill (glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_fill_color != NULL ) { + + return TRUE; + + } else { + + return FALSE; + + } + +} + +/****************************************************************************/ +/* Set fill color for object. */ +/****************************************************************************/ +void +gl_label_object_set_fill_color (glLabelObject *object, + glColorNode *fill_color_node) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_fill_color != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_fill_color (object, fill_color_node); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Get fill color for object. */ +/****************************************************************************/ +glColorNode* +gl_label_object_get_fill_color (glLabelObject *object) +{ + glColorNode *ret = NULL; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_fill_color != NULL ) { + + /* We have an object specific method, use it */ + ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_fill_color (object); + + } + + gl_debug (DEBUG_LABEL, "END"); + + return ret; +} + +/*****************************************************************************/ +/* Can line color property be set for this object? */ +/*****************************************************************************/ +gboolean +gl_label_object_can_line_color (glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_line_color != NULL ) { + + return TRUE; + + } else { + + return FALSE; + + } + +} + +/****************************************************************************/ +/* Set line color for object. */ +/****************************************************************************/ +void +gl_label_object_set_line_color (glLabelObject *object, + glColorNode *line_color_node) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_line_color != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_line_color (object, line_color_node); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Get line color for object. */ +/****************************************************************************/ +glColorNode* +gl_label_object_get_line_color (glLabelObject *object) +{ + glColorNode *ret = NULL; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_line_color != NULL ) { + + /* We have an object specific method, use it */ + ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_line_color (object); + + } + + gl_debug (DEBUG_LABEL, "END"); + + return ret; +} + +/*****************************************************************************/ +/* Can line width property be set for this object? */ +/*****************************************************************************/ +gboolean +gl_label_object_can_line_width (glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_line_width != NULL ) { + + return TRUE; + + } else { + + return FALSE; + + } + +} + +/****************************************************************************/ +/* Set line width for object. */ +/****************************************************************************/ +void +gl_label_object_set_line_width (glLabelObject *object, + gdouble line_width) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->set_line_width != NULL ) { + + /* We have an object specific method, use it */ + GL_LABEL_OBJECT_GET_CLASS(object)->set_line_width (object, line_width); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Get line width for object. */ +/****************************************************************************/ +gdouble +gl_label_object_get_line_width (glLabelObject *object) +{ + gdouble ret = 0.0; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), 0.0); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->get_line_width != NULL ) { + + /* We have an object specific method, use it */ + ret = GL_LABEL_OBJECT_GET_CLASS(object)->get_line_width (object); + + } + + gl_debug (DEBUG_LABEL, "END"); + + return ret; +} + +/****************************************************************************/ +/* Set shadow state of object. */ +/****************************************************************************/ +void +gl_label_object_set_shadow_state (glLabelObject *object, + gboolean state) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if (object->priv->shadow_state != state) + { + object->priv->shadow_state = state; + gl_label_object_emit_changed (object); + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Get shadow state of object. */ +/****************************************************************************/ +gboolean +gl_label_object_get_shadow_state (glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); + + return object->priv->shadow_state; +} + +/****************************************************************************/ +/* Set offset of object's shadow. */ +/****************************************************************************/ +void +gl_label_object_set_shadow_offset (glLabelObject *object, + gdouble x, + gdouble y) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( (x != object->priv->shadow_x) || (y != object->priv->shadow_y) ) + { + object->priv->shadow_x = x; + object->priv->shadow_y = y; + + gl_label_object_emit_changed (object); + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Get offset of object's shadow. */ +/****************************************************************************/ +void +gl_label_object_get_shadow_offset (glLabelObject *object, + gdouble *x, + gdouble *y) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + *x = object->priv->shadow_x; + *y = object->priv->shadow_y; + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Set color of object's shadow. */ +/****************************************************************************/ +void +gl_label_object_set_shadow_color (glLabelObject *object, + glColorNode *color_node) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if ( !gl_color_node_equal (object->priv->shadow_color_node, color_node )) + { + gl_color_node_free (&(object->priv->shadow_color_node)); + object->priv->shadow_color_node = gl_color_node_dup (color_node); + gl_label_object_emit_changed (GL_LABEL_OBJECT(object)); + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Get color of object's shadow. */ +/****************************************************************************/ +glColorNode* +gl_label_object_get_shadow_color (glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), NULL); + + return gl_color_node_dup (object->priv->shadow_color_node); +} + +/****************************************************************************/ +/* Set opacity of object's shadow. */ +/****************************************************************************/ +void +gl_label_object_set_shadow_opacity (glLabelObject *object, + gdouble alpha) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if (object->priv->shadow_opacity != alpha) + { + object->priv->shadow_opacity = alpha; + gl_label_object_emit_changed (object); + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Get opacity of object's shadow. */ +/****************************************************************************/ +gdouble +gl_label_object_get_shadow_opacity (glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); + + return object->priv->shadow_opacity; +} + +/****************************************************************************/ +/* Flip object horizontally. */ +/****************************************************************************/ +void +gl_label_object_flip_horiz (glLabelObject *object) +{ + cairo_matrix_t flip_matrix; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + cairo_matrix_init_scale (&flip_matrix, -1.0, 1.0); + cairo_matrix_multiply (&object->priv->matrix, &object->priv->matrix, &flip_matrix); + + g_signal_emit (G_OBJECT(object), signals[FLIP_ROTATE], 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Flip object vertically. */ +/****************************************************************************/ +void +gl_label_object_flip_vert (glLabelObject *object) +{ + cairo_matrix_t flip_matrix; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + cairo_matrix_init_scale (&flip_matrix, 1.0, -1.0); + cairo_matrix_multiply (&object->priv->matrix, &object->priv->matrix, &flip_matrix); + + g_signal_emit (G_OBJECT(object), signals[FLIP_ROTATE], 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Rotate object. */ +/****************************************************************************/ +void +gl_label_object_rotate (glLabelObject *object, + gdouble theta_degs) +{ + cairo_matrix_t rotate_matrix; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + cairo_matrix_init_rotate (&rotate_matrix, theta_degs*(G_PI/180.)); + cairo_matrix_multiply (&object->priv->matrix, &object->priv->matrix, &rotate_matrix); + + g_signal_emit (G_OBJECT(object), signals[FLIP_ROTATE], 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Set raw affine */ +/****************************************************************************/ +void +gl_label_object_set_matrix (glLabelObject *object, + cairo_matrix_t *matrix) +{ + gl_debug (DEBUG_LABEL, ""); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + object->priv->matrix = *matrix; +} + +/****************************************************************************/ +/* Get raw affine */ +/****************************************************************************/ +void +gl_label_object_get_matrix (glLabelObject *object, + cairo_matrix_t *matrix) +{ + gl_debug (DEBUG_LABEL, ""); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + *matrix = object->priv->matrix; +} + +/****************************************************************************/ +/* Bring label object to front/top. */ +/****************************************************************************/ +void +gl_label_object_raise_to_top (glLabelObject *object) +{ + glLabel *label; + + gl_debug (DEBUG_LABEL, "START"); + + label = object->parent; + + gl_label_raise_object_to_top (label, object); + + g_signal_emit (G_OBJECT(object), signals[TOP], 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Send label object to rear/bottom. */ +/****************************************************************************/ +void +gl_label_object_lower_to_bottom (glLabelObject *object) +{ + glLabel *label; + + gl_debug (DEBUG_LABEL, "START"); + + label = object->parent; + + gl_label_lower_object_to_bottom (label, object); + + g_signal_emit (G_OBJECT(object), signals[BOTTOM], 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Label's merge data changed callback. */ +/*--------------------------------------------------------------------------*/ +static void +merge_changed_cb (glLabel *label, + glLabelObject *object) +{ + gl_label_object_emit_changed (object); +} + +/*****************************************************************************/ +/* Draw object */ +/*****************************************************************************/ +void +gl_label_object_draw (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) + +{ + gdouble x0, y0; + cairo_matrix_t matrix; + gboolean shadow_state; + gdouble shadow_x, shadow_y; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + gl_label_object_get_position (object, &x0, &y0); + gl_label_object_get_matrix (object, &matrix); + + cairo_save (cr); + cairo_translate (cr, x0, y0); + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->draw_shadow != NULL ) { + + shadow_state = gl_label_object_get_shadow_state (object); + + if ( shadow_state ) + { + gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); + + cairo_save (cr); + cairo_translate (cr, shadow_x, shadow_y); + cairo_transform (cr, &matrix); + + GL_LABEL_OBJECT_GET_CLASS(object)->draw_shadow (object, + cr, + screen_flag, + record); + + cairo_restore (cr); + } + } + + if ( GL_LABEL_OBJECT_GET_CLASS(object)->draw_object != NULL ) { + + cairo_save (cr); + cairo_transform (cr, &matrix); + + GL_LABEL_OBJECT_GET_CLASS(object)->draw_object (object, + cr, + screen_flag, + record); + + cairo_restore (cr); + } + + cairo_restore (cr); + + gl_debug (DEBUG_LABEL, "END"); +} + diff --git a/src/label-object.h b/src/label-object.h new file mode 100644 index 00000000..5ee0f9ba --- /dev/null +++ b/src/label-object.h @@ -0,0 +1,345 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_object.h: GLabels label object base class + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LABEL_OBJECT_H__ +#define __LABEL_OBJECT_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +typedef enum { + GL_LABEL_OBJECT_TEXT, + GL_LABEL_OBJECT_BOX, + GL_LABEL_OBJECT_LINE, + GL_LABEL_OBJECT_ELLIPSE, + GL_LABEL_OBJECT_IMAGE, + GL_LABEL_OBJECT_BARCODE, + GL_LABEL_OBJECT_N_TYPES +} glLabelObjectType; + + +#define GL_TYPE_LABEL_OBJECT (gl_label_object_get_type ()) +#define GL_LABEL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_OBJECT, glLabelObject)) +#define GL_LABEL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_OBJECT, glLabelObjectClass)) +#define GL_IS_LABEL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_OBJECT)) +#define GL_IS_LABEL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_OBJECT)) +#define GL_LABEL_OBJECT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_LABEL_OBJECT, glLabelObjectClass)) + + +typedef struct _glLabelObject glLabelObject; +typedef struct _glLabelObjectClass glLabelObjectClass; + +typedef struct _glLabelObjectPrivate glLabelObjectPrivate; + +#include "label.h" +#include "color.h" + +struct _glLabelObject { + GObject object; + + glLabel *parent; + + glLabelObjectPrivate *priv; +}; + +struct _glLabelObjectClass { + GObjectClass parent_class; + + /* + * Methods + */ + + void (*set_size) (glLabelObject *object, + gdouble w, + gdouble h); + + void (*get_size) (glLabelObject *object, + gdouble *w, + gdouble *h); + + void (*set_font_family) (glLabelObject *object, + const gchar *font_family); + + void (*set_font_size) (glLabelObject *object, + gdouble font_size); + + void (*set_font_weight) (glLabelObject *object, + PangoWeight font_weight); + + void (*set_font_italic_flag) (glLabelObject *object, + gboolean font_italic_flag); + + void (*set_text_alignment) (glLabelObject *object, + PangoAlignment text_alignment); + + void (*set_text_line_spacing) (glLabelObject *object, + gdouble text_line_spacing); + + void (*set_text_color) (glLabelObject *object, + glColorNode *text_color_node); + + void (*set_fill_color) (glLabelObject *object, + glColorNode *fill_color_node); + + void (*set_line_color) (glLabelObject *object, + glColorNode *line_color_node); + + void (*set_line_width) (glLabelObject *object, + gdouble line_width); + + gchar *(*get_font_family) (glLabelObject *object); + + gdouble (*get_font_size) (glLabelObject *object); + + PangoWeight (*get_font_weight) (glLabelObject *object); + + gboolean (*get_font_italic_flag) (glLabelObject *object); + + PangoAlignment (*get_text_alignment) (glLabelObject *object); + + gdouble (*get_text_line_spacing) (glLabelObject *object); + + glColorNode* (*get_text_color) (glLabelObject *object); + + glColorNode* (*get_fill_color) (glLabelObject *object); + + glColorNode* (*get_line_color) (glLabelObject *object); + + gdouble (*get_line_width) (glLabelObject *object); + + void (*copy) (glLabelObject *dst_object, + glLabelObject *src_object); + + /* + * Draw methods + */ + void (*draw_shadow) (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + + void (*draw_object) (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + + + /* + * Signals + */ + void (*changed) (glLabelObject *object, + gpointer user_data); + + void (*moved) (glLabelObject *object, + gdouble dx, + gdouble dy, + gpointer user_data); + + void (*flip_rotate) (glLabelObject *object, + gpointer user_data); + + void (*top) (glLabelObject *object, + gpointer user_data); + + void (*bottom) (glLabelObject *object, + gpointer user_data); + + void (*removed) (glLabelObject *object, + gpointer user_data); + +}; + +GType gl_label_object_get_type (void) G_GNUC_CONST; + +GObject *gl_label_object_new (glLabel *label); + + +glLabelObject *gl_label_object_dup (glLabelObject *src_object, + glLabel *label); + +void gl_label_object_emit_changed (glLabelObject *object); + + +void gl_label_object_set_parent (glLabelObject *object, + glLabel *label); + +glLabel *gl_label_object_get_parent (glLabelObject *object); + + +void gl_label_object_remove (glLabelObject *object); + +void gl_label_object_set_name (glLabelObject *object, + gchar *name); + +gchar *gl_label_object_get_name (glLabelObject *object); + + +void gl_label_object_set_position (glLabelObject *object, + gdouble x, + gdouble y); + +void gl_label_object_set_position_relative (glLabelObject *object, + gdouble dx, + gdouble dy); + +void gl_label_object_get_position (glLabelObject *object, + gdouble *x, + gdouble *y); + +void gl_label_object_set_size (glLabelObject *object, + gdouble w, + gdouble h); + +void gl_label_object_set_size_honor_aspect (glLabelObject *object, + gdouble w, + gdouble h); + +void gl_label_object_get_size (glLabelObject *object, + gdouble *w, + gdouble *h); + +void gl_label_object_get_raw_size (glLabelObject *object, + gdouble *w, + gdouble *h); + +void gl_label_object_get_extent (glLabelObject *object, + glLabelRegion *region); + +gboolean gl_label_object_can_text (glLabelObject *object); + +void gl_label_object_set_font_family (glLabelObject *object, + const gchar *font_family); + +void gl_label_object_set_font_size (glLabelObject *object, + gdouble font_size); + +void gl_label_object_set_font_weight (glLabelObject *object, + PangoWeight font_weight); + +void gl_label_object_set_font_italic_flag (glLabelObject *object, + gboolean font_italic_flag); + +void gl_label_object_set_text_alignment (glLabelObject *object, + PangoAlignment text_alignment); + +void gl_label_object_set_text_color (glLabelObject *object, + glColorNode *text_color_node); + +void gl_label_object_set_text_line_spacing (glLabelObject *object, + gdouble text_line_spacing); + + +gchar *gl_label_object_get_font_family (glLabelObject *object); + +gdouble gl_label_object_get_font_size (glLabelObject *object); + +PangoWeight gl_label_object_get_font_weight (glLabelObject *object); + +gboolean gl_label_object_get_font_italic_flag (glLabelObject *object); + +PangoAlignment gl_label_object_get_text_alignment (glLabelObject *object); + +gdouble gl_label_object_get_text_line_spacing (glLabelObject *object); + +glColorNode *gl_label_object_get_text_color (glLabelObject *object); + + +gboolean gl_label_object_can_fill (glLabelObject *object); + +void gl_label_object_set_fill_color (glLabelObject *object, + glColorNode *fill_color_node); + +glColorNode* gl_label_object_get_fill_color (glLabelObject *object); + + +gboolean gl_label_object_can_line_color (glLabelObject *object); + +void gl_label_object_set_line_color (glLabelObject *object, + glColorNode *line_color_node); + +glColorNode *gl_label_object_get_line_color (glLabelObject *object); + +gboolean gl_label_object_can_line_width (glLabelObject *object); + +void gl_label_object_set_line_width (glLabelObject *object, + gdouble line_width); + +gdouble gl_label_object_get_line_width (glLabelObject *object); + + +void gl_label_object_raise_to_top (glLabelObject *object); + +void gl_label_object_lower_to_bottom (glLabelObject *object); + + +void gl_label_object_flip_horiz (glLabelObject *object); + +void gl_label_object_flip_vert (glLabelObject *object); + +void gl_label_object_rotate (glLabelObject *object, + gdouble theta_degs); + +void gl_label_object_set_matrix (glLabelObject *object, + cairo_matrix_t *matrix); + +void gl_label_object_get_matrix (glLabelObject *object, + cairo_matrix_t *matrix); + +void gl_label_object_set_shadow_state (glLabelObject *object, + gboolean state); + +void gl_label_object_set_shadow_offset (glLabelObject *object, + gdouble x, + gdouble y); + +void gl_label_object_set_shadow_color (glLabelObject *object, + glColorNode *color_node); + +void gl_label_object_set_shadow_opacity (glLabelObject *object, + gdouble alpha); + +gboolean gl_label_object_get_shadow_state (glLabelObject *object); + +void gl_label_object_get_shadow_offset (glLabelObject *object, + gdouble *x, + gdouble *y); + +glColorNode* gl_label_object_get_shadow_color (glLabelObject *object); + +gdouble gl_label_object_get_shadow_opacity (glLabelObject *object); + +void gl_label_object_draw (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + + + + +G_END_DECLS + +#endif /* __LABEL_OBJECT_H__ */ diff --git a/src/label-text.c b/src/label-text.c new file mode 100644 index 00000000..9a4d59a1 --- /dev/null +++ b/src/label-text.c @@ -0,0 +1,1094 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_text.c: GLabels label text object + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "label-text.h" + +#include +#include +#include +#include +#include + +#include "util.h" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +#define DEFAULT_FONT_FAMILY "Sans" +#define DEFAULT_FONT_SIZE 14.0 +#define DEFAULT_FONT_WEIGHT PANGO_WEIGHT_NORMAL +#define DEFAULT_FONT_ITALIC_FLAG FALSE +#define DEFAULT_ALIGN PANGO_ALIGN_LEFT +#define DEFAULT_COLOR GL_COLOR (0,0,0) +#define DEFAULT_TEXT_LINE_SPACING 1.0 +#define DEFAULT_AUTO_SHRINK FALSE + +#define FONT_SCALE (72.0/96.0) + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glLabelTextPrivate { + GtkTextTagTable *tag_table; + GtkTextBuffer *buffer; + + gchar *font_family; + gdouble font_size; + PangoWeight font_weight; + gboolean font_italic_flag; + PangoAlignment align; + glColorNode *color_node; + gdouble line_spacing; + gboolean auto_shrink; + + gboolean size_changed; + gdouble w; + gdouble h; +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_label_text_finalize (GObject *object); + +static void copy (glLabelObject *dst_object, + glLabelObject *src_object); + +static void buffer_changed_cb (GtkTextBuffer *textbuffer, + glLabelText *ltext); + +static void get_size (glLabelObject *object, + gdouble *w, + gdouble *h); + +static void set_font_family (glLabelObject *object, + const gchar *font_family); + +static void set_font_size (glLabelObject *object, + gdouble font_size); + +static void set_font_weight (glLabelObject *object, + PangoWeight font_weight); + +static void set_font_italic_flag (glLabelObject *object, + gboolean font_italic_flag); + +static void set_text_alignment (glLabelObject *object, + PangoAlignment text_alignment); + +static void set_text_line_spacing (glLabelObject *object, + gdouble text_line_spacing); + +static void set_text_color (glLabelObject *object, + glColorNode *text_color_node); + +static gchar *get_font_family (glLabelObject *object); + +static gdouble get_font_size (glLabelObject *object); + +static PangoWeight get_font_weight (glLabelObject *object); + +static gboolean get_font_italic_flag (glLabelObject *object); + +static PangoAlignment get_text_alignment (glLabelObject *object); + +static gdouble get_text_line_spacing (glLabelObject *object); + +static glColorNode* get_text_color (glLabelObject *object); + +static void draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + +static void draw_shadow (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + +static gdouble auto_shrink_font_size (cairo_t *cr, + gchar *family, + gdouble size, + PangoWeight weight, + PangoStyle style, + gchar *text, + gdouble width); + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glLabelText, gl_label_text, GL_TYPE_LABEL_OBJECT); + +static void +gl_label_text_class_init (glLabelTextClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glLabelObjectClass *label_object_class = GL_LABEL_OBJECT_CLASS (class); + + gl_label_text_parent_class = g_type_class_peek_parent (class); + + label_object_class->copy = copy; + + label_object_class->get_size = get_size; + + label_object_class->set_font_family = set_font_family; + label_object_class->set_font_size = set_font_size; + label_object_class->set_font_weight = set_font_weight; + label_object_class->set_font_italic_flag = set_font_italic_flag; + label_object_class->set_text_alignment = set_text_alignment; + label_object_class->set_text_line_spacing = set_text_line_spacing; + label_object_class->set_text_color = set_text_color; + label_object_class->get_font_family = get_font_family; + label_object_class->get_font_size = get_font_size; + label_object_class->get_font_weight = get_font_weight; + label_object_class->get_font_italic_flag = get_font_italic_flag; + label_object_class->get_text_alignment = get_text_alignment; + label_object_class->get_text_line_spacing = get_text_line_spacing; + label_object_class->get_text_color = get_text_color; + label_object_class->draw_object = draw_object; + label_object_class->draw_shadow = draw_shadow; + + object_class->finalize = gl_label_text_finalize; +} + +static void +gl_label_text_init (glLabelText *ltext) +{ + ltext->priv = g_new0 (glLabelTextPrivate, 1); + + ltext->priv->tag_table = gtk_text_tag_table_new (); + ltext->priv->buffer = gtk_text_buffer_new (ltext->priv->tag_table); + + ltext->priv->font_family = g_strdup(DEFAULT_FONT_FAMILY); + ltext->priv->font_size = DEFAULT_FONT_SIZE; + ltext->priv->font_weight = DEFAULT_FONT_WEIGHT; + ltext->priv->font_italic_flag = DEFAULT_FONT_ITALIC_FLAG; + ltext->priv->align = DEFAULT_ALIGN; + ltext->priv->color_node = gl_color_node_new_default (); + ltext->priv->color_node->color = DEFAULT_COLOR; + ltext->priv->line_spacing = DEFAULT_TEXT_LINE_SPACING; + ltext->priv->auto_shrink = DEFAULT_AUTO_SHRINK; + + ltext->priv->size_changed = TRUE; + + g_signal_connect (G_OBJECT(ltext->priv->buffer), "changed", + G_CALLBACK(buffer_changed_cb), ltext); +} + +static void +gl_label_text_finalize (GObject *object) +{ + glLabelText *ltext = GL_LABEL_TEXT (object); + + g_return_if_fail (object && GL_IS_LABEL_TEXT (object)); + + g_object_unref (ltext->priv->tag_table); + g_object_unref (ltext->priv->buffer); + g_free (ltext->priv->font_family); + gl_color_node_free (&(ltext->priv->color_node)); + g_free (ltext->priv); + + G_OBJECT_CLASS (gl_label_text_parent_class)->finalize (object); +} + +/*****************************************************************************/ +/* NEW label "text" object. */ +/*****************************************************************************/ +GObject * +gl_label_text_new (glLabel *label) +{ + glLabelText *ltext; + + ltext = g_object_new (gl_label_text_get_type(), NULL); + + gl_label_object_set_parent (GL_LABEL_OBJECT(ltext), label); + + return G_OBJECT (ltext); +} + +/*****************************************************************************/ +/* Copy object contents. */ +/*****************************************************************************/ +static void +copy (glLabelObject *dst_object, + glLabelObject *src_object) +{ + glLabelText *ltext = (glLabelText *)src_object; + glLabelText *new_ltext = (glLabelText *)dst_object; + GList *lines; + glColorNode *text_color_node; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + g_return_if_fail (new_ltext && GL_IS_LABEL_TEXT (new_ltext)); + + lines = gl_label_text_get_lines (ltext); + text_color_node = get_text_color (src_object); + gl_label_text_set_lines (new_ltext, lines); + + new_ltext->priv->font_family = g_strdup (ltext->priv->font_family); + new_ltext->priv->font_size = ltext->priv->font_size; + new_ltext->priv->font_weight = ltext->priv->font_weight; + new_ltext->priv->font_italic_flag = ltext->priv->font_italic_flag; + set_text_color (dst_object, text_color_node); + new_ltext->priv->align = ltext->priv->align; + new_ltext->priv->line_spacing = ltext->priv->line_spacing; + new_ltext->priv->auto_shrink = ltext->priv->auto_shrink; + + new_ltext->priv->size_changed = ltext->priv->size_changed; + new_ltext->priv->w = ltext->priv->w; + new_ltext->priv->h = ltext->priv->h; + + gl_color_node_free (&text_color_node); + gl_text_node_lines_free (&lines); + + gl_debug (DEBUG_LABEL, "END"); +} + + +/*****************************************************************************/ +/* Set object params. */ +/*****************************************************************************/ +void +gl_label_text_set_lines (glLabelText *ltext, + GList *lines) +{ + gchar *text; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + + text = gl_text_node_lines_expand (lines, NULL); + gtk_text_buffer_set_text (ltext->priv->buffer, text, -1); + g_free (text); + + ltext->priv->size_changed = TRUE; + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Get object params. */ +/*****************************************************************************/ +GtkTextBuffer * +gl_label_text_get_buffer (glLabelText *ltext) +{ + g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), NULL); + + return ltext->priv->buffer; +} + +GList * +gl_label_text_get_lines (glLabelText *ltext) +{ + GtkTextIter start, end; + gchar *text; + GList *lines; + + g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), NULL); + + gtk_text_buffer_get_bounds (ltext->priv->buffer, &start, &end); + text = gtk_text_buffer_get_text (ltext->priv->buffer, + &start, &end, FALSE); + lines = gl_text_node_lines_new_from_text (text); + g_free (text); + + return lines; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. text buffer "changed" callback. */ +/*---------------------------------------------------------------------------*/ +void buffer_changed_cb (GtkTextBuffer *textbuffer, + glLabelText *ltext) +{ + ltext->priv->size_changed = TRUE; + + gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. get object size method. */ +/*---------------------------------------------------------------------------*/ +static void +get_size (glLabelObject *object, + gdouble *w, + gdouble *h) +{ + glLabelText *ltext = (glLabelText *)object; + PangoFontMap *fontmap; + PangoContext *context; + cairo_font_options_t *options; + PangoStyle style; + PangoLayout *layout; + PangoFontDescription *desc; + gdouble font_size; + gdouble line_spacing; + GtkTextIter start, end; + gchar *text; + gdouble w_parent, h_parent; + gint iw, ih; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + + gl_label_object_get_raw_size (object, &w_parent, &h_parent); + + if ( (w_parent != 0.0) || (h_parent != 0.0) ) { + *w = w_parent; + *h = h_parent; + return; + } + + if (!ltext->priv->size_changed) + { + *w = ltext->priv->w; + *h = ltext->priv->h; + return; + } + + font_size = GL_LABEL_TEXT (object)->priv->font_size * FONT_SCALE; + line_spacing = GL_LABEL_TEXT (object)->priv->line_spacing; + + gtk_text_buffer_get_bounds (ltext->priv->buffer, &start, &end); + text = gtk_text_buffer_get_text (ltext->priv->buffer, + &start, &end, FALSE); + + + fontmap = pango_cairo_font_map_new (); + context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap)); + options = cairo_font_options_create (); + cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE); + pango_cairo_context_set_font_options (context, options); + cairo_font_options_destroy (options); + + layout = pango_layout_new (context); + + style = GL_LABEL_TEXT (object)->priv->font_italic_flag ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL; + + desc = pango_font_description_new (); + pango_font_description_set_family (desc, GL_LABEL_TEXT (object)->priv->font_family); + pango_font_description_set_weight (desc, GL_LABEL_TEXT (object)->priv->font_weight); + pango_font_description_set_style (desc, style); + pango_font_description_set_size (desc, font_size * PANGO_SCALE); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_spacing (layout, font_size * (line_spacing-1) * PANGO_SCALE); + pango_layout_set_text (layout, text, -1); + pango_layout_get_size (layout, &iw, &ih); + *w = ltext->priv->w = iw / PANGO_SCALE + 2*GL_LABEL_TEXT_MARGIN; + *h = ltext->priv->h = ih / PANGO_SCALE; + ltext->priv->size_changed = FALSE; + + g_object_unref (layout); + g_object_unref (context); + g_object_unref (fontmap); + g_free (text); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. set font family method. */ +/*---------------------------------------------------------------------------*/ +static void +set_font_family (glLabelObject *object, + const gchar *font_family) +{ + glLabelText *ltext = (glLabelText *)object; + GList *family_names; + gchar *good_font_family; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + g_return_if_fail (font_family); + + family_names = gl_util_get_font_family_list (); + if (g_list_find_custom (family_names, font_family, (GCompareFunc)g_utf8_collate)) { + good_font_family = g_strdup (font_family); + } else { + if (family_names != NULL) { + good_font_family = g_strdup (family_names->data); /* 1st entry */ + } else { + good_font_family = g_strdup (font_family); + } + } + + if (ltext->priv->font_family) { + if (g_strcasecmp (ltext->priv->font_family, good_font_family) == 0) { + g_free (good_font_family); + gl_debug (DEBUG_LABEL, "END (no change)"); + return; + } + g_free (ltext->priv->font_family); + } + ltext->priv->font_family = g_strdup (good_font_family); + g_free (good_font_family); + + gl_debug (DEBUG_LABEL, "new font family = %s", ltext->priv->font_family); + + ltext->priv->size_changed = TRUE; + + gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. set font size method. */ +/*---------------------------------------------------------------------------*/ +static void +set_font_size (glLabelObject *object, + gdouble font_size) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + + if (ltext->priv->font_size != font_size) { + + ltext->priv->size_changed = TRUE; + + ltext->priv->font_size = font_size; + gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. set font weight method. */ +/*---------------------------------------------------------------------------*/ +static void +set_font_weight (glLabelObject *object, + PangoWeight font_weight) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + + if (ltext->priv->font_weight != font_weight) { + + ltext->priv->size_changed = TRUE; + + ltext->priv->font_weight = font_weight; + gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. set font italic flag method. */ +/*---------------------------------------------------------------------------*/ +static void +set_font_italic_flag (glLabelObject *object, + gboolean font_italic_flag) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + + if (ltext->priv->font_italic_flag != font_italic_flag) { + + ltext->priv->size_changed = TRUE; + + ltext->priv->font_italic_flag = font_italic_flag; + gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. set text alignment method. */ +/*---------------------------------------------------------------------------*/ +static void +set_text_alignment (glLabelObject *object, + PangoAlignment text_alignment) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + + if (ltext->priv->align != text_alignment) { + + ltext->priv->size_changed = TRUE; + + ltext->priv->align = text_alignment; + gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. set text line spacing method. */ +/*---------------------------------------------------------------------------*/ +static void +set_text_line_spacing (glLabelObject *object, + gdouble line_spacing) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + + if (ltext->priv->line_spacing != line_spacing) { + + ltext->priv->size_changed = TRUE; + + ltext->priv->line_spacing = line_spacing; + gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. set text color method. */ +/*---------------------------------------------------------------------------*/ +static void +set_text_color (glLabelObject *object, + glColorNode *text_color_node) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + + if (!gl_color_node_equal (ltext->priv->color_node, text_color_node)) { + + gl_color_node_free (&(ltext->priv->color_node)); + ltext->priv->color_node = gl_color_node_dup (text_color_node); + + gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. get font family method. */ +/*---------------------------------------------------------------------------*/ +static gchar * +get_font_family (glLabelObject *object) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), NULL); + + return g_strdup (ltext->priv->font_family); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. get font size method. */ +/*---------------------------------------------------------------------------*/ +static gdouble +get_font_size (glLabelObject *object) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0.0); + + return ltext->priv->font_size; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. get font weight method. */ +/*---------------------------------------------------------------------------*/ +static PangoWeight +get_font_weight (glLabelObject *object) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), PANGO_WEIGHT_NORMAL); + + return ltext->priv->font_weight; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. get font italic flag method. */ +/*---------------------------------------------------------------------------*/ +static gboolean +get_font_italic_flag (glLabelObject *object) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), FALSE); + + return ltext->priv->font_italic_flag; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. get text alignment method. */ +/*---------------------------------------------------------------------------*/ +static PangoAlignment +get_text_alignment (glLabelObject *object) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), GTK_JUSTIFY_LEFT); + + return ltext->priv->align; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. get text line spacing method. */ +/*---------------------------------------------------------------------------*/ +static gdouble +get_text_line_spacing (glLabelObject *object) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0.0); + + return ltext->priv->line_spacing; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. get text color method. */ +/*---------------------------------------------------------------------------*/ +static glColorNode* +get_text_color (glLabelObject *object) +{ + glLabelText *ltext = (glLabelText *)object; + + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0); + + return gl_color_node_dup (ltext->priv->color_node); +} + +/*****************************************************************************/ +/* Set auto shrink flag. */ +/*****************************************************************************/ +void +gl_label_text_set_auto_shrink (glLabelText *ltext, + gboolean auto_shrink) +{ + gl_debug (DEBUG_LABEL, "BEGIN"); + + g_return_if_fail (ltext && GL_IS_LABEL_TEXT (ltext)); + + if (ltext->priv->auto_shrink != auto_shrink) { + + ltext->priv->auto_shrink = auto_shrink; + gl_label_object_emit_changed (GL_LABEL_OBJECT(ltext)); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Query auto shrink flag. */ +/*****************************************************************************/ +gboolean +gl_label_text_get_auto_shrink (glLabelText *ltext) +{ + gl_debug (DEBUG_LABEL, ""); + + g_return_val_if_fail (ltext && GL_IS_LABEL_TEXT (ltext), 0); + + return ltext->priv->auto_shrink; +} + +/*****************************************************************************/ +/* Draw object method. */ +/*****************************************************************************/ +static void +draw_object (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + gdouble x0, y0; + cairo_matrix_t matrix; + gdouble object_w, object_h; + gdouble raw_w, raw_h; + gchar *text; + GList *lines; + gchar *font_family; + gdouble font_size; + PangoWeight font_weight; + gboolean font_italic_flag; + glColorNode *color_node; + gboolean auto_shrink; + guint color; + gdouble text_line_spacing; + PangoAlignment alignment; + PangoStyle style; + PangoLayout *layout; + PangoFontDescription *desc; + gdouble scale_x, scale_y; + cairo_font_options_t *font_options; + PangoContext *context; + + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_object_get_position (object, &x0, &y0); + gl_label_object_get_matrix (object, &matrix); + + gl_label_object_get_size (object, &object_w, &object_h); + gl_label_object_get_raw_size (object, &raw_w, &raw_h); + lines = gl_label_text_get_lines (GL_LABEL_TEXT (object)); + font_family = gl_label_object_get_font_family (object); + font_size = gl_label_object_get_font_size (object) * FONT_SCALE; + font_weight = gl_label_object_get_font_weight (object); + font_italic_flag = gl_label_object_get_font_italic_flag (object); + + color_node = gl_label_object_get_text_color (object); + color = gl_color_node_expand (color_node, record); + if (color_node->field_flag && screen_flag) + { + color = GL_COLOR_MERGE_DEFAULT; + } + gl_color_node_free (&color_node); + + alignment = gl_label_object_get_text_alignment (object); + text_line_spacing = + gl_label_object_get_text_line_spacing (object); + auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); + + text = gl_text_node_lines_expand (lines, record); + + style = font_italic_flag ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL; + + + if (!screen_flag && record && auto_shrink && (raw_w != 0.0)) + { + font_size = auto_shrink_font_size (cr, + font_family, + font_size, + font_weight, + style, + text, + object_w); + g_print ("Autosize new size = %g\n", font_size); + } + + + /* + * Workaround for pango Bug#341481. + * Render font at device scale and scale font size accordingly. + */ + scale_x = 1.0; + scale_y = 1.0; + cairo_device_to_user_distance (cr, &scale_x, &scale_y); + scale_x = fabs (scale_x); + scale_y = fabs (scale_y); + cairo_save (cr); + cairo_scale (cr, scale_x, scale_y); + + layout = pango_cairo_create_layout (cr); + + font_options = cairo_font_options_create (); + cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); + context = pango_layout_get_context (layout); + pango_cairo_context_set_font_options (context, font_options); + cairo_font_options_destroy (font_options); + + desc = pango_font_description_new (); + pango_font_description_set_family (desc, font_family); + pango_font_description_set_weight (desc, font_weight); + pango_font_description_set_style (desc, style); + pango_font_description_set_size (desc, font_size * PANGO_SCALE / scale_x); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_text (layout, text, -1); + pango_layout_set_spacing (layout, font_size * (text_line_spacing-1) * PANGO_SCALE / scale_x); + if (raw_w == 0.0) + { + pango_layout_set_width (layout, -1); + } + else + { + pango_layout_set_width (layout, object_w * PANGO_SCALE / scale_x); + } + pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); + pango_layout_set_alignment (layout, alignment); + + + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (color)); + cairo_move_to (cr, GL_LABEL_TEXT_MARGIN/scale_x, 0); + pango_cairo_show_layout (cr, layout); + + cairo_restore (cr); + + g_object_unref (layout); + + + gl_text_node_lines_free (&lines); + g_free (font_family); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Draw shadow method. */ +/*****************************************************************************/ +static void +draw_shadow (glLabelObject *object, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + gdouble x0, y0; + cairo_matrix_t matrix; + gdouble object_w, object_h; + gdouble raw_w, raw_h; + gchar *text; + GList *lines; + gchar *font_family; + gdouble font_size; + PangoWeight font_weight; + gboolean font_italic_flag; + gboolean auto_shrink; + guint color; + glColorNode *color_node; + gdouble text_line_spacing; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + guint shadow_color; + PangoAlignment alignment; + PangoStyle style; + PangoLayout *layout; + PangoFontDescription *desc; + gdouble scale_x, scale_y; + cairo_font_options_t *font_options; + PangoContext *context; + + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_object_get_position (object, &x0, &y0); + gl_label_object_get_matrix (object, &matrix); + + gl_label_object_get_size (object, &object_w, &object_h); + gl_label_object_get_raw_size (object, &raw_w, &raw_h); + lines = gl_label_text_get_lines (GL_LABEL_TEXT (object)); + font_family = gl_label_object_get_font_family (object); + font_size = gl_label_object_get_font_size (object) * FONT_SCALE; + font_weight = gl_label_object_get_font_weight (object); + font_italic_flag = gl_label_object_get_font_italic_flag (object); + + color_node = gl_label_object_get_text_color (object); + color = gl_color_node_expand (color_node, record); + gl_color_node_free (&color_node); + + alignment = gl_label_object_get_text_alignment (object); + text_line_spacing = + gl_label_object_get_text_line_spacing (object); + auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); + + shadow_color_node = gl_label_object_get_shadow_color (object); + if (shadow_color_node->field_flag) + { + shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT; + } + shadow_opacity = gl_label_object_get_shadow_opacity (object); + shadow_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, color); + gl_color_node_free (&shadow_color_node); + + text = gl_text_node_lines_expand (lines, record); + + style = font_italic_flag ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL; + + + if (!screen_flag && record && auto_shrink && (raw_w != 0.0)) + { + font_size = auto_shrink_font_size (cr, + font_family, + font_size, + font_weight, + style, + text, + object_w); + } + + + /* + * Workaround for pango Bug#341481. + * Render font at device scale and scale font size accordingly. + */ + scale_x = 1.0; + scale_y = 1.0; + cairo_device_to_user_distance (cr, &scale_x, &scale_y); + scale_x = fabs (scale_x); + scale_y = fabs (scale_y); + cairo_save (cr); + cairo_scale (cr, scale_x, scale_y); + + layout = pango_cairo_create_layout (cr); + + font_options = cairo_font_options_create (); + cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); + context = pango_layout_get_context (layout); + pango_cairo_context_set_font_options (context, font_options); + cairo_font_options_destroy (font_options); + + desc = pango_font_description_new (); + pango_font_description_set_family (desc, font_family); + pango_font_description_set_weight (desc, font_weight); + pango_font_description_set_style (desc, style); + pango_font_description_set_size (desc, font_size * PANGO_SCALE / scale_x); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_text (layout, text, -1); + pango_layout_set_spacing (layout, font_size * (text_line_spacing-1) * PANGO_SCALE / scale_x); + if (raw_w == 0.0) + { + pango_layout_set_width (layout, -1); + } + else + { + pango_layout_set_width (layout, object_w * PANGO_SCALE / scale_x); + } + pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); + pango_layout_set_alignment (layout, alignment); + + cairo_set_source_rgba (cr, GL_COLOR_RGBA_ARGS (shadow_color)); + cairo_move_to (cr, GL_LABEL_TEXT_MARGIN/scale_x, 0); + pango_cairo_show_layout (cr, layout); + + + cairo_restore (cr); + + g_object_unref (layout); + + gl_text_node_lines_free (&lines); + g_free (font_family); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Automatically shrink text size to fit within horizontal width. */ +/*****************************************************************************/ +static gdouble +auto_shrink_font_size (cairo_t *cr, + gchar *family, + gdouble size, + PangoWeight weight, + PangoStyle style, + gchar *text, + gdouble width) +{ + PangoLayout *layout; + PangoFontDescription *desc; + gint iw, ih; + gdouble layout_width; + gdouble new_size; + + layout = pango_cairo_create_layout (cr); + + desc = pango_font_description_new (); + pango_font_description_set_family (desc, family); + pango_font_description_set_weight (desc, weight); + pango_font_description_set_style (desc, style); + pango_font_description_set_size (desc, size * PANGO_SCALE); + + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_text (layout, text, -1); + pango_layout_set_width (layout, -1); + pango_layout_get_size (layout, &iw, &ih); + layout_width = (gdouble)iw / (gdouble)PANGO_SCALE; + + g_object_unref (layout); + + g_print ("Object w = %g, layout w = %g\n", width, layout_width); + + if ( layout_width > width ) + { + /* Scale down. */ + new_size = size * (width-2*GL_LABEL_TEXT_MARGIN)/layout_width; + + /* Round down to nearest 1/2 point */ + new_size = (int)(new_size*2.0) / 2.0; + + /* don't get ridiculously small. */ + if (new_size < 1.0) + { + new_size = 1.0; + } + } + else + { + new_size = size; + } + + return new_size; +} + diff --git a/src/label-text.h b/src/label-text.h new file mode 100644 index 00000000..95c46230 --- /dev/null +++ b/src/label-text.h @@ -0,0 +1,74 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label_text.h: GLabels label text object + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LABEL_TEXT_H__ +#define __LABEL_TEXT_H__ + +#include +#include "text-node.h" +#include "label-object.h" + +G_BEGIN_DECLS + +#define GL_LABEL_TEXT_MARGIN 3.0 + + +#define GL_TYPE_LABEL_TEXT (gl_label_text_get_type ()) +#define GL_LABEL_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_TEXT, glLabelText)) +#define GL_LABEL_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_TEXT, glLabelTextClass)) +#define GL_IS_LABEL_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_TEXT)) +#define GL_IS_LABEL_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_TEXT)) + +typedef struct _glLabelText glLabelText; +typedef struct _glLabelTextClass glLabelTextClass; + +typedef struct _glLabelTextPrivate glLabelTextPrivate; + +struct _glLabelText { + glLabelObject object; + + glLabelTextPrivate *priv; +}; + +struct _glLabelTextClass { + glLabelObjectClass parent_class; +}; + +GType gl_label_text_get_type (void) G_GNUC_CONST; + +GObject *gl_label_text_new (glLabel *label); + +void gl_label_text_set_lines (glLabelText *ltext, + GList *lines); +GtkTextBuffer *gl_label_text_get_buffer (glLabelText *ltext); +GList *gl_label_text_get_lines (glLabelText *ltext); + +void gl_label_text_set_auto_shrink (glLabelText *ltext, + gboolean auto_shrink); +gboolean gl_label_text_get_auto_shrink (glLabelText *ltext); + + +G_END_DECLS + +#endif /* __LABEL_TEXT_H__ */ diff --git a/src/label.c b/src/label.c new file mode 100644 index 00000000..c886529b --- /dev/null +++ b/src/label.c @@ -0,0 +1,674 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label.c: GLabels label module + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "label.h" + +#include + +#include "marshal.h" +#include "prefs.h" +#include "util.h" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glLabelPrivate { + + gchar *filename; + gint compression; + gboolean modified_flag; + gint untitled_instance; + + glMerge *merge; + + GHashTable *pixbuf_cache; +}; + +enum { + CHANGED, + NAME_CHANGED, + MODIFIED_CHANGED, + MERGE_CHANGED, + SIZE_CHANGED, + OBJECT_ADDED, + LAST_SIGNAL +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +static guint signals[LAST_SIGNAL] = {0}; + +static guint untitled = 0; + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_label_finalize (GObject *object); + +static void object_changed_cb (glLabelObject *object, + glLabel *label); + +static void object_moved_cb (glLabelObject *object, + gdouble x, + gdouble y, + glLabel *label); + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glLabel, gl_label, G_TYPE_OBJECT); + +static void +gl_label_class_init (glLabelClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_LABEL, "START"); + + gl_label_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_label_finalize; + + signals[CHANGED] = + g_signal_new ("changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelClass, changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + signals[NAME_CHANGED] = + g_signal_new ("name_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelClass, name_changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + signals[MODIFIED_CHANGED] = + g_signal_new ("modified_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelClass, modified_changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + signals[MERGE_CHANGED] = + g_signal_new ("merge_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelClass, merge_changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + signals[SIZE_CHANGED] = + g_signal_new ("size_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelClass, size_changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + signals[OBJECT_ADDED] = + g_signal_new ("object_added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glLabelClass, object_added), + NULL, NULL, + gl_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, G_TYPE_OBJECT); + + gl_debug (DEBUG_LABEL, "END"); +} + +static void +gl_label_init (glLabel *label) +{ + gl_debug (DEBUG_LABEL, "START"); + + label->template = NULL; + label->rotate_flag = FALSE; + label->objects = NULL; + + label->priv = g_new0 (glLabelPrivate, 1); + + label->priv->filename = NULL; + label->priv->merge = NULL; + label->priv->pixbuf_cache = gl_pixbuf_cache_new (); + + gl_debug (DEBUG_LABEL, "END"); +} + +static void +gl_label_finalize (GObject *object) +{ + glLabel *label = GL_LABEL (object); + GList *p, *p_next; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (object && GL_IS_LABEL (object)); + + for (p = label->objects; p != NULL; p = p_next) { + p_next = p->next; /* NOTE: p will be left dangling */ + g_object_unref (G_OBJECT(p->data)); + } + + lgl_template_free (label->template); + g_free (label->priv->filename); + if (label->priv->merge != NULL) { + g_object_unref (G_OBJECT(label->priv->merge)); + } + gl_pixbuf_cache_free (label->priv->pixbuf_cache); + + g_free (label->priv); + + G_OBJECT_CLASS (gl_label_parent_class)->finalize (object); + + gl_debug (DEBUG_LABEL, "END"); +} + +GObject * +gl_label_new (void) +{ + glLabel *label; + + gl_debug (DEBUG_LABEL, "START"); + + label = g_object_new (gl_label_get_type(), NULL); + + label->priv->compression = 9; + + label->priv->modified_flag = FALSE; + + gl_debug (DEBUG_LABEL, "END"); + + return G_OBJECT (label); +} + + +/*****************************************************************************/ +/* Add object to label. */ +/*****************************************************************************/ +void +gl_label_add_object (glLabel *label, + glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (label && GL_IS_LABEL (label)); + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + object->parent = label; + label->objects = g_list_append (label->objects, g_object_ref (object)); + + label->priv->modified_flag = TRUE; + + g_signal_emit (G_OBJECT(label), signals[OBJECT_ADDED], 0, object); + g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); + g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); + + g_signal_connect (G_OBJECT(object), "changed", + G_CALLBACK(object_changed_cb), label); + + g_signal_connect (G_OBJECT(object), "moved", + G_CALLBACK(object_moved_cb), label); + + gl_debug (DEBUG_LABEL, "END"); +} + +/*****************************************************************************/ +/* Remove object from label. */ +/*****************************************************************************/ +void +gl_label_remove_object (glLabel *label, + glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (label && GL_IS_LABEL (label)); + g_return_if_fail (GL_IS_LABEL_OBJECT (object)); + + object->parent = NULL; + label->objects = g_list_remove (label->objects, object); + + if ( G_OBJECT(label)->ref_count /* not finalized */ ) { + + g_signal_handlers_disconnect_by_func (object, + G_CALLBACK(object_changed_cb), + label); + g_signal_handlers_disconnect_by_func (object, + G_CALLBACK(object_moved_cb), + label); + + label->priv->modified_flag = TRUE; + + g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); + g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Object changed callback. */ +/*---------------------------------------------------------------------------*/ +static void +object_changed_cb (glLabelObject *object, + glLabel *label) +{ + + if ( !label->priv->modified_flag ) { + + label->priv->modified_flag = TRUE; + + g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); + } + + g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Object moved callback. */ +/*---------------------------------------------------------------------------*/ +static void +object_moved_cb (glLabelObject *object, + gdouble x, + gdouble y, + glLabel *label) +{ + + if ( !label->priv->modified_flag ) { + + label->priv->modified_flag = TRUE; + + g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); + } + + g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); +} + +/****************************************************************************/ +/* Bring label object to front/top. */ +/****************************************************************************/ +void +gl_label_raise_object_to_top (glLabel *label, + glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, "START"); + + /* Move to end of list, representing front most object */ + label->objects = g_list_remove (label->objects, object); + label->objects = g_list_append (label->objects, object); + + label->priv->modified_flag = TRUE; + + g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); + g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Send label object to rear/bottom. */ +/****************************************************************************/ +void +gl_label_lower_object_to_bottom (glLabel *label, + glLabelObject *object) +{ + gl_debug (DEBUG_LABEL, "START"); + + /* Move to front of list, representing rear most object */ + label->objects = g_list_remove (label->objects, object); + label->objects = g_list_prepend (label->objects, object); + + label->priv->modified_flag = TRUE; + + g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); + g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* set template. */ +/****************************************************************************/ +extern void +gl_label_set_template (glLabel *label, + lglTemplate *template) +{ + gchar *name; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (label && GL_IS_LABEL (label)); + g_return_if_fail (template); + + if ((label->template == NULL) || + !lgl_template_do_templates_match (template, label->template)) { + + lgl_template_free (label->template); + label->template = lgl_template_dup (template); + + label->priv->modified_flag = TRUE; + + g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); + g_signal_emit (G_OBJECT(label), signals[SIZE_CHANGED], 0); + g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); + + name = lgl_template_get_name (template); + gl_prefs_add_recent_template (name); + g_free (name); + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* set rotate flag. */ +/****************************************************************************/ +extern void +gl_label_set_rotate_flag (glLabel *label, + gboolean rotate_flag) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (label && GL_IS_LABEL (label)); + + if (rotate_flag != label->rotate_flag) { + + label->rotate_flag = rotate_flag; + + label->priv->modified_flag = TRUE; + + g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); + g_signal_emit (G_OBJECT(label), signals[SIZE_CHANGED], 0); + g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); + + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Get label size. */ +/****************************************************************************/ +void +gl_label_get_size (glLabel *label, + gdouble *w, + gdouble *h) +{ + lglTemplate *template; + const lglTemplateFrame *frame; + + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (label && GL_IS_LABEL (label)); + + template = label->template; + if ( !template ) { + gl_debug (DEBUG_LABEL, "END -- template NULL"); + *w = *h = 0; + return; + } + frame = (lglTemplateFrame *)template->frames->data; + + if (!label->rotate_flag) { + lgl_template_frame_get_size (frame, w, h); + } else { + lgl_template_frame_get_size (frame, h, w); + } + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* set merge information structure. */ +/****************************************************************************/ +extern void +gl_label_set_merge (glLabel *label, + glMerge *merge) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_if_fail (label && GL_IS_LABEL (label)); + + if ( label->priv->merge != NULL ) { + g_object_unref (G_OBJECT(label->priv->merge)); + } + label->priv->merge = gl_merge_dup (merge); + + label->priv->modified_flag = TRUE; + + g_signal_emit (G_OBJECT(label), signals[MERGE_CHANGED], 0); + g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); + g_signal_emit (G_OBJECT(label), signals[CHANGED], 0); + + gl_debug (DEBUG_LABEL, "END"); +} + +/****************************************************************************/ +/* Get merge information structure. */ +/****************************************************************************/ +glMerge * +gl_label_get_merge (glLabel *label) +{ + gl_debug (DEBUG_LABEL, "START"); + + g_return_val_if_fail (label && GL_IS_LABEL (label), NULL); + + gl_debug (DEBUG_LABEL, "END"); + + return gl_merge_dup (label->priv->merge); +} + +/****************************************************************************/ +/* return filename. */ +/****************************************************************************/ +gchar * +gl_label_get_filename (glLabel *label) +{ + gl_debug (DEBUG_LABEL, ""); + + return g_strdup ( label->priv->filename ); +} + +/****************************************************************************/ +/* return short filename. */ +/****************************************************************************/ +gchar * +gl_label_get_short_name (glLabel *label) +{ + gl_debug (DEBUG_LABEL, ""); + + if ( label->priv->filename == NULL ) { + + if ( label->priv->untitled_instance == 0 ) { + label->priv->untitled_instance = ++untitled; + } + + return g_strdup_printf ( "%s %d", _("Untitled"), + label->priv->untitled_instance ); + + } else { + gchar *temp_name, *short_name; + + temp_name = g_path_get_basename ( label->priv->filename ); + short_name = gl_util_remove_extension (temp_name); + g_free (temp_name); + + return short_name; + } +} + +/****************************************************************************/ +/* Get pixbuf cache. */ +/****************************************************************************/ +GHashTable * +gl_label_get_pixbuf_cache (glLabel *label) +{ + return label->priv->pixbuf_cache; +} + +/****************************************************************************/ +/* Is label modified? */ +/****************************************************************************/ +gboolean +gl_label_is_modified (glLabel *label) +{ + gl_debug (DEBUG_LABEL, "return %d", label->priv->modified_flag); + return label->priv->modified_flag; +} + +/****************************************************************************/ +/* Is label untitled? */ +/****************************************************************************/ +gboolean +gl_label_is_untitled (glLabel *label) +{ + gl_debug (DEBUG_LABEL, "return %d",(label->priv->filename == NULL)); + return (label->priv->filename == NULL); +} + +/****************************************************************************/ +/* Can undo? */ +/****************************************************************************/ +gboolean +gl_label_can_undo (glLabel *label) +{ + return FALSE; +} + + +/****************************************************************************/ +/* Can redo? */ +/****************************************************************************/ +gboolean +gl_label_can_redo (glLabel *label) +{ + return FALSE; +} + + +/****************************************************************************/ +/* Set filename. */ +/****************************************************************************/ +void +gl_label_set_filename (glLabel *label, + const gchar *filename) +{ + label->priv->filename = g_strdup (filename); + + g_signal_emit (G_OBJECT(label), signals[NAME_CHANGED], 0); +} + +/****************************************************************************/ +/* Clear modified flag. */ +/****************************************************************************/ +void +gl_label_clear_modified (glLabel *label) +{ + + if ( label->priv->modified_flag ) { + + label->priv->modified_flag = FALSE; + + g_signal_emit (G_OBJECT(label), signals[MODIFIED_CHANGED], 0); + } + +} + + +/****************************************************************************/ +/* Set compression level. */ +/****************************************************************************/ +void +gl_label_set_compression (glLabel *label, + gint compression) +{ + gl_debug (DEBUG_LABEL, "set %d", compression); + + /* Older versions of libxml2 always return a -1 for documents "read in," so + * default to 9. Also, default to 9 for anything else out of range. */ + if ((compression < 0) || (compression >9)) { + compression = 9; + } + + gl_debug (DEBUG_LABEL, "actual set %d", compression); + label->priv->compression = compression; +} + + +/****************************************************************************/ +/* Get compression level. */ +/****************************************************************************/ +gint +gl_label_get_compression (glLabel *label) +{ + gl_debug (DEBUG_LABEL, "return %d", label->priv->compression); + return label->priv->compression; +} + + +/****************************************************************************/ +/* Draw label. */ +/****************************************************************************/ +void +gl_label_draw (glLabel *label, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record) +{ + GList *p_obj; + glLabelObject *object; + + g_return_if_fail (label && GL_IS_LABEL (label)); + + for (p_obj = label->objects; p_obj != NULL; p_obj = p_obj->next) + { + object = GL_LABEL_OBJECT (p_obj->data); + + gl_label_object_draw (object, cr, screen_flag, record); + } +} diff --git a/src/label.h b/src/label.h new file mode 100644 index 00000000..f6e0c23b --- /dev/null +++ b/src/label.h @@ -0,0 +1,154 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label.h: GLabels label module header file + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __LABEL_H__ +#define __LABEL_H__ + +#include + +#include +#include "merge.h" +#include "pixbuf-cache.h" +#include + +G_BEGIN_DECLS + +typedef struct { + gdouble x1; + gdouble y1; + gdouble x2; + gdouble y2; +} glLabelRegion; + +#define GL_TYPE_LABEL (gl_label_get_type ()) +#define GL_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL, glLabel)) +#define GL_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL, glLabelClass)) +#define GL_IS_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL)) +#define GL_IS_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL)) + +typedef struct _glLabel glLabel; +typedef struct _glLabelClass glLabelClass; + +typedef struct _glLabelPrivate glLabelPrivate; + +#include "label-object.h" +struct _glLabel { + GObject object; + + lglTemplate *template; + gboolean rotate_flag; + + GList *objects; + + glLabelPrivate *priv; +}; + +struct _glLabelClass { + GObjectClass parent_class; + + void (*changed) (glLabel *label, gpointer user_data); + + void (*name_changed) (glLabel *label, gpointer user_data); + + void (*modified_changed) (glLabel *label, gpointer user_data); + + void (*merge_changed) (glLabel *label, gpointer user_data); + + void (*size_changed) (glLabel *label, gpointer user_data); + + void (*object_added) (glLabel *label, + glLabelObject *object, + gpointer user_data); + +}; + + +GType gl_label_get_type (void) G_GNUC_CONST; + +GObject *gl_label_new (void); + + +void gl_label_add_object (glLabel *label, + glLabelObject *object); + +void gl_label_remove_object (glLabel *label, + glLabelObject *object); + +void gl_label_raise_object_to_top (glLabel *label, + glLabelObject *object); + +void gl_label_lower_object_to_bottom (glLabel *label, + glLabelObject *object); + + +void gl_label_set_template (glLabel *label, + lglTemplate *template); + +void gl_label_set_rotate_flag (glLabel *label, + gboolean rotate_flag); + +void gl_label_get_size (glLabel *label, + gdouble *w, + gdouble *h); + + +void gl_label_set_merge (glLabel *label, + glMerge *merge); + +glMerge *gl_label_get_merge (glLabel *label); + + +gchar *gl_label_get_filename (glLabel *label); + +gchar *gl_label_get_short_name (glLabel *label); + +GHashTable *gl_label_get_pixbuf_cache (glLabel *label); + +gboolean gl_label_is_modified (glLabel *label); + +gboolean gl_label_is_untitled (glLabel *label); + +gboolean gl_label_can_undo (glLabel *label); + +gboolean gl_label_can_redo (glLabel *label); + + +void gl_label_set_filename (glLabel *label, + const gchar *filename); + +void gl_label_clear_modified (glLabel *label); + +void gl_label_set_compression (glLabel *label, + gint compression); + +gint gl_label_get_compression (glLabel *label); + +void gl_label_draw (glLabel *label, + cairo_t *cr, + gboolean screen_flag, + glMergeRecord *record); + +G_END_DECLS + + +#endif /* __LABEL_H__ */ diff --git a/src/marshal.list b/src/marshal.list new file mode 100644 index 00000000..ea17eaf3 --- /dev/null +++ b/src/marshal.list @@ -0,0 +1,7 @@ +VOID:VOID +VOID:INT +VOID:INT,INT +VOID:INT,UINT +VOID:DOUBLE +VOID:DOUBLE,DOUBLE +VOID:OBJECT diff --git a/src/merge-evolution.c b/src/merge-evolution.c new file mode 100644 index 00000000..bf99e1bb --- /dev/null +++ b/src/merge-evolution.c @@ -0,0 +1,546 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge_evolution.c: evolution merge backend module + * + * Copyright (C) 2001 Jim Evins . + * and + * Copyright (C) 2005 Austin Henry + * and + * Copyright (C) 2007 Peter Cherriman + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#ifdef HAVE_LIBEBOOK + + +#include "merge-evolution.h" + +#include +#include +#include +#include +#include + +#include "debug.h" + +#define DEFAULT_QUERY "(exists \"full_name\")" + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +struct _glMergeEvolutionPrivate { + gchar *query; + EBook *book; + GList *contacts; + GList *fields; /* the fields supported by the addressbook */ +}; + +enum { + LAST_SIGNAL +}; + +enum { + ARG_0, + ARG_QUERY, +}; + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_merge_evolution_finalize (GObject *object); + +static void gl_merge_evolution_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec); + +static void gl_merge_evolution_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec); + +static GList *gl_merge_evolution_get_key_list (glMerge *merge); +static gchar *gl_merge_evolution_get_primary_key (glMerge *merge); +static void gl_merge_evolution_open (glMerge *merge); +static void gl_merge_evolution_close (glMerge *merge); +static glMergeRecord *gl_merge_evolution_get_record (glMerge *merge); +static void gl_merge_evolution_copy (glMerge *dst_merge, + glMerge *src_merge); + +/* utility function prototypes go here */ +static void free_field_list (GList *fields); + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glMergeEvolution, gl_merge_evolution, GL_TYPE_MERGE); + +static void +gl_merge_evolution_class_init (glMergeEvolutionClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glMergeClass *merge_class = GL_MERGE_CLASS (class); + + gl_debug (DEBUG_MERGE, "START"); + + gl_merge_evolution_parent_class = g_type_class_peek_parent (class); + + object_class->set_property = gl_merge_evolution_set_property; + object_class->get_property = gl_merge_evolution_get_property; + + g_object_class_install_property + (object_class, + ARG_QUERY, + g_param_spec_string ("query", NULL, + "Query used to select records from the addressbook", + "(exists \"full_name\")", + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + + object_class->finalize = gl_merge_evolution_finalize; + + merge_class->get_key_list = gl_merge_evolution_get_key_list; + merge_class->get_primary_key = gl_merge_evolution_get_primary_key; + merge_class->open = gl_merge_evolution_open; + merge_class->close = gl_merge_evolution_close; + merge_class->get_record = gl_merge_evolution_get_record; + merge_class->copy = gl_merge_evolution_copy; + + gl_debug (DEBUG_MERGE, "END"); +} + +static void +gl_merge_evolution_init (glMergeEvolution *merge_evolution) +{ + gl_debug (DEBUG_MERGE, "START"); + + merge_evolution->priv = g_new0 (glMergeEvolutionPrivate, 1); + merge_evolution->priv->query = g_strdup(DEFAULT_QUERY); + + gl_debug (DEBUG_MERGE, "END"); +} + +static void +gl_merge_evolution_finalize (GObject *object) +{ + glMergeEvolution *merge_evolution = GL_MERGE_EVOLUTION (object); + + gl_debug (DEBUG_MERGE, "START"); + + g_return_if_fail (object && GL_IS_MERGE_EVOLUTION (object)); + + free_field_list(merge_evolution->priv->fields); + g_free (merge_evolution->priv->query); + g_free (merge_evolution->priv); + + G_OBJECT_CLASS (gl_merge_evolution_parent_class)->finalize (object); + + gl_debug (DEBUG_MERGE, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* Set argument. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_evolution_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec) +{ + glMergeEvolution *merge_evolution; + + merge_evolution = GL_MERGE_EVOLUTION (object); + + switch (param_id) { + + case ARG_QUERY: + g_free (merge_evolution->priv->query); + merge_evolution->priv->query = g_value_dup_string (value); + gl_debug (DEBUG_MERGE, "ARG \"query\" = \"%s\"", + merge_evolution->priv->query); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); + break; + + } + +} + +/*--------------------------------------------------------------------------*/ +/* Get argument. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_evolution_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec) +{ + glMergeEvolution *merge_evolution; + + merge_evolution = GL_MERGE_EVOLUTION (object); + + switch (param_id) { + + case ARG_QUERY: + g_value_set_string (value, merge_evolution->priv->query); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); + break; + + } + +} + +/*--------------------------------------------------------------------------*/ +/* Get key list. */ +/*--------------------------------------------------------------------------*/ +static GList * +gl_merge_evolution_get_key_list (glMerge *merge) +{ + glMergeEvolution *merge_evolution; + GList *key_list = NULL; + GList *iter; + + gl_debug (DEBUG_MERGE, "BEGIN"); + + merge_evolution = GL_MERGE_EVOLUTION (merge); + + /* for the previously retrieved supported fileds, go through them and find + * their pretty names */ + for (iter = merge_evolution->priv->fields; + iter != NULL; + iter = g_list_next(iter)) + { + key_list = g_list_prepend (key_list, + g_strdup (e_contact_pretty_name (*(EContactField *)iter->data))); + } + + key_list = g_list_reverse (key_list); + + gl_debug (DEBUG_MERGE, "END"); + + return key_list; +} + +/*--------------------------------------------------------------------------*/ +/* Get "primary" key. */ +/*--------------------------------------------------------------------------*/ +static gchar * +gl_merge_evolution_get_primary_key (glMerge *merge) +{ + return g_strdup (e_contact_pretty_name(E_CONTACT_FILE_AS)); +} + +/* Sort compare function for sorting contacts by file-as element + * by Peter Cherriman (PJC) + * called by GList* g_list_sort(GList *list, sort_contact_by_file_as); + */ +static gint sort_contact_by_file_as(gconstpointer *a, gconstpointer *b) +{ + /* + * Returns : negative value if a < b; zero if a = b; positive value if a > b + */ + + // Check and cast a and b to EContact + EContact *contact_a = E_CONTACT(a); + EContact *contact_b = E_CONTACT(b); + + // Extract file_as for each contact and compare... + gchar *a_file_as = e_contact_get (contact_a, E_CONTACT_FILE_AS); + gchar *b_file_as = e_contact_get (contact_b, E_CONTACT_FILE_AS); + gint res = lgl_str_utf8_casecmp(a_file_as, b_file_as); + + gl_debug(DEBUG_MERGE, "Sort comparing contacts '%s' and '%s' = %d", a_file_as, b_file_as, res); + + // free file_as strings created earlier.... + g_free (a_file_as); + g_free (b_file_as); + + return res; +} + +/*--------------------------------------------------------------------------*/ +/* Open merge source. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_evolution_open (glMerge *merge) +{ + glMergeEvolution *merge_evolution; + EBookQuery *query; + gboolean status; + GList *fields, *iter; + EContactField *field_id; + GError *error = NULL; + + gl_debug (DEBUG_MERGE, "BEGIN"); + + merge_evolution = GL_MERGE_EVOLUTION (merge); + + query = e_book_query_from_string(merge_evolution->priv->query); + if (!query) { + g_warning (_("Couldn't construct query")); + return; + } + + merge_evolution->priv->book = e_book_new_system_addressbook(&error); + if (!merge_evolution->priv->book) { + g_warning (_("Couldn't open addressbook.")); + if (error) + { + g_warning ("e_book_new_system_addressbook: %s", error->message); + g_error_free (error); + } + e_book_query_unref(query); + return; + } + + if (!e_book_open(merge_evolution->priv->book, FALSE, &error)) { + g_warning (_("Couldn't open addressbook.")); + if (error) + { + g_warning ("e_book_open: %s", error->message); + g_error_free (error); + } + e_book_query_unref(query); + g_object_unref(merge_evolution->priv->book); + merge_evolution->priv->book = NULL; + return; + } + + /* fetch the list of fields supported by this address book */ + status = e_book_get_supported_fields(merge_evolution->priv->book, &fields, &error); + if (status == FALSE) { + g_warning (_("Couldn't list available fields.")); + if (error) + { + g_warning ("e_book_get_supported_fields: %s", error->message); + g_error_free (error); + } + e_book_query_unref(query); + g_object_unref(merge_evolution->priv->book); + merge_evolution->priv->book = NULL; + return; + } + + /* generate a list of field_ids, and put that into private->fields */ + for (iter = fields; iter != NULL; iter = g_list_next(iter)) { + field_id = g_new(EContactField, 1); + *field_id = e_contact_field_id(iter->data); + + /* above this value, the data aren't strings anymore */ + if (*field_id >= E_CONTACT_LAST_SIMPLE_STRING) { + g_free (field_id); + continue; + } + + merge_evolution->priv->fields = + g_list_prepend(merge_evolution->priv->fields, field_id); + } + free_field_list(fields); /* don't need the list of names anymore */ + + gl_debug(DEBUG_MERGE, "Field list length: %d", g_list_length(merge_evolution->priv->fields)); + + /* finally retrieve the contacts */ + status = e_book_get_contacts (merge_evolution->priv->book, + query, + &merge_evolution->priv->contacts, + &error); + if (status == FALSE) { + g_warning (_("Couldn't get contacts.")); + if (error) + { + g_warning ("e_book_get_contacts: %s", error->message); + g_error_free (error); + } + e_book_query_unref(query); + free_field_list(merge_evolution->priv->fields); + g_object_unref(merge_evolution->priv->book); + merge_evolution->priv->book = NULL; + + return; + } + + e_book_query_unref(query); + + /* Sort contacts using file-as element.... + * by Peter Cherriman (PJC) + */ + gl_debug (DEBUG_MERGE, "Starting sort"); + merge_evolution->priv->contacts = g_list_sort(merge_evolution->priv->contacts, (GCompareFunc)sort_contact_by_file_as); + gl_debug (DEBUG_MERGE, "Ended sort"); + + gl_debug (DEBUG_MERGE, "END"); + + return; +} + +/*--------------------------------------------------------------------------*/ +/* Close merge source. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_evolution_close (glMerge *merge) +{ + glMergeEvolution *merge_evolution; + GList *iter; + + merge_evolution = GL_MERGE_EVOLUTION (merge); + + /* unref all of the objects created in _open */ + g_object_unref(merge_evolution->priv->book); + merge_evolution->priv->book = NULL; + + for (iter = merge_evolution->priv->contacts; + iter != NULL; + iter = g_list_next(iter)) + { + EContact *contact = E_CONTACT (iter->data); + + g_object_unref(contact); + } + g_list_free(merge_evolution->priv->contacts); + merge_evolution->priv->contacts = NULL; +} + +/*--------------------------------------------------------------------------*/ +/* Get next record from merge source, NULL if no records left (i.e EOF) */ +/*--------------------------------------------------------------------------*/ +static glMergeRecord * +gl_merge_evolution_get_record (glMerge *merge) +{ + glMergeEvolution *merge_evolution; + glMergeRecord *record; + glMergeField *field; + EContactField field_id; + + GList *head, *iter; + EContact *contact; + + merge_evolution = GL_MERGE_EVOLUTION (merge); + + head = merge_evolution->priv->contacts; + if (head == NULL) { + return NULL; /* past the last record */ + } + contact = E_CONTACT(head->data); + + record = g_new0 (glMergeRecord, 1); + record->select_flag = TRUE; + + /* Take the interesting fields one by one from the contact, and put them + * into the glMergeRecord structure. When done, free up the resources for + * that contact */ + + /* iterate through the supported fields, and add them to the list */ + for (iter = merge_evolution->priv->fields; + iter != NULL; + iter = g_list_next(iter)) + { + gchar *value; + field_id = *(EContactField *)iter->data; + value = g_strdup (e_contact_get_const (contact, field_id)); + + if (value) { + field = g_new0 (glMergeField, 1); + field->key = g_strdup (e_contact_pretty_name (field_id)); + field->value = value; + record->field_list = g_list_prepend (record->field_list, field); + } + } + + record->field_list = g_list_reverse (record->field_list); + + /* do a destructive read */ + g_object_unref (contact); + merge_evolution->priv->contacts = + g_list_remove_link (merge_evolution->priv->contacts, head); + g_list_free_1 (head); + + return record; +} + +/*---------------------------------------------------------------------------*/ +/* Copy merge_evolution specific fields. */ +/*---------------------------------------------------------------------------*/ +static void +gl_merge_evolution_copy (glMerge *dst_merge, + glMerge *src_merge) +{ + GList *src_iter, *dst_iter; + + gl_debug (DEBUG_MERGE, "BEGIN"); + + glMergeEvolution *dst_merge_evolution; + glMergeEvolution *src_merge_evolution; + + dst_merge_evolution = GL_MERGE_EVOLUTION (dst_merge); + src_merge_evolution = GL_MERGE_EVOLUTION (src_merge); + + dst_merge_evolution->priv->query = g_strdup(src_merge_evolution->priv->query); + + dst_merge_evolution->priv->fields = g_list_copy(src_merge_evolution->priv->fields); + for (src_iter = src_merge_evolution->priv->fields, + dst_iter = dst_merge_evolution->priv->fields; + src_iter != NULL && dst_iter != NULL; + src_iter = g_list_next(src_iter), dst_iter = g_list_next(dst_iter)) + { + dst_iter->data = g_new(EContactField, 1); + if (src_iter->data) { /* this better not be null, but... */ + memcpy(dst_iter->data, src_iter->data, sizeof(EContactField)); + } + } + + /* I don't know that there's a good way to do a deep copy of the various + * libebook structures/objects, so I'm just going to leave them out. They + * are all regenerated on gl_merge_evolution_open, anyway */ + + gl_debug (DEBUG_MERGE, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* Free the list of supported fields */ +/*---------------------------------------------------------------------------*/ +static void +free_field_list (GList *fields) +{ + GList *iter; + + for (iter = fields; iter != NULL; iter = g_list_next(iter)) + { + if (iter->data) { + g_free(iter->data); + } + } + g_list_free(fields); + fields = NULL; +} + + +#endif /* HAVE_LIBEBOOK */ diff --git a/src/merge-evolution.h b/src/merge-evolution.h new file mode 100644 index 00000000..26468abc --- /dev/null +++ b/src/merge-evolution.h @@ -0,0 +1,70 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge_evolution.h: evolution merge backend module header file + * + * Copyright (C) 2002 Jim Evins . + * and + * Copyright (C) 2005 Austin Henry + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __MERGE_EVOLUTION_H__ +#define __MERGE_EVOLUTION_H__ + +#include "merge.h" + +G_BEGIN_DECLS + +/* The following object arguments are available: + * + * name type description + * --------------------------------------------------------------------------- + * query gchar* The query used to select records + * + */ + +#define GL_TYPE_MERGE_EVOLUTION (gl_merge_evolution_get_type ()) +#define GL_MERGE_EVOLUTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_MERGE_EVOLUTION, glMergeEvolution)) +#define GL_MERGE_EVOLUTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_MERGE_EVOLUTION, glMergeEvolutionClass)) +#define GL_IS_MERGE_EVOLUTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_MERGE_EVOLUTION)) +#define GL_IS_MERGE_EVOLUTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_MERGE_EVOLUTION)) +#define GL_MERGE_EVOLUTION_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_MERGE_EVOLUTION, glMergeEvolutionClass)) + + +typedef struct _glMergeEvolution glMergeEvolution; +typedef struct _glMergeEvolutionClass glMergeEvolutionClass; + +typedef struct _glMergeEvolutionPrivate glMergeEvolutionPrivate; + + +struct _glMergeEvolution { + glMerge object; + + glMergeEvolutionPrivate *priv; +}; + +struct _glMergeEvolutionClass { + glMergeClass parent_class; +}; + + +GType gl_merge_evolution_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __MERGE_EVOLUTION_H__ */ diff --git a/src/merge-init.c b/src/merge-init.c new file mode 100644 index 00000000..b62551be --- /dev/null +++ b/src/merge-init.c @@ -0,0 +1,94 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge.c: document merge initialization + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include + +#include "merge-init.h" +#include "merge-text.h" +#ifdef HAVE_LIBEBOOK +#include "merge-evolution.h" +#include "merge-vcard.h" +#endif /* HAVE_LIBEBOOK */ + +#include "debug.h" + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + + +/*****************************************************************************/ +/* Initailize document merge module, by registering all available backends. */ +/*****************************************************************************/ +void +gl_merge_init (void) +{ + + gl_merge_register_backend (GL_TYPE_MERGE_TEXT, + "Text/Comma", + _("Text file with comma delimeters (CSV)"), + GL_MERGE_SRC_IS_FILE, + "delim", ',', + NULL); + + gl_merge_register_backend (GL_TYPE_MERGE_TEXT, + "Text/Colon", + _("Text file with colon delimeters"), + GL_MERGE_SRC_IS_FILE, + "delim", ':', + NULL); + + gl_merge_register_backend (GL_TYPE_MERGE_TEXT, + "Text/Tab", + _("Text file with tab delimeters"), + GL_MERGE_SRC_IS_FILE, + "delim", '\t', + NULL); + +#ifdef HAVE_LIBEBOOK + + gl_merge_register_backend (GL_TYPE_MERGE_EVOLUTION, + "ebook/eds", + _("Data from default Evolution Addressbook"), + GL_MERGE_SRC_IS_FIXED, + NULL); + + gl_merge_register_backend (GL_TYPE_MERGE_VCARD, + "ebook/vcard", + _("Data from a file containing VCards"), + GL_MERGE_SRC_IS_FILE, + NULL); + +#endif /* HAVE_LIBEBOOK */ + +} diff --git a/src/merge-init.h b/src/merge-init.h new file mode 100644 index 00000000..7bd57eef --- /dev/null +++ b/src/merge-init.h @@ -0,0 +1,35 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge-init.h: document merge initialization header file + * + * Copyright (C) 2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __MERGE_INIT_H__ +#define __MERGE_INIT_H__ + +#include "merge.h" + +G_BEGIN_DECLS + +void gl_merge_init (void); + +G_END_DECLS + +#endif diff --git a/src/merge-properties-dialog.c b/src/merge-properties-dialog.c new file mode 100644 index 00000000..d5f3508d --- /dev/null +++ b/src/merge-properties-dialog.c @@ -0,0 +1,659 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge-properties-dialog.c: document merge properties dialog module + * + * Copyright (C) 2001 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "merge-properties-dialog.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "label.h" +#include "merge.h" +#include "util.h" +#include "hig.h" + +#include "debug.h" + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +struct _glMergePropertiesDialogPrivate { + + glLabel *label; + glMerge *merge; + + GtkWidget *type_combo; + GtkWidget *location_vbox; + GtkWidget *src_entry; + + GtkTreeStore *store; + GtkWidget *treeview; + + GtkWidget *select_all_button; + GtkWidget *unselect_all_button; + + gchar *saved_src; + +}; + +enum { + /* Real columns */ + SELECT_COLUMN, + RECORD_FIELD_COLUMN, + VALUE_COLUMN, + + /* Invisible columns */ + IS_RECORD_COLUMN, + DATA_COLUMN, /* points to glMergeRecord */ + + N_COLUMNS +}; + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_merge_properties_dialog_finalize (GObject *object); +static void gl_merge_properties_dialog_construct (glMergePropertiesDialog *dialog, + glLabel *label, + GtkWindow *window); + +static void type_changed_cb (GtkWidget *widget, + glMergePropertiesDialog *dialog); + +static void src_changed_cb (GtkWidget *widget, + glMergePropertiesDialog *dialog); + +static void response_cb (glMergePropertiesDialog *dialog, + gint response, + gpointer user_data); + +static void load_tree (GtkTreeStore *store, + glMerge *merge); + +static void record_select_toggled_cb (GtkCellRendererToggle *cell, + gchar *path_str, + GtkTreeStore *store); + +static void select_all_button_clicked_cb (GtkWidget *widget, + glMergePropertiesDialog *dialog); + +static void unselect_all_button_clicked_cb (GtkWidget *widget, + glMergePropertiesDialog *dialog); + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glMergePropertiesDialog, gl_merge_properties_dialog, GTK_TYPE_DIALOG); + +static void +gl_merge_properties_dialog_class_init (glMergePropertiesDialogClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_MERGE, ""); + + gl_merge_properties_dialog_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_merge_properties_dialog_finalize; +} + +static void +gl_merge_properties_dialog_init (glMergePropertiesDialog *dialog) +{ + gl_debug (DEBUG_MERGE, "START"); + + dialog->priv = g_new0 (glMergePropertiesDialogPrivate, 1); + + gtk_container_set_border_width (GTK_CONTAINER(dialog), GL_HIG_PAD2); + + gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE); + gtk_dialog_add_buttons (GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, + NULL); + + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); + + g_signal_connect(G_OBJECT (dialog), "response", + G_CALLBACK (response_cb), NULL); + + + gl_debug (DEBUG_MERGE, "END"); +} + +static void +gl_merge_properties_dialog_finalize (GObject *object) +{ + glMergePropertiesDialog* dialog = GL_MERGE_PROPERTIES_DIALOG (object); + + gl_debug (DEBUG_MERGE, "START"); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_MERGE_PROPERTIES_DIALOG (dialog)); + g_return_if_fail (dialog->priv != NULL); + + if (dialog->priv->merge != NULL) { + g_object_unref (G_OBJECT (dialog->priv->merge)); + } + g_free (dialog->priv); + + G_OBJECT_CLASS (gl_merge_properties_dialog_parent_class)->finalize (object); + gl_debug (DEBUG_MERGE, "END"); +} + +/*****************************************************************************/ +/* NEW merge properties dialog. */ +/*****************************************************************************/ +GtkWidget* +gl_merge_properties_dialog_new (glLabel *label, + GtkWindow *window) +{ + GtkWidget *dialog; + + gl_debug (DEBUG_MERGE, "START"); + + dialog = GTK_WIDGET (g_object_new (GL_TYPE_MERGE_PROPERTIES_DIALOG, NULL)); + + gl_merge_properties_dialog_construct (GL_MERGE_PROPERTIES_DIALOG (dialog), + label, window); + + gl_debug (DEBUG_MERGE, "END"); + + return dialog; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Create merge widgets. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_properties_dialog_construct (glMergePropertiesDialog *dialog, + glLabel *label, + GtkWindow *window) +{ + GladeXML *gui; + gchar *description; + glMergeSrcType src_type; + gchar *src; + gchar *name, *title; + GList *texts; + GtkWidget *vbox; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + GtkTreeSelection *selection; + + gl_debug (DEBUG_MERGE, "START"); + + g_return_if_fail (GL_IS_MERGE_PROPERTIES_DIALOG (dialog)); + g_return_if_fail (dialog->priv != NULL); + + if (window) { + gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(window)); + gtk_window_set_destroy_with_parent (GTK_WINDOW(dialog), TRUE); + } + + gui = glade_xml_new (GLABELS_GLADE_DIR "merge-properties-dialog.glade", + "merge_properties_vbox", NULL); + + if (!gui) { + g_critical ("Could not open merge-properties-dialog.glade. gLabels may not be installed correctly!"); + return; + } + + vbox = glade_xml_get_widget (gui, "merge_properties_vbox"); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox); + + dialog->priv->type_combo = glade_xml_get_widget (gui, "type_combo"); + dialog->priv->location_vbox = glade_xml_get_widget (gui, "location_vbox"); + dialog->priv->treeview = glade_xml_get_widget (gui, "treeview"); + + dialog->priv->select_all_button = glade_xml_get_widget (gui, "select_all_button"); + dialog->priv->unselect_all_button = glade_xml_get_widget (gui, "unselect_all_button"); + + g_object_unref (gui); + + gl_util_combo_box_add_text_model (GTK_COMBO_BOX (dialog->priv->type_combo)); + + dialog->priv->label = label; + + dialog->priv->merge = gl_label_get_merge (dialog->priv->label); + description = gl_merge_get_description (dialog->priv->merge); + src_type = gl_merge_get_src_type (dialog->priv->merge); + src = gl_merge_get_src (dialog->priv->merge); + + /* --- Window title --- */ + name = gl_label_get_short_name (label); + title = g_strdup_printf ("%s %s", name, _("Merge Properties")); + gtk_window_set_title (GTK_WINDOW (dialog), title); + g_free (name); + g_free (title); + + texts = gl_merge_get_descriptions (); + gl_debug (DEBUG_MERGE, "DESCRIPTIONS:"); + { + GList *p; + + for (p=texts; p!=NULL; p=p->next) { + gl_debug (DEBUG_MERGE, " \"%s\"", p->data); + } + } + gl_util_combo_box_set_strings (GTK_COMBO_BOX (dialog->priv->type_combo), + texts); + gl_merge_free_descriptions (&texts); + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (dialog->priv->type_combo), + description); + g_signal_connect (G_OBJECT (dialog->priv->type_combo), "changed", + G_CALLBACK (type_changed_cb), dialog); + + gl_debug (DEBUG_MERGE, "Src_type = %d", src_type); + switch (src_type) { + case GL_MERGE_SRC_IS_FILE: + dialog->priv->src_entry = + gtk_file_chooser_button_new (_("Select merge-database source"), + GTK_FILE_CHOOSER_ACTION_OPEN); + gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog->priv->src_entry), + src); + g_signal_connect (G_OBJECT (dialog->priv->src_entry), + "selection-changed", + G_CALLBACK (src_changed_cb), dialog); + break; + default: + dialog->priv->src_entry = gtk_label_new (_("N/A")); + gtk_misc_set_alignment (GTK_MISC (dialog->priv->src_entry), 0.0, 0.5); + break; + } + gtk_box_pack_start (GTK_BOX (dialog->priv->location_vbox), + dialog->priv->src_entry, FALSE, FALSE, 0); + gtk_widget_show_all (GTK_WIDGET (dialog->priv->location_vbox)); + + dialog->priv->store = gtk_tree_store_new (N_COLUMNS, + G_TYPE_BOOLEAN, /* Record selector */ + G_TYPE_STRING, /* Record/Field name */ + G_TYPE_STRING, /* Field value */ + G_TYPE_BOOLEAN, /* Is Record? */ + G_TYPE_POINTER /* Pointer to record */); + load_tree (dialog->priv->store, dialog->priv->merge); + + gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->priv->treeview), + GTK_TREE_MODEL (dialog->priv->store)); + + gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (dialog->priv->treeview), + TRUE); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->priv->treeview)); + gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE); + renderer = gtk_cell_renderer_toggle_new (); + g_signal_connect (G_OBJECT (renderer), "toggled", + G_CALLBACK (record_select_toggled_cb), dialog->priv->store); + column = gtk_tree_view_column_new_with_attributes (_("Select"), renderer, + "active", SELECT_COLUMN, + "visible", IS_RECORD_COLUMN, + NULL); + gtk_tree_view_column_set_clickable (column, TRUE); + gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->treeview), column); + renderer = gtk_cell_renderer_text_new (); + gtk_object_set (GTK_OBJECT (renderer), "yalign", 0.0, NULL); + column = gtk_tree_view_column_new_with_attributes (_("Record/Field"), renderer, + "text", RECORD_FIELD_COLUMN, + NULL); + gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->treeview), column); + gtk_tree_view_set_expander_column (GTK_TREE_VIEW (dialog->priv->treeview), column); + renderer = gtk_cell_renderer_text_new (); + gtk_object_set (GTK_OBJECT (renderer), "yalign", 0.0, NULL); + column = gtk_tree_view_column_new_with_attributes (_("Data"), renderer, + "text", VALUE_COLUMN, + NULL); + gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->priv->treeview), column); + + g_signal_connect (G_OBJECT (dialog->priv->select_all_button), + "clicked", + G_CALLBACK (select_all_button_clicked_cb), dialog); + + g_signal_connect (G_OBJECT (dialog->priv->unselect_all_button), + "clicked", + G_CALLBACK (unselect_all_button_clicked_cb), dialog); + + + g_free (src); + g_free (description); + + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + + gl_debug (DEBUG_MERGE, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. type "changed" callback. */ +/*--------------------------------------------------------------------------*/ +static void +type_changed_cb (GtkWidget *widget, + glMergePropertiesDialog *dialog) +{ + gchar *description; + gchar *name; + gchar *src; + glMergeSrcType src_type; + + gl_debug (DEBUG_MERGE, "START"); + + description = gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->type_combo)); + name = gl_merge_description_to_name (description); + + src = gl_merge_get_src (dialog->priv->merge); /* keep current src if possible */ + if ( src != NULL ) { + gl_debug (DEBUG_MERGE, "Saving src = \"%s\"", src); + g_free (dialog->priv->saved_src); + dialog->priv->saved_src = src; + } + + if (dialog->priv->merge != NULL) { + g_object_unref (G_OBJECT(dialog->priv->merge)); + } + dialog->priv->merge = gl_merge_new (name); + + gtk_widget_destroy (dialog->priv->src_entry); + src_type = gl_merge_get_src_type (dialog->priv->merge); + switch (src_type) { + case GL_MERGE_SRC_IS_FILE: + dialog->priv->src_entry = + gtk_file_chooser_button_new (_("Select merge-database source"), + GTK_FILE_CHOOSER_ACTION_OPEN); + if (dialog->priv->saved_src != NULL) { + gl_debug (DEBUG_MERGE, "Setting src = \"%s\"", dialog->priv->saved_src); + gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog->priv->src_entry), + dialog->priv->saved_src); + gl_merge_set_src (dialog->priv->merge, dialog->priv->saved_src); + } + g_signal_connect (G_OBJECT (dialog->priv->src_entry), + "selection-changed", + G_CALLBACK (src_changed_cb), dialog); + break; + case GL_MERGE_SRC_IS_FIXED: + dialog->priv->src_entry = gtk_label_new (_("Fixed")); + gtk_misc_set_alignment (GTK_MISC (dialog->priv->src_entry), 0.0, 0.5); + + gl_debug (DEBUG_MERGE, "Setting src = \"%s\"", dialog->priv->saved_src); + gl_merge_set_src (dialog->priv->merge, "Fixed"); + break; + default: + dialog->priv->src_entry = gtk_label_new (_("N/A")); + gtk_misc_set_alignment (GTK_MISC (dialog->priv->src_entry), 0.0, 0.5); + break; + } + gtk_box_pack_start( GTK_BOX (dialog->priv->location_vbox), + dialog->priv->src_entry, FALSE, FALSE, 0); + gtk_widget_show_all (dialog->priv->location_vbox); + + load_tree (dialog->priv->store, dialog->priv->merge); + + g_free (description); + g_free (name); + + gl_debug (DEBUG_MERGE, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. source "changed" callback. */ +/*--------------------------------------------------------------------------*/ +static void +src_changed_cb (GtkWidget *widget, + glMergePropertiesDialog *dialog) +{ + gchar *src, *orig_src; + + gl_debug (DEBUG_MERGE, "START"); + + orig_src = gl_merge_get_src (dialog->priv->merge); + src = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog->priv->src_entry)); + + gl_debug (DEBUG_MERGE, "orig=\"%s\", new=\"%s\"\n", orig_src, src); + + if (((orig_src == NULL) && (src != NULL)) || + ((orig_src != NULL) && (src == NULL)) || + ((orig_src != NULL) && (src != NULL) && strcmp (src, orig_src))) + { + gl_merge_set_src (dialog->priv->merge, src); + load_tree (dialog->priv->store, dialog->priv->merge); + } + + g_free (orig_src); + g_free (src); + + + gl_debug (DEBUG_MERGE, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. response callback. */ +/*--------------------------------------------------------------------------*/ +static void +response_cb (glMergePropertiesDialog *dialog, + gint response, + gpointer user_data) +{ + gl_debug (DEBUG_MERGE, "START"); + + switch (response) { + + case GTK_RESPONSE_OK: + gl_label_set_merge (dialog->priv->label, dialog->priv->merge); + gtk_widget_hide (GTK_WIDGET (dialog)); + break; + case GTK_RESPONSE_CANCEL: + /* Let the dialog get rebuilt next time to recover state. */ + gtk_widget_destroy (GTK_WIDGET (dialog)); + break; + case GTK_RESPONSE_DELETE_EVENT: + break; + default: + g_print ("response = %d", response); + g_assert_not_reached (); + } + + gl_debug (DEBUG_MERGE, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Load tree store from merge data. */ +/*--------------------------------------------------------------------------*/ +static void +load_tree (GtkTreeStore *store, + glMerge *merge) +{ + const GList *record_list; + GList *p_rec, *p_field; + glMergeRecord *record; + glMergeField *field; + GtkTreeIter iter1, iter2; + gchar *primary_key; + gchar *primary_value; + + gl_debug (DEBUG_MERGE, "START"); + + gtk_tree_store_clear (store); + + primary_key = gl_merge_get_primary_key (merge); + record_list = gl_merge_get_record_list (merge); + + for ( p_rec=(GList *)record_list; p_rec!=NULL; p_rec=p_rec->next ) { + record = (glMergeRecord *)p_rec->data; + + primary_value = gl_merge_eval_key (record, primary_key); + + gtk_tree_store_append (store, &iter1, NULL); + gtk_tree_store_set (store, &iter1, + SELECT_COLUMN, record->select_flag, + RECORD_FIELD_COLUMN, primary_value, + IS_RECORD_COLUMN, TRUE, + DATA_COLUMN, record, + -1); + + g_free (primary_value); + + for ( p_field=record->field_list; p_field!=NULL; p_field=p_field->next ) { + field = (glMergeField *)p_field->data; + + gtk_tree_store_append (store, &iter2, &iter1); + gtk_tree_store_set (store, &iter2, + RECORD_FIELD_COLUMN, field->key, + VALUE_COLUMN, field->value, + IS_RECORD_COLUMN, FALSE, + -1); + } + } + + g_free (primary_key); + + gl_debug (DEBUG_MERGE, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Record select toggled. */ +/*--------------------------------------------------------------------------*/ +static void +record_select_toggled_cb (GtkCellRendererToggle *cell, + gchar *path_str, + GtkTreeStore *store) +{ + GtkTreePath *path; + GtkTreeIter iter; + glMergeRecord *record; + + gl_debug (DEBUG_MERGE, "START"); + + /* get toggled iter */ + path = gtk_tree_path_new_from_string (path_str); + gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path); + + /* get current data */ + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, + DATA_COLUMN, &record, + -1); + + /* toggle the select flag within the record */ + record->select_flag ^= 1; + + /* set new value in store */ + gtk_tree_store_set (store, &iter, + SELECT_COLUMN, record->select_flag, + -1); + + /* clean up */ + gtk_tree_path_free (path); + + gl_debug (DEBUG_MERGE, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. "Select All" button callback. */ +/*--------------------------------------------------------------------------*/ +static void +select_all_button_clicked_cb (GtkWidget *widget, + glMergePropertiesDialog *dialog) +{ + GtkTreeModel *store = GTK_TREE_MODEL (dialog->priv->store); + GtkTreeIter iter; + glMergeRecord *record; + gboolean good; + + gl_debug (DEBUG_MERGE, "START"); + + for ( good = gtk_tree_model_get_iter_first (store, &iter); + good; + good = gtk_tree_model_iter_next (store, &iter) ) + { + + /* get current data */ + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, + DATA_COLUMN, &record, + -1); + + + /* Set select flag within the record */ + record->select_flag = TRUE; + + /* set new value in store */ + gtk_tree_store_set (GTK_TREE_STORE (store), &iter, + SELECT_COLUMN, record->select_flag, + -1); + + } + + gl_debug (DEBUG_MERGE, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. "Unselect All" button callback. */ +/*--------------------------------------------------------------------------*/ +static void +unselect_all_button_clicked_cb (GtkWidget *widget, + glMergePropertiesDialog *dialog) +{ + GtkTreeModel *store = GTK_TREE_MODEL (dialog->priv->store); + GtkTreeIter iter; + glMergeRecord *record; + gboolean good; + + gl_debug (DEBUG_MERGE, "START"); + + for ( good = gtk_tree_model_get_iter_first (store, &iter); + good; + good = gtk_tree_model_iter_next (store, &iter) ) + { + + /* get current data */ + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, + DATA_COLUMN, &record, + -1); + + + /* Set select flag within the record */ + record->select_flag = FALSE; + + /* set new value in store */ + gtk_tree_store_set (GTK_TREE_STORE (store), &iter, + SELECT_COLUMN, record->select_flag, + -1); + + } + + gl_debug (DEBUG_MERGE, "END"); +} diff --git a/src/merge-properties-dialog.h b/src/merge-properties-dialog.h new file mode 100644 index 00000000..f98ea7bf --- /dev/null +++ b/src/merge-properties-dialog.h @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge-properties-dialog.h: document merge properties dialog module header file + * + * Copyright (C) 2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __MERGE_PROPERTIES_DIALOG_H__ +#define __MERGE_PROPERTIES_DIALOG_H__ + +#include +#include +#include "label.h" + +G_BEGIN_DECLS + +#define GL_TYPE_MERGE_PROPERTIES_DIALOG (gl_merge_properties_dialog_get_type ()) +#define GL_MERGE_PROPERTIES_DIALOG(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_MERGE_PROPERTIES_DIALOG, glMergePropertiesDialog)) +#define GL_MERGE_PROPERTIES_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_MERGE_PROPERTIES_DIALOG, glMergePropertiesDialogClass)) +#define GL_IS_MERGE_PROPERTIES_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_MERGE_PROPERTIES_DIALOG)) +#define GL_IS_MERGE_PROPERTIES_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_MERGE_PROPERTIES_DIALOG)) +#define GL_MERGE_PROPERTIES_DIALOG_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_MERGE_PROPERTIES_DIALOG, glMergePropertiesDialogClass)) + + +typedef struct _glMergePropertiesDialog glMergePropertiesDialog; +typedef struct _glMergePropertiesDialogClass glMergePropertiesDialogClass; + +typedef struct _glMergePropertiesDialogPrivate glMergePropertiesDialogPrivate; + +struct _glMergePropertiesDialog +{ + GtkDialog parent_instance; + + glMergePropertiesDialogPrivate *priv; + +}; + +struct _glMergePropertiesDialogClass +{ + GtkDialogClass parent_class; +}; + +GType gl_merge_properties_dialog_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_merge_properties_dialog_new (glLabel *label, + GtkWindow *window); + +G_END_DECLS + +#endif diff --git a/src/merge-text.c b/src/merge-text.c new file mode 100644 index 00000000..674e81d1 --- /dev/null +++ b/src/merge-text.c @@ -0,0 +1,694 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge_text.c: text-file merge backend module + * + * Copyright (C) 2001 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "merge-text.h" + +#include + +#include "debug.h" + +#define LINE_BUF_LEN 1024 + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +struct _glMergeTextPrivate { + gchar delim; + FILE *fp; +}; + +enum { + LAST_SIGNAL +}; + +enum { + ARG_0, + ARG_DELIM, +}; + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_merge_text_finalize (GObject *object); + +static void gl_merge_text_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec); + +static void gl_merge_text_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec); + +static GList *gl_merge_text_get_key_list (glMerge *merge); +static gchar *gl_merge_text_get_primary_key (glMerge *merge); +static void gl_merge_text_open (glMerge *merge); +static void gl_merge_text_close (glMerge *merge); +static glMergeRecord *gl_merge_text_get_record (glMerge *merge); +static void gl_merge_text_copy (glMerge *dst_merge, + glMerge *src_merge); + +static GList *parse_line (FILE *fp, + gchar delim); +static gchar *parse_field (gchar *raw_field); +static void free_fields (GList **fields); + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glMergeText, gl_merge_text, GL_TYPE_MERGE); + +static void +gl_merge_text_class_init (glMergeTextClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glMergeClass *merge_class = GL_MERGE_CLASS (class); + + gl_debug (DEBUG_MERGE, "START"); + + gl_merge_text_parent_class = g_type_class_peek_parent (class); + + object_class->set_property = gl_merge_text_set_property; + object_class->get_property = gl_merge_text_get_property; + + g_object_class_install_property + (object_class, + ARG_DELIM, + g_param_spec_char ("delim", NULL, NULL, + 0, 0x7F, ',', + (G_PARAM_READABLE | G_PARAM_WRITABLE))); + + object_class->finalize = gl_merge_text_finalize; + + merge_class->get_key_list = gl_merge_text_get_key_list; + merge_class->get_primary_key = gl_merge_text_get_primary_key; + merge_class->open = gl_merge_text_open; + merge_class->close = gl_merge_text_close; + merge_class->get_record = gl_merge_text_get_record; + merge_class->copy = gl_merge_text_copy; + + gl_debug (DEBUG_MERGE, "END"); +} + +static void +gl_merge_text_init (glMergeText *merge_text) +{ + gl_debug (DEBUG_MERGE, "START"); + + merge_text->priv = g_new0 (glMergeTextPrivate, 1); + + gl_debug (DEBUG_MERGE, "END"); +} + +static void +gl_merge_text_finalize (GObject *object) +{ + glMergeText *merge_text = GL_MERGE_TEXT (object); + + gl_debug (DEBUG_MERGE, "START"); + + g_return_if_fail (object && GL_IS_MERGE_TEXT (object)); + + g_free (merge_text->priv); + + G_OBJECT_CLASS (gl_merge_text_parent_class)->finalize (object); + + gl_debug (DEBUG_MERGE, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* Set argument. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_text_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec) +{ + glMergeText *merge_text; + + merge_text = GL_MERGE_TEXT (object); + + switch (param_id) { + + case ARG_DELIM: + merge_text->priv->delim = g_value_get_char (value); + gl_debug (DEBUG_MERGE, "ARG \"delim\" = \"%c\"", + merge_text->priv->delim); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); + break; + + } + +} + +/*--------------------------------------------------------------------------*/ +/* Get argument. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_text_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec) +{ + glMergeText *merge_text; + + merge_text = GL_MERGE_TEXT (object); + + switch (param_id) { + + case ARG_DELIM: + g_value_set_char (value, merge_text->priv->delim); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); + break; + + } + +} + +/*--------------------------------------------------------------------------*/ +/* Get key list. */ +/*--------------------------------------------------------------------------*/ +static GList * +gl_merge_text_get_key_list (glMerge *merge) +{ + glMergeText *merge_text; + GList *record_list, *p_rec; + glMergeRecord *record; + GList *p_field; + gint i_field, n_fields, n_fields_max = 0; + GList *key_list; + + /* Field keys are simply column numbers. */ + + gl_debug (DEBUG_MERGE, "BEGIN"); + + merge_text = GL_MERGE_TEXT (merge); + + record_list = (GList *)gl_merge_get_record_list (merge); + + for ( p_rec=record_list; p_rec!=NULL; p_rec=p_rec->next ) { + record = (glMergeRecord *)p_rec->data; + + n_fields = 0; + for ( p_field=record->field_list; p_field!=NULL; p_field=p_field->next ) { + n_fields++; + } + if ( n_fields > n_fields_max ) n_fields_max = n_fields; + } + + key_list = NULL; + for (i_field=1; i_field <= n_fields_max; i_field++) { + key_list = g_list_append (key_list, g_strdup_printf ("%d", i_field)); + } + + + gl_debug (DEBUG_MERGE, "END"); + + return key_list; +} + +/*--------------------------------------------------------------------------*/ +/* Get "primary" key. */ +/*--------------------------------------------------------------------------*/ +static gchar * +gl_merge_text_get_primary_key (glMerge *merge) +{ + /* For now, let's always assume the first column is the primary key. */ + return g_strdup ("1"); +} + +/*--------------------------------------------------------------------------*/ +/* Open merge source. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_text_open (glMerge *merge) +{ + glMergeText *merge_text; + gchar *src; + + merge_text = GL_MERGE_TEXT (merge); + + src = gl_merge_get_src (merge); + + if (src != NULL) { + merge_text->priv->fp = fopen (src, "r"); + } + + g_free (src); +} + +/*--------------------------------------------------------------------------*/ +/* Close merge source. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_text_close (glMerge *merge) +{ + glMergeText *merge_text; + + merge_text = GL_MERGE_TEXT (merge); + + if (merge_text->priv->fp != NULL) { + + fclose (merge_text->priv->fp); + merge_text->priv->fp = NULL; + + } +} + +/*--------------------------------------------------------------------------*/ +/* Get next record from merge source, NULL if no records left (i.e EOF) */ +/*--------------------------------------------------------------------------*/ +static glMergeRecord * +gl_merge_text_get_record (glMerge *merge) +{ + glMergeText *merge_text; + gchar delim; + FILE *fp; + glMergeRecord *record; + GList *fields, *p; + gint i_field; + glMergeField *field; + + merge_text = GL_MERGE_TEXT (merge); + + delim = merge_text->priv->delim; + fp = merge_text->priv->fp; + + if (fp == NULL) { + return NULL; + } + + fields = parse_line (fp, delim); + if ( fields == NULL ) { + return NULL; + } + + record = g_new0 (glMergeRecord, 1); + record->select_flag = TRUE; + i_field = 1; + for (p=fields; p != NULL; p=p->next) { + + field = g_new0 (glMergeField, 1); + field->key = g_strdup_printf ("%d", i_field++); +#ifndef CSV_ALWAYS_UTF8 + field->value = g_locale_to_utf8 (p->data, -1, NULL, NULL, NULL); +#else + field->value = g_strdup (p->data); +#endif + + record->field_list = g_list_append (record->field_list, field); + } + free_fields (&fields); + + return record; +} + +/*---------------------------------------------------------------------------*/ +/* Copy merge_text specific fields. */ +/*---------------------------------------------------------------------------*/ +static void +gl_merge_text_copy (glMerge *dst_merge, + glMerge *src_merge) +{ + glMergeText *dst_merge_text; + glMergeText *src_merge_text; + + dst_merge_text = GL_MERGE_TEXT (dst_merge); + src_merge_text = GL_MERGE_TEXT (src_merge); + + dst_merge_text->priv->delim = src_merge_text->priv->delim; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Parse line. */ +/* */ +/* Attempt to be a robust parser of various CSV (and similar) formats. */ +/* */ +/* Split into fields, accounting for: */ +/* - delimeters may be embedded in quoted text (") */ +/* - delimeters may be "escaped" by a leading backslash (\) */ +/* - quotes may be embedded in quoted text as two adjacent quotes ("") */ +/* - quotes may be "escaped" either within or outside of quoted text. */ +/* - newlines may be embedded in quoted text, allowing a field to span */ +/* more than one line. */ +/* */ +/* This function does not do any parsing of the individual fields, other */ +/* than to correctly interpet delimeters. Actual parsing of the individual */ +/* fields is done in parse_field(). */ +/* */ +/* Returns a list of fields. A blank line is considered a line with one */ +/* empty field. Returns empty (NULL) when done. */ +/*---------------------------------------------------------------------------*/ +static GList * +parse_line (FILE *fp, + gchar delim ) +{ + GList *list = NULL; + GString *string; + gint c; + enum { BEGIN, NORMAL, QUOTED, QUOTED_QUOTE1, + NORMAL_ESCAPED, QUOTED_ESCAPED, DONE } state; + + state = BEGIN; + string = g_string_new( "" ); + while ( state != DONE ) { + c=getc (fp); + + switch (state) { + + case BEGIN: + if ( c == delim ) + { + /* first field is empty. */ + list = g_list_append (list, g_strdup ("")); + state = NORMAL; + break; + } + switch (c) { + case '"': + string = g_string_append_c (string, c); + state = QUOTED; + break; + case '\\': + string = g_string_append_c (string, c); + state = NORMAL_ESCAPED; + break; + case '\n': + /* treat as one empty field. */ + list = g_list_append (list, g_strdup ("")); + state = DONE; + break; + case EOF: + /* end of file, no more lines. */ + state = DONE; + break; + default: + string = g_string_append_c (string, c); + state = NORMAL; + break; + } + break; + + case NORMAL: + if ( c == delim ) + { + list = g_list_append (list, parse_field (string->str)); + string = g_string_assign( string, "" ); + state = NORMAL; + break; + } + switch (c) { + case '"': + string = g_string_append_c (string, c); + state = QUOTED; + break; + case '\\': + string = g_string_append_c (string, c); + state = NORMAL_ESCAPED; + break; + case '\n': + case EOF: + list = g_list_append (list, parse_field (string->str)); + state = DONE; + break; + default: + string = g_string_append_c (string, c); + state = NORMAL; + break; + } + break; + + case QUOTED: + switch (c) { + case '"': + string = g_string_append_c (string, c); + state = QUOTED_QUOTE1; + break; + case '\\': + string = g_string_append_c (string, c); + state = QUOTED_ESCAPED; + break; + case EOF: + /* File ended mid way through quoted item */ + list = g_list_append (list, parse_field (string->str)); + state = DONE; + break; + default: + string = g_string_append_c (string, c); + break; + } + break; + + case QUOTED_QUOTE1: + if ( c == delim ) + { + list = g_list_append (list, parse_field (string->str)); + string = g_string_assign( string, "" ); + state = NORMAL; + break; + } + switch (c) { + case '"': + /* insert quotes in string, stay quoted. */ + string = g_string_append_c (string, c); + state = QUOTED; + break; + case '\n': + case EOF: + /* line or file ended after quoted item */ + list = g_list_append (list, parse_field (string->str)); + state = DONE; + break; + default: + string = g_string_append_c (string, c); + state = NORMAL; + break; + } + break; + + case NORMAL_ESCAPED: + switch (c) { + case EOF: + /* File ended mid way through quoted item */ + list = g_list_append (list, parse_field (string->str)); + state = DONE; + break; + default: + string = g_string_append_c (string, c); + state = NORMAL; + break; + } + break; + + case QUOTED_ESCAPED: + switch (c) { + case EOF: + /* File ended mid way through quoted item */ + list = g_list_append (list, parse_field (string->str)); + state = DONE; + break; + default: + string = g_string_append_c (string, c); + state = QUOTED; + break; + } + break; + + default: + g_assert_not_reached(); + break; + } + + } + g_string_free( string, TRUE ); + + return list; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Parse field. */ +/* */ +/* - Strip leading and trailing white space, unless quoted. */ +/* - Strip CR, unless escaped. */ +/* - Expand '\n' and '\t' into newline and tab characters. */ +/* - Remove quotes, unless escaped (\" anywhere or "" within quotes) */ +/*---------------------------------------------------------------------------*/ +static gchar * +parse_field (gchar *raw_field) +{ + GString *string; + gchar *pass1_field, *c, *field; + enum { NORMAL, NORMAL_ESCAPED, QUOTED, QUOTED_ESCAPED, QUOTED_QUOTE1} state; + + + /* + * Pass 1: remove leading and trailing spaces. + */ + pass1_field = g_strdup (raw_field); + g_strstrip (pass1_field); + + /* + * Pass 2: resolve quoting and escaping. + */ + state = NORMAL; + string = g_string_new( "" ); + for ( c=pass1_field; *c != 0; c++ ) + { + switch (state) { + + case NORMAL: + switch (*c) { + case '\\': + state = NORMAL_ESCAPED; + break; + case '"': + state = QUOTED; + break; + case '\r': + /* Strip CR. */ + break; + default: + string = g_string_append_c (string, *c); + break; + } + break; + + case NORMAL_ESCAPED: + switch (*c) { + case 'n': + string = g_string_append_c (string, '\n'); + state = NORMAL; + break; + case 't': + string = g_string_append_c (string, '\t'); + state = NORMAL; + break; + default: + string = g_string_append_c (string, *c); + state = NORMAL; + break; + } + break; + + case QUOTED: + switch (*c) { + case '\\': + state = QUOTED_ESCAPED; + break; + case '"': + state = QUOTED_QUOTE1; + break; + case '\r': + /* Strip CR. */ + break; + default: + string = g_string_append_c (string, *c); + break; + } + break; + + case QUOTED_ESCAPED: + switch (*c) { + case 'n': + string = g_string_append_c (string, '\n'); + state = QUOTED; + break; + case 't': + string = g_string_append_c (string, '\t'); + state = QUOTED; + break; + default: + string = g_string_append_c (string, *c); + state = QUOTED; + break; + } + break; + + case QUOTED_QUOTE1: + switch (*c) { + case '"': + /* insert quotes in string, stay quoted. */ + string = g_string_append_c (string, *c); + state = QUOTED; + break; + case '\r': + /* Strip CR, return to QUOTED. */ + state = QUOTED; + break; + default: + string = g_string_append_c (string, *c); + state = NORMAL; + break; + } + break; + + default: + g_assert_not_reached(); + break; + } + + } + + field = g_strdup (string->str); + g_string_free( string, TRUE ); + g_free (pass1_field); + + return field; +} + +/*---------------------------------------------------------------------------*/ +/* Free list of fields. */ +/*---------------------------------------------------------------------------*/ +void +free_fields (GList ** list) +{ + GList *p; + + for (p = *list; p != NULL; p = p->next) { + g_free (p->data); + p->data = NULL; + } + + g_list_free (*list); + *list = NULL; +} + diff --git a/src/merge-text.h b/src/merge-text.h new file mode 100644 index 00000000..65bad54d --- /dev/null +++ b/src/merge-text.h @@ -0,0 +1,68 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge_text.h: text-file merge backend module header file + * + * Copyright (C) 2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __MERGE_TEXT_H__ +#define __MERGE_TEXT_H__ + +#include "merge.h" + +G_BEGIN_DECLS + +/* The following object arguments are available: + * + * name type description + * --------------------------------------------------------------------------- + * delim gchar Field delimiter. + * + */ + +#define GL_TYPE_MERGE_TEXT (gl_merge_text_get_type ()) +#define GL_MERGE_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_MERGE_TEXT, glMergeText)) +#define GL_MERGE_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_MERGE_TEXT, glMergeTextClass)) +#define GL_IS_MERGE_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_MERGE_TEXT)) +#define GL_IS_MERGE_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_MERGE_TEXT)) +#define GL_MERGE_TEXT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_MERGE_TEXT, glMergeTextClass)) + + +typedef struct _glMergeText glMergeText; +typedef struct _glMergeTextClass glMergeTextClass; + +typedef struct _glMergeTextPrivate glMergeTextPrivate; + + +struct _glMergeText { + glMerge object; + + glMergeTextPrivate *priv; +}; + +struct _glMergeTextClass { + glMergeClass parent_class; +}; + + +GType gl_merge_text_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif diff --git a/src/merge-vcard.c b/src/merge-vcard.c new file mode 100644 index 00000000..c0eb1449 --- /dev/null +++ b/src/merge-vcard.c @@ -0,0 +1,383 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge_vcard.c: vcard merge backend module + * + * Copyright (C) 2001 Jim Evins . + * and + * Copyright (C) 2005 Austin Henry + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#ifdef HAVE_LIBEBOOK + + +#include "merge-vcard.h" +#include + +#include +#include +#include + +#include "debug.h" + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +struct _glMergeVCardPrivate { + FILE *fp; +}; + +enum { + LAST_SIGNAL +}; + +enum { + ARG_0, +}; + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_merge_vcard_finalize (GObject *object); + +static void gl_merge_vcard_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec); + +static void gl_merge_vcard_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec); + +static GList *gl_merge_vcard_get_key_list (glMerge *merge); +static gchar *gl_merge_vcard_get_primary_key (glMerge *merge); +static void gl_merge_vcard_open (glMerge *merge); +static void gl_merge_vcard_close (glMerge *merge); +static glMergeRecord *gl_merge_vcard_get_record (glMerge *merge); +static void gl_merge_vcard_copy (glMerge *dst_merge, + glMerge *src_merge); +static char * parse_next_vcard (FILE *fp); + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glMergeVCard, gl_merge_vcard, GL_TYPE_MERGE); + +static void +gl_merge_vcard_class_init (glMergeVCardClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glMergeClass *merge_class = GL_MERGE_CLASS (class); + + gl_debug (DEBUG_MERGE, "START"); + + gl_merge_vcard_parent_class = g_type_class_peek_parent (class); + + object_class->set_property = gl_merge_vcard_set_property; + object_class->get_property = gl_merge_vcard_get_property; + + object_class->finalize = gl_merge_vcard_finalize; + + merge_class->get_key_list = gl_merge_vcard_get_key_list; + merge_class->get_primary_key = gl_merge_vcard_get_primary_key; + merge_class->open = gl_merge_vcard_open; + merge_class->close = gl_merge_vcard_close; + merge_class->get_record = gl_merge_vcard_get_record; + merge_class->copy = gl_merge_vcard_copy; + + gl_debug (DEBUG_MERGE, "END"); +} + +static void +gl_merge_vcard_init (glMergeVCard *merge_vcard) +{ + gl_debug (DEBUG_MERGE, "START"); + + merge_vcard->priv = g_new0 (glMergeVCardPrivate, 1); + + gl_debug (DEBUG_MERGE, "END"); +} + +static void +gl_merge_vcard_finalize (GObject *object) +{ + glMergeVCard *merge_vcard = GL_MERGE_VCARD (object); + + gl_debug (DEBUG_MERGE, "START"); + + g_return_if_fail (object && GL_IS_MERGE_VCARD (object)); + + g_free (merge_vcard->priv); + + G_OBJECT_CLASS (gl_merge_vcard_parent_class)->finalize (object); + + gl_debug (DEBUG_MERGE, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* Set argument. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_vcard_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec) +{ + glMergeVCard *merge_vcard; + + merge_vcard = GL_MERGE_VCARD (object); + + switch (param_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); + break; + } +} + +/*--------------------------------------------------------------------------*/ +/* Get argument. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_vcard_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec) +{ + glMergeVCard *merge_vcard; + + merge_vcard = GL_MERGE_VCARD (object); + + switch (param_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); + break; + } + +} + +/* TODO */ +/*--------------------------------------------------------------------------*/ +/* Get key list. */ +/*--------------------------------------------------------------------------*/ +static GList * +gl_merge_vcard_get_key_list (glMerge *merge) +{ + glMergeVCard *merge_vcard; + GList *key_list; + + gl_debug (DEBUG_MERGE, "BEGIN"); + + merge_vcard = GL_MERGE_VCARD (merge); + + /* extremely simple approach until I can list the available keys from the + * server, and return them. */ + key_list = NULL; + key_list = g_list_append (key_list, g_strdup ("full_name")); + key_list = g_list_append (key_list, g_strdup ("home_address")); + key_list = g_list_append (key_list, g_strdup ("work_address")); + + gl_debug (DEBUG_MERGE, "END"); + + return key_list; +} + +/* TODO? */ +/*--------------------------------------------------------------------------*/ +/* Get "primary" key. */ +/*--------------------------------------------------------------------------*/ +static gchar * +gl_merge_vcard_get_primary_key (glMerge *merge) +{ + /* For now, let's always assume the full name is the primary key. */ + return g_strdup ("full_name"); +} + +/*--------------------------------------------------------------------------*/ +/* Open merge source. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_vcard_open (glMerge *merge) +{ + glMergeVCard *merge_vcard; + gchar *src; + + merge_vcard = GL_MERGE_VCARD (merge); + + src = gl_merge_get_src (merge); + + if (src != NULL) { + merge_vcard->priv->fp = fopen (src, "r"); + } + + g_free (src); + + return; +} + +/*--------------------------------------------------------------------------*/ +/* Close merge source. */ +/*--------------------------------------------------------------------------*/ +static void +gl_merge_vcard_close (glMerge *merge) +{ + glMergeVCard *merge_vcard; + + merge_vcard = GL_MERGE_VCARD (merge); + + if (merge_vcard->priv->fp != NULL) { + fclose (merge_vcard->priv->fp); + merge_vcard->priv->fp = NULL; + } +} + +/*--------------------------------------------------------------------------*/ +/* Get next record from merge source, NULL if no records left (i.e EOF) */ +/*--------------------------------------------------------------------------*/ +static glMergeRecord * +gl_merge_vcard_get_record (glMerge *merge) +{ + glMergeVCard *merge_vcard; + glMergeRecord *record; + glMergeField *field; + + char *vcard; + EContact *contact; + + merge_vcard = GL_MERGE_VCARD (merge); + + vcard = parse_next_vcard(merge_vcard->priv->fp); + if (vcard == NULL || vcard[0] == '\0') { + return NULL; /* EOF */ + } + contact = e_contact_new_from_vcard(vcard); + if (contact == NULL) { + return NULL; /* invalid vcard */ + } + + record = g_new0 (glMergeRecord, 1); + record->select_flag = TRUE; + + /* Take the interesting fields one by one from the contact, and put them + * into the glMergeRecord structure. When done, free up the resources for + * that contact */ + + /* get the full name */ + field = g_new0 (glMergeField, 1); + field->key = g_strdup ("full_name"); + field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_FULL_NAME)); + + record->field_list = g_list_append (record->field_list, field); + + /* get the home address */ + field = g_new0 (glMergeField, 1); + field->key = g_strdup ("home_address"); + field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_ADDRESS_LABEL_HOME)); + + record->field_list = g_list_append (record->field_list, field); + + /* get the work address */ + field = g_new0 (glMergeField, 1); + field->key = g_strdup ("work_address"); + field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_ADDRESS_LABEL_WORK)); + + record->field_list = g_list_append (record->field_list, field); + + /* free the contact */ + g_object_unref (contact); + g_free(vcard); + + return record; +} + +/*---------------------------------------------------------------------------*/ +/* Copy merge_vcard specific fields. */ +/*---------------------------------------------------------------------------*/ +static void +gl_merge_vcard_copy (glMerge *dst_merge, + glMerge *src_merge) +{ + glMergeVCard *dst_merge_vcard; + glMergeVCard *src_merge_vcard; + + dst_merge_vcard = GL_MERGE_VCARD (dst_merge); + src_merge_vcard = GL_MERGE_VCARD (src_merge); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE: pull out a full VCard from the open file */ +/* Arguments: */ +/* fp - an open stream to parse in put from */ +/* Returns: */ +/* a pointer to the buffer containing the vcard, the empty string on */ +/* end-of-file or error, this buffer needs to be free by the caller */ +/*---------------------------------------------------------------------------*/ +static char * +parse_next_vcard (FILE *fp) +{ + gboolean found_begin = FALSE; + gboolean found_end = FALSE; + char *vcard; + char line[512]; + int size = 2048; + int cursize = 0; + + /* if no source has been set up, don't try to read from the file */ + if (!fp) { + return NULL; + } + + vcard = g_malloc0(size); + + while (fgets(line, sizeof(line), fp) && found_end == FALSE) { + if (found_begin == TRUE) { + if (g_str_has_prefix(line, "END:VCARD")) { found_end = TRUE; } + } else { + if (g_str_has_prefix(line, "BEGIN:VCARD")) { found_begin = TRUE; } + else { continue; }/* skip lines not in a vcard */ + } + + /* if the buffer passed us isn't big enough, reallocate it */ + cursize += strlen(line); + if (cursize >= size) { + size *= 2; + vcard = (char *)g_realloc(vcard, size); /* aborts program on error */ + } + + /* add the line (or portion thereof) to the vcard */ + strncat(vcard, line, size); + } + + return vcard; +} + + + +#endif /* HAVE_LIBEBOOK */ diff --git a/src/merge-vcard.h b/src/merge-vcard.h new file mode 100644 index 00000000..7ede444f --- /dev/null +++ b/src/merge-vcard.h @@ -0,0 +1,70 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge_vcard.h: vcard merge backend module header file + * + * Copyright (C) 2002 Jim Evins . + * and + * Copyright (C) 2005 Austin Henry + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __MERGE_VCARD_H__ +#define __MERGE_VCARD_H__ + +#include "merge.h" + +G_BEGIN_DECLS + +/* The following object arguments are available: + * + * name type description + * --------------------------------------------------------------------------- + * + */ + +#define GL_TYPE_MERGE_VCARD (gl_merge_vcard_get_type ()) +#define GL_MERGE_VCARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_MERGE_VCARD, glMergeVCard)) +#define GL_MERGE_VCARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_MERGE_VCARD, glMergeVCardClass)) +#define GL_IS_MERGE_VCARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_MERGE_VCARD)) +#define GL_IS_MERGE_VCARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_MERGE_VCARD)) +#define GL_MERGE_VCARD_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_MERGE_VCARD, glMergeVCardClass)) + + +typedef struct _glMergeVCard glMergeVCard; +typedef struct _glMergeVCardClass glMergeVCardClass; + +typedef struct _glMergeVCardPrivate glMergeVCardPrivate; + + +struct _glMergeVCard { + glMerge object; + + glMergeVCardPrivate *priv; +}; + +struct _glMergeVCardClass { + glMergeClass parent_class; +}; + + +GType gl_merge_vcard_get_type (void) G_GNUC_CONST; + +G_END_DECLS + + +#endif /* __MERGE_VCARD_H__ */ diff --git a/src/merge.c b/src/merge.c new file mode 100644 index 00000000..8af027fc --- /dev/null +++ b/src/merge.c @@ -0,0 +1,791 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge.c: document merge module + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "merge.h" + +#include +#include +#include + +#include "debug.h" + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glMergePrivate { + gchar *name; + gchar *description; + gchar *src; + glMergeSrcType src_type; + + GList *record_list; +}; + +enum { + LAST_SIGNAL +}; + +typedef struct { + + GType type; + gchar *name; + gchar *description; + glMergeSrcType src_type; + + guint n_params; + GParameter *params; + +} Backend; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +static GList *backends = NULL; + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_merge_finalize (GObject *object); + +static void merge_open (glMerge *merge); + +static void merge_close (glMerge *merge); + +static glMergeRecord *merge_get_record (glMerge *merge); + +static void merge_free_record (glMergeRecord **record); + +static glMergeRecord *merge_dup_record (glMergeRecord *record); + +static void merge_free_record_list (GList **record_list); + +static GList *merge_dup_record_list (GList *record_list); + + + + +/*****************************************************************************/ +/* Register a new merge backend. */ +/*****************************************************************************/ +void +gl_merge_register_backend (GType type, + gchar *name, + gchar *description, + glMergeSrcType src_type, + const gchar *first_arg_name, + ...) +{ + Backend *backend; + va_list args; + const gchar *pname; + GObjectClass *class; + GParamSpec *pspec; + GParameter *params; + guint n_params = 0, n_alloced_params = 16; + + backend = g_new0 (Backend, 1); + + backend->type = type; + backend->name = g_strdup (name); + backend->description = g_strdup (description); + backend->src_type = src_type; + + params = g_new (GParameter, n_alloced_params); + va_start (args, first_arg_name); + for ( pname=first_arg_name; pname != NULL; pname=va_arg (args,gchar *) ) { + gchar *error = NULL; + + class = g_type_class_ref (type); + if (class == NULL) { + g_message ("%s: unknown object type %d", + G_STRLOC, (int)type); + break; + } + pspec = g_object_class_find_property (class, pname); + if (pspec == NULL) { + g_message ("%s: object class `%s' has no property named `%s'", + G_STRLOC, g_type_name (type), pname); + break; + } + if (n_params >= n_alloced_params) { + n_alloced_params += 16; + params = g_renew (GParameter, params, n_alloced_params); + } + params[n_params].name = pname; + params[n_params].value.g_type = 0; + g_value_init (¶ms[n_params].value, pspec->value_type); + G_VALUE_COLLECT (¶ms[n_params].value, args, 0, &error); + if (error) { + g_message ("%s: %s", G_STRLOC, error); + g_free (error); + break; + } + + n_params++; + } + va_end (args); + + backend->n_params = n_params; + backend->params = params; + + backends = g_list_append (backends, backend); + +} + +/*****************************************************************************/ +/* Get list of registered backend descriptions. */ +/*****************************************************************************/ +GList * +gl_merge_get_descriptions (void) +{ + GList *descriptions = NULL; + GList *p; + Backend *backend; + + descriptions = g_list_append (descriptions, g_strdup(_("None"))); + + for ( p=backends; p!=NULL; p=p->next) { + backend = (Backend *)p->data; + descriptions = g_list_append (descriptions, + g_strdup(backend->description)); + } + + return descriptions; +} + +/*****************************************************************************/ +/* Free list of descriptions. */ +/*****************************************************************************/ +void +gl_merge_free_descriptions (GList **descriptions) +{ + GList *p; + + gl_debug (DEBUG_MERGE, "START"); + + for (p = *descriptions; p != NULL; p = p->next) { + g_free (p->data); + p->data = NULL; + } + + g_list_free (*descriptions); + *descriptions = NULL; + + gl_debug (DEBUG_MERGE, "END"); +} + +/*****************************************************************************/ +/* Lookup name of backend from description. */ +/*****************************************************************************/ +gchar * +gl_merge_description_to_name (gchar *description) +{ + GList *p; + Backend *backend; + + if (g_strcasecmp(description, _("None")) == 0) { + return g_strdup("None"); + } + + for ( p=backends; p!=NULL; p=p->next) { + backend = (Backend *)p->data; + if (g_strcasecmp(description, backend->description) == 0) { + return g_strdup(backend->name); + } + } + + return g_strdup("None"); +} + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glMerge, gl_merge, G_TYPE_OBJECT); + +static void +gl_merge_class_init (glMergeClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_MERGE, "START"); + + gl_merge_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_merge_finalize; + + gl_debug (DEBUG_MERGE, "END"); +} + +static void +gl_merge_init (glMerge *merge) +{ + gl_debug (DEBUG_MERGE, "START"); + + merge->priv = g_new0 (glMergePrivate, 1); + + gl_debug (DEBUG_MERGE, "END"); +} + +static void +gl_merge_finalize (GObject *object) +{ + glMerge *merge = GL_MERGE (object); + + gl_debug (DEBUG_MERGE, "START"); + + g_return_if_fail (object && GL_IS_MERGE (object)); + + merge_free_record_list (&merge->priv->record_list); + g_free (merge->priv->name); + g_free (merge->priv->description); + g_free (merge->priv->src); + g_free (merge->priv); + + G_OBJECT_CLASS (gl_merge_parent_class)->finalize (object); + + gl_debug (DEBUG_MERGE, "END"); +} + +/*****************************************************************************/ +/* New merge object. */ +/*****************************************************************************/ +glMerge * +gl_merge_new (gchar *name) +{ + glMerge *merge = NULL; + GList *p; + Backend *backend; + + gl_debug (DEBUG_MERGE, "START"); + + for (p=backends; p!=NULL; p=p->next) { + backend = (Backend *)p->data; + + if (g_strcasecmp(name, backend->name) == 0) { + + merge = GL_MERGE (g_object_newv (backend->type, + backend->n_params, + backend->params)); + + merge->priv->name = g_strdup (name); + merge->priv->description = g_strdup (backend->description); + merge->priv->src_type = backend->src_type; + + break; + } + } + + if ( (merge == NULL) && (g_strcasecmp (name, "None") != 0)) { + g_message ("Unknown merge backend \"%s\"", name); + } + + gl_debug (DEBUG_MERGE, "END"); + + return merge; +} + +/*****************************************************************************/ +/* Duplicate merge. */ +/*****************************************************************************/ +glMerge * +gl_merge_dup (glMerge *src_merge) +{ + glMerge *dst_merge; + + gl_debug (DEBUG_MERGE, "START"); + + if (src_merge == NULL) { + gl_debug (DEBUG_MERGE, "END (NULL)"); + return NULL; + } + + g_return_val_if_fail (GL_IS_MERGE (src_merge), NULL); + + dst_merge = g_object_new (G_OBJECT_TYPE(src_merge), NULL); + dst_merge->priv->name = g_strdup (src_merge->priv->name); + dst_merge->priv->description = g_strdup (src_merge->priv->description); + dst_merge->priv->src = g_strdup (src_merge->priv->src); + dst_merge->priv->src_type = src_merge->priv->src_type; + dst_merge->priv->record_list + = merge_dup_record_list (src_merge->priv->record_list); + + if ( GL_MERGE_GET_CLASS(src_merge)->copy != NULL ) { + + /* We have an object specific method, use it */ + GL_MERGE_GET_CLASS(src_merge)->copy (dst_merge, src_merge); + + } + + gl_debug (DEBUG_MERGE, "END"); + + return dst_merge; +} + +/*****************************************************************************/ +/* Get name of merge. */ +/*****************************************************************************/ +gchar * +gl_merge_get_name (glMerge *merge) +{ + gl_debug (DEBUG_MERGE, ""); + + if (merge == NULL) { + return g_strdup("None"); + } + + g_return_val_if_fail (GL_IS_MERGE (merge), g_strdup("None")); + + return g_strdup(merge->priv->name); +} + +/*****************************************************************************/ +/* Get description of merge. */ +/*****************************************************************************/ +gchar * +gl_merge_get_description (glMerge *merge) +{ + gl_debug (DEBUG_MERGE, ""); + + if (merge == NULL) { + return g_strdup(_("None")); + } + + g_return_val_if_fail (GL_IS_MERGE (merge), g_strdup(_("None"))); + + return g_strdup(merge->priv->description); +} + +/*****************************************************************************/ +/* Get source type of merge. */ +/*****************************************************************************/ +glMergeSrcType +gl_merge_get_src_type (glMerge *merge) +{ + gl_debug (DEBUG_MERGE, ""); + + if (merge == NULL) { + return GL_MERGE_SRC_IS_FIXED; + } + + g_return_val_if_fail (GL_IS_MERGE (merge), GL_MERGE_SRC_IS_FIXED); + + return merge->priv->src_type; +} + +/*****************************************************************************/ +/* Set src of merge. */ +/*****************************************************************************/ +void +gl_merge_set_src (glMerge *merge, + gchar *src) +{ + GList *record_list = NULL; + glMergeRecord *record; + + gl_debug (DEBUG_MERGE, "START"); + + if (merge == NULL) + { + gl_debug (DEBUG_MERGE, "END (NULL)"); + return; + } + + g_return_if_fail (GL_IS_MERGE (merge)); + + if ( src == NULL) + { + + if ( merge->priv->src != NULL ) + { + g_free (merge->priv->src); + } + merge->priv->src = NULL; + merge_free_record_list (&merge->priv->record_list); + + } + else + { + + if ( merge->priv->src != NULL ) + { + g_free(merge->priv->src); + } + merge->priv->src = g_strdup (src); + + merge_free_record_list (&merge->priv->record_list); + + merge_open (merge); + while ( (record = merge_get_record (merge)) != NULL ) + { + record_list = g_list_append( record_list, record ); + } + merge_close (merge); + merge->priv->record_list = record_list; + + } + + + gl_debug (DEBUG_MERGE, "END"); +} + +/*****************************************************************************/ +/* Get src of merge. */ +/*****************************************************************************/ +gchar * +gl_merge_get_src (glMerge *merge) +{ + gl_debug (DEBUG_MERGE, ""); + + if (merge == NULL) { + return NULL; + } + + g_return_val_if_fail (GL_IS_MERGE (merge), NULL); + + return g_strdup(merge->priv->src); +} + +/*****************************************************************************/ +/* Get Key List. */ +/*****************************************************************************/ +GList * +gl_merge_get_key_list (glMerge *merge) +{ + GList *key_list = NULL; + + gl_debug (DEBUG_MERGE, "START"); + + if (merge == NULL) { + return NULL; + } + + g_return_val_if_fail (GL_IS_MERGE (merge), NULL); + + if ( GL_MERGE_GET_CLASS(merge)->get_key_list != NULL ) { + + key_list = GL_MERGE_GET_CLASS(merge)->get_key_list (merge); + + } + + gl_debug (DEBUG_MERGE, "END"); + + return key_list; +} + +/*****************************************************************************/ +/* Free a list of keys. */ +/*****************************************************************************/ +void +gl_merge_free_key_list (GList **key_list) +{ + GList *p; + + gl_debug (DEBUG_MERGE, "START"); + + for (p = *key_list; p != NULL; p = p->next) { + g_free (p->data); + p->data = NULL; + } + + g_list_free (*key_list); + *key_list = NULL; + + gl_debug (DEBUG_MERGE, "END"); +} + +/*****************************************************************************/ +/* Get Key List. */ +/*****************************************************************************/ +gchar * +gl_merge_get_primary_key (glMerge *merge) +{ + gchar *key = NULL; + + gl_debug (DEBUG_MERGE, "START"); + + if (merge == NULL) { + return NULL; + } + + g_return_val_if_fail (GL_IS_MERGE (merge), NULL); + + if ( GL_MERGE_GET_CLASS(merge)->get_primary_key != NULL ) { + + key = GL_MERGE_GET_CLASS(merge)->get_primary_key (merge); + + } + + gl_debug (DEBUG_MERGE, "END"); + + return key; +} + +/*---------------------------------------------------------------------------*/ +/* Open merge source. */ +/*---------------------------------------------------------------------------*/ +static void +merge_open (glMerge *merge) +{ + gl_debug (DEBUG_MERGE, "START"); + + g_return_if_fail (merge && GL_IS_MERGE (merge)); + + if ( GL_MERGE_GET_CLASS(merge)->open != NULL ) { + + GL_MERGE_GET_CLASS(merge)->open (merge); + + } + + gl_debug (DEBUG_MERGE, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* Close merge source. */ +/*---------------------------------------------------------------------------*/ +static void +merge_close (glMerge *merge) +{ + gl_debug (DEBUG_MERGE, "START"); + + g_return_if_fail (merge && GL_IS_MERGE (merge)); + + if ( GL_MERGE_GET_CLASS(merge)->close != NULL ) { + + GL_MERGE_GET_CLASS(merge)->close (merge); + + } + + gl_debug (DEBUG_MERGE, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* Get next record (list of fields) from opened merge source. */ +/*---------------------------------------------------------------------------*/ +static glMergeRecord * +merge_get_record (glMerge *merge) +{ + glMergeRecord *record = NULL; + + gl_debug (DEBUG_MERGE, "START"); + + g_return_val_if_fail (merge && GL_IS_MERGE (merge), NULL); + + if ( GL_MERGE_GET_CLASS(merge)->get_record != NULL ) { + + record = GL_MERGE_GET_CLASS(merge)->get_record (merge); + + } + + gl_debug (DEBUG_MERGE, "END"); + + return record; +} + +/*---------------------------------------------------------------------------*/ +/* Free a merge record (list of fields) */ +/*---------------------------------------------------------------------------*/ +static void +merge_free_record (glMergeRecord **record) +{ + GList *p; + glMergeField *field; + + gl_debug (DEBUG_MERGE, "START"); + + for (p = (*record)->field_list; p != NULL; p = p->next) { + field = (glMergeField *) p->data; + + g_free (field->key); + field->key = NULL; + g_free (field->value); + field->value = NULL; + + g_free (p->data); + p->data = NULL; + + } + g_list_free ((*record)->field_list); + (*record)->field_list = NULL; + + g_free (*record); + *record = NULL; + + gl_debug (DEBUG_MERGE, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* Duplicate a merge record (list of fields) */ +/*---------------------------------------------------------------------------*/ +static glMergeRecord * +merge_dup_record (glMergeRecord *record) +{ + glMergeRecord *dest_record; + GList *p; + glMergeField *dest_field, *field; + + gl_debug (DEBUG_MERGE, "START"); + + dest_record = g_new0 (glMergeRecord, 1); + dest_record->select_flag = record->select_flag; + + for (p = record->field_list; p != NULL; p = p->next) { + field = (glMergeField *) p->data; + + dest_field = g_new0 (glMergeField, 1); + + dest_field->key = g_strdup (field->key); + dest_field->value = g_strdup (field->value); + + dest_record->field_list = + g_list_append (dest_record->field_list, dest_field); + + } + + gl_debug (DEBUG_MERGE, "END"); + + return dest_record; +} + +/*****************************************************************************/ +/* Find key in given record and evaluate. */ +/*****************************************************************************/ +gchar * +gl_merge_eval_key (glMergeRecord *record, + gchar *key) + +{ + GList *p; + glMergeField *field; + gchar *val = NULL; + + gl_debug (DEBUG_MERGE, "START"); + + if ( (record != NULL) ) { + for (p = record->field_list; p != NULL; p = p->next) { + field = (glMergeField *) p->data; + + if (strcmp (key, field->key) == 0) { + val = g_strdup (field->value); + } + + } + } + + gl_debug (DEBUG_MERGE, "END"); + + return val; +} + +/*****************************************************************************/ +/* Read all records from merge source. */ +/*****************************************************************************/ +const GList * +gl_merge_get_record_list (glMerge *merge) +{ + gl_debug (DEBUG_MERGE, ""); + + if ( merge != NULL ) { + return merge->priv->record_list; + } else { + return NULL; + } +} + +/*---------------------------------------------------------------------------*/ +/* Free a list of records. */ +/*---------------------------------------------------------------------------*/ +static void +merge_free_record_list (GList **record_list) +{ + GList *p; + glMergeRecord *record; + + gl_debug (DEBUG_MERGE, "START"); + + for (p = *record_list; p != NULL; p = p->next) { + record = (glMergeRecord *) p->data; + + merge_free_record( &record ); + + } + + g_list_free (*record_list); + *record_list = NULL; + + gl_debug (DEBUG_MERGE, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* Duplicate a list of records. */ +/*---------------------------------------------------------------------------*/ +static GList * +merge_dup_record_list (GList *record_list) +{ + GList *dest_list = NULL, *p; + glMergeRecord *dest_record, *record; + + gl_debug (DEBUG_MERGE, "START"); + + for (p = record_list; p != NULL; p = p->next) { + record = (glMergeRecord *) p->data; + + dest_record = merge_dup_record( record ); + dest_list = g_list_append (dest_list, dest_record); + } + + + gl_debug (DEBUG_MERGE, "END"); + + return dest_list; +} + +/*****************************************************************************/ +/* Count selected records. */ +/*****************************************************************************/ +gint +gl_merge_get_record_count (glMerge *merge) +{ + GList *p; + glMergeRecord *record; + gint count; + + gl_debug (DEBUG_MERGE, "START"); + + count = 0; + for ( p=merge->priv->record_list; p!=NULL; p=p->next ) { + record = (glMergeRecord *)p->data; + + if ( record->select_flag ) count ++; + } + + gl_debug (DEBUG_MERGE, "END"); + + return count; +} + + diff --git a/src/merge.h b/src/merge.h new file mode 100644 index 00000000..819ca25b --- /dev/null +++ b/src/merge.h @@ -0,0 +1,130 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * merge.h: document merge module header file + * + * Copyright (C) 2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __MERGE_H__ +#define __MERGE_H__ + +#include + +G_BEGIN_DECLS + +typedef enum { + GL_MERGE_SRC_IS_FIXED, + GL_MERGE_SRC_IS_FILE, +} glMergeSrcType; + +typedef struct { + gchar *key; + gchar *value; +} glMergeField; + +typedef struct { + gboolean select_flag; + GList *field_list; /* List of glMergeFields */ +} glMergeRecord; + + +#define GL_TYPE_MERGE (gl_merge_get_type ()) +#define GL_MERGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_MERGE, glMerge)) +#define GL_MERGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_MERGE, glMergeClass)) +#define GL_IS_MERGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_MERGE)) +#define GL_IS_MERGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_MERGE)) +#define GL_MERGE_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_MERGE, glMergeClass)) + + +typedef struct _glMerge glMerge; +typedef struct _glMergeClass glMergeClass; + +typedef struct _glMergePrivate glMergePrivate; + + +struct _glMerge { + GObject object; + + glMergePrivate *priv; +}; + +struct _glMergeClass { + GObjectClass parent_class; + + GList *(*get_key_list) (glMerge *merge); + + gchar *(*get_primary_key) (glMerge *merge); + + void (*open) (glMerge *merge); + + void (*close) (glMerge *merge); + + glMergeRecord *(*get_record) (glMerge *merge); + + void (*copy) (glMerge *dst_merge, + glMerge *src_merge); +}; + + +void gl_merge_register_backend (GType type, + gchar *name, + gchar *description, + glMergeSrcType src_type, + const gchar *first_arg_name, + ...); + +GList *gl_merge_get_descriptions (void); + +void gl_merge_free_descriptions (GList **descriptions); + +gchar *gl_merge_description_to_name (gchar *description); + +GType gl_merge_get_type (void) G_GNUC_CONST; + +glMerge *gl_merge_new (gchar *name); + +glMerge *gl_merge_dup (glMerge *orig); + +gchar *gl_merge_get_name (glMerge *merge); + +gchar *gl_merge_get_description (glMerge *merge); + +glMergeSrcType gl_merge_get_src_type (glMerge *merge); + +void gl_merge_set_src (glMerge *merge, + gchar *src); + +gchar *gl_merge_get_src (glMerge *merge); + +GList *gl_merge_get_key_list (glMerge *merge); + +void gl_merge_free_key_list (GList **keys); + +gchar *gl_merge_get_primary_key (glMerge *merge); + +gchar *gl_merge_eval_key (glMergeRecord *record, + gchar *key); + +const GList *gl_merge_get_record_list (glMerge *merge); + +gint gl_merge_get_record_count (glMerge *merge); + +G_END_DECLS + +#endif diff --git a/src/mini-preview-pixbuf-cache.c b/src/mini-preview-pixbuf-cache.c new file mode 100644 index 00000000..c7d3afa3 --- /dev/null +++ b/src/mini-preview-pixbuf-cache.c @@ -0,0 +1,149 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * mini-preview-pixbuf-cache.c: GLabels mini-preview pixbuf cache module + * + * Copyright (C) 2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "mini-preview-pixbuf-cache.h" +#include "mini-preview-pixbuf.h" + +#include "libglabels/db.h" + +#include +#include + +#include "debug.h" + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +static GHashTable *mini_preview_pixbuf_cache = NULL; + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + + +/*****************************************************************************/ +/* Create a new hash table to keep track of cached mini preview pixbufs. */ +/*****************************************************************************/ +void +gl_mini_preview_pixbuf_cache_init (void) +{ + GList *names = NULL; + GList *p; + lglTemplate *template; + + gl_debug (DEBUG_PIXBUF_CACHE, "START"); + + mini_preview_pixbuf_cache = g_hash_table_new (g_str_hash, g_str_equal); + + names = lgl_db_get_template_name_list_unique (NULL, NULL, NULL); + for ( p=names; p != NULL; p=p->next ) + { + gl_debug (DEBUG_PIXBUF_CACHE, "name = \"%s\"", p->data); + + template = lgl_db_lookup_template_from_name (p->data); + gl_mini_preview_pixbuf_cache_add_by_template (template); + lgl_template_free (template); + } + lgl_db_free_template_name_list (names); + + gl_debug (DEBUG_PIXBUF_CACHE, "END pixbuf_cache=%p", mini_preview_pixbuf_cache); +} + +/*****************************************************************************/ +/* Add pixbuf to cache by template. */ +/*****************************************************************************/ +void +gl_mini_preview_pixbuf_cache_add_by_template (lglTemplate *template) +{ + GdkPixbuf *pixbuf; + GList *p; + lglTemplateAlias *alias; + gchar *name; + + gl_debug (DEBUG_PIXBUF_CACHE, "START"); + + pixbuf = gl_mini_preview_pixbuf_new (template, 72, 72); + + for ( p=template->aliases; p != NULL; p=p->next ) + { + alias = (lglTemplateAlias *)p->data; + + name = g_strdup_printf ("%s %s", alias->brand, alias->part); + g_hash_table_insert (mini_preview_pixbuf_cache, name, g_object_ref (pixbuf)); + } + + g_object_unref (pixbuf); + + gl_debug (DEBUG_PIXBUF_CACHE, "END"); +} + +/*****************************************************************************/ +/* Add pixbuf to cache by name. */ +/*****************************************************************************/ +void +gl_mini_preview_pixbuf_cache_add_by_name (gchar *name) +{ + lglTemplate *template; + GdkPixbuf *pixbuf; + + gl_debug (DEBUG_PIXBUF_CACHE, "START"); + + template = lgl_db_lookup_template_from_name (name); + pixbuf = gl_mini_preview_pixbuf_new (template, 72, 72); + lgl_template_free (template); + + g_hash_table_insert (mini_preview_pixbuf_cache, g_strdup (name), pixbuf); + + gl_debug (DEBUG_PIXBUF_CACHE, "END"); +} + +/*****************************************************************************/ +/* Get pixbuf. */ +/*****************************************************************************/ +GdkPixbuf * +gl_mini_preview_pixbuf_cache_get_pixbuf (gchar *name) +{ + GdkPixbuf *pixbuf; + + gl_debug (DEBUG_PIXBUF_CACHE, "START pixbuf_cache=%p", mini_preview_pixbuf_cache); + + pixbuf = g_hash_table_lookup (mini_preview_pixbuf_cache, name); + + if (!pixbuf) + { + gl_mini_preview_pixbuf_cache_add_by_name (name); + pixbuf = g_hash_table_lookup (mini_preview_pixbuf_cache, name); + } + + gl_debug (DEBUG_PIXBUF_CACHE, "END"); + + return g_object_ref (pixbuf); +} + diff --git a/src/mini-preview-pixbuf-cache.h b/src/mini-preview-pixbuf-cache.h new file mode 100644 index 00000000..092d5692 --- /dev/null +++ b/src/mini-preview-pixbuf-cache.h @@ -0,0 +1,42 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * mini-preview-pixbuf-cache.h: GLabels mini-preview pixbuf cache module + * + * Copyright (C) 2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __MINI_PREVIEW_PIXBUF_CACHE_H__ +#define __MINI_PREVIEW_PIXBUF_CACHE_H__ + +#include +#include + +G_BEGIN_DECLS + +void gl_mini_preview_pixbuf_cache_init (void); + +void gl_mini_preview_pixbuf_cache_add_by_name (gchar *name); +void gl_mini_preview_pixbuf_cache_add_by_template (lglTemplate *template); + +GdkPixbuf *gl_mini_preview_pixbuf_cache_get_pixbuf (gchar *name); + + +G_END_DECLS + +#endif /*__MINI_PREVIEW_PIXBUF_CACHE_H__ */ diff --git a/src/mini-preview-pixbuf.c b/src/mini-preview-pixbuf.c new file mode 100644 index 00000000..a4642525 --- /dev/null +++ b/src/mini-preview-pixbuf.c @@ -0,0 +1,225 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * mini-preview-pixbuf.c: mini preview pixbuf module + * + * Copyright (C) 2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "mini-preview-pixbuf.h" +#include "cairo-label-path.h" + +#include +#include + +#include "debug.h" + +/*===========================================*/ +/* Private macros and constants. */ +/*===========================================*/ + +#define PAPER_RGB_ARGS 0.95, 0.95, 0.95 +#define PAPER_OUTLINE_RGB_ARGS 0.0, 0.0, 0.0 +#define LABEL_RGB_ARGS 1.0, 1.0, 1.0 +#define LABEL_OUTLINE_RGB_ARGS 0.25, 0.25, 0.25 + +#define PAPER_OUTLINE_WIDTH_PIXELS 1.0 +#define LABEL_OUTLINE_WIDTH_PIXELS 1.0 + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void draw_paper (cairo_t *cr, + lglTemplate *template, + gdouble scale); + +static void draw_label_outlines (cairo_t *cr, + lglTemplate *template, + gdouble scale); + +static void draw_label_outline (cairo_t *cr, + lglTemplate *template, + gdouble x0, + gdouble y0); + + + + +/****************************************************************************/ +/* Create new pixbuf with mini preview of template */ +/****************************************************************************/ +GdkPixbuf * +gl_mini_preview_pixbuf_new (lglTemplate *template, + gint width, + gint height) +{ + cairo_surface_t *surface; + cairo_t *cr; + GdkPixbuf *pixbuf; + gdouble scale; + gdouble w, h; + gdouble offset_x, offset_y; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + /* Create pixbuf and cairo context. */ + pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height); + surface = cairo_image_surface_create_for_data (gdk_pixbuf_get_pixels (pixbuf), + CAIRO_FORMAT_RGB24, + gdk_pixbuf_get_width (pixbuf), + gdk_pixbuf_get_height (pixbuf), + gdk_pixbuf_get_rowstride (pixbuf)); + + cr = cairo_create (surface); + cairo_surface_destroy (surface); + + /* Clear pixbuf */ + cairo_save (cr); + cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); + cairo_paint (cr); + cairo_restore (cr); + + cairo_set_antialias (cr, CAIRO_ANTIALIAS_GRAY); + + /* Set scale and offset */ + w = width - 1; + h = height - 1; + if ( (w/template->page_width) > (h/template->page_height) ) { + scale = h / template->page_height; + } else { + scale = w / template->page_width; + } + offset_x = (width/scale - template->page_width) / 2.0; + offset_y = (height/scale - template->page_height) / 2.0; + cairo_identity_matrix (cr); + cairo_scale (cr, scale, scale); + cairo_translate (cr, offset_x, offset_y); + + /* Draw paper and label outlines */ + draw_paper (cr, template, scale); + draw_label_outlines (cr, template, scale); + + /* Cleanup */ + cairo_destroy (cr); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); + + return pixbuf; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Draw paper and paper outline. */ +/*--------------------------------------------------------------------------*/ +static void +draw_paper (cairo_t *cr, + lglTemplate *template, + gdouble scale) +{ + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + cairo_save (cr); + cairo_rectangle (cr, 0.0, 0.0, template->page_width, template->page_height); + cairo_set_source_rgb (cr, PAPER_RGB_ARGS); + cairo_fill_preserve (cr); + cairo_set_line_width (cr, PAPER_OUTLINE_WIDTH_PIXELS/scale); + cairo_set_source_rgb (cr, PAPER_OUTLINE_RGB_ARGS); + cairo_stroke (cr); + cairo_restore (cr); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Draw label outlines. */ +/*--------------------------------------------------------------------------*/ +static void +draw_label_outlines (cairo_t *cr, + lglTemplate *template, + gdouble scale) +{ + const lglTemplateFrame *frame; + gint i, n_labels; + lglTemplateOrigin *origins; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + cairo_save (cr); + + cairo_set_line_width (cr, LABEL_OUTLINE_WIDTH_PIXELS/scale); + + frame = (lglTemplateFrame *)template->frames->data; + + n_labels = lgl_template_frame_get_n_labels (frame); + origins = lgl_template_frame_get_origins (frame); + + for ( i=0; i < n_labels; i++ ) { + + draw_label_outline(cr, template, origins[i].x, origins[i].y); + + } + + g_free (origins); + + cairo_restore (cr); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Draw label outline. */ +/*--------------------------------------------------------------------------*/ +static void +draw_label_outline (cairo_t *cr, + lglTemplate *template, + gdouble x0, + gdouble y0) +{ + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + cairo_save (cr); + + cairo_translate (cr, x0, y0); + + gl_cairo_label_path (cr, template, FALSE, FALSE); + + cairo_set_source_rgb (cr, LABEL_RGB_ARGS); + cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); + cairo_fill_preserve (cr); + + cairo_set_source_rgb (cr, LABEL_OUTLINE_RGB_ARGS); + cairo_stroke (cr); + + cairo_restore (cr); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + diff --git a/src/mini-preview-pixbuf.h b/src/mini-preview-pixbuf.h new file mode 100644 index 00000000..ddad146b --- /dev/null +++ b/src/mini-preview-pixbuf.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * mini-preview-pixbuf.h: mini-preview pixbuf module header file + * + * Copyright (C) 2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __MINI_PREVIEW_PIXBUF_H__ +#define __MINI_PREVIEW_PIXBUF_H__ + + +#include +#include + +G_BEGIN_DECLS + +GdkPixbuf *gl_mini_preview_pixbuf_new (lglTemplate *template, + gint width, + gint height); + +G_END_DECLS + +#endif diff --git a/src/mygal/Makefile.am b/src/mygal/Makefile.am new file mode 100644 index 00000000..054cbe7a --- /dev/null +++ b/src/mygal/Makefile.am @@ -0,0 +1,44 @@ +INCLUDES = \ + $(MYGAL_CFLAGS) + + +libmygal_la_LDFLAGS=\ + $(MYGAL_LIBS) + +noinst_LTLIBRARIES = libmygal.la + +libmygal_la_SOURCES = \ + widget-color-combo.c \ + widget-color-combo.h \ + e-util.h \ + e-colors.c \ + e-colors.h \ + mygal-combo-box.c \ + mygal-combo-box.h \ + color-palette.c \ + color-palette.h \ + color-group.c \ + color-group.h \ + e-marshal.c \ + e-marshal.h + +marshal_sources = \ + e-marshal.c \ + e-marshal.h + +$(libmygal_la_OBJECTS) : $(marshal_sources) + +e-marshal.h: e-marshal.list $(GLIB_GENMARSHAL) + $(GLIB_GENMARSHAL) $< --header --prefix=e_marshal > $@ +e-marshal.c: e-marshal.list $(GLIB_GENMARSHAL) + $(GLIB_GENMARSHAL) $< --body --prefix=e_marshal > $@ + +EXTRA_DIST = e-marshal.list +CLEANFILES = $(marshal_sources) + +DONT_DIST_SOURCE = $(marshal_sources) + +dist-hook: + for file in $(DONT_DIST_SOURCE) ; do \ + rm -f $(distdir)/$$file ; \ + done diff --git a/src/mygal/color-group.c b/src/mygal/color-group.c new file mode 100644 index 00000000..3f35257c --- /dev/null +++ b/src/mygal/color-group.c @@ -0,0 +1,333 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * color-group.c - Utility to keep a shered memory of custom colors + * between arbitrary widgets. + * Copyright 2000, Michael Levy + * Copyright 2001, Almer S. Tigelaar + * + * Authors: + * Michael Levy (mlevy@genoscope.cns.fr) + * Revised and polished by: + * Almer S. Tigelaar + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include "color-group.h" +#include +#include +#include "e-util.h" +#include + +#define PARENT_TYPE G_TYPE_OBJECT + +enum { + CUSTOM_COLOR_ADD, + LAST_SIGNAL +}; + +static GObjectClass *parent_class; + +static GQuark color_group_signals [LAST_SIGNAL] = { 0 }; + +static void color_group_finalize (GObject *obj); + +static void +color_group_class_init (ColorGroupClass *klass) +{ + GObjectClass *object_class; + + object_class = (GObjectClass*) klass; + + object_class->finalize = &color_group_finalize; + parent_class = g_type_class_peek (PARENT_TYPE); + + color_group_signals [CUSTOM_COLOR_ADD] = + g_signal_new ("custom_color_add", + COLOR_GROUP_TYPE, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ColorGroupClass, custom_color_add), + (GSignalAccumulator) NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, G_TYPE_POINTER); +} + +static void +color_group_init (ColorGroup *cg) +{ + cg->name = NULL; + cg->history = NULL; + cg->history_size = 0; +} + +E_MAKE_TYPE(color_group, + "ColorGroup", + ColorGroup, + color_group_class_init, + color_group_init, + PARENT_TYPE) + + +/* Hash table used to ensure unicity in newly created names*/ +static GHashTable *group_names = NULL; + +static guint +cg_hash (gconstpointer key) +{ + /* Do NOT use smart type checking it will not work for the tmp_key */ + return g_str_hash (((ColorGroup *)key)->name); +} + +static gint +cg_cmp (gconstpointer a, gconstpointer b) +{ + /* Do NOT use smart type checking it will not work for the tmp_key */ + ColorGroup const *cg_a = (ColorGroup *)a; + ColorGroup const *cg_b = (ColorGroup *)b; + if (cg_a == cg_b) + return TRUE; + if (cg_a->context != cg_b->context) + return FALSE; + return g_str_equal (cg_a->name, cg_b->name); +} + +static void +initialize_group_names (void) +{ + g_assert (group_names == NULL); + group_names = g_hash_table_new (cg_hash, cg_cmp); +} + +/** + * color_group_get : + * @name : + * @context : + * + * Look up the name/context specific color-group. Return NULL if it is not found. + * No reference is added if it is found. + */ +ColorGroup * +color_group_get (const gchar * name, gpointer context) +{ + ColorGroup tmp_key; + gpointer res; + + g_assert(group_names); + + g_return_val_if_fail(name != NULL, NULL); + + tmp_key.name = (char *)name; + tmp_key.context = context; + res = g_hash_table_lookup (group_names, &tmp_key); + + if (res != NULL) + return COLOR_GROUP (res); + else + return NULL; +} + +static gchar * +create_unique_name (gpointer context) +{ + const gchar *prefix = "__cg_autogen_name__"; + static gint latest_suff = 0; + gchar *new_name; + + for(;;latest_suff++) { + new_name = g_strdup_printf("%s%i", prefix, latest_suff); + if (color_group_get (new_name, context) == NULL) + return new_name; + else + g_free(new_name); + } + g_assert_not_reached(); +} + +static void +color_group_finalize (GObject *obj) +{ + ColorGroup *cg; + + g_return_if_fail(obj != NULL); + g_return_if_fail(IS_COLOR_GROUP(obj)); + g_assert(group_names != NULL); + + cg = COLOR_GROUP (obj); + + /* make this name available */ + if (cg->name) { + g_hash_table_remove (group_names, cg); + g_free (cg->name); + cg->name = NULL; + } + + if (cg->history) { + /* Free the whole colour history */ + while ((int) cg->history->len > 0) + gdk_color_free ((GdkColor *) + g_ptr_array_remove_index (cg->history, 0)); + g_ptr_array_free (cg->history, TRUE); + cg->history = NULL; + } + + if (parent_class->finalize) + (parent_class->finalize) (obj); +} + +/* + * color_group_get_history_size: + * Get the size of the custom color history + */ +gint +color_group_get_history_size (ColorGroup *cg) +{ + g_return_val_if_fail (cg != NULL, 0); + + return cg->history_size; +} + +/* + * Change the size of the custom color history. + */ +void +color_group_set_history_size (ColorGroup *cg, gint size) +{ + g_return_if_fail(cg != NULL); + g_return_if_fail(size >= 0); + + /* Remove excess elements (begin with kicking out the oldest) */ + while ((int) cg->history->len > size) + gdk_color_free ((GdkColor *) g_ptr_array_remove_index (cg->history, 0)); +} + +/* + * color_group_fetch : + * @name : + * @context : + * + * if name is NULL or a name not currently in use by another group + * then a new group is created and returned. If name was NULL + * then the new group is given a unique name prefixed by "__cg_autogen_name__" + * (thereby insuring namespace separation). + * If name was already used by a group then the reference count is + * incremented and a pointer to the group is returned. + */ +ColorGroup * +color_group_fetch (const gchar *name, gpointer context) +{ + ColorGroup *cg; + gchar *new_name; + + if (group_names == NULL) + initialize_group_names(); + + if (name == NULL) + new_name = create_unique_name (context); + else + new_name = g_strdup (name); + + cg = color_group_get (new_name, context); + if (cg != NULL) { + g_free (new_name); + g_object_ref (G_OBJECT (cg)); + return cg; + } + + /* Take care of creating the new object */ + cg = g_object_new (color_group_get_type (), NULL); + g_return_val_if_fail(cg != NULL, NULL); + + cg->name = new_name; + cg->context = context; + + /* Create history */ + cg->history = g_ptr_array_new (); + + /* FIXME: Why not 8? We never use more then 8 on the palette, + * maybe we can't free colors while they are still on the palette and + * need to be sure they are not on it when we free them and thus we + * make the upper limit twice the size of the number of displayed items + * (2 * 8) ? + */ + cg->history_size = 16; + + /* lastly register this name */ + g_hash_table_insert (group_names, cg, cg); + + return cg; +} + +/* + * color_group_get_custom_colors: + * Retrieve all custom colors currently in the history using a callback + * mechanism. The custom colors will be passed from the oldest to the newest. + */ +void +color_group_get_custom_colors (ColorGroup *cg, CbCustomColors callback, gpointer user_data) +{ + int i; + + g_return_if_fail (cg != NULL); + + /* Invoke the callback for our full history */ + for (i = 0; i < (int) cg->history->len; i++) { + GdkColor const * const color = g_ptr_array_index (cg->history, i); + + callback (color, user_data); + } +} + +/* + * color_group_add_color: + * Changes the colors. The color to be set should always be a custom + * color! It has no use adding a color which is already in the default + * palette. + */ +void +color_group_add_color (ColorGroup *cg, GdkColor const * const color) +{ + int i; + + g_return_if_fail(cg != NULL); + g_return_if_fail(color != NULL); /* Can't be NULL */ + + /* Let's be smart and see if it's already in our history, no need to add it again*/ + for (i = 0; i < (int) cg->history->len; i++) { + GdkColor *current = g_ptr_array_index (cg->history, i); + + if (gdk_color_equal (color, current)) + return; + } + + /* + * We make our own private copy of the color passed and put + * it in the history, this is freed later. + */ + if (cg->history_size > 0) + g_ptr_array_add (cg->history, gdk_color_copy (color)); + + /* Shift out the oldest item if we grow beyond our set size */ + if ((int) cg->history->len > cg->history_size) + gdk_color_free ((GdkColor *) g_ptr_array_remove_index (cg->history, 0)); + + /* Tell color-palette's that use this group that + * a new custom color was added. + */ + g_signal_emit (G_OBJECT(cg), + color_group_signals [CUSTOM_COLOR_ADD], + 0, + color); +} diff --git a/src/mygal/color-group.h b/src/mygal/color-group.h new file mode 100644 index 00000000..b35ad614 --- /dev/null +++ b/src/mygal/color-group.h @@ -0,0 +1,77 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * color-group.h - Utility to keep a shered memory of custom colors + * between arbitrary widgets. + * Copyright 2000, Michael Levy + * Copyright 2001, Almer S. Tigelaar + * + * Authors: + * Michael Levy (mlevy@genoscope.cns.fr) + * Revised and polished by: + * Almer S. Tigelaar + * + * Modified for gLabels by: + * Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef GNOME_APP_LIB__COLOR_GROUP_H +#define GNOME_APP_LIB__COLOR_GROUP_H + +#include +#include +#include + +G_BEGIN_DECLS + +typedef gboolean (* CbCustomColors) (GdkColor const * const color, gpointer data); + +typedef struct _ColorGroup { + GObject parent; + + gchar *name; + gpointer context; + + GPtrArray *history; /* The custom color history */ + gint history_size; /* length of color_history */ +} ColorGroup; + +typedef struct { + GObjectClass parent_class; + + /* Signals emited by this object */ + void (*custom_color_add) (ColorGroup *color_group, GdkColor const * const color); +} ColorGroupClass; + +#define COLOR_GROUP_TYPE (color_group_get_type ()) +#define COLOR_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), COLOR_GROUP_TYPE, ColorGroup)) +#define COLOR_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST (k), COLOR_GROUP_TYPE) +#define IS_COLOR_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), COLOR_GROUP_TYPE)) + +GType color_group_get_type (void); +ColorGroup *color_group_fetch (const gchar *name, gpointer context); +ColorGroup *color_group_get (const gchar *name, gpointer context); + +void color_group_set_history_size (ColorGroup *cg, gint size); +gint color_group_get_history_size (ColorGroup *cg); + +void color_group_get_custom_colors (ColorGroup *cg, CbCustomColors callback, + gpointer user_data); +void color_group_add_color (ColorGroup *cg, GdkColor const * const color); + +G_END_DECLS + +#endif /* GNOME_APP_LIB__COLOR_GROUP_H */ diff --git a/src/mygal/color-palette.c b/src/mygal/color-palette.c new file mode 100644 index 00000000..49d47795 --- /dev/null +++ b/src/mygal/color-palette.c @@ -0,0 +1,661 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * color-palette.c - A color selector palette + * Copyright 2000, 2001, Ximian, Inc. + * + * Authors: + * This code was extracted from widget-color-combo.c + * written by Miguel de Icaza (miguel@kernel.org) and + * Dom Lachowicz (dominicl@seas.upenn.edu). The extracted + * code was re-packaged into a separate object by + * Michael Levy (mlevy@genoscope.cns.fr) + * And later revised and polished by + * Almer S. Tigelaar (almer@gnome.org) + * + * Modified for gLabels by: + * Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "e-util.h" +#include "color-group.h" +#include "color-palette.h" +#include "e-colors.h" + +#define COLOR_PREVIEW_WIDTH 15 +#define COLOR_PREVIEW_HEIGHT 15 + +enum { + COLOR_CHANGED, + LAST_SIGNAL +}; + +struct _ColorNamePair { + char *color; /* rgb color or otherwise - eg. "#FFFFFF" */ + char *name; /* english name - eg. "white" */ +}; + +static guint color_palette_signals [LAST_SIGNAL] = { 0, }; + +#define PARENT_TYPE GTK_TYPE_VBOX +static GObjectClass *color_palette_parent_class; + +#define make_color(P,COL) (((COL) != NULL) ? (COL) : ((P) ? ((P)->default_color) : NULL)) + +static void +color_palette_destroy (GtkObject *object) +{ + ColorPalette *P = COLOR_PALETTE (object); + GtkObjectClass *klass = (GtkObjectClass *)color_palette_parent_class; + + if (P->tool_tip) { + g_object_unref (P->tool_tip); + P->tool_tip = NULL; + } + + if (P->current_color) { + gdk_color_free (P->current_color); + P->current_color = NULL; + } + + color_palette_set_group (P, NULL); + + memset (P->items, 0, P->total * sizeof (GnomeCanvasItem *)); + + if (klass->destroy) + klass->destroy (object); +} + +static void +color_palette_finalize (GObject *object) +{ + ColorPalette *P = COLOR_PALETTE (object); + + g_free (P->items); + + (*color_palette_parent_class->finalize) (object); +} + +static void +color_palette_class_init (GObjectClass *object_class) +{ + object_class->finalize = color_palette_finalize; + ((GtkObjectClass *)object_class)->destroy = color_palette_destroy; + + color_palette_parent_class = g_type_class_peek_parent (object_class); + + color_palette_signals [COLOR_CHANGED] = + g_signal_new ("color_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ColorPaletteClass, color_changed), + NULL, NULL, + e_marshal_NONE__POINTER_BOOLEAN_BOOLEAN_BOOLEAN, + G_TYPE_NONE, 4, G_TYPE_POINTER, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); +} + +E_MAKE_TYPE (color_palette, + "ColorPalette", + ColorPalette, + color_palette_class_init, + NULL, + PARENT_TYPE) + +static void +emit_color_changed (ColorPalette *P, GdkColor *color, + gboolean custom, gboolean by_user, gboolean is_default) +{ + GdkColor *new = make_color (P, color); + + if (new != NULL) + new = gdk_color_copy (new); + if (P->current_color) + gdk_color_free (P->current_color); + P->current_color = new; + P->current_is_default = is_default; + + /* Only add custom colors to the group */ + if (custom && color) + color_group_add_color (P->color_group, color); + + g_signal_emit (P, color_palette_signals [COLOR_CHANGED], 0, + color, custom, by_user, is_default); +} + + +/* + * Add the new custom color as the first custom color in the custom color rows + * and shift all of the others 'one step down' + * + * Also take care of setting up the GtkColorButton 'display' + */ +static void +color_palette_change_custom_color (ColorPalette *P, GdkColor const * const new) +{ + int index; + GnomeCanvasItem *item; + GnomeCanvasItem *next_item; + + g_return_if_fail (P != NULL); + g_return_if_fail (new != NULL); + g_return_if_fail (P->picker); + + /* make sure there is room */ + if (P->custom_color_pos == -1) + return; + + for (index = P->custom_color_pos; index < P->total - 1; index++) { + GdkColor *color; + GdkColor *outline; + item = P->items[index]; + next_item = P->items[index + 1]; + + g_object_get (G_OBJECT (next_item), + "fill_color_gdk", &color, + "outline_color_gdk", &outline, + NULL); + gnome_canvas_item_set (item, + "fill_color_gdk", color, + "outline_color_gdk", outline, + NULL); + gdk_color_free (color); + gdk_color_free (outline); + } + item = P->items[index]; + gnome_canvas_item_set (item, + "fill_color_gdk", new, + "outline_color_gdk", new, + NULL); + gtk_color_button_set_color (P->picker, new); +} + +/* + * The custom color box was clicked. Find out its value and emit it + * And add it to the custom color row + */ +static void +cust_color_set (GtkWidget *color_picker, ColorPalette *P) +{ + GdkColor c_color; + + gtk_color_button_get_color (GTK_COLOR_BUTTON (color_picker), &c_color); + + e_color_alloc_gdk (NULL, &c_color); + emit_color_changed (P, &c_color, TRUE, TRUE, FALSE); +} + +static void +cb_default_clicked (GtkWidget *button, ColorPalette *P) +{ + emit_color_changed (P, P->default_color, FALSE, TRUE, TRUE); +} + +/* + * Something in our table was clicked. Find out what and emit it + */ +static void +color_clicked (GtkWidget *button, ColorPalette *P) +{ + int index; + GnomeCanvasItem *item; + GdkColor *gdk_color; + + index = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (button))); + item = P->items[index]; + + g_object_get (item, + "fill_color_gdk", &gdk_color, + NULL); + + emit_color_changed (P, gdk_color, FALSE, TRUE, FALSE); + + gdk_color_free (gdk_color); +} + +/* + * The color group sent the 'custom_color_add' signal + */ +static void +cb_group_custom_color_add (GtkObject *cg, GdkColor *color, ColorPalette *P) +{ + GdkColor *new; + + new = make_color (P, color); + color_palette_change_custom_color (P, new); +} + +/* + * Find out if a color is in the default palette (not in the custom colors!) + * + * Utility function + */ +static gboolean +color_in_palette (ColorNamePair *set, GdkColor *color) +{ + int i; + + g_return_val_if_fail (set != NULL, FALSE); + + if (color == NULL) + return TRUE; + + /* Iterator over all the colors and try to find + * if we can find @color + */ + for (i = 0; set[i].color != NULL; i++) { + GdkColor current; + + gdk_color_parse (set[i].color, ¤t); + + if (gdk_color_equal (color, ¤t)) + return TRUE; + } + + return FALSE; +} + +/* + * Create the individual color buttons + * + * Utility function + */ +static GnomeCanvasItem * +color_palette_button_new(ColorPalette *P, GtkTable* table, + GtkTooltips *tool_tip, ColorNamePair* color_name, + gint col, gint row, int data) +{ + GtkWidget *button; + GtkWidget *canvas; + GnomeCanvasItem *item; + + button = gtk_button_new (); + gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); + + canvas = gnome_canvas_new (); + + gtk_widget_set_usize (canvas, COLOR_PREVIEW_WIDTH, COLOR_PREVIEW_HEIGHT); + gtk_container_add (GTK_CONTAINER (button), canvas); + + item = gnome_canvas_item_new (GNOME_CANVAS_GROUP (gnome_canvas_root + (GNOME_CANVAS (canvas))), + gnome_canvas_rect_get_type (), + "x1", 0.0, + "y1", 0.0, + "x2", (double) COLOR_PREVIEW_WIDTH, + "y2", (double) COLOR_PREVIEW_HEIGHT, + "fill_color", color_name->color, + NULL); + + gtk_tooltips_set_tip (tool_tip, button, _(color_name->name), + "Private+Unused"); + + gtk_table_attach (table, button, + col, col+1, row, row+1, GTK_FILL, GTK_FILL, 1, 1); + + g_signal_connect (button, "clicked", + G_CALLBACK (color_clicked), P); + gtk_object_set_user_data (GTK_OBJECT (button), + GINT_TO_POINTER (data)); + return item; +} + +static void +cb_custom_colors (GdkColor const * const color, gpointer data) +{ + ColorPalette *P = data; + + if (color) + color_palette_change_custom_color (P, color); +} + +/* + * gets history information from the group + */ +static void +custom_color_history_setup(ColorPalette *P) +{ + g_return_if_fail (P != NULL); + g_return_if_fail (P->color_group != NULL); + + /* Sync our own palette with all the custom colors in the group */ + color_group_get_custom_colors (P->color_group, (CbCustomColors) cb_custom_colors, P); +} + +/* + * Creates the color table + */ +static GtkWidget * +color_palette_setup (ColorPalette *P, + char const * const no_color_label, + int ncols, int nrows, + ColorNamePair *color_names) +{ + GtkWidget *default_button; + GtkWidget *cust_label; + GtkWidget *table; + GtkTooltips *tool_tip; + int total, row, col; + + table = gtk_table_new (ncols, nrows, FALSE); + + if (no_color_label != NULL) { + default_button = gtk_button_new_with_label (no_color_label); + + gtk_table_attach (GTK_TABLE (table), default_button, + 0, ncols, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); + g_signal_connect (default_button, "clicked", + G_CALLBACK (cb_default_clicked), P); + } + + P->tool_tip = tool_tip = gtk_tooltips_new (); + g_object_ref (P->tool_tip); + gtk_object_sink (GTK_OBJECT (P->tool_tip)); + + P->custom_color_pos = -1; + total = 0; + + for (row = 0; row < nrows; row++) { + for (col = 0; col < ncols; col++) { + int pos; + + pos = row * ncols + col; + /* + * If we are done with all of the colors in color_names + */ + if (color_names [pos].color == NULL) { + /* This is the default custom color */ + ColorNamePair color_name = {"#000", N_("custom")}; + row++; + if (col == 0 || row < nrows) { + /* Add a full row for custom colors */ + for (col = 0; col < ncols; col++) { + /* Have we set custom pos yet ? */ + if (P->custom_color_pos == -1) { + P->custom_color_pos = total; + } + P->items[total] = + color_palette_button_new( + P, + GTK_TABLE (table), + GTK_TOOLTIPS (tool_tip), + &(color_name), + col, + row + 1, + total); + total++; + } + } + /* Break out of two for-loops. */ + row = nrows; + break; + } + + P->items[total] = + color_palette_button_new ( + P, + GTK_TABLE (table), + GTK_TOOLTIPS (tool_tip), + &(color_names [pos]), + col, + row + 1, + total); + total++; + } + } + P->total = total; + + + /* "Custom" color - we'll pop up a GtkColorButton */ + cust_label = gtk_label_new (_("Custom Color:")); + gtk_table_attach (GTK_TABLE (table), cust_label, 0, ncols - 3 , + row + 1, row + 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); + /* + Keep a pointer to the picker so that we can update it's color + to keep it in synch with that of other members of the group + */ + P->picker = GTK_COLOR_BUTTON (gtk_color_button_new ()); + gtk_color_button_set_title (P->picker, _("Choose Custom Color")); + gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (P->picker), ncols - 3, ncols, + row + 1, row + 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); + g_signal_connect (P->picker, "color-set", + G_CALLBACK (cust_color_set), P); + return table; +} + +void +color_palette_set_color_to_default (ColorPalette *P) +{ + g_return_if_fail (P != NULL); + g_return_if_fail (IS_COLOR_GROUP (P->color_group)); + + emit_color_changed (P, P->default_color, FALSE, TRUE, TRUE); +} + +void +color_palette_set_current_color (ColorPalette *P, GdkColor *color) +{ + g_return_if_fail (P != NULL); + g_return_if_fail (IS_COLOR_GROUP (P->color_group)); + + if (color) + emit_color_changed + (P, color, color_in_palette (P->default_set, color), + FALSE, FALSE); + else + color_palette_set_color_to_default (P); +} + +GdkColor * +color_palette_get_current_color (ColorPalette *P, gboolean *is_default) +{ + g_return_val_if_fail (P != NULL, NULL); + g_return_val_if_fail (IS_COLOR_GROUP (P->color_group), NULL); + + if (is_default != NULL) + *is_default = P->current_is_default; + + return P->current_color ? gdk_color_copy (P->current_color) : NULL; +} + +GtkWidget * +color_palette_get_color_picker (ColorPalette *P) +{ + g_return_val_if_fail (IS_COLOR_PALETTE (P), NULL); + + return GTK_WIDGET (P->picker); +} + + +/* + * Where the actual construction goes on + */ +static void +color_palette_construct (ColorPalette *P, + char const * const no_color_label, + int ncols, int nrows) +{ + GtkWidget * table; + g_return_if_fail (P != NULL); + g_return_if_fail (IS_COLOR_PALETTE (P)); + + P->items = g_malloc (sizeof (GnomeCanvasItem *) * ncols * nrows); + + /* + * Our table selector + */ + table = color_palette_setup (P, no_color_label, ncols, + nrows, P->default_set); + gtk_container_add (GTK_CONTAINER(P), table); +} + +/* + * More verbose constructor. Allows for specifying the rows, columns, and + * Colors this palette will contain + * + * Note that if after placing all of the color_names there remains an entire + * row available then a row of custum colors (initialized to black) is added + * + */ +static GtkWidget* +color_palette_new_with_vals (char const * const no_color_label, + int ncols, int nrows, ColorNamePair *color_names, + GdkColor *default_color, + ColorGroup *cg) +{ + ColorPalette *P; + + g_return_val_if_fail (color_names != NULL, NULL); + + P = g_object_new (COLOR_PALETTE_TYPE, NULL); + + P->default_set = color_names; + P->default_color = default_color; + P->current_color = default_color ? gdk_color_copy (default_color) : NULL; + P->current_is_default = TRUE; + color_palette_set_group (P, cg); + + color_palette_construct (P, no_color_label, ncols, nrows); + custom_color_history_setup(P); + + return GTK_WIDGET (P); +} + +/** + * color_palette_set_group : absorbs the reference to the group + */ +void +color_palette_set_group (ColorPalette *P, ColorGroup *cg) +{ + if (P->color_group == cg) + return; + + if (P->color_group) { + g_signal_handlers_disconnect_by_func ( + G_OBJECT (P->color_group), + G_CALLBACK (cb_group_custom_color_add), + P); + g_object_unref (G_OBJECT (P->color_group)); + P->color_group = NULL; + } + if (cg != NULL) { + P->color_group = COLOR_GROUP (cg); + g_signal_connect (G_OBJECT (cg), "custom_color_add", + G_CALLBACK (cb_group_custom_color_add), + P); + + } +} + +static ColorNamePair default_color_set [] = { + {"#000000", N_("black")}, + {"#993300", N_("light brown")}, + {"#333300", N_("brown gold")}, + {"#003300", N_("dark green #2")}, + {"#003366", N_("navy")}, + {"#000080", N_("dark blue")}, + {"#333399", N_("purple #2")}, + {"#333333", N_("very dark gray")}, + + + {"#800000", N_("dark red")}, + {"#FF6600", N_("red-orange")}, + {"#808000", N_("gold")}, + {"#008000", N_("dark green")}, + {"#008080", N_("dull blue")}, + {"#0000FF", N_("blue")}, + {"#666699", N_("dull purple")}, + {"#808080", N_("dark grey")}, + + + {"#FF0000", N_("red")}, + {"#FF9900", N_("orange")}, + {"#99CC00", N_("lime")}, + {"#339966", N_("dull green")}, + {"#33CCCC",N_("dull blue #2")}, + {"#3366FF", N_("sky blue #2")}, + {"#800080", N_("purple")}, + {"#969696", N_("gray")}, + + + {"#FF00FF", N_("magenta")}, + {"#FFCC00", N_("bright orange")}, + {"#FFFF00", N_("yellow")}, + {"#00FF00", N_("green")}, + {"#00FFFF", N_("cyan")}, + {"#00CCFF", N_("bright blue")}, + {"#993366", N_("red purple")}, + {"#C0C0C0", N_("light grey")}, + + + {"#FF99CC", N_("pink")}, + {"#FFCC99", N_("light orange")}, + {"#FFFF99", N_("light yellow")}, + {"#CCFFCC", N_("light green")}, + {"#CCFFFF", N_("light cyan")}, + {"#99CCFF", N_("light blue")}, + {"#CC99FF", N_("light purple")}, + {"#FFFFFF", N_("white")}, + + /* Disable these for now, they are mostly repeats */ + {NULL, NULL}, + + {"#9999FF", N_("purplish blue")}, + {"#993366", N_("red purple")}, + {"#FFFFCC", N_("light yellow")}, + {"#CCFFFF", N_("light blue")}, + {"#660066", N_("dark purple")}, + {"#FF8080", N_("pink")}, + {"#0066CC", N_("sky blue")}, + {"#CCCCFF", N_("light purple")}, + + {"#000080", N_("dark blue")}, + {"#FF00FF", N_("magenta")}, + {"#FFFF00", N_("yellow")}, + {"#00FFFF", N_("cyan")}, + {"#800080", N_("purple")}, + {"#800000", N_("dark red")}, + {"#008080", N_("dull blue")}, + {"#0000FF", N_("blue")}, + + {NULL, NULL} +}; + + + +/* + * Default constructor. Pass an optional label for + * the no/auto color button. + * + */ +GtkWidget* +color_palette_new (const char *no_color_label, + GdkColor *default_color, ColorGroup *color_group) +{ + /* specify 6 rows to allow for a row of custom colors */ + return color_palette_new_with_vals (no_color_label, + 8, 6, + default_color_set, default_color, + color_group); +} diff --git a/src/mygal/color-palette.h b/src/mygal/color-palette.h new file mode 100644 index 00000000..b2b281c7 --- /dev/null +++ b/src/mygal/color-palette.h @@ -0,0 +1,113 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * color-palette.h - A color selector palette + * Copyright 2000, 2001, Ximian, Inc. + * + * Authors: + * This code was extracted from widget-color-combo.c + * written by Miguel de Icaza (miguel@kernel.org) and + * Dom Lachowicz (dominicl@seas.upenn.edu). The extracted + * code was re-packaged into a separate object by + * Michael Levy (mlevy@genoscope.cns.fr) + * And later revised and polished by + * Almer S. Tigelaar (almer@gnome.org) + * + * Modified for gLabels by: + * Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef GNUMERIC_COLOR_PALETTE_H +#define GNUMERIC_COLOR_PALETTE_H + +#include +#include +#include +#include +#include +#include "color-group.h" + +G_BEGIN_DECLS + +typedef struct _ColorNamePair ColorNamePair; + +typedef struct _ColorPalette { + GtkVBox vbox; + GtkTooltips *tool_tip; + GtkColorButton *picker; + /* + * Array of colors + */ + GnomeCanvasItem **items; + /* The (potentially NULL) default color */ + GdkColor *default_color; + + /* The current color */ + GdkColor *current_color; + gboolean current_is_default; + + /* + * Position of the last possible position + * for custom colors in **items + * (i.e. custom colors go from items[custom_color_pos] + * to items[total - 1]) + * + * If custom_color_pos == -1, there is no room for custom colors + */ + int custom_color_pos; + /* + * Number of default colors in **items + */ + int total; + + /* The table with our default color names */ + ColorNamePair *default_set; + + /* The color group to which we belong */ + ColorGroup *color_group; +} ColorPalette; + +typedef struct { + GtkVBoxClass parent_class; + + /* Signals emited by this widget */ + void (* color_changed) (ColorPalette *color_palette, GdkColor *color, + gboolean custom, gboolean by_user, gboolean is_default); +} ColorPaletteClass; + +#define COLOR_PALETTE_TYPE (color_palette_get_type ()) +#define COLOR_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), COLOR_PALETTE_TYPE, ColorPalette)) +#define COLOR_PALETTE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST(k), COLOR_PALETTE_TYPE) +#define IS_COLOR_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), COLOR_PALETTE_TYPE)) + +GtkType color_palette_get_type (void); + +GtkWidget *color_palette_new (const char *no_color_label, + GdkColor *default_color, + ColorGroup *color_group); +void color_palette_set_group (ColorPalette *P, + ColorGroup *cg); + +void color_palette_set_current_color (ColorPalette *P, GdkColor *color); +void color_palette_set_color_to_default (ColorPalette *P); +GdkColor *color_palette_get_current_color (ColorPalette *P, gboolean *is_default); +GtkWidget *color_palette_get_color_picker (ColorPalette *P); + +G_END_DECLS + +#endif /* GNUMERIC_PALETTE_H */ + + diff --git a/src/mygal/e-colors.c b/src/mygal/e-colors.c new file mode 100644 index 00000000..fc4bf483 --- /dev/null +++ b/src/mygal/e-colors.c @@ -0,0 +1,106 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * e-colors.c - General color allocation utilities + * Copyright 2000, 2001, Ximian, Inc. + * + * Authors: + * Miguel de Icaza (miguel@kernel.org) + * + * Modified for gLabels by: + * Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +/* We keep our own color context, as the color allocation might take + * place before things are realized. + */ + +#include +#include +#include "e-colors.h" + +GdkColor e_white, e_dark_gray, e_black; + +gulong +e_color_alloc (gushort red, gushort green, gushort blue) +{ + e_color_init (); + + red >>= 8; + green >>= 8; + blue >>= 8; + return gdk_rgb_xpixel_from_rgb ( + ((red & 0xff) << 16) | ((green & 0xff) << 8) | + (blue & 0xff)); +} + +void +e_color_alloc_gdk (GtkWidget *widget, GdkColor *c) +{ + GdkColormap *map; + + e_color_init (); + + if (widget) + map = gtk_widget_get_colormap (widget); + else /* FIXME: multi depth broken ? */ + map = gtk_widget_get_default_colormap (); + + gdk_rgb_find_color (map, c); +} + +void +e_color_alloc_name (GtkWidget *widget, const char *name, GdkColor *c) +{ + GdkColormap *map; + + e_color_init (); + + gdk_color_parse (name, c); + + if (widget) + map = gtk_widget_get_colormap (widget); + else /* FIXME: multi depth broken ? */ + map = gtk_widget_get_default_colormap (); + + gdk_rgb_find_color (map, c); +} + +void +e_color_init (void) +{ + static gboolean e_color_inited = FALSE; + + /* It's surprisingly easy to end up calling this twice. Survive. */ + if (e_color_inited) + return; + + e_color_inited = TRUE; + + /* Allocate the default colors */ + e_white.red = 65535; + e_white.green = 65535; + e_white.blue = 65535; + e_color_alloc_gdk (NULL, &e_white); + + e_black.red = 0; + e_black.green = 0; + e_black.blue = 0; + e_color_alloc_gdk (NULL, &e_black); + + e_color_alloc_name (NULL, "gray20", &e_dark_gray); +} + diff --git a/src/mygal/e-colors.h b/src/mygal/e-colors.h new file mode 100644 index 00000000..13665046 --- /dev/null +++ b/src/mygal/e-colors.h @@ -0,0 +1,47 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * e-colors.h + * Copyright 2000, 2001, Ximian, Inc. + * + * Authors: + * Miguel de Icaza (miguel@kernel.org) + * + * Modified for gLabels by: + * Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef GNOME_APP_LIBS_COLOR_H +#define GNOME_APP_LIBS_COLOR_H + +#include +#include +#include + +G_BEGIN_DECLS + +void e_color_init (void); + +/* Return the pixel value for the given red, green and blue */ +gulong e_color_alloc (gushort red, gushort green, gushort blue); +void e_color_alloc_name (GtkWidget *widget, const char *name, GdkColor *color); +void e_color_alloc_gdk (GtkWidget *widget, GdkColor *color); + +extern GdkColor e_white, e_dark_gray, e_black; + +G_END_DECLS + +#endif /* GNOME_APP_LIBS_COLOR_H */ diff --git a/src/mygal/e-marshal.list b/src/mygal/e-marshal.list new file mode 100644 index 00000000..92496dbd --- /dev/null +++ b/src/mygal/e-marshal.list @@ -0,0 +1,51 @@ +BOOLEAN:INT,INT,OBJECT,INT,INT,UINT +BOOLEAN:INT,POINTER,INT,OBJECT,INT,INT,UINT +BOOLEAN:NONE +BOOLEAN:OBJECT +BOOLEAN:OBJECT,DOUBLE,DOUBLE,BOOLEAN +BOOLEAN:POINTER,POINTER,INT,INT,INT +BOOLEAN:POINTER,POINTER,POINTER,INT,INT,INT +BOOLEAN:STRING,INT +DOUBLE:OBJECT,DOUBLE,DOUBLE,BOOLEAN +INT:BOXED +INT:INT +INT:INT,INT,BOXED +INT:INT,POINTER,INT,BOXED +INT:OBJECT,BOXED +INT:POINTER +NONE:BOXED +NONE:BOXED,INT +NONE:BOXED,INT,INT +NONE:DOUBLE +NONE:INT +NONE:INT,INT +NONE:INT,INT,BOXED +NONE:INT,INT,OBJECT +NONE:INT,INT,OBJECT,BOXED,UINT,UINT +NONE:INT,INT,OBJECT,INT,INT,BOXED,UINT,UINT +NONE:INT,INT,OBJECT,POINTER,UINT,UINT +NONE:INT,INT,OBJECT,UINT +NONE:INT,INT,STRING,STRING +NONE:INT,INT,STRING,STRING,POINTER +NONE:INT,POINTER +NONE:INT,POINTER,INT,BOXED +NONE:INT,POINTER,INT,OBJECT +NONE:INT,POINTER,INT,OBJECT,BOXED,UINT,UINT +NONE:INT,POINTER,INT,OBJECT,INT,INT,BOXED,UINT,UINT +NONE:INT,POINTER,INT,OBJECT,UINT +NONE:INT,STRING +NONE:NONE +NONE:OBJECT +NONE:OBJECT,OBJECT +NONE:OBJECT,DOUBLE,DOUBLE,BOOLEAN +NONE:POINTER +NONE:POINTER,BOOLEAN +NONE:POINTER,BOOLEAN,BOOLEAN,BOOLEAN +NONE:POINTER,INT +NONE:POINTER,INT,INT +NONE:POINTER,INT,INT,INT +NONE:POINTER,INT,OBJECT +NONE:POINTER,POINTER +NONE:POINTER,POINTER,INT +OBJECT:OBJECT,DOUBLE,DOUBLE,BOOLEAN +POINTER:NONE diff --git a/src/mygal/e-util.h b/src/mygal/e-util.h new file mode 100644 index 00000000..7bc39783 --- /dev/null +++ b/src/mygal/e-util.h @@ -0,0 +1,234 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * e-util.h + * Copyright 2000, 2001, Ximian, Inc. + * + * Authors: + * Chris Lahey + * + * Modified for gLabels by: + * Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef _E_UTIL_H_ +#define _E_UTIL_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#pragma } +#endif /* __cplusplus */ + +#include "e-marshal.h" + +#define E_MAKE_TYPE(l,str,t,ci,i,parent) \ +GType l##_get_type(void)\ +{\ + static GType type = 0; \ + if (!type){ \ + static GTypeInfo const object_info = { \ + sizeof (t##Class), \ + \ + (GBaseInitFunc) NULL, \ + (GBaseFinalizeFunc) NULL, \ + \ + (GClassInitFunc) ci, \ + (GClassFinalizeFunc) NULL, \ + NULL, /* class_data */ \ + \ + sizeof (t), \ + 0, /* n_preallocs */ \ + (GInstanceInitFunc) i, \ + }; \ + type = g_type_register_static (parent, str, &object_info, 0); \ + } \ + return type; \ +} + + +#define E_MAKE_X_TYPE(l,str,t,ci,i,parent,poa_init,offset) \ +GtkType l##_get_type(void) \ +{ \ + static GtkType type = 0; \ + if (!type){ \ + GTypeInfo info = { \ + sizeof (t##Class), \ + \ + (GBaseInitFunc) NULL, \ + (GBaseFinalizeFunc) NULL, \ + \ + (GClassInitFunc) ci, \ + (GClassFinalizeFunc) NULL, \ + \ + NULL, /* class_data */ \ + \ + sizeof (t), \ + 0, /* n_preallocs */ \ + (GInstanceInitFunc) i, \ + }; \ + type = bonobo_x_type_unique ( \ + parent, poa_init, NULL, \ + offset, &info, str); \ + } \ + return type; \ +} + +#define GET_STRING_ARRAY_FROM_ELLIPSIS(labels, first_string) \ + { \ + va_list args; \ + int i; \ + char *s; \ + \ + va_start (args, (first_string)); \ + \ + i = 0; \ + for (s = (first_string); s; s = va_arg (args, char *)) \ + i++; \ + va_end (args); \ + \ + (labels) = g_new (char *, i + 1); \ + \ + va_start (args, (first_string)); \ + i = 0; \ + for (s = (first_string); s; s = va_arg (args, char *)) \ + (labels)[i++] = s; \ + \ + va_end (args); \ + (labels)[i] = NULL; \ + } + + +#define GET_DUPLICATED_STRING_ARRAY_FROM_ELLIPSIS(labels, first_string) \ + { \ + int i; \ + GET_STRING_ARRAY_FROM_ELLIPSIS ((labels), (first_string)); \ + for (i = 0; labels[i]; i++) \ + labels[i] = g_strdup (labels[i]); \ + } + + +#if 0 +# define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last) \ + gtk_object_class_add_signals (oc, sigs, last) +# define E_OBJECT_CLASS_TYPE(oc) (oc)->type +#else +# define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last) +# define E_OBJECT_CLASS_TYPE(oc) G_TYPE_FROM_CLASS (oc) +#endif + + +typedef enum { + E_FOCUS_NONE, + E_FOCUS_CURRENT, + E_FOCUS_START, + E_FOCUS_END +} EFocus; +int g_str_compare (const void *x, + const void *y); +int g_collate_compare (const void *x, + const void *y); +int g_int_compare (const void *x, + const void *y); +char *e_strdup_strip (const char *string); +void e_free_object_list (GList *list); +void e_free_object_slist (GSList *list); +void e_free_string_list (GList *list); +void e_free_string_slist (GSList *list); +char *e_read_file (const char *filename); +int e_write_file (const char *filename, + const char *data, + int flags); +int e_write_file_mkstemp (char *filename, + const char *data); +int e_mkdir_hier (const char *path, + mode_t mode); + +gchar **e_strsplit (const gchar *string, + const gchar *delimiter, + gint max_tokens); +gchar *e_strstrcase (const gchar *haystack, + const gchar *needle); +/* This only makes a filename safe for usage as a filename. It still may have shell meta-characters in it. */ +void e_filename_make_safe (gchar *string); +gchar *e_format_number (gint number); +gchar *e_format_number_float (gfloat number); +gboolean e_create_directory (gchar *directory); +gchar **e_strdupv (const gchar **str_array); + + +typedef int (*ESortCompareFunc) (const void *first, + const void *second, + gpointer closure); +void e_sort (void *base, + size_t nmemb, + size_t size, + ESortCompareFunc compare, + gpointer closure); +void e_bsearch (const void *key, + const void *base, + size_t nmemb, + size_t size, + ESortCompareFunc compare, + gpointer closure, + size_t *start, + size_t *end); +size_t e_strftime_fix_am_pm (char *s, + size_t max, + const char *fmt, + const struct tm *tm); + +size_t e_strftime (char *s, + size_t max, + const char *fmt, + const struct tm *tm); + +size_t e_utf8_strftime_fix_am_pm (char *s, + size_t max, + const char *fmt, + const struct tm *tm); + +size_t e_utf8_strftime (char *s, + size_t max, + const char *fmt, + const struct tm *tm); + +/* String to/from double conversion functions */ +gdouble e_flexible_strtod (const gchar *nptr, + gchar **endptr); + +/* 29 bytes should enough for all possible values that + * g_ascii_dtostr can produce with the %.17g format. + * Then add 10 for good measure */ +#define E_ASCII_DTOSTR_BUF_SIZE (DBL_DIG + 12 + 10) +gchar *e_ascii_dtostr (gchar *buffer, + gint buf_len, + const gchar *format, + gdouble d); + +/* Alternating char * and int arguments with a NULL char * to end. + Less than 0 for the int means copy the whole string. */ +gchar *e_strdup_append_strings (gchar *first_string, + ...); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _E_UTIL_H_ */ diff --git a/src/mygal/mygal-combo-box.c b/src/mygal/mygal-combo-box.c new file mode 100644 index 00000000..adf1c648 --- /dev/null +++ b/src/mygal/mygal-combo-box.c @@ -0,0 +1,837 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * mygal-combo-box.c - a customizable combobox + * Copyright 2000, 2001, Ximian, Inc. + * + * Authors: + * Miguel de Icaza (miguel@gnu.org) + * Adrian E Feiguin (feiguin@ifir.edu.ar) + * Paolo Molnaro (lupus@debian.org). + * Jon K Hellan (hellan@acm.org) + * + * Modified for gLabels by: + * Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "mygal-combo-box.h" +#include "e-util.h" + +#define PARENT_TYPE GTK_TYPE_HBOX +static GObjectClass *mygal_combo_box_parent_class; + +static int mygal_combo_toggle_pressed (GtkToggleButton *tbutton, + MygalComboBox *combo_box); +static void mygal_combo_popup_tear_off (MygalComboBox *combo, + gboolean set_position); +static void mygal_combo_set_tearoff_state (MygalComboBox *combo, + gboolean torn_off); +static void mygal_combo_popup_reparent (GtkWidget *popup, GtkWidget *new_parent, + gboolean unrealize); +static gboolean cb_popup_delete (GtkWidget *w, GdkEventAny *event, + MygalComboBox *combo); +static void mygal_combo_tearoff_bg_copy (MygalComboBox *combo); + +enum { + POP_DOWN_WIDGET, + POP_DOWN_DONE, + PRE_POP_DOWN, + POST_POP_HIDE, + LAST_SIGNAL +}; + +static guint mygal_combo_box_signals [LAST_SIGNAL] = { 0, }; + +struct _MygalComboBoxPrivate { + GtkWidget *pop_down_widget; + GtkWidget *display_widget; + + /* + * Internal widgets used to implement the ComboBox + */ + GtkWidget *frame; + GtkWidget *arrow_button; + + GtkWidget *toplevel; /* Popup's toplevel when not torn off */ + GtkWidget *tearoff_window; /* Popup's toplevel when torn off */ + guint torn_off; + + GtkWidget *tearable; /* The tearoff "button" */ + GtkWidget *popup; /* Popup */ + + /* + * Closure for invoking the callbacks above + */ + void *closure; +}; + +static void +mygal_combo_box_finalize (GObject *object) +{ + MygalComboBox *combo_box = MYGAL_COMBO_BOX (object); + + g_free (combo_box->priv); + + mygal_combo_box_parent_class->finalize (object); +} + +static void +mygal_combo_box_destroy (GtkObject *object) +{ + GtkObjectClass *klass = (GtkObjectClass *)mygal_combo_box_parent_class; + MygalComboBox *combo_box = MYGAL_COMBO_BOX (object); + + if (combo_box->priv->toplevel) { + gtk_object_destroy (GTK_OBJECT (combo_box->priv->toplevel)); + combo_box->priv->toplevel = NULL; + } + + if (combo_box->priv->tearoff_window) { + gtk_object_destroy (GTK_OBJECT (combo_box->priv->tearoff_window)); + combo_box->priv->tearoff_window = NULL; + } + + if (klass->destroy) + klass->destroy (object); +} + +static gboolean +mygal_combo_box_mnemonic_activate (GtkWidget *w, gboolean group_cycling) +{ + MygalComboBox *combo_box = MYGAL_COMBO_BOX (w); + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (combo_box->priv->arrow_button), TRUE); + return TRUE; +} + +static void +mygal_combo_box_class_init (GObjectClass *object_class) +{ + GtkWidgetClass *widget_class = (GtkWidgetClass *)object_class; + mygal_combo_box_parent_class = g_type_class_peek_parent (object_class); + + object_class->finalize = mygal_combo_box_finalize; + widget_class->mnemonic_activate = mygal_combo_box_mnemonic_activate; + ((GtkObjectClass *)object_class)->destroy = mygal_combo_box_destroy; + + mygal_combo_box_signals [POP_DOWN_WIDGET] = g_signal_new ( + "pop_down_widget", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (MygalComboBoxClass, pop_down_widget), + NULL, NULL, + e_marshal_POINTER__NONE, + G_TYPE_POINTER, 0, G_TYPE_NONE); + + mygal_combo_box_signals [POP_DOWN_DONE] = g_signal_new ( + "pop_down_done", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (MygalComboBoxClass, pop_down_done), + NULL, NULL, + e_marshal_BOOLEAN__OBJECT, + G_TYPE_BOOLEAN, 1, G_TYPE_OBJECT); + + mygal_combo_box_signals [PRE_POP_DOWN] = g_signal_new ( + "pre_pop_down", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (MygalComboBoxClass, pre_pop_down), + NULL, NULL, + e_marshal_NONE__NONE, + G_TYPE_NONE, 0); + + mygal_combo_box_signals [POST_POP_HIDE] = g_signal_new ( + "post_pop_hide", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (MygalComboBoxClass, post_pop_hide), + NULL, NULL, + e_marshal_NONE__NONE, + G_TYPE_NONE, 0); +} + +static void +deactivate_arrow (MygalComboBox *combo_box) +{ + GtkToggleButton *arrow; + + arrow = GTK_TOGGLE_BUTTON (combo_box->priv->arrow_button); + g_signal_handlers_block_matched (arrow, + G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, + 0, 0, NULL, + mygal_combo_toggle_pressed, combo_box); + + gtk_toggle_button_set_active (arrow, FALSE); + + g_signal_handlers_unblock_matched (arrow, + G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, + 0, 0, NULL, + mygal_combo_toggle_pressed, combo_box); +} + +/** + * mygal_combo_box_popup_hide_unconditional + * @combo_box: Combo box + * + * Hide popup, whether or not it is torn off. + */ +static void +mygal_combo_box_popup_hide_unconditional (MygalComboBox *combo_box) +{ + gboolean popup_info_destroyed = FALSE; + + g_return_if_fail (combo_box != NULL); + g_return_if_fail (MYGAL_IS_COMBO_BOX (combo_box)); + + gtk_widget_hide (combo_box->priv->toplevel); + gtk_widget_hide (combo_box->priv->popup); + if (combo_box->priv->torn_off) { + GTK_TEAROFF_MENU_ITEM (combo_box->priv->tearable)->torn_off + = FALSE; + mygal_combo_set_tearoff_state (combo_box, FALSE); + } + + gtk_grab_remove (combo_box->priv->toplevel); + gdk_pointer_ungrab (GDK_CURRENT_TIME); + + g_object_ref (combo_box->priv->pop_down_widget); + g_signal_emit (combo_box, + mygal_combo_box_signals [POP_DOWN_DONE], 0, + combo_box->priv->pop_down_widget, &popup_info_destroyed); + + if (popup_info_destroyed){ + gtk_container_remove ( + GTK_CONTAINER (combo_box->priv->frame), + combo_box->priv->pop_down_widget); + combo_box->priv->pop_down_widget = NULL; + } + g_object_unref (combo_box->priv->pop_down_widget); + deactivate_arrow (combo_box); + + g_signal_emit (combo_box, mygal_combo_box_signals [POST_POP_HIDE], 0); +} + +/** + * mygal_combo_box_popup_hide: + * @combo_box: Combo box + * + * Hide popup, but not when it is torn off. + * This is the external interface - for subclasses and apps which expect a + * regular combo which doesn't do tearoffs. + */ +void +mygal_combo_box_popup_hide (MygalComboBox *combo_box) +{ + if (!combo_box->priv->torn_off) + mygal_combo_box_popup_hide_unconditional (combo_box); + else if (GTK_WIDGET_VISIBLE (combo_box->priv->toplevel)) { + /* Both popup and tearoff window present. Get rid of just + the popup shell. */ + mygal_combo_popup_tear_off (combo_box, FALSE); + deactivate_arrow (combo_box); + } +} + +/* + * Find best location for displaying + */ +void +mygal_combo_box_get_pos (MygalComboBox *combo_box, int *x, int *y) +{ + GtkWidget *wcombo = GTK_WIDGET (combo_box); + int ph, pw; + + gdk_window_get_origin (wcombo->window, x, y); + *y += wcombo->allocation.height + wcombo->allocation.y; + *x += wcombo->allocation.x; + + ph = combo_box->priv->popup->allocation.height; + pw = combo_box->priv->popup->allocation.width; + + if ((*y + ph) > gdk_screen_height ()) + *y = gdk_screen_height () - ph; + + if ((*x + pw) > gdk_screen_width ()) + *x = gdk_screen_width () - pw; +} + +static void +mygal_combo_box_popup_display (MygalComboBox *combo_box) +{ + int x, y; + + g_return_if_fail (combo_box != NULL); + g_return_if_fail (MYGAL_IS_COMBO_BOX (combo_box)); + + /* + * If we have no widget to display on the popdown, + * create it + */ + if (!combo_box->priv->pop_down_widget){ + GtkWidget *pw = NULL; + + g_signal_emit (combo_box, + mygal_combo_box_signals [POP_DOWN_WIDGET], 0, &pw); + g_assert (pw != NULL); + combo_box->priv->pop_down_widget = pw; + gtk_container_add (GTK_CONTAINER (combo_box->priv->frame), pw); + } + + g_signal_emit (combo_box, mygal_combo_box_signals [PRE_POP_DOWN], 0); + + if (combo_box->priv->torn_off) { + /* To give the illusion that tearoff still displays the + * popup, we copy the image in the popup window to the + * background. Thus, it won't be blank after reparenting */ + mygal_combo_tearoff_bg_copy (combo_box); + + /* We force an unrealize here so that we don't trigger + * redrawing/ clearing code - we just want to reveal our + * backing pixmap. + */ + mygal_combo_popup_reparent (combo_box->priv->popup, + combo_box->priv->toplevel, TRUE); + } + + mygal_combo_box_get_pos (combo_box, &x, &y); + + gtk_widget_set_uposition (combo_box->priv->toplevel, x, y); + gtk_widget_realize (combo_box->priv->popup); + gtk_widget_show (combo_box->priv->popup); + gtk_widget_realize (combo_box->priv->toplevel); + gtk_widget_show (combo_box->priv->toplevel); + + gtk_grab_add (combo_box->priv->toplevel); + gdk_pointer_grab (combo_box->priv->toplevel->window, TRUE, + GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_RELEASE_MASK | + GDK_POINTER_MOTION_MASK, + NULL, NULL, GDK_CURRENT_TIME); +} + +static int +mygal_combo_toggle_pressed (GtkToggleButton *tbutton, MygalComboBox *combo_box) +{ + if (tbutton->active) + mygal_combo_box_popup_display (combo_box); + else + mygal_combo_box_popup_hide_unconditional (combo_box); + + return TRUE; +} + +static gint +mygal_combo_box_button_press (GtkWidget *widget, GdkEventButton *event, MygalComboBox *combo_box) +{ + GtkWidget *child; + + child = gtk_get_event_widget ((GdkEvent *) event); + if (child != widget){ + while (child){ + if (child == widget) + return FALSE; + child = child->parent; + } + } + + mygal_combo_box_popup_hide (combo_box); + return TRUE; +} + +/** + * mygal_combo_box_key_press + * @widget: Widget + * @event: Event + * @combo_box: Combo box + * + * Key press handler which dismisses popup on escape. + * Popup is dismissed whether or not popup is torn off. + */ +static gint +mygal_combo_box_key_press (GtkWidget *widget, GdkEventKey *event, + MygalComboBox *combo_box) +{ + if (event->keyval == GDK_Escape) { + mygal_combo_box_popup_hide_unconditional (combo_box); + return TRUE; + } else + return FALSE; +} + +static void +cb_state_change (GtkWidget *widget, GtkStateType old_state, MygalComboBox *combo_box) +{ + GtkStateType const new_state = GTK_WIDGET_STATE(widget); + gtk_widget_set_state (combo_box->priv->display_widget, new_state); +} + +static void +mygal_combo_box_init (MygalComboBox *combo_box) +{ + GtkWidget *arrow; + GdkCursor *cursor; + + combo_box->priv = g_new0 (MygalComboBoxPrivate, 1); + + /* + * Create the arrow + */ + combo_box->priv->arrow_button = gtk_toggle_button_new (); + gtk_button_set_relief (GTK_BUTTON (combo_box->priv->arrow_button), GTK_RELIEF_NONE); + GTK_WIDGET_UNSET_FLAGS (combo_box->priv->arrow_button, GTK_CAN_FOCUS); + + arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN); + gtk_container_add (GTK_CONTAINER (combo_box->priv->arrow_button), arrow); + gtk_box_pack_end (GTK_BOX (combo_box), combo_box->priv->arrow_button, FALSE, FALSE, 0); + g_signal_connect (combo_box->priv->arrow_button, "toggled", + G_CALLBACK (mygal_combo_toggle_pressed), combo_box); + gtk_widget_show_all (combo_box->priv->arrow_button); + + /* + * prelight the display widget when mousing over the arrow. + */ + g_signal_connect (combo_box->priv->arrow_button, "state-changed", + G_CALLBACK (cb_state_change), combo_box); + + /* + * The pop-down container + */ + + combo_box->priv->toplevel = gtk_window_new (GTK_WINDOW_POPUP); + gtk_widget_ref (combo_box->priv->toplevel); + gtk_object_sink (GTK_OBJECT (combo_box->priv->toplevel)); + gtk_window_set_policy (GTK_WINDOW (combo_box->priv->toplevel), + FALSE, TRUE, FALSE); + + combo_box->priv->popup = gtk_event_box_new (); + gtk_container_add (GTK_CONTAINER (combo_box->priv->toplevel), + combo_box->priv->popup); + gtk_widget_show (combo_box->priv->popup); + + gtk_widget_realize (combo_box->priv->popup); + cursor = gdk_cursor_new (GDK_TOP_LEFT_ARROW); + gdk_window_set_cursor (combo_box->priv->popup->window, cursor); + gdk_cursor_unref (cursor); + + combo_box->priv->torn_off = FALSE; + combo_box->priv->tearoff_window = NULL; + + combo_box->priv->frame = gtk_frame_new (NULL); + gtk_container_add (GTK_CONTAINER (combo_box->priv->popup), + combo_box->priv->frame); + gtk_frame_set_shadow_type (GTK_FRAME (combo_box->priv->frame), GTK_SHADOW_OUT); + + g_signal_connect (combo_box->priv->toplevel, "button_press_event", + G_CALLBACK (mygal_combo_box_button_press), combo_box); + g_signal_connect (combo_box->priv->toplevel, "key_press_event", + G_CALLBACK (mygal_combo_box_key_press), combo_box); +} + +E_MAKE_TYPE (mygal_combo_box, + "MygalComboBox", + MygalComboBox, + mygal_combo_box_class_init, + mygal_combo_box_init, + PARENT_TYPE) + +/** + * mygal_combo_box_set_display: + * @combo_box: the Combo Box to modify + * @display_widget: The widget to be displayed + + * Sets the displayed widget for the @combo_box to be @display_widget + */ +void +mygal_combo_box_set_display (MygalComboBox *combo_box, GtkWidget *display_widget) +{ + g_return_if_fail (combo_box != NULL); + g_return_if_fail (MYGAL_IS_COMBO_BOX (combo_box)); + g_return_if_fail (display_widget != NULL); + g_return_if_fail (GTK_IS_WIDGET (display_widget)); + + if (combo_box->priv->display_widget && + combo_box->priv->display_widget != display_widget) + gtk_container_remove (GTK_CONTAINER (combo_box), + combo_box->priv->display_widget); + + combo_box->priv->display_widget = display_widget; + + gtk_box_pack_start (GTK_BOX (combo_box), display_widget, TRUE, TRUE, 0); +} + +static gboolean +cb_tearable_enter_leave (GtkWidget *w, GdkEventCrossing *event, gpointer data) +{ + gboolean const flag = GPOINTER_TO_INT(data); + gtk_widget_set_state (w, flag ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL); + return FALSE; +} + +/** + * mygal_combo_popup_tear_off + * @combo: Combo box + * @set_position: Set to position of popup shell if true + * + * Tear off the popup + * + * FIXME: + * Gtk popup menus are toplevel windows, not dialogs. I think this is wrong, + * and make the popups dialogs. But may be there should be a way to make + * them toplevel. We can do this after creating: + * GTK_WINDOW (tearoff)->type = GTK_WINDOW_TOPLEVEL; + */ +static void +mygal_combo_popup_tear_off (MygalComboBox *combo, gboolean set_position) +{ + int x, y; + + if (!combo->priv->tearoff_window) { + GtkWidget *tearoff; + gchar *title; + + /* FIXME: made this a toplevel, not a dialog ! */ + tearoff = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_ref (tearoff); + gtk_object_sink (GTK_OBJECT (tearoff)); + combo->priv->tearoff_window = tearoff; + gtk_widget_set_app_paintable (tearoff, TRUE); + g_signal_connect (tearoff, "key_press_event", + G_CALLBACK (mygal_combo_box_key_press), + combo); + gtk_widget_realize (tearoff); + title = g_object_get_data (G_OBJECT (combo), + "gtk-combo-title"); + if (title) + gdk_window_set_title (tearoff->window, title); + gtk_window_set_policy (GTK_WINDOW (tearoff), + FALSE, TRUE, FALSE); + gtk_window_set_transient_for + (GTK_WINDOW (tearoff), + GTK_WINDOW (gtk_widget_get_toplevel + GTK_WIDGET (combo))); + } + + if (GTK_WIDGET_VISIBLE (combo->priv->popup)) { + gtk_widget_hide (combo->priv->toplevel); + + gtk_grab_remove (combo->priv->toplevel); + gdk_pointer_ungrab (GDK_CURRENT_TIME); + } + + mygal_combo_popup_reparent (combo->priv->popup, + combo->priv->tearoff_window, FALSE); + + /* It may have got confused about size */ + gtk_widget_queue_resize (GTK_WIDGET (combo->priv->popup)); + + if (set_position) { + mygal_combo_box_get_pos (combo, &x, &y); + gtk_widget_set_uposition (combo->priv->tearoff_window, x, y); + } + gtk_widget_show (GTK_WIDGET (combo->priv->popup)); + gtk_widget_show (combo->priv->tearoff_window); + +} + +/** + * mygal_combo_set_tearoff_state + * @combo_box: Combo box + * @torn_off: TRUE: Tear off. FALSE: Pop down and reattach + * + * Set the tearoff state of the popup + * + * Compare with gtk_menu_set_tearoff_state in gtk/gtkmenu.c + */ +static void +mygal_combo_set_tearoff_state (MygalComboBox *combo, + gboolean torn_off) +{ + g_return_if_fail (combo != NULL); + g_return_if_fail (MYGAL_IS_COMBO_BOX (combo)); + + if (combo->priv->torn_off != torn_off) { + combo->priv->torn_off = torn_off; + + if (combo->priv->torn_off) { + mygal_combo_popup_tear_off (combo, TRUE); + deactivate_arrow (combo); + } else { + gtk_widget_hide (combo->priv->tearoff_window); + mygal_combo_popup_reparent (combo->priv->popup, + combo->priv->toplevel, + FALSE); + } + } +} + +/** + * mygal_combo_tearoff_bg_copy + * @combo_box: Combo box + * + * Copy popup window image to the tearoff window. + */ +static void +mygal_combo_tearoff_bg_copy (MygalComboBox *combo) +{ + GdkPixmap *pixmap; + GdkGC *gc; + GdkGCValues gc_values; + + GtkWidget *widget = combo->priv->popup; + + if (combo->priv->torn_off) { + gc_values.subwindow_mode = GDK_INCLUDE_INFERIORS; + gc = gdk_gc_new_with_values (widget->window, + &gc_values, GDK_GC_SUBWINDOW); + + pixmap = gdk_pixmap_new (widget->window, + widget->allocation.width, + widget->allocation.height, + -1); + + gdk_draw_drawable (pixmap, gc, + widget->window, + 0, 0, 0, 0, -1, -1); + gdk_gc_unref (gc); + + gtk_widget_set_usize (combo->priv->tearoff_window, + widget->allocation.width, + widget->allocation.height); + + gdk_window_set_back_pixmap + (combo->priv->tearoff_window->window, pixmap, FALSE); + gdk_drawable_unref (pixmap); + } +} + +/** + * mygal_combo_popup_reparent + * @popup: Popup + * @new_parent: New parent + * @unrealize: Unrealize popup if TRUE. + * + * Reparent the popup, taking care of the refcounting + * + * Compare with gtk_menu_reparent in gtk/gtkmenu.c + */ +static void +mygal_combo_popup_reparent (GtkWidget *popup, + GtkWidget *new_parent, + gboolean unrealize) +{ + GtkObject *object = GTK_OBJECT (popup); + gboolean was_floating = GTK_OBJECT_FLOATING (object); + + g_object_ref (object); + gtk_object_sink (object); + + if (unrealize) { + g_object_ref (object); + gtk_container_remove (GTK_CONTAINER (popup->parent), popup); + gtk_container_add (GTK_CONTAINER (new_parent), popup); + g_object_unref (object); + } + else + gtk_widget_reparent (GTK_WIDGET (popup), new_parent); + gtk_widget_set_usize (new_parent, -1, -1); + + if (was_floating) + GTK_OBJECT_SET_FLAGS (object, GTK_FLOATING); + else + g_object_unref (object); +} + +/** + * cb_tearable_button_release + * @w: Widget + * @event: Event + * @combo: Combo box + * + * Toggle tearoff state. + */ +static gboolean +cb_tearable_button_release (GtkWidget *w, GdkEventButton *event, + MygalComboBox *combo) +{ + GtkTearoffMenuItem *tearable; + + g_return_val_if_fail (w != NULL, FALSE); + g_return_val_if_fail (GTK_IS_TEAROFF_MENU_ITEM (w), FALSE); + + tearable = GTK_TEAROFF_MENU_ITEM (w); + tearable->torn_off = !tearable->torn_off; + + if (!combo->priv->torn_off) { + gboolean need_connect; + + need_connect = (!combo->priv->tearoff_window); + mygal_combo_set_tearoff_state (combo, TRUE); + if (need_connect) + g_signal_connect (combo->priv->tearoff_window, + "delete_event", + G_CALLBACK (cb_popup_delete), + combo); + } else + mygal_combo_box_popup_hide_unconditional (combo); + + return TRUE; +} + +static gboolean +cb_popup_delete (GtkWidget *w, GdkEventAny *event, MygalComboBox *combo) +{ + mygal_combo_box_popup_hide_unconditional (combo); + return TRUE; +} + +void +mygal_combo_box_construct (MygalComboBox *combo_box, GtkWidget *display_widget, GtkWidget *pop_down_widget) +{ + GtkWidget *tearable; + GtkWidget *vbox; + + g_return_if_fail (combo_box != NULL); + g_return_if_fail (MYGAL_IS_COMBO_BOX (combo_box)); + g_return_if_fail (display_widget != NULL); + g_return_if_fail (GTK_IS_WIDGET (display_widget)); + + GTK_BOX (combo_box)->spacing = 0; + GTK_BOX (combo_box)->homogeneous = FALSE; + + combo_box->priv->pop_down_widget = pop_down_widget; + combo_box->priv->display_widget = NULL; + + vbox = gtk_vbox_new (FALSE, 5); + tearable = gtk_tearoff_menu_item_new (); + g_signal_connect (tearable, "enter-notify-event", + G_CALLBACK (cb_tearable_enter_leave), + GINT_TO_POINTER (TRUE)); + g_signal_connect (tearable, "leave-notify-event", + G_CALLBACK (cb_tearable_enter_leave), + GINT_TO_POINTER (FALSE)); + g_signal_connect (tearable, "button-release-event", + G_CALLBACK (cb_tearable_button_release), + (gpointer) combo_box); + gtk_box_pack_start (GTK_BOX (vbox), tearable, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), pop_down_widget, TRUE, TRUE, 0); + combo_box->priv->tearable = tearable; + + /* + * Finish setup + */ + mygal_combo_box_set_display (combo_box, display_widget); + + gtk_container_add (GTK_CONTAINER (combo_box->priv->frame), vbox); + gtk_widget_show_all (combo_box->priv->frame); +} + +GtkWidget * +mygal_combo_box_new (GtkWidget *display_widget, GtkWidget *optional_popdown) +{ + MygalComboBox *combo_box; + + g_return_val_if_fail (display_widget != NULL, NULL); + g_return_val_if_fail (GTK_IS_WIDGET (display_widget), NULL); + + combo_box = g_object_new (MYGAL_COMBO_BOX_TYPE, NULL); + mygal_combo_box_construct (combo_box, display_widget, optional_popdown); + return GTK_WIDGET (combo_box); +} + +void +mygal_combo_box_set_arrow_relief (MygalComboBox *cc, GtkReliefStyle relief) +{ + g_return_if_fail (cc != NULL); + g_return_if_fail (MYGAL_IS_COMBO_BOX (cc)); + + gtk_button_set_relief (GTK_BUTTON (cc->priv->arrow_button), relief); +} + +/** + * mygal_combo_box_set_title + * @combo: Combo box + * @title: Title + * + * Set a title to display over the tearoff window. + * + * FIXME: + * + * This should really change the title even when the popup is already torn off. + * I guess the tearoff window could attach a listener to title change or + * something. But I don't think we need the functionality, so I didn't bother + * to investigate. + */ +void +mygal_combo_box_set_title (MygalComboBox *combo, + const gchar *title) +{ + g_return_if_fail (combo != NULL); + g_return_if_fail (MYGAL_IS_COMBO_BOX (combo)); + + g_object_set_data_full (G_OBJECT (combo), "gtk-combo-title", + g_strdup (title), (GDestroyNotify) g_free); +} + +/** + * mygal_combo_box_set_arrow_sensitive + * @combo: Combo box + * @sensitive: Sensitivity value + * + * Toggle the sensitivity of the arrow button + */ + +void +mygal_combo_box_set_arrow_sensitive (MygalComboBox *combo, + gboolean sensitive) +{ + g_return_if_fail (combo != NULL); + + gtk_widget_set_sensitive (combo->priv->arrow_button, sensitive); +} + +/** + * mygal_combo_box_set_tearable: + * @combo: Combo box + * @tearable: whether to allow the @combo to be tearable + * + * controls whether the combo box's pop up widget can be torn off. + */ +void +mygal_combo_box_set_tearable (MygalComboBox *combo, gboolean tearable) +{ + g_return_if_fail (combo != NULL); + g_return_if_fail (MYGAL_IS_COMBO_BOX (combo)); + + if (tearable){ + gtk_widget_show (combo->priv->tearable); + } else { + mygal_combo_set_tearoff_state (combo, FALSE); + gtk_widget_hide (combo->priv->tearable); + } +} diff --git a/src/mygal/mygal-combo-box.h b/src/mygal/mygal-combo-box.h new file mode 100644 index 00000000..e1785f2d --- /dev/null +++ b/src/mygal/mygal-combo-box.h @@ -0,0 +1,94 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * mygal-combo-box.h - a customizable combobox + * Copyright 2000, 2001, Ximian, Inc. + * + * Authors: + * Miguel de Icaza + * + * Modified for gLabels by: + * Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef _MYGAL_COMBO_BOX_H_ +#define _MYGAL_COMBO_BOX_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#define MYGAL_COMBO_BOX_TYPE (mygal_combo_box_get_type()) +#define MYGAL_COMBO_BOX(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, mygal_combo_box_get_type (), MygalComboBox) +#define MYGAL_COMBO_BOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, mygal_combo_box_get_type (), MygalComboBoxClass) +#define MYGAL_IS_COMBO_BOX(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, mygal_combo_box_get_type ()) + +typedef struct _MygalComboBox MygalComboBox; +typedef struct _MygalComboBoxPrivate MygalComboBoxPrivate; +typedef struct _MygalComboBoxClass MygalComboBoxClass; + +struct _MygalComboBox { + GtkHBox hbox; + MygalComboBoxPrivate *priv; +}; + +struct _MygalComboBoxClass { + GtkHBoxClass parent_class; + + GtkWidget *(*pop_down_widget) (MygalComboBox *cbox); + + /* + * invoked when the popup has been hidden, if the signal + * returns TRUE, it means it should be killed from the + */ + gboolean *(*pop_down_done) (MygalComboBox *cbox, GtkWidget *); + + /* + * Notification signals. + */ + void (*pre_pop_down) (MygalComboBox *cbox); + void (*post_pop_hide) (MygalComboBox *cbox); +}; + +GtkType mygal_combo_box_get_type (void); +void mygal_combo_box_construct (MygalComboBox *combo_box, + GtkWidget *display_widget, + GtkWidget *optional_pop_down_widget); +void mygal_combo_box_get_pos (MygalComboBox *combo_box, int *x, int *y); + +GtkWidget *mygal_combo_box_new (GtkWidget *display_widget, + GtkWidget *optional_pop_down_widget); +void mygal_combo_box_popup_hide (MygalComboBox *combo_box); + +void mygal_combo_box_set_display (MygalComboBox *combo_box, + GtkWidget *display_widget); + +void mygal_combo_box_set_title (MygalComboBox *combo, + const gchar *title); + +void mygal_combo_box_set_tearable (MygalComboBox *combo, + gboolean tearable); +void mygal_combo_box_set_arrow_sensitive (MygalComboBox *combo, + gboolean sensitive); +void mygal_combo_box_set_arrow_relief (MygalComboBox *cc, + GtkReliefStyle relief); +#ifdef __cplusplus +}; +#endif /* __cplusplus */ + +#endif /* _MYGAL_COMBO_BOX_H_ */ diff --git a/src/mygal/widget-color-combo.c b/src/mygal/widget-color-combo.c new file mode 100644 index 00000000..8f365456 --- /dev/null +++ b/src/mygal/widget-color-combo.c @@ -0,0 +1,338 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * widget-color-combo.c - A color selector combo box + * Copyright 2000, 2001, Ximian, Inc. + * + * Authors: + * Miguel de Icaza (miguel@kernel.org) + * Dom Lachowicz (dominicl@seas.upenn.edu) + * + * Reworked and split up into a separate ColorPalette object: + * Michael Levy (mlevy@genoscope.cns.fr) + * + * And later revised and polished by: + * Almer S. Tigelaar (almer@gnome.org) + * + * Modified for gLabels by: + * Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include + +#include +#include +#include +#include "e-util.h" +#include "e-colors.h" +#include "widget-color-combo.h" + +enum { + CHANGED, + LAST_SIGNAL +}; + +static guint color_combo_signals [LAST_SIGNAL] = { 0, }; + +#define PARENT_TYPE MYGAL_COMBO_BOX_TYPE +static GObjectClass *color_combo_parent_class; + +#define make_color(CC,COL) (((COL) != NULL) ? (COL) : ((CC) ? ((CC)->default_color) : NULL)) +#define RGBA_TO_UINT(r,g,b,a) ((((guint)(r))<<24)|(((guint)(g))<<16)|(((guint)(b))<<8)|(guint)(a)) +#define GDK_TO_UINT(c) RGBA_TO_UINT(((c).red>>8), ((c).green>>8), ((c).blue>>8), 0xff) + +#define PREVIEW_SIZE 20 + +static void +color_combo_set_color_internal (ColorCombo *cc, GdkColor *color) +{ + guint color_y, color_height; + guint height, width; + GdkPixbuf *pixbuf; + GdkPixbuf *color_pixbuf; + GdkColor *new_color; + GdkColor *outline_color; + + new_color = make_color (cc,color); + /* If the new and the default are NULL draw an outline */ + outline_color = (new_color) ? new_color : &e_dark_gray; + + pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (cc->preview_image)); + + if (!pixbuf) + return; + + width = gdk_pixbuf_get_width (pixbuf); + height = gdk_pixbuf_get_height (pixbuf); + + if (cc->preview_is_icon) { + color_y = height - 4; + color_height = 4; + } + else { + color_y = 0; + color_height = height; + } + + color_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, + TRUE, 8, + width, + color_height); + gdk_pixbuf_fill (color_pixbuf, GDK_TO_UINT (*outline_color)); + gdk_pixbuf_copy_area (color_pixbuf, 0, 0, width, color_height, + pixbuf, 0, color_y); + + if (new_color != NULL) + gdk_pixbuf_fill (color_pixbuf, GDK_TO_UINT (*new_color)); + else + gdk_pixbuf_fill (color_pixbuf, 0xffffff00); + gdk_pixbuf_copy_area (color_pixbuf, 0, 0, width - 2, color_height -2, + pixbuf, 1, color_y + 1); + + g_object_unref (color_pixbuf); + + gtk_widget_queue_draw (GTK_WIDGET (cc)); +} + +static void +color_combo_class_init (GObjectClass *object_class) +{ + color_combo_parent_class = g_type_class_ref (PARENT_TYPE); + + color_combo_signals [CHANGED] = + g_signal_new ("color_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ColorComboClass, color_changed), + NULL, NULL, + e_marshal_NONE__POINTER_BOOLEAN_BOOLEAN_BOOLEAN, + G_TYPE_NONE, 4, G_TYPE_POINTER, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); +} + +E_MAKE_TYPE (color_combo, + "ColorCombo", + ColorCombo, + color_combo_class_init, + NULL, + PARENT_TYPE) + +/* + * Fires signal "color_changed" with the current color as its param + */ +static void +emit_color_changed (ColorCombo *cc, GdkColor *color, + gboolean is_custom, gboolean by_user, gboolean is_default) +{ + g_signal_emit (cc, + color_combo_signals [CHANGED], 0, + color, is_custom, by_user, is_default); + mygal_combo_box_popup_hide (MYGAL_COMBO_BOX (cc)); +} + +static void +cb_palette_color_changed (ColorPalette *P, GdkColor *color, + gboolean custom, gboolean by_user, gboolean is_default, + ColorCombo *cc) +{ + color_combo_set_color_internal (cc, color); + emit_color_changed (cc, color, custom, by_user, is_default); +} + +static void +preview_clicked (GtkWidget *button, ColorCombo *cc) +{ + gboolean is_default; + GdkColor *color = color_palette_get_current_color (cc->palette, &is_default); + emit_color_changed (cc, color, FALSE, TRUE, is_default); + if (color) + gdk_color_free (color); +} + +static void +cb_cust_color_clicked (GtkWidget *widget, ColorCombo *cc) +{ + mygal_combo_box_popup_hide (MYGAL_COMBO_BOX (cc)); +} + +/* + * Creates the color table + */ +static void +color_table_setup (ColorCombo *cc, + char const *no_color_label, ColorGroup *color_group) +{ + g_return_if_fail (cc != NULL); + + /* Tell the palette that we will be changing it's custom colors */ + cc->palette = + COLOR_PALETTE (color_palette_new (no_color_label, + cc->default_color, + color_group)); + + { + GtkWidget *picker = color_palette_get_color_picker (cc->palette); + g_signal_connect (picker, "clicked", + G_CALLBACK (cb_cust_color_clicked), cc); + } + + g_signal_connect (cc->palette, "color_changed", + G_CALLBACK (cb_palette_color_changed), cc); + + gtk_widget_show_all (GTK_WIDGET (cc->palette)); + + return; +} + +void +color_combo_box_set_preview_relief (ColorCombo *cc, GtkReliefStyle relief) +{ + g_return_if_fail (cc != NULL); + g_return_if_fail (IS_COLOR_COMBO (cc)); + + gtk_button_set_relief (GTK_BUTTON (cc->preview_button), relief); +} + +/* + * Where the actual construction goes on + */ +static void +color_combo_construct (ColorCombo *cc, GdkPixbuf *icon, + char const *no_color_label, + ColorGroup *color_group) +{ + GdkColor *color; + GdkPixbuf *pixbuf = NULL; + + g_return_if_fail (cc != NULL); + g_return_if_fail (IS_COLOR_COMBO (cc)); + + /* + * Our button with the gtk_image preview + */ + cc->preview_button = gtk_button_new (); + cc->preview_is_icon = FALSE; + + if (icon) + /* use icon only if size > 4*4 */ + if ((gdk_pixbuf_get_width (icon) > 4) && + (gdk_pixbuf_get_height (icon) > 4)) + { + cc->preview_is_icon = TRUE; + pixbuf = gdk_pixbuf_copy (icon); + } + + if (pixbuf == NULL) + pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, + TRUE, 8, + PREVIEW_SIZE, + PREVIEW_SIZE); + + cc->preview_image = gtk_image_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + + gtk_button_set_relief (GTK_BUTTON (cc->preview_button), GTK_RELIEF_NONE); + gtk_widget_show (cc->preview_image); + + gtk_container_add (GTK_CONTAINER (cc->preview_button), cc->preview_image); + g_signal_connect (cc->preview_button, "clicked", + G_CALLBACK (preview_clicked), cc); + + color_table_setup (cc, no_color_label, color_group); + + gtk_widget_show_all (cc->preview_button); + + mygal_combo_box_construct (MYGAL_COMBO_BOX (cc), + cc->preview_button, + GTK_WIDGET (cc->palette)); + + mygal_combo_box_set_tearable (MYGAL_COMBO_BOX (cc), FALSE); + + color = color_palette_get_current_color (cc->palette, NULL); + color_combo_set_color_internal (cc, color); + if (color) gdk_color_free (color); +} + +/* color_combo_get_color: + * + * Return current color, result must be freed with gdk_color_free ! + */ +GdkColor * +color_combo_get_color (ColorCombo *cc, gboolean *is_default) +{ + return color_palette_get_current_color (cc->palette, is_default); +} + +/** + * color_combo_set_color + * @cc The combo + * @color The color + * + * Set the color of the combo to the given color. Causes the color_changed + * signal to be emitted. + */ +void +color_combo_set_color (ColorCombo *cc, GdkColor *color) +{ + /* This will change the color on the palette than it will invoke + * cb_palette_color_changed which will call emit_color_changed and + * set_color_internal which will change the color on our preview and + * will let the users of the combo know that the current color has + * changed + */ + if (color != NULL) + gdk_rgb_find_color (gtk_widget_get_colormap (GTK_WIDGET (cc)), color); + color_palette_set_current_color (cc->palette, color); +} + +/** + * color_combo_set_color_to_default + * @cc The combo + * + * Set the color of the combo to the default color. Causes the color_changed + * signal to be emitted. + */ +void +color_combo_set_color_to_default (ColorCombo *cc) +{ + color_palette_set_color_to_default (cc->palette); +} + +/** + * color_combo_new : + * icon : optionally NULL. + * , const char *no_color_label, + * Default constructor. Pass an optional icon and an optional label for the + * no/auto color button. + */ +GtkWidget * +color_combo_new (GdkPixbuf *icon, char const *no_color_label, + GdkColor *default_color, + ColorGroup *color_group) +{ + ColorCombo *cc; + + cc = g_object_new (COLOR_COMBO_TYPE, NULL); + + if ( default_color ) + { + cc->default_color = gdk_color_copy (default_color); + } + + color_combo_construct (cc, icon, no_color_label, color_group); + + return GTK_WIDGET (cc); +} diff --git a/src/mygal/widget-color-combo.h b/src/mygal/widget-color-combo.h new file mode 100644 index 00000000..3fb283c7 --- /dev/null +++ b/src/mygal/widget-color-combo.h @@ -0,0 +1,86 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * widget-color-combo.h - A color selector combo box + * Copyright 2000, 2001, Ximian, Inc. + * + * Authors: + * Miguel de Icaza (miguel@kernel.org) + * Dom Lachowicz (dominicl@seas.upenn.edu) + * + * Reworked and split up into a separate ColorPalette object: + * Michael Levy (mlevy@genoscope.cns.fr) + * + * And later revised and polished by: + * Almer S. Tigelaar (almer@gnome.org) + * + * Modified for gLabels by: + * Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef GNUMERIC_WIDGET_COLOR_COMBO_H +#define GNUMERIC_WIDGET_COLOR_COMBO_H + +#include +#include "mygal-combo-box.h" +#include "color-palette.h" + +G_BEGIN_DECLS + +typedef struct _ColorCombo { + MygalComboBox combo_box; + + /* + * GtkImage where we display + */ + GtkWidget *preview_button; + GtkWidget *preview_image; + gboolean preview_is_icon; + + ColorPalette *palette; + + GdkColor *default_color; + gboolean trigger; +} ColorCombo; + +typedef struct { + MygalComboBoxClass parent_class; + + /* Signals emited by this widget */ + void (* color_changed) (ColorCombo *color_combo, GdkColor *color, + gboolean custom, gboolean by_user, gboolean is_default); +} ColorComboClass; + +#define COLOR_COMBO_TYPE (color_combo_get_type ()) +#define COLOR_COMBO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), COLOR_COMBO_TYPE, ColorCombo)) +#define COLOR_COMBO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST(k), COLOR_COMBO_TYPE) +#define IS_COLOR_COMBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), COLOR_COMBO_TYPE)) + +GtkType color_combo_get_type (void); +GtkWidget *color_combo_new (GdkPixbuf *icon, + char const *no_color_label, + GdkColor *default_color, + ColorGroup *color_group); +void color_combo_set_color (ColorCombo *cc, + GdkColor *color); +void color_combo_set_color_to_default (ColorCombo *cc); +GdkColor *color_combo_get_color (ColorCombo *cc, gboolean *is_default); + +void color_combo_box_set_preview_relief (ColorCombo *cc, GtkReliefStyle relief); + +G_END_DECLS + +#endif /* GNUMERIC_WIDGET_COLOR_COMBO_H */ diff --git a/src/new-label-dialog.c b/src/new-label-dialog.c new file mode 100644 index 00000000..038ed43b --- /dev/null +++ b/src/new-label-dialog.c @@ -0,0 +1,289 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * new-label-dialog.c: New label dialog module + * + * Copyright (C) 2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "new-label-dialog.h" + +#include +#include +#include +#include + +#include "hig.h" +#include "wdgt-media-select.h" +#include "wdgt-rotate-label.h" + +#include "debug.h" + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +struct _glNewLabelDialogPrivate { + + GtkWidget *media_select; + GtkWidget *rotate_label; + +}; + + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_new_label_dialog_finalize (GObject *object); + +static void gl_new_label_dialog_construct (glNewLabelDialog *dialog, + GtkWindow *win); + +static void template_changed_cb (glWdgtMediaSelect *select, + gpointer data); + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glNewLabelDialog, gl_new_label_dialog, GTK_TYPE_DIALOG); + +static void +gl_new_label_dialog_class_init (glNewLabelDialogClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_FILE, ""); + + gl_new_label_dialog_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_new_label_dialog_finalize; +} + +static void +gl_new_label_dialog_init (glNewLabelDialog *dialog) +{ + gl_debug (DEBUG_FILE, "START"); + + g_return_if_fail (GL_IS_NEW_LABEL_DIALOG (dialog)); + + dialog->priv = g_new0 (glNewLabelDialogPrivate, 1); + + gtk_container_set_border_width (GTK_CONTAINER(dialog), GL_HIG_PAD2); + + gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE); + gtk_dialog_add_buttons (GTK_DIALOG(dialog), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, + NULL); + gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); + gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); + + gl_debug (DEBUG_FILE, "END"); +} + +static void +gl_new_label_dialog_finalize (GObject *object) +{ + glNewLabelDialog* dialog = GL_NEW_LABEL_DIALOG (object);; + + gl_debug (DEBUG_FILE, "START"); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_NEW_LABEL_DIALOG (dialog)); + g_return_if_fail (dialog->priv != NULL); + + g_free (dialog->priv); + + G_OBJECT_CLASS (gl_new_label_dialog_parent_class)->finalize (object); + + gl_debug (DEBUG_FILE, "END"); + +} + +/*****************************************************************************/ +/* NEW object properties dialog. */ +/*****************************************************************************/ +GtkWidget * +gl_new_label_dialog_new (GtkWindow *win) +{ + GtkWidget *dialog; + + gl_debug (DEBUG_FILE, ""); + + dialog = GTK_WIDGET (g_object_new (GL_TYPE_NEW_LABEL_DIALOG, NULL)); + + gl_new_label_dialog_construct (GL_NEW_LABEL_DIALOG(dialog), win); + + return dialog; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct dialog. */ +/*--------------------------------------------------------------------------*/ +static void +gl_new_label_dialog_construct (glNewLabelDialog *dialog, + GtkWindow *win) +{ + GladeXML *gui; + GtkWidget *vbox, *media_select_vbox, *rotate_label_vbox; + gchar *name; + + gl_debug (DEBUG_FILE, "START"); + + gtk_window_set_transient_for (GTK_WINDOW (dialog), win); + + gui = glade_xml_new (GLABELS_GLADE_DIR "new-label-dialog.glade", + "new_label_dialog_vbox", NULL); + + if (!gui) { + g_critical ("Could not open new-label-dialog.glade. gLabels may not be installed correctly!"); + return; + } + + vbox = glade_xml_get_widget (gui, "new_label_dialog_vbox"); + gtk_box_pack_start (GTK_BOX( GTK_DIALOG (dialog)->vbox), vbox, FALSE, FALSE, 0); + + media_select_vbox = glade_xml_get_widget (gui, "media_select_vbox"); + rotate_label_vbox = glade_xml_get_widget (gui, "rotate_label_vbox"); + + g_object_unref (gui); + + dialog->priv->media_select = gl_wdgt_media_select_new (); + gtk_box_pack_start (GTK_BOX (media_select_vbox), + dialog->priv->media_select, FALSE, FALSE, 0); + + dialog->priv->rotate_label = gl_wdgt_rotate_label_new (); + gtk_box_pack_start (GTK_BOX (rotate_label_vbox), + dialog->priv->rotate_label, FALSE, FALSE, 0); + + /* Sync template name from media select with rotate widget. */ + name = gl_wdgt_media_select_get_name (GL_WDGT_MEDIA_SELECT (dialog->priv->media_select)); + gl_wdgt_rotate_label_set_template_name (GL_WDGT_ROTATE_LABEL (dialog->priv->rotate_label), + name); + + g_signal_connect (G_OBJECT (dialog->priv->media_select), "changed", + G_CALLBACK (template_changed_cb), dialog); + + gl_debug (DEBUG_FILE, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. New template changed callback. */ +/*---------------------------------------------------------------------------*/ +static void +template_changed_cb (glWdgtMediaSelect *select, + gpointer data) +{ + glNewLabelDialog *dialog = GL_NEW_LABEL_DIALOG (data); + gchar *name; + + gl_debug (DEBUG_FILE, "START"); + + name = gl_wdgt_media_select_get_name (GL_WDGT_MEDIA_SELECT (select)); + + gl_wdgt_rotate_label_set_template_name (GL_WDGT_ROTATE_LABEL (dialog->priv->rotate_label), + name); + + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), + GTK_RESPONSE_OK, + (name != NULL)); + + g_free (name); + + gl_debug (DEBUG_FILE, "END"); +} + +/*****************************************************************************/ +/* Get template name. */ +/*****************************************************************************/ +gchar * +gl_new_label_dialog_get_template_name (glNewLabelDialog *dialog) +{ + gchar *name; + + name = gl_wdgt_media_select_get_name (GL_WDGT_MEDIA_SELECT (dialog->priv->media_select)); + + return name; +} + +/*****************************************************************************/ +/* Set template name. */ +/*****************************************************************************/ +void +gl_new_label_dialog_set_template_name (glNewLabelDialog *dialog, + gchar *name) +{ + gl_wdgt_media_select_set_name (GL_WDGT_MEDIA_SELECT (dialog->priv->media_select), name); +} + +/*****************************************************************************/ +/* Get current filter parameters. */ +/*****************************************************************************/ +void +gl_new_label_dialog_get_filter_parameters (glNewLabelDialog *dialog, + gchar **page_size_id, + gchar **category_id) +{ + gl_wdgt_media_select_get_filter_parameters ( + GL_WDGT_MEDIA_SELECT (dialog->priv->media_select), + page_size_id, category_id); +} + +/*****************************************************************************/ +/* Set current filter parameters. */ +/*****************************************************************************/ +void +gl_new_label_dialog_set_filter_parameters (glNewLabelDialog *dialog, + const gchar *page_size_id, + const gchar *category_id) +{ + gl_wdgt_media_select_set_filter_parameters ( + GL_WDGT_MEDIA_SELECT (dialog->priv->media_select), + page_size_id, category_id); +} + +/*****************************************************************************/ +/* Get rotate state. */ +/*****************************************************************************/ +gboolean +gl_new_label_dialog_get_rotate_state (glNewLabelDialog *dialog) +{ + return gl_wdgt_rotate_label_get_state ( + GL_WDGT_ROTATE_LABEL (dialog->priv->rotate_label)); +} + +/*****************************************************************************/ +/* Set rotate state. */ +/*****************************************************************************/ +void +gl_new_label_dialog_set_rotate_state (glNewLabelDialog *dialog, + gboolean state) +{ + gl_wdgt_rotate_label_set_state ( + GL_WDGT_ROTATE_LABEL (dialog->priv->rotate_label), state); +} + diff --git a/src/new-label-dialog.h b/src/new-label-dialog.h new file mode 100644 index 00000000..a38a48d9 --- /dev/null +++ b/src/new-label-dialog.h @@ -0,0 +1,84 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * new-label-dialog.h: New label dialog module header file + * + * Copyright (C) 2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __NEW_LABEL_DIALOG_H__ +#define __NEW_LABEL_DIALOG_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GL_TYPE_NEW_LABEL_DIALOG (gl_new_label_dialog_get_type ()) +#define GL_NEW_LABEL_DIALOG(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_NEW_LABEL_DIALOG, glNewLabelDialog)) +#define GL_NEW_LABEL_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_NEW_LABEL_DIALOG, glNewLabelDialogClass)) +#define GL_IS_NEW_LABEL_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_NEW_LABEL_DIALOG)) +#define GL_IS_NEW_LABEL_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_NEW_LABEL_DIALOG)) +#define GL_NEW_LABEL_DIALOG_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_NEW_LABEL_DIALOG, glNewLabelDialogClass)) + + +typedef struct _glNewLabelDialog glNewLabelDialog; +typedef struct _glNewLabelDialogClass glNewLabelDialogClass; + +typedef struct _glNewLabelDialogPrivate glNewLabelDialogPrivate; + +struct _glNewLabelDialog +{ + GtkDialog parent_instance; + + glNewLabelDialogPrivate *priv; + +}; + +struct _glNewLabelDialogClass +{ + GtkDialogClass parent_class; +}; + + +GType gl_new_label_dialog_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_new_label_dialog_new (GtkWindow *win); + +gchar *gl_new_label_dialog_get_template_name (glNewLabelDialog *dialog); + +void gl_new_label_dialog_set_template_name (glNewLabelDialog *dialog, + gchar *name); + +void gl_new_label_dialog_get_filter_parameters (glNewLabelDialog *dialog, + gchar **page_size_id, + gchar **category_id); + +void gl_new_label_dialog_set_filter_parameters (glNewLabelDialog *dialog, + const gchar *page_size_id, + const gchar *category_id); + +gboolean gl_new_label_dialog_get_rotate_state (glNewLabelDialog *dialog); + +void gl_new_label_dialog_set_rotate_state (glNewLabelDialog *dialog, + gboolean state); + + +G_END_DECLS + +#endif diff --git a/src/object-editor-bc-page.c b/src/object-editor-bc-page.c new file mode 100644 index 00000000..464029e0 --- /dev/null +++ b/src/object-editor-bc-page.c @@ -0,0 +1,426 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include +#include +#include + +#include "prefs.h" +#include "mygal/widget-color-combo.h" +#include "color.h" +#include "util.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void style_changed_cb (glObjectEditor *editor); +static void bc_radio_toggled_cb (glObjectEditor *editor); + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare size page. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_prepare_bc_page (glObjectEditor *editor) +{ + GList *styles = NULL; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Extract widgets from XML tree. */ + editor->priv->bc_page_vbox = + glade_xml_get_widget (editor->priv->gui, "bc_page_vbox"); + editor->priv->bc_style_combo = + glade_xml_get_widget (editor->priv->gui, "bc_style_combo"); + editor->priv->bc_text_check = + glade_xml_get_widget (editor->priv->gui, "bc_text_check"); + editor->priv->bc_cs_check = + glade_xml_get_widget (editor->priv->gui, "bc_cs_check"); + editor->priv->bc_color_combo = + glade_xml_get_widget (editor->priv->gui, "bc_color_combo"); + editor->priv->bc_key_combo = + glade_xml_get_widget (editor->priv->gui, "bc_key_combo"); + editor->priv->bc_key_radio = + glade_xml_get_widget (editor->priv->gui, "bc_key_radio"); + editor->priv->bc_color_radio = + glade_xml_get_widget (editor->priv->gui, "bc_color_radio"); + editor->priv->data_format_label = + glade_xml_get_widget (editor->priv->gui, "data_format_label"); + editor->priv->data_ex_label = + glade_xml_get_widget (editor->priv->gui, "data_ex_label"); + editor->priv->data_digits_label = + glade_xml_get_widget (editor->priv->gui, "data_digits_label"); + editor->priv->data_digits_spin = + glade_xml_get_widget (editor->priv->gui, "data_digits_spin"); + + editor->priv->data_format_fixed_flag = FALSE; + + gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->bc_style_combo)); + gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->bc_key_combo)); + + /* Load barcode styles */ + styles = gl_barcode_get_styles_list (); + gl_util_combo_box_set_strings (GTK_COMBO_BOX(editor->priv->bc_style_combo), + styles); + gl_barcode_free_styles_list (styles); + + /* Modify widgets */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->bc_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->bc_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->bc_key_combo, FALSE); + + /* Un-hide */ + gtk_widget_show_all (editor->priv->bc_page_vbox); + + /* Connect signals */ + g_signal_connect_swapped (G_OBJECT (editor->priv->bc_style_combo), + "changed", + G_CALLBACK (style_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->bc_text_check), + "toggled", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->bc_cs_check), + "toggled", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->bc_color_combo), + "color_changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->bc_key_combo), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->bc_color_radio), + "toggled", + G_CALLBACK (bc_radio_toggled_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->bc_key_radio), + "toggled", + G_CALLBACK (bc_radio_toggled_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->data_digits_spin), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Callback for when style has changed. */ +/*--------------------------------------------------------------------------*/ +static void +style_changed_cb (glObjectEditor *editor) +{ + gchar *style_string = NULL; + const gchar *id; + gchar *ex_string = NULL; + guint digits; + + if (editor->priv->stop_signals) return; + + style_string = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_style_combo)); + + /* Don't emit if entry is empty. */ + if ( *style_string != 0 ) { + id = gl_barcode_name_to_id (style_string); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(editor->priv->bc_text_check), + gl_barcode_can_text (id)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(editor->priv->bc_cs_check), + gl_barcode_can_csum (id)); + + gtk_widget_set_sensitive (editor->priv->bc_text_check, + gl_barcode_text_optional (id)); + gtk_widget_set_sensitive (editor->priv->bc_cs_check, + gl_barcode_csum_optional (id)); + + editor->priv->data_format_fixed_flag = !gl_barcode_can_freeform (id); + digits = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->data_digits_spin)); + if (editor->priv->data_format_fixed_flag) { + digits = gl_barcode_get_prefered_n(id); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->data_digits_spin), + digits); + } + + ex_string = gl_barcode_default_digits (id, digits); + gtk_label_set_text (GTK_LABEL(editor->priv->data_ex_label), ex_string); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) { + gtk_widget_set_sensitive (editor->priv->data_format_label, FALSE); + gtk_widget_set_sensitive (editor->priv->data_ex_label, FALSE); + gtk_widget_set_sensitive (editor->priv->data_digits_label, FALSE); + gtk_widget_set_sensitive (editor->priv->data_digits_spin, FALSE); + } else { + gtk_widget_set_sensitive (editor->priv->data_format_label, TRUE); + gtk_widget_set_sensitive (editor->priv->data_ex_label, TRUE); + gtk_widget_set_sensitive (editor->priv->data_digits_label, + !editor->priv->data_format_fixed_flag); + gtk_widget_set_sensitive (editor->priv->data_digits_spin, + !editor->priv->data_format_fixed_flag); + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + } + + g_free (style_string); + g_free (ex_string); +} + +/*****************************************************************************/ +/* Set barcode style. */ +/*****************************************************************************/ +void +gl_object_editor_set_bc_style (glObjectEditor *editor, + gchar *id, + gboolean text_flag, + gboolean checksum_flag, + guint format_digits) +{ + const gchar *style_string; + gchar *ex_string; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + style_string = gl_barcode_id_to_name (id); + + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->bc_style_combo), + style_string); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->bc_text_check), + text_flag); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->bc_cs_check), + checksum_flag); + + gtk_widget_set_sensitive (editor->priv->bc_text_check, + gl_barcode_text_optional (id)); + gtk_widget_set_sensitive (editor->priv->bc_cs_check, + gl_barcode_csum_optional (id)); + + editor->priv->data_format_fixed_flag = !gl_barcode_can_freeform (id); + + if (editor->priv->data_format_fixed_flag) { + format_digits = gl_barcode_get_prefered_n (id); + } + + ex_string = gl_barcode_default_digits (id, format_digits); + gtk_label_set_text (GTK_LABEL(editor->priv->data_ex_label), ex_string); + g_free (ex_string); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->data_digits_spin), + format_digits); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) { + gtk_widget_set_sensitive (editor->priv->data_format_label, FALSE); + gtk_widget_set_sensitive (editor->priv->data_ex_label, FALSE); + gtk_widget_set_sensitive (editor->priv->data_digits_label, FALSE); + gtk_widget_set_sensitive (editor->priv->data_digits_spin, FALSE); + } else { + gtk_widget_set_sensitive (editor->priv->data_format_label, TRUE); + gtk_widget_set_sensitive (editor->priv->data_ex_label, TRUE); + gtk_widget_set_sensitive (editor->priv->data_digits_label, + !editor->priv->data_format_fixed_flag); + gtk_widget_set_sensitive (editor->priv->data_digits_spin, + !editor->priv->data_format_fixed_flag); + } + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query barcode style. */ +/*****************************************************************************/ +void +gl_object_editor_get_bc_style (glObjectEditor *editor, + gchar **id, + gboolean *text_flag, + gboolean *checksum_flag, + guint *format_digits) +{ + gchar *style_string; + + gl_debug (DEBUG_EDITOR, "START"); + + style_string = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_style_combo)); + *id = g_strdup (gl_barcode_name_to_id (style_string)); + + *text_flag = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->bc_text_check)); + + *checksum_flag = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->bc_cs_check)); + + + *format_digits = + gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->data_digits_spin)); + + g_free (style_string); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set bc color. */ +/*****************************************************************************/ +void +gl_object_editor_set_bc_color (glObjectEditor *editor, + gboolean merge_flag, + glColorNode *color_node) +{ + GdkColor *gdk_color; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_widget_set_sensitive (editor->priv->bc_key_radio, merge_flag); + + if ( color_node->color == GL_COLOR_NONE ) { + + color_combo_set_color_to_default (COLOR_COMBO(editor->priv->bc_color_combo)); + + } else { + + gdk_color = gl_color_to_gdk_color (color_node->color); + color_combo_set_color (COLOR_COMBO(editor->priv->bc_color_combo), + gdk_color); + g_free (gdk_color); + } + + if (!color_node->field_flag) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->bc_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->bc_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->bc_key_combo, FALSE); + + } else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->bc_key_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->bc_color_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->bc_key_combo, TRUE); + + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->bc_key_combo), + color_node->key); + } + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query bc color. */ +/*****************************************************************************/ +glColorNode* +gl_object_editor_get_bc_color (glObjectEditor *editor) +{ + GdkColor *gdk_color; + glColorNode *color_node; + gboolean is_default; + + gl_debug (DEBUG_EDITOR, "START"); + + color_node = gl_color_node_new_default (); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->bc_key_radio))) { + color_node->field_flag = TRUE; + color_node->color = gl_prefs->default_line_color; + color_node->key = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->bc_key_combo)); + } else { + color_node->field_flag = FALSE; + color_node->key = NULL; + gdk_color = color_combo_get_color (COLOR_COMBO(editor->priv->bc_color_combo), + &is_default); + + if (is_default) { + color_node->color = gl_prefs->default_line_color; + } else { + color_node->color = gl_color_from_gdk_color (gdk_color); + } + } + + gl_debug (DEBUG_EDITOR, "END"); + + return color_node; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. barcode color radio callback. */ +/*--------------------------------------------------------------------------*/ +static void +bc_radio_toggled_cb (glObjectEditor *editor) +{ + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->bc_color_radio))) { + gtk_widget_set_sensitive (editor->priv->bc_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->bc_key_combo, FALSE); + } else { + gtk_widget_set_sensitive (editor->priv->bc_color_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->bc_key_combo, TRUE); + + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + + gl_debug (DEBUG_EDITOR, "END"); +} diff --git a/src/object-editor-data-page.c b/src/object-editor-data-page.c new file mode 100644 index 00000000..449d3e28 --- /dev/null +++ b/src/object-editor-data-page.c @@ -0,0 +1,232 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include +#include +#include + +#include "prefs.h" +#include "util.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void data_radio_toggled_cb (glObjectEditor *editor); + + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare data page. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_prepare_data_page (glObjectEditor *editor) +{ + gl_debug (DEBUG_EDITOR, "START"); + + /* Extract widgets from XML tree. */ + editor->priv->data_page_vbox = glade_xml_get_widget (editor->priv->gui, + "data_page_vbox"); + editor->priv->data_literal_radio = glade_xml_get_widget (editor->priv->gui, + "data_literal_radio"); + editor->priv->data_key_radio = glade_xml_get_widget (editor->priv->gui, + "data_key_radio"); + editor->priv->data_text_entry = glade_xml_get_widget (editor->priv->gui, + "data_text_entry"); + editor->priv->data_key_combo = glade_xml_get_widget (editor->priv->gui, + "data_key_combo"); + + gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->data_key_combo)); + + /* Un-hide */ + gtk_widget_show_all (editor->priv->data_page_vbox); + + /* Connect signals */ + g_signal_connect_swapped (G_OBJECT (editor->priv->data_text_entry), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->data_key_combo), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->data_literal_radio), + "toggled", + G_CALLBACK (data_radio_toggled_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->data_key_radio), + "toggled", + G_CALLBACK (data_radio_toggled_cb), + G_OBJECT (editor)); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. data radio callback. */ +/*--------------------------------------------------------------------------*/ +static void +data_radio_toggled_cb (glObjectEditor *editor) +{ + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_WDGT, "START"); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) { + gtk_widget_set_sensitive (editor->priv->data_text_entry, TRUE); + gtk_widget_set_sensitive (editor->priv->data_key_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->data_format_label, FALSE); + gtk_widget_set_sensitive (editor->priv->data_ex_label, FALSE); + gtk_widget_set_sensitive (editor->priv->data_digits_label, FALSE); + gtk_widget_set_sensitive (editor->priv->data_digits_spin, FALSE); + } else { + gtk_widget_set_sensitive (editor->priv->data_text_entry, FALSE); + gtk_widget_set_sensitive (editor->priv->data_key_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->data_format_label, TRUE); + gtk_widget_set_sensitive (editor->priv->data_ex_label, TRUE); + gtk_widget_set_sensitive (editor->priv->data_digits_label, + !editor->priv->data_format_fixed_flag); + gtk_widget_set_sensitive (editor->priv->data_digits_spin, + !editor->priv->data_format_fixed_flag); + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + + gl_debug (DEBUG_WDGT, "END"); +} + +/*****************************************************************************/ +/* Set data. */ +/*****************************************************************************/ +void +gl_object_editor_set_data (glObjectEditor *editor, + gboolean merge_flag, + glTextNode *text_node) +{ + gint pos; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_widget_set_sensitive (editor->priv->data_key_radio, merge_flag); + + if (!text_node->field_flag) { + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->data_literal_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->data_text_entry, TRUE); + gtk_widget_set_sensitive (editor->priv->data_key_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->data_format_label, FALSE); + gtk_widget_set_sensitive (editor->priv->data_ex_label, FALSE); + gtk_widget_set_sensitive (editor->priv->data_digits_spin, FALSE); + gtk_widget_set_sensitive (editor->priv->data_digits_label, FALSE); + + gtk_editable_delete_text (GTK_EDITABLE (editor->priv->data_text_entry), 0, -1); + pos = 0; + if (text_node->data != NULL ) { + gtk_editable_insert_text (GTK_EDITABLE (editor->priv->data_text_entry), + text_node->data, + strlen (text_node->data), + &pos); + } + + } else { + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->data_key_radio), TRUE); + + gtk_widget_set_sensitive (editor->priv->data_text_entry, FALSE); + gtk_widget_set_sensitive (editor->priv->data_key_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->data_format_label, TRUE); + gtk_widget_set_sensitive (editor->priv->data_ex_label, TRUE); + gtk_widget_set_sensitive (editor->priv->data_digits_label, + !editor->priv->data_format_fixed_flag); + gtk_widget_set_sensitive (editor->priv->data_digits_spin, + !editor->priv->data_format_fixed_flag); + + + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->data_key_combo), + text_node->data); + } + + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query data. */ +/*****************************************************************************/ +glTextNode * +gl_object_editor_get_data (glObjectEditor *editor) +{ + glTextNode *text_node; + + gl_debug (DEBUG_EDITOR, "START"); + + text_node = g_new0(glTextNode,1); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) { + text_node->field_flag = FALSE; + text_node->data = + gtk_editable_get_chars (GTK_EDITABLE (editor->priv->data_text_entry), + 0, -1); + } else { + text_node->field_flag = TRUE; + text_node->data = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->data_key_combo)); + } + + gl_debug (DEBUG_EDITOR, "text_node: field_flag=%d, data=%s", + text_node->field_flag, text_node->data); + + gl_debug (DEBUG_EDITOR, "END"); + + return text_node; +} diff --git a/src/object-editor-edit-page.c b/src/object-editor-edit-page.c new file mode 100644 index 00000000..0a21e8d6 --- /dev/null +++ b/src/object-editor-edit-page.c @@ -0,0 +1,133 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include + +#include "prefs.h" +#include "mygal/widget-color-combo.h" +#include "color.h" +#include "util.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void insert_button_cb (glObjectEditor *editor); + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare size page. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_prepare_edit_page (glObjectEditor *editor) +{ + gl_debug (DEBUG_EDITOR, "START"); + + /* Extract widgets from XML tree. */ + editor->priv->edit_page_vbox = + glade_xml_get_widget (editor->priv->gui, "edit_page_vbox"); + editor->priv->edit_text_view = + glade_xml_get_widget (editor->priv->gui, "edit_text_view"); + editor->priv->edit_key_label = + glade_xml_get_widget (editor->priv->gui, "edit_key_label"); + editor->priv->edit_key_combo = + glade_xml_get_widget (editor->priv->gui, "edit_key_combo"); + editor->priv->edit_insert_field_button = + glade_xml_get_widget (editor->priv->gui, "edit_insert_field_button"); + + gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->edit_key_combo)); + + /* Un-hide */ + gtk_widget_show_all (editor->priv->edit_page_vbox); + + /* Connect signals */ + g_signal_connect_swapped (G_OBJECT (editor->priv->edit_insert_field_button), + "clicked", + G_CALLBACK (insert_button_cb), + G_OBJECT (editor)); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Alignment togglebutton callback. */ +/*--------------------------------------------------------------------------*/ +static void +insert_button_cb (glObjectEditor *editor) +{ + GtkTextBuffer *buffer; + gchar *key, *field; + + gl_debug (DEBUG_EDITOR, "START"); + + key = gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->edit_key_combo)); + field = g_strdup_printf ("${%s}", key); + gl_debug (DEBUG_WDGT, "Inserting %s", field); + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (editor->priv->edit_text_view)); + gtk_text_buffer_insert_at_cursor (buffer, field, -1); + + g_free (field); + g_free (key); + + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set text buffer as model for text view/editor. */ +/*****************************************************************************/ +void +gl_object_editor_set_text_buffer (glObjectEditor *editor, + GtkTextBuffer *buffer) +{ + gl_debug (DEBUG_EDITOR, "START"); + + gtk_text_view_set_buffer (GTK_TEXT_VIEW(editor->priv->edit_text_view), buffer); + + gl_debug (DEBUG_EDITOR, "END"); +} + diff --git a/src/object-editor-fill-page.c b/src/object-editor-fill-page.c new file mode 100644 index 00000000..c40f8a17 --- /dev/null +++ b/src/object-editor-fill-page.c @@ -0,0 +1,224 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include + +#include "prefs.h" +#include "mygal/widget-color-combo.h" +#include "color.h" +#include "util.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void fill_radio_toggled_cb (glObjectEditor *editor); + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare fill page. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_prepare_fill_page (glObjectEditor *editor) +{ + GdkColor *gdk_color; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Extract widgets from XML tree. */ + editor->priv->fill_page_vbox = glade_xml_get_widget (editor->priv->gui, + "fill_page_vbox"); + editor->priv->fill_color_combo = glade_xml_get_widget (editor->priv->gui, + "fill_color_combo"); + editor->priv->fill_key_combo = glade_xml_get_widget (editor->priv->gui, + "fill_key_combo"); + editor->priv->fill_key_radio = glade_xml_get_widget (editor->priv->gui, + "fill_key_radio"); + editor->priv->fill_color_radio = glade_xml_get_widget (editor->priv->gui, + "fill_color_radio"); + + + gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->fill_key_combo)); + + /* Modify widgets based on configuration */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->fill_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE); + gdk_color = gl_color_to_gdk_color (gl_prefs->default_fill_color); + color_combo_set_color (COLOR_COMBO(editor->priv->fill_color_combo), gdk_color); + g_free (gdk_color); + + /* Un-hide */ + gtk_widget_show_all (editor->priv->fill_page_vbox); + + /* Connect signals */ + g_signal_connect_swapped (G_OBJECT (editor->priv->fill_color_combo), + "color_changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->fill_key_combo), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->fill_color_radio), + "toggled", + G_CALLBACK (fill_radio_toggled_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->fill_key_radio), + "toggled", + G_CALLBACK (fill_radio_toggled_cb), + G_OBJECT (editor)); + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set fill color. */ +/*****************************************************************************/ +void +gl_object_editor_set_fill_color (glObjectEditor *editor, + gboolean merge_flag, + glColorNode *color_node) +{ + GdkColor *gdk_color; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_widget_set_sensitive (editor->priv->fill_key_radio, merge_flag); + + if ( color_node->color == GL_COLOR_NONE ) { + + color_combo_set_color_to_default (COLOR_COMBO(editor->priv->fill_color_combo)); + + } else { + + gdk_color = gl_color_to_gdk_color (color_node->color); + color_combo_set_color (COLOR_COMBO(editor->priv->fill_color_combo), + gdk_color); + g_free (gdk_color); + + } + + if (!color_node->field_flag) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->fill_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE); + + } else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->fill_key_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->fill_color_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->fill_key_combo, TRUE); + + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->fill_key_combo), + color_node->key); + } + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query fill color. */ +/*****************************************************************************/ +glColorNode* +gl_object_editor_get_fill_color (glObjectEditor *editor) +{ + GdkColor *gdk_color; + gboolean is_default; + glColorNode *color_node; + + gl_debug (DEBUG_EDITOR, "START"); + + color_node = gl_color_node_new_default (); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->fill_key_radio))) { + color_node->field_flag = TRUE; + color_node->key = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->fill_key_combo)); + } else { + color_node->field_flag = FALSE; + color_node->key = NULL; + gdk_color = color_combo_get_color (COLOR_COMBO(editor->priv->fill_color_combo), + &is_default); + + if (!is_default) { + color_node->color = gl_color_from_gdk_color (gdk_color); + } + } + + gl_debug (DEBUG_EDITOR, "END"); + + return color_node; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. fill radio callback. */ +/*--------------------------------------------------------------------------*/ +static void +fill_radio_toggled_cb (glObjectEditor *editor) +{ + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->fill_color_radio))) { + gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE); + } else { + gtk_widget_set_sensitive (editor->priv->fill_color_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->fill_key_combo, TRUE); + + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + + gl_debug (DEBUG_EDITOR, "END"); +} diff --git a/src/object-editor-image-page.c b/src/object-editor-image-page.c new file mode 100644 index 00000000..a975ab29 --- /dev/null +++ b/src/object-editor-image-page.c @@ -0,0 +1,350 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include +#include +#include + +#include "prefs.h" +#include "util.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void img_radio_toggled_cb (glObjectEditor *editor); + +static void update_preview_cb (GtkFileChooser *file_chooser, + gpointer data); +static void add_image_filters_to_chooser (GtkFileChooser *file_chooser); + +static void img_selection_changed_cb (glObjectEditor *editor); + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare image page. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_prepare_image_page (glObjectEditor *editor) +{ + GtkWidget *preview; + + + gl_debug (DEBUG_EDITOR, "START"); + + /* Extract widgets from XML tree. */ + editor->priv->img_page_vbox = glade_xml_get_widget (editor->priv->gui, + "img_page_vbox"); + editor->priv->img_file_radio = glade_xml_get_widget (editor->priv->gui, + "img_file_radio"); + editor->priv->img_key_radio = glade_xml_get_widget (editor->priv->gui, + "img_key_radio"); + editor->priv->img_file_button = glade_xml_get_widget (editor->priv->gui, + "img_file_button"); + editor->priv->img_key_combo = glade_xml_get_widget (editor->priv->gui, + "img_key_combo"); + + gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->img_key_combo)); + + /* Modify file button properties. */ + add_image_filters_to_chooser (GTK_FILE_CHOOSER (editor->priv->img_file_button)); + preview = gtk_image_new (); + gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (editor->priv->img_file_button), preview); + g_signal_connect (G_OBJECT (editor->priv->img_file_button), + "update-preview", + G_CALLBACK (update_preview_cb), preview); + + /* Un-hide */ + gtk_widget_show_all (editor->priv->img_page_vbox); + + /* Connect signals */ + g_signal_connect_swapped (G_OBJECT (editor->priv->img_file_button), + "selection-changed", + G_CALLBACK (img_selection_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->img_key_combo), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->img_file_radio), + "toggled", + G_CALLBACK (img_radio_toggled_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->img_key_radio), + "toggled", + G_CALLBACK (img_radio_toggled_cb), + G_OBJECT (editor)); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. image radio callback. */ +/*--------------------------------------------------------------------------*/ +static void +img_radio_toggled_cb (glObjectEditor *editor) +{ + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_WDGT, "START"); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio))) { + gtk_widget_set_sensitive (editor->priv->img_file_button, TRUE); + gtk_widget_set_sensitive (editor->priv->img_key_combo, FALSE); + } else { + gtk_widget_set_sensitive (editor->priv->img_file_button, FALSE); + gtk_widget_set_sensitive (editor->priv->img_key_combo, TRUE); + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + + gl_debug (DEBUG_WDGT, "END"); +} + +/*****************************************************************************/ +/* Set image. */ +/*****************************************************************************/ +void +gl_object_editor_set_image (glObjectEditor *editor, + gboolean merge_flag, + glTextNode *text_node) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_widget_set_sensitive (editor->priv->img_key_radio, merge_flag); + + if (!text_node->field_flag) { + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->img_file_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->img_file_button, TRUE); + gtk_widget_set_sensitive (editor->priv->img_key_combo, FALSE); + + if (text_node->data != NULL ) { + gtk_file_chooser_set_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button), + text_node->data); + } else { + gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER(editor->priv->img_file_button)); + } + } else { + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->img_key_radio), TRUE); + + gtk_widget_set_sensitive (editor->priv->img_file_button, FALSE); + gtk_widget_set_sensitive (editor->priv->img_key_combo, TRUE); + + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->img_key_combo), + text_node->data); + } + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query image. */ +/*****************************************************************************/ +glTextNode * +gl_object_editor_get_image (glObjectEditor *editor) +{ + glTextNode *text_node; + + gl_debug (DEBUG_EDITOR, "START"); + + text_node = g_new0(glTextNode,1); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio))) { + text_node->field_flag = FALSE; + text_node->data = + gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button)); + } else { + text_node->field_flag = TRUE; + text_node->data = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->img_key_combo)); + } + + gl_debug (DEBUG_EDITOR, "text_node: field_flag=%d, data=%s", + text_node->field_flag, text_node->data); + + gl_debug (DEBUG_EDITOR, "END"); + + return text_node; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Update preview image. */ +/*--------------------------------------------------------------------------*/ +static void +update_preview_cb (GtkFileChooser *file_chooser, gpointer data) +{ + GtkWidget *preview; + char *filename; + GdkPixbuf *pixbuf; + gboolean have_preview; + + preview = GTK_WIDGET (data); + filename = gtk_file_chooser_get_preview_filename (file_chooser); + + if (filename) { + pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL); + have_preview = (pixbuf != NULL); + g_free (filename); + + gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf); + if (pixbuf) + gdk_pixbuf_unref (pixbuf); + + gtk_file_chooser_set_preview_widget_active (file_chooser, + have_preview); + } else { + gtk_file_chooser_set_preview_widget_active (file_chooser, FALSE); + } +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add filters to file chooser. */ +/* Based on eog's eog_file_selection_add_filter(). */ +/*--------------------------------------------------------------------------*/ +static void +add_image_filters_to_chooser (GtkFileChooser *chooser) +{ + GtkFileFilter *all_file_filter; + GtkFileFilter *all_img_filter; + GSList *formats; + GSList *it; + GtkFileFilter *filter; + GSList *filters = NULL; + gchar **mime_types, **pattern, *tmp; + int i; + + /* All Files Filter */ + all_file_filter = gtk_file_filter_new (); + gtk_file_filter_set_name (all_file_filter, _("All Files")); + gtk_file_filter_add_pattern (all_file_filter, "*"); + + /* All Image Filter */ + all_img_filter = gtk_file_filter_new (); + gtk_file_filter_set_name (all_img_filter, _("All Images")); + + /* Individual image filters */ + formats = gdk_pixbuf_get_formats (); + for (it = formats; it != NULL; it = it->next) { + gchar *filter_name; + GdkPixbufFormat *format; + filter = gtk_file_filter_new (); + gchar *description, *name; + + format = (GdkPixbufFormat*) it->data; + + /* Filter name: First description then file extension, eg. "The PNG-Format (*.png)".*/ + description = gdk_pixbuf_format_get_description (format); + name = gdk_pixbuf_format_get_name (format); + filter_name = g_strdup_printf (_("%s (*.%s)"), description, name); + g_free (description); + g_free (name); + gtk_file_filter_set_name (filter, filter_name); + g_free (filter_name); + + mime_types = gdk_pixbuf_format_get_mime_types ((GdkPixbufFormat *) it->data); + for (i = 0; mime_types[i] != NULL; i++) { + gtk_file_filter_add_mime_type (filter, mime_types[i]); + gtk_file_filter_add_mime_type (all_img_filter, mime_types[i]); + } + g_strfreev (mime_types); + + pattern = gdk_pixbuf_format_get_extensions ((GdkPixbufFormat *) it->data); + for (i = 0; pattern[i] != NULL; i++) { + tmp = g_strconcat ("*.", pattern[i], NULL); + gtk_file_filter_add_pattern (filter, tmp); + gtk_file_filter_add_pattern (all_img_filter, tmp); + g_free (tmp); + } + g_strfreev (pattern); + + filters = g_slist_prepend (filters, filter); + } + g_slist_free (formats); + + /* Add filter to filechooser */ + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), all_file_filter); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), all_img_filter); + gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (chooser), all_img_filter); + + for (it = filters; it != NULL; it = it->next) { + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), + GTK_FILE_FILTER (it->data)); + } + g_slist_free (filters); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Selection changed callback. */ +/*--------------------------------------------------------------------------*/ +static void +img_selection_changed_cb (glObjectEditor *editor) +{ + gchar *filename; + + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button)); + if (filename != NULL) + { + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + } + g_free (filename); + + gl_debug (DEBUG_EDITOR, "END"); +} + diff --git a/src/object-editor-line-page.c b/src/object-editor-line-page.c new file mode 100644 index 00000000..a9daf766 --- /dev/null +++ b/src/object-editor-line-page.c @@ -0,0 +1,271 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include +#include +#include + +#include "prefs.h" +#include "mygal/widget-color-combo.h" +#include "color.h" +#include "util.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ +static void line_radio_toggled_cb (glObjectEditor *editor); + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare line page. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_prepare_line_page (glObjectEditor *editor) +{ + GdkColor *gdk_color; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Extract widgets from XML tree. */ + editor->priv->line_page_vbox = glade_xml_get_widget (editor->priv->gui, + "line_page_vbox"); + editor->priv->line_width_spin = glade_xml_get_widget (editor->priv->gui, + "line_width_spin"); + editor->priv->line_color_combo = glade_xml_get_widget (editor->priv->gui, + "line_color_combo"); + editor->priv->line_key_combo = glade_xml_get_widget (editor->priv->gui, + "line_key_combo"); + editor->priv->line_key_radio = glade_xml_get_widget (editor->priv->gui, + "line_key_radio"); + editor->priv->line_color_radio = glade_xml_get_widget (editor->priv->gui, + "line_color_radio"); + + gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->line_key_combo)); + + /* Modify widgets based on configuration */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->line_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->line_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->line_key_combo, FALSE); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->line_width_spin), + gl_prefs->default_line_width); + gdk_color = gl_color_to_gdk_color (gl_prefs->default_line_color); + color_combo_set_color (COLOR_COMBO(editor->priv->line_color_combo), gdk_color); + g_free (gdk_color); + + /* Un-hide */ + gtk_widget_show_all (editor->priv->line_page_vbox); + + /* Connect signals */ + g_signal_connect_swapped (G_OBJECT (editor->priv->line_width_spin), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->line_color_combo), + "color_changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->line_key_combo), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->line_color_radio), + "toggled", + G_CALLBACK (line_radio_toggled_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->line_key_radio), + "toggled", + G_CALLBACK (line_radio_toggled_cb), + G_OBJECT (editor)); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set line width. */ +/*****************************************************************************/ +void +gl_object_editor_set_line_width (glObjectEditor *editor, + gdouble width) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + /* Set widget values */ + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->line_width_spin), + width); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query line width. */ +/*****************************************************************************/ +gdouble +gl_object_editor_get_line_width (glObjectEditor *editor) +{ + gdouble w; + + gl_debug (DEBUG_EDITOR, "START"); + + w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->line_width_spin)); + + gl_debug (DEBUG_EDITOR, "END"); + + return w; +} + +/*****************************************************************************/ +/* Set line color. */ +/*****************************************************************************/ +void +gl_object_editor_set_line_color (glObjectEditor *editor, + gboolean merge_flag, + glColorNode *color_node) +{ + GdkColor *gdk_color; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gl_debug (DEBUG_EDITOR, "color field %s(%d) / %X", color_node->key, color_node->field_flag, color_node->color); + gtk_widget_set_sensitive (editor->priv->line_key_radio, merge_flag); + + if ( color_node->color == GL_COLOR_NONE ) { + + color_combo_set_color_to_default (COLOR_COMBO(editor->priv->line_color_combo)); + + } else { + + gdk_color = gl_color_to_gdk_color (color_node->color); + color_combo_set_color (COLOR_COMBO(editor->priv->line_color_combo), + gdk_color); + g_free (gdk_color); + + } + + if (!color_node->field_flag) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->line_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->line_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->line_key_combo, FALSE); + + } else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->line_key_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->line_color_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->line_key_combo, TRUE); + + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->line_key_combo), + color_node->key); + } + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query line color. */ +/*****************************************************************************/ +glColorNode* +gl_object_editor_get_line_color (glObjectEditor *editor) +{ + GdkColor *gdk_color; + gboolean is_default; + glColorNode *color_node; + + gl_debug (DEBUG_EDITOR, "START"); + + color_node = gl_color_node_new_default (); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->line_key_radio))) { + color_node->field_flag = TRUE; + color_node->key = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->line_key_combo)); + } else { + color_node->field_flag = FALSE; + color_node->key = NULL; + gdk_color = color_combo_get_color (COLOR_COMBO(editor->priv->line_color_combo), + &is_default); + + if (!is_default) { + color_node->color = gl_color_from_gdk_color (gdk_color); + } + } + + gl_debug (DEBUG_EDITOR, "END"); + + return color_node; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. line color radio callback. */ +/*--------------------------------------------------------------------------*/ +static void +line_radio_toggled_cb (glObjectEditor *editor) +{ + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->line_color_radio))) { + gtk_widget_set_sensitive (editor->priv->line_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->line_key_combo, FALSE); + } else { + gtk_widget_set_sensitive (editor->priv->line_color_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->line_key_combo, TRUE); + + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + + gl_debug (DEBUG_EDITOR, "END"); +} diff --git a/src/object-editor-lsize-page.c b/src/object-editor-lsize-page.c new file mode 100644 index 00000000..d87c2470 --- /dev/null +++ b/src/object-editor-lsize-page.c @@ -0,0 +1,259 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include + +#include "prefs.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +#define LENGTH(x,y) sqrt( (x)*(x) + (y)*(y) ) +#define ANGLE(x,y) ( (180.0/G_PI)*atan2( -(y), (x) ) ) +#define COMP_X(l,a) ( (l) * cos( (G_PI/180.0)*(a) ) ) +#define COMP_Y(l,a) ( -(l) * sin( (G_PI/180.0)*(a) ) ) + + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare line size page. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_prepare_lsize_page (glObjectEditor *editor) +{ + const gchar *units_string; + gdouble climb_rate; + gint digits; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Extract widgets from XML tree. */ + editor->priv->lsize_page_vbox = + glade_xml_get_widget (editor->priv->gui, "lsize_page_vbox"); + editor->priv->lsize_r_spin = + glade_xml_get_widget (editor->priv->gui, "lsize_r_spin"); + editor->priv->lsize_theta_spin = + glade_xml_get_widget (editor->priv->gui, "lsize_theta_spin"); + editor->priv->lsize_r_units_label = + glade_xml_get_widget (editor->priv->gui, "lsize_r_units_label"); + + /* Get configuration information */ + units_string = gl_prefs_get_units_string (); + editor->priv->units_per_point = gl_prefs_get_units_per_point (); + climb_rate = gl_prefs_get_units_step_size (); + digits = gl_prefs_get_units_precision (); + + /* Modify widgets based on configuration */ + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), + climb_rate, 10.0*climb_rate); + gtk_label_set_text (GTK_LABEL(editor->priv->lsize_r_units_label), units_string); + + /* Un-hide */ + gtk_widget_show_all (editor->priv->lsize_page_vbox); + + /* Connect signals */ + g_signal_connect_swapped (G_OBJECT (editor->priv->lsize_r_spin), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->lsize_theta_spin), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set line size. */ +/*****************************************************************************/ +void +gl_object_editor_set_lsize (glObjectEditor *editor, + gdouble dx, + gdouble dy) +{ + gdouble r, theta; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + /* save a copy in internal units */ + editor->priv->dx = dx; + editor->priv->dy = dy; + + /* convert internal units to displayed units */ + gl_debug (DEBUG_EDITOR, "internal dx,dy = %g, %g", dx, dy); + dx *= editor->priv->units_per_point; + dy *= editor->priv->units_per_point; + gl_debug (DEBUG_EDITOR, "display dx,dy = %g, %g", dx, dy); + + r = LENGTH (dx, dy); + theta = ANGLE (dx, dy); + + /* Set widget values */ + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin), r); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_theta_spin), + theta); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set maximum line size. */ +/*****************************************************************************/ +void +gl_object_editor_set_max_lsize (glObjectEditor *editor, + gdouble dx_max, + gdouble dy_max) +{ + gdouble tmp; + + gl_debug (DEBUG_EDITOR, "START"); + + if (editor->priv->lsize_page_vbox) + { + + editor->priv->stop_signals = TRUE; + + /* save a copy in internal units */ + editor->priv->dx_max = dx_max; + editor->priv->dy_max = dy_max; + + /* convert internal units to displayed units */ + gl_debug (DEBUG_EDITOR, "internal dx_max,dy_max = %g, %g", dx_max, dy_max); + dx_max *= editor->priv->units_per_point; + dy_max *= editor->priv->units_per_point; + gl_debug (DEBUG_EDITOR, "display dx_max,dy_max = %g, %g", dx_max, dy_max); + + /* Set widget values */ + tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin)); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin), + 0.0, 2.0*LENGTH (dx_max, dy_max)); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin), tmp); + + editor->priv->stop_signals = FALSE; + + } + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query line size. */ +/*****************************************************************************/ +void +gl_object_editor_get_lsize (glObjectEditor *editor, + gdouble *dx, + gdouble *dy) +{ + gdouble r, theta; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Get values from widgets */ + r = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin)); + theta = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->lsize_theta_spin)); + + /* convert everything back to our internal units (points) */ + r /= editor->priv->units_per_point; + + *dx = COMP_X (r, theta); + *dy = COMP_Y (r, theta); + + /* save a copy in internal units */ + editor->priv->dx = *dx; + editor->priv->dy = *dy; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* PRIVATE. Prefs changed callback. Update units related items. */ +/*****************************************************************************/ +void +lsize_prefs_changed_cb (glObjectEditor *editor) +{ + const gchar *units_string; + gdouble climb_rate; + gint digits; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Get new configuration information */ + units_string = gl_prefs_get_units_string (); + editor->priv->units_per_point = gl_prefs_get_units_per_point (); + climb_rate = gl_prefs_get_units_step_size (); + digits = gl_prefs_get_units_precision (); + + /* Update characteristics of r_spin */ + editor->priv->stop_signals = TRUE; + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), + digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), + climb_rate, 10.0*climb_rate); + editor->priv->stop_signals = FALSE; + + /* Update r_units_label */ + gtk_label_set_text (GTK_LABEL(editor->priv->lsize_r_units_label), + units_string); + + /* Update values of r_spin/theta_spin */ + gl_object_editor_set_lsize (editor, + editor->priv->dx, + editor->priv->dy); + gl_object_editor_set_max_lsize (editor, + editor->priv->dx_max, + editor->priv->dy_max); + + gl_debug (DEBUG_EDITOR, "END"); +} + diff --git a/src/object-editor-position-page.c b/src/object-editor-position-page.c new file mode 100644 index 00000000..e72036e0 --- /dev/null +++ b/src/object-editor-position-page.c @@ -0,0 +1,253 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include + +#include "prefs.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare position page. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_prepare_position_page (glObjectEditor *editor) +{ + const gchar *units_string; + gdouble climb_rate; + gint digits; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Extract widgets from XML tree. */ + editor->priv->pos_page_vbox = glade_xml_get_widget (editor->priv->gui, + "pos_page_vbox"); + editor->priv->pos_x_spin = glade_xml_get_widget (editor->priv->gui, + "pos_x_spin"); + editor->priv->pos_y_spin = glade_xml_get_widget (editor->priv->gui, + "pos_y_spin"); + editor->priv->pos_x_units_label = glade_xml_get_widget (editor->priv->gui, + "pos_x_units_label"); + editor->priv->pos_y_units_label = glade_xml_get_widget (editor->priv->gui, + "pos_y_units_label"); + + /* Get configuration information */ + units_string = gl_prefs_get_units_string (); + editor->priv->units_per_point = gl_prefs_get_units_per_point (); + climb_rate = gl_prefs_get_units_step_size (); + digits = gl_prefs_get_units_precision (); + + /* Modify widgets based on configuration */ + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_x_spin), digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_x_spin), + climb_rate, 10.0*climb_rate); + gtk_label_set_text (GTK_LABEL(editor->priv->pos_x_units_label), units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_y_spin), digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_y_spin), + climb_rate, 10.0*climb_rate); + gtk_label_set_text (GTK_LABEL(editor->priv->pos_y_units_label), units_string); + + /* Un-hide */ + gtk_widget_show_all (editor->priv->pos_page_vbox); + + /* Connect signals */ + g_signal_connect_swapped (G_OBJECT (editor->priv->pos_x_spin), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->pos_y_spin), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set position. */ +/*****************************************************************************/ +void +gl_object_editor_set_position (glObjectEditor *editor, + gdouble x, + gdouble y) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + /* save a copy in internal units */ + editor->priv->x = x; + editor->priv->y = y; + + /* convert internal units to displayed units */ + gl_debug (DEBUG_EDITOR, "internal x,y = %g, %g", x, y); + x *= editor->priv->units_per_point; + y *= editor->priv->units_per_point; + gl_debug (DEBUG_EDITOR, "display x,y = %g, %g", x, y); + + /* Set widget values */ + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), x); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), y); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set maximum position. */ +/*****************************************************************************/ +void +gl_object_editor_set_max_position (glObjectEditor *editor, + gdouble x_max, + gdouble y_max) +{ + gdouble tmp; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + /* save a copy in internal units */ + editor->priv->x_max = x_max; + editor->priv->y_max = y_max; + + /* convert internal units to displayed units */ + gl_debug (DEBUG_EDITOR, "internal x_max,y_max = %g, %g", x_max, y_max); + x_max *= editor->priv->units_per_point; + y_max *= editor->priv->units_per_point; + gl_debug (DEBUG_EDITOR, "display x_max,y_max = %g, %g", x_max, y_max); + + /* Set widget values */ + tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin)); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), + -x_max, 2.0*x_max); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), tmp); + tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin)); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), + -y_max, 2.0*y_max); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), tmp); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query position. */ +/*****************************************************************************/ +void +gl_object_editor_get_position (glObjectEditor *editor, + gdouble *x, + gdouble *y) +{ + gl_debug (DEBUG_EDITOR, "START"); + + /* Get values from widgets */ + *x = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin)); + *y = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin)); + + /* convert everything back to our internal units (points) */ + *x /= editor->priv->units_per_point; + *y /= editor->priv->units_per_point; + + /* save a copy in internal units */ + editor->priv->x = *x; + editor->priv->y = *y; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* PRIVATE. Prefs changed callback. Update units related items. */ +/*****************************************************************************/ +void +position_prefs_changed_cb (glObjectEditor *editor) +{ + const gchar *units_string; + gdouble climb_rate; + gint digits; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Get new configuration information */ + units_string = gl_prefs_get_units_string (); + editor->priv->units_per_point = gl_prefs_get_units_per_point (); + climb_rate = gl_prefs_get_units_step_size (); + digits = gl_prefs_get_units_precision (); + + /* Update characteristics of x_spin/y_spin */ + editor->priv->stop_signals = TRUE; + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_x_spin), + digits); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_y_spin), + digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_x_spin), + climb_rate, 10.0*climb_rate); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_y_spin), + climb_rate, 10.0*climb_rate); + editor->priv->stop_signals = FALSE; + + /* Update units_labels */ + gtk_label_set_text (GTK_LABEL(editor->priv->pos_x_units_label), + units_string); + gtk_label_set_text (GTK_LABEL(editor->priv->pos_y_units_label), + units_string); + + /* Update values of x_spin/y_spin */ + gl_object_editor_set_position (editor, + editor->priv->x, + editor->priv->y); + gl_object_editor_set_max_position (editor, + editor->priv->x_max, + editor->priv->y_max); + + gl_debug (DEBUG_EDITOR, "END"); +} + diff --git a/src/object-editor-private.h b/src/object-editor-private.h new file mode 100644 index 00000000..e83759ad --- /dev/null +++ b/src/object-editor-private.h @@ -0,0 +1,204 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor-private.h: object properties editor module private header file + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __OBJECT_EDITOR_PRIVATE_H__ +#define __OBJECT_EDITOR_PRIVATE_H__ + +#include +#include + +G_BEGIN_DECLS + +struct _glObjectEditorPrivate { + + GladeXML *gui; + GtkWidget *editor_vbox; + + glLabel *label; + + gdouble units_per_point; + + GtkWidget *title_image; + GtkWidget *title_label; + GtkWidget *notebook; + + GtkWidget *pos_page_vbox; + GtkWidget *pos_x_spin; + GtkWidget *pos_y_spin; + GtkWidget *pos_x_units_label; + GtkWidget *pos_y_units_label; + gdouble x; + gdouble y; + gdouble x_max; + gdouble y_max; + + GtkWidget *size_page_vbox; + GtkWidget *size_w_spin; + GtkWidget *size_h_spin; + GtkWidget *size_w_units_label; + GtkWidget *size_h_units_label; + GtkWidget *size_aspect_checkbutton; + GtkWidget *size_reset_image_button; + gdouble size_aspect_ratio; + gdouble w; + gdouble h; + gdouble w_max; + gdouble h_max; + gdouble w_base; + gdouble h_base; + + GtkWidget *lsize_page_vbox; + GtkWidget *lsize_r_spin; + GtkWidget *lsize_theta_spin; + GtkWidget *lsize_r_units_label; + gdouble dx; + gdouble dy; + gdouble dx_max; + gdouble dy_max; + + GtkWidget *fill_page_vbox; + GtkWidget *fill_color_combo; + GtkWidget *fill_key_combo; + GtkWidget *fill_key_radio; + GtkWidget *fill_color_radio; + + GtkWidget *line_page_vbox; + GtkWidget *line_width_spin; + GtkWidget *line_color_radio; + GtkWidget *line_color_combo; + GtkWidget *line_key_radio; + GtkWidget *line_key_combo; + + GtkWidget *img_page_vbox; + GtkWidget *img_file_radio; + GtkWidget *img_key_radio; + GtkWidget *img_file_button; + GtkWidget *img_key_combo; + + GtkWidget *text_page_vbox; + GtkWidget *text_family_combo; + GtkWidget *text_size_spin; + GtkWidget *text_bold_toggle; + GtkWidget *text_italic_toggle; + GtkWidget *text_color_radio; + GtkWidget *text_color_combo; + GtkWidget *text_color_key_radio; + GtkWidget *text_color_key_combo; + GtkWidget *text_left_toggle; + GtkWidget *text_center_toggle; + GtkWidget *text_right_toggle; + GtkWidget *text_line_spacing_spin; + GtkWidget *text_auto_shrink_check; + + GtkWidget *edit_page_vbox; + GtkWidget *edit_text_view; + GtkWidget *edit_key_label; + GtkWidget *edit_key_combo; + GtkWidget *edit_insert_field_button; + + GtkWidget *bc_page_vbox; + GtkWidget *bc_style_combo; + GtkWidget *bc_text_check; + GtkWidget *bc_cs_check; + GtkWidget *bc_color_radio; + GtkWidget *bc_color_combo; + GtkWidget *bc_key_radio; + GtkWidget *bc_key_combo; + + GtkWidget *data_page_vbox; + GtkWidget *data_literal_radio; + GtkWidget *data_key_radio; + GtkWidget *data_text_entry; + GtkWidget *data_key_combo; + GtkWidget *data_format_label; + GtkWidget *data_ex_label; + GtkWidget *data_digits_label; + GtkWidget *data_digits_spin; + gboolean data_format_fixed_flag; + + GtkWidget *shadow_page_vbox; + GtkWidget *shadow_enable_check; + GtkWidget *shadow_controls_table; + GtkWidget *shadow_x_spin; + GtkWidget *shadow_y_spin; + GtkWidget *shadow_x_units_label; + GtkWidget *shadow_y_units_label; + GtkWidget *shadow_color_radio; + GtkWidget *shadow_key_radio; + GtkWidget *shadow_color_combo; + GtkWidget *shadow_key_combo; + GtkWidget *shadow_opacity_spin; + gdouble shadow_x; + gdouble shadow_y; + gdouble shadow_x_max; + gdouble shadow_y_max; + + /* Prevent recursion */ + gboolean stop_signals; +}; + +enum { + CHANGED, + SIZE_CHANGED, + LAST_SIGNAL +}; + +extern gint gl_object_editor_signals[LAST_SIGNAL]; + + + +void gl_object_editor_prepare_position_page (glObjectEditor *editor); + +void gl_object_editor_prepare_size_page (glObjectEditor *editor, + glObjectEditorOption option); + +void gl_object_editor_prepare_lsize_page (glObjectEditor *editor); + +void gl_object_editor_prepare_fill_page (glObjectEditor *editor); + +void gl_object_editor_prepare_line_page (glObjectEditor *editor); + +void gl_object_editor_prepare_image_page (glObjectEditor *editor); + +void gl_object_editor_prepare_text_page (glObjectEditor *editor); + +void gl_object_editor_prepare_edit_page (glObjectEditor *editor); + +void gl_object_editor_prepare_bc_page (glObjectEditor *editor); + +void gl_object_editor_prepare_data_page (glObjectEditor *editor); + +void gl_object_editor_prepare_shadow_page (glObjectEditor *editor); + + +void gl_object_editor_changed_cb (glObjectEditor *editor); +void gl_object_editor_size_changed_cb (glObjectEditor *editor); + +void lsize_prefs_changed_cb (glObjectEditor *editor); +void size_prefs_changed_cb (glObjectEditor *editor); +void position_prefs_changed_cb (glObjectEditor *editor); +void shadow_prefs_changed_cb (glObjectEditor *editor); + +G_END_DECLS + +#endif diff --git a/src/object-editor-shadow-page.c b/src/object-editor-shadow-page.c new file mode 100644 index 00000000..4be309e9 --- /dev/null +++ b/src/object-editor-shadow-page.c @@ -0,0 +1,494 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include +#include +#include + +#include "prefs.h" +#include "mygal/widget-color-combo.h" +#include "color.h" +#include "util.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void shadow_enable_check_toggled_cb (glObjectEditor *editor); +static void shadow_color_radio_toggled_cb (glObjectEditor *editor); + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare shadow page. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_prepare_shadow_page (glObjectEditor *editor) +{ + const gchar *units_string; + gdouble climb_rate; + gint digits; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Extract widgets from XML tree. */ + editor->priv->shadow_page_vbox + = glade_xml_get_widget (editor->priv->gui, "shadow_page_vbox"); + editor->priv->shadow_enable_check + = glade_xml_get_widget (editor->priv->gui, "shadow_enable_check"); + editor->priv->shadow_controls_table + = glade_xml_get_widget (editor->priv->gui, "shadow_controls_table"); + editor->priv->shadow_x_spin + = glade_xml_get_widget (editor->priv->gui, "shadow_x_spin"); + editor->priv->shadow_y_spin + = glade_xml_get_widget (editor->priv->gui, "shadow_y_spin"); + editor->priv->shadow_x_units_label + = glade_xml_get_widget (editor->priv->gui, "shadow_x_units_label"); + editor->priv->shadow_y_units_label + = glade_xml_get_widget (editor->priv->gui, "shadow_y_units_label"); + editor->priv->shadow_color_radio + = glade_xml_get_widget (editor->priv->gui, "shadow_color_radio"); + editor->priv->shadow_key_radio + = glade_xml_get_widget (editor->priv->gui, "shadow_key_radio"); + editor->priv->shadow_color_combo + = glade_xml_get_widget (editor->priv->gui, "shadow_color_combo"); + editor->priv->shadow_key_combo + = glade_xml_get_widget (editor->priv->gui, "shadow_key_combo"); + editor->priv->shadow_opacity_spin + = glade_xml_get_widget (editor->priv->gui, "shadow_opacity_spin"); + + gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->shadow_key_combo)); + + /* Get configuration information */ + units_string = gl_prefs_get_units_string (); + editor->priv->units_per_point = gl_prefs_get_units_per_point (); + climb_rate = gl_prefs_get_units_step_size (); + digits = gl_prefs_get_units_precision (); + + /* Modify widgets based on configuration */ + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_x_spin), digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->shadow_x_spin), + climb_rate, 10.0*climb_rate); + gtk_label_set_text (GTK_LABEL(editor->priv->shadow_x_units_label), units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin), digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin), + climb_rate, 10.0*climb_rate); + gtk_label_set_text (GTK_LABEL(editor->priv->shadow_y_units_label), units_string); + + /* Un-hide */ + gtk_widget_show_all (editor->priv->shadow_page_vbox); + + /* Connect signals */ + g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_enable_check), + "toggled", + G_CALLBACK (shadow_enable_check_toggled_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_x_spin), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_y_spin), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_color_combo), + "color_changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_key_combo), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_color_radio), + "toggled", + G_CALLBACK (shadow_color_radio_toggled_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_key_radio), + "toggled", + G_CALLBACK (shadow_color_radio_toggled_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_opacity_spin), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set shadow parameters. */ +/*****************************************************************************/ +void +gl_object_editor_set_shadow_state (glObjectEditor *editor, + gboolean state) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check), + state); + gtk_widget_set_sensitive (editor->priv->shadow_controls_table, state); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +void +gl_object_editor_set_shadow_offset (glObjectEditor *editor, + gdouble x, + gdouble y) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + /* save a copy in internal units */ + editor->priv->shadow_x = x; + editor->priv->shadow_y = y; + + /* convert internal units to displayed units */ + gl_debug (DEBUG_EDITOR, "internal x,y = %g, %g", x, y); + x *= editor->priv->units_per_point; + y *= editor->priv->units_per_point; + gl_debug (DEBUG_EDITOR, "display x,y = %g, %g", x, y); + + /* Set widget values */ + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), x); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), y); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +void +gl_object_editor_set_shadow_color (glObjectEditor *editor, + gboolean merge_flag, + glColorNode *color_node) +{ + GdkColor *gdk_color; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_widget_set_sensitive (editor->priv->shadow_key_radio, merge_flag); + + if ( color_node->color == GL_COLOR_NONE ) { + + color_combo_set_color_to_default (COLOR_COMBO(editor->priv->shadow_color_combo)); + + } else { + + gdk_color = gl_color_to_gdk_color (color_node->color); + color_combo_set_color (COLOR_COMBO(editor->priv->shadow_color_combo), + gdk_color); + g_free (gdk_color); + + } + + if (!color_node->field_flag) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->shadow_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->shadow_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->shadow_key_combo, FALSE); + + } else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->shadow_key_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->shadow_color_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->shadow_key_combo, TRUE); + + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->shadow_key_combo), + color_node->key); + } + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +void +gl_object_editor_set_shadow_opacity (glObjectEditor *editor, + gdouble alpha) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_opacity_spin), + alpha * 100.0); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + + +/*****************************************************************************/ +/* Set maximum shadow offset. */ +/*****************************************************************************/ +void +gl_object_editor_set_max_shadow_offset (glObjectEditor *editor, + gdouble x_max, + gdouble y_max) +{ + gdouble tmp; + + gl_debug (DEBUG_EDITOR, "START"); + + if (editor->priv->shadow_page_vbox) + { + + editor->priv->stop_signals = TRUE; + + /* save a copy in internal units */ + editor->priv->shadow_x_max = x_max; + editor->priv->shadow_y_max = y_max; + + /* convert internal units to displayed units */ + gl_debug (DEBUG_EDITOR, "internal x_max,y_max = %g, %g", x_max, y_max); + x_max *= editor->priv->units_per_point; + y_max *= editor->priv->units_per_point; + gl_debug (DEBUG_EDITOR, "display x_max,y_max = %g, %g", x_max, y_max); + + /* Set widget values */ + tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin)); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), + -x_max, x_max); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), tmp); + tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin)); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), + -y_max, y_max); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), tmp); + + editor->priv->stop_signals = FALSE; + + } + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query shadow parameters. */ +/*****************************************************************************/ +gboolean +gl_object_editor_get_shadow_state (glObjectEditor *editor) +{ + gboolean state; + + gl_debug (DEBUG_EDITOR, "START"); + + state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check)); + + gl_debug (DEBUG_EDITOR, "END"); + + return state; +} + +void +gl_object_editor_get_shadow_offset (glObjectEditor *editor, + gdouble *x, + gdouble *y) +{ + gl_debug (DEBUG_EDITOR, "START"); + + /* Get values from widgets */ + *x = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin)); + *y = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin)); + + /* convert everything back to our internal units (points) */ + *x /= editor->priv->units_per_point; + *y /= editor->priv->units_per_point; + + /* save a copy in internal units */ + editor->priv->shadow_x = *x; + editor->priv->shadow_y = *y; + + gl_debug (DEBUG_EDITOR, "END"); +} + +glColorNode* +gl_object_editor_get_shadow_color (glObjectEditor *editor) +{ + GdkColor *gdk_color; + gboolean is_default; + glColorNode *color_node; + + gl_debug (DEBUG_EDITOR, "START"); + + color_node = gl_color_node_new_default (); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_key_radio))) { + color_node->field_flag = TRUE; + color_node->key = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->shadow_key_combo)); + } else { + color_node->field_flag = FALSE; + color_node->key = NULL; + gdk_color = color_combo_get_color (COLOR_COMBO(editor->priv->shadow_color_combo), + &is_default); + + if (!is_default) { + color_node->color = gl_color_from_gdk_color (gdk_color); + } + } + + gl_debug (DEBUG_EDITOR, "END"); + + return color_node; +} + +gdouble +gl_object_editor_get_shadow_opacity (glObjectEditor *editor) +{ + gdouble alpha; + + gl_debug (DEBUG_EDITOR, "START"); + + alpha = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_opacity_spin)); + + gl_debug (DEBUG_EDITOR, "END"); + + return alpha / 100.0; +} + + +/*****************************************************************************/ +/* PRIVATE. Prefs changed callback. Update units related items. */ +/*****************************************************************************/ +void +shadow_prefs_changed_cb (glObjectEditor *editor) +{ + const gchar *units_string; + gdouble climb_rate; + gint digits; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Get new configuration information */ + units_string = gl_prefs_get_units_string (); + editor->priv->units_per_point = gl_prefs_get_units_per_point (); + climb_rate = gl_prefs_get_units_step_size (); + digits = gl_prefs_get_units_precision (); + + /* Update characteristics of x_spin/y_spin */ + editor->priv->stop_signals = TRUE; + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_x_spin), + digits); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin), + digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->shadow_x_spin), + climb_rate, 10.0*climb_rate); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin), + climb_rate, 10.0*climb_rate); + editor->priv->stop_signals = FALSE; + + /* Update units_labels */ + gtk_label_set_text (GTK_LABEL(editor->priv->shadow_x_units_label), + units_string); + gtk_label_set_text (GTK_LABEL(editor->priv->shadow_y_units_label), + units_string); + + /* Update values of x_spin/y_spin */ + gl_object_editor_set_shadow_offset (editor, + editor->priv->shadow_x, + editor->priv->shadow_y); + gl_object_editor_set_max_shadow_offset (editor, + editor->priv->shadow_x_max, + editor->priv->shadow_y_max); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. shadow enable check callback. */ +/*--------------------------------------------------------------------------*/ +static void +shadow_enable_check_toggled_cb (glObjectEditor *editor) +{ + gboolean state; + + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check)); + + gtk_widget_set_sensitive (editor->priv->shadow_controls_table, state); + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + + gl_debug (DEBUG_EDITOR, "END"); +} + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. shadow color radio callback. */ +/*--------------------------------------------------------------------------*/ +static void +shadow_color_radio_toggled_cb (glObjectEditor *editor) +{ + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_color_radio))) { + gtk_widget_set_sensitive (editor->priv->shadow_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->shadow_key_combo, FALSE); + } else { + gtk_widget_set_sensitive (editor->priv->shadow_color_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->shadow_key_combo, TRUE); + + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + + gl_debug (DEBUG_EDITOR, "END"); +} diff --git a/src/object-editor-size-page.c b/src/object-editor-size-page.c new file mode 100644 index 00000000..58cec074 --- /dev/null +++ b/src/object-editor-size-page.c @@ -0,0 +1,453 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include + +#include "prefs.h" +#include "wdgt-chain-button.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void aspect_toggle_cb (glObjectEditor *editor); +static void size_reset_cb (glObjectEditor *editor); +static void w_spin_cb (glObjectEditor *editor); +static void h_spin_cb (glObjectEditor *editor); + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare size page. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_prepare_size_page (glObjectEditor *editor, + glObjectEditorOption option) +{ + const gchar *units_string; + gdouble climb_rate; + gint digits; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Extract widgets from XML tree. */ + editor->priv->size_page_vbox = + glade_xml_get_widget (editor->priv->gui, "size_page_vbox"); + editor->priv->size_w_spin = + glade_xml_get_widget (editor->priv->gui, "size_w_spin"); + editor->priv->size_h_spin = + glade_xml_get_widget (editor->priv->gui, "size_h_spin"); + editor->priv->size_w_units_label = + glade_xml_get_widget (editor->priv->gui, "size_w_units_label"); + editor->priv->size_h_units_label = + glade_xml_get_widget (editor->priv->gui, "size_h_units_label"); + editor->priv->size_aspect_checkbutton = + glade_xml_get_widget (editor->priv->gui, "size_aspect_checkbutton"); + editor->priv->size_reset_image_button = + glade_xml_get_widget (editor->priv->gui, "size_reset_image_button"); + + /* Get configuration information */ + units_string = gl_prefs_get_units_string (); + editor->priv->units_per_point = gl_prefs_get_units_per_point (); + climb_rate = gl_prefs_get_units_step_size (); + digits = gl_prefs_get_units_precision (); + + /* Modify widgets based on configuration */ + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_w_spin), digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_w_spin), + climb_rate, 10.0*climb_rate); + gtk_label_set_text (GTK_LABEL(editor->priv->size_w_units_label), units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_h_spin), digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_h_spin), + climb_rate, 10.0*climb_rate); + gtk_label_set_text (GTK_LABEL(editor->priv->size_h_units_label), units_string); + + /* Un-hide */ + gtk_widget_show_all (editor->priv->size_page_vbox); + if (option != GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE) { + gtk_widget_hide (editor->priv->size_reset_image_button); + } + + /* Connect signals */ + g_signal_connect_swapped (G_OBJECT (editor->priv->size_aspect_checkbutton), + "toggled", + G_CALLBACK (aspect_toggle_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->size_w_spin), + "changed", + G_CALLBACK (w_spin_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->size_h_spin), + "changed", + G_CALLBACK (h_spin_cb), + G_OBJECT (editor)); + + if (option == GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE) { + g_signal_connect_swapped (G_OBJECT (editor->priv->size_reset_image_button), + "clicked", + G_CALLBACK (size_reset_cb), + G_OBJECT (editor)); + } + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Maintain aspect ratio checkbox callback. */ +/*--------------------------------------------------------------------------*/ +static void +aspect_toggle_cb (glObjectEditor *editor) +{ + glWdgtChainButton *toggle; + gdouble w, h; + + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton); + + if (gl_wdgt_chain_button_get_active (toggle)) { + + w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->size_w_spin)); + h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->size_h_spin)); + + editor->priv->size_aspect_ratio = h / w; + + } + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. W spin button changed callback. */ +/*--------------------------------------------------------------------------*/ +static void +w_spin_cb (glObjectEditor *editor) +{ + gdouble w, h; + glWdgtChainButton *toggle; + + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton); + + if (gl_wdgt_chain_button_get_active (toggle)) { + + w = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin)); + + h = w * editor->priv->size_aspect_ratio; + + /* Update our sibling control, blocking recursion. */ + editor->priv->stop_signals = TRUE; + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), h); + editor->priv->stop_signals = FALSE; + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[SIZE_CHANGED], 0); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. H spin button changed callback. */ +/*--------------------------------------------------------------------------*/ +static void +h_spin_cb (glObjectEditor *editor) +{ + gdouble w, h; + glWdgtChainButton *toggle; + + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton); + + if (gl_wdgt_chain_button_get_active (toggle)) { + + h = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin)); + + w = h / editor->priv->size_aspect_ratio; + + /* Update our sibling control, blocking recursion. */ + editor->priv->stop_signals = TRUE; + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), w); + editor->priv->stop_signals = FALSE; + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[SIZE_CHANGED], 0); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Reset image size callback. */ +/*--------------------------------------------------------------------------*/ +static void +size_reset_cb (glObjectEditor *editor) +{ + gdouble w_base, h_base; + gdouble w_max, h_max, wh_max; + gdouble aspect_ratio; + + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + w_base = editor->priv->w_base; + h_base = editor->priv->h_base; + + w_max = editor->priv->w_max; + h_max = editor->priv->h_max; + wh_max = MAX( w_max, h_max ); + + if ( (w_base > wh_max) || (h_base > wh_max) ) { + + aspect_ratio = h_base / w_base; + + if ( aspect_ratio < 1.0 ) { + w_base = wh_max; + h_base = wh_max * aspect_ratio; + + } else { + w_base = wh_max / aspect_ratio; + h_base = wh_max; + } + } + + w_base *= editor->priv->units_per_point; + h_base *= editor->priv->units_per_point; + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), + w_base); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), + h_base); + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[SIZE_CHANGED], 0); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set size. */ +/*****************************************************************************/ +void +gl_object_editor_set_size (glObjectEditor *editor, + gdouble w, + gdouble h) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + /* save a copy in internal units */ + editor->priv->w = w; + editor->priv->h = h; + + /* convert internal units to displayed units */ + gl_debug (DEBUG_EDITOR, "internal w,h = %g, %g", w, h); + w *= editor->priv->units_per_point; + h *= editor->priv->units_per_point; + gl_debug (DEBUG_EDITOR, "display w,h = %g, %g", w, h); + + /* Set widget values */ + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), w); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), h); + + /* Update aspect ratio */ + editor->priv->size_aspect_ratio = h / w; + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set maximum size. */ +/*****************************************************************************/ +void +gl_object_editor_set_max_size (glObjectEditor *editor, + gdouble w_max, + gdouble h_max) +{ + gdouble tmp; + gdouble wh_max; + + gl_debug (DEBUG_EDITOR, "START"); + + if (editor->priv->size_page_vbox) + { + + editor->priv->stop_signals = TRUE; + + /* save a copy in internal units */ + editor->priv->w_max = w_max; + editor->priv->h_max = h_max; + + /* convert internal units to displayed units */ + gl_debug (DEBUG_EDITOR, "internal w_max,h_max = %g, %g", w_max, h_max); + w_max *= editor->priv->units_per_point; + h_max *= editor->priv->units_per_point; + wh_max = MAX( w_max, h_max ); + gl_debug (DEBUG_EDITOR, "display w_max,h_max = %g, %g", w_max, h_max); + + /* Set widget values */ + tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin)); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_w_spin), + 0.0, 2.0*wh_max); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), tmp); + tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin)); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_h_spin), + 0.0, 2.0*wh_max); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), tmp); + + editor->priv->stop_signals = FALSE; + + } + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set base or natural size of image. */ +/*****************************************************************************/ +void +gl_object_editor_set_base_size (glObjectEditor *editor, + gdouble w_base, + gdouble h_base) +{ + gl_debug (DEBUG_EDITOR, "Setting w_base = %g", w_base); + gl_debug (DEBUG_EDITOR, "Setting h_base = %g", h_base); + + editor->priv->w_base = w_base; + editor->priv->h_base = h_base; +} + +/*****************************************************************************/ +/* Query size. */ +/*****************************************************************************/ +void +gl_object_editor_get_size (glObjectEditor *editor, + gdouble *w, + gdouble *h) +{ + gl_debug (DEBUG_EDITOR, "START"); + + + /* Get values from widgets */ + *w = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin)); + *h = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin)); + + /* convert everything back to our internal units (points) */ + *w /= editor->priv->units_per_point; + *h /= editor->priv->units_per_point; + + /* save a copy in internal units */ + editor->priv->w = *w; + editor->priv->h = *h; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* PRIVATE. Prefs changed callback. Update units related items. */ +/*****************************************************************************/ +void +size_prefs_changed_cb (glObjectEditor *editor) +{ + const gchar *units_string; + gdouble climb_rate; + gint digits; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Get new configuration information */ + units_string = gl_prefs_get_units_string (); + editor->priv->units_per_point = gl_prefs_get_units_per_point (); + climb_rate = gl_prefs_get_units_step_size (); + digits = gl_prefs_get_units_precision (); + + /* Update characteristics of w_spin/h_spin */ + editor->priv->stop_signals = TRUE; + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_w_spin), + digits); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_h_spin), + digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_w_spin), + climb_rate, 10.0*climb_rate); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_h_spin), + climb_rate, 10.0*climb_rate); + editor->priv->stop_signals = FALSE; + + /* Update units_labels */ + gtk_label_set_text (GTK_LABEL(editor->priv->size_w_units_label), + units_string); + gtk_label_set_text (GTK_LABEL(editor->priv->size_h_units_label), + units_string); + + /* Update values of w_spin/h_spin */ + gl_object_editor_set_size (editor, + editor->priv->w, + editor->priv->h); + gl_object_editor_set_max_size (editor, + editor->priv->w_max, + editor->priv->h_max); + + gl_debug (DEBUG_EDITOR, "END"); +} + diff --git a/src/object-editor-text-page.c b/src/object-editor-text-page.c new file mode 100644 index 00000000..e8a463da --- /dev/null +++ b/src/object-editor-text-page.c @@ -0,0 +1,636 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include +#include + +#include "prefs.h" +#include "mygal/widget-color-combo.h" +#include "color.h" +#include "util.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void align_toggle_cb (GtkToggleButton *toggle, + glObjectEditor *editor); +static void text_radio_toggled_cb (glObjectEditor *editor); + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare size page. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_prepare_text_page (glObjectEditor *editor) +{ + GList *family_names = NULL; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Extract widgets from XML tree. */ + editor->priv->text_page_vbox = + glade_xml_get_widget (editor->priv->gui, "text_page_vbox"); + editor->priv->text_family_combo = + glade_xml_get_widget (editor->priv->gui, "text_family_combo"); + editor->priv->text_size_spin = + glade_xml_get_widget (editor->priv->gui, "text_size_spin"); + editor->priv->text_bold_toggle = + glade_xml_get_widget (editor->priv->gui, "text_bold_toggle"); + editor->priv->text_italic_toggle = + glade_xml_get_widget (editor->priv->gui, "text_italic_toggle"); + editor->priv->text_color_combo = + glade_xml_get_widget (editor->priv->gui, "text_color_combo"); + editor->priv->text_color_radio = + glade_xml_get_widget (editor->priv->gui, "text_color_radio"); + editor->priv->text_color_key_radio = + glade_xml_get_widget (editor->priv->gui, "text_color_key_radio"); + editor->priv->text_color_key_combo = + glade_xml_get_widget (editor->priv->gui, "text_color_key_combo"); + editor->priv->text_left_toggle = + glade_xml_get_widget (editor->priv->gui, "text_left_toggle"); + editor->priv->text_center_toggle = + glade_xml_get_widget (editor->priv->gui, "text_center_toggle"); + editor->priv->text_right_toggle = + glade_xml_get_widget (editor->priv->gui, "text_right_toggle"); + editor->priv->text_line_spacing_spin = + glade_xml_get_widget (editor->priv->gui, "text_line_spacing_spin"); + editor->priv->text_auto_shrink_check = + glade_xml_get_widget (editor->priv->gui, "text_auto_shrink_check"); + + gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->text_family_combo)); + gl_util_combo_box_add_text_model ( GTK_COMBO_BOX(editor->priv->text_color_key_combo)); + + /* Load family names */ + family_names = gl_util_get_font_family_list (); + gl_util_combo_box_set_strings (GTK_COMBO_BOX(editor->priv->text_family_combo), + family_names); + + /* Modify widgets */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE); + + /* Un-hide */ + gtk_widget_show_all (editor->priv->text_page_vbox); + + /* Connect signals */ + g_signal_connect_swapped (G_OBJECT (editor->priv->text_family_combo), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->text_size_spin), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->text_bold_toggle), + "toggled", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->text_italic_toggle), + "toggled", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->text_color_combo), + "color_changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->text_color_key_combo), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->text_color_radio), + "toggled", + G_CALLBACK (text_radio_toggled_cb), + G_OBJECT (editor)); + g_signal_connect_swapped (G_OBJECT (editor->priv->text_color_key_radio), + "toggled", + G_CALLBACK (text_radio_toggled_cb), + G_OBJECT (editor)); + + g_signal_connect (G_OBJECT (editor->priv->text_left_toggle), + "toggled", + G_CALLBACK (align_toggle_cb), + G_OBJECT (editor)); + g_signal_connect (G_OBJECT (editor->priv->text_center_toggle), + "toggled", + G_CALLBACK (align_toggle_cb), + G_OBJECT (editor)); + g_signal_connect (G_OBJECT (editor->priv->text_right_toggle), + "toggled", + G_CALLBACK (align_toggle_cb), + G_OBJECT (editor)); + + g_signal_connect_swapped (G_OBJECT (editor->priv->text_line_spacing_spin), + "changed", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + + g_signal_connect_swapped (G_OBJECT (editor->priv->text_auto_shrink_check), + "toggled", + G_CALLBACK (gl_object_editor_changed_cb), + G_OBJECT (editor)); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Alignment togglebutton callback. */ +/*--------------------------------------------------------------------------*/ +static void +align_toggle_cb (GtkToggleButton *toggle, + glObjectEditor *editor) +{ + if (editor->priv->stop_signals) return; + + if (gtk_toggle_button_get_active (toggle)) { + + if (GTK_WIDGET (toggle) == GTK_WIDGET (editor->priv->text_left_toggle)) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_center_toggle), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_right_toggle), + FALSE); + } else if (GTK_WIDGET (toggle) == + GTK_WIDGET (editor->priv->text_center_toggle)) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_left_toggle), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_right_toggle), + FALSE); + } else if (GTK_WIDGET (toggle) == + GTK_WIDGET (editor->priv->text_right_toggle)) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_left_toggle), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_center_toggle), + FALSE); + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + } + +} + +/*****************************************************************************/ +/* Set font family. */ +/*****************************************************************************/ +void +gl_object_editor_set_font_family (glObjectEditor *editor, + const gchar *font_family) +{ + GList *family_names; + gchar *old_font_family; + gchar *good_font_family; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + old_font_family = gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->text_family_combo)); + + if ( !old_font_family || g_utf8_collate( old_font_family, font_family ) ) + { + + /* Make sure we have a valid font family. if not provide a good default. */ + family_names = gl_util_get_font_family_list (); + if (g_list_find_custom (family_names, font_family, (GCompareFunc)g_utf8_collate)) { + good_font_family = g_strdup (font_family); + } else { + if (family_names != NULL) { + good_font_family = g_strdup (family_names->data); /* 1st entry */ + } else { + good_font_family = NULL; + } + } + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->text_family_combo), good_font_family); + g_free (good_font_family); + } + + g_free (old_font_family); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query font family. */ +/*****************************************************************************/ +gchar * +gl_object_editor_get_font_family (glObjectEditor *editor) +{ + gchar *font_family; + + gl_debug (DEBUG_EDITOR, "START"); + + font_family = gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->text_family_combo)); + + gl_debug (DEBUG_EDITOR, "END"); + + return font_family; +} + +/*****************************************************************************/ +/* Set font size. */ +/*****************************************************************************/ +void +gl_object_editor_set_font_size (glObjectEditor *editor, + gdouble font_size) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->text_size_spin), + font_size); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query font size. */ +/*****************************************************************************/ +gdouble +gl_object_editor_get_font_size (glObjectEditor *editor) +{ + gdouble font_size; + + gl_debug (DEBUG_EDITOR, "START"); + + font_size = + gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->text_size_spin)); + + gl_debug (DEBUG_EDITOR, "END"); + + return font_size; +} + +/*****************************************************************************/ +/* Set font weight. */ +/*****************************************************************************/ +void +gl_object_editor_set_font_weight (glObjectEditor *editor, + PangoWeight font_weight) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_bold_toggle), + (font_weight == PANGO_WEIGHT_BOLD)); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query font weight. */ +/*****************************************************************************/ +PangoWeight +gl_object_editor_get_font_weight (glObjectEditor *editor) +{ + PangoWeight font_weight; + + gl_debug (DEBUG_EDITOR, "START"); + + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (editor->priv->text_bold_toggle))) { + font_weight = PANGO_WEIGHT_BOLD; + } else { + font_weight = PANGO_WEIGHT_NORMAL; + } + + gl_debug (DEBUG_EDITOR, "END"); + + return font_weight; +} + +/*****************************************************************************/ +/* Set font italic flag. */ +/*****************************************************************************/ +void +gl_object_editor_set_font_italic_flag (glObjectEditor *editor, + gboolean font_italic_flag) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_italic_toggle), + font_italic_flag); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query font italic flag. */ +/*****************************************************************************/ +gboolean +gl_object_editor_get_font_italic_flag (glObjectEditor *editor) +{ + gboolean italic_flag; + + gl_debug (DEBUG_EDITOR, "START"); + + italic_flag = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (editor->priv->text_italic_toggle)); + + gl_debug (DEBUG_EDITOR, "END"); + + return italic_flag; +} + +/*****************************************************************************/ +/* Set text alignment. */ +/*****************************************************************************/ +void +gl_object_editor_set_text_alignment (glObjectEditor *editor, + PangoAlignment align) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_left_toggle), + (align == PANGO_ALIGN_LEFT)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_center_toggle), + (align == PANGO_ALIGN_CENTER)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_right_toggle), + (align == PANGO_ALIGN_RIGHT)); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query text alignment. */ +/*****************************************************************************/ +PangoAlignment +gl_object_editor_get_text_alignment (glObjectEditor *editor) +{ + PangoAlignment align; + + gl_debug (DEBUG_EDITOR, "START"); + + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (editor->priv->text_left_toggle))) { + align = PANGO_ALIGN_LEFT; + } else + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (editor->priv->text_right_toggle))) { + align = PANGO_ALIGN_RIGHT; + } else + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (editor->priv->text_center_toggle))) { + align = PANGO_ALIGN_CENTER; + } else { + align = PANGO_ALIGN_LEFT; /* Should not happen. */ + } + + gl_debug (DEBUG_EDITOR, "END"); + + return align; +} + +/*****************************************************************************/ +/* Set text color. */ +/*****************************************************************************/ +void +gl_object_editor_set_text_color (glObjectEditor *editor, + gboolean merge_flag, + glColorNode *text_color_node) +{ + GdkColor *gdk_color; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gl_debug (DEBUG_EDITOR, "color field %s(%d) / %X", text_color_node->key, text_color_node->field_flag, text_color_node->color); + + gtk_widget_set_sensitive (editor->priv->text_color_key_radio, merge_flag); + + if ( text_color_node->color == GL_COLOR_NONE ) { + + color_combo_set_color_to_default (COLOR_COMBO(editor->priv->text_color_combo)); + + } else { + + gdk_color = gl_color_to_gdk_color (text_color_node->color); + color_combo_set_color (COLOR_COMBO(editor->priv->text_color_combo), gdk_color); + g_free (gdk_color); + } + + if (!text_color_node->field_flag) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE); + gl_debug (DEBUG_EDITOR, "color field false 0"); + gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE); + + } else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (editor->priv->text_color_key_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->text_color_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->text_color_key_combo, TRUE); + + gl_debug (DEBUG_EDITOR, "color field true 1"); + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (editor->priv->text_color_key_combo), ""); + gl_debug (DEBUG_EDITOR, "color field true 2"); + } + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query text color. */ +/*****************************************************************************/ +glColorNode* +gl_object_editor_get_text_color (glObjectEditor *editor) +{ + GdkColor *gdk_color; + glColorNode *color_node; + gboolean is_default; + + gl_debug (DEBUG_EDITOR, "START"); + + color_node = gl_color_node_new_default (); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_key_radio))) { + color_node->field_flag = TRUE; + color_node->color = gl_prefs->default_text_color; + color_node->key = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (editor->priv->text_color_key_combo)); + } else { + color_node->field_flag = FALSE; + color_node->key = NULL; + gdk_color = color_combo_get_color (COLOR_COMBO(editor->priv->text_color_combo), + &is_default); + + if (is_default) { + color_node->color = gl_prefs->default_text_color; + } else { + color_node->color = gl_color_from_gdk_color (gdk_color); + } + } + + gl_debug (DEBUG_EDITOR, "END"); + + return color_node; +} + + +/*****************************************************************************/ +/* Set text line spacing. */ +/*****************************************************************************/ +void +gl_object_editor_set_text_line_spacing (glObjectEditor *editor, + gdouble text_line_spacing) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->text_line_spacing_spin), + text_line_spacing); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query text line spacing. */ +/*****************************************************************************/ +gdouble +gl_object_editor_get_text_line_spacing (glObjectEditor *editor) +{ + gdouble text_line_spacing; + + gl_debug (DEBUG_EDITOR, "START"); + + text_line_spacing = + gtk_spin_button_get_value (GTK_SPIN_BUTTON(editor->priv->text_line_spacing_spin)); + + gl_debug (DEBUG_EDITOR, "END"); + + return text_line_spacing; +} + +/*****************************************************************************/ +/* Set auto shrink checkbox. */ +/*****************************************************************************/ +void +gl_object_editor_set_text_auto_shrink (glObjectEditor *editor, + gboolean auto_shrink) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->stop_signals = TRUE; + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_auto_shrink_check), + auto_shrink); + + editor->priv->stop_signals = FALSE; + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Query auto shrink checkbox. */ +/*****************************************************************************/ +gboolean gl_object_editor_get_text_auto_shrink (glObjectEditor *editor) +{ + gboolean auto_shrink; + + gl_debug (DEBUG_EDITOR, "START"); + + auto_shrink = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->text_auto_shrink_check)); + + gl_debug (DEBUG_EDITOR, "END"); + + return auto_shrink; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. color radio callback. */ +/*--------------------------------------------------------------------------*/ +static void +text_radio_toggled_cb (glObjectEditor *editor) +{ + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_radio))) { + gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE); + } else { + gtk_widget_set_sensitive (editor->priv->text_color_combo, FALSE); + gtk_widget_set_sensitive (editor->priv->text_color_key_combo, TRUE); + + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + + gl_debug (DEBUG_EDITOR, "END"); +} diff --git a/src/object-editor.c b/src/object-editor.c new file mode 100644 index 00000000..02a153d6 --- /dev/null +++ b/src/object-editor.c @@ -0,0 +1,693 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/** + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.c: object properties editor module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "object-editor.h" + +#include +#include +#include +#include +#include +#include + +#include + +#include "prefs.h" +#include "mygal/widget-color-combo.h" +#include "color.h" +#include "wdgt-chain-button.h" +#include "marshal.h" +#include "util.h" + +#include "object-editor-private.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros */ +/*===========================================*/ + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +typedef void (*ChangedSignal) (GObject * object, gpointer data); + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +gint gl_object_editor_signals[LAST_SIGNAL] = { 0 }; + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_object_editor_finalize (GObject *object); + +static void gl_object_notebook_construct_valist (glObjectEditor *editor, + glLabel *label, + glObjectEditorOption first_option, + va_list args); + +static void prefs_changed_cb (glObjectEditor *editor); + +static void label_changed_cb (glLabel *label, + glObjectEditor *editor); + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glObjectEditor, gl_object_editor, GTK_TYPE_VBOX); + +static void +gl_object_editor_class_init (glObjectEditorClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_EDITOR, "START"); + + gl_object_editor_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_object_editor_finalize; + + gl_object_editor_signals[CHANGED] = + g_signal_new ("changed", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glObjectEditorClass, changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + gl_object_editor_signals[SIZE_CHANGED] = + g_signal_new ("size_changed", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glObjectEditorClass, size_changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + gl_debug (DEBUG_EDITOR, "END"); +} + +static void +gl_object_editor_init (glObjectEditor *editor) +{ + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv = g_new0 (glObjectEditorPrivate, 1); + + editor->priv->gui = glade_xml_new (GLABELS_GLADE_DIR "object-editor.glade", + "editor_vbox", + NULL); + + if (!editor->priv->gui) { + g_critical ("Could not open object-editor.glade. gLabels may not be installed correctly!"); + return; + } + + editor->priv->editor_vbox = glade_xml_get_widget (editor->priv->gui, + "editor_vbox"); + gtk_box_pack_start (GTK_BOX(editor), + editor->priv->editor_vbox, + FALSE, FALSE, 0); + + editor->priv->title_image = glade_xml_get_widget (editor->priv->gui, + "title_image"); + editor->priv->title_label = glade_xml_get_widget (editor->priv->gui, + "title_label"); + editor->priv->notebook = glade_xml_get_widget (editor->priv->gui, + "notebook"); + + gtk_widget_show_all (GTK_WIDGET(editor)); + + /* Hide all notebook pages to start with. */ + gtk_widget_hide_all (editor->priv->notebook); + gtk_widget_set_no_show_all (editor->priv->notebook, TRUE); + + gl_debug (DEBUG_EDITOR, "END"); +} + +static void +gl_object_editor_finalize (GObject *object) +{ + glObjectEditor* editor = GL_OBJECT_EDITOR (object);; + + gl_debug (DEBUG_EDITOR, "START"); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_OBJECT_EDITOR (editor)); + g_return_if_fail (editor->priv != NULL); + + g_signal_handlers_disconnect_by_func (G_OBJECT(gl_prefs), + prefs_changed_cb, editor); + g_signal_handlers_disconnect_by_func (G_OBJECT(editor->priv->label), + label_changed_cb, editor); + + g_object_unref (editor->priv->gui); + g_free (editor->priv); + + G_OBJECT_CLASS (gl_object_editor_parent_class)->finalize (object); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* NEW object editor. */ +/*****************************************************************************/ +GtkWidget* +gl_object_editor_new (gchar *image, + gchar *title, + glLabel *label, + glObjectEditorOption first_option, ...) +{ + glObjectEditor *editor; + va_list args; + + gl_debug (DEBUG_EDITOR, "START"); + + editor = GL_OBJECT_EDITOR (g_object_new (GL_TYPE_OBJECT_EDITOR, NULL)); + + if (image) { + gtk_image_set_from_stock (GTK_IMAGE(editor->priv->title_image), + image, + GTK_ICON_SIZE_LARGE_TOOLBAR); + } + + if (title) { + gchar *s; + + s = g_strdup_printf ("%s", + title); + gtk_label_set_text (GTK_LABEL(editor->priv->title_label), s); + g_free (s); + + gtk_label_set_use_markup (GTK_LABEL(editor->priv->title_label), TRUE); + + } + + gtk_notebook_set_homogeneous_tabs (GTK_NOTEBOOK(editor->priv->notebook), TRUE); + + va_start (args, first_option); + gl_object_notebook_construct_valist (editor, label, first_option, args); + va_end (args); + + gl_debug (DEBUG_EDITOR, "END"); + + return GTK_WIDGET(editor); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct notebook. */ +/*--------------------------------------------------------------------------*/ +static void +gl_object_notebook_construct_valist (glObjectEditor *editor, + glLabel *label, + glObjectEditorOption first_option, + va_list args) +{ + glObjectEditorOption option; + gint pages = 0; + + gl_debug (DEBUG_EDITOR, "START"); + + editor->priv->label = label; + + option = first_option; + + for ( option=first_option; option; option=va_arg (args, glObjectEditorOption) ) { + + switch (option) { + + case GL_OBJECT_EDITOR_EMPTY: + gtk_widget_set_sensitive (editor->priv->title_image, FALSE); + gtk_widget_set_sensitive (editor->priv->title_label, FALSE); + break; + + case GL_OBJECT_EDITOR_POSITION_PAGE: + gl_object_editor_prepare_position_page (editor); + pages++; + break; + + case GL_OBJECT_EDITOR_SIZE_PAGE: + case GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE: + gl_object_editor_prepare_size_page (editor, option); + pages++; + break; + + case GL_OBJECT_EDITOR_SIZE_LINE_PAGE: + gl_object_editor_prepare_lsize_page (editor); + pages++; + break; + + case GL_OBJECT_EDITOR_FILL_PAGE: + gl_object_editor_prepare_fill_page (editor); + pages++; + break; + + case GL_OBJECT_EDITOR_LINE_PAGE: + gl_object_editor_prepare_line_page (editor); + pages++; + break; + + case GL_OBJECT_EDITOR_IMAGE_PAGE: + gl_object_editor_prepare_image_page (editor); + pages++; + break; + + case GL_OBJECT_EDITOR_TEXT_PAGE: + gl_object_editor_prepare_text_page (editor); + pages++; + break; + + case GL_OBJECT_EDITOR_EDIT_PAGE: + gl_object_editor_prepare_edit_page (editor); + pages++; + break; + + case GL_OBJECT_EDITOR_BC_PAGE: + gl_object_editor_prepare_bc_page (editor); + pages++; + break; + + case GL_OBJECT_EDITOR_DATA_PAGE: + gl_object_editor_prepare_data_page (editor); + pages++; + break; + + case GL_OBJECT_EDITOR_SHADOW_PAGE: + gl_object_editor_prepare_shadow_page (editor); + pages++; + break; + + default: + g_message ("option = %d", option); + g_assert_not_reached (); + } + + } + if (pages) { + gtk_widget_show (editor->priv->notebook); + } + + g_signal_connect_swapped (G_OBJECT (gl_prefs), "changed", + G_CALLBACK (prefs_changed_cb), + editor); + if (label) + { + label_changed_cb (label, editor); + g_signal_connect (G_OBJECT (label), "size_changed", + G_CALLBACK (label_changed_cb), + editor); + g_signal_connect (G_OBJECT (label), "merge_changed", + G_CALLBACK (label_changed_cb), + editor); + } + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Widget changed callback. Emit our "changed" signal. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_changed_cb (glObjectEditor *editor) +{ + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Widget size changed callback. Emit our "size-changed" signal. */ +/*--------------------------------------------------------------------------*/ +void +gl_object_editor_size_changed_cb (glObjectEditor *editor) +{ + if (editor->priv->stop_signals) return; + + gl_debug (DEBUG_EDITOR, "START"); + + /* Emit our "size_changed" signal */ + g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[SIZE_CHANGED], 0); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Set possible key names from merge object. */ +/*****************************************************************************/ +void +gl_object_editor_set_key_names (glObjectEditor *editor, + glMerge *merge) +{ + GList *keys; + GtkWidget *combo; + gboolean fixed_flag; + gboolean state; + + gl_debug (DEBUG_EDITOR, "START"); + + if (editor->priv->edit_key_label) { + gtk_widget_set_sensitive (editor->priv->edit_key_label, merge != NULL); + } + + if (editor->priv->edit_key_combo) { + gtk_widget_set_sensitive (editor->priv->edit_key_combo, merge != NULL); + } + + if (editor->priv->text_auto_shrink_check) { + gtk_widget_set_sensitive (editor->priv->text_auto_shrink_check, + merge != NULL); + } + + if (editor->priv->text_page_vbox) { + gtk_widget_set_sensitive (editor->priv->text_color_key_radio, merge != NULL); + if (merge == NULL) { + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(editor->priv->text_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE); + } else { + state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->text_color_key_radio)); + gtk_widget_set_sensitive (editor->priv->text_color_combo, !state); + gtk_widget_set_sensitive (editor->priv->text_color_key_combo, state); + + } + } + + if (editor->priv->edit_insert_field_button) { + gtk_widget_set_sensitive (editor->priv->edit_insert_field_button, + merge != NULL); + } + + if (editor->priv->img_key_combo) { + gtk_widget_set_sensitive (editor->priv->img_key_combo, merge != NULL); + } + + if (editor->priv->img_key_radio) { + gtk_widget_set_sensitive (editor->priv->img_key_radio, merge != NULL); + if (merge == NULL) { + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(editor->priv->img_file_radio), TRUE); + } + } + + if (editor->priv->data_key_combo) { + gtk_widget_set_sensitive (editor->priv->data_key_combo, merge != NULL); + } + + if (editor->priv->data_key_radio) { + gtk_widget_set_sensitive (editor->priv->data_key_radio, merge != NULL); + if (merge == NULL) { + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(editor->priv->data_literal_radio), TRUE); + } + } + + fixed_flag = editor->priv->data_format_fixed_flag; + if (editor->priv->data_format_label) { + gtk_widget_set_sensitive (editor->priv->data_format_label, + (merge != NULL)); + } + if (editor->priv->data_ex_label) { + gtk_widget_set_sensitive (editor->priv->data_ex_label, + (merge != NULL)); + } + if (editor->priv->data_digits_label) { + gtk_widget_set_sensitive (editor->priv->data_digits_label, + (merge != NULL) && !fixed_flag); + } + if (editor->priv->data_digits_spin) { + gtk_widget_set_sensitive (editor->priv->data_digits_spin, + (merge != NULL) && !fixed_flag); + } + + if (editor->priv->fill_page_vbox) { + gtk_widget_set_sensitive (editor->priv->fill_key_radio, merge != NULL); + if (merge == NULL) { + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(editor->priv->fill_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE); + } else { + state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->fill_key_radio)); + gtk_widget_set_sensitive (editor->priv->fill_color_combo, !state); + gtk_widget_set_sensitive (editor->priv->fill_key_combo, state); + + } + } + + if (editor->priv->line_page_vbox) { + gtk_widget_set_sensitive (editor->priv->line_key_radio, merge != NULL); + if (merge == NULL) { + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(editor->priv->line_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->line_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->line_key_combo, FALSE); + } else { + state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->line_key_radio)); + gtk_widget_set_sensitive (editor->priv->line_color_combo, !state); + gtk_widget_set_sensitive (editor->priv->line_key_combo, state); + + } + } + + if (editor->priv->bc_page_vbox) { + gtk_widget_set_sensitive (editor->priv->bc_key_radio, merge != NULL); + if (merge == NULL) { + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(editor->priv->bc_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->bc_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->bc_key_combo, FALSE); + } else { + state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->bc_key_radio)); + gtk_widget_set_sensitive (editor->priv->bc_color_combo, !state); + gtk_widget_set_sensitive (editor->priv->bc_key_combo, state); + + } + } + + if (editor->priv->shadow_page_vbox) { + gtk_widget_set_sensitive (editor->priv->shadow_key_radio, merge != NULL); + if (merge == NULL) { + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(editor->priv->shadow_color_radio), TRUE); + gtk_widget_set_sensitive (editor->priv->shadow_color_combo, TRUE); + gtk_widget_set_sensitive (editor->priv->shadow_key_combo, FALSE); + } else { + state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->shadow_key_radio)); + gtk_widget_set_sensitive (editor->priv->shadow_color_combo, !state); + gtk_widget_set_sensitive (editor->priv->shadow_key_combo, state); + + } + } + + keys = gl_merge_get_key_list (merge); + if ( keys == NULL ) { + keys = g_list_append (keys, g_strdup ("")); + } + + combo = editor->priv->img_key_combo; + if (combo) { + gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); + } + + combo = editor->priv->edit_key_combo; + if (combo) { + gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); + } + + combo = editor->priv->data_key_combo; + if (combo) { + gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); + } + + combo = editor->priv->fill_key_combo; + if (combo) { + gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); + } + + combo = editor->priv->text_color_key_combo; + if (combo) { + gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); + } + + combo = editor->priv->line_key_combo; + if (combo) { + gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); + } + + combo = editor->priv->bc_key_combo; + if (combo) { + gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); + } + + combo = editor->priv->shadow_key_combo; + if (combo) { + gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys); + } + + gl_merge_free_key_list (&keys); + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*****************************************************************************/ +/* Construct color combo "Custom widget". */ +/*****************************************************************************/ +GtkWidget * +gl_object_editor_construct_color_combo (gchar *name, + gchar *string1, + gchar *string2, + gint int1, + gint int2) +{ + GtkWidget *color_combo; + ColorGroup *cg; + gchar *cg_name; + GdkColor *gdk_color; + gchar *no_color; + + switch (int1) { + + case 3: + cg_name = "shadow_color_group"; + gdk_color = gl_color_to_gdk_color (GL_COLOR_SHADOW_DEFAULT); + no_color = _("Default"); + break; + + case 2: + cg_name = "text_color_group"; + gdk_color = gl_color_to_gdk_color (gl_prefs->default_text_color); + no_color = _("Default"); + break; + + case 1: + cg_name = "line_color_group"; + gdk_color = NULL; + no_color = _("No line"); + break; + + case 0: + default: + cg_name = "fill_color_group"; + gdk_color = NULL; + no_color = _("No fill"); + break; + + } + + cg = color_group_fetch (cg_name, NULL); + color_combo = color_combo_new (NULL, no_color, gdk_color, cg); + g_free (gdk_color); + + color_combo_box_set_preview_relief (COLOR_COMBO(color_combo), GTK_RELIEF_NORMAL); + + return color_combo; +} + +/*****************************************************************************/ +/* Construct chain button "Custom widget". */ +/*****************************************************************************/ +GtkWidget * +gl_object_editor_construct_chain_button (gchar *name, + gchar *string1, + gchar *string2, + gint int1, + gint int2) +{ + GtkWidget *chain_button; + + chain_button = gl_wdgt_chain_button_new (GL_WDGT_CHAIN_RIGHT); + gl_wdgt_chain_button_set_active (GL_WDGT_CHAIN_BUTTON(chain_button), TRUE); + + return chain_button; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prefs changed callback. Update units related items. */ +/*--------------------------------------------------------------------------*/ +static void +prefs_changed_cb (glObjectEditor *editor) +{ + + gl_debug (DEBUG_EDITOR, "START"); + + if (editor->priv->lsize_r_spin) { + lsize_prefs_changed_cb (editor); + } + + if (editor->priv->size_w_spin) { + size_prefs_changed_cb (editor); + } + + if (editor->priv->pos_x_spin) { + position_prefs_changed_cb (editor); + } + + if (editor->priv->shadow_x_spin) { + shadow_prefs_changed_cb (editor); + } + + gl_debug (DEBUG_EDITOR, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +label_changed_cb (glLabel *label, + glObjectEditor *editor) +{ + gdouble label_width, label_height; + glMerge *merge; + + gl_debug (DEBUG_EDITOR, "START"); + + gl_label_get_size (label, &label_width, &label_height); + gl_object_editor_set_max_position (GL_OBJECT_EDITOR (editor), + label_width, label_height); + gl_object_editor_set_max_size (GL_OBJECT_EDITOR (editor), + label_width, label_height); + gl_object_editor_set_max_lsize (GL_OBJECT_EDITOR (editor), + label_width, label_height); + gl_object_editor_set_max_shadow_offset (GL_OBJECT_EDITOR (editor), + label_width, label_height); + + merge = gl_label_get_merge (label); + gl_object_editor_set_key_names (editor, merge); + + gl_debug (DEBUG_EDITOR, "END"); +} + diff --git a/src/object-editor.h b/src/object-editor.h new file mode 100644 index 00000000..fe3bbe56 --- /dev/null +++ b/src/object-editor.h @@ -0,0 +1,302 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * object-editor.h: object properties editor module header file + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __OBJECT_EDITOR_H__ +#define __OBJECT_EDITOR_H__ + +#include +#include + +#include "text-node.h" +#include "label.h" +#include "merge.h" +#include "bc.h" +#include "color.h" + +G_BEGIN_DECLS + +typedef enum { + GL_OBJECT_EDITOR_EMPTY = 1, + GL_OBJECT_EDITOR_POSITION_PAGE, + GL_OBJECT_EDITOR_SIZE_PAGE, + GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE, + GL_OBJECT_EDITOR_SIZE_LINE_PAGE, + GL_OBJECT_EDITOR_FILL_PAGE, + GL_OBJECT_EDITOR_LINE_PAGE, + GL_OBJECT_EDITOR_IMAGE_PAGE, + GL_OBJECT_EDITOR_TEXT_PAGE, + GL_OBJECT_EDITOR_EDIT_PAGE, + GL_OBJECT_EDITOR_BC_PAGE, + GL_OBJECT_EDITOR_DATA_PAGE, + GL_OBJECT_EDITOR_SHADOW_PAGE, +} glObjectEditorOption; + +#define GL_TYPE_OBJECT_EDITOR (gl_object_editor_get_type ()) +#define GL_OBJECT_EDITOR(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_OBJECT_EDITOR, glObjectEditor)) +#define GL_OBJECT_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_OBJECT_EDITOR, glObjectEditorClass)) +#define GL_IS_OBJECT_EDITOR(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_OBJECT_EDITOR)) +#define GL_IS_OBJECT_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_OBJECT_EDITOR)) +#define GL_OBJECT_EDITOR_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_OBJECT_EDITOR, glObjectEditorClass)) + + +typedef struct _glObjectEditor glObjectEditor; +typedef struct _glObjectEditorClass glObjectEditorClass; + +typedef struct _glObjectEditorPrivate glObjectEditorPrivate; + +struct _glObjectEditor +{ + GtkVBox parent_instance; + + glObjectEditorPrivate *priv; + +}; + +struct _glObjectEditorClass +{ + GtkVBoxClass parent_class; + + void (*changed) (glObjectEditor *editor, gpointer user_data); + void (*size_changed) (glObjectEditor *editor, gpointer user_data); +}; + + + + +GtkType gl_object_editor_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_object_editor_new (gchar *image, + gchar *title, + glLabel *label, + glObjectEditorOption first_option, ...); + +void gl_object_editor_set_key_names (glObjectEditor *editor, + glMerge *merge); + + +/* + * Position Page + */ +void gl_object_editor_set_position (glObjectEditor *editor, + gdouble x, + gdouble y); + +void gl_object_editor_set_max_position (glObjectEditor *editor, + gdouble x_max, + gdouble y_max); + +void gl_object_editor_get_position (glObjectEditor *editor, + gdouble *x, + gdouble *y); + +/* + * Size Page + */ +void gl_object_editor_set_size (glObjectEditor *editor, + gdouble w, + gdouble h); + +void gl_object_editor_set_max_size (glObjectEditor *editor, + gdouble w_max, + gdouble h_max); + +void gl_object_editor_set_base_size (glObjectEditor *editor, + gdouble w_max, + gdouble h_max); + +void gl_object_editor_get_size (glObjectEditor *editor, + gdouble *w, + gdouble *h); + + +/* + * Line Size Page + */ +void gl_object_editor_set_lsize (glObjectEditor *editor, + gdouble dx, + gdouble dy); + +void gl_object_editor_set_max_lsize (glObjectEditor *editor, + gdouble dx_max, + gdouble dy_max); + +void gl_object_editor_get_lsize (glObjectEditor *editor, + gdouble *dx, + gdouble *dy); + + +/* + * Fill Page + */ +void gl_object_editor_set_fill_color (glObjectEditor *editor, + gboolean merge_flag, + glColorNode *color_node); + +glColorNode* gl_object_editor_get_fill_color (glObjectEditor *editor); + + +/* + * Line/Outline Page + */ +void gl_object_editor_set_line_color (glObjectEditor *editor, + gboolean merge_flag, + glColorNode *color_node); + +glColorNode* gl_object_editor_get_line_color (glObjectEditor *editor); + +void gl_object_editor_set_line_width (glObjectEditor *editor, + gdouble width); + +gdouble gl_object_editor_get_line_width (glObjectEditor *editor); + + +/* + * Image Page + */ +void gl_object_editor_set_image (glObjectEditor *editor, + gboolean merge_flag, + glTextNode *text_node); + +glTextNode *gl_object_editor_get_image (glObjectEditor *editor); + + +/* + * Text Page + */ +void gl_object_editor_set_font_family (glObjectEditor *editor, + const gchar *font_family); + +gchar *gl_object_editor_get_font_family (glObjectEditor *editor); + +void gl_object_editor_set_font_size (glObjectEditor *editor, + gdouble font_size); + +gdouble gl_object_editor_get_font_size (glObjectEditor *editor); + +void gl_object_editor_set_font_weight (glObjectEditor *editor, + PangoWeight font_weight); + +PangoWeight gl_object_editor_get_font_weight (glObjectEditor *editor); + +void gl_object_editor_set_font_italic_flag (glObjectEditor *editor, + gboolean font_italic_flag); + +gboolean gl_object_editor_get_font_italic_flag (glObjectEditor *editor); + +void gl_object_editor_set_text_alignment (glObjectEditor *editor, + PangoAlignment text_alignment); + +PangoAlignment gl_object_editor_get_text_alignment (glObjectEditor *editor); + +void gl_object_editor_set_text_line_spacing (glObjectEditor *editor, + gdouble text_line_spacing); + +gdouble gl_object_editor_get_text_line_spacing (glObjectEditor *editor); + +void gl_object_editor_set_text_color (glObjectEditor *editor, + gboolean merge_flag, + glColorNode *text_color_node); + +glColorNode* gl_object_editor_get_text_color (glObjectEditor *editor); + +void gl_object_editor_set_text_auto_shrink (glObjectEditor *editor, + gboolean auto_shrink); + +gboolean gl_object_editor_get_text_auto_shrink (glObjectEditor *editor); + + +/* + * Edit Text Page + */ +void gl_object_editor_set_text_buffer (glObjectEditor *editor, + GtkTextBuffer *buffer); + +/* + * Barcode Page + */ +void gl_object_editor_set_bc_style (glObjectEditor *editor, + gchar *id, + gboolean text_flag, + gboolean checksum_flag, + guint format_digits); + +void gl_object_editor_get_bc_style (glObjectEditor *editor, + gchar **id, + gboolean *text_flag, + gboolean *checksum_flag, + guint *format_digits); + +void gl_object_editor_set_bc_color (glObjectEditor *editor, + gboolean merge_flag, + glColorNode *color_node); + +glColorNode* gl_object_editor_get_bc_color (glObjectEditor *editor); + + +/* + * Barcode Data Page + */ +void gl_object_editor_set_data (glObjectEditor *editor, + gboolean merge_flag, + glTextNode *text_node); + +glTextNode *gl_object_editor_get_data (glObjectEditor *editor); + + +/* + * Shadow Page + */ +void gl_object_editor_set_shadow_state (glObjectEditor *editor, + gboolean state); + +void gl_object_editor_set_shadow_offset (glObjectEditor *editor, + gdouble x, + gdouble y); + +void gl_object_editor_set_shadow_color (glObjectEditor *editor, + gboolean merge_flag, + glColorNode *color_node); + +void gl_object_editor_set_shadow_opacity (glObjectEditor *editor, + gdouble alpha); + +void gl_object_editor_set_max_shadow_offset(glObjectEditor *editor, + gdouble x_max, + gdouble y_max); + + +gboolean gl_object_editor_get_shadow_state (glObjectEditor *editor); + +void gl_object_editor_get_shadow_offset (glObjectEditor *editor, + gdouble *x, + gdouble *y); + +glColorNode* gl_object_editor_get_shadow_color (glObjectEditor *editor); + +gdouble gl_object_editor_get_shadow_opacity (glObjectEditor *editor); + + + +G_END_DECLS + +#endif diff --git a/src/pixbuf-cache.c b/src/pixbuf-cache.c new file mode 100644 index 00000000..df676047 --- /dev/null +++ b/src/pixbuf-cache.c @@ -0,0 +1,254 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * pixbuf-cache.c: GLabels pixbuf cache module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "pixbuf-cache.h" + +#include "debug.h" + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +typedef struct { + gchar *key; + guint references; + GdkPixbuf *pixbuf; +} CacheRecord; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void record_destroy (gpointer val); + +static void add_name_to_list (gpointer key, + gpointer val, + gpointer user_data); + + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Destroy cache record. */ +/*---------------------------------------------------------------------------*/ +static void +record_destroy (gpointer val) +{ + CacheRecord *record = (CacheRecord *)val; + + g_return_if_fail (record); + + g_free (record->key); + g_object_unref (record->pixbuf); + g_free (record); +} + +/*****************************************************************************/ +/* Create a new hash table to keep track of cached pixbufs. */ +/*****************************************************************************/ +GHashTable * +gl_pixbuf_cache_new (void) +{ + GHashTable *pixbuf_cache; + + gl_debug (DEBUG_PIXBUF_CACHE, "START"); + + pixbuf_cache = g_hash_table_new_full (g_str_hash, + g_str_equal, + NULL, + record_destroy); + + gl_debug (DEBUG_PIXBUF_CACHE, "END pixbuf_cache=%p", pixbuf_cache); + + return pixbuf_cache; +} + +/*****************************************************************************/ +/* Free up previously allocated hash table and its contents. */ +/*****************************************************************************/ +void +gl_pixbuf_cache_free (GHashTable *pixbuf_cache) +{ + gl_debug (DEBUG_PIXBUF_CACHE, "START"); + + g_hash_table_destroy (pixbuf_cache); + + gl_debug (DEBUG_PIXBUF_CACHE, "END"); +} + +/*****************************************************************************/ +/* Add pixbuf to cache explicitly (not a reference). */ +/*****************************************************************************/ +void +gl_pixbuf_cache_add_pixbuf (GHashTable *pixbuf_cache, + gchar *name, + GdkPixbuf *pixbuf) +{ + CacheRecord *test_record, *record; + + gl_debug (DEBUG_PIXBUF_CACHE, "START"); + + test_record = g_hash_table_lookup (pixbuf_cache, name); + if (test_record != NULL) { + /* pixbuf is already in the cache. */ + gl_debug (DEBUG_PIXBUF_CACHE, "END already in cache"); + return; + } + + record = g_new0 (CacheRecord, 1); + record->key = g_strdup (name); + record->references = 0; /* Nobody has referenced it yet. */ + record->pixbuf = g_object_ref (G_OBJECT (pixbuf)); + + g_hash_table_insert (pixbuf_cache, record->key, record); + + gl_debug (DEBUG_PIXBUF_CACHE, "END"); +} + +/*****************************************************************************/ +/* Get pixbuf. If not in cache, read it and add to cache. */ +/*****************************************************************************/ +GdkPixbuf * +gl_pixbuf_cache_get_pixbuf (GHashTable *pixbuf_cache, + gchar *name) +{ + CacheRecord *record; + GdkPixbuf *pixbuf; + + gl_debug (DEBUG_PIXBUF_CACHE, "START pixbuf_cache=%p", pixbuf_cache); + + record = g_hash_table_lookup (pixbuf_cache, name); + + if (record != NULL) { + record->references++; + gl_debug (DEBUG_PIXBUF_CACHE, "references=%d", record->references); + gl_debug (DEBUG_PIXBUF_CACHE, "END cached"); + return record->pixbuf; + } + + + pixbuf = gdk_pixbuf_new_from_file (name, NULL); + if ( pixbuf != NULL) { + record = g_new0 (CacheRecord, 1); + record->key = g_strdup (name); + record->references = 1; + record->pixbuf = pixbuf; + + g_hash_table_insert (pixbuf_cache, record->key, record); + } + + gl_debug (DEBUG_PIXBUF_CACHE, "END"); + + return pixbuf; +} + +/*****************************************************************************/ +/* Remove pixbuf, but only if no references left. */ +/*****************************************************************************/ +void +gl_pixbuf_cache_remove_pixbuf (GHashTable *pixbuf_cache, + gchar *name) +{ + CacheRecord *record; + + if (name == NULL) return; + + gl_debug (DEBUG_PIXBUF_CACHE, "START"); + + record = g_hash_table_lookup (pixbuf_cache, name); + if (record == NULL) { + gl_debug (DEBUG_PIXBUF_CACHE, "END not in cache"); + return; + } + + record->references--; + + if ( record->references == 0 ) { + g_hash_table_remove (pixbuf_cache, name); + } + + gl_debug (DEBUG_PIXBUF_CACHE, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Add a name to a GList while iterating over cache. */ +/*---------------------------------------------------------------------------*/ +static void +add_name_to_list (gpointer key, + gpointer val, + gpointer user_data) +{ + gchar *name = (gchar *)key; + GList **name_list = (GList **)user_data; + + gl_debug (DEBUG_PIXBUF_CACHE, "START"); + + gl_debug (DEBUG_PIXBUF_CACHE, "adding name=%s", name); + + *name_list = g_list_append (*name_list, g_strdup(name)); + + gl_debug (DEBUG_PIXBUF_CACHE, "END"); +} + +/*****************************************************************************/ +/* Return a list of names for all pixbufs in the cache. */ +/*****************************************************************************/ +GList * +gl_pixbuf_cache_get_name_list (GHashTable *pixbuf_cache) +{ + GList *name_list = NULL; + + gl_debug (DEBUG_PIXBUF_CACHE, "START"); + + g_hash_table_foreach (pixbuf_cache, add_name_to_list, &name_list); + + gl_debug (DEBUG_PIXBUF_CACHE, "END"); + + return name_list; +} + +/*****************************************************************************/ +/* Free up a list of pixbuf names. */ +/*****************************************************************************/ +void +gl_pixbuf_cache_free_name_list (GList *name_list) +{ + GList *p_name; + + gl_debug (DEBUG_PIXBUF_CACHE, "START"); + + for (p_name = name_list; p_name != NULL; p_name = p_name->next) { + g_free (p_name->data); + p_name->data = NULL; + } + + g_list_free (name_list); + + gl_debug (DEBUG_PIXBUF_CACHE, "END"); +} + + diff --git a/src/pixbuf-cache.h b/src/pixbuf-cache.h new file mode 100644 index 00000000..5fe8a80c --- /dev/null +++ b/src/pixbuf-cache.h @@ -0,0 +1,53 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * pixbuf-cache.h: GLabels pixbuf cache module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PIXBUF_CACHE_H__ +#define __PIXBUF_CACHE_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +GHashTable *gl_pixbuf_cache_new (void); + +void gl_pixbuf_cache_free (GHashTable *pixbuf_cache); + +void gl_pixbuf_cache_add_pixbuf (GHashTable *pixbuf_cache, + gchar *name, + GdkPixbuf *pixbuf); + +GdkPixbuf *gl_pixbuf_cache_get_pixbuf (GHashTable *pixbuf_cache, + gchar *name); + +void gl_pixbuf_cache_remove_pixbuf (GHashTable *pixbuf_cache, + gchar *name); + +GList *gl_pixbuf_cache_get_name_list (GHashTable *pixbuf_cache); + +void gl_pixbuf_cache_free_name_list (GList *name_list); + +G_END_DECLS + +#endif /*__PIXBUF_CACHE_H__ */ diff --git a/src/pixmaps/Makefile.am b/src/pixmaps/Makefile.am new file mode 100644 index 00000000..5b192860 --- /dev/null +++ b/src/pixmaps/Makefile.am @@ -0,0 +1,18 @@ + +EXTRA_DIST = \ + collate.xpm \ + nocollate.xpm \ + checkerboard.xpm \ + cursor_text.xbm \ + cursor_text_mask.xbm \ + cursor_box.xbm \ + cursor_box_mask.xbm \ + cursor_line.xbm \ + cursor_line_mask.xbm \ + cursor_ellipse.xbm \ + cursor_ellipse_mask.xbm \ + cursor_image.xbm \ + cursor_image_mask.xbm \ + cursor_barcode.xbm \ + cursor_barcode_mask.xbm + diff --git a/src/pixmaps/checkerboard.xpm b/src/pixmaps/checkerboard.xpm new file mode 100644 index 00000000..33ab7b57 --- /dev/null +++ b/src/pixmaps/checkerboard.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static char * checkerboard_xpm[] = { +"24 24 2 1", +" c #CCCCCC", +". c #000000", +".. .. .. .. .. .. ", +".. .. .. .. .. .. ", +" .. .. .. .. .. ..", +" .. .. .. .. .. ..", +".. .. .. .. .. .. ", +".. .. .. .. .. .. ", +" .. .. .. .. .. ..", +" .. .. .. .. .. ..", +".. .. .. .. .. .. ", +".. .. .. .. .. .. ", +" .. .. .. .. .. ..", +" .. .. .. .. .. ..", +".. .. .. .. .. .. ", +".. .. .. .. .. .. ", +" .. .. .. .. .. ..", +" .. .. .. .. .. ..", +".. .. .. .. .. .. ", +".. .. .. .. .. .. ", +" .. .. .. .. .. ..", +" .. .. .. .. .. ..", +".. .. .. .. .. .. ", +".. .. .. .. .. .. ", +" .. .. .. .. .. ..", +" .. .. .. .. .. .."}; diff --git a/src/pixmaps/collate.xpm b/src/pixmaps/collate.xpm new file mode 100644 index 00000000..a781151a --- /dev/null +++ b/src/pixmaps/collate.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char *collate_xpm[]={ +"58 28 3 1", +". c None", +"# c #000000", +"a c #ffffff", +"..........................................................", +".###################..###################.................", +".#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.................", +".#aaaaaaaa#aaaaaaaa#..#aaaaaaa##aaaaaaaa#.................", +".#aaaaaaa##aaaaaaaa#..#aaaaaa#aa#aaaaaaa#.................", +".#aaaaaaaa#aaaaaaaa#..#aaaaaaaaa#aaaaaaa#..##..##..##.....", +".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#..##..##..##.....", +".#aaaaaaaa#aaaaaaaa#..#aaaaaaa#aaaaaaaaa#.................", +".#aaaaaaaa#aaaaaaaa#..#aaaaaa#aaaaaaaaaa#.................", +".#aaaaaaa###aaaaaaa#..#aaaaaa####aaaaaaa#.................", +".#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.................", +".###################..###################.................", +"..........................................................", +"..........................................................", +"..........................................................", +".................###################..###################.", +".................#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.", +".................#aaaaaaaa#aaaaaaaa#..#aaaaaaa##aaaaaaaa#.", +".................#aaaaaaa##aaaaaaaa#..#aaaaaa#aa#aaaaaaa#.", +"....##..##..##...#aaaaaaaa#aaaaaaaa#..#aaaaaaaaa#aaaaaaa#.", +"....##..##..##...#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#.", +".................#aaaaaaaa#aaaaaaaa#..#aaaaaaa#aaaaaaaaa#.", +".................#aaaaaaaa#aaaaaaaa#..#aaaaaa#aaaaaaaaaa#.", +".................#aaaaaaa###aaaaaaa#..#aaaaaa####aaaaaaa#.", +".................#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.", +".................###################..###################.", +"..........................................................", +".........................................................."}; diff --git a/src/pixmaps/cursor_barcode.xbm b/src/pixmaps/cursor_barcode.xbm new file mode 100644 index 00000000..6e8d1d62 --- /dev/null +++ b/src/pixmaps/cursor_barcode.xbm @@ -0,0 +1,16 @@ +#define cursor_barcode_width 32 +#define cursor_barcode_height 32 +#define cursor_barcode_x_hot 7 +#define cursor_barcode_y_hot 7 +static unsigned char cursor_barcode_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, + 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, + 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, + 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, + 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, 0x00, 0xa0, 0xad, 0x5a, + 0x00, 0xa0, 0xad, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/pixmaps/cursor_barcode_mask.xbm b/src/pixmaps/cursor_barcode_mask.xbm new file mode 100644 index 00000000..52ed3ba2 --- /dev/null +++ b/src/pixmaps/cursor_barcode_mask.xbm @@ -0,0 +1,16 @@ +#define cursor_barcode_mask_width 32 +#define cursor_barcode_mask_height 32 +#define cursor_barcode_mask_x_hot 7 +#define cursor_barcode_mask_y_hot 7 +static unsigned char cursor_barcode_mask_bits[] = { + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xc0, 0xf1, 0xff, 0xff, 0xc0, 0xf1, 0xff, 0xff, 0xc0, 0xf1, 0xff, 0xff, + 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, + 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, + 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, + 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, + 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/pixmaps/cursor_box.xbm b/src/pixmaps/cursor_box.xbm new file mode 100644 index 00000000..48ae4ea2 --- /dev/null +++ b/src/pixmaps/cursor_box.xbm @@ -0,0 +1,16 @@ +#define cursor_box_width 32 +#define cursor_box_height 32 +#define cursor_box_x_hot 7 +#define cursor_box_y_hot 7 +static unsigned char cursor_box_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xff, 0x7f, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x80, 0x01, 0x60, + 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, + 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, + 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, + 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0x01, 0x60, 0x00, 0x80, 0xff, 0x7f, + 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/pixmaps/cursor_box_mask.xbm b/src/pixmaps/cursor_box_mask.xbm new file mode 100644 index 00000000..b41e0559 --- /dev/null +++ b/src/pixmaps/cursor_box_mask.xbm @@ -0,0 +1,16 @@ +#define cursor_box_mask_width 32 +#define cursor_box_mask_height 32 +#define cursor_box_mask_x_hot 7 +#define cursor_box_mask_y_hot 7 +static unsigned char cursor_box_mask_bits[] = { + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0xc1, 0xff, 0xff, + 0x00, 0xc0, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, + 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, + 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, + 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0x03, 0xf0, + 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xc0, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, + 0x00, 0xc0, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff}; diff --git a/src/pixmaps/cursor_ellipse.xbm b/src/pixmaps/cursor_ellipse.xbm new file mode 100644 index 00000000..946af9ac --- /dev/null +++ b/src/pixmaps/cursor_ellipse.xbm @@ -0,0 +1,16 @@ +#define cursor_ellipse_width 32 +#define cursor_ellipse_height 32 +#define cursor_ellipse_x_hot 7 +#define cursor_ellipse_y_hot 7 +static unsigned char cursor_ellipse_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x7c, 0x00, 0x80, 0x00, 0xef, 0x01, 0x00, 0x80, 0x01, 0x03, + 0x00, 0xc0, 0x00, 0x06, 0x00, 0x60, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x08, + 0x00, 0x30, 0x00, 0x18, 0x00, 0x30, 0x00, 0x18, 0x00, 0x10, 0x00, 0x10, + 0x00, 0x30, 0x00, 0x18, 0x00, 0x30, 0x00, 0x18, 0x00, 0x20, 0x00, 0x08, + 0x00, 0x60, 0x00, 0x0c, 0x00, 0xc0, 0x00, 0x06, 0x00, 0x80, 0x01, 0x03, + 0x00, 0x00, 0xef, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/pixmaps/cursor_ellipse_mask.xbm b/src/pixmaps/cursor_ellipse_mask.xbm new file mode 100644 index 00000000..22fb5442 --- /dev/null +++ b/src/pixmaps/cursor_ellipse_mask.xbm @@ -0,0 +1,16 @@ +#define cursor_ellipse_mask_width 32 +#define cursor_ellipse_mask_height 32 +#define cursor_ellipse_mask_x_hot 7 +#define cursor_ellipse_mask_y_hot 7 +static unsigned char cursor_ellipse_mask_bits[] = { + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0xfe, 0x00, + 0xc0, 0x81, 0xff, 0x03, 0xc0, 0xc1, 0xff, 0x07, 0xc0, 0xe1, 0xff, 0x0f, + 0x00, 0xf0, 0x83, 0x1f, 0x00, 0xf0, 0x01, 0x1f, 0x00, 0xf8, 0x00, 0x3e, + 0x00, 0x78, 0x00, 0x3c, 0x00, 0x78, 0x00, 0x3c, 0x00, 0x78, 0x00, 0x3c, + 0x00, 0x78, 0x00, 0x3c, 0x00, 0x78, 0x00, 0x3c, 0x00, 0xf8, 0x00, 0x3e, + 0x00, 0xf0, 0x01, 0x1f, 0x00, 0xf0, 0x83, 0x1f, 0x00, 0xe0, 0xff, 0x0f, + 0x00, 0xc0, 0xff, 0x07, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0xfe, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/pixmaps/cursor_image.xbm b/src/pixmaps/cursor_image.xbm new file mode 100644 index 00000000..32308360 --- /dev/null +++ b/src/pixmaps/cursor_image.xbm @@ -0,0 +1,16 @@ +#define cursor_image_width 32 +#define cursor_image_height 32 +#define cursor_image_x_hot 7 +#define cursor_image_y_hot 7 +static unsigned char cursor_image_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0xf0, 0xff, 0x7f, 0x80, 0x10, 0x00, 0x40, 0x00, 0x10, 0x00, 0x40, + 0x00, 0x10, 0x00, 0x4c, 0x00, 0x10, 0x00, 0x52, 0x00, 0x10, 0x08, 0x4c, + 0x00, 0x10, 0x14, 0x40, 0x00, 0x10, 0x22, 0x40, 0x00, 0x10, 0x41, 0x40, + 0x00, 0x90, 0xc1, 0x40, 0x00, 0x10, 0x41, 0x40, 0x00, 0xf0, 0xc1, 0x7f, + 0x00, 0x10, 0x41, 0x40, 0x00, 0x10, 0x41, 0x40, 0x00, 0x10, 0x41, 0x40, + 0x00, 0x10, 0x7f, 0x40, 0x00, 0x10, 0x00, 0x40, 0x00, 0x10, 0x00, 0x40, + 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/pixmaps/cursor_image_mask.xbm b/src/pixmaps/cursor_image_mask.xbm new file mode 100644 index 00000000..9c79e82e --- /dev/null +++ b/src/pixmaps/cursor_image_mask.xbm @@ -0,0 +1,16 @@ +#define cursor_image_mask_width 32 +#define cursor_image_mask_height 32 +#define cursor_image_mask_x_hot 7 +#define cursor_image_mask_y_hot 7 +static unsigned char cursor_image_mask_bits[] = { + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0xf9, 0xff, 0xff, + 0xc0, 0xf9, 0xff, 0xff, 0xc0, 0xf9, 0xff, 0xff, 0xc0, 0xf9, 0xff, 0xff, + 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, + 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, + 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, + 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, + 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff, + 0x00, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0xff, 0xff}; diff --git a/src/pixmaps/cursor_line.xbm b/src/pixmaps/cursor_line.xbm new file mode 100644 index 00000000..f5e2636e --- /dev/null +++ b/src/pixmaps/cursor_line.xbm @@ -0,0 +1,16 @@ +#define cursor_line_width 32 +#define cursor_line_height 32 +#define cursor_line_x_hot 7 +#define cursor_line_y_hot 7 +static unsigned char cursor_line_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x08, + 0x80, 0x00, 0x00, 0x0c, 0x80, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x60, 0x00, + 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0c, 0x00, + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, + 0x00, 0xc0, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/pixmaps/cursor_line_mask.xbm b/src/pixmaps/cursor_line_mask.xbm new file mode 100644 index 00000000..a9359d55 --- /dev/null +++ b/src/pixmaps/cursor_line_mask.xbm @@ -0,0 +1,16 @@ +#define cursor_line_mask_width 32 +#define cursor_line_mask_height 32 +#define cursor_line_mask_x_hot 7 +#define cursor_line_mask_y_hot 7 +static unsigned char cursor_line_mask_bits[] = { + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x08, 0xc0, 0x01, 0x00, 0x1c, + 0xc0, 0x01, 0x00, 0x1e, 0xc0, 0x01, 0x00, 0x0f, 0xc0, 0x01, 0x80, 0x07, + 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x00, + 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x1e, 0x00, + 0x00, 0x00, 0x0f, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0x00, + 0x00, 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, + 0x00, 0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/pixmaps/cursor_text.xbm b/src/pixmaps/cursor_text.xbm new file mode 100644 index 00000000..4378c1a6 --- /dev/null +++ b/src/pixmaps/cursor_text.xbm @@ -0,0 +1,16 @@ +#define cursor_text_width 32 +#define cursor_text_height 32 +#define cursor_text_x_hot 7 +#define cursor_text_y_hot 7 +static unsigned char cursor_text_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, + 0x00, 0xc0, 0x9c, 0x01, 0x00, 0x40, 0x1c, 0x01, 0x00, 0x00, 0x1c, 0x00, + 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, + 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, + 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/pixmaps/cursor_text_mask.xbm b/src/pixmaps/cursor_text_mask.xbm new file mode 100644 index 00000000..543c2b7f --- /dev/null +++ b/src/pixmaps/cursor_text_mask.xbm @@ -0,0 +1,16 @@ +#define cursor_text_mask_width 32 +#define cursor_text_mask_height 32 +#define cursor_text_mask_x_hot 7 +#define cursor_text_mask_y_hot 7 +static unsigned char cursor_text_mask_bits[] = { + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xc0, 0xe1, 0xff, 0x03, 0xc0, 0xe1, 0xff, 0x03, + 0x00, 0xe0, 0xff, 0x03, 0x00, 0xe0, 0xbe, 0x03, 0x00, 0x60, 0x3e, 0x03, + 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, + 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, + 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x7f, 0x00, + 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/src/pixmaps/nocollate.xpm b/src/pixmaps/nocollate.xpm new file mode 100644 index 00000000..a67cc13c --- /dev/null +++ b/src/pixmaps/nocollate.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char *nocollate_xpm[]={ +"58 28 3 1", +". c None", +"# c #000000", +"a c #ffffff", +"..........................................................", +".###################..###################.................", +".#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.................", +".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#.................", +".#aaaaaaa##aaaaaaaa#..#aaaaaaa##aaaaaaaa#.................", +".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#..##..##..##.....", +".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#..##..##..##.....", +".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#.................", +".#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#.................", +".#aaaaaaa###aaaaaaa#..#aaaaaaa###aaaaaaa#.................", +".#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.................", +".###################..###################.................", +"..........................................................", +"..........................................................", +"..........................................................", +".................###################..###################.", +".................#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.", +".................#aaaaaaaa##aaaaaaa#..#aaaaaaaa##aaaaaaa#.", +".................#aaaaaaa#aa#aaaaaa#..#aaaaaaa#aa#aaaaaa#.", +"....##..##..##...#aaaaaaaaaa#aaaaaa#..#aaaaaaaaaa#aaaaaa#.", +"....##..##..##...#aaaaaaaaa#aaaaaaa#..#aaaaaaaaa#aaaaaaa#.", +".................#aaaaaaaa#aaaaaaaa#..#aaaaaaaa#aaaaaaaa#.", +".................#aaaaaaa#aaaaaaaaa#..#aaaaaaa#aaaaaaaaa#.", +".................#aaaaaaa####aaaaaa#..#aaaaaaa####aaaaaa#.", +".................#aaaaaaaaaaaaaaaaa#..#aaaaaaaaaaaaaaaaa#.", +".................###################..###################.", +"..........................................................", +".........................................................."}; diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c new file mode 100644 index 00000000..0a095231 --- /dev/null +++ b/src/prefs-dialog.c @@ -0,0 +1,692 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * prefs-dialog.c: Preferences dialog module + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "prefs-dialog.h" + +#include +#include +#include +#include +#include +#include + +#include "prefs.h" +#include "hig.h" +#include "mygal/widget-color-combo.h" +#include "color.h" +#include "util.h" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +#define US_LETTER_ID "US-Letter" +#define A4_ID "A4" + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glPrefsDialogPrivate +{ + GladeXML *gui; + + /* Units properties */ + GtkWidget *units_points_radio; + GtkWidget *units_inches_radio; + GtkWidget *units_mm_radio; + + /* Page size properties */ + GtkWidget *page_size_us_letter_radio; + GtkWidget *page_size_a4_radio; + + /* Default text properties */ + GtkWidget *text_family_combo; + GtkWidget *text_size_spin; + GtkWidget *text_bold_toggle; + GtkWidget *text_italic_toggle; + GtkWidget *text_color_combo; + GtkWidget *text_left_toggle; + GtkWidget *text_center_toggle; + GtkWidget *text_right_toggle; + GtkWidget *text_line_spacing_spin; + + /* Default line properties */ + GtkWidget *line_width_spin; + GtkWidget *line_color_combo; + + /* Default fill properties */ + GtkWidget *fill_color_combo; + + /* Prevent recursion */ + gboolean stop_signals; +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_prefs_dialog_finalize (GObject *object); +static void gl_prefs_dialog_construct (glPrefsDialog *dialog); + +static void response_cb (glPrefsDialog *dialog, + gint response, + gpointer user_data); + +static void construct_locale_page (glPrefsDialog *dialog); +static void construct_object_page (glPrefsDialog *dialog); + +static void align_toggle_cb (GtkToggleButton *toggle, + glPrefsDialog *dialog); + +static void update_locale_page_from_prefs (glPrefsDialog *dialog); +static void update_object_page_from_prefs (glPrefsDialog *dialog); + +static void update_prefs_from_locale_page (glPrefsDialog *dialog); +static void update_prefs_from_object_page (glPrefsDialog *dialog); + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glPrefsDialog, gl_prefs_dialog, GTK_TYPE_DIALOG); + +static void +gl_prefs_dialog_class_init (glPrefsDialogClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_PREFS, ""); + + gl_prefs_dialog_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_prefs_dialog_finalize; +} + +static void +gl_prefs_dialog_init (glPrefsDialog *dialog) +{ + gl_debug (DEBUG_PREFS, "START"); + + dialog->priv = g_new0 (glPrefsDialogPrivate, 1); + + dialog->priv->gui = glade_xml_new (GLABELS_GLADE_DIR "prefs-dialog.glade", + "prefs_notebook", + NULL); + + if (!dialog->priv->gui) + { + g_critical ("Could not open prefs-dialog.glade. gLabels may not be installed correctly!"); + return; + } + + gtk_container_set_border_width (GTK_CONTAINER(dialog), GL_HIG_PAD2); + + gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE); + gtk_dialog_add_button (GTK_DIALOG(dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); + + g_signal_connect(G_OBJECT (dialog), "response", + G_CALLBACK (response_cb), NULL); + + gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); + gtk_window_set_title (GTK_WINDOW (dialog), _("gLabels Preferences")); + gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); + + gl_debug (DEBUG_PREFS, "END"); +} + +static void +gl_prefs_dialog_finalize (GObject *object) +{ + glPrefsDialog* dialog = GL_PREFS_DIALOG (object); + + gl_debug (DEBUG_PREFS, "START"); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_PREFS_DIALOG (dialog)); + g_return_if_fail (dialog->priv != NULL); + + if (dialog->priv->gui) + { + g_object_unref (G_OBJECT (dialog->priv->gui)); + } + g_free (dialog->priv); + + G_OBJECT_CLASS (gl_prefs_dialog_parent_class)->finalize (object); + + gl_debug (DEBUG_PREFS, "END"); +} + +/*****************************************************************************/ +/* NEW preferences dialog. */ +/*****************************************************************************/ +GtkWidget* +gl_prefs_dialog_new (GtkWindow *parent) +{ + GtkWidget *dialog; + + gl_debug (DEBUG_PREFS, "START"); + gl_debug (DEBUG_PREFS, "page size = \"%s\"", gl_prefs->default_page_size); + + dialog = GTK_WIDGET (g_object_new (GL_TYPE_PREFS_DIALOG, NULL)); + + if (parent) + gtk_window_set_transient_for (GTK_WINDOW (dialog), parent); + + gl_prefs_dialog_construct (GL_PREFS_DIALOG(dialog)); + + + gl_debug (DEBUG_PREFS, "END"); + + return dialog; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Construct composite widget. */ +/*---------------------------------------------------------------------------*/ +static void +gl_prefs_dialog_construct (glPrefsDialog *dialog) +{ + GtkWidget *notebook; + + g_return_if_fail (GL_IS_PREFS_DIALOG (dialog)); + g_return_if_fail (dialog->priv != NULL); + + notebook = glade_xml_get_widget (dialog->priv->gui, "prefs_notebook"); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, FALSE, FALSE, 0); + + construct_locale_page (dialog); + construct_object_page (dialog); + + update_locale_page_from_prefs (dialog); + update_object_page_from_prefs (dialog); + + gtk_widget_show_all (GTK_DIALOG (dialog)->vbox); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. "Response" callback. */ +/*---------------------------------------------------------------------------*/ +static void +response_cb (glPrefsDialog *dialog, + gint response, + gpointer user_data) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail(dialog != NULL); + g_return_if_fail(GTK_IS_DIALOG(dialog)); + + switch(response) { + case GTK_RESPONSE_CLOSE: + gtk_widget_hide (GTK_WIDGET(dialog)); + break; + case GTK_RESPONSE_DELETE_EVENT: + break; + default: + g_print ("response = %d", response); + g_assert_not_reached (); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Build Locale Properties Notebook Tab */ +/*--------------------------------------------------------------------------*/ +static void +construct_locale_page (glPrefsDialog *dialog) +{ + + dialog->priv->units_points_radio = + glade_xml_get_widget (dialog->priv->gui, "units_points_radio"); + + dialog->priv->units_inches_radio = + glade_xml_get_widget (dialog->priv->gui, "units_inches_radio"); + + dialog->priv->units_mm_radio = + glade_xml_get_widget (dialog->priv->gui, "units_mm_radio"); + + dialog->priv->page_size_us_letter_radio = + glade_xml_get_widget (dialog->priv->gui, "page_size_us_letter_radio"); + + dialog->priv->page_size_a4_radio = + glade_xml_get_widget (dialog->priv->gui, "page_size_a4_radio"); + + g_signal_connect_swapped ( + G_OBJECT(dialog->priv->units_points_radio), + "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog)); + g_signal_connect_swapped ( + G_OBJECT(dialog->priv->units_inches_radio), + "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog)); + g_signal_connect_swapped ( + G_OBJECT(dialog->priv->units_mm_radio), + "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog)); + g_signal_connect_swapped ( + G_OBJECT(dialog->priv->page_size_us_letter_radio), + "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog)); + g_signal_connect_swapped ( + G_OBJECT(dialog->priv->page_size_a4_radio), + "toggled", G_CALLBACK(update_prefs_from_locale_page), G_OBJECT(dialog)); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Build Default Object Properties Notebook Tab */ +/*--------------------------------------------------------------------------*/ +static void +construct_object_page (glPrefsDialog *dialog) +{ + GList *family_names; + + dialog->priv->text_family_combo = + glade_xml_get_widget (dialog->priv->gui, "text_family_combo"); + dialog->priv->text_size_spin = + glade_xml_get_widget (dialog->priv->gui, "text_size_spin"); + dialog->priv->text_bold_toggle = + glade_xml_get_widget (dialog->priv->gui, "text_bold_toggle"); + dialog->priv->text_italic_toggle = + glade_xml_get_widget (dialog->priv->gui, "text_italic_toggle"); + dialog->priv->text_color_combo = + glade_xml_get_widget (dialog->priv->gui, "text_color_combo"); + dialog->priv->text_left_toggle = + glade_xml_get_widget (dialog->priv->gui, "text_left_toggle"); + dialog->priv->text_center_toggle = + glade_xml_get_widget (dialog->priv->gui, "text_center_toggle"); + dialog->priv->text_right_toggle = + glade_xml_get_widget (dialog->priv->gui, "text_right_toggle"); + dialog->priv->text_line_spacing_spin = + glade_xml_get_widget (dialog->priv->gui, "text_line_spacing_spin"); + + dialog->priv->line_width_spin = + glade_xml_get_widget (dialog->priv->gui, "line_width_spin"); + dialog->priv->line_color_combo = + glade_xml_get_widget (dialog->priv->gui, "line_color_combo"); + + dialog->priv->fill_color_combo = + glade_xml_get_widget (dialog->priv->gui, "fill_color_combo"); + + gl_util_combo_box_add_text_model (GTK_COMBO_BOX (dialog->priv->text_family_combo)); + + /* Load family names */ + family_names = gl_util_get_font_family_list (); + gl_util_combo_box_set_strings (GTK_COMBO_BOX (dialog->priv->text_family_combo), + family_names); + + + g_signal_connect_swapped (G_OBJECT(dialog->priv->text_family_combo), + "changed", + G_CALLBACK(update_prefs_from_object_page), + G_OBJECT(dialog)); + g_signal_connect_swapped (G_OBJECT(dialog->priv->text_size_spin), + "changed", + G_CALLBACK(update_prefs_from_object_page), + G_OBJECT(dialog)); + g_signal_connect_swapped (G_OBJECT(dialog->priv->text_bold_toggle), + "toggled", + G_CALLBACK(update_prefs_from_object_page), + G_OBJECT(dialog)); + g_signal_connect_swapped (G_OBJECT(dialog->priv->text_italic_toggle), + "toggled", + G_CALLBACK(update_prefs_from_object_page), + G_OBJECT(dialog)); + g_signal_connect_swapped (G_OBJECT(dialog->priv->text_color_combo), + "color_changed", + G_CALLBACK(update_prefs_from_object_page), + G_OBJECT(dialog)); + + g_signal_connect (G_OBJECT(dialog->priv->text_left_toggle), + "toggled", + G_CALLBACK(align_toggle_cb), + G_OBJECT(dialog)); + g_signal_connect (G_OBJECT(dialog->priv->text_center_toggle), + "toggled", + G_CALLBACK(align_toggle_cb), + G_OBJECT(dialog)); + g_signal_connect (G_OBJECT(dialog->priv->text_right_toggle), + "toggled", + G_CALLBACK(align_toggle_cb), + G_OBJECT(dialog)); + + g_signal_connect_swapped (G_OBJECT(dialog->priv->text_line_spacing_spin), + "changed", + G_CALLBACK(update_prefs_from_object_page), + G_OBJECT(dialog)); + + g_signal_connect_swapped (G_OBJECT(dialog->priv->line_width_spin), + "changed", + G_CALLBACK(update_prefs_from_object_page), + G_OBJECT(dialog)); + g_signal_connect_swapped (G_OBJECT(dialog->priv->line_color_combo), + "color_changed", + G_CALLBACK(update_prefs_from_object_page), + G_OBJECT(dialog)); + + g_signal_connect_swapped (G_OBJECT(dialog->priv->fill_color_combo), + "color_changed", + G_CALLBACK(update_prefs_from_object_page), + G_OBJECT(dialog)); +} + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Alignment togglebutton callback. */ +/*--------------------------------------------------------------------------*/ +static void +align_toggle_cb (GtkToggleButton *toggle, + glPrefsDialog *dialog) +{ + if (gtk_toggle_button_get_active (toggle)) + { + + if (GTK_WIDGET (toggle) == GTK_WIDGET (dialog->priv->text_left_toggle)) + { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (dialog->priv->text_center_toggle), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (dialog->priv->text_right_toggle), + FALSE); + } + else if (GTK_WIDGET (toggle) == GTK_WIDGET (dialog->priv->text_center_toggle)) + { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (dialog->priv->text_left_toggle), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (dialog->priv->text_right_toggle), + FALSE); + } + else if (GTK_WIDGET (toggle) == GTK_WIDGET (dialog->priv->text_right_toggle)) + { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (dialog->priv->text_left_toggle), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (dialog->priv->text_center_toggle), + FALSE); + } + + update_prefs_from_object_page (dialog); + } + +} + + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Update locale page widgets from current prefs. */ +/*--------------------------------------------------------------------------*/ +static void +update_locale_page_from_prefs (glPrefsDialog *dialog) +{ + dialog->priv->stop_signals = TRUE; + + switch (gl_prefs->units) { + case LGL_UNITS_POINT: + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(dialog->priv->units_points_radio), + TRUE); + break; + case LGL_UNITS_INCH: + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(dialog->priv->units_inches_radio), + TRUE); + break; + case LGL_UNITS_MM: + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(dialog->priv->units_mm_radio), + TRUE); + break; + default: + g_message ("Illegal units"); /* Should not happen */ + break; + } + + if ( g_strcasecmp(gl_prefs->default_page_size, US_LETTER_ID) == 0) + { + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(dialog->priv->page_size_us_letter_radio), TRUE); + } + else if ( g_strcasecmp(gl_prefs->default_page_size, A4_ID) == 0) + { + gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON(dialog->priv->page_size_a4_radio), TRUE); + } + else + { + g_message ("Unknown default page size"); /* Shouldn't happen */ + } + + dialog->priv->stop_signals = FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Update object page widgets from current prefs. */ +/*--------------------------------------------------------------------------*/ +static void +update_object_page_from_prefs (glPrefsDialog *dialog) +{ + GList *family_names; + gchar *good_font_family; + GdkColor *gdk_color; + + dialog->priv->stop_signals = TRUE; + + + /* Make sure we have a valid font family. if not provide a good default. */ + family_names = gl_util_get_font_family_list (); + if (g_list_find_custom (family_names, + gl_prefs->default_font_family, + (GCompareFunc)g_utf8_collate)) + { + good_font_family = g_strdup (gl_prefs->default_font_family); + } + else + { + if (family_names != NULL) + { + good_font_family = g_strdup (family_names->data); /* 1st entry */ + } + else + { + good_font_family = NULL; + } + } + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (dialog->priv->text_family_combo), + good_font_family); + g_free (good_font_family); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->text_size_spin), + gl_prefs->default_font_size); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_bold_toggle), + (gl_prefs->default_font_weight == PANGO_WEIGHT_BOLD)); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_italic_toggle), + gl_prefs->default_font_italic_flag); + + gdk_color = gl_color_to_gdk_color (gl_prefs->default_text_color); + color_combo_set_color (COLOR_COMBO(dialog->priv->text_color_combo), gdk_color); + g_free (gdk_color); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_left_toggle), + (gl_prefs->default_text_alignment == GTK_JUSTIFY_LEFT)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_center_toggle), + (gl_prefs->default_text_alignment == GTK_JUSTIFY_CENTER)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_right_toggle), + (gl_prefs->default_text_alignment == GTK_JUSTIFY_RIGHT)); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->text_line_spacing_spin), + gl_prefs->default_text_line_spacing); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->line_width_spin), + gl_prefs->default_line_width); + + gdk_color = gl_color_to_gdk_color (gl_prefs->default_line_color); + color_combo_set_color (COLOR_COMBO(dialog->priv->line_color_combo), gdk_color); + g_free (gdk_color); + + + gdk_color = gl_color_to_gdk_color (gl_prefs->default_fill_color); + color_combo_set_color (COLOR_COMBO(dialog->priv->fill_color_combo), gdk_color); + g_free (gdk_color); + + + dialog->priv->stop_signals = FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Update prefs from current state of locale page widgets. */ +/*--------------------------------------------------------------------------*/ +static void +update_prefs_from_locale_page (glPrefsDialog *dialog) +{ + if (dialog->priv->stop_signals) return; + + if (gtk_toggle_button_get_active ( + GTK_TOGGLE_BUTTON(dialog->priv->units_points_radio))) + { + gl_prefs->units = LGL_UNITS_POINT; + } + if (gtk_toggle_button_get_active ( + GTK_TOGGLE_BUTTON(dialog->priv->units_inches_radio))) + { + gl_prefs->units = LGL_UNITS_INCH; + } + if (gtk_toggle_button_get_active ( + GTK_TOGGLE_BUTTON(dialog->priv->units_mm_radio))) + { + gl_prefs->units = LGL_UNITS_MM; + } + + if (gtk_toggle_button_get_active ( + GTK_TOGGLE_BUTTON(dialog->priv->page_size_us_letter_radio))) + { + g_free (gl_prefs->default_page_size); + gl_prefs->default_page_size = g_strdup (US_LETTER_ID); + } + if (gtk_toggle_button_get_active ( + GTK_TOGGLE_BUTTON(dialog->priv->page_size_a4_radio))) + { + g_free (gl_prefs->default_page_size); + gl_prefs->default_page_size = g_strdup (A4_ID); + } + + gl_prefs_model_save_settings (gl_prefs); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Update prefs from current state of object page widgets. */ +/*--------------------------------------------------------------------------*/ +static void +update_prefs_from_object_page (glPrefsDialog *dialog) +{ + GdkColor *gdk_color; + gboolean is_default; + + if (dialog->priv->stop_signals) return; + + g_free (gl_prefs->default_font_family); + gl_prefs->default_font_family = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->text_family_combo)); + gl_prefs->default_font_size = + gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->text_size_spin)); + + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (dialog->priv->text_bold_toggle))) + { + gl_prefs->default_font_weight = PANGO_WEIGHT_BOLD; + } + else + { + gl_prefs->default_font_weight = PANGO_WEIGHT_NORMAL; + } + + gl_prefs->default_font_italic_flag = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (dialog->priv->text_italic_toggle)); + + gdk_color = color_combo_get_color (COLOR_COMBO(dialog->priv->text_color_combo), + &is_default); + if (!is_default) + { + gl_prefs->default_text_color = gl_color_from_gdk_color (gdk_color); + } + + if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (dialog->priv->text_left_toggle))) + { + gl_prefs->default_text_alignment = GTK_JUSTIFY_LEFT; + } + else if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (dialog->priv->text_right_toggle))) + { + gl_prefs->default_text_alignment = GTK_JUSTIFY_RIGHT; + } + else if (gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (dialog->priv->text_center_toggle))) + { + gl_prefs->default_text_alignment = GTK_JUSTIFY_CENTER; + } + else + { + /* Should not happen. */ + gl_prefs->default_text_alignment = GTK_JUSTIFY_LEFT; + } + + + gl_prefs->default_text_line_spacing = + gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->text_line_spacing_spin)); + + gl_prefs->default_line_width = + gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->line_width_spin)); + + gdk_color = color_combo_get_color (COLOR_COMBO(dialog->priv->line_color_combo), + &is_default); + if (!is_default) + { + gl_prefs->default_line_color = gl_color_from_gdk_color (gdk_color); + } + + + gdk_color = color_combo_get_color (COLOR_COMBO(dialog->priv->fill_color_combo), + &is_default); + if (!is_default) + { + gl_prefs->default_fill_color = gl_color_from_gdk_color (gdk_color); + } + + gl_prefs_model_save_settings (gl_prefs); +} + + + diff --git a/src/prefs-dialog.h b/src/prefs-dialog.h new file mode 100644 index 00000000..8ec8e929 --- /dev/null +++ b/src/prefs-dialog.h @@ -0,0 +1,65 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * prefs-dialog.h: Preferences dialog module header file + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __PREFS_DIALOG_H__ +#define __PREFS_DIALOG_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GL_TYPE_PREFS_DIALOG (gl_prefs_dialog_get_type ()) +#define GL_PREFS_DIALOG(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_PREFS_DIALOG, glPrefsDialog)) +#define GL_PREFS_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_PREFS_DIALOG, glPrefsDialogClass)) +#define GL_IS_PREFS_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_PREFS_DIALOG)) +#define GL_IS_PREFS_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_PREFS_DIALOG)) +#define GL_PREFS_DIALOG_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_PREFS_DIALOG, glPrefsDialogClass)) + + +typedef struct _glPrefsDialog glPrefsDialog; +typedef struct _glPrefsDialogClass glPrefsDialogClass; + +typedef struct _glPrefsDialogPrivate glPrefsDialogPrivate; + +struct _glPrefsDialog +{ + GtkDialog parent_instance; + + glPrefsDialogPrivate *priv; + +}; + +struct _glPrefsDialogClass +{ + GtkDialogClass parent_class; +}; + +GType gl_prefs_dialog_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_prefs_dialog_new (GtkWindow *parent); + +G_END_DECLS + +#endif /* __PREFS_DIALOG_H__ */ diff --git a/src/prefs-model.c b/src/prefs-model.c new file mode 100644 index 00000000..72b61792 --- /dev/null +++ b/src/prefs-model.c @@ -0,0 +1,736 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * prefs-model.c: Application preferences model module + * + * Copyright (C) 2001-2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "prefs-model.h" + +#include +#include + +#include "marshal.h" +#include "util.h" +#include "color.h" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +/* GConf keys */ +#define BASE_KEY "/apps/glabels" + +#define PREF_UNITS "/units" +#define PREF_DEFAULT_PAGE_SIZE "/default-page-size" + +#define PREF_DEFAULT_FONT_FAMILY "/default-font-family" +#define PREF_DEFAULT_FONT_SIZE "/default-font-size" +#define PREF_DEFAULT_FONT_WEIGHT "/default-font-weight" +#define PREF_DEFAULT_FONT_ITALIC_FLAG "/default-font-italic-flag" +#define PREF_DEFAULT_TEXT_COLOR "/default-text-color" +#define PREF_DEFAULT_TEXT_ALIGNMENT "/default-text-alignment" +#define PREF_DEFAULT_TEXT_LINE_SPACING "/default-text-line-spacing" + +#define PREF_DEFAULT_LINE_WIDTH "/default-line-width" +#define PREF_DEFAULT_LINE_COLOR "/default-line-color" + +#define PREF_DEFAULT_FILL_COLOR "/default-fill-color" + +#define PREF_MAIN_TOOLBAR_VISIBLE "/main-toolbar-visible" +#define PREF_MAIN_TOOLBAR_BUTTONS_STYLE "/main-toolbar-buttons-style" +#define PREF_MAIN_TOOLBAR_VIEW_TOOLTIPS "/main-toolbar-view-tooltips" + +#define PREF_DRAWING_TOOLBAR_VISIBLE "/drawing-toolbar-visible" +#define PREF_DRAWING_TOOLBAR_VIEW_TOOLTIPS "/drawing-toolbar-view-tooltips" + +#define PREF_PROPERTY_TOOLBAR_VISIBLE "/property-toolbar-visible" +#define PREF_PROPERTY_TOOLBAR_VIEW_TOOLTIPS "/property-toolbar-view-tooltips" + +#define PREF_GRID_VISIBLE "/grid-visible" +#define PREF_MARKUP_VISIBLE "/markup-visible" + +#define PREF_MAX_RECENTS "/max-recents" + +#define PREF_RECENT_TEMPLATES "/recent-templates" +#define PREF_MAX_RECENT_TEMPLATES "/max-recent-templates" + +/* Default values */ +#define DEFAULT_UNITS_STRING units_to_string (LGL_UNITS_INCH) +#define DEFAULT_PAGE_SIZE "US-Letter" + +#define DEFAULT_FONT_FAMILY "Sans" +#define DEFAULT_FONT_SIZE 14.0 +#define DEFAULT_FONT_WEIGHT_STRING gl_util_weight_to_string (PANGO_WEIGHT_NORMAL) +#define DEFAULT_FONT_ITALIC_FLAG FALSE +#define DEFAULT_TEXT_ALIGN_STRING gl_util_align_to_string (PANGO_ALIGN_LEFT) +#define DEFAULT_TEXT_COLOR GL_COLOR (0,0,0) +#define DEFAULT_TEXT_LINE_SPACING 1.0 + +#define DEFAULT_LINE_WIDTH 1.0 +#define DEFAULT_LINE_COLOR GL_COLOR_A (0, 0, 0, 255) + +#define DEFAULT_FILL_COLOR GL_COLOR_A (0, 255, 0, 255) + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +enum { + CHANGED, + LAST_SIGNAL +}; + + + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +static guint signals[LAST_SIGNAL] = {0}; + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_prefs_model_finalize (GObject *object); + +static void notify_cb (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + glPrefsModel *prefs_model); + +static gchar *get_string (GConfClient *client, + const gchar *key, + const gchar *def); + +static gboolean get_bool (GConfClient *client, + const gchar *key, + gboolean def); + +static gint get_int (GConfClient *client, + const gchar *key, + gint def); + +static gdouble get_float (GConfClient *client, + const gchar *key, + gdouble def); + +static lglUnitsType string_to_units (const gchar *string); +static const gchar *units_to_string (lglUnitsType units); + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glPrefsModel, gl_prefs_model, G_TYPE_OBJECT); + +static void +gl_prefs_model_class_init (glPrefsModelClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_PREFS, "START"); + + gl_prefs_model_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_prefs_model_finalize; + + signals[CHANGED] = + g_signal_new ("changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glPrefsModelClass, changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + gl_debug (DEBUG_PREFS, "END"); +} + +static void +gl_prefs_model_init (glPrefsModel *prefs_model) +{ + gl_debug (DEBUG_PREFS, "START"); + + prefs_model->gconf_client = gconf_client_get_default (); + + g_return_if_fail (prefs_model->gconf_client != NULL); + + gconf_client_add_dir (prefs_model->gconf_client, + BASE_KEY, + GCONF_CLIENT_PRELOAD_ONELEVEL, + NULL); + + gconf_client_notify_add (prefs_model->gconf_client, + BASE_KEY, + (GConfClientNotifyFunc)notify_cb, prefs_model, + NULL, NULL); + + gl_debug (DEBUG_PREFS, "END"); +} + +static void +gl_prefs_model_finalize (GObject *object) +{ + glPrefsModel *prefs_model = GL_PREFS_MODEL (object); + + gl_debug (DEBUG_PREFS, "START"); + + g_return_if_fail (object && GL_IS_PREFS_MODEL (object)); + + g_object_unref (G_OBJECT(prefs_model->gconf_client)); + g_free (prefs_model->default_page_size); + g_free (prefs_model->default_font_family); + + G_OBJECT_CLASS (gl_prefs_model_parent_class)->finalize (object); + + gl_debug (DEBUG_PREFS, "END"); +} + +/*****************************************************************************/ +/* New prefs_model object. */ +/*****************************************************************************/ +glPrefsModel * +gl_prefs_model_new (void) +{ + glPrefsModel *prefs_model; + + gl_debug (DEBUG_PREFS, "START"); + + prefs_model = GL_PREFS_MODEL (g_object_new (gl_prefs_model_get_type(), NULL)); + + gl_debug (DEBUG_PREFS, "END"); + + return prefs_model; +} + + + +/*****************************************************************************/ +/* Save all settings. */ +/*****************************************************************************/ +void +gl_prefs_model_save_settings (glPrefsModel *prefs_model) +{ + gl_debug (DEBUG_PREFS, "START"); + + g_return_if_fail (prefs_model && GL_IS_PREFS_MODEL(prefs_model)); + g_return_if_fail (prefs_model->gconf_client != NULL); + + /* We are saving settings because presumably some of them have been changed. */ + g_signal_emit (G_OBJECT(prefs_model), signals[CHANGED], 0); + + /* Units */ + gconf_client_set_string (prefs_model->gconf_client, + BASE_KEY PREF_UNITS, + units_to_string(prefs_model->units), + NULL); + lgl_xml_set_default_units (prefs_model->units); + + /* Default page size */ + gconf_client_set_string (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_PAGE_SIZE, + prefs_model->default_page_size, + NULL); + + + /* Text properties */ + gconf_client_set_string (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_FONT_FAMILY, + prefs_model->default_font_family, + NULL); + + gconf_client_set_float (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_FONT_SIZE, + prefs_model->default_font_size, + NULL); + + gconf_client_set_string (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_FONT_WEIGHT, + gl_util_weight_to_string(prefs_model->default_font_weight), + NULL); + + gconf_client_set_int (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_TEXT_COLOR, + prefs_model->default_text_color, + NULL); + + gconf_client_set_string (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_TEXT_ALIGNMENT, + gl_util_align_to_string(prefs_model->default_text_alignment), + NULL); + + gconf_client_set_float (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_TEXT_LINE_SPACING, + prefs_model->default_text_line_spacing, + NULL); + + /* Line properties */ + gconf_client_set_float (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_LINE_WIDTH, + prefs_model->default_line_width, + NULL); + + gconf_client_set_int (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_LINE_COLOR, + prefs_model->default_line_color, + NULL); + + + /* Fill properties */ + gconf_client_set_int (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_FILL_COLOR, + prefs_model->default_fill_color, + NULL); + + + /* Main Toolbar */ + gconf_client_set_bool (prefs_model->gconf_client, + BASE_KEY PREF_MAIN_TOOLBAR_VISIBLE, + prefs_model->main_toolbar_visible, + NULL); + + gconf_client_set_int (prefs_model->gconf_client, + BASE_KEY PREF_MAIN_TOOLBAR_BUTTONS_STYLE, + prefs_model->main_toolbar_buttons_style, + NULL); + + gconf_client_set_bool (prefs_model->gconf_client, + BASE_KEY PREF_MAIN_TOOLBAR_VIEW_TOOLTIPS, + prefs_model->main_toolbar_view_tooltips, + NULL); + + /* Drawing Toolbar */ + gconf_client_set_bool (prefs_model->gconf_client, + BASE_KEY PREF_DRAWING_TOOLBAR_VISIBLE, + prefs_model->drawing_toolbar_visible, + NULL); + + gconf_client_set_bool (prefs_model->gconf_client, + BASE_KEY PREF_DRAWING_TOOLBAR_VIEW_TOOLTIPS, + prefs_model->drawing_toolbar_view_tooltips, + NULL); + + /* Property Toolbar */ + gconf_client_set_bool (prefs_model->gconf_client, + BASE_KEY PREF_PROPERTY_TOOLBAR_VISIBLE, + prefs_model->property_toolbar_visible, + NULL); + + gconf_client_set_bool (prefs_model->gconf_client, + BASE_KEY PREF_PROPERTY_TOOLBAR_VIEW_TOOLTIPS, + prefs_model->property_toolbar_view_tooltips, + NULL); + + /* View properties */ + gconf_client_set_bool (prefs_model->gconf_client, + BASE_KEY PREF_GRID_VISIBLE, + prefs_model->grid_visible, + NULL); + + gconf_client_set_bool (prefs_model->gconf_client, + BASE_KEY PREF_MARKUP_VISIBLE, + prefs_model->markup_visible, + NULL); + + /* Recent files */ + gconf_client_set_int (prefs_model->gconf_client, + BASE_KEY PREF_MAX_RECENTS, + prefs_model->max_recents, + NULL); + + /* Recent templates */ + gconf_client_set_list (prefs_model->gconf_client, + BASE_KEY PREF_RECENT_TEMPLATES, + GCONF_VALUE_STRING, + prefs_model->recent_templates, + NULL); + gconf_client_set_int (prefs_model->gconf_client, + BASE_KEY PREF_MAX_RECENT_TEMPLATES, + prefs_model->max_recent_templates, + NULL); + + + gconf_client_suggest_sync (prefs_model->gconf_client, NULL); + + gl_debug (DEBUG_PREFS, "END"); +} + +/*****************************************************************************/ +/* Load all settings. */ +/*****************************************************************************/ +void +gl_prefs_model_load_settings (glPrefsModel *prefs_model) +{ + gchar *string; + lglPaper *paper; + GSList *p, *p_next; + + gl_debug (DEBUG_PREFS, "START"); + + g_return_if_fail (prefs_model && GL_IS_PREFS_MODEL(prefs_model)); + g_return_if_fail (prefs_model->gconf_client != NULL); + + /* Units */ + string = + get_string (prefs_model->gconf_client, + BASE_KEY PREF_UNITS, + DEFAULT_UNITS_STRING); + prefs_model->units = string_to_units( string ); + g_free( string ); + lgl_xml_set_default_units (prefs_model->units); + + + /* Page size */ + g_free (prefs_model->default_page_size); + prefs_model->default_page_size = + get_string (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_PAGE_SIZE, + DEFAULT_PAGE_SIZE); + + /* Text properties */ + g_free (prefs_model->default_font_family); + prefs_model->default_font_family = + get_string (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_FONT_FAMILY, + DEFAULT_FONT_FAMILY); + + prefs_model->default_font_size = + get_float (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_FONT_SIZE, + DEFAULT_FONT_SIZE); + + string = + get_string (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_FONT_WEIGHT, + DEFAULT_FONT_WEIGHT_STRING); + prefs_model->default_font_weight = gl_util_string_to_weight( string ); + g_free( string ); + + prefs_model->default_text_color = + get_int (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_TEXT_COLOR, + DEFAULT_TEXT_COLOR); + + string = + get_string (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_TEXT_ALIGNMENT, + DEFAULT_TEXT_ALIGN_STRING); + prefs_model->default_text_alignment = gl_util_string_to_align( string ); + g_free( string ); + + prefs_model->default_text_line_spacing = + get_float (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_TEXT_LINE_SPACING, + DEFAULT_TEXT_LINE_SPACING); + + gl_debug (DEBUG_PREFS, "text_line_spacing = %f", prefs_model->default_text_line_spacing); + + /* Line properties */ + prefs_model->default_line_width = + get_float (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_LINE_WIDTH, + DEFAULT_LINE_WIDTH); + prefs_model->default_line_color = + get_int (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_LINE_COLOR, + DEFAULT_LINE_COLOR); + + /* Fill properties */ + prefs_model->default_fill_color = + get_int (prefs_model->gconf_client, + BASE_KEY PREF_DEFAULT_FILL_COLOR, + DEFAULT_FILL_COLOR); + + + /* User Inferface/Main Toolbar */ + prefs_model->main_toolbar_visible = + get_bool (prefs_model->gconf_client, + BASE_KEY PREF_MAIN_TOOLBAR_VISIBLE, + TRUE); + + prefs_model->main_toolbar_buttons_style = + get_int (prefs_model->gconf_client, + BASE_KEY PREF_MAIN_TOOLBAR_BUTTONS_STYLE, + GL_TOOLBAR_SYSTEM); + + prefs_model->main_toolbar_view_tooltips = + get_bool (prefs_model->gconf_client, + BASE_KEY PREF_MAIN_TOOLBAR_VIEW_TOOLTIPS, + TRUE); + + /* User Inferface/Drawing Toolbar */ + prefs_model->drawing_toolbar_visible = + get_bool (prefs_model->gconf_client, + BASE_KEY PREF_DRAWING_TOOLBAR_VISIBLE, + TRUE); + + prefs_model->drawing_toolbar_view_tooltips = + get_bool (prefs_model->gconf_client, + BASE_KEY PREF_DRAWING_TOOLBAR_VIEW_TOOLTIPS, + TRUE); + + /* User Inferface/Property Toolbar */ + prefs_model->property_toolbar_visible = + get_bool (prefs_model->gconf_client, + BASE_KEY PREF_PROPERTY_TOOLBAR_VISIBLE, + TRUE); + + prefs_model->property_toolbar_view_tooltips = + get_bool (prefs_model->gconf_client, + BASE_KEY PREF_PROPERTY_TOOLBAR_VIEW_TOOLTIPS, + TRUE); + + + /* View properties */ + prefs_model->grid_visible = + get_bool (prefs_model->gconf_client, + BASE_KEY PREF_GRID_VISIBLE, + TRUE); + + prefs_model->markup_visible = + get_bool (prefs_model->gconf_client, + BASE_KEY PREF_MARKUP_VISIBLE, + TRUE); + + /* Recent files */ + prefs_model->max_recents = + get_int (prefs_model->gconf_client, + BASE_KEY PREF_MAX_RECENTS, + -1); + + /* Recent templates */ + for (p=prefs_model->recent_templates; p != NULL; p=p->next) + { + g_free (p->data); + } + g_slist_free (prefs_model->recent_templates); + prefs_model->recent_templates = + gconf_client_get_list (prefs_model->gconf_client, + BASE_KEY PREF_RECENT_TEMPLATES, + GCONF_VALUE_STRING, + NULL); + prefs_model->max_recent_templates = + get_int (prefs_model->gconf_client, + BASE_KEY PREF_MAX_RECENT_TEMPLATES, + 5); + + + /* Proof read the default page size -- it must be a valid id. */ + /* (For compatability with older versions.) */ + paper = lgl_db_lookup_paper_from_id (prefs_model->default_page_size); + if ( paper == NULL ) { + prefs_model->default_page_size = g_strdup (DEFAULT_PAGE_SIZE); + } else { + lgl_paper_free (paper); + paper = NULL; + } + + /* Proof read the recent templates list. Make sure the template names */ + /* are valid. Remove from list if not. */ + for (p=prefs_model->recent_templates; p != NULL; p=p_next) + { + p_next = p->next; + + if ( !lgl_db_does_template_name_exist (p->data) ) + { + g_free (p->data); + prefs_model->recent_templates = g_slist_delete_link (prefs_model->recent_templates, p); + } + } + + gl_debug (DEBUG_PREFS, "max_recents = %d", prefs_model->max_recents); + + + g_signal_emit (G_OBJECT(prefs_model), signals[CHANGED], 0); + + gl_debug (DEBUG_PREFS, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Key changed callback. */ +/*---------------------------------------------------------------------------*/ +static void +notify_cb (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + glPrefsModel *prefs_model) +{ + gl_debug (DEBUG_PREFS, "Key was changed: %s", entry->key); + + gl_prefs_model_load_settings (prefs_model); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Utilities to get values with defaults. */ +/*---------------------------------------------------------------------------*/ +static gchar* +get_string (GConfClient *client, + const gchar *key, + const gchar *def) +{ + gchar* val; + + val = gconf_client_get_string (client, key, NULL); + + if (val != NULL) { + + return val; + + } else { + + return def ? g_strdup (def) : NULL; + + } +} + +static gboolean +get_bool (GConfClient *client, + const gchar *key, + gboolean def) +{ + GConfValue* val; + gboolean retval; + + val = gconf_client_get (client, key, NULL); + + if (val != NULL) { + + if ( val->type == GCONF_VALUE_BOOL ) { + retval = gconf_value_get_bool (val); + } else { + retval = def; + } + + gconf_value_free (val); + + return retval; + + } else { + + return def; + + } +} + +static gint +get_int (GConfClient *client, + const gchar *key, + gint def) +{ + GConfValue* val; + gint retval; + + val = gconf_client_get (client, key, NULL); + + if (val != NULL) { + + if ( val->type == GCONF_VALUE_INT) { + retval = gconf_value_get_int(val); + } else { + retval = def; + } + + gconf_value_free (val); + + return retval; + + } else { + + return def; + + } +} + +static gdouble +get_float (GConfClient *client, + const gchar *key, + gdouble def) +{ + GConfValue* val; + gdouble retval; + + val = gconf_client_get (client, key, NULL); + + if (val != NULL) { + + if ( val->type == GCONF_VALUE_FLOAT ) { + retval = gconf_value_get_float(val); + } else { + retval = def; + } + + gconf_value_free (val); + + return retval; + + } else { + return def; + + } +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Utilities to deal with units. */ +/*---------------------------------------------------------------------------*/ +static lglUnitsType +string_to_units (const gchar *string) +{ + lglUnitsType units; + + if (g_strcasecmp (string, "Points") == 0) { + units = LGL_UNITS_POINT; + } else if (g_strcasecmp (string, "Inches") == 0) { + units = LGL_UNITS_INCH; + } else if (g_strcasecmp (string, "Millimeters") == 0) { + units = LGL_UNITS_MM; + } else { + units = LGL_UNITS_INCH; + } + + return units; +} + +static const +gchar *units_to_string (lglUnitsType units) +{ + switch (units) { + case LGL_UNITS_POINT: + return "Points"; + break; + case LGL_UNITS_INCH: + return "Inches"; + break; + case LGL_UNITS_MM: + return "Millimeters"; + break; + default: + return "Inches"; + break; + } +} + + diff --git a/src/prefs-model.h b/src/prefs-model.h new file mode 100644 index 00000000..b2cc1cbd --- /dev/null +++ b/src/prefs-model.h @@ -0,0 +1,124 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * prefs-model.h: Application preferences model module header file + * + * Copyright (C) 2001-2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PREFS_MODEL_H__ +#define __PREFS_MODEL_H__ + +#include +#include +#include +#include + +G_BEGIN_DECLS + +typedef enum { + GL_TOOLBAR_SYSTEM = 0, + GL_TOOLBAR_ICONS, + GL_TOOLBAR_ICONS_AND_TEXT +} glToolbarSetting; + +#define GL_TYPE_PREFS_MODEL (gl_prefs_model_get_type ()) +#define GL_PREFS_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_PREFS_MODEL, glPrefsModel)) +#define GL_PREFS_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_PREFS_MODEL, glPrefsModelClass)) +#define GL_IS_PREFS_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_PREFS_MODEL)) +#define GL_IS_PREFS_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_PREFS_MODEL)) +#define GL_PREFS_MODEL_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_PREFS_MODEL, glPrefsModelClass)) + + +typedef struct _glPrefsModel glPrefsModel; +typedef struct _glPrefsModelClass glPrefsModelClass; + +typedef struct _glPrefsModelPrivate glPrefsModelPrivate; + + +struct _glPrefsModel { + GObject *object; + + GConfClient *gconf_client; + + /* Units */ + lglUnitsType units; + + /* Page size */ + gchar *default_page_size; + + /* Text properties */ + gchar *default_font_family; + gdouble default_font_size; + PangoWeight default_font_weight; + gboolean default_font_italic_flag; + guint default_text_color; + PangoAlignment default_text_alignment; + gdouble default_text_line_spacing; + + /* Line properties */ + gdouble default_line_width; + guint default_line_color; + + /* Fill properties */ + guint default_fill_color; + + /* User Interface/Main Toolbar */ + gboolean main_toolbar_visible; + glToolbarSetting main_toolbar_buttons_style; + gboolean main_toolbar_view_tooltips; + + /* User Interface/Drawing Toolbar */ + gboolean drawing_toolbar_visible; + gboolean drawing_toolbar_view_tooltips; + + /* User Interface/Property Toolbar */ + gboolean property_toolbar_visible; + gboolean property_toolbar_view_tooltips; + + /* View properties */ + gboolean grid_visible; + gboolean markup_visible; + + /* Recent files */ + gint max_recents; + + /* Recent templates */ + GSList *recent_templates; + gint max_recent_templates; +}; + +struct _glPrefsModelClass { + GObjectClass parent_class; + + void (*changed) (glPrefsModel *prefs_model, gpointer user_data); +}; + + +GType gl_prefs_model_get_type (void) G_GNUC_CONST; + +glPrefsModel *gl_prefs_model_new (void); + +void gl_prefs_model_save_settings (glPrefsModel *prefs_model); + +void gl_prefs_model_load_settings (glPrefsModel *prefs_model); + +G_END_DECLS + +#endif /* __PREFS_MODEL_H__ */ + diff --git a/src/prefs.c b/src/prefs.c new file mode 100644 index 00000000..32011b79 --- /dev/null +++ b/src/prefs.c @@ -0,0 +1,214 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * prefs.c: Application preferences module + * + * Copyright (C) 2001-2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "prefs.h" + +#include +#include + +#include "debug.h" + +glPrefsModel *gl_prefs = NULL; + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + + + +/*****************************************************************************/ +/* Initialize preferences module. */ +/*****************************************************************************/ +void +gl_prefs_init (void) +{ + gl_debug (DEBUG_PREFS, "START"); + + gl_prefs = gl_prefs_model_new (); + + gl_prefs_model_load_settings (gl_prefs); + + gl_debug (DEBUG_PREFS, "END"); +} + + +/****************************************************************************/ +/* Get string representing desired units. */ +/****************************************************************************/ +const gchar * +gl_prefs_get_page_size (void) +{ + return (gl_prefs->default_page_size); +} + +/****************************************************************************/ +/* Get desired units. */ +/****************************************************************************/ +lglUnitsType +gl_prefs_get_units (void) +{ + return gl_prefs->units; +} + +/****************************************************************************/ +/* Get desired units per point. */ +/****************************************************************************/ +gdouble +gl_prefs_get_units_per_point (void) +{ + + switch (gl_prefs->units) { + case LGL_UNITS_POINT: + return 1.0; /* points */ + case LGL_UNITS_INCH: + return 1.0 / 72.0; /* inches */ + case LGL_UNITS_MM: + return 0.35277778; /* mm */ + default: + g_message ("Illegal units"); /* Should not happen */ + return 1.0; + } +} + +/****************************************************************************/ +/* Get precision for desired units. */ +/****************************************************************************/ +gint +gl_prefs_get_units_precision (void) +{ + + switch (gl_prefs->units) { + case LGL_UNITS_POINT: + return 1; /* points */ + case LGL_UNITS_INCH: + return 3; /* inches */ + case LGL_UNITS_MM: + return 1; /* mm */ + default: + g_message ("Illegal units"); /* Should not happen */ + return 1.0; + } +} + +/****************************************************************************/ +/* Get step size for desired units. */ +/****************************************************************************/ +gdouble +gl_prefs_get_units_step_size (void) +{ + + switch (gl_prefs->units) { + case LGL_UNITS_POINT: + return 0.1; /* points */ + case LGL_UNITS_INCH: + return 0.001; /* inches */ + case LGL_UNITS_MM: + return 0.1; /* mm */ + default: + g_message ("Illegal units"); /* Should not happen */ + return 1.0; + } +} + +/****************************************************************************/ +/* Get string representing desired units. */ +/****************************************************************************/ +const gchar * +gl_prefs_get_units_string (void) +{ + + switch (gl_prefs->units) { + case LGL_UNITS_POINT: + return _("points"); + case LGL_UNITS_INCH: + return _("inches"); + case LGL_UNITS_MM: + return _("mm"); + default: + g_message ("Illegal units"); /* Should not happen */ + return _("points"); + } +} + +/****************************************************************************/ +/* Add template to recent template list. */ +/****************************************************************************/ +void +gl_prefs_add_recent_template (const gchar *name) +{ + GSList *p; + + /* + * If already in list, remove that entry. + */ + p = g_slist_find_custom (gl_prefs->recent_templates, + name, + (GCompareFunc)lgl_str_utf8_casecmp); + if (p) + { + gl_prefs->recent_templates = + g_slist_remove_link (gl_prefs->recent_templates, p); + g_free (p->data); + g_slist_free_1 (p); + } + + /* + * Now prepend to list. + */ + gl_prefs->recent_templates = + g_slist_prepend (gl_prefs->recent_templates, g_strdup (name)); + + /* + * Truncate list to maximum size + */ + while (g_slist_length (gl_prefs->recent_templates) > gl_prefs->max_recent_templates) + { + p = g_slist_last (gl_prefs->recent_templates); + gl_prefs->recent_templates = + g_slist_remove_link (gl_prefs->recent_templates, p); + g_free (p->data); + g_slist_free_1 (p); + } + + /* + * Sync to disk. + */ + gl_prefs_model_save_settings (gl_prefs); +} diff --git a/src/prefs.h b/src/prefs.h new file mode 100644 index 00000000..98474f5c --- /dev/null +++ b/src/prefs.h @@ -0,0 +1,56 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * prefs.h: Application preferences module header file + * + * Copyright (C) 2001-2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PREFS_H__ +#define __PREFS_H__ + +#include "prefs-model.h" + +G_BEGIN_DECLS + + + +extern glPrefsModel *gl_prefs; + + + +void gl_prefs_init (void); + +const gchar *gl_prefs_get_page_size (void); + +lglUnitsType gl_prefs_get_units (void); + +const gchar *gl_prefs_get_units_string (void); + +gdouble gl_prefs_get_units_per_point (void); + +gdouble gl_prefs_get_units_step_size (void); + +gint gl_prefs_get_units_precision (void); + +void gl_prefs_add_recent_template (const gchar *name); + +G_END_DECLS + +#endif /* __PREFS_H__ */ + diff --git a/src/print-op.c b/src/print-op.c new file mode 100644 index 00000000..2b2cd4a7 --- /dev/null +++ b/src/print-op.c @@ -0,0 +1,690 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * print-op.c: Print operation module + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "print-op.h" + +#include +#include +#include +#include +#include +#include + +#include +#include "print.h" +#include "label.h" + +#include "wdgt-print-copies.h" +#include "wdgt-print-merge.h" + +#include "debug.h" + +/*===========================================*/ +/* Private data types */ +/*===========================================*/ + +struct _glPrintOpPrivate { + + glLabel *label; + + GtkWidget *simple_frame; + GtkWidget *copies_vbox; + GtkWidget *copies; + + GtkWidget *merge_frame; + GtkWidget *prmerge_vbox; + GtkWidget *prmerge; + + GtkWidget *outline_check; + GtkWidget *reverse_check; + GtkWidget *crop_marks_check; + + gboolean force_outline_flag; + + gchar *filename; + + gboolean outline_flag; + gboolean reverse_flag; + gboolean crop_marks_flag; + gboolean merge_flag; + gboolean collate_flag; + + gint first; + gint last; + gint n_sheets; + gint n_copies; + + glPrintState state; +}; + +struct _glPrintOpSettings +{ + + GtkPrintSettings *gtk_settings; + + gboolean outline_flag; + gboolean reverse_flag; + gboolean crop_marks_flag; + gboolean collate_flag; + + gint first; + gint last; + gint n_sheets; + gint n_copies; + +}; + + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_print_op_finalize (GObject *object); + +static void gl_print_op_construct (glPrintOp *op, + glLabel *label); + +static void gl_print_op_construct_batch (glPrintOp *op, + glLabel *label, + gchar *filename, + gint n_sheets, + gint n_copies, + gint first, + gboolean outline_flag, + gboolean reverse_flag, + gboolean crop_marks_flag); + + +static void set_page_size (glPrintOp *op, + glLabel *label); + +static GObject *create_custom_widget_cb (GtkPrintOperation *operation, + gpointer user_data); + +static void custom_widget_apply_cb (GtkPrintOperation *operation, + GtkWidget *widget, + gpointer user_data); + +static void begin_print_cb (GtkPrintOperation *operation, + GtkPrintContext *context, + gpointer user_data); + +static void draw_page_cb (GtkPrintOperation *operation, + GtkPrintContext *context, + int page_nr, + gpointer user_data); + + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glPrintOp, gl_print_op, GTK_TYPE_PRINT_OPERATION); + +static void +gl_print_op_class_init (glPrintOpClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_PRINT, ""); + + gl_print_op_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_print_op_finalize; +} + +static void +gl_print_op_init (glPrintOp *op) +{ + gl_debug (DEBUG_PRINT, ""); + + gtk_print_operation_set_use_full_page (GTK_PRINT_OPERATION (op), TRUE); + + gtk_print_operation_set_unit (GTK_PRINT_OPERATION (op), GTK_UNIT_POINTS); + + op->priv = g_new0 (glPrintOpPrivate, 1); + +} + +static void +gl_print_op_finalize (GObject *object) +{ + glPrintOp* op = GL_PRINT_OP (object); + + gl_debug (DEBUG_PRINT, ""); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_PRINT_OP (op)); + g_return_if_fail (op->priv != NULL); + + if (op->priv->label) { + g_object_unref (G_OBJECT(op->priv->label)); + } + g_free (op->priv->filename); + g_free (op->priv); + + G_OBJECT_CLASS (gl_print_op_parent_class)->finalize (object); + + g_free (op->priv); +} + +/*****************************************************************************/ +/* NEW print op. */ +/*****************************************************************************/ +glPrintOp * +gl_print_op_new (glLabel *label) +{ + glPrintOp *op; + + gl_debug (DEBUG_PRINT, ""); + + op = GL_PRINT_OP (g_object_new (GL_TYPE_PRINT_OP, NULL)); + + gl_print_op_construct (GL_PRINT_OP(op), label); + + return op; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct op. */ +/*--------------------------------------------------------------------------*/ +static void +gl_print_op_construct (glPrintOp *op, + glLabel *label) +{ + const lglTemplateFrame *frame; + + op->priv->label = label; + op->priv->force_outline_flag = FALSE; + + frame = (lglTemplateFrame *)label->template->frames->data; + + op->priv->n_sheets = 1; + op->priv->first = 1; + op->priv->last = lgl_template_frame_get_n_labels (frame); + op->priv->n_copies = 1; + + set_page_size (op, label); + + gtk_print_operation_set_custom_tab_label ( GTK_PRINT_OPERATION (op), + _("Labels")); + + g_signal_connect (G_OBJECT (op), "create-custom-widget", + G_CALLBACK (create_custom_widget_cb), label); + + g_signal_connect (G_OBJECT (op), "custom-widget-apply", + G_CALLBACK (custom_widget_apply_cb), label); + + g_signal_connect (G_OBJECT (op), "begin-print", + G_CALLBACK (begin_print_cb), label); + + g_signal_connect (G_OBJECT (op), "draw-page", + G_CALLBACK (draw_page_cb), label); +} + +/*****************************************************************************/ +/* NEW batch print operation. */ +/*****************************************************************************/ +glPrintOp * +gl_print_op_new_batch (glLabel *label, + gchar *filename, + gint n_sheets, + gint n_copies, + gint first, + gboolean outline_flag, + gboolean reverse_flag, + gboolean crop_marks_flag) +{ + glPrintOp *op; + + gl_debug (DEBUG_PRINT, ""); + + op = GL_PRINT_OP (g_object_new (GL_TYPE_PRINT_OP, NULL)); + + gl_print_op_construct_batch (GL_PRINT_OP(op), + label, + filename, + n_sheets, + n_copies, + first, + outline_flag, + reverse_flag, + crop_marks_flag); + + return op; +} + +/*****************************************************************************/ +/* Get print operation settings. */ +/*****************************************************************************/ +glPrintOpSettings * +gl_print_op_get_settings (glPrintOp *print_op) +{ + glPrintOpSettings *settings; + + settings = g_new0 (glPrintOpSettings, 1); + + if ( settings ) + { + settings->gtk_settings = + gtk_print_operation_get_print_settings (GTK_PRINT_OPERATION (print_op)); + + settings->outline_flag = print_op->priv->outline_flag; + settings->reverse_flag = print_op->priv->reverse_flag; + settings->crop_marks_flag = print_op->priv->crop_marks_flag; + settings->collate_flag = print_op->priv->collate_flag; + + settings->first = print_op->priv->first; + settings->last = print_op->priv->last; + settings->n_sheets = print_op->priv->n_sheets; + settings->n_copies = print_op->priv->n_copies; + } + + return settings; +} + +/*****************************************************************************/ +/* Set print operation settings. */ +/*****************************************************************************/ +void +gl_print_op_set_settings (glPrintOp *print_op, + glPrintOpSettings *settings) +{ + + if ( settings ) + { + gtk_print_operation_set_print_settings (GTK_PRINT_OPERATION (print_op), + settings->gtk_settings); + + print_op->priv->outline_flag = settings->outline_flag; + print_op->priv->reverse_flag = settings->reverse_flag; + print_op->priv->crop_marks_flag = settings->crop_marks_flag; + print_op->priv->collate_flag = settings->collate_flag; + + print_op->priv->first = settings->first; + print_op->priv->last = settings->last; + print_op->priv->n_sheets = settings->n_sheets; + print_op->priv->n_copies = settings->n_copies; + } + + } + +/*****************************************************************************/ +/* Free print operation settings structure. */ +/*****************************************************************************/ +void +gl_print_op_free_settings(glPrintOpSettings *settings) +{ + + if ( settings ) + { + if ( settings->gtk_settings ) + { + g_object_unref (settings->gtk_settings); + } + + g_free (settings); + } +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct op. */ +/*--------------------------------------------------------------------------*/ +static void +gl_print_op_construct_batch (glPrintOp *op, + glLabel *label, + gchar *filename, + gint n_sheets, + gint n_copies, + gint first, + gboolean outline_flag, + gboolean reverse_flag, + gboolean crop_marks_flag) + +{ + glMerge *merge = NULL; + const lglTemplateFrame *frame = NULL; + + op->priv->label = label; + op->priv->force_outline_flag = FALSE; + op->priv->filename = g_strdup (filename); + op->priv->n_sheets = n_sheets; + op->priv->n_copies = n_copies; + op->priv->first = first; + op->priv->outline_flag = outline_flag; + op->priv->reverse_flag = reverse_flag; + op->priv->crop_marks_flag = crop_marks_flag; + + merge = gl_label_get_merge (label); + + frame = (lglTemplateFrame *)label->template->frames->data; + if (merge == NULL) + { + op->priv->merge_flag = FALSE; + + op->priv->last = lgl_template_frame_get_n_labels (frame); + + } + else + { + op->priv->merge_flag = TRUE; + + op->priv->n_sheets = + ceil ((double)(first-1 + n_copies * gl_merge_get_record_count(merge)) + / lgl_template_frame_get_n_labels (frame));; + + g_object_unref (G_OBJECT(merge)); + + } + + set_page_size (op, label); + + gtk_print_operation_set_export_filename (GTK_PRINT_OPERATION (op), + filename); + + g_signal_connect (G_OBJECT (op), "begin-print", + G_CALLBACK (begin_print_cb), label); + + g_signal_connect (G_OBJECT (op), "draw-page", + G_CALLBACK (draw_page_cb), label); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Set page size. */ +/*--------------------------------------------------------------------------*/ +static void +set_page_size (glPrintOp *op, + glLabel *label) +{ + GtkPaperSize *psize; + GtkPageSetup *su; + lglPaper *paper; + + gl_debug (DEBUG_PRINT, "begin"); + + paper = lgl_db_lookup_paper_from_id (label->template->paper_id); + + if (!paper) + { + const gchar *name; + + name = gtk_paper_size_get_default (); + psize = gtk_paper_size_new (name); + + gl_debug (DEBUG_PRINT, "Using default size = \"%s\"", name); + } + else if (lgl_db_is_paper_id_other (paper->id)) + { + psize = gtk_paper_size_new_custom (paper->id, + paper->name, + label->template->page_width, + label->template->page_height, + GTK_UNIT_POINTS); + gl_debug (DEBUG_PRINT, "Using custom size = %g x %g points", + label->template->page_width, + label->template->page_height); + + } + else + { + psize = gtk_paper_size_new (paper->pwg_size); + gl_debug (DEBUG_PRINT, "Using PWG size \"%s\"", paper->pwg_size); + } + lgl_paper_free (paper); + + su = gtk_page_setup_new (); + gtk_page_setup_set_paper_size (su, psize); + gtk_print_operation_set_default_page_setup (GTK_PRINT_OPERATION (op), su); + g_object_unref (su); + + gtk_paper_size_free (psize); + + gl_debug (DEBUG_PRINT, "end"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. "Create custom widget" callback */ +/*--------------------------------------------------------------------------*/ +static GObject * +create_custom_widget_cb (GtkPrintOperation *operation, + gpointer user_data) +{ + GladeXML *gui; + glPrintOp *op = GL_PRINT_OP (operation); + glLabel *label = GL_LABEL (user_data); + GtkWidget *vbox; + glMerge *merge = NULL; + + gui = glade_xml_new (GLABELS_GLADE_DIR "print-custom-widget.glade", + "print_custom_widget_vbox", NULL); + + if (!gui) { + g_warning ("Could not open print-op.glade, reinstall glabels!"); + return NULL; + } + + vbox = glade_xml_get_widget (gui, "print_custom_widget_vbox"); + + /* ----- Simple print control ----- */ + op->priv->simple_frame = glade_xml_get_widget (gui, "simple_frame"); + op->priv->copies_vbox = glade_xml_get_widget (gui, "copies_vbox"); + op->priv->copies = gl_wdgt_print_copies_new (label); + gtk_box_pack_start (GTK_BOX(op->priv->copies_vbox), + op->priv->copies, FALSE, FALSE, 0); + + /* ----- Merge print control ----- */ + op->priv->merge_frame = glade_xml_get_widget (gui, "merge_frame"); + op->priv->prmerge_vbox = glade_xml_get_widget (gui, "prmerge_vbox"); + op->priv->prmerge = gl_wdgt_print_merge_new (label); + gtk_box_pack_start (GTK_BOX(op->priv->prmerge_vbox), + op->priv->prmerge, FALSE, FALSE, 0); + + /* ----- Options ----------------- */ + op->priv->outline_check = glade_xml_get_widget (gui, "outline_check"); + op->priv->reverse_check = glade_xml_get_widget (gui, "reverse_check"); + op->priv->crop_marks_check = glade_xml_get_widget (gui, "crop_marks_check"); + + g_object_unref (gui); + + /* ---- Activate either simple or merge print control widgets. ---- */ + merge = gl_label_get_merge (op->priv->label); + if (merge == NULL) { + + gl_wdgt_print_copies_set_range (GL_WDGT_PRINT_COPIES (op->priv->copies), + op->priv->n_sheets, + op->priv->first, + op->priv->last); + + gtk_widget_show_all (op->priv->simple_frame); + gtk_widget_hide_all (op->priv->merge_frame); + + } else { + + gint n_records = gl_merge_get_record_count( merge ); + gl_wdgt_print_merge_set_copies (GL_WDGT_PRINT_MERGE (op->priv->prmerge), + op->priv->n_copies, + op->priv->first, + n_records, + op->priv->collate_flag); + g_object_unref (G_OBJECT(merge)); + + gtk_widget_hide_all (op->priv->simple_frame); + gtk_widget_show_all (op->priv->merge_frame); + } + + /* --- Set options --- */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (op->priv->outline_check), + op->priv->outline_flag); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (op->priv->reverse_check), + op->priv->reverse_flag); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (op->priv->crop_marks_check), + op->priv->crop_marks_flag); + + /* --- Do we need to force the outline flag --- */ + if (op->priv->force_outline_flag) + { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(op->priv->outline_check), + TRUE); + + gtk_widget_set_sensitive (op->priv->outline_check, FALSE); + gtk_widget_set_sensitive (op->priv->reverse_check, FALSE); + gtk_widget_set_sensitive (op->priv->crop_marks_check, FALSE); + } + + return G_OBJECT (vbox); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. "Custom widget apply" callback */ +/*--------------------------------------------------------------------------*/ +static void +custom_widget_apply_cb (GtkPrintOperation *operation, + GtkWidget *widget, + gpointer user_data) +{ + glPrintOp *op = GL_PRINT_OP (operation); + glMerge *merge = NULL; + + + op->priv->outline_flag = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (op->priv->outline_check)); + op->priv->reverse_flag = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (op->priv->reverse_check)); + op->priv->crop_marks_flag = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (op->priv->crop_marks_check)); + + merge = gl_label_get_merge (op->priv->label); + + if (merge == NULL) + { + + op->priv->merge_flag = FALSE; + gl_wdgt_print_copies_get_range (GL_WDGT_PRINT_COPIES (op->priv->copies), + &op->priv->n_sheets, + &op->priv->first, + &op->priv->last); + } + else + { + + op->priv->merge_flag = TRUE; + gl_wdgt_print_merge_get_copies (GL_WDGT_PRINT_MERGE (op->priv->prmerge), + &op->priv->n_copies, + &op->priv->first, + &op->priv->collate_flag, + &op->priv->n_sheets); + g_object_unref (G_OBJECT(merge)); + } + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. "Begin print" callback */ +/*--------------------------------------------------------------------------*/ +static void +begin_print_cb (GtkPrintOperation *operation, + GtkPrintContext *context, + gpointer user_data) +{ + glPrintOp *op = GL_PRINT_OP (operation); + + gtk_print_operation_set_n_pages (operation, op->priv->n_sheets); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. "Draw page" callback. */ +/*--------------------------------------------------------------------------*/ +static void +draw_page_cb (GtkPrintOperation *operation, + GtkPrintContext *context, + int page_nr, + gpointer user_data) +{ + glPrintOp *op = GL_PRINT_OP (operation); + cairo_t *cr; + + cr = gtk_print_context_get_cairo_context (context); + + if (!op->priv->merge_flag) + { + gl_print_simple_sheet (op->priv->label, + cr, + page_nr, + op->priv->n_sheets, + op->priv->first, + op->priv->last, + op->priv->outline_flag, + op->priv->reverse_flag, + op->priv->crop_marks_flag); + } + else + { + if (op->priv->collate_flag) + { + gl_print_collated_merge_sheet (op->priv->label, + cr, + page_nr, + op->priv->n_copies, + op->priv->first, + op->priv->outline_flag, + op->priv->reverse_flag, + op->priv->crop_marks_flag, + &op->priv->state); + } + else + { + gl_print_uncollated_merge_sheet (op->priv->label, + cr, + page_nr, + op->priv->n_copies, + op->priv->first, + op->priv->outline_flag, + op->priv->reverse_flag, + op->priv->crop_marks_flag, + &op->priv->state); + } + } +} + + +/*****************************************************************************/ +/* Set outline flag/checkbox. */ +/*****************************************************************************/ +void +gl_print_op_force_outline_flag (glPrintOp *op) +{ + op->priv->force_outline_flag = TRUE; +} + + diff --git a/src/print-op.h b/src/print-op.h new file mode 100644 index 00000000..75c893c5 --- /dev/null +++ b/src/print-op.h @@ -0,0 +1,88 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * print-op.h: Print operation module header file + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PRINT_OP_H__ +#define __PRINT_OP_H__ + +#include +#include "label.h" + +G_BEGIN_DECLS + +#define GL_TYPE_PRINT_OP (gl_print_op_get_type ()) +#define GL_PRINT_OP(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_PRINT_OP, glPrintOp)) +#define GL_PRINT_OP_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_PRINT_OP, glPrintOpClass)) +#define GL_IS_PRINT_OP(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_PRINT_OP)) +#define GL_IS_PRINT_OP_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_PRINT_OP)) +#define GL_PRINT_OP_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_PRINT_OP, glPrintOpClass)) + + +typedef struct _glPrintOp glPrintOp; +typedef struct _glPrintOpClass glPrintOpClass; + +typedef struct _glPrintOpPrivate glPrintOpPrivate; + +struct _glPrintOp +{ + GtkPrintOperation parent_instance; + + glPrintOpPrivate *priv; + +}; + +struct _glPrintOpClass +{ + GtkPrintOperationClass parent_class; +}; + + +typedef struct _glPrintOpSettings glPrintOpSettings; + + + +GType gl_print_op_get_type (void) G_GNUC_CONST; + +glPrintOp *gl_print_op_new (glLabel *label); + +void gl_print_op_force_outline_flag (glPrintOp *print_op); + +glPrintOpSettings *gl_print_op_get_settings (glPrintOp *print_op); +void gl_print_op_set_settings (glPrintOp *print_op, + glPrintOpSettings *settings); +void gl_print_op_free_settings (glPrintOpSettings *settings); + +/* + * Batch print operation + */ +glPrintOp *gl_print_op_new_batch (glLabel *label, + gchar *filename, + gint n_sheets, + gint n_copies, + gint first, + gboolean outline_flag, + gboolean reverse_flag, + gboolean crop_marks_flag); + +G_END_DECLS + +#endif diff --git a/src/print.c b/src/print.c new file mode 100644 index 00000000..a33e3ad1 --- /dev/null +++ b/src/print.c @@ -0,0 +1,575 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * print.c: Print module + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "print.h" + +#include +#include +#include +#include + +#include "label.h" +#include +#include "cairo-label-path.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros and constants. */ +/*===========================================*/ + +#define OUTLINE_RGB_ARGS 0.0, 0.0, 0.0 + +#define OUTLINE_WIDTH 0.25 + +#define TICK_OFFSET 2.25 +#define TICK_LENGTH 18.0 + +/*=========================================================================*/ +/* Private types. */ +/*=========================================================================*/ + +typedef struct _PrintInfo { + cairo_t *cr; + + /* gLabels Template */ + lglTemplate *template; + gboolean label_rotate_flag; + + /* page size */ + gdouble page_width; + gdouble page_height; + +} PrintInfo; + + +/*=========================================================================*/ +/* Private function prototypes. */ +/*=========================================================================*/ +static PrintInfo *print_info_new (cairo_t *cr, + glLabel *label); + +static void print_info_free (PrintInfo **pi); + +static void print_crop_marks (PrintInfo *pi); + +static void print_label (PrintInfo *pi, + glLabel *label, + gdouble x, + gdouble y, + glMergeRecord *record, + gboolean outline_flag, + gboolean reverse_flag); + + +static void draw_outline (PrintInfo *pi, + glLabel *label); + +static void clip_to_outline (PrintInfo *pi, + glLabel *label); + + + +/*****************************************************************************/ +/* Print simple sheet (no merge data) command. */ +/*****************************************************************************/ +void +gl_print_simple_sheet (glLabel *label, + cairo_t *cr, + gint page, + gint n_sheets, + gint first, + gint last, + gboolean outline_flag, + gboolean reverse_flag, + gboolean crop_marks_flag) +{ + PrintInfo *pi; + const lglTemplateFrame *frame; + gint i_label; + lglTemplateOrigin *origins; + + gl_debug (DEBUG_PRINT, "START"); + + pi = print_info_new (cr, label); + + frame = (lglTemplateFrame *)pi->template->frames->data; + origins = lgl_template_frame_get_origins (frame); + + if (crop_marks_flag) { + print_crop_marks (pi); + } + + for (i_label = first - 1; i_label < last; i_label++) { + + print_label (pi, label, + origins[i_label].x, origins[i_label].y, + NULL, outline_flag, reverse_flag); + + } + + g_free (origins); + + print_info_free (&pi); + + gl_debug (DEBUG_PRINT, "END"); +} + +/*****************************************************************************/ +/* Print collated merge sheet command */ +/*****************************************************************************/ +void +gl_print_collated_merge_sheet (glLabel *label, + cairo_t *cr, + gint page, + gint n_copies, + gint first, + gboolean outline_flag, + gboolean reverse_flag, + gboolean crop_marks_flag, + glPrintState *state) +{ + glMerge *merge; + const GList *record_list; + PrintInfo *pi; + const lglTemplateFrame *frame; + gint i_label, n_labels_per_page, i_copy; + glMergeRecord *record; + GList *p; + lglTemplateOrigin *origins; + + gl_debug (DEBUG_PRINT, "START"); + + merge = gl_label_get_merge (label); + record_list = gl_merge_get_record_list (merge); + + pi = print_info_new (cr, label); + frame = (lglTemplateFrame *)pi->template->frames->data; + + n_labels_per_page = lgl_template_frame_get_n_labels (frame); + origins = lgl_template_frame_get_origins (frame); + + if (crop_marks_flag) { + print_crop_marks (pi); + } + + if (page == 0) + { + state->i_copy = 0; + state->p_record = (GList *)record_list; + + i_label = first - 1; + } + else + { + i_label = 0; + } + + + for ( p=(GList *)state->p_record; p!=NULL; p=p->next ) { + record = (glMergeRecord *)p->data; + + if ( record->select_flag ) { + for (i_copy = state->i_copy; i_copy < n_copies; i_copy++) { + + print_label (pi, label, + origins[i_label].x, + origins[i_label].y, + record, + outline_flag, reverse_flag); + + i_label++; + if (i_label == n_labels_per_page) + { + g_free (origins); + print_info_free (&pi); + + state->i_copy = (i_copy+1) % n_copies; + if (state->i_copy == 0) + { + state->p_record = p->next; + } + else + { + state->p_record = p; + } + return; + } + } + state->i_copy = 0; + } + } + + g_free (origins); + print_info_free (&pi); + + gl_debug (DEBUG_PRINT, "END"); +} + +/*****************************************************************************/ +/* Print uncollated merge sheet command */ +/*****************************************************************************/ +void +gl_print_uncollated_merge_sheet (glLabel *label, + cairo_t *cr, + gint page, + gint n_copies, + gint first, + gboolean outline_flag, + gboolean reverse_flag, + gboolean crop_marks_flag, + glPrintState *state) +{ + glMerge *merge; + const GList *record_list; + PrintInfo *pi; + const lglTemplateFrame *frame; + gint i_label, n_labels_per_page, i_copy; + glMergeRecord *record; + GList *p; + lglTemplateOrigin *origins; + + gl_debug (DEBUG_PRINT, "START"); + + merge = gl_label_get_merge (label); + record_list = gl_merge_get_record_list (merge); + + pi = print_info_new (cr, label); + frame = (lglTemplateFrame *)pi->template->frames->data; + + n_labels_per_page = lgl_template_frame_get_n_labels (frame); + origins = lgl_template_frame_get_origins (frame); + + if (crop_marks_flag) { + print_crop_marks (pi); + } + + if (page == 0) + { + state->i_copy = 0; + state->p_record = (GList *)record_list; + + i_label = first - 1; + } + else + { + i_label = 0; + } + + for (i_copy = state->i_copy; i_copy < n_copies; i_copy++) { + + for ( p=state->p_record; p!=NULL; p=p->next ) { + record = (glMergeRecord *)p->data; + + if ( record->select_flag ) { + + print_label (pi, label, + origins[i_label].x, + origins[i_label].y, + record, + outline_flag, reverse_flag); + + i_label++; + if (i_label == n_labels_per_page) + { + g_free (origins); + print_info_free (&pi); + + state->p_record = p->next; + if (state->p_record == NULL) + { + state->p_record = (GList *)record_list; + state->i_copy = i_copy + 1; + } + else + { + state->i_copy = i_copy; + } + return; + } + } + } + state->p_record = (GList *)record_list; + + } + + g_free (origins); + print_info_free (&pi); + + gl_debug (DEBUG_PRINT, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. new print info structure */ +/*---------------------------------------------------------------------------*/ +static PrintInfo * +print_info_new (cairo_t *cr, + glLabel *label) +{ + PrintInfo *pi = g_new0 (PrintInfo, 1); + + gl_debug (DEBUG_PRINT, "START"); + + g_return_val_if_fail (label && GL_IS_LABEL (label), NULL); + + g_return_val_if_fail (label->template, NULL); + g_return_val_if_fail (label->template->paper_id, NULL); + g_return_val_if_fail (label->template->page_width > 0, NULL); + g_return_val_if_fail (label->template->page_height > 0, NULL); + + pi->cr = cr; + + gl_debug (DEBUG_PRINT, + "setting page size = \"%s\"", label->template->paper_id); + + pi->page_width = label->template->page_width; + pi->page_height = label->template->page_height; + + pi->template = label->template; + pi->label_rotate_flag = label->rotate_flag; + + gl_debug (DEBUG_PRINT, "END"); + + return pi; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. free print info structure */ +/*---------------------------------------------------------------------------*/ +static void +print_info_free (PrintInfo **pi) +{ + gl_debug (DEBUG_PRINT, "START"); + + + g_free (*pi); + *pi = NULL; + + gl_debug (DEBUG_PRINT, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Print crop tick marks. */ +/*---------------------------------------------------------------------------*/ +static void +print_crop_marks (PrintInfo *pi) +{ + const lglTemplateFrame *frame; + gdouble w, h, page_w, page_h; + GList *p; + lglTemplateLayout *layout; + gdouble xmin, ymin, xmax, ymax, dx, dy; + gdouble x1, y1, x2, y2, x3, y3, x4, y4; + gint ix, iy, nx, ny; + + gl_debug (DEBUG_PRINT, "START"); + + frame = (lglTemplateFrame *)pi->template->frames->data; + + lgl_template_frame_get_size (frame, &w, &h); + + page_w = pi->page_width; + page_h = pi->page_height; + + cairo_save (pi->cr); + + cairo_set_source_rgb (pi->cr, OUTLINE_RGB_ARGS); + cairo_set_line_width (pi->cr, OUTLINE_WIDTH); + + for (p=frame->all.layouts; p != NULL; p=p->next) { + + layout = (lglTemplateLayout *)p->data; + + xmin = layout->x0; + ymin = layout->y0; + xmax = layout->x0 + layout->dx*(layout->nx - 1) + w; + ymax = layout->y0 + layout->dy*(layout->ny - 1) + h; + + dx = layout->dx; + dy = layout->dy; + + nx = layout->nx; + ny = layout->ny; + + for (ix=0; ix < nx; ix++) { + + x1 = xmin + ix*dx; + x2 = x1 + w; + + y1 = MAX((ymin - TICK_OFFSET), 0.0); + y2 = MAX((y1 - TICK_LENGTH), 0.0); + + y3 = MIN((ymax + TICK_OFFSET), page_h); + y4 = MIN((y3 + TICK_LENGTH), page_h); + + cairo_move_to (pi->cr, x1, y1); + cairo_line_to (pi->cr, x1, y2); + cairo_stroke (pi->cr); + + cairo_move_to (pi->cr, x2, y1); + cairo_line_to (pi->cr, x2, y2); + cairo_stroke (pi->cr); + + cairo_move_to (pi->cr, x1, y3); + cairo_line_to (pi->cr, x1, y4); + cairo_stroke (pi->cr); + + cairo_move_to (pi->cr, x2, y3); + cairo_line_to (pi->cr, x2, y4); + cairo_stroke (pi->cr); + + } + + for (iy=0; iy < ny; iy++) { + + y1 = ymin + iy*dy; + y2 = y1 + h; + + x1 = MAX((xmin - TICK_OFFSET), 0.0); + x2 = MAX((x1 - TICK_LENGTH), 0.0); + + x3 = MIN((xmax + TICK_OFFSET), page_w); + x4 = MIN((x3 + TICK_LENGTH), page_w); + + cairo_move_to (pi->cr, x1, y1); + cairo_line_to (pi->cr, x2, y1); + cairo_stroke (pi->cr); + + cairo_move_to (pi->cr, x1, y2); + cairo_line_to (pi->cr, x2, y2); + cairo_stroke (pi->cr); + + cairo_move_to (pi->cr, x3, y1); + cairo_line_to (pi->cr, x4, y1); + cairo_stroke (pi->cr); + + cairo_move_to (pi->cr, x3, y2); + cairo_line_to (pi->cr, x4, y2); + cairo_stroke (pi->cr); + + } + + } + + cairo_restore (pi->cr); + + gl_debug (DEBUG_PRINT, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Print i'th label. */ +/*---------------------------------------------------------------------------*/ +static void +print_label (PrintInfo *pi, + glLabel *label, + gdouble x, + gdouble y, + glMergeRecord *record, + gboolean outline_flag, + gboolean reverse_flag) +{ + const lglTemplateFrame *frame; + gdouble width, height; + + gl_debug (DEBUG_PRINT, "START"); + + frame = (lglTemplateFrame *)pi->template->frames->data; + + gl_label_get_size (label, &width, &height); + + cairo_save (pi->cr); + + /* Transform coordinate system to be relative to upper corner */ + /* of the current label */ + cairo_translate (pi->cr, x, y); + + clip_to_outline (pi, label); + + cairo_save (pi->cr); + + /* Special transformations. */ + if (label->rotate_flag) { + gl_debug (DEBUG_PRINT, "Rotate flag set"); + cairo_rotate (pi->cr, -M_PI/2.0); + cairo_translate (pi->cr, -width, 0.0); + } + if ( reverse_flag ) { + cairo_translate (pi->cr, width, 0.0); + cairo_scale (pi->cr, -1.0, 1.0); + } + + gl_label_draw (label, pi->cr, FALSE, record); + + cairo_restore (pi->cr); /* From special transformations. */ + + if (outline_flag) { + draw_outline (pi, label); + } + + cairo_restore (pi->cr); /* From translation. */ + + gl_debug (DEBUG_PRINT, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw outline. */ +/*---------------------------------------------------------------------------*/ +static void +draw_outline (PrintInfo *pi, + glLabel *label) +{ + gl_debug (DEBUG_PRINT, "START"); + + cairo_save (pi->cr); + + cairo_set_source_rgb (pi->cr, OUTLINE_RGB_ARGS); + cairo_set_line_width (pi->cr, OUTLINE_WIDTH); + + gl_cairo_label_path (pi->cr, label->template, FALSE, FALSE); + + cairo_stroke (pi->cr); + + cairo_restore (pi->cr); + + gl_debug (DEBUG_PRINT, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Clip to outline. */ +/*---------------------------------------------------------------------------*/ +static void +clip_to_outline (PrintInfo *pi, + glLabel *label) +{ + gl_debug (DEBUG_PRINT, "START"); + + gl_cairo_label_path (pi->cr, label->template, FALSE, TRUE); + + cairo_set_fill_rule (pi->cr, CAIRO_FILL_RULE_EVEN_ODD); + cairo_clip (pi->cr); + + gl_debug (DEBUG_PRINT, "END"); +} + diff --git a/src/print.h b/src/print.h new file mode 100644 index 00000000..b4f46a1f --- /dev/null +++ b/src/print.h @@ -0,0 +1,70 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * print.h: Print module header file + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PRINT_H__ +#define __PRINT_H__ + +#include + +#include "label.h" + +G_BEGIN_DECLS + +typedef struct { + gint i_copy; + GList *p_record; +} glPrintState; + +void gl_print_simple_sheet (glLabel *label, + cairo_t *cr, + gint page, + gint n_sheets, + gint first, + gint last, + gboolean outline_flag, + gboolean reverse_flag, + gboolean crop_marks_flag); + +void gl_print_collated_merge_sheet (glLabel *label, + cairo_t *cr, + gint page, + gint n_copies, + gint first, + gboolean outline_flag, + gboolean reverse_flag, + gboolean crop_marks_flag, + glPrintState *state); + +void gl_print_uncollated_merge_sheet (glLabel *label, + cairo_t *cr, + gint page, + gint n_copies, + gint first, + gboolean outline_flag, + gboolean reverse_flag, + gboolean crop_marks_flag, + glPrintState *state); + +G_END_DECLS + +#endif diff --git a/src/recent.c b/src/recent.c new file mode 100644 index 00000000..f713fcb4 --- /dev/null +++ b/src/recent.c @@ -0,0 +1,155 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * recent.c: gLabels recent files module + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "recent.h" + +#include +#include + +#include "prefs.h" +#include "debug.h" + +#define GLABELS_MIME_TYPE "application/x-glabels" + +static GtkRecentManager *model; + + + +/*****************************************************************************/ +/* Initialize recent files model. */ +/*****************************************************************************/ +void +gl_recent_init (void) +{ + gl_debug (DEBUG_RECENT, "START"); + + model = gtk_recent_manager_get_default (); + + gl_debug (DEBUG_RECENT, "END"); +} + + +/*****************************************************************************/ +/* Get UTF8 filename from GtkRecentInfo structure. */ +/*****************************************************************************/ +gchar * +gl_recent_get_utf8_filename (GtkRecentInfo *item) +{ + const gchar *uri; + gchar *filename; + gchar *utf8_filename = NULL; + + gl_debug (DEBUG_RECENT, "START"); + + uri = gtk_recent_info_get_uri (item); + + filename = g_filename_from_uri (uri, NULL, NULL); + if ( filename != NULL ) + { + utf8_filename = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL); + g_free (filename); + } + + return utf8_filename; + gl_debug (DEBUG_RECENT, "END"); +} + +/*****************************************************************************/ +/* Add file by UTF8 filename to recent model. */ +/*****************************************************************************/ +void +gl_recent_add_utf8_filename (gchar *utf8_filename) +{ + GtkRecentData *recent_data; + gchar *filename; + gchar *uri; + + static gchar *groups[2] = { + "glabels", + NULL + }; + + gl_debug (DEBUG_RECENT, "START"); + + recent_data = g_slice_new (GtkRecentData); + + recent_data->display_name = NULL; + recent_data->description = NULL; + recent_data->mime_type = GLABELS_MIME_TYPE; + recent_data->app_name = (gchar *) g_get_application_name (); + recent_data->app_exec = g_strjoin (" ", g_get_prgname (), "%f", NULL); + recent_data->groups = groups; + recent_data->is_private = FALSE; + + filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); + if ( filename != NULL ) + { + + uri = g_filename_to_uri (filename, NULL, NULL); + if ( uri != NULL ) + { + + gtk_recent_manager_add_full (model, uri, recent_data); + g_free (uri); + + } + g_free (filename); + + } + + g_free (recent_data->app_exec); + g_slice_free (GtkRecentData, recent_data); + + gl_debug (DEBUG_RECENT, "END"); +} + + +/*****************************************************************************/ +/* Create a menu of recent files. */ +/*****************************************************************************/ +GtkWidget * +gl_recent_create_menu (void) +{ + GtkWidget *recent_menu; + GtkRecentFilter *recent_filter; + + gl_debug (DEBUG_RECENT, "START"); + + recent_menu = + gtk_recent_chooser_menu_new_for_manager (model); + gtk_recent_chooser_menu_set_show_numbers (GTK_RECENT_CHOOSER_MENU (recent_menu), FALSE); + gtk_recent_chooser_set_show_icons (GTK_RECENT_CHOOSER (recent_menu), TRUE); + gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER (recent_menu), gl_prefs->max_recents); + gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (recent_menu), GTK_RECENT_SORT_MRU); + gtk_recent_chooser_set_local_only (GTK_RECENT_CHOOSER (recent_menu), TRUE); + + recent_filter = gtk_recent_filter_new (); + gtk_recent_filter_add_mime_type (recent_filter, GLABELS_MIME_TYPE); + gtk_recent_chooser_set_filter (GTK_RECENT_CHOOSER (recent_menu), recent_filter); + + gl_debug (DEBUG_RECENT, "END"); + return recent_menu; +} diff --git a/src/recent.h b/src/recent.h new file mode 100644 index 00000000..9a1b36c4 --- /dev/null +++ b/src/recent.h @@ -0,0 +1,45 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * recent.h: gLabels recent files module header file + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __RECENT_H__ +#define __RECENT_H__ + +#include +#include + +G_BEGIN_DECLS + +void gl_recent_init (void); + +gchar *gl_recent_get_utf8_filename (GtkRecentInfo *item); + +void gl_recent_add_utf8_filename (gchar *utf8_filename); + +GtkWidget *gl_recent_create_menu (void); + + +G_END_DECLS + +#endif /*__RECENT_H__*/ + diff --git a/src/stock-pixmaps/Makefile.am b/src/stock-pixmaps/Makefile.am new file mode 100644 index 00000000..5e34a955 --- /dev/null +++ b/src/stock-pixmaps/Makefile.am @@ -0,0 +1,95 @@ + +IMAGES = \ + stock_arrow_24.png \ + stock_arrow_16.png \ + stock_barcode_24.png \ + stock_barcode_16.png \ + stock_box_24.png \ + stock_box_16.png \ + stock_ellipse_24.png \ + stock_ellipse_16.png \ + stock_image_24.png \ + stock_image_16.png \ + stock_line_24.png \ + stock_line_16.png \ + stock_merge_24.png \ + stock_merge_16.png \ + stock_properties_24.png \ + stock_properties_16.png \ + stock_text_24.png \ + stock_text_16.png \ + stock_order_top_16.png \ + stock_order_bottom_16.png \ + stock_rotate_left_16.png \ + stock_rotate_right_16.png \ + stock_flip_horiz_16.png \ + stock_flip_vert_16.png \ + stock_align_left_16.png \ + stock_align_right_16.png \ + stock_align_hcenter_16.png \ + stock_align_top_16.png \ + stock_align_bottom_16.png \ + stock_align_vcenter_16.png \ + stock_center_horiz_16.png \ + stock_center_vert_16.png \ + stock_bucket_fill_16.png \ + stock_bucket_fill_24.png \ + stock_pencil_16.png \ + stock_pencil_24.png \ + stock_hchain_24.png \ + stock_hchain_broken_24.png \ + stock_vchain_24.png \ + stock_vchain_broken_24.png + +VARIABLES1 = \ + stock_arrow_24 $(srcdir)/stock_arrow_24.png \ + stock_arrow_16 $(srcdir)/stock_arrow_16.png \ + stock_barcode_24 $(srcdir)/stock_barcode_24.png \ + stock_barcode_16 $(srcdir)/stock_barcode_16.png \ + stock_box_24 $(srcdir)/stock_box_24.png \ + stock_box_16 $(srcdir)/stock_box_16.png \ + stock_ellipse_24 $(srcdir)/stock_ellipse_24.png \ + stock_ellipse_16 $(srcdir)/stock_ellipse_16.png \ + stock_image_24 $(srcdir)/stock_image_24.png \ + stock_image_16 $(srcdir)/stock_image_16.png \ + stock_line_24 $(srcdir)/stock_line_24.png \ + stock_line_16 $(srcdir)/stock_line_16.png \ + stock_merge_24 $(srcdir)/stock_merge_24.png \ + stock_merge_16 $(srcdir)/stock_merge_16.png \ + stock_properties_24 $(srcdir)/stock_properties_24.png \ + stock_properties_16 $(srcdir)/stock_properties_16.png \ + stock_text_24 $(srcdir)/stock_text_24.png \ + stock_text_16 $(srcdir)/stock_text_16.png \ + stock_order_top_16 $(srcdir)/stock_order_top_16.png \ + stock_order_bottom_16 $(srcdir)/stock_order_bottom_16.png \ + stock_rotate_left_16 $(srcdir)/stock_rotate_left_16.png \ + stock_rotate_right_16 $(srcdir)/stock_rotate_right_16.png \ + stock_flip_horiz_16 $(srcdir)/stock_flip_horiz_16.png \ + stock_flip_vert_16 $(srcdir)/stock_flip_vert_16.png \ + stock_align_left_16 $(srcdir)/stock_align_left_16.png \ + stock_align_right_16 $(srcdir)/stock_align_right_16.png \ + stock_align_hcenter_16 $(srcdir)/stock_align_hcenter_16.png \ + stock_align_top_16 $(srcdir)/stock_align_top_16.png \ + stock_align_bottom_16 $(srcdir)/stock_align_bottom_16.png \ + stock_align_vcenter_16 $(srcdir)/stock_align_vcenter_16.png \ + stock_center_horiz_16 $(srcdir)/stock_center_horiz_16.png \ + stock_center_vert_16 $(srcdir)/stock_center_vert_16.png \ + stock_bucket_fill_16 $(srcdir)/stock_bucket_fill_16.png \ + stock_bucket_fill_24 $(srcdir)/stock_bucket_fill_24.png \ + stock_pencil_16 $(srcdir)/stock_pencil_16.png \ + stock_pencil_24 $(srcdir)/stock_pencil_24.png \ + stock_hchain_24 $(srcdir)/stock_hchain_24.png \ + stock_hchain_broken_24 $(srcdir)/stock_hchain_broken_24.png \ + stock_vchain_24 $(srcdir)/stock_vchain_24.png \ + stock_vchain_broken_24 $(srcdir)/stock_vchain_broken_24.png + + +noinst_DATA = stockpixbufs.h +CLEANFILES = $(noinst_DATA) + +stockpixbufs.h: $(IMAGES) + gdk-pixbuf-csource \ + --raw --build-list $(VARIABLES1) > $(srcdir)/stockpixbufs.h || \ + ( rm -f $(srcdir)/stockpixbufs.h && false ) + +EXTRA_DIST = $(IMAGES) stockpixbufs.h diff --git a/src/stock-pixmaps/stock_align_bottom_16.png b/src/stock-pixmaps/stock_align_bottom_16.png new file mode 100644 index 00000000..da901bc4 Binary files /dev/null and b/src/stock-pixmaps/stock_align_bottom_16.png differ diff --git a/src/stock-pixmaps/stock_align_hcenter_16.png b/src/stock-pixmaps/stock_align_hcenter_16.png new file mode 100644 index 00000000..684c1259 Binary files /dev/null and b/src/stock-pixmaps/stock_align_hcenter_16.png differ diff --git a/src/stock-pixmaps/stock_align_left_16.png b/src/stock-pixmaps/stock_align_left_16.png new file mode 100644 index 00000000..1cdcf9bc Binary files /dev/null and b/src/stock-pixmaps/stock_align_left_16.png differ diff --git a/src/stock-pixmaps/stock_align_right_16.png b/src/stock-pixmaps/stock_align_right_16.png new file mode 100644 index 00000000..2b4872b0 Binary files /dev/null and b/src/stock-pixmaps/stock_align_right_16.png differ diff --git a/src/stock-pixmaps/stock_align_top_16.png b/src/stock-pixmaps/stock_align_top_16.png new file mode 100644 index 00000000..5bda931c Binary files /dev/null and b/src/stock-pixmaps/stock_align_top_16.png differ diff --git a/src/stock-pixmaps/stock_align_vcenter_16.png b/src/stock-pixmaps/stock_align_vcenter_16.png new file mode 100644 index 00000000..a51293f0 Binary files /dev/null and b/src/stock-pixmaps/stock_align_vcenter_16.png differ diff --git a/src/stock-pixmaps/stock_arrow_16.png b/src/stock-pixmaps/stock_arrow_16.png new file mode 100644 index 00000000..0ae5f368 Binary files /dev/null and b/src/stock-pixmaps/stock_arrow_16.png differ diff --git a/src/stock-pixmaps/stock_arrow_24.png b/src/stock-pixmaps/stock_arrow_24.png new file mode 100644 index 00000000..6e0e26af Binary files /dev/null and b/src/stock-pixmaps/stock_arrow_24.png differ diff --git a/src/stock-pixmaps/stock_barcode_16.png b/src/stock-pixmaps/stock_barcode_16.png new file mode 100644 index 00000000..6e0e2890 Binary files /dev/null and b/src/stock-pixmaps/stock_barcode_16.png differ diff --git a/src/stock-pixmaps/stock_barcode_24.png b/src/stock-pixmaps/stock_barcode_24.png new file mode 100644 index 00000000..9699c8dd Binary files /dev/null and b/src/stock-pixmaps/stock_barcode_24.png differ diff --git a/src/stock-pixmaps/stock_box_16.png b/src/stock-pixmaps/stock_box_16.png new file mode 100644 index 00000000..c141c9d5 Binary files /dev/null and b/src/stock-pixmaps/stock_box_16.png differ diff --git a/src/stock-pixmaps/stock_box_24.png b/src/stock-pixmaps/stock_box_24.png new file mode 100644 index 00000000..9f8e06f8 Binary files /dev/null and b/src/stock-pixmaps/stock_box_24.png differ diff --git a/src/stock-pixmaps/stock_bucket_fill_16.png b/src/stock-pixmaps/stock_bucket_fill_16.png new file mode 100644 index 00000000..2be70def Binary files /dev/null and b/src/stock-pixmaps/stock_bucket_fill_16.png differ diff --git a/src/stock-pixmaps/stock_bucket_fill_24.png b/src/stock-pixmaps/stock_bucket_fill_24.png new file mode 100644 index 00000000..1ee5993e Binary files /dev/null and b/src/stock-pixmaps/stock_bucket_fill_24.png differ diff --git a/src/stock-pixmaps/stock_center_horiz_16.png b/src/stock-pixmaps/stock_center_horiz_16.png new file mode 100644 index 00000000..fce3e909 Binary files /dev/null and b/src/stock-pixmaps/stock_center_horiz_16.png differ diff --git a/src/stock-pixmaps/stock_center_vert_16.png b/src/stock-pixmaps/stock_center_vert_16.png new file mode 100644 index 00000000..08b19af0 Binary files /dev/null and b/src/stock-pixmaps/stock_center_vert_16.png differ diff --git a/src/stock-pixmaps/stock_ellipse_16.png b/src/stock-pixmaps/stock_ellipse_16.png new file mode 100644 index 00000000..9652562e Binary files /dev/null and b/src/stock-pixmaps/stock_ellipse_16.png differ diff --git a/src/stock-pixmaps/stock_ellipse_24.png b/src/stock-pixmaps/stock_ellipse_24.png new file mode 100644 index 00000000..12f0468f Binary files /dev/null and b/src/stock-pixmaps/stock_ellipse_24.png differ diff --git a/src/stock-pixmaps/stock_flip_horiz_16.png b/src/stock-pixmaps/stock_flip_horiz_16.png new file mode 100644 index 00000000..e4770685 Binary files /dev/null and b/src/stock-pixmaps/stock_flip_horiz_16.png differ diff --git a/src/stock-pixmaps/stock_flip_vert_16.png b/src/stock-pixmaps/stock_flip_vert_16.png new file mode 100644 index 00000000..93027c93 Binary files /dev/null and b/src/stock-pixmaps/stock_flip_vert_16.png differ diff --git a/src/stock-pixmaps/stock_hchain_24.png b/src/stock-pixmaps/stock_hchain_24.png new file mode 100644 index 00000000..5bc2eedc Binary files /dev/null and b/src/stock-pixmaps/stock_hchain_24.png differ diff --git a/src/stock-pixmaps/stock_hchain_broken_24.png b/src/stock-pixmaps/stock_hchain_broken_24.png new file mode 100644 index 00000000..2e961a3e Binary files /dev/null and b/src/stock-pixmaps/stock_hchain_broken_24.png differ diff --git a/src/stock-pixmaps/stock_image_16.png b/src/stock-pixmaps/stock_image_16.png new file mode 100644 index 00000000..ee9ed3d2 Binary files /dev/null and b/src/stock-pixmaps/stock_image_16.png differ diff --git a/src/stock-pixmaps/stock_image_24.png b/src/stock-pixmaps/stock_image_24.png new file mode 100644 index 00000000..093c8ad9 Binary files /dev/null and b/src/stock-pixmaps/stock_image_24.png differ diff --git a/src/stock-pixmaps/stock_line_16.png b/src/stock-pixmaps/stock_line_16.png new file mode 100644 index 00000000..cf0e0406 Binary files /dev/null and b/src/stock-pixmaps/stock_line_16.png differ diff --git a/src/stock-pixmaps/stock_line_24.png b/src/stock-pixmaps/stock_line_24.png new file mode 100644 index 00000000..7bb65234 Binary files /dev/null and b/src/stock-pixmaps/stock_line_24.png differ diff --git a/src/stock-pixmaps/stock_merge_16.png b/src/stock-pixmaps/stock_merge_16.png new file mode 100644 index 00000000..2a3bfe8b Binary files /dev/null and b/src/stock-pixmaps/stock_merge_16.png differ diff --git a/src/stock-pixmaps/stock_merge_24.png b/src/stock-pixmaps/stock_merge_24.png new file mode 100644 index 00000000..af612006 Binary files /dev/null and b/src/stock-pixmaps/stock_merge_24.png differ diff --git a/src/stock-pixmaps/stock_order_bottom_16.png b/src/stock-pixmaps/stock_order_bottom_16.png new file mode 100644 index 00000000..f6ed2d00 Binary files /dev/null and b/src/stock-pixmaps/stock_order_bottom_16.png differ diff --git a/src/stock-pixmaps/stock_order_top_16.png b/src/stock-pixmaps/stock_order_top_16.png new file mode 100644 index 00000000..0884bc1e Binary files /dev/null and b/src/stock-pixmaps/stock_order_top_16.png differ diff --git a/src/stock-pixmaps/stock_pencil_16.png b/src/stock-pixmaps/stock_pencil_16.png new file mode 100644 index 00000000..83a14936 Binary files /dev/null and b/src/stock-pixmaps/stock_pencil_16.png differ diff --git a/src/stock-pixmaps/stock_pencil_24.png b/src/stock-pixmaps/stock_pencil_24.png new file mode 100644 index 00000000..a36ce930 Binary files /dev/null and b/src/stock-pixmaps/stock_pencil_24.png differ diff --git a/src/stock-pixmaps/stock_properties_16.png b/src/stock-pixmaps/stock_properties_16.png new file mode 100644 index 00000000..ab42b19c Binary files /dev/null and b/src/stock-pixmaps/stock_properties_16.png differ diff --git a/src/stock-pixmaps/stock_properties_24.png b/src/stock-pixmaps/stock_properties_24.png new file mode 100644 index 00000000..f5926060 Binary files /dev/null and b/src/stock-pixmaps/stock_properties_24.png differ diff --git a/src/stock-pixmaps/stock_rotate_left_16.png b/src/stock-pixmaps/stock_rotate_left_16.png new file mode 100644 index 00000000..157884e5 Binary files /dev/null and b/src/stock-pixmaps/stock_rotate_left_16.png differ diff --git a/src/stock-pixmaps/stock_rotate_right_16.png b/src/stock-pixmaps/stock_rotate_right_16.png new file mode 100644 index 00000000..cc5dc49a Binary files /dev/null and b/src/stock-pixmaps/stock_rotate_right_16.png differ diff --git a/src/stock-pixmaps/stock_text_16.png b/src/stock-pixmaps/stock_text_16.png new file mode 100644 index 00000000..c539bf1e Binary files /dev/null and b/src/stock-pixmaps/stock_text_16.png differ diff --git a/src/stock-pixmaps/stock_text_24.png b/src/stock-pixmaps/stock_text_24.png new file mode 100644 index 00000000..b9e5511a Binary files /dev/null and b/src/stock-pixmaps/stock_text_24.png differ diff --git a/src/stock-pixmaps/stock_vchain_24.png b/src/stock-pixmaps/stock_vchain_24.png new file mode 100644 index 00000000..7dc2031f Binary files /dev/null and b/src/stock-pixmaps/stock_vchain_24.png differ diff --git a/src/stock-pixmaps/stock_vchain_broken_24.png b/src/stock-pixmaps/stock_vchain_broken_24.png new file mode 100644 index 00000000..8ef1363c Binary files /dev/null and b/src/stock-pixmaps/stock_vchain_broken_24.png differ diff --git a/src/stock.c b/src/stock.c new file mode 100644 index 00000000..72f1c25c --- /dev/null +++ b/src/stock.c @@ -0,0 +1,221 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * stock.h: Stock image module header file + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "stock.h" + +#include +#include +#include +#include + +#include "stock-pixmaps/stockpixbufs.h" + + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void add_icons (GtkIconFactory *factory, + const gchar *stock_id, + const guchar *inline_24, + const guchar *inline_16); + +static void add_button_icon (GtkIconFactory *factory, + const gchar *stock_id, + const guchar *inline_24); + + +/****************************************************************************/ +/* Initialize our stock icons. */ +/****************************************************************************/ +void +gl_stock_init (void) +{ + GtkIconFactory *factory; + + static GtkStockItem items[] = { + { GL_STOCK_ARROW, N_("_Select Mode"), 0, 0, NULL }, + { GL_STOCK_TEXT, N_("_Text"), 0, 0, NULL }, + { GL_STOCK_LINE, N_("_Line"), 0, 0, NULL }, + { GL_STOCK_BOX, N_("_Box"), 0, 0, NULL }, + { GL_STOCK_ELLIPSE, N_("_Ellipse"), 0, 0, NULL }, + { GL_STOCK_IMAGE, N_("_Image"), 0, 0, NULL }, + { GL_STOCK_BARCODE, N_("Bar_code"), 0, 0, NULL }, + { GL_STOCK_MERGE, N_("_Merge Properties"), 0, 0, NULL }, + { GL_STOCK_PROPERTIES, N_("Object _Properties"), 0, 0, NULL }, + { GL_STOCK_ORDER_TOP, N_("Bring to _Front"), 0, 0, NULL }, + { GL_STOCK_ORDER_BOTTOM, N_("Send to _Back"), 0, 0, NULL }, + { GL_STOCK_ROTATE_LEFT, N_("Rotate _Left"), 0, 0, NULL }, + { GL_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), 0, 0, NULL }, + { GL_STOCK_FLIP_HORIZ, N_("Flip _Horizontally"), 0, 0, NULL }, + { GL_STOCK_FLIP_VERT, N_("Flip _Vertically"), 0, 0, NULL }, + { GL_STOCK_ALIGN_LEFT, N_("_Lefts"), 0, 0, NULL }, + { GL_STOCK_ALIGN_RIGHT, N_("_Rights"), 0, 0, NULL }, + { GL_STOCK_ALIGN_HCENTER, N_("_Centers"), 0, 0, NULL }, + { GL_STOCK_ALIGN_TOP, N_("_Tops"), 0, 0, NULL }, + { GL_STOCK_ALIGN_BOTTOM, N_("Bottoms"), 0, 0, NULL }, + { GL_STOCK_ALIGN_VCENTER, N_("Centers"), 0, 0, NULL }, + { GL_STOCK_CENTER_HORIZ, N_("Label Ce_nter"), 0, 0, NULL }, + { GL_STOCK_CENTER_VERT, N_("Label Ce_nter"), 0, 0, NULL }, + { GL_STOCK_BUCKET_FILL, N_("Fill color"), 0, 0, NULL }, + { GL_STOCK_PENCIL, N_("Line color"), 0, 0, NULL }, + { GL_STOCK_HCHAIN, N_("Linked"), 0, 0, NULL }, + { GL_STOCK_HCHAIN_BROKEN, N_("Not Linked"), 0, 0, NULL }, + { GL_STOCK_VCHAIN, N_("Linked"), 0, 0, NULL }, + { GL_STOCK_VCHAIN_BROKEN, N_("Not Linked"), 0, 0, NULL }, + }; + + gtk_stock_add (items, G_N_ELEMENTS (items)); + + factory = gtk_icon_factory_new (); + gtk_icon_factory_add_default (factory); + + add_icons (factory, GL_STOCK_ARROW, stock_arrow_24, stock_arrow_16); + add_icons (factory, GL_STOCK_TEXT, stock_text_24, stock_text_16); + add_icons (factory, GL_STOCK_LINE, stock_line_24, stock_line_16); + add_icons (factory, GL_STOCK_BOX, stock_box_24, stock_box_16); + add_icons (factory, GL_STOCK_ELLIPSE, stock_ellipse_24, stock_ellipse_16); + add_icons (factory, GL_STOCK_IMAGE, stock_image_24, stock_image_16); + add_icons (factory, GL_STOCK_BARCODE, stock_barcode_24, stock_barcode_16); + add_icons (factory, GL_STOCK_MERGE, stock_merge_24, stock_merge_16); + + add_icons (factory, GL_STOCK_PROPERTIES, + stock_properties_24, + stock_properties_16); + + add_icons (factory, GL_STOCK_ORDER_TOP, NULL, stock_order_top_16); + add_icons (factory, GL_STOCK_ORDER_BOTTOM, NULL, stock_order_bottom_16); + add_icons (factory, GL_STOCK_ROTATE_LEFT, NULL, stock_rotate_left_16); + add_icons (factory, GL_STOCK_ROTATE_RIGHT, NULL, stock_rotate_right_16); + add_icons (factory, GL_STOCK_FLIP_HORIZ, NULL, stock_flip_horiz_16); + add_icons (factory, GL_STOCK_FLIP_VERT, NULL, stock_flip_vert_16); + add_icons (factory, GL_STOCK_ALIGN_LEFT, NULL, stock_align_left_16); + add_icons (factory, GL_STOCK_ALIGN_RIGHT, NULL, stock_align_right_16); + add_icons (factory, GL_STOCK_ALIGN_HCENTER, NULL, stock_align_hcenter_16); + add_icons (factory, GL_STOCK_ALIGN_TOP, NULL, stock_align_top_16); + add_icons (factory, GL_STOCK_ALIGN_BOTTOM, NULL, stock_align_bottom_16); + add_icons (factory, GL_STOCK_ALIGN_VCENTER, NULL, stock_align_vcenter_16); + add_icons (factory, GL_STOCK_CENTER_HORIZ, NULL, stock_center_horiz_16); + add_icons (factory, GL_STOCK_CENTER_VERT, NULL, stock_center_vert_16); + + add_icons (factory, GL_STOCK_BUCKET_FILL, stock_bucket_fill_24, stock_bucket_fill_16); + add_icons (factory, GL_STOCK_PENCIL, stock_pencil_24, stock_pencil_16); + + add_button_icon (factory, GL_STOCK_HCHAIN, stock_hchain_24); + add_button_icon (factory, GL_STOCK_HCHAIN_BROKEN, stock_hchain_broken_24); + add_button_icon (factory, GL_STOCK_VCHAIN, stock_vchain_24); + add_button_icon (factory, GL_STOCK_VCHAIN_BROKEN, stock_vchain_broken_24); + + g_object_unref (G_OBJECT(factory)); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Unpack and associate given icons with stock_id. */ +/*--------------------------------------------------------------------------*/ +static void +add_icons (GtkIconFactory *factory, + const gchar *stock_id, + const guchar *inline_24, + const guchar *inline_16) +{ + GdkPixbuf *pixbuf; + GtkIconSet *icon_set; + GtkIconSource *icon_source; + + if ( inline_24 != NULL ) { + /* Create icon set with default image */ + pixbuf = gdk_pixbuf_new_from_inline (-1, inline_24, FALSE, NULL); + icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); + g_object_unref (G_OBJECT(pixbuf)); + } else { + /* Create an empty icon set */ + icon_set = gtk_icon_set_new (); + } + + if ( inline_16 != NULL ) { + /* Add 16x16 icon for menus to icon set */ + icon_source = gtk_icon_source_new (); + pixbuf = gdk_pixbuf_new_from_inline (-1, inline_16, + FALSE, NULL); + gtk_icon_source_set_pixbuf (icon_source, pixbuf); + g_object_unref (G_OBJECT(pixbuf)); + gtk_icon_source_set_size_wildcarded (icon_source, FALSE); + gtk_icon_source_set_size (icon_source, GTK_ICON_SIZE_MENU); + gtk_icon_set_add_source (icon_set, icon_source); + g_free (icon_source); + } + + /* Now associate icon set with stock id */ + gtk_icon_factory_add (factory, stock_id, icon_set); + gtk_icon_set_unref (icon_set); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Unpack and associate given button icon with stock_id. */ +/*--------------------------------------------------------------------------*/ +static void +add_button_icon (GtkIconFactory *factory, + const gchar *stock_id, + const guchar *inline_24) +{ + GtkIconSet *icon_set; + GdkPixbuf *pixbuf; + GtkIconSource *icon_source; + + icon_set = gtk_icon_set_new (); + + icon_source = gtk_icon_source_new (); + pixbuf = gdk_pixbuf_new_from_inline (-1, inline_24, FALSE, NULL); + gtk_icon_source_set_pixbuf (icon_source, pixbuf); + g_object_unref (G_OBJECT(pixbuf)); + gtk_icon_source_set_size_wildcarded (icon_source, FALSE); + gtk_icon_source_set_size (icon_source, GTK_ICON_SIZE_BUTTON); + gtk_icon_set_add_source (icon_set, icon_source); + g_free (icon_source); + + /* Now associate icon set with stock id */ + gtk_icon_factory_add (factory, stock_id, icon_set); + gtk_icon_set_unref (icon_set); +} + + + + + + + diff --git a/src/stock.h b/src/stock.h new file mode 100644 index 00000000..14fb907a --- /dev/null +++ b/src/stock.h @@ -0,0 +1,68 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * stock.h: Stock image module header file + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __STOCK_H__ +#define __STOCK_H__ + +#include + +G_BEGIN_DECLS + +/* Stock names */ + +#define GL_STOCK_ARROW "gl_stock_arrow" +#define GL_STOCK_TEXT "gl_stock_text" +#define GL_STOCK_LINE "gl_stock_line" +#define GL_STOCK_BOX "gl_stock_box" +#define GL_STOCK_ELLIPSE "gl_stock_ellipse" +#define GL_STOCK_IMAGE "gl_stock_image" +#define GL_STOCK_BARCODE "gl_stock_barcode" +#define GL_STOCK_MERGE "gl_stock_merge" +#define GL_STOCK_PROPERTIES "gl_stock_properties" +#define GL_STOCK_ORDER_TOP "gl_stock_order_top" +#define GL_STOCK_ORDER_BOTTOM "gl_stock_order_bottom" +#define GL_STOCK_ROTATE_LEFT "gl_stock_rotate_left" +#define GL_STOCK_ROTATE_RIGHT "gl_stock_rotate_right" +#define GL_STOCK_FLIP_HORIZ "gl_stock_flip_horiz" +#define GL_STOCK_FLIP_VERT "gl_stock_flip_vert" +#define GL_STOCK_ALIGN_LEFT "gl_stock_align_left" +#define GL_STOCK_ALIGN_RIGHT "gl_stock_align_right" +#define GL_STOCK_ALIGN_HCENTER "gl_stock_align_hcenter" +#define GL_STOCK_ALIGN_TOP "gl_stock_align_top" +#define GL_STOCK_ALIGN_BOTTOM "gl_stock_align_bottom" +#define GL_STOCK_ALIGN_VCENTER "gl_stock_align_vcenter" +#define GL_STOCK_CENTER_HORIZ "gl_stock_center_horiz" +#define GL_STOCK_CENTER_VERT "gl_stock_center_vert" +#define GL_STOCK_BUCKET_FILL "gl_stock_bucket_fill" +#define GL_STOCK_PENCIL "gl_stock_pencil" +#define GL_STOCK_HCHAIN "gl_stock_hchain" +#define GL_STOCK_HCHAIN_BROKEN "gl_stock_hchain_broken" +#define GL_STOCK_VCHAIN "gl_stock_vchain" +#define GL_STOCK_VCHAIN_BROKEN "gl_stock_vchain_broken" + +void gl_stock_init (void); + +G_END_DECLS + +#endif diff --git a/src/template-designer.c b/src/template-designer.c new file mode 100644 index 00000000..60ffe576 --- /dev/null +++ b/src/template-designer.c @@ -0,0 +1,1758 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * template-designer.c: Template designer module + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "template-designer.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "prefs.h" +#include +#include "wdgt-mini-preview.h" +#include "mini-preview-pixbuf-cache.h" +#include "print-op.h" +#include "util.h" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ +#define ICON_PIXMAP (GLABELS_ICON_DIR "glabels.png") + +#define EX_RECT_IMAGE (GLABELS_PIXMAP_DIR "ex-rect-size.png") +#define EX_ROUND_IMAGE (GLABELS_PIXMAP_DIR "ex-round-size.png") +#define EX_CD_IMAGE (GLABELS_PIXMAP_DIR "ex-cd-size.png") +#define EX_NLAYOUTS_IMAGE1 (GLABELS_PIXMAP_DIR "ex-1layout.png") +#define EX_NLAYOUTS_IMAGE2 (GLABELS_PIXMAP_DIR "ex-2layouts.png") + +#define DEFAULT_MARGIN 9.0 + +#define DEFAULT_RECT_W 252.0 +#define DEFAULT_RECT_H 144.0 +#define DEFAULT_RECT_R 0.0 +#define DEFAULT_RECT_WASTE 0.0 /* Should never exceed 1/2 the distance between items. */ + +#define DEFAULT_ROUND_R 72.0 +#define DEFAULT_ROUND_WASTE 0.0 /* Should never exceed 1/2 the distance between items. */ + +#define DEFAULT_CD_RADIUS 166.5 +#define DEFAULT_CD_HOLE 58.5 +#define DEFAULT_CD_WASTE 9.0 /* Should never exceed 1/2 the distance between items. */ + +#define DELTA 0.01 +#define MAX_PAGE_DIM_POINTS 5000.0 + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glTemplateDesignerPrivate +{ + /* Assistant pages */ + GtkWidget *start_page; + GtkWidget *name_page; + GtkWidget *pg_size_page; + GtkWidget *shape_page; + GtkWidget *rect_size_page; + GtkWidget *round_size_page; + GtkWidget *cd_size_page; + GtkWidget *nlayouts_page; + GtkWidget *layout_page; + GtkWidget *finish_page; + + /* Name page controls */ + GtkWidget *brand_entry; + GtkWidget *part_num_entry; + GtkWidget *name_warning_image; + GtkWidget *name_warning_label; + GtkWidget *description_entry; + + /* Page size page controls */ + GtkWidget *pg_size_combo; + GtkWidget *pg_w_spin; + GtkWidget *pg_h_spin; + GtkWidget *pg_w_units_label; + GtkWidget *pg_h_units_label; + + /* Shape page controls */ + GtkWidget *shape_rect_radio; + GtkWidget *shape_round_radio; + GtkWidget *shape_cd_radio; + + /* Label size (rectangular) page controls */ + GtkWidget *rect_image; + GtkWidget *rect_w_spin; + GtkWidget *rect_h_spin; + GtkWidget *rect_r_spin; + GtkWidget *rect_x_waste_spin; + GtkWidget *rect_y_waste_spin; + GtkWidget *rect_margin_spin; + GtkWidget *rect_w_units_label; + GtkWidget *rect_h_units_label; + GtkWidget *rect_r_units_label; + GtkWidget *rect_x_waste_units_label; + GtkWidget *rect_y_waste_units_label; + GtkWidget *rect_margin_units_label; + + /* Label size (round) page controls */ + GtkWidget *round_image; + GtkWidget *round_r_spin; + GtkWidget *round_waste_spin; + GtkWidget *round_margin_spin; + GtkWidget *round_r_units_label; + GtkWidget *round_waste_units_label; + GtkWidget *round_margin_units_label; + + /* Label size (cd) page controls */ + GtkWidget *cd_image; + GtkWidget *cd_radius_spin; + GtkWidget *cd_hole_spin; + GtkWidget *cd_w_spin; + GtkWidget *cd_h_spin; + GtkWidget *cd_waste_spin; + GtkWidget *cd_margin_spin; + GtkWidget *cd_radius_units_label; + GtkWidget *cd_hole_units_label; + GtkWidget *cd_w_units_label; + GtkWidget *cd_h_units_label; + GtkWidget *cd_waste_units_label; + GtkWidget *cd_margin_units_label; + + /* Number of layouts controls */ + GtkWidget *nlayouts_image1; + GtkWidget *nlayouts_image2; + GtkWidget *nlayouts_spin; + + /* Layout page controls */ + GtkWidget *layout1_head_label; + GtkWidget *layout1_nx_spin; + GtkWidget *layout1_ny_spin; + GtkWidget *layout1_x0_spin; + GtkWidget *layout1_y0_spin; + GtkWidget *layout1_dx_spin; + GtkWidget *layout1_dy_spin; + GtkWidget *layout2_head_label; + GtkWidget *layout2_nx_spin; + GtkWidget *layout2_ny_spin; + GtkWidget *layout2_x0_spin; + GtkWidget *layout2_y0_spin; + GtkWidget *layout2_dx_spin; + GtkWidget *layout2_dy_spin; + GtkWidget *layout_x0_units_label; + GtkWidget *layout_y0_units_label; + GtkWidget *layout_dx_units_label; + GtkWidget *layout_dy_units_label; + GtkWidget *layout_mini_preview; + GtkWidget *layout_test_button; + + /* Units related stuff */ + const gchar *units_string; + gdouble units_per_point; + gdouble climb_rate; + gint digits; + + /* Prevent recursion */ + gboolean stop_signals; +}; + +/* Page numbers for traversing GtkAssistant */ +enum { + START_PAGE_NUM = 0, + NAME_PAGE_NUM, + PG_SIZE_PAGE_NUM, + SHAPE_PAGE_NUM, + RECT_SIZE_PAGE_NUM, + ROUND_SIZE_PAGE_NUM, + CD_SIZE_PAGE_NUM, + NLAYOUTS_PAGE_NUM, + LAYOUT_PAGE_NUM, + FINISH_PAGE_NUM +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_template_designer_finalize (GObject *object); +static void gl_template_designer_construct (glTemplateDesigner *dialog); + +static void construct_start_page (glTemplateDesigner *dialog, + GdkPixbuf *logo); + +static void construct_name_page (glTemplateDesigner *dialog, + GdkPixbuf *logo); + +static void construct_pg_size_page (glTemplateDesigner *dialog, + GdkPixbuf *logo); + +static void construct_shape_page (glTemplateDesigner *dialog, + GdkPixbuf *logo); + +static void construct_rect_size_page (glTemplateDesigner *dialog, + GdkPixbuf *logo); + +static void construct_round_size_page (glTemplateDesigner *dialog, + GdkPixbuf *logo); + +static void construct_cd_size_page (glTemplateDesigner *dialog, + GdkPixbuf *logo); + +static void construct_nlayouts_page (glTemplateDesigner *dialog, + GdkPixbuf *logo); + +static void construct_layout_page (glTemplateDesigner *dialog, + GdkPixbuf *logo); + +static void construct_finish_page (glTemplateDesigner *dialog, + GdkPixbuf *logo); + +static void cancel_cb (glTemplateDesigner *dialog); +static void apply_cb (glTemplateDesigner *dialog); +static void close_cb (glTemplateDesigner *dialog); +static void prepare_cb (glTemplateDesigner *dialog, + GtkWidget *page); + +static gint forward_page_function (gint current_page, + gpointer data); + +static void name_page_changed_cb (glTemplateDesigner *dialog); + +static void pg_size_page_changed_cb (glTemplateDesigner *dialog); + +static void rect_size_page_prepare_cb (glTemplateDesigner *dialog); + +static void round_size_page_prepare_cb (glTemplateDesigner *dialog); + +static void cd_size_page_prepare_cb (glTemplateDesigner *dialog); + +static void layout_page_prepare_cb (glTemplateDesigner *dialog); + +static void layout_page_changed_cb (glTemplateDesigner *dialog); + +static void print_test_cb (glTemplateDesigner *dialog); + +static lglTemplate *build_template (glTemplateDesigner *dialog); + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glTemplateDesigner, gl_template_designer, GTK_TYPE_ASSISTANT); + +static void +gl_template_designer_class_init (glTemplateDesignerClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_TEMPLATE, ""); + + gl_template_designer_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_template_designer_finalize; +} + +static void +gl_template_designer_init (glTemplateDesigner *dialog) +{ + gl_debug (DEBUG_TEMPLATE, "START"); + + dialog->priv = g_new0 (glTemplateDesignerPrivate, 1); + + gl_debug (DEBUG_TEMPLATE, "END"); + + return; +} + +static void +gl_template_designer_finalize (GObject *object) +{ + glTemplateDesigner* dialog = GL_TEMPLATE_DESIGNER (object); + + gl_debug (DEBUG_TEMPLATE, "START"); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_TEMPLATE_DESIGNER (dialog)); + g_return_if_fail (dialog->priv != NULL); + + g_free (dialog->priv); + + G_OBJECT_CLASS (gl_template_designer_parent_class)->finalize (object); + + gl_debug (DEBUG_TEMPLATE, "END"); +} + +/*****************************************************************************/ +/* NEW preferences dialog. */ +/*****************************************************************************/ +GtkWidget* +gl_template_designer_new (GtkWindow *parent) +{ + GtkWidget *dialog; + + gl_debug (DEBUG_TEMPLATE, "START"); + + dialog = GTK_WIDGET (g_object_new (GL_TYPE_TEMPLATE_DESIGNER, NULL)); + + if (parent) + gtk_window_set_transient_for (GTK_WINDOW (dialog), parent); + + gl_template_designer_construct (GL_TEMPLATE_DESIGNER(dialog)); + + + gl_debug (DEBUG_TEMPLATE, "END"); + + return dialog; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Construct composite widget. */ +/*---------------------------------------------------------------------------*/ +static void +gl_template_designer_construct (glTemplateDesigner *dialog) +{ + GdkPixbuf *logo; + + g_return_if_fail (dialog && GL_IS_TEMPLATE_DESIGNER (dialog)); + g_return_if_fail (dialog->priv != NULL); + + /* Initialize units stuff from prefs */ + dialog->priv->units_string = gl_prefs_get_units_string (); + dialog->priv->units_per_point = gl_prefs_get_units_per_point (); + dialog->priv->climb_rate = gl_prefs_get_units_step_size (); + dialog->priv->digits = gl_prefs_get_units_precision (); + + gtk_window_set_title (GTK_WINDOW(dialog), _("gLabels Template Designer")); + + logo = gdk_pixbuf_new_from_file (ICON_PIXMAP, NULL); + + /* Costruct and append pages (must be same order as PAGE_NUM enums. */ + construct_start_page (dialog, logo); + construct_name_page (dialog, logo); + construct_pg_size_page (dialog, logo); + construct_shape_page (dialog, logo); + construct_rect_size_page (dialog, logo); + construct_round_size_page (dialog, logo); + construct_cd_size_page (dialog, logo); + construct_nlayouts_page (dialog, logo); + construct_layout_page (dialog, logo); + construct_finish_page (dialog, logo); + + gtk_assistant_set_forward_page_func (GTK_ASSISTANT (dialog), + forward_page_function, + dialog, + NULL); + + /* signals */ + g_signal_connect_swapped (G_OBJECT(dialog), "cancel", + G_CALLBACK(cancel_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog), "apply", + G_CALLBACK(apply_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog), "close", + G_CALLBACK(close_cb), dialog); + g_signal_connect (G_OBJECT(dialog), "prepare", + G_CALLBACK(prepare_cb), NULL); + + gtk_widget_show_all (GTK_WIDGET(dialog)); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct start page. */ +/*--------------------------------------------------------------------------*/ +static void +construct_start_page (glTemplateDesigner *dialog, + GdkPixbuf *logo) +{ + GladeXML *gui; + + gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", + "start_page", NULL); + if (!gui) + { + g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); + return; + } + + dialog->priv->start_page = glade_xml_get_widget (gui, "start_page"); + + g_object_unref (gui); + + + gtk_assistant_append_page (GTK_ASSISTANT (dialog), + dialog->priv->start_page); + + gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), + dialog->priv->start_page, + _("Welcome")); + gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), + dialog->priv->start_page, + logo); + gtk_assistant_set_page_type (GTK_ASSISTANT (dialog), + dialog->priv->start_page, + GTK_ASSISTANT_PAGE_INTRO); + gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), + dialog->priv->start_page, + TRUE); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct name page. */ +/*--------------------------------------------------------------------------*/ +static void +construct_name_page (glTemplateDesigner *dialog, + GdkPixbuf *logo) +{ + GladeXML *gui; + + gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", + "name_page", NULL); + if (!gui) + { + g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); + return; + } + + dialog->priv->name_page = glade_xml_get_widget (gui, "name_page"); + dialog->priv->brand_entry = glade_xml_get_widget (gui, "brand_entry"); + dialog->priv->part_num_entry = glade_xml_get_widget (gui, "part_num_entry"); + dialog->priv->name_warning_image = glade_xml_get_widget (gui, "name_warning_image"); + dialog->priv->name_warning_label = glade_xml_get_widget (gui, "name_warning_label"); + dialog->priv->description_entry = glade_xml_get_widget (gui, "description_entry"); + + g_object_unref (gui); + + + gtk_assistant_append_page (GTK_ASSISTANT (dialog), + dialog->priv->name_page); + + gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), + dialog->priv->name_page, + _("Name and Description")); + gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), + dialog->priv->name_page, + logo); + + /* Connect a handler that listens for changes in these widgets */ + /* This controls whether we can progress to the next page. */ + g_signal_connect_swapped (G_OBJECT(dialog->priv->brand_entry), "changed", + G_CALLBACK(name_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->part_num_entry), "changed", + G_CALLBACK(name_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->description_entry), "changed", + G_CALLBACK(name_page_changed_cb), dialog); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct page size page. */ +/*--------------------------------------------------------------------------*/ +static void +construct_pg_size_page (glTemplateDesigner *dialog, + GdkPixbuf *logo) +{ + GladeXML *gui; + GList *page_sizes; + const gchar *default_page_size_id; + gchar *default_page_size_name; + + gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", + "pg_size_page", NULL); + if (!gui) + { + g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); + return; + } + + dialog->priv->pg_size_page = glade_xml_get_widget (gui, "pg_size_page"); + dialog->priv->pg_size_combo = glade_xml_get_widget (gui, "pg_size_combo"); + dialog->priv->pg_w_spin = glade_xml_get_widget (gui, "pg_w_spin"); + dialog->priv->pg_h_spin = glade_xml_get_widget (gui, "pg_h_spin"); + dialog->priv->pg_w_units_label = glade_xml_get_widget (gui, "pg_w_units_label"); + dialog->priv->pg_h_units_label = glade_xml_get_widget (gui, "pg_h_units_label"); + + g_object_unref (gui); + + + gl_util_combo_box_add_text_model (GTK_COMBO_BOX (dialog->priv->pg_size_combo)); + + gtk_assistant_append_page (GTK_ASSISTANT (dialog), + dialog->priv->pg_size_page); + + gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), + dialog->priv->pg_size_page, + _("Page Size")); + gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), + dialog->priv->pg_size_page, + logo); + gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), + dialog->priv->pg_size_page, + TRUE); + + /* Load page size combo */ + page_sizes = lgl_db_get_paper_name_list (); + gl_util_combo_box_set_strings (GTK_COMBO_BOX (dialog->priv->pg_size_combo), page_sizes); + lgl_db_free_paper_name_list (page_sizes); + default_page_size_id = gl_prefs_get_page_size (); + default_page_size_name = lgl_db_lookup_paper_name_from_id (default_page_size_id); + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (dialog->priv->pg_size_combo), default_page_size_name); + g_free (default_page_size_name); + + /* Apply units to spinbuttons and units labels. */ + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->pg_w_units_label), + dialog->priv->units_string); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->pg_w_spin), + 0.0, MAX_PAGE_DIM_POINTS*dialog->priv->units_per_point); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->pg_h_units_label), + dialog->priv->units_string); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->pg_h_spin), + 0.0, MAX_PAGE_DIM_POINTS*dialog->priv->units_per_point); + + /* Connect a handler that listens for changes in these widgets */ + /* This controls sensitivity of related widgets. */ + g_signal_connect_swapped (G_OBJECT(dialog->priv->pg_size_combo), "changed", + G_CALLBACK(pg_size_page_changed_cb), dialog); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct shape page. */ +/*--------------------------------------------------------------------------*/ +static void +construct_shape_page (glTemplateDesigner *dialog, + GdkPixbuf *logo) +{ + GladeXML *gui; + + gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", + "shape_page", NULL); + if (!gui) + { + g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); + return; + } + + dialog->priv->shape_page = glade_xml_get_widget (gui, "shape_page"); + dialog->priv->shape_rect_radio = glade_xml_get_widget (gui, "shape_rect_radio"); + dialog->priv->shape_round_radio = glade_xml_get_widget (gui, "shape_round_radio"); + dialog->priv->shape_cd_radio = glade_xml_get_widget (gui, "shape_cd_radio"); + + g_object_unref (gui); + + + gtk_assistant_append_page (GTK_ASSISTANT (dialog), + dialog->priv->shape_page); + + gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), + dialog->priv->shape_page, + _("Label or Card Shape")); + gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), + dialog->priv->shape_page, + logo); + gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), + dialog->priv->shape_page, + TRUE); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct rect size page. */ +/*--------------------------------------------------------------------------*/ +static void +construct_rect_size_page (glTemplateDesigner *dialog, + GdkPixbuf *logo) +{ + GladeXML *gui; + GdkPixbuf *pixbuf; + + gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", + "rect_size_page", NULL); + if (!gui) + { + g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); + return; + } + + dialog->priv->rect_size_page = glade_xml_get_widget (gui, "rect_size_page"); + dialog->priv->rect_image = glade_xml_get_widget (gui, "rect_image"); + dialog->priv->rect_w_spin = glade_xml_get_widget (gui, "rect_w_spin"); + dialog->priv->rect_h_spin = glade_xml_get_widget (gui, "rect_h_spin"); + dialog->priv->rect_r_spin = glade_xml_get_widget (gui, "rect_r_spin"); + dialog->priv->rect_x_waste_spin = glade_xml_get_widget (gui, "rect_x_waste_spin"); + dialog->priv->rect_y_waste_spin = glade_xml_get_widget (gui, "rect_y_waste_spin"); + dialog->priv->rect_margin_spin = glade_xml_get_widget (gui, "rect_margin_spin"); + dialog->priv->rect_w_units_label = glade_xml_get_widget (gui, "rect_w_units_label"); + dialog->priv->rect_h_units_label = glade_xml_get_widget (gui, "rect_h_units_label"); + dialog->priv->rect_r_units_label = glade_xml_get_widget (gui, "rect_r_units_label"); + dialog->priv->rect_x_waste_units_label = glade_xml_get_widget (gui, "rect_x_waste_units_label"); + dialog->priv->rect_y_waste_units_label = glade_xml_get_widget (gui, "rect_y_waste_units_label"); + dialog->priv->rect_margin_units_label = glade_xml_get_widget (gui, "rect_margin_units_label"); + + g_object_unref (gui); + + + gtk_assistant_append_page (GTK_ASSISTANT (dialog), + dialog->priv->rect_size_page); + + gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), + dialog->priv->rect_size_page, + _("Label or Card Size")); + gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), + dialog->priv->rect_size_page, + logo); + gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), + dialog->priv->rect_size_page, + TRUE); + + /* Initialize illustration. */ + pixbuf = gdk_pixbuf_new_from_file (EX_RECT_IMAGE, NULL); + gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->rect_image), pixbuf); + + /* Apply units to spinbuttons and units labels. */ + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->rect_w_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->rect_h_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->rect_r_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->rect_x_waste_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->rect_y_waste_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->rect_margin_units_label), + dialog->priv->units_string); + + /* Load some realistic defaults. */ + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin), + DEFAULT_RECT_W * dialog->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin), + DEFAULT_RECT_H * dialog->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin), + DEFAULT_RECT_R * dialog->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin), + DEFAULT_RECT_WASTE * dialog->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin), + DEFAULT_RECT_WASTE * dialog->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin), + DEFAULT_MARGIN * dialog->priv->units_per_point); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct round size page. */ +/*--------------------------------------------------------------------------*/ +static void +construct_round_size_page (glTemplateDesigner *dialog, + GdkPixbuf *logo) +{ + GladeXML *gui; + GdkPixbuf *pixbuf; + + gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", + "round_size_page", NULL); + if (!gui) + { + g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); + return; + } + + dialog->priv->round_size_page = glade_xml_get_widget (gui, "round_size_page"); + dialog->priv->round_image = glade_xml_get_widget (gui, "round_image"); + dialog->priv->round_r_spin = glade_xml_get_widget (gui, "round_r_spin"); + dialog->priv->round_waste_spin = glade_xml_get_widget (gui, "round_waste_spin"); + dialog->priv->round_margin_spin = glade_xml_get_widget (gui, "round_margin_spin"); + dialog->priv->round_r_units_label = glade_xml_get_widget (gui, "round_r_units_label"); + dialog->priv->round_waste_units_label = glade_xml_get_widget (gui, "round_waste_units_label"); + dialog->priv->round_margin_units_label = glade_xml_get_widget (gui, "round_margin_units_label"); + + g_object_unref (gui); + + + gtk_assistant_append_page (GTK_ASSISTANT (dialog), + dialog->priv->round_size_page); + + gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), + dialog->priv->round_size_page, + _("Label Size (round)")); + gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), + dialog->priv->round_size_page, + logo); + gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), + dialog->priv->round_size_page, + TRUE); + + /* Initialize illustration. */ + pixbuf = gdk_pixbuf_new_from_file (EX_ROUND_IMAGE, NULL); + gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->round_image), pixbuf); + + /* Apply units to spinbuttons and units labels. */ + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->round_r_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->round_r_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->round_r_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->round_waste_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->round_margin_units_label), + dialog->priv->units_string); + + /* Load some realistic defaults. */ + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin), + DEFAULT_ROUND_R * dialog->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin), + DEFAULT_ROUND_WASTE * dialog->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin), + DEFAULT_MARGIN * dialog->priv->units_per_point); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct CD/DVD size page. */ +/*--------------------------------------------------------------------------*/ +static void +construct_cd_size_page (glTemplateDesigner *dialog, + GdkPixbuf *logo) +{ + GladeXML *gui; + GdkPixbuf *pixbuf; + + gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", + "cd_size_page", NULL); + if (!gui) + { + g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); + return; + } + + dialog->priv->cd_size_page = glade_xml_get_widget (gui, "cd_size_page"); + dialog->priv->cd_image = glade_xml_get_widget (gui, "cd_image"); + dialog->priv->cd_radius_spin = glade_xml_get_widget (gui, "cd_radius_spin"); + dialog->priv->cd_hole_spin = glade_xml_get_widget (gui, "cd_hole_spin"); + dialog->priv->cd_w_spin = glade_xml_get_widget (gui, "cd_w_spin"); + dialog->priv->cd_h_spin = glade_xml_get_widget (gui, "cd_h_spin"); + dialog->priv->cd_waste_spin = glade_xml_get_widget (gui, "cd_waste_spin"); + dialog->priv->cd_margin_spin = glade_xml_get_widget (gui, "cd_margin_spin"); + dialog->priv->cd_radius_units_label = glade_xml_get_widget (gui, "cd_radius_units_label"); + dialog->priv->cd_hole_units_label = glade_xml_get_widget (gui, "cd_hole_units_label"); + dialog->priv->cd_w_units_label = glade_xml_get_widget (gui, "cd_w_units_label"); + dialog->priv->cd_h_units_label = glade_xml_get_widget (gui, "cd_h_units_label"); + dialog->priv->cd_waste_units_label = glade_xml_get_widget (gui, "cd_waste_units_label"); + dialog->priv->cd_margin_units_label = glade_xml_get_widget (gui, "cd_margin_units_label"); + + g_object_unref (gui); + + + gtk_assistant_append_page (GTK_ASSISTANT (dialog), + dialog->priv->cd_size_page); + + gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), + dialog->priv->cd_size_page, + _("Label Size (CD/DVD)")); + gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), + dialog->priv->cd_size_page, + logo); + gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), + dialog->priv->cd_size_page, + TRUE); + + /* Initialize illustration. */ + pixbuf = gdk_pixbuf_new_from_file (EX_CD_IMAGE, NULL); + gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->cd_image), pixbuf); + + /* Apply units to spinbuttons and units labels. */ + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->cd_radius_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->cd_hole_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_w_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_w_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->cd_w_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_h_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_h_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->cd_h_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->cd_waste_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->cd_margin_units_label), + dialog->priv->units_string); + + /* Load some realistic defaults. */ + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin), + DEFAULT_CD_RADIUS * dialog->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin), + DEFAULT_CD_HOLE * dialog->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin), + DEFAULT_CD_WASTE * dialog->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin), + DEFAULT_MARGIN * dialog->priv->units_per_point); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct number of layouts page. */ +/*--------------------------------------------------------------------------*/ +static void +construct_nlayouts_page (glTemplateDesigner *dialog, + GdkPixbuf *logo) +{ + GladeXML *gui; + GdkPixbuf *pixbuf; + + gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", + "nlayouts_page", NULL); + if (!gui) + { + g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); + return; + } + + dialog->priv->nlayouts_page = glade_xml_get_widget (gui, "nlayouts_page"); + dialog->priv->nlayouts_image1 = glade_xml_get_widget (gui, "nlayouts_image1"); + dialog->priv->nlayouts_image2 = glade_xml_get_widget (gui, "nlayouts_image2"); + dialog->priv->nlayouts_spin = glade_xml_get_widget (gui, "nlayouts_spin"); + + g_object_unref (gui); + + + gtk_assistant_append_page (GTK_ASSISTANT (dialog), + dialog->priv->nlayouts_page); + + gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), + dialog->priv->nlayouts_page, + _("Number of Layouts")); + gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), + dialog->priv->nlayouts_page, + logo); + gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), + dialog->priv->nlayouts_page, + TRUE); + + /* Initialize illustrations. */ + pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE1, NULL); + gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->nlayouts_image1), pixbuf); + pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE2, NULL); + gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->nlayouts_image2), pixbuf); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct layout page. */ +/*--------------------------------------------------------------------------*/ +static void +construct_layout_page (glTemplateDesigner *dialog, + GdkPixbuf *logo) +{ + GladeXML *gui; + + gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", + "layout_page", NULL); + if (!gui) + { + g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); + return; + } + + dialog->priv->layout_page = glade_xml_get_widget (gui, "layout_page"); + dialog->priv->layout1_head_label = glade_xml_get_widget (gui, "layout1_head_label"); + dialog->priv->layout1_nx_spin = glade_xml_get_widget (gui, "layout1_nx_spin"); + dialog->priv->layout1_ny_spin = glade_xml_get_widget (gui, "layout1_ny_spin"); + dialog->priv->layout1_x0_spin = glade_xml_get_widget (gui, "layout1_x0_spin"); + dialog->priv->layout1_y0_spin = glade_xml_get_widget (gui, "layout1_y0_spin"); + dialog->priv->layout1_dx_spin = glade_xml_get_widget (gui, "layout1_dx_spin"); + dialog->priv->layout1_dy_spin = glade_xml_get_widget (gui, "layout1_dy_spin"); + dialog->priv->layout2_head_label = glade_xml_get_widget (gui, "layout2_head_label"); + dialog->priv->layout2_nx_spin = glade_xml_get_widget (gui, "layout2_nx_spin"); + dialog->priv->layout2_ny_spin = glade_xml_get_widget (gui, "layout2_ny_spin"); + dialog->priv->layout2_x0_spin = glade_xml_get_widget (gui, "layout2_x0_spin"); + dialog->priv->layout2_y0_spin = glade_xml_get_widget (gui, "layout2_y0_spin"); + dialog->priv->layout2_dx_spin = glade_xml_get_widget (gui, "layout2_dx_spin"); + dialog->priv->layout2_dy_spin = glade_xml_get_widget (gui, "layout2_dy_spin"); + dialog->priv->layout_x0_units_label = glade_xml_get_widget (gui, "layout_x0_units_label"); + dialog->priv->layout_y0_units_label = glade_xml_get_widget (gui, "layout_y0_units_label"); + dialog->priv->layout_dx_units_label = glade_xml_get_widget (gui, "layout_dx_units_label"); + dialog->priv->layout_dy_units_label = glade_xml_get_widget (gui, "layout_dy_units_label"); + dialog->priv->layout_mini_preview = glade_xml_get_widget (gui, "layout_mini_preview"); + dialog->priv->layout_test_button = glade_xml_get_widget (gui, "layout_test_button"); + + g_object_unref (gui); + + + gtk_assistant_append_page (GTK_ASSISTANT (dialog), + dialog->priv->layout_page); + + gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), + dialog->priv->layout_page, + _("Layout(s)")); + gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), + dialog->priv->layout_page, + logo); + gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), + dialog->priv->layout_page, + TRUE); + + /* Apply units to spinbuttons and units labels. */ + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout1_x0_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout1_x0_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout2_x0_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout2_x0_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->layout_x0_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout1_y0_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout1_y0_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout2_y0_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout2_y0_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->layout_y0_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout1_dx_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout1_dx_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout2_dx_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout2_dx_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->layout_dx_units_label), + dialog->priv->units_string); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout1_dy_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout1_dy_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON(dialog->priv->layout2_dy_spin), + dialog->priv->digits); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON(dialog->priv->layout2_dy_spin), + dialog->priv->climb_rate, 10.0*dialog->priv->climb_rate); + gtk_label_set_text (GTK_LABEL(dialog->priv->layout_dy_units_label), + dialog->priv->units_string); + + /* Connect a handler that listens for changes in these widgets */ + /* This controls sensitivity of related widgets. */ + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_nx_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_ny_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_x0_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_y0_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_dx_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout1_dy_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_nx_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_ny_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_x0_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_y0_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_dx_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout2_dy_spin), "changed", + G_CALLBACK(layout_page_changed_cb), dialog); + + + /* Print button */ + g_signal_connect_swapped (G_OBJECT(dialog->priv->layout_test_button), "clicked", + G_CALLBACK(print_test_cb), dialog); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct finish page. */ +/*--------------------------------------------------------------------------*/ +static void +construct_finish_page (glTemplateDesigner *dialog, + GdkPixbuf *logo) +{ + GladeXML *gui; + + gui = glade_xml_new (GLABELS_GLADE_DIR "template-designer.glade", + "finish_page", NULL); + if (!gui) + { + g_critical ("Could not open template-designer.glade. gLabels may not be installed correctly!"); + return; + } + + dialog->priv->finish_page = glade_xml_get_widget (gui, "finish_page"); + + g_object_unref (gui); + + + gtk_assistant_append_page (GTK_ASSISTANT (dialog), + dialog->priv->finish_page); + + gtk_assistant_set_page_title (GTK_ASSISTANT (dialog), + dialog->priv->finish_page, + _("Design Completed")); + gtk_assistant_set_page_header_image (GTK_ASSISTANT (dialog), + dialog->priv->finish_page, + logo); + gtk_assistant_set_page_type (GTK_ASSISTANT (dialog), + dialog->priv->finish_page, + GTK_ASSISTANT_PAGE_CONFIRM); + gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), + dialog->priv->finish_page, + TRUE); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. cancel callback. */ +/*--------------------------------------------------------------------------*/ +static void +cancel_cb (glTemplateDesigner *dialog) +{ + + gtk_widget_destroy (GTK_WIDGET(dialog)); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. apply callback */ +/*--------------------------------------------------------------------------*/ +static void +apply_cb (glTemplateDesigner *dialog) +{ + lglTemplate *template; + gchar *name; + + template = build_template (dialog); + lgl_db_register_template (template); + name = lgl_template_get_name (template); + gl_mini_preview_pixbuf_cache_add_by_name (name); + g_free (name); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. close callback */ +/*--------------------------------------------------------------------------*/ +static void +close_cb (glTemplateDesigner *dialog) +{ + + gtk_widget_destroy (GTK_WIDGET(dialog)); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. prepare page callback */ +/*--------------------------------------------------------------------------*/ +static void +prepare_cb (glTemplateDesigner *dialog, + GtkWidget *page) +{ + gint page_num; + + page_num = gtk_assistant_get_current_page (GTK_ASSISTANT (dialog)); + + switch (page_num) + { + + case NAME_PAGE_NUM: + name_page_changed_cb (dialog); /* Use to prepare */ + break; + + case PG_SIZE_PAGE_NUM: + pg_size_page_changed_cb (dialog); /* Use to prepare */ + break; + + case RECT_SIZE_PAGE_NUM: + rect_size_page_prepare_cb (dialog); + break; + + case ROUND_SIZE_PAGE_NUM: + round_size_page_prepare_cb (dialog); + break; + + case CD_SIZE_PAGE_NUM: + cd_size_page_prepare_cb (dialog); + break; + + case LAYOUT_PAGE_NUM: + layout_page_prepare_cb (dialog); + break; + + default: + /* No preparation needed */ + break; + + } +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Handle non-linear forward traversal. */ +/*--------------------------------------------------------------------------*/ +static gint +forward_page_function (gint current_page, + gpointer data) +{ + glTemplateDesigner *dialog = GL_TEMPLATE_DESIGNER (data); + + switch (current_page) + { + case START_PAGE_NUM: + return NAME_PAGE_NUM; + + case NAME_PAGE_NUM: + return PG_SIZE_PAGE_NUM; + + case PG_SIZE_PAGE_NUM: + return SHAPE_PAGE_NUM; + + case SHAPE_PAGE_NUM: + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_rect_radio))) { + return RECT_SIZE_PAGE_NUM; + } + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_round_radio))) { + return ROUND_SIZE_PAGE_NUM; + } + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_cd_radio))) { + return CD_SIZE_PAGE_NUM; + } + break; + + case RECT_SIZE_PAGE_NUM: + case ROUND_SIZE_PAGE_NUM: + case CD_SIZE_PAGE_NUM: + return NLAYOUTS_PAGE_NUM; + + case NLAYOUTS_PAGE_NUM: + return LAYOUT_PAGE_NUM; + + case LAYOUT_PAGE_NUM: + return FINISH_PAGE_NUM; + + case FINISH_PAGE_NUM: + default: + return -1; + } + + return -1; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Widget on name page "changed" callback. */ +/*--------------------------------------------------------------------------*/ +static void +name_page_changed_cb (glTemplateDesigner *dialog) +{ + gchar *brand, *part_num, *desc; + + brand = g_strstrip (gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->brand_entry), 0, -1)); + part_num = g_strstrip (gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->part_num_entry), 0, -1)); + desc = gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->description_entry), 0, -1); + + + if (brand && brand[0] && part_num && part_num[0] && + lgl_db_does_template_exist (brand, part_num)) + { + gtk_image_set_from_stock (GTK_IMAGE (dialog->priv->name_warning_image), + GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_BUTTON); + gtk_label_set_markup (GTK_LABEL (dialog->priv->name_warning_label), + _("Brand and part# match an existing template!")); + } + else + { + gtk_image_clear (GTK_IMAGE (dialog->priv->name_warning_image)); + gtk_label_set_text (GTK_LABEL (dialog->priv->name_warning_label), ""); + } + + if (brand && brand[0] && part_num && part_num[0] && desc && desc[0] && + !lgl_db_does_template_exist (brand, part_num)) + { + + gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), + dialog->priv->name_page, + TRUE); + } + else + { + + gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog), + dialog->priv->name_page, + FALSE); + } + + g_free (brand); + g_free (part_num); + g_free (desc); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Widget on page size page "changed" callback. */ +/*--------------------------------------------------------------------------*/ +static void +pg_size_page_changed_cb (glTemplateDesigner *dialog) +{ + gchar *page_size_name; + lglPaper *paper; + + + page_size_name = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->pg_size_combo)); + + if (page_size_name && strlen(page_size_name)) { + + paper = lgl_db_lookup_paper_from_name (page_size_name); + + + if ( g_strcasecmp (paper->id, "Other") == 0 ) { + gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_w_spin), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_h_spin), TRUE); + gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_w_units_label), + TRUE); + gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_h_units_label), + TRUE); + + } else { + gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_w_spin), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_h_spin), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_w_units_label), + FALSE); + gtk_widget_set_sensitive (GTK_WIDGET(dialog->priv->pg_h_units_label), + FALSE); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin), + paper->width * dialog->priv->units_per_point); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin), + paper->height * dialog->priv->units_per_point); + } + + lgl_paper_free (paper); + } + + g_free (page_size_name); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare rectangular size page. */ +/*--------------------------------------------------------------------------*/ +static void +rect_size_page_prepare_cb (glTemplateDesigner *dialog) +{ + gdouble max_w, max_h; + gdouble w, h, r, x_waste, y_waste, margin; + + /* Limit label size based on already chosen page size. */ + max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin)); + max_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin)); + + w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin)); + h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin)); + r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin)); + x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin)); + y_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin)); + margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin)); + + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_w_spin), + dialog->priv->climb_rate, max_w); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_h_spin), + dialog->priv->climb_rate, max_h); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_r_spin), + 0.0, MIN(max_w, max_h)/2.0); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_x_waste_spin), + 0.0, MIN(max_w, max_h)/4.0); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_y_waste_spin), + 0.0, MIN(max_w, max_h)/4.0); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->rect_margin_spin), + 0.0, MIN(max_w, max_h)/4.0); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin), w); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin), h); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin), r); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin), x_waste); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin), y_waste); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin), margin); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare round size page. */ +/*--------------------------------------------------------------------------*/ +static void +round_size_page_prepare_cb (glTemplateDesigner *dialog) +{ + gdouble max_w, max_h; + gdouble r, waste, margin; + + /* Limit label size based on already chosen page size. */ + max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin)); + max_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin)); + + r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin)); + waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin)); + margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin)); + + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->round_r_spin), + dialog->priv->climb_rate, MIN(max_w, max_h)/2.0); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->round_waste_spin), + 0.0, MIN(max_w, max_h)/4.0); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->round_margin_spin), + 0.0, MIN(max_w, max_h)/4.0); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin), r); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin), waste); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin), margin); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare cd/dvd size page. */ +/*--------------------------------------------------------------------------*/ +static void +cd_size_page_prepare_cb (glTemplateDesigner *dialog) +{ + gdouble max_w, max_h; + gdouble radius, hole, w, h, waste, margin; + + /* Limit label size based on already chosen page size. */ + max_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin)); + max_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin)); + + radius = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin)); + hole = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin)); + w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_w_spin)); + h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_h_spin)); + waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin)); + margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin)); + + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_radius_spin), + dialog->priv->climb_rate, MIN(max_w, max_h)/2.0); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_hole_spin), + dialog->priv->climb_rate, MIN(max_w, max_h)/2.0); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_w_spin), + 0.0, max_w); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_h_spin), + 0.0, max_h); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_waste_spin), + 0.0, MIN(max_w, max_h)/4.0); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->cd_margin_spin), + 0.0, MIN(max_w, max_h)/4.0); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin), radius); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin), hole); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_w_spin), w); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_h_spin), h); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin), waste); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin), margin); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Prepare Layout page cb. */ +/*--------------------------------------------------------------------------*/ +static void +layout_page_prepare_cb (glTemplateDesigner *dialog) +{ + gdouble page_w, page_h; + gdouble w=0, h=0, x_waste=0, y_waste=0; + gint max_nx, max_ny; + gint nlayouts; + gdouble nx_1, ny_1, x0_1, y0_1, dx_1, dy_1; + gdouble nx_2, ny_2, x0_2, y0_2, dx_2, dy_2; + lglTemplate *template; + + if (dialog->priv->stop_signals) return; + dialog->priv->stop_signals = TRUE; + + + /* Limit ranges based on already chosen page and label sizes. */ + page_w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin)); + page_h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin)); + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_rect_radio))) { + w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin)); + h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin)); + x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin)); + y_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin)); + } + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_round_radio))) { + w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin)); + h = w; + x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin)); + y_waste = x_waste; + } + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_cd_radio))) { + w = 2*gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin)); + h = w; + x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin)); + y_waste = x_waste; + } + max_nx = MAX (floor (page_w/(w + 2*x_waste) + DELTA), 1.0); + max_ny = MAX (floor (page_h/(h + 2*y_waste) + DELTA), 1.0); + + nx_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_nx_spin)); + ny_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_ny_spin)); + x0_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_x0_spin)); + y0_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_y0_spin)); + dx_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dx_spin)); + dy_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dy_spin)); + nx_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_nx_spin)); + ny_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_ny_spin)); + x0_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_x0_spin)); + y0_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_y0_spin)); + dx_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dx_spin)); + dy_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dy_spin)); + + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_nx_spin), + 1, max_nx); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_ny_spin), + 1, max_ny); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_x0_spin), + x_waste, page_w - w - x_waste); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_y0_spin), + y_waste, page_h - h - y_waste); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_dx_spin), + w + 2*x_waste, page_w - w - 2*x_waste); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout1_dy_spin), + h + 2*y_waste, page_h - h - 2*y_waste); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_nx_spin), + 1, max_nx); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_ny_spin), + 1, max_ny); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_x0_spin), + x_waste, page_w - w - x_waste); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_y0_spin), + y_waste, page_h - h - y_waste); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_dx_spin), + w + 2*x_waste, page_w - w - 2*x_waste); + gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->priv->layout2_dy_spin), + h + 2*y_waste, page_h - h - 2*y_waste); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_nx_spin), nx_1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_ny_spin), ny_1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_x0_spin), x0_1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_y0_spin), y0_1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dx_spin), dx_1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dy_spin), dy_1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_nx_spin), nx_2); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_ny_spin), ny_2); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_x0_spin), x0_2); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_y0_spin), y0_2); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dx_spin), dx_2); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dy_spin), dy_2); + + /* Set visibility of layout2 widgets as appropriate. */ + nlayouts = gtk_spin_button_get_value (GTK_SPIN_BUTTON (dialog->priv->nlayouts_spin)); + if ( nlayouts == 1 ) + { + gtk_widget_hide (dialog->priv->layout1_head_label); + gtk_widget_hide (dialog->priv->layout2_head_label); + gtk_widget_hide (dialog->priv->layout2_nx_spin); + gtk_widget_hide (dialog->priv->layout2_ny_spin); + gtk_widget_hide (dialog->priv->layout2_x0_spin); + gtk_widget_hide (dialog->priv->layout2_y0_spin); + gtk_widget_hide (dialog->priv->layout2_dx_spin); + gtk_widget_hide (dialog->priv->layout2_dy_spin); + } + else + { + gtk_widget_show (dialog->priv->layout1_head_label); + gtk_widget_show (dialog->priv->layout2_head_label); + gtk_widget_show (dialog->priv->layout2_nx_spin); + gtk_widget_show (dialog->priv->layout2_ny_spin); + gtk_widget_show (dialog->priv->layout2_x0_spin); + gtk_widget_show (dialog->priv->layout2_y0_spin); + gtk_widget_show (dialog->priv->layout2_dx_spin); + gtk_widget_show (dialog->priv->layout2_dy_spin); + } + + template = build_template (dialog); + gl_wdgt_mini_preview_set_template (GL_WDGT_MINI_PREVIEW(dialog->priv->layout_mini_preview), + template); + lgl_template_free (template); + + + dialog->priv->stop_signals = FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Layout page widget changed cb. */ +/*--------------------------------------------------------------------------*/ +static void +layout_page_changed_cb (glTemplateDesigner *dialog) +{ + lglTemplate *template; + + if (dialog->priv->stop_signals) return; + dialog->priv->stop_signals = TRUE; + + template = build_template (dialog); + + gl_wdgt_mini_preview_set_template (GL_WDGT_MINI_PREVIEW(dialog->priv->layout_mini_preview), + template); + + lgl_template_free (template); + + dialog->priv->stop_signals = FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Print test sheet callback. */ +/*--------------------------------------------------------------------------*/ +static void +print_test_cb (glTemplateDesigner *dialog) +{ + GObject *label; + lglTemplate *template; + glPrintOp *print_op; + + label = gl_label_new (); + + template = build_template (dialog); + gl_label_set_template (GL_LABEL(label), template); + + print_op = gl_print_op_new (GL_LABEL(label)); + gl_print_op_force_outline_flag (print_op); + gtk_print_operation_run (GTK_PRINT_OPERATION (print_op), + GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, + GTK_WINDOW (dialog), + NULL); + + lgl_template_free (template); + g_object_unref (G_OBJECT(label)); +} + +/*--------------------------------------------------------------------------*/ +/* Build a template based on current assistant settings. */ +/*--------------------------------------------------------------------------*/ +static lglTemplate * +build_template (glTemplateDesigner *dialog) +{ + gdouble upp; + gchar *brand, *part_num, *desc; + gchar *page_size_name; + lglPaper *paper; + lglTemplateFrameShape shape; + lglTemplateFrame *frame=NULL; + gdouble w=0, h=0, r=0, radius=0, hole=0, waste=0, x_waste=0, y_waste=0, margin=0; + gint nlayouts; + gdouble nx_1, ny_1, x0_1, y0_1, dx_1, dy_1; + gdouble nx_2, ny_2, x0_2, y0_2, dx_2, dy_2; + lglTemplate *template; + + upp = dialog->priv->units_per_point; + + brand = g_strstrip (gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->brand_entry), 0, -1)); + part_num = g_strstrip (gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->part_num_entry), 0, -1)); + desc = gtk_editable_get_chars (GTK_EDITABLE(dialog->priv->description_entry), 0, -1); + + page_size_name = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (dialog->priv->pg_size_combo)); + paper = lgl_db_lookup_paper_from_name (page_size_name); + if ( g_strcasecmp (paper->id, "Other") == 0 ) { + paper->width = + gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_w_spin)) + / upp; + paper->height = + gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->pg_h_spin)) + / upp; + } + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_rect_radio))) { + shape = LGL_TEMPLATE_FRAME_SHAPE_RECT; + w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_w_spin)); + h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_h_spin)); + r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_r_spin)); + x_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_x_waste_spin)); + y_waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_y_waste_spin)); + margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->rect_margin_spin)); + } + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_round_radio))) { + shape = LGL_TEMPLATE_FRAME_SHAPE_ROUND; + r = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_r_spin)); + waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_waste_spin)); + margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->round_margin_spin)); + } + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->priv->shape_cd_radio))) { + shape = LGL_TEMPLATE_FRAME_SHAPE_CD; + radius = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_radius_spin)); + hole = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_hole_spin)); + w = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_w_spin)); + h = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_h_spin)); + waste = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_waste_spin)); + margin = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->cd_margin_spin)); + } + + nlayouts = gtk_spin_button_get_value (GTK_SPIN_BUTTON (dialog->priv->nlayouts_spin)); + nx_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_nx_spin)); + ny_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_ny_spin)); + x0_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_x0_spin)); + y0_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_y0_spin)); + dx_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dx_spin)); + dy_1 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout1_dy_spin)); + nx_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_nx_spin)); + ny_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_ny_spin)); + x0_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_x0_spin)); + y0_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_y0_spin)); + dx_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dx_spin)); + dy_2 = gtk_spin_button_get_value (GTK_SPIN_BUTTON(dialog->priv->layout2_dy_spin)); + + + template = lgl_template_new (brand, part_num, desc, paper->id, paper->width, paper->height); + + switch (shape) { + case LGL_TEMPLATE_FRAME_SHAPE_RECT: + frame = lgl_template_frame_rect_new ("0", + w/upp, h/upp, r/upp, + x_waste/upp, y_waste/upp); + break; + case LGL_TEMPLATE_FRAME_SHAPE_ROUND: + frame = lgl_template_frame_round_new ("0", r/upp, waste/upp); + break; + case LGL_TEMPLATE_FRAME_SHAPE_CD: + frame = lgl_template_frame_cd_new ("0", + radius/upp, hole/upp, + w/upp, h/upp, + waste/upp); + break; + } + lgl_template_add_frame (template, frame); + + lgl_template_frame_add_markup (frame, + lgl_template_markup_margin_new (margin/upp)); + + lgl_template_frame_add_layout (frame, + lgl_template_layout_new (nx_1, ny_1, + x0_1/upp, + y0_1/upp, + dx_1/upp, + dy_1/upp)); + if (nlayouts > 1) { + lgl_template_frame_add_layout (frame, + lgl_template_layout_new (nx_2, ny_2, + x0_2/upp, + y0_2/upp, + dx_2/upp, + dy_2/upp)); + } + + g_free (brand); + g_free (part_num); + g_free (desc); + + g_free (page_size_name); + lgl_paper_free (paper); + + return template; +} + +/*****************************************************************************/ +/* Construct mini preview widget. */ +/*****************************************************************************/ +GtkWidget * +gl_template_designer_construct_mini_preview (gchar *name, + gchar *string1, + gchar *string2, + gint int1, + gint int2) +{ + gint width = int1; + gint height = int2; + + return gl_wdgt_mini_preview_new (height, width); +} + diff --git a/src/template-designer.h b/src/template-designer.h new file mode 100644 index 00000000..bf5086ae --- /dev/null +++ b/src/template-designer.h @@ -0,0 +1,73 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * template-designer.h: Template designer module header file + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __TEMPLATE_DESIGNER_H__ +#define __TEMPLATE_DESIGNER_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GL_TYPE_TEMPLATE_DESIGNER (gl_template_designer_get_type ()) +#define GL_TEMPLATE_DESIGNER(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_TEMPLATE_DESIGNER, glTemplateDesigner)) +#define GL_TEMPLATE_DESIGNER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_TEMPLATE_DESIGNER, glTemplateDesignerClass)) +#define GL_IS_TEMPLATE_DESIGNER(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_TEMPLATE_DESIGNER)) +#define GL_IS_TEMPLATE_DESIGNER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_TEMPLATE_DESIGNER)) +#define GL_TEMPLATE_DESIGNER_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_TEMPLATE_DESIGNER, glTemplateDesignerClass)) + + +typedef struct _glTemplateDesigner glTemplateDesigner; +typedef struct _glTemplateDesignerClass glTemplateDesignerClass; + +typedef struct _glTemplateDesignerPrivate glTemplateDesignerPrivate; + +struct _glTemplateDesigner +{ + GtkAssistant parent_instance; + + glTemplateDesignerPrivate *priv; + +}; + +struct _glTemplateDesignerClass +{ + GtkAssistantClass parent_class; +}; + +GType gl_template_designer_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_template_designer_new (GtkWindow *parent); + +/* Semi-public, for use by libglade: */ +GtkWidget *gl_template_designer_construct_mini_preview (gchar *name, + gchar *string1, + gchar *string2, + gint int1, + gint int2); + + +G_END_DECLS + +#endif /* __TEMPLATE_DESIGNER_H__ */ diff --git a/src/text-node.c b/src/text-node.c new file mode 100644 index 00000000..7a77fbd6 --- /dev/null +++ b/src/text-node.c @@ -0,0 +1,356 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * text_node.c: text node module + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "text-node.h" + +#include + +#include "merge.h" + +#include "debug.h" + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static glTextNode *extract_text_node (gchar *text, + gint *n); + +static gboolean is_empty_field (glTextNode *text_node, + glMergeRecord *record); + + +/****************************************************************************/ +/* Expand single node into representative string. */ +/****************************************************************************/ +gchar * +gl_text_node_expand (glTextNode *text_node, + glMergeRecord *record) +{ + gchar *text; + + if (text_node->field_flag) { + if (record == NULL) { + return g_strdup_printf ("${%s}", text_node->data); + } else { + text = gl_merge_eval_key (record, text_node->data); + if (text != NULL) { + return text; + } else { + return g_strdup_printf ("%s", ""); + } + } + } else { + return g_strdup (text_node->data); + } +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Is node a field that evaluates empty? */ +/*--------------------------------------------------------------------------*/ +static gboolean +is_empty_field (glTextNode *text_node, + glMergeRecord *record) +{ + gchar *text; + gboolean ret = FALSE; + + if ( (record != NULL) && text_node->field_flag) { + text = gl_merge_eval_key (record, text_node->data); + if ( (text == NULL) || (text[0] == 0) ) { + ret = TRUE; + } + g_free (text); + } + + return ret; +} + +/****************************************************************************/ +/* Create a single text node from given text. */ +/****************************************************************************/ +glTextNode * +gl_text_node_new_from_text (gchar *text) +{ + gint n; + + return extract_text_node (text, &n); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Create a single text node from given text. n = characters used */ +/*--------------------------------------------------------------------------*/ +static glTextNode * +extract_text_node (gchar *text, + gint *n) +{ + glTextNode *text_node; + gchar *p; + gint m; + + text_node = g_new0 (glTextNode, 1); + + if (strncmp (text, "${", strlen ("${")) == 0) { + /* We are at the beginning of a "FIELD" node */ + text_node->field_flag = TRUE; + *n = strlen ("${"); + text += *n; + for (p = text, m = 0; *p != 0; p++, m++, (*n)++) { + if (*p == '}') { + (*n)++; + break; + } + } + text_node->data = g_strndup (text, m); + } else { + /* We are at the beginning of a literal node */ + text_node->field_flag = FALSE; + for (p = text, *n = 0; *p != 0; p++, (*n)++) { + if (strncmp (p, "${", strlen ("${")) == 0) + break; + if (*p == '\n') + break; + } + text_node->data = g_strndup (text, *n); + } + + return text_node; +} + +/****************************************************************************/ +/* Copy a single text node. */ +/****************************************************************************/ +glTextNode * +gl_text_node_dup (glTextNode *src) +{ + glTextNode *dst; + + if ( src == NULL ) return NULL; + + dst = g_new0 (glTextNode, 1); + + dst->field_flag = src->field_flag; + dst->data = g_strdup (src->data); + + return dst; +} + +/****************************************************************************/ +/* Free a single text node. */ +/****************************************************************************/ +void +gl_text_node_free (glTextNode **text_node) +{ + if ( *text_node == NULL ) return; + + g_free ((*text_node)->data); + (*text_node)->data = NULL; + g_free (*text_node); + *text_node = NULL; +} + +/****************************************************************************/ +/* Compare 2 text nodes for equality. */ +/****************************************************************************/ +gboolean +gl_text_node_equal (glTextNode *text_node1, + glTextNode *text_node2) +{ + /* First take care of the case of either or both being NULL. */ + if ( text_node1 == NULL ) { + return ( text_node2 == NULL ); + } else { + if ( text_node2 == NULL ) { + return FALSE; + } + } + + /* Bail if field flags differ. */ + if ( text_node1->field_flag != text_node2->field_flag ) { + return FALSE; + } + + /* Now take care of the case of either or both data fields being NULL. */ + if ( text_node1->data == NULL ) { + return ( text_node2->data == NULL ); + } else { + if ( text_node2->data == NULL ) { + return FALSE; + } + } + + /* Field flags are identical, so now compare the data. */ + return (strcmp (text_node1->data, text_node2->data) == 0); +} + +/****************************************************************************/ +/* Expand text lines into single string. */ +/****************************************************************************/ +gchar * +gl_text_node_lines_expand (GList *lines, + glMergeRecord *record) +{ + GList *p_line, *p_node; + glTextNode *text_node; + gchar *text, *old_text, *expanded_node; + + text = g_strdup (""); /* prime pointer for concatenation */ + for (p_line = lines; p_line != NULL; p_line = p_line->next) { + + /* special case: something like ${ADDRESS2} = "" on line by itself. */ + /* in such circumstances ignore the line completely. */ + p_node = (GList *)p_line->data; + if (p_node && p_node->next == NULL) { + text_node = (glTextNode *) p_node->data; + if ( is_empty_field (text_node, record) ) { + continue; + } + } + + /* expand each node */ + for (p_node = (GList *) p_line->data; p_node != NULL; + p_node = p_node->next) { + text_node = (glTextNode *) p_node->data; + old_text = text; + expanded_node = gl_text_node_expand (text_node, record); + text = g_strconcat (text, expanded_node, NULL); + g_free (old_text); + g_free (expanded_node); + } + + /* append newline to each line, except last. */ + if ( p_line->next != NULL ) { + old_text = text; + text = g_strconcat (text, "\n", NULL); + g_free (old_text); + } + } + + return text; +} + +/****************************************************************************/ +/* Parse a string back into text lines. */ +/****************************************************************************/ +GList * +gl_text_node_lines_new_from_text (gchar *text) +{ + GList *lines, *nodes; + glTextNode *text_node; + gchar *p; + gint n; + + lines = NULL; + nodes = NULL; + for (p = text; *p != 0; p += n) { + if (*p != '\n') { + text_node = extract_text_node (p, &n); + nodes = g_list_append (nodes, text_node); + } else { + n = 1; + lines = g_list_append (lines, nodes); + nodes = NULL; + } + } + if (*(p - 1) != '\n') { + lines = g_list_append (lines, nodes); + } + + return lines; +} + +/****************************************************************************/ +/* Copy a list of text lines. */ +/****************************************************************************/ +GList * +gl_text_node_lines_dup (GList *src_lines) +{ + GList *dst_lines=NULL; + GList *p_line, *line, *p_node; + glTextNode *node; + + for (p_line = src_lines; p_line != NULL; p_line = p_line->next) + { + line = NULL; + for (p_node = (GList *) p_line->data; p_node != NULL; p_node = p_node->next) + { + node = gl_text_node_dup ((glTextNode *)p_node->data); + line = g_list_append (line, node); + } + dst_lines = g_list_append (dst_lines, line); + } + + return dst_lines; +} + +/****************************************************************************/ +/* Free a list of text lines. */ +/****************************************************************************/ +void +gl_text_node_lines_free (GList **lines) +{ + GList *p_line, *p_node; + glTextNode *text_node; + + for (p_line = *lines; p_line != NULL; p_line = p_line->next) + { + for (p_node = (GList *) p_line->data; p_node != NULL; p_node = p_node->next) + { + text_node = (glTextNode *)p_node->data; + p_node->data = NULL; + gl_text_node_free ( &text_node ); + } + g_list_free ((GList *) p_line->data); + p_line->data = NULL; + } + + g_list_free (*lines); + *lines = NULL; +} + +/****************************************************************************/ +/* For debugging: descend and print lines list. */ +/****************************************************************************/ +void +gl_text_node_lines_print (GList * lines ) +{ + GList *p_line, *p_node; + glTextNode *text_node; + gint i_line, i_node; + + for (p_line=lines, i_line=0; p_line != NULL; p_line=p_line->next, i_line++) { + for (p_node = (GList *) p_line->data, i_node=0; p_node != NULL; + p_node = p_node->next, i_node++) { + text_node = (glTextNode *) p_node->data; + g_print( "LINE[%d], NODE[%d] = { %d, \"%s\" }\n", + i_line, i_node, + text_node->field_flag, text_node->data ); + + } + } + +} + diff --git a/src/text-node.h b/src/text-node.h new file mode 100644 index 00000000..4a9bd228 --- /dev/null +++ b/src/text-node.h @@ -0,0 +1,58 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * text_node.h: text node module header file + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __TEXT_NODE_H__ +#define __TEXT_NODE_H__ + +#include +#include +#include "merge.h" + +G_BEGIN_DECLS + +typedef struct { + gboolean field_flag; + gchar *data; +} glTextNode; + +gchar *gl_text_node_expand (glTextNode *text_node, + glMergeRecord *record); +glTextNode *gl_text_node_new_from_text (gchar *text); +glTextNode *gl_text_node_dup (glTextNode *text_node); +void gl_text_node_free (glTextNode **text_node); + +gboolean gl_text_node_equal (glTextNode *text_node1, + glTextNode *text_node2); + +gchar *gl_text_node_lines_expand (GList *lines, + glMergeRecord *record); +GList *gl_text_node_lines_new_from_text (gchar *text); +GList *gl_text_node_lines_dup (GList *lines); +void gl_text_node_lines_free (GList **lines); + +/* debug function */ +void gl_text_node_lines_print (GList *lines); + +G_END_DECLS + +#endif diff --git a/src/ui-commands.c b/src/ui-commands.c new file mode 100644 index 00000000..9a06936f --- /dev/null +++ b/src/ui-commands.c @@ -0,0 +1,1168 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * ui-commands.c: GLabels UI commands module + * + * Copyright (C) 2001-2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "ui-commands.h" + +#include +#include +#include +#include + +#include "view.h" +#include "file.h" +#include "template-designer.h" +#include "print-op.h" +#include "prefs.h" +#include "prefs-dialog.h" +#include "recent.h" +#include "debug.h" + + + +/****************************************************************************/ +/** File/New command. */ +/****************************************************************************/ +void +gl_ui_cmd_file_new (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_file_new (window); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** File/Properties command. */ +/****************************************************************************/ +void +gl_ui_cmd_file_properties (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_file_properties (GL_VIEW(window->view)->label, window); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** File/Template-Designer command. */ +/****************************************************************************/ +void +gl_ui_cmd_file_template_designer (GtkAction *action, + glWindow *window) +{ + GtkWidget *dialog; + + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + dialog = gl_template_designer_new (GTK_WINDOW(window)); + + gtk_widget_show (dialog); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** File/Open command. */ +/****************************************************************************/ +void +gl_ui_cmd_file_open (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_file_open (window); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** File/Open-Recent command. */ +/****************************************************************************/ +void +gl_ui_cmd_file_open_recent (GtkRecentChooser *chooser, + glWindow *window) +{ + GtkRecentInfo *item; + gchar *utf8_filename; + + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (chooser && GTK_IS_RECENT_CHOOSER(chooser)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + item = gtk_recent_chooser_get_current_item (chooser); + if (!item) + return; + + utf8_filename = gl_recent_get_utf8_filename (item); + + gl_debug (DEBUG_COMMANDS, "Selected %s\n", utf8_filename); + gl_file_open_recent (utf8_filename, window); + + gtk_recent_info_unref (item); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** File/Save command. */ +/****************************************************************************/ +void +gl_ui_cmd_file_save (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_file_save (GL_VIEW(window->view)->label, window); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** File/Save-as command. */ +/****************************************************************************/ +void +gl_ui_cmd_file_save_as (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_file_save_as (GL_VIEW(window->view)->label, window); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** File/Print command. */ +/****************************************************************************/ +void +gl_ui_cmd_file_print (GtkAction *action, + glWindow *window) +{ + glPrintOp *op; + GtkPrintOperationResult result; + + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + op = gl_print_op_new (GL_VIEW(window->view)->label); + + if (window->print_settings) + { + gl_print_op_set_settings (op, window->print_settings); + } + + result = gtk_print_operation_run (GTK_PRINT_OPERATION (op), + GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, + GTK_WINDOW (window), + NULL); + + if ( result == GTK_PRINT_OPERATION_RESULT_APPLY ) + { + gl_print_op_free_settings (window->print_settings); + window->print_settings = gl_print_op_get_settings (op); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** File/Close command. */ +/****************************************************************************/ +void +gl_ui_cmd_file_close (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_file_close (window); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** File/Quit command. */ +/****************************************************************************/ +void +gl_ui_cmd_file_quit (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_file_exit (); + + gl_debug (DEBUG_COMMANDS, "END"); +} + + +/****************************************************************************/ +/** Edit/Cut command. */ +/****************************************************************************/ +void +gl_ui_cmd_edit_cut (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_view_cut (GL_VIEW(window->view)); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** Edit/Copy command. */ +/****************************************************************************/ +void +gl_ui_cmd_edit_copy (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_view_copy (GL_VIEW(window->view)); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** Edit/Paste command. */ +/****************************************************************************/ +void +gl_ui_cmd_edit_paste (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_view_paste (GL_VIEW(window->view)); + + gl_debug (DEBUG_COMMANDS, "END"); +} + + +/****************************************************************************/ +/** Edit/Delete command. */ +/****************************************************************************/ +void +gl_ui_cmd_edit_delete (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_view_delete_selection (GL_VIEW(window->view)); + + gl_debug (DEBUG_COMMANDS, "END"); +} + + +/****************************************************************************/ +/** Edit/Select-all command. */ +/****************************************************************************/ +void +gl_ui_cmd_edit_select_all (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_view_select_all (GL_VIEW(window->view)); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** Edit/Unselect-all command. */ +/****************************************************************************/ +void +gl_ui_cmd_edit_unselect_all (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gl_view_unselect_all (GL_VIEW(window->view)); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** Edit/Preferences command. */ +/****************************************************************************/ +void +gl_ui_cmd_edit_preferences (GtkAction *action, + glWindow *window) +{ + static GtkWidget *dialog = NULL; + + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (dialog != NULL) + { + gtk_window_present (GTK_WINDOW (dialog)); + gtk_window_set_transient_for (GTK_WINDOW (dialog), + GTK_WINDOW(window)); + + } else { + + dialog = gl_prefs_dialog_new (GTK_WINDOW(window)); + + g_signal_connect (G_OBJECT (dialog), "destroy", + G_CALLBACK (gtk_widget_destroyed), &dialog); + + gtk_widget_show (dialog); + + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** View/Property-bar-toggle command. */ +/*****************************************************************************/ +void +gl_ui_cmd_view_property_bar_toggle (GtkToggleAction *action, + glWindow *window) +{ + gboolean state; + + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_TOGGLE_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + state = gtk_toggle_action_get_active (action); + + gl_prefs->property_toolbar_visible = state; + if (state) { + gtk_widget_show (GTK_WIDGET (window->property_bar)); + } else { + gtk_widget_hide (GTK_WIDGET (window->property_bar)); + } + gl_prefs_model_save_settings (gl_prefs); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** View/Property-bar-tooltips-toggle command. */ +/*****************************************************************************/ +void +gl_ui_cmd_view_property_bar_tips_toggle (GtkToggleAction *action, + glWindow *window) +{ + gboolean state; + + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_TOGGLE_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + state = gtk_toggle_action_get_active (action); + + gl_prefs->property_toolbar_view_tooltips = state; + gl_ui_property_bar_set_tooltips (window->property_bar, state); + gl_prefs_model_save_settings (gl_prefs); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** View/Grid-toggle command. */ +/*****************************************************************************/ +void +gl_ui_cmd_view_grid_toggle (GtkToggleAction *action, + glWindow *window) +{ + gboolean state; + + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_TOGGLE_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + state = gtk_toggle_action_get_active (action); + + if (window->view != NULL) + { + if (state) { + gl_view_show_grid (GL_VIEW(window->view)); + } else { + gl_view_hide_grid (GL_VIEW(window->view)); + } + } + + gl_prefs->grid_visible = state; + gl_prefs_model_save_settings (gl_prefs); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** View/Markup-toggle command. */ +/*****************************************************************************/ +void +gl_ui_cmd_view_markup_toggle (GtkToggleAction *action, + glWindow *window) +{ + gboolean state; + + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_TOGGLE_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + state = gtk_toggle_action_get_active (action); + + if (window->view != NULL) + { + if (state) { + gl_view_show_markup (GL_VIEW(window->view)); + } else { + gl_view_hide_markup (GL_VIEW(window->view)); + } + } + + gl_prefs->markup_visible = state; + gl_prefs_model_save_settings (gl_prefs); + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** View/Zoom-in command. */ +/*****************************************************************************/ +void +gl_ui_cmd_view_zoomin (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_zoom_in (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** View/Zoom-out command. */ +/*****************************************************************************/ +void +gl_ui_cmd_view_zoomout (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_zoom_out (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** View/Zoom-1:1 command. */ +/*****************************************************************************/ +void +gl_ui_cmd_view_zoom1to1 (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_set_zoom (GL_VIEW(window->view), 1.0); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** View/Zoom-to-fit command. */ +/*****************************************************************************/ +void +gl_ui_cmd_view_zoom_to_fit (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_zoom_to_fit (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Arrow-mode command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_arrow_mode (GtkAction *action, + glWindow *window) +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_arrow_mode (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Create-text object command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_create_text (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_object_create_mode (GL_VIEW(window->view), + GL_LABEL_OBJECT_TEXT); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Create-box object command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_create_box (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_object_create_mode (GL_VIEW(window->view), + GL_LABEL_OBJECT_BOX); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Create-line object command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_create_line (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_object_create_mode (GL_VIEW(window->view), + GL_LABEL_OBJECT_LINE); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Create-ellipse object command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_create_ellipse (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_object_create_mode (GL_VIEW(window->view), + GL_LABEL_OBJECT_ELLIPSE); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Create-image object command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_create_image (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_object_create_mode (GL_VIEW(window->view), + GL_LABEL_OBJECT_IMAGE); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Create-barcode object command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_create_barcode (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_object_create_mode (GL_VIEW(window->view), + GL_LABEL_OBJECT_BARCODE); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Raise command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_raise (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_raise_selection (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Lower command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_lower (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_lower_selection (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Rotate-left-90-degrees command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_rotate_left (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_rotate_selection_left (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Rotate-right-90-degrees command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_rotate_right (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_rotate_selection_right (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Flip-horizontally command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_flip_horiz (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_flip_selection_horiz (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Flip-vertically command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_flip_vert (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_flip_selection_vert (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Align-left command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_align_left (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_align_selection_left (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Align-right command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_align_right (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_align_selection_right (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Align-horizontal-center command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_align_hcenter (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_align_selection_hcenter (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Align-top command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_align_top (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_align_selection_top (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Align-bottom command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_align_bottom (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_align_selection_bottom (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Align-vertical center command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_align_vcenter (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_align_selection_vcenter (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Center-horizontally command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_center_horiz (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_center_selection_horiz (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Center-vertically command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_center_vert (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->view != NULL) { + gl_view_center_selection_vert (GL_VIEW(window->view)); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/*****************************************************************************/ +/** Objects/Edit- merge-properties command. */ +/*****************************************************************************/ +void +gl_ui_cmd_objects_merge_properties (GtkAction *action, + glWindow *window) + +{ + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (window->merge_dialog) { + + gtk_window_present (GTK_WINDOW(window->merge_dialog)); + gtk_window_set_transient_for (GTK_WINDOW (window->merge_dialog), + GTK_WINDOW (window)); + + } else { + + window->merge_dialog = + g_object_ref ( + gl_merge_properties_dialog_new (GL_VIEW(window->view)->label, + GTK_WINDOW(window)) ); + + g_signal_connect (G_OBJECT(window->merge_dialog), "destroy", + G_CALLBACK (gtk_widget_destroyed), + &window->merge_dialog); + + gtk_widget_show (GTK_WIDGET (window->merge_dialog)); + + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + +/****************************************************************************/ +/** Help/Contents command. */ +/****************************************************************************/ +void +gl_ui_cmd_help_contents (GtkAction *action, + glWindow *window) +{ + GError *error = NULL; + + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + gnome_help_display_with_doc_id (NULL, NULL, "glabels.xml", NULL, &error); + + if (error != NULL) + { + g_message ("%s", error->message); + + g_error_free (error); + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + + +/****************************************************************************/ +/** Help/About command. */ +/****************************************************************************/ +void +gl_ui_cmd_help_about (GtkAction *action, + glWindow *window) +{ + static GtkWidget *about = NULL; + + GdkPixbuf *pixbuf = NULL; + + const gchar *authors[] = { + "Jim Evins", + " ", + _("Glabels includes contributions from:"), + "Frederic Ruaudel", + "Wayne Schuller", + "Emmanuel Pacaud", + "Austin Henry", + " ", + _("See the file AUTHORS for additional credits,"), + _("or visit http://glabels.sourceforge.net/"), + NULL + }; + + const gchar *artists[] = { + "Nestor Di", + "Jim Evins", + NULL + }; + + const gchar *copy_text = "Copyright \xc2\xa9 2001-2009 Jim Evins"; + + const gchar *about_text = _("A label and business card creation program.\n"); + + const gchar *url = "http://glabels.sourceforge.net"; + + const gchar *translator_credits = _("translator-credits"); + + const gchar *license = _( + "Glabels is free software; you can redistribute it and/or modify it\n" + "under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation; either version 2 of the License, or\n" + "(at your option) any later version.\n" "\n" + "This program is distributed in the hope that it will be useful, but\n" + "WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See\n" + "the GNU General Public License for more details.\n"); + + gl_debug (DEBUG_COMMANDS, "START"); + + g_return_if_fail (action && GTK_IS_ACTION(action)); + g_return_if_fail (window && GL_IS_WINDOW(window)); + + if (about != NULL) + { + + gtk_window_present (GTK_WINDOW (about)); + gtk_window_set_transient_for (GTK_WINDOW (about), + GTK_WINDOW (window)); + + } else { + + pixbuf = gdk_pixbuf_new_from_file (GLABELS_PIXMAP_DIR "glabels-splash.png", NULL); + + about = gtk_about_dialog_new (); + gtk_about_dialog_set_name (GTK_ABOUT_DIALOG(about), _("glabels")); + gtk_about_dialog_set_version (GTK_ABOUT_DIALOG(about), VERSION); + gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG(about), copy_text); + gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG(about), about_text); + gtk_about_dialog_set_website (GTK_ABOUT_DIALOG(about), url); + gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG(about), pixbuf); + + gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG(about), authors); + gtk_about_dialog_set_artists (GTK_ABOUT_DIALOG(about), artists); + gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG(about), + translator_credits); + gtk_about_dialog_set_license (GTK_ABOUT_DIALOG(about), license); + + gtk_window_set_destroy_with_parent (GTK_WINDOW (about), TRUE); + + g_signal_connect (G_OBJECT (about), "response", + G_CALLBACK (gtk_widget_destroy), NULL); + g_signal_connect (G_OBJECT (about), "destroy", + G_CALLBACK (gtk_widget_destroyed), &about); + + gtk_window_set_transient_for (GTK_WINDOW (about), + GTK_WINDOW (window)); + + gtk_window_present (GTK_WINDOW (about)); + + if (pixbuf != NULL) + g_object_unref (pixbuf); + + } + + gl_debug (DEBUG_COMMANDS, "END"); +} + diff --git a/src/ui-commands.h b/src/ui-commands.h new file mode 100644 index 00000000..fc8a3db9 --- /dev/null +++ b/src/ui-commands.h @@ -0,0 +1,203 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * ui-commands.h: GLabels UI commands module header file + * + * Copyright (C) 2001-2005 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __COMMANDS_H__ +#define __COMMANDS_H__ + +#include +#include +#include +#include "window.h" + +G_BEGIN_DECLS + +void gl_ui_cmd_file_new (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_file_properties (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_file_template_designer (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_file_open (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_file_open_recent (GtkRecentChooser *chooser, + glWindow *window); + +void gl_ui_cmd_file_save (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_file_save_as (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_file_print (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_file_print_preview (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_file_close (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_file_quit (GtkAction *action, + glWindow *window); + + + +void gl_ui_cmd_edit_undo (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_edit_redo (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_edit_cut (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_edit_copy (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_edit_paste (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_edit_delete (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_edit_select_all (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_edit_unselect_all (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_edit_preferences (GtkAction *action, + glWindow *window); + + + +void gl_ui_cmd_view_property_bar_toggle (GtkToggleAction *action, + glWindow *window); + +void gl_ui_cmd_view_property_bar_tips_toggle (GtkToggleAction *action, + glWindow *window); + +void gl_ui_cmd_view_grid_toggle (GtkToggleAction *action, + glWindow *window); + +void gl_ui_cmd_view_markup_toggle (GtkToggleAction *action, + glWindow *window); + + + +void gl_ui_cmd_view_zoomin (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_view_zoomout (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_view_zoom1to1 (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_view_zoom_to_fit (GtkAction *action, + glWindow *window); + + + +void gl_ui_cmd_objects_arrow_mode (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_create_text (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_create_box (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_create_line (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_create_ellipse (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_create_image (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_create_barcode (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_raise (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_lower (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_rotate_left (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_rotate_right (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_flip_horiz (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_flip_vert (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_align_left (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_align_right (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_align_hcenter (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_align_top (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_align_bottom (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_align_vcenter (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_center_horiz (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_center_vert (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_objects_merge_properties (GtkAction *action, + glWindow *window); + + + +void gl_ui_cmd_help_contents (GtkAction *action, + glWindow *window); + +void gl_ui_cmd_help_about (GtkAction *action, + glWindow *window); + +G_END_DECLS + +#endif /* __COMMANDS_H__ */ diff --git a/src/ui-property-bar.c b/src/ui-property-bar.c new file mode 100644 index 00000000..005c8380 --- /dev/null +++ b/src/ui-property-bar.c @@ -0,0 +1,1331 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/** + * (GLABELS) Label and Business Card Creation program for GNOME + * + * property-bar.c: gLabels property bar + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "ui-property-bar.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "util.h" +#include "mygal/widget-color-combo.h" +#include "stock-pixmaps/stockpixbufs.h" +#include "prefs.h" +#include "color.h" + +#include "debug.h" + +/*===========================================================================*/ +/* Private macros and constants. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Private data types */ +/*===========================================================================*/ + +struct _glUIPropertyBarPrivate { + + glView *view; + + GladeXML *gui; + + GtkWidget *tool_bar; + + /* Font selection */ + GtkWidget *font_family_combo; + GtkWidget *font_size_spin; + GtkWidget *font_bold_toggle; + GtkWidget *font_italic_toggle; + + /* Text alignemnt radios */ + GtkWidget *text_align_left_radio; + GtkWidget *text_align_center_radio; + GtkWidget *text_align_right_radio; + + /* Color combos */ + GtkWidget *text_color_combo; + GtkWidget *fill_color_combo; + GtkWidget *line_color_combo; + + /* Line width */ + GtkWidget *line_width_spin; + + /* Prevent recursion */ + gboolean stop_signals; +}; + + +/*===========================================================================*/ +/* Private globals */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Local function prototypes */ +/*===========================================================================*/ + +static void gl_ui_property_bar_finalize (GObject *object); + +static void gl_ui_property_bar_construct (glUIPropertyBar *property_bar); + +static void selection_changed_cb (glUIPropertyBar *property_bar); + +static void font_family_changed_cb (GtkComboBox *combo, + glUIPropertyBar *property_bar); + +static void font_size_changed_cb (GtkSpinButton *spin, + glUIPropertyBar *property_bar); + +static void text_color_changed_cb (ColorCombo *cc, + GdkColor *gdk_color, + gboolean custom, + gboolean by_user, + gboolean is_default, + glUIPropertyBar *property_bar); + +static void fill_color_changed_cb (ColorCombo *cc, + GdkColor *gdk_color, + gboolean custom, + gboolean by_user, + gboolean is_default, + glUIPropertyBar *property_bar); + +static void line_color_changed_cb (ColorCombo *cc, + GdkColor *gdk_color, + gboolean custom, + gboolean by_user, + gboolean is_default, + glUIPropertyBar *property_bar); + +static void line_width_changed_cb (GtkSpinButton *spin, + glUIPropertyBar *property_bar); + +static void font_bold_toggled_cb (GtkToggleToolButton *toggle, + glUIPropertyBar *property_bar); + +static void font_italic_toggled_cb (GtkToggleToolButton *toggle, + glUIPropertyBar *property_bar); + +static void text_align_toggled_cb (GtkToggleToolButton *toggle, + glUIPropertyBar *property_bar); + +static void set_doc_items_sensitive (glUIPropertyBar *property_bar, + gboolean state); + +static void set_text_items_sensitive (glUIPropertyBar *property_bar, + gboolean state); + +static void set_fill_items_sensitive (glUIPropertyBar *property_bar, + gboolean state); + +static void set_line_color_items_sensitive (glUIPropertyBar *property_bar, + gboolean state); + +static void set_line_width_items_sensitive (glUIPropertyBar *property_bar, + gboolean state); + + +/****************************************************************************/ +/* Boilerplate Object stuff. */ +/****************************************************************************/ +G_DEFINE_TYPE (glUIPropertyBar, gl_ui_property_bar, GTK_TYPE_HBOX); + +static void +gl_ui_property_bar_class_init (glUIPropertyBarClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + gl_ui_property_bar_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_ui_property_bar_finalize; + + gl_debug (DEBUG_PROPERTY_BAR, "END"); +} + +static void +gl_ui_property_bar_init (glUIPropertyBar *property_bar) +{ + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + property_bar->priv = g_new0 (glUIPropertyBarPrivate, 1); + + gl_debug (DEBUG_PROPERTY_BAR, "END"); +} + +static void +gl_ui_property_bar_finalize (GObject *object) +{ + glUIPropertyBar *property_bar = GL_UI_PROPERTY_BAR (object); + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_UI_PROPERTY_BAR (object)); + + if (property_bar->priv->view) + { + g_object_unref (G_OBJECT(property_bar->priv->view)); + } + if (property_bar->priv->gui) + { + g_object_unref (G_OBJECT(property_bar->priv->gui)); + } + g_free (property_bar->priv); + + G_OBJECT_CLASS (gl_ui_property_bar_parent_class)->finalize (object); + + gl_debug (DEBUG_PROPERTY_BAR, "END"); +} + +/****************************************************************************/ +/* Create a NEW property_bar. */ +/****************************************************************************/ +GtkWidget * +gl_ui_property_bar_new (void) +{ + glUIPropertyBar *property_bar; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + property_bar = g_object_new (GL_TYPE_UI_PROPERTY_BAR, NULL); + + gl_ui_property_bar_construct (property_bar); + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + return GTK_WIDGET (property_bar); +} + +/******************************************************************************/ +/* Initialize property toolbar. */ +/******************************************************************************/ +static void +gl_ui_property_bar_construct (glUIPropertyBar *property_bar) +{ + GladeXML *gui; + GList *family_names = NULL; + GList *family_node; + GdkColor *gdk_color; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + property_bar->priv->stop_signals = TRUE; + + gui = glade_xml_new (GLABELS_GLADE_DIR "property-bar.glade", + "property_toolbar", NULL); + + if (!gui) + { + g_critical ("Could not open property-bar.glade. gLabels may not be installed correctly!"); + return; + } + + property_bar->priv->tool_bar = glade_xml_get_widget (gui, "property_toolbar"); + gtk_container_add (GTK_CONTAINER (property_bar), property_bar->priv->tool_bar); + + property_bar->priv->font_family_combo = + glade_xml_get_widget (gui, "font_family_combo"); + property_bar->priv->font_size_spin = + glade_xml_get_widget (gui, "font_size_spin"); + property_bar->priv->font_bold_toggle = + glade_xml_get_widget (gui, "font_bold_toggle"); + property_bar->priv->font_italic_toggle = + glade_xml_get_widget (gui, "font_italic_toggle"); + property_bar->priv->text_align_left_radio = + glade_xml_get_widget (gui, "text_align_left_radio"); + property_bar->priv->text_align_center_radio = + glade_xml_get_widget (gui, "text_align_center_radio"); + property_bar->priv->text_align_right_radio = + glade_xml_get_widget (gui, "text_align_right_radio"); + property_bar->priv->text_color_combo = + glade_xml_get_widget (gui, "text_color_combo"); + property_bar->priv->fill_color_combo = + glade_xml_get_widget (gui, "fill_color_combo"); + property_bar->priv->line_color_combo = + glade_xml_get_widget (gui, "line_color_combo"); + property_bar->priv->line_width_spin = + glade_xml_get_widget (gui, "line_width_spin"); + + /* Save reference to gui tree so we don't lose tooltips */ + property_bar->priv->gui = gui; + + set_doc_items_sensitive (property_bar, FALSE); + + /* Font family entry widget */ + gl_util_combo_box_add_text_model (GTK_COMBO_BOX (property_bar->priv->font_family_combo)); + family_names = gl_util_get_font_family_list (); + gl_util_combo_box_set_strings (GTK_COMBO_BOX (property_bar->priv->font_family_combo), + family_names); + gtk_widget_set_size_request (property_bar->priv->font_family_combo, 200, -1); + + /* Make sure we have a valid font. if not provide a good default. */ + family_node = g_list_find_custom (family_names, + gl_prefs->default_font_family, + (GCompareFunc)g_utf8_collate); + if (family_node) + { + gtk_combo_box_set_active (GTK_COMBO_BOX (property_bar->priv->font_family_combo), + g_list_position (family_names, + family_node)); + } + else + { + gtk_combo_box_set_active (GTK_COMBO_BOX (property_bar->priv->font_family_combo), 0); + } + + g_signal_connect (G_OBJECT (property_bar->priv->font_family_combo), + "changed", G_CALLBACK (font_family_changed_cb), property_bar); + + /* Font size entry widget */ + gtk_spin_button_set_value (GTK_SPIN_BUTTON(property_bar->priv->font_size_spin), + gl_prefs->default_font_size); + + g_signal_connect (G_OBJECT (property_bar->priv->font_size_spin), + "changed", G_CALLBACK (font_size_changed_cb), property_bar); + + + /* Bold and Italic toggles */ + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_bold_toggle), + (gl_prefs->default_font_weight == PANGO_WEIGHT_BOLD)); + g_signal_connect (G_OBJECT (property_bar->priv->font_bold_toggle), + "toggled", G_CALLBACK (font_bold_toggled_cb), property_bar); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_italic_toggle), + gl_prefs->default_font_italic_flag); + g_signal_connect (G_OBJECT (property_bar->priv->font_italic_toggle), + "toggled", G_CALLBACK (font_italic_toggled_cb), property_bar); + + + /* Text alignment radio group */ + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_left_radio), + (gl_prefs->default_text_alignment == PANGO_ALIGN_LEFT)); + g_signal_connect (G_OBJECT (property_bar->priv->text_align_left_radio), + "toggled", G_CALLBACK (text_align_toggled_cb), property_bar); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_center_radio), + (gl_prefs->default_text_alignment == PANGO_ALIGN_CENTER)); + g_signal_connect (G_OBJECT (property_bar->priv->text_align_center_radio), + "toggled", G_CALLBACK (text_align_toggled_cb), property_bar); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_right_radio), + (gl_prefs->default_text_alignment == PANGO_ALIGN_RIGHT)); + g_signal_connect (G_OBJECT (property_bar->priv->text_align_right_radio), + "toggled", G_CALLBACK (text_align_toggled_cb), property_bar); + + /* Text color widget */ + gdk_color = gl_color_to_gdk_color (gl_prefs->default_text_color); + color_combo_set_color (COLOR_COMBO (property_bar->priv->text_color_combo), gdk_color); + g_free (gdk_color); + g_signal_connect (G_OBJECT (property_bar->priv->text_color_combo), + "color_changed", + G_CALLBACK (text_color_changed_cb), property_bar); + + /* Fill color widget */ + gdk_color = gl_color_to_gdk_color (gl_prefs->default_fill_color); + color_combo_set_color (COLOR_COMBO (property_bar->priv->fill_color_combo), gdk_color); + g_free (gdk_color); + g_signal_connect (G_OBJECT (property_bar->priv->fill_color_combo), + "color_changed", + G_CALLBACK (fill_color_changed_cb), property_bar); + + /* Line color widget */ + gdk_color = gl_color_to_gdk_color (gl_prefs->default_line_color); + color_combo_set_color (COLOR_COMBO (property_bar->priv->line_color_combo), gdk_color); + g_free (gdk_color); + g_signal_connect (G_OBJECT (property_bar->priv->line_color_combo), + "color_changed", + G_CALLBACK (line_color_changed_cb), property_bar); + + /* Line width entry widget */ + g_signal_connect (G_OBJECT (property_bar->priv->line_width_spin), + "changed", + G_CALLBACK (line_width_changed_cb), property_bar); + + property_bar->priv->stop_signals = FALSE; + + gl_debug (DEBUG_PROPERTY_BAR, "END"); +} + +/****************************************************************************/ +/* Fill widgets with default values. */ +/****************************************************************************/ +static void +reset_to_default_properties (glView *view, + glUIPropertyBar *property_bar) +{ + GList *family_names; + gchar *good_font_family; + GdkColor *gdk_color; + + /* Make sure we have a valid font. if not provide a good default. */ + family_names = gl_util_get_font_family_list (); + if (g_list_find_custom (family_names, + view->default_font_family, + (GCompareFunc)g_utf8_collate)) + { + good_font_family = g_strdup (view->default_font_family); + } + else + { + if (family_names != NULL) + { + good_font_family = g_strdup (family_names->data); /* 1st entry */ + } + else + { + good_font_family = NULL; + } + } + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (property_bar->priv->font_family_combo), + good_font_family); + g_free (good_font_family); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON(property_bar->priv->font_size_spin), + view->default_font_size); + + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_bold_toggle), + (view->default_font_weight == PANGO_WEIGHT_BOLD)); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_italic_toggle), + view->default_font_italic_flag); + + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_left_radio), + (view->default_text_alignment == PANGO_ALIGN_LEFT)); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_center_radio), + (view->default_text_alignment == PANGO_ALIGN_CENTER)); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_right_radio), + (view->default_text_alignment == PANGO_ALIGN_RIGHT)); + + gdk_color = gl_color_to_gdk_color (view->default_text_color); + color_combo_set_color (COLOR_COMBO(property_bar->priv->text_color_combo), gdk_color); + g_free (gdk_color); + + gdk_color = gl_color_to_gdk_color (view->default_fill_color); + color_combo_set_color (COLOR_COMBO(property_bar->priv->fill_color_combo), gdk_color); + g_free (gdk_color); + + gdk_color = gl_color_to_gdk_color (view->default_line_color); + color_combo_set_color (COLOR_COMBO(property_bar->priv->line_color_combo), gdk_color); + g_free (gdk_color); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON(property_bar->priv->line_width_spin), + view->default_line_width); +} + +/****************************************************************************/ +/* Set view associated with property_bar. */ +/****************************************************************************/ +void +gl_ui_property_bar_set_view (glUIPropertyBar *property_bar, + glView *view) +{ + glLabel *label; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + label = view->label; + g_return_if_fail (label && GL_IS_LABEL (label)); + + set_doc_items_sensitive (property_bar, TRUE); + + property_bar->priv->view = GL_VIEW (g_object_ref (G_OBJECT (view))); + + reset_to_default_properties (view, property_bar); + + g_signal_connect_swapped (G_OBJECT(view), "selection_changed", + G_CALLBACK(selection_changed_cb), property_bar); + + g_signal_connect_swapped (G_OBJECT(view->label), "changed", + G_CALLBACK(selection_changed_cb), property_bar); + + gl_debug (DEBUG_PROPERTY_BAR, "END"); +} + +/****************************************************************************/ +/** Set visiblity of property bar's tooltips. */ +/****************************************************************************/ +void +gl_ui_property_bar_set_tooltips (glUIPropertyBar *property_bar, + gboolean state) +{ + GtkTooltipsData *data; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + g_return_if_fail (property_bar && GL_IS_UI_PROPERTY_BAR(property_bar)); + + /* HACK: peek into one of our widgets to get the tooltips group created by libglade. */ + data = gtk_tooltips_data_get (property_bar->priv->font_size_spin); + g_return_if_fail (data); + + if (state) + { + gtk_tooltips_enable (data->tooltips); + } + else + { + gtk_tooltips_disable (data->tooltips); + } + + gl_debug (DEBUG_PROPERTY_BAR, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. View "selection state changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_text_properties (glView *view, + glUIPropertyBar *property_bar) +{ + gboolean can_text, is_first_object; + gboolean is_same_font_family, is_same_font_size; + gboolean is_same_text_color, is_same_is_italic; + gboolean is_same_is_bold, is_same_align; + GList *p; + glLabelObject *object; + gchar *selection_font_family, *font_family; + gdouble selection_font_size, font_size; + guint selection_text_color, text_color; + glColorNode *text_color_node; + gboolean selection_is_italic, is_italic; + gboolean selection_is_bold, is_bold; + PangoAlignment selection_align, align; + GdkColor *gdk_color; + + can_text = gl_view_can_selection_text (view); + set_text_items_sensitive (property_bar, can_text); + + if (!can_text) + return; + + is_same_is_italic = + is_same_is_bold = + is_same_align = + is_same_text_color = + is_same_font_size = + is_same_font_family = TRUE; + selection_font_family = NULL; + selection_font_size = -1; + selection_align = PANGO_ALIGN_LEFT; + selection_is_italic = TRUE; + selection_is_bold = TRUE; + selection_text_color = 0; + + is_first_object = TRUE; + + for (p = view->selected_object_list; p != NULL; p = p->next) + { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + if (!gl_label_object_can_text (object)) + continue; + + font_family = gl_label_object_get_font_family (object); + if (font_family != NULL) + { + if (selection_font_family == NULL) + { + selection_font_family = g_strdup (font_family); + } + else + { + if (strcmp (font_family, selection_font_family) != 0) + { + is_same_font_family = FALSE; + } + } + g_free (font_family); + } + + font_size = gl_label_object_get_font_size (object); + + text_color_node = gl_label_object_get_text_color (object); + if (text_color_node->field_flag) + { + /* If a merge field is set we use the default color for merged color*/ + text_color = GL_COLOR_MERGE_DEFAULT; + + } + else + { + text_color = text_color_node->color; + } + gl_color_node_free (&text_color_node); + + is_italic = gl_label_object_get_font_italic_flag (object); + is_bold = gl_label_object_get_font_weight (object) == PANGO_WEIGHT_BOLD; + align = gl_label_object_get_text_alignment (object); + + if (is_first_object) + { + selection_font_size = font_size; + selection_text_color = text_color; + selection_is_italic = is_italic; + selection_is_bold = is_bold; + selection_align = align; + } + else + { + if (font_size != selection_font_size) + is_same_font_size = FALSE; + if (text_color != selection_text_color) + is_same_text_color = FALSE; + if (is_italic != selection_is_italic) + is_same_is_italic = FALSE; + if (is_bold != selection_is_bold) + is_same_is_bold = FALSE; + if (align != selection_align) + is_same_align = FALSE; + } + is_first_object = FALSE; + } + + if (is_same_font_family && (selection_font_family != NULL)) + gl_debug (DEBUG_PROPERTY_BAR, "same font family = %s", + selection_font_family); + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (property_bar->priv->font_family_combo), + is_same_font_family?selection_font_family:""); + g_free (selection_font_family); + + if (is_same_font_size) + { + gl_debug (DEBUG_PROPERTY_BAR, "same font size = %g", + selection_font_size); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (property_bar->priv->font_size_spin), + selection_font_size); + } + else + { + gtk_entry_set_text (GTK_ENTRY (property_bar->priv->font_size_spin), ""); + } + + if (is_same_text_color) + { + gl_debug (DEBUG_PROPERTY_BAR, "same text color = %08x", selection_text_color); + gdk_color = gl_color_to_gdk_color (selection_text_color); + color_combo_set_color (COLOR_COMBO (property_bar->priv->text_color_combo), + gdk_color); + g_free (gdk_color); + } + + if (is_same_is_italic) + { + gl_debug (DEBUG_PROPERTY_BAR, "same italic flag = %d", + selection_is_italic); + } + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_italic_toggle), + selection_is_italic && is_same_is_italic); + + if (is_same_is_bold) + { + gl_debug (DEBUG_PROPERTY_BAR, "same bold flag = %d", + selection_is_bold); + } + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->font_bold_toggle), + selection_is_bold && is_same_is_bold); + + if (is_same_align) + gl_debug (DEBUG_PROPERTY_BAR, "same align"); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_left_radio), + (selection_align == PANGO_ALIGN_LEFT) && + is_same_align); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_center_radio), + (selection_align == PANGO_ALIGN_CENTER) && + is_same_align); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_right_radio), + (selection_align == PANGO_ALIGN_RIGHT) && + is_same_align); +} + +static void +update_fill_color (glView *view, + glUIPropertyBar *property_bar) +{ + gboolean can, is_first_object; + gboolean is_same_fill_color; + GList *p; + glLabelObject *object; + guint selection_fill_color, fill_color; + GdkColor *gdk_color; + glColorNode *fill_color_node; + + can = gl_view_can_selection_fill (view); + set_fill_items_sensitive (property_bar, can); + + if (!can) + return; + + is_same_fill_color = TRUE; + is_first_object = TRUE; + selection_fill_color = 0; + + for (p = view->selected_object_list; p != NULL; p = p->next) + { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + if (!gl_label_object_can_fill (object)) + continue; + + fill_color_node = gl_label_object_get_fill_color (object); + if (fill_color_node->field_flag) + { + /* If a merge field is set we use the default color for merged color*/ + fill_color = GL_COLOR_FILL_MERGE_DEFAULT; + + } + else + { + fill_color = fill_color_node->color; + } + gl_color_node_free (&fill_color_node); + + if (is_first_object) + { + selection_fill_color = fill_color; + } + else + { + if (fill_color != selection_fill_color) + { + is_same_fill_color = FALSE; + } + } + is_first_object = FALSE; + } + + if (is_same_fill_color) + { + gl_debug (DEBUG_PROPERTY_BAR, "same fill color = %08x", selection_fill_color); + gdk_color = gl_color_to_gdk_color (selection_fill_color); + color_combo_set_color (COLOR_COMBO (property_bar->priv->fill_color_combo), + gdk_color); + g_free (gdk_color); + } +} + +static void +update_line_color (glView *view, + glUIPropertyBar *property_bar) +{ + gboolean can, is_first_object; + gboolean is_same_line_color; + GList *p; + glLabelObject *object; + guint selection_line_color, line_color; + glColorNode *line_color_node; + GdkColor *gdk_color; + + can = gl_view_can_selection_line_color (view); + set_line_color_items_sensitive (property_bar, can); + + if (!can) + return; + + is_same_line_color = TRUE; + is_first_object = TRUE; + selection_line_color = 0; + + for (p = view->selected_object_list; p != NULL; p = p->next) + { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + if (!gl_label_object_can_line_color (object)) + continue; + + line_color_node = gl_label_object_get_line_color (object); + if (line_color_node->field_flag) + { + /* If a merge field is set we use the default color for merged color*/ + line_color = GL_COLOR_MERGE_DEFAULT; + + } + else + { + line_color = line_color_node->color; + } + gl_color_node_free (&line_color_node); + + if (is_first_object) + { + selection_line_color = line_color; + } + else + { + if (line_color != selection_line_color) + { + is_same_line_color = FALSE; + } + } + is_first_object = FALSE; + } + + if (is_same_line_color) + { + gl_debug (DEBUG_PROPERTY_BAR, "same line color = %08x", selection_line_color); + gdk_color = gl_color_to_gdk_color (selection_line_color); + color_combo_set_color (COLOR_COMBO (property_bar->priv->line_color_combo), + gdk_color); + g_free (gdk_color); + } +} + +static void +update_line_width (glView *view, + glUIPropertyBar *property_bar) +{ + gboolean can, is_first_object; + gboolean is_same_line_width; + GList *p; + glLabelObject *object; + gdouble selection_line_width, line_width; + + can = gl_view_can_selection_line_width (view); + set_line_width_items_sensitive (property_bar, can); + + if (!can) + return; + + is_same_line_width = TRUE; + is_first_object = TRUE; + selection_line_width = 0; + + for (p = view->selected_object_list; p != NULL; p = p->next) + { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + if (!gl_label_object_can_line_width (object)) + continue; + + line_width = gl_label_object_get_line_width (object); + + if (is_first_object) + { + selection_line_width = line_width; + } + else + { + if (line_width != selection_line_width) + { + is_same_line_width = FALSE; + } + } + is_first_object = FALSE; + } + + if (is_same_line_width) + { + gl_debug (DEBUG_PROPERTY_BAR, "same line width = %g", selection_line_width); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (property_bar->priv->line_width_spin), + selection_line_width); + } + else + { + gtk_entry_set_text (GTK_ENTRY (property_bar->priv->line_width_spin), ""); + } +} + +static void +selection_changed_cb (glUIPropertyBar *property_bar) +{ + glView *view = property_bar->priv->view; + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (property_bar && GL_IS_UI_PROPERTY_BAR (property_bar)); + + if (property_bar->priv->stop_signals) return; + property_bar->priv->stop_signals = TRUE; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + if (gl_view_is_selection_empty (view)) + { + /* No selection: make all controls active. */ + reset_to_default_properties (view, property_bar); + set_doc_items_sensitive (property_bar, TRUE); + } + else + { + update_text_properties (view, property_bar); + update_fill_color (view, property_bar); + update_line_color (view, property_bar); + update_line_width (view, property_bar); + } + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + property_bar->priv->stop_signals = FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Font family entry changed. */ +/*--------------------------------------------------------------------------*/ +static void +font_family_changed_cb (GtkComboBox *combo, + glUIPropertyBar *property_bar) +{ + gchar *font_family; + + if (property_bar->priv->stop_signals) return; + property_bar->priv->stop_signals = TRUE; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + font_family = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo)); + if ( strlen(font_family) ) + { + gl_view_set_selection_font_family (property_bar->priv->view, + font_family); + gl_view_set_default_font_family (property_bar->priv->view, + font_family); + } + g_free (font_family); + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + property_bar->priv->stop_signals = FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Font size spin button changed. */ +/*--------------------------------------------------------------------------*/ +static void +font_size_changed_cb (GtkSpinButton *spin, + glUIPropertyBar *property_bar) +{ + gdouble font_size; + + if (property_bar->priv->stop_signals) return; + property_bar->priv->stop_signals = TRUE; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + font_size = gtk_spin_button_get_value (spin); + + gl_view_set_selection_font_size (property_bar->priv->view, + font_size); + gl_view_set_default_font_size (property_bar->priv->view, + font_size); + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + property_bar->priv->stop_signals = FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Text color combo changed. */ +/*--------------------------------------------------------------------------*/ +static void +text_color_changed_cb (ColorCombo *cc, + GdkColor *gdk_color, + gboolean custom, + gboolean by_user, + gboolean is_default, + glUIPropertyBar *property_bar) +{ + glColorNode *text_color_node; + + g_return_if_fail (property_bar && GL_IS_UI_PROPERTY_BAR (property_bar)); + + if (property_bar->priv->stop_signals) return; + property_bar->priv->stop_signals = TRUE; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + text_color_node = gl_color_node_new_default (); + text_color_node->color = gl_color_from_gdk_color (gdk_color); + + gl_debug (DEBUG_PROPERTY_BAR, "Color=%08x, Custom=%d, By_User=%d, Is_default=%d", + text_color_node->color, custom, by_user, is_default); + + if (is_default) + { + text_color_node->color = gl_prefs->default_text_color; + gl_view_set_selection_text_color (property_bar->priv->view, + text_color_node); + gl_view_set_default_text_color (property_bar->priv->view, + gl_prefs->default_text_color); + } + else + { + gl_view_set_selection_text_color (property_bar->priv->view, + text_color_node); + gl_view_set_default_text_color (property_bar->priv->view, + text_color_node->color); + } + + gl_color_node_free (&text_color_node); + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + property_bar->priv->stop_signals = FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Fill color combo changed. */ +/*--------------------------------------------------------------------------*/ +static void +fill_color_changed_cb (ColorCombo *cc, + GdkColor *gdk_color, + gboolean custom, + gboolean by_user, + gboolean is_default, + glUIPropertyBar *property_bar) +{ + glColorNode *fill_color_node; + + g_return_if_fail (property_bar && GL_IS_UI_PROPERTY_BAR (property_bar)); + + if (property_bar->priv->stop_signals) return; + property_bar->priv->stop_signals = TRUE; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + fill_color_node = gl_color_node_new_default (); + + fill_color_node->color = gl_color_from_gdk_color (gdk_color); + + gl_debug (DEBUG_PROPERTY_BAR, "Color=%08x, Custom=%d, By_User=%d, Is_default=%d", + fill_color_node->color, custom, by_user, is_default); + + if (is_default) + { + + fill_color_node->color = GL_COLOR_NONE; + gl_view_set_selection_fill_color (property_bar->priv->view, + fill_color_node); + gl_view_set_default_fill_color (property_bar->priv->view, + fill_color_node->color); + } + else + { + gl_view_set_selection_fill_color (property_bar->priv->view, + fill_color_node); + gl_view_set_default_fill_color (property_bar->priv->view, + fill_color_node->color); + } + gl_color_node_free (&fill_color_node); + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + property_bar->priv->stop_signals = FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Line color combo changed. */ +/*--------------------------------------------------------------------------*/ +static void +line_color_changed_cb (ColorCombo *cc, + GdkColor *gdk_color, + gboolean custom, + gboolean by_user, + gboolean is_default, + glUIPropertyBar *property_bar) +{ + glColorNode *line_color_node; + + g_return_if_fail (property_bar && GL_IS_UI_PROPERTY_BAR (property_bar)); + + if (property_bar->priv->stop_signals) return; + property_bar->priv->stop_signals = TRUE; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + line_color_node = gl_color_node_new_default (); + line_color_node->color = gl_color_from_gdk_color (gdk_color); + + gl_debug (DEBUG_PROPERTY_BAR, "Color=%08x, Custom=%d, By_User=%d, Is_default=%d", + line_color_node->color, custom, by_user, is_default); + + if (is_default) + { + line_color_node->color = GL_COLOR_NONE; + gl_view_set_selection_line_color (property_bar->priv->view, + line_color_node); + gl_view_set_default_line_color (property_bar->priv->view, + line_color_node->color); + } + else + { + gl_view_set_selection_line_color (property_bar->priv->view, + line_color_node); + gl_view_set_default_line_color (property_bar->priv->view, + line_color_node->color); + } + gl_color_node_free (&line_color_node); + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + property_bar->priv->stop_signals = FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Line width spin button changed. */ +/*--------------------------------------------------------------------------*/ +static void +line_width_changed_cb (GtkSpinButton *spin, + glUIPropertyBar *property_bar) +{ + gdouble line_width; + + if (property_bar->priv->stop_signals) return; + property_bar->priv->stop_signals = TRUE; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + if (property_bar->priv->view) + { + line_width = gtk_spin_button_get_value (spin); + + gl_view_set_selection_line_width (property_bar->priv->view, + line_width); + gl_view_set_default_line_width (property_bar->priv->view, + line_width); + } + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + property_bar->priv->stop_signals = FALSE; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Font bold toggled callback. */ +/*---------------------------------------------------------------------------*/ +static void +font_bold_toggled_cb (GtkToggleToolButton *toggle, + glUIPropertyBar *property_bar) +{ + gboolean state; + PangoWeight weight; + + + if (property_bar->priv->stop_signals) return; + property_bar->priv->stop_signals = TRUE; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + state = gtk_toggle_tool_button_get_active (toggle); + + weight = state ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL; + + gl_view_set_selection_font_weight (property_bar->priv->view, weight); + gl_view_set_default_font_weight (property_bar->priv->view, weight); + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + property_bar->priv->stop_signals = FALSE; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Font italic toggled callback. */ +/*---------------------------------------------------------------------------*/ +static void +font_italic_toggled_cb (GtkToggleToolButton *toggle, + glUIPropertyBar *property_bar) +{ + gboolean state; + + if (property_bar->priv->stop_signals) return; + property_bar->priv->stop_signals = TRUE; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + state = gtk_toggle_tool_button_get_active (toggle); + + gl_view_set_selection_font_italic_flag (property_bar->priv->view, state); + gl_view_set_default_font_italic_flag (property_bar->priv->view, state); + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + property_bar->priv->stop_signals = FALSE; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Text align toggled callback. */ +/*---------------------------------------------------------------------------*/ +static void +text_align_toggled_cb (GtkToggleToolButton *toggle, + glUIPropertyBar *property_bar) +{ + if (property_bar->priv->stop_signals) return; + property_bar->priv->stop_signals = TRUE; + + gl_debug (DEBUG_PROPERTY_BAR, "START"); + + if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_left_radio))) + { + gl_view_set_selection_text_alignment (property_bar->priv->view, + PANGO_ALIGN_LEFT); + gl_view_set_default_text_alignment (property_bar->priv->view, + PANGO_ALIGN_LEFT); + } + + if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_center_radio))) + { + gl_view_set_selection_text_alignment (property_bar->priv->view, + PANGO_ALIGN_CENTER); + gl_view_set_default_text_alignment (property_bar->priv->view, + PANGO_ALIGN_CENTER); + } + + if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (property_bar->priv->text_align_right_radio))) + { + gl_view_set_selection_text_alignment (property_bar->priv->view, + PANGO_ALIGN_RIGHT); + gl_view_set_default_text_alignment (property_bar->priv->view, + PANGO_ALIGN_RIGHT); + } + + gl_debug (DEBUG_PROPERTY_BAR, "END"); + + property_bar->priv->stop_signals = FALSE; +} + + +/*****************************************************************************/ +/* Construct color combo "Custom widget". */ +/*****************************************************************************/ +GtkWidget * +gl_ui_property_bar_construct_color_combo (gchar *name, + gchar *string1, + gchar *string2, + gint int1, + gint int2) +{ + GtkWidget *color_combo; + ColorGroup *cg; + gchar *cg_name; + GdkColor *gdk_color; + gchar *no_color; + GdkPixbuf *pixbuf = NULL; + + switch (int1) { + + case 0: + cg_name = "text_color_group"; + gdk_color = gl_color_to_gdk_color (gl_prefs->default_text_color); + no_color = _("Default"); + pixbuf = gdk_pixbuf_new_from_inline (-1, stock_text_24, FALSE, NULL); + break; + + case 2: + cg_name = "line_color_group"; + gdk_color = NULL; + no_color = _("No line"); + pixbuf = gdk_pixbuf_new_from_inline (-1, stock_pencil_24, FALSE, NULL); + break; + + case 1: + default: + cg_name = "fill_color_group"; + gdk_color = NULL; + no_color = _("No fill"); + pixbuf = gdk_pixbuf_new_from_inline (-1, stock_bucket_fill_24, FALSE, NULL); + break; + + } + + cg = color_group_fetch (cg_name, NULL); + color_combo = color_combo_new (pixbuf, no_color, gdk_color, cg); + g_free (gdk_color); + + color_combo_box_set_preview_relief (COLOR_COMBO(color_combo), GTK_RELIEF_NORMAL); + + g_object_unref (G_OBJECT (pixbuf)); + + return color_combo; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set sensitivity of doc controls. */ +/*---------------------------------------------------------------------------*/ +static void +set_doc_items_sensitive (glUIPropertyBar *property_bar, + gboolean state) +{ + gtk_widget_set_sensitive (property_bar->priv->font_family_combo, state); + gtk_widget_set_sensitive (property_bar->priv->font_size_spin, state); + gtk_widget_set_sensitive (property_bar->priv->font_bold_toggle, state); + gtk_widget_set_sensitive (property_bar->priv->font_italic_toggle, state); + gtk_widget_set_sensitive (property_bar->priv->text_align_left_radio, state); + gtk_widget_set_sensitive (property_bar->priv->text_align_center_radio, state); + gtk_widget_set_sensitive (property_bar->priv->text_align_right_radio, state); + gtk_widget_set_sensitive (property_bar->priv->text_color_combo, state); + gtk_widget_set_sensitive (property_bar->priv->fill_color_combo, state); + gtk_widget_set_sensitive (property_bar->priv->line_color_combo, state); + gtk_widget_set_sensitive (property_bar->priv->line_width_spin, state); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set sensitivity of text related controls. */ +/*---------------------------------------------------------------------------*/ +static void +set_text_items_sensitive (glUIPropertyBar *property_bar, + gboolean state) +{ + gtk_widget_set_sensitive (property_bar->priv->font_family_combo, state); + gtk_widget_set_sensitive (property_bar->priv->font_size_spin, state); + gtk_widget_set_sensitive (property_bar->priv->font_bold_toggle, state); + gtk_widget_set_sensitive (property_bar->priv->font_italic_toggle, state); + gtk_widget_set_sensitive (property_bar->priv->text_align_left_radio, state); + gtk_widget_set_sensitive (property_bar->priv->text_align_center_radio, state); + gtk_widget_set_sensitive (property_bar->priv->text_align_right_radio, state); + gtk_widget_set_sensitive (property_bar->priv->text_color_combo, state); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set sensitivity of fill related controls. */ +/*---------------------------------------------------------------------------*/ +static void +set_fill_items_sensitive (glUIPropertyBar *property_bar, + gboolean state) +{ + gtk_widget_set_sensitive (property_bar->priv->fill_color_combo, state); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set sensitivity of line color related controls. */ +/*---------------------------------------------------------------------------*/ +static void +set_line_color_items_sensitive (glUIPropertyBar *property_bar, + gboolean state) +{ + gtk_widget_set_sensitive (property_bar->priv->line_color_combo, state); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set sensitivity of line width related controls. */ +/*---------------------------------------------------------------------------*/ +static void +set_line_width_items_sensitive (glUIPropertyBar *property_bar, + gboolean state) +{ + gtk_widget_set_sensitive (property_bar->priv->line_width_spin, state); +} + + diff --git a/src/ui-property-bar.h b/src/ui-property-bar.h new file mode 100644 index 00000000..e2af1912 --- /dev/null +++ b/src/ui-property-bar.h @@ -0,0 +1,74 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/** + * (GLABELS) Label and Business Card Creation program for GNOME + * + * ui-property-bar.h: Property toolbar header file + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __UI_PROPERTY_BAR_H__ +#define __UI_PROPERTY_BAR_H__ + +#include + +#include "view.h" + +G_BEGIN_DECLS + +#define GL_TYPE_UI_PROPERTY_BAR (gl_ui_property_bar_get_type ()) +#define GL_UI_PROPERTY_BAR(obj) \ + (GTK_CHECK_CAST((obj), GL_TYPE_UI_PROPERTY_BAR, glUIPropertyBar )) +#define GL_UI_PROPERTY_BAR_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_UI_PROPERTY_BAR, glUIPropertyBarClass)) +#define GL_IS_UI_PROPERTY_BAR(obj) \ + (GTK_CHECK_TYPE ((obj), GL_TYPE_UI_PROPERTY_BAR)) +#define GL_IS_UI_PROPERTY_BAR_CLASS(klass) \ + (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_UI_PROPERTY_BAR)) + +typedef struct _glUIPropertyBar glUIPropertyBar; +typedef struct _glUIPropertyBarClass glUIPropertyBarClass; + +typedef struct _glUIPropertyBarPrivate glUIPropertyBarPrivate; + +struct _glUIPropertyBar { + GtkHBox parent_widget; + + glUIPropertyBarPrivate *priv; + +}; + +struct _glUIPropertyBarClass { + GtkHBoxClass parent_class; +}; + +GType gl_ui_property_bar_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_ui_property_bar_new (void); + +void gl_ui_property_bar_set_view (glUIPropertyBar *property_bar, + glView *view); + +void gl_ui_property_bar_set_tooltips (glUIPropertyBar *property_bar, + gboolean state); + + + +G_END_DECLS + +#endif /* __UI_PROPERTY_BAR_H__ */ diff --git a/src/ui-sidebar.c b/src/ui-sidebar.c new file mode 100644 index 00000000..f8c398f4 --- /dev/null +++ b/src/ui-sidebar.c @@ -0,0 +1,217 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/** + * (GLABELS) Label and Business Card Creation program for GNOME + * + * ui-sidebar.c: Object property sidebar + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "ui-sidebar.h" + +#include + +#include "ui-util.h" +#include "object-editor.h" +#include "stock.h" + +#include "debug.h" + +/*===========================================================================*/ +/* Private macros and constants. */ +/*===========================================================================*/ + +#define DEFAULT_SIDEBAR_WIDTH 340 + +/*===========================================================================*/ +/* Private data types */ +/*===========================================================================*/ + +struct _glUISidebarPrivate { + + glView *view; + + GtkWidget *child; + GtkWidget *empty_child; +}; + +/*===========================================================================*/ +/* Private globals */ +/*===========================================================================*/ + + +/*===========================================================================*/ +/* Local function prototypes */ +/*===========================================================================*/ + +static void gl_ui_sidebar_finalize (GObject *object); + +static void gl_ui_sidebar_construct (glUISidebar *sidebar); + +static void selection_changed_cb (glView *view, + glUISidebar *sidebar); + + + +/****************************************************************************/ +/* Boilerplate Object stuff. */ +/****************************************************************************/ +G_DEFINE_TYPE (glUISidebar, gl_ui_sidebar, GTK_TYPE_VBOX); + +static void +gl_ui_sidebar_class_init (glUISidebarClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_UI, "START"); + + gl_ui_sidebar_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_ui_sidebar_finalize; + + gl_debug (DEBUG_UI, "END"); +} + +static void +gl_ui_sidebar_init (glUISidebar *sidebar) +{ + gl_debug (DEBUG_UI, "START"); + + sidebar->priv = g_new0 (glUISidebarPrivate, 1); + + gl_debug (DEBUG_UI, "END"); +} + +static void +gl_ui_sidebar_finalize (GObject *object) +{ + glUISidebar *sidebar = GL_UI_SIDEBAR (object); + + gl_debug (DEBUG_UI, "START"); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_UI_SIDEBAR (object)); + + if (sidebar->priv->view) { + g_object_unref (G_OBJECT(sidebar->priv->view)); + } + g_free (sidebar->priv); + + G_OBJECT_CLASS (gl_ui_sidebar_parent_class)->finalize (object); + + gl_debug (DEBUG_UI, "END"); +} + +/****************************************************************************/ +/* Create a NEW sidebar. */ +/****************************************************************************/ +GtkWidget * +gl_ui_sidebar_new (void) +{ + glUISidebar *sidebar; + + gl_debug (DEBUG_UI, "START"); + + sidebar = g_object_new (gl_ui_sidebar_get_type (), NULL); + + gtk_widget_set_size_request (GTK_WIDGET (sidebar), DEFAULT_SIDEBAR_WIDTH, -1); + + gl_ui_sidebar_construct (sidebar); + + gl_debug (DEBUG_UI, "END"); + + return GTK_WIDGET(sidebar); +} + +/******************************************************************************/ +/* Initialize property toolbar. */ +/******************************************************************************/ +static void +gl_ui_sidebar_construct (glUISidebar *sidebar) +{ + gl_debug (DEBUG_UI, "START"); + + sidebar->priv->empty_child = gl_object_editor_new (GL_STOCK_PROPERTIES, + _("Object properties"), + NULL, + GL_OBJECT_EDITOR_EMPTY, + NULL); + + sidebar->priv->child = gtk_widget_ref (sidebar->priv->empty_child); + gtk_widget_show (sidebar->priv->child); + gtk_container_add (GTK_CONTAINER(sidebar), sidebar->priv->child); + + gtk_widget_set_sensitive (GTK_WIDGET (sidebar), FALSE); + + gl_debug (DEBUG_UI, "END"); +} + +/****************************************************************************/ +/* Set view associated with sidebar. */ +/****************************************************************************/ +void +gl_ui_sidebar_set_view (glUISidebar *sidebar, + glView *view) +{ + gl_debug (DEBUG_UI, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + gtk_widget_set_sensitive (GTK_WIDGET (sidebar), TRUE); + + sidebar->priv->view = GL_VIEW (g_object_ref (G_OBJECT (view))); + + g_signal_connect (G_OBJECT(view), "selection_changed", + G_CALLBACK(selection_changed_cb), sidebar); + + gl_debug (DEBUG_UI, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. View "selection state changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +selection_changed_cb (glView *view, + glUISidebar *sidebar) +{ + gl_debug (DEBUG_UI, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (sidebar && GL_IS_UI_SIDEBAR (sidebar)); + + gtk_container_remove (GTK_CONTAINER(sidebar), sidebar->priv->child); + + if (gl_view_is_selection_empty (view) || !gl_view_is_selection_atomic (view)) { + + sidebar->priv->child = gtk_widget_ref (sidebar->priv->empty_child); + + } else { + + sidebar->priv->child = gtk_widget_ref (gl_view_get_editor (view)); + + } + + gtk_widget_show (sidebar->priv->child); + + gtk_box_pack_start (GTK_BOX(sidebar), sidebar->priv->child, TRUE, TRUE, 0); + + gl_debug (DEBUG_UI, "END"); +} + diff --git a/src/ui-sidebar.h b/src/ui-sidebar.h new file mode 100644 index 00000000..9ec1264d --- /dev/null +++ b/src/ui-sidebar.h @@ -0,0 +1,69 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/** + * (GLABELS) Label and Business Card Creation program for GNOME + * + * ui-sidebar.h: Object property sidebar header file + * + * Copyright (C) 2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __UI_SIDEBAR_H__ +#define __UI_SIDEBAR_H__ + +#include + +#include "view.h" + +G_BEGIN_DECLS + +#define GL_TYPE_UI_SIDEBAR (gl_ui_sidebar_get_type ()) +#define GL_UI_SIDEBAR(obj) \ + (GTK_CHECK_CAST((obj), GL_TYPE_UI_SIDEBAR, glUISidebar )) +#define GL_UI_SIDEBAR_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_UI_SIDEBAR, glUISidebarClass)) +#define GL_IS_UI_SIDEBAR(obj) \ + (GTK_CHECK_TYPE ((obj), GL_TYPE_UI_SIDEBAR)) +#define GL_IS_UI_SIDEBAR_CLASS(klass) \ + (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_UI_SIDEBAR)) + +typedef struct _glUISidebar glUISidebar; +typedef struct _glUISidebarClass glUISidebarClass; + +typedef struct _glUISidebarPrivate glUISidebarPrivate; + +struct _glUISidebar { + GtkVBox parent_widget; + + glUISidebarPrivate *priv; +}; + +struct _glUISidebarClass { + GtkVBoxClass parent_class; +}; + +GType gl_ui_sidebar_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_ui_sidebar_new (void); + +void gl_ui_sidebar_set_view (glUISidebar *sidebar, + glView *view); + + +G_END_DECLS + +#endif /* __UI_SIDEBAR_H__ */ diff --git a/src/ui-util.c b/src/ui-util.c new file mode 100644 index 00000000..3a0539df --- /dev/null +++ b/src/ui-util.c @@ -0,0 +1,126 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * ui-util.c: GLabels ui utilities module + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "ui-util.h" + +#include +#include + +#include "debug.h" + +/*==========================================================================*/ +/* Private macros and constants. */ +/*==========================================================================*/ + +/*==========================================================================*/ +/* Private types. */ +/*==========================================================================*/ + +/*==========================================================================*/ +/* Private globals */ +/*==========================================================================*/ + +/*==========================================================================*/ +/* Local function prototypes */ +/*==========================================================================*/ + + + +/*****************************************************************************/ +/** Set sensitivity of verb. */ +/*****************************************************************************/ +void +gl_ui_util_set_verb_sensitive (GtkUIManager *ui, + gchar *cname, + gboolean sensitive) +{ + GtkAction *action; + + gl_debug (DEBUG_UI, "START"); + + g_return_if_fail (cname != NULL); + g_return_if_fail (GTK_IS_UI_MANAGER (ui)); + + action = gtk_ui_manager_get_action (ui, cname); + + if (action) { + gl_debug (DEBUG_UI, "Set action \"%s\" sensitive = %d", cname, sensitive); + gtk_action_set_sensitive (action, sensitive); + } + + gl_debug (DEBUG_UI, "END"); +} + +/*****************************************************************************/ +/** Set sensitivity of a list of verbs. */ +/*****************************************************************************/ +void +gl_ui_util_set_verb_list_sensitive (GtkUIManager *ui, + gchar **vlist, + gboolean sensitive) +{ + GtkAction *action; + + gl_debug (DEBUG_UI, "START"); + + g_return_if_fail (vlist != NULL); + g_return_if_fail (GTK_IS_UI_MANAGER (ui)); + + for ( ; *vlist; ++vlist) + { + action = gtk_ui_manager_get_action (ui, *vlist); + + if (action) { + gtk_action_set_sensitive (action, sensitive); + } + } + + gl_debug (DEBUG_UI, "END"); +} + +/*****************************************************************************/ +/** Set state of a verb. */ +/*****************************************************************************/ +void +gl_ui_util_set_verb_state (GtkUIManager *ui, + gchar *cname, + gboolean state) +{ + GtkToggleAction *action; + + gl_debug (DEBUG_UI, "START"); + + g_return_if_fail (cname != NULL); + g_return_if_fail (GTK_IS_UI_MANAGER (ui)); + + action = GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui, cname)); + + if (action) { + gtk_toggle_action_set_active (action, state); + } + + gl_debug (DEBUG_UI, "END"); +} + diff --git a/src/ui-util.h b/src/ui-util.h new file mode 100644 index 00000000..ffa2653e --- /dev/null +++ b/src/ui-util.h @@ -0,0 +1,45 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * ui-util.h: GLabels UI utilities module header file + * + * Copyright (C) 2001-2003 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __GL_UI_UTIL_H__ +#define __GL_UI_UTIL_H__ + +#include + +G_BEGIN_DECLS + +void gl_ui_util_set_verb_sensitive (GtkUIManager *ui, + gchar *cname, + gboolean sensitive); + +void gl_ui_util_set_verb_list_sensitive (GtkUIManager *ui, + gchar **vlist, + gboolean sensitive); + +void gl_ui_util_set_verb_state (GtkUIManager *ui, + gchar *cname, + gboolean state); + +G_END_DECLS + +#endif /* __GL_UI_UTIL_H__ */ diff --git a/src/ui.c b/src/ui.c new file mode 100644 index 00000000..f8cbd128 --- /dev/null +++ b/src/ui.c @@ -0,0 +1,1179 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * ui.c: GLabels ui module + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "ui.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ui-util.h" +#include "ui-commands.h" +#include "file.h" +#include "prefs.h" +#include "stock.h" +#include "window.h" +#include "recent.h" + +#include "debug.h" + +/*==========================================================================*/ +/* Private macros and constants. */ +/*==========================================================================*/ + +/*==========================================================================*/ +/* Private types. */ +/*==========================================================================*/ + + +/*==========================================================================*/ +/* Local function prototypes */ +/*==========================================================================*/ + +static void view_ui_item_toggled_cb (GtkToggleAction *action, + GtkUIManager *ui); + +static void set_app_main_toolbar_style (GtkUIManager *ui); + +static void set_app_drawing_toolbar_style (GtkUIManager *ui); + +static void set_view_style (GtkUIManager *ui); + +static void connect_proxy_cb (GtkUIManager *ui, + GtkAction *action, + GtkWidget *proxy, + glWindow *window); + +static void disconnect_proxy_cb (GtkUIManager *ui, + GtkAction *action, + GtkWidget *proxy, + glWindow *window); + +static void menu_item_select_cb (GtkMenuItem *proxy, + glWindow *window); + +static void menu_item_deselect_cb (GtkMenuItem *proxy, + glWindow *window); + + +/*==========================================================================*/ +/* Private globals */ +/*==========================================================================*/ + +static GtkActionEntry entries[] = { + + /* Menu entries. */ + { "FileMenu", NULL, N_("_File") }, + { "FileRecentsMenu", NULL, N_("Open Recent _Files") }, + { "EditMenu", NULL, N_("_Edit") }, + { "ViewMenu", NULL, N_("_View") }, + { "ViewMainToolBarMenu", NULL, N_("Customize Main Toolbar") }, + { "ViewDrawingToolBarMenu", NULL, N_("Customize Drawing Toolbar") }, + { "ViewPropertyToolBarMenu", NULL, N_("Customize Properties Toolbar") }, + { "ObjectsMenu", NULL, N_("_Objects") }, + { "ObjectsCreateMenu", NULL, N_("_Create") }, + { "ObjectsOrderMenu", NULL, N_("_Order") }, + { "ObjectsRotateFlipMenu", NULL, N_("_Rotate/Flip") }, + { "ObjectsAlignHorizMenu", NULL, N_("Align _Horizontal") }, + { "ObjectsAlignVertMenu", NULL, N_("Align _Vertical") }, + { "HelpMenu", NULL, N_("_Help") }, + + /* Popup entries. */ + { "ContextMenu", NULL, N_("Context Menu") }, + { "EmptySelectionContextMenu", NULL, N_("Context Menu") }, + + /* File action entries. */ + { "FileNew", + GTK_STOCK_NEW, + N_("_New"), + "N", + N_("Create a new file"), + G_CALLBACK (gl_ui_cmd_file_new) }, + + { "FileOpen", + GTK_STOCK_OPEN, + N_("_Open..."), + "O", + N_("Open a file"), + G_CALLBACK (gl_ui_cmd_file_open) }, + + { "FileSave", + GTK_STOCK_SAVE, + N_("_Save"), + "S", + N_("Save current file"), + G_CALLBACK (gl_ui_cmd_file_save) }, + + { "FileSaveAs", + GTK_STOCK_SAVE, + N_("Save _As..."), + "S", + N_("Save the current file to a different name"), + G_CALLBACK (gl_ui_cmd_file_save_as) }, + + { "FilePrint", + GTK_STOCK_PRINT, + N_("_Print..."), + "P", + N_("Print the current file"), + G_CALLBACK (gl_ui_cmd_file_print) }, + + { "FileProperties", + GTK_STOCK_PROPERTIES, + N_("Properties..."), + NULL, + N_("Modify document properties"), + G_CALLBACK (gl_ui_cmd_file_properties) }, + + { "FileTemplateDesigner", + NULL, + N_("Template _Designer..."), + NULL, + N_("Create a custom template"), + G_CALLBACK (gl_ui_cmd_file_template_designer) }, + + { "FileClose", + GTK_STOCK_CLOSE, + N_("_Close"), + "F4", + N_("Close the current file"), + G_CALLBACK (gl_ui_cmd_file_close) }, + + { "FileQuit", + GTK_STOCK_QUIT, + N_("_Quit"), + "Q", + N_("Quit the program"), + G_CALLBACK (gl_ui_cmd_file_quit) }, + + + /* Edit action entries. */ + { "EditCut", + GTK_STOCK_CUT, + N_("Cut"), + "X", + N_("Cut the selection"), + G_CALLBACK (gl_ui_cmd_edit_cut) }, + + { "EditCopy", + GTK_STOCK_COPY, + N_("Copy"), + "C", + N_("Copy the selection"), + G_CALLBACK (gl_ui_cmd_edit_copy) }, + + { "EditPaste", + GTK_STOCK_PASTE, + N_("Paste"), + "V", + N_("Paste the clipboard"), + G_CALLBACK (gl_ui_cmd_edit_paste) }, + + { "EditDelete", + NULL, + N_("Delete"), + NULL, + N_("Delete the selected objects"), + G_CALLBACK (gl_ui_cmd_edit_delete) }, + + { "EditSelectAll", + NULL, + N_("Select All"), + "A", + N_("Select all objects"), + G_CALLBACK (gl_ui_cmd_edit_select_all) }, + + { "EditUnSelectAll", + NULL, + N_("Un-select All"), + NULL, + N_("Remove all selections"), + G_CALLBACK (gl_ui_cmd_edit_unselect_all) }, + + { "EditPreferences", + GTK_STOCK_PREFERENCES, + N_("Preferences"), + NULL, + N_("Configure the application"), + G_CALLBACK (gl_ui_cmd_edit_preferences) }, + + + /* View action entries. */ + { "ViewZoomIn", + GTK_STOCK_ZOOM_IN, + N_("Zoom in"), + NULL, + N_("Increase magnification"), + G_CALLBACK (gl_ui_cmd_view_zoomin) }, + + { "ViewZoomOut", + GTK_STOCK_ZOOM_OUT, + N_("Zoom out"), + NULL, + N_("Decrease magnification"), + G_CALLBACK (gl_ui_cmd_view_zoomout) }, + + { "ViewZoom1to1", + GTK_STOCK_ZOOM_100, + N_("Zoom 1 to 1"), + NULL, + N_("Restore scale to 100%"), + G_CALLBACK (gl_ui_cmd_view_zoom1to1) }, + + { "ViewZoomToFit", + GTK_STOCK_ZOOM_FIT, + N_("Zoom to fit"), + NULL, + N_("Set scale to fit window"), + G_CALLBACK (gl_ui_cmd_view_zoom_to_fit) }, + + + /* Objects action entries. */ + { "ObjectsArrowMode", + GL_STOCK_ARROW, + N_("Select Mode"), + NULL, + N_("Select, move and modify objects"), + G_CALLBACK (gl_ui_cmd_objects_arrow_mode) }, + + { "ObjectsCreateText", + GL_STOCK_TEXT, + N_("Text"), + NULL, + N_("Create text object"), + G_CALLBACK (gl_ui_cmd_objects_create_text) }, + + { "ObjectsCreateBox", + GL_STOCK_BOX, + N_("Box"), + NULL, + N_("Create box/rectangle object"), + G_CALLBACK (gl_ui_cmd_objects_create_box) }, + + { "ObjectsCreateLine", + GL_STOCK_LINE, + N_("Line"), + NULL, + N_("Create line object"), + G_CALLBACK (gl_ui_cmd_objects_create_line) }, + + { "ObjectsCreateEllipse", + GL_STOCK_ELLIPSE, + N_("Ellipse"), + NULL, + N_("Create ellipse/circle object"), + G_CALLBACK (gl_ui_cmd_objects_create_ellipse) }, + + { "ObjectsCreateImage", + GL_STOCK_IMAGE, + N_("Image"), + NULL, + N_("Create image object"), + G_CALLBACK (gl_ui_cmd_objects_create_image) }, + + { "ObjectsCreateBarcode", + GL_STOCK_BARCODE, + N_("Barcode"), + NULL, + N_("Create barcode object"), + G_CALLBACK (gl_ui_cmd_objects_create_barcode) }, + + { "ObjectsRaise", + GL_STOCK_ORDER_TOP, + N_("Bring to front"), + NULL, + N_("Raise object to top"), + G_CALLBACK (gl_ui_cmd_objects_raise) }, + + { "ObjectsLower", + GL_STOCK_ORDER_BOTTOM, + N_("Send to back"), + NULL, + N_("Lower object to bottom"), + G_CALLBACK (gl_ui_cmd_objects_lower) }, + + { "ObjectsRotateLeft", + GL_STOCK_ROTATE_LEFT, + N_("Rotate left"), + NULL, + N_("Rotate object 90 degrees counter-clockwise"), + G_CALLBACK (gl_ui_cmd_objects_rotate_left) }, + + { "ObjectsRotateRight", + GL_STOCK_ROTATE_RIGHT, + N_("Rotate right"), + NULL, + N_("Rotate object 90 degrees clockwise"), + G_CALLBACK (gl_ui_cmd_objects_rotate_right) }, + + { "ObjectsFlipHorizontal", + GL_STOCK_FLIP_HORIZ, + N_("Flip horizontally"), + NULL, + N_("Flip object horizontally"), + G_CALLBACK (gl_ui_cmd_objects_flip_horiz) }, + + { "ObjectsFlipVertical", + GL_STOCK_FLIP_VERT, + N_("Flip vertically"), + NULL, + N_("Flip object vertically"), + G_CALLBACK (gl_ui_cmd_objects_flip_vert) }, + + { "ObjectsAlignLeft", + GL_STOCK_ALIGN_LEFT, + N_("Align left"), + NULL, + N_("Align objects to left edges"), + G_CALLBACK (gl_ui_cmd_objects_align_left) }, + + { "ObjectsAlignRight", + GL_STOCK_ALIGN_RIGHT, + N_("Align right"), + NULL, + N_("Align objects to right edges"), + G_CALLBACK (gl_ui_cmd_objects_align_right) }, + + { "ObjectsAlignHCenter", + GL_STOCK_ALIGN_HCENTER, + N_("Align horizontal center"), + NULL, + N_("Align objects to horizontal centers"), + G_CALLBACK (gl_ui_cmd_objects_align_hcenter) }, + + { "ObjectsAlignTop", + GL_STOCK_ALIGN_TOP, + N_("Align tops"), + NULL, + N_("Align objects to top edges"), + G_CALLBACK (gl_ui_cmd_objects_align_top) }, + + { "ObjectsAlignBottom", + GL_STOCK_ALIGN_BOTTOM, + N_("Align bottoms"), + NULL, + N_("Align objects to bottom edges"), + G_CALLBACK (gl_ui_cmd_objects_align_bottom) }, + + { "ObjectsAlignVCenter", + GL_STOCK_ALIGN_VCENTER, + N_("Align vertical center"), + NULL, + N_("Align objects to vertical centers"), + G_CALLBACK (gl_ui_cmd_objects_align_vcenter) }, + + { "ObjectsCenterHorizontal", + GL_STOCK_CENTER_HORIZ, + N_("Center horizontally"), + NULL, + N_("Center objects to horizontal label center"), + G_CALLBACK (gl_ui_cmd_objects_center_horiz) }, + + { "ObjectsCenterVertical", + GL_STOCK_CENTER_VERT, + N_("Center vertically"), + NULL, + N_("Center objects to vertical label center"), + G_CALLBACK (gl_ui_cmd_objects_center_vert) }, + + { "ObjectsMergeProperties", + GL_STOCK_MERGE, + N_("Merge properties"), + NULL, + N_("Edit merge properties"), + G_CALLBACK (gl_ui_cmd_objects_merge_properties) }, + + + /* Help actions entries. */ + { "HelpContents", + GTK_STOCK_HELP, + N_("Contents"), + "F1", + N_("Open glabels manual"), + G_CALLBACK (gl_ui_cmd_help_contents) }, + + { "HelpAbout", + GTK_STOCK_ABOUT, + N_("About..."), + NULL, + N_("About glabels"), + G_CALLBACK (gl_ui_cmd_help_about) }, + +}; +static guint n_entries = G_N_ELEMENTS (entries); + +static GtkToggleActionEntry toggle_entries[] = { + + { "ViewPropertyToolBar", + NULL, + N_("Property toolbar"), + NULL, + N_("Change the visibility of the property toolbar in the current window"), + G_CALLBACK (gl_ui_cmd_view_property_bar_toggle), + TRUE }, + + { "ViewPropertyToolBarToolTips", + NULL, + N_("Show tooltips"), + NULL, + N_("Show tooltips for property toolbar"), + G_CALLBACK (gl_ui_cmd_view_property_bar_tips_toggle), + TRUE }, + + { "ViewGrid", + NULL, + N_("Grid"), + NULL, + N_("Change the visibility of the grid in the current window"), + G_CALLBACK (gl_ui_cmd_view_grid_toggle), + TRUE }, + + { "ViewMarkup", + NULL, + N_("Markup"), + NULL, + N_("Change the visibility of markup lines in the current window"), + G_CALLBACK (gl_ui_cmd_view_markup_toggle), + TRUE }, + +}; +static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries); + +static GtkToggleActionEntry ui_toggle_entries[] = { + + { "ViewMainToolBar", + NULL, + N_("Main toolbar"), + NULL, + N_("Change the visibility of the main toolbar in the current window"), + G_CALLBACK (view_ui_item_toggled_cb), + TRUE }, + + { "ViewDrawingToolBar", + NULL, + N_("Drawing toolbar"), + NULL, + N_("Change the visibility of the drawing toolbar in the current window"), + G_CALLBACK (view_ui_item_toggled_cb), + TRUE }, + + { "ViewMainToolBarToolTips", + NULL, + N_("Show tooltips"), + NULL, + N_("Show tooltips for main toolbar"), + G_CALLBACK (view_ui_item_toggled_cb), + TRUE }, + + { "ViewDrawingToolBarToolTips", + NULL, + N_("Show tooltips"), + NULL, + N_("Show tooltips for drawing toolbar"), + G_CALLBACK (view_ui_item_toggled_cb), + TRUE }, + +}; +static guint n_ui_toggle_entries = G_N_ELEMENTS (ui_toggle_entries); + +static const gchar *ui_info = +"" +"" +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +"" +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +"" +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +"" +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +" " +"" +" " +" " +" " +"" +""; + + +static gchar* doc_verbs [] = { + "/ui/MenuBar/FileMenu/FileProperties", + "/ui/MenuBar/FileMenu/FileSave", + "/ui/MenuBar/FileMenu/FileSaveAs", + "/ui/MenuBar/FileMenu/FilePrint", + "/ui/MenuBar/FileMenu/FileClose", + "/ui/MenuBar/EditMenu/EditCut", + "/ui/MenuBar/EditMenu/EditCopy", + "/ui/MenuBar/EditMenu/EditPaste", + "/ui/MenuBar/EditMenu/EditDelete", + "/ui/MenuBar/EditMenu/EditSelectAll", + "/ui/MenuBar/EditMenu/EditUnSelectAll", + "/ui/MenuBar/ViewMenu/ViewZoomIn", + "/ui/MenuBar/ViewMenu/ViewZoomOut", + "/ui/MenuBar/ViewMenu/ViewZoom1to1", + "/ui/MenuBar/ViewMenu/ViewZoomToFit", + "/ui/MenuBar/ViewMenu/ViewGrid", + "/ui/MenuBar/ViewMenu/ViewMarkup", + "/ui/MenuBar/ObjectsMenu/ObjectsArrowMode", + "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateText", + "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateLine", + "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateBox", + "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateEllipse", + "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateImage", + "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateBarcode", + "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsRaise", + "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsLower", + "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateLeft", + "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateRight", + "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipHorizontal", + "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipVertical", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignLeft", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignRight", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignHCenter", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsCenterHorizontal", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignTop", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignBottom", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignVCenter", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsCenterVertical", + "/ui/MenuBar/ObjectsMenu/ObjectsMergeProperties", + + NULL +}; + +static gchar* doc_modified_verbs [] = { + "/ui/MenuBar/FileMenu/FileSave", + + NULL +}; + +static gchar* selection_verbs [] = { + "/ui/MenuBar/EditMenu/EditCut", + "/ui/MenuBar/EditMenu/EditCopy", + "/ui/MenuBar/EditMenu/EditDelete", + "/ui/MenuBar/EditMenu/EditUnSelectAll", + "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsRaise", + "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsLower", + "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateLeft", + "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateRight", + "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipHorizontal", + "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipVertical", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsCenterHorizontal", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsCenterVertical", + + NULL +}; + +static gchar* atomic_selection_verbs [] = { + + NULL +}; + +static gchar* multi_selection_verbs [] = { + "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignLeft", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignRight", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignHCenter", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignTop", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignBottom", + "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignVCenter", + + NULL +}; + + +/*****************************************************************************/ +/** Initialize UI component for given window. */ +/*****************************************************************************/ +GtkUIManager * +gl_ui_new (glWindow *window) +{ + GtkUIManager *ui; + GtkActionGroup *actions; + GError *error = NULL; + GtkWidget *recent_menu; + + gl_debug (DEBUG_UI, "START"); + + g_return_val_if_fail (window && GL_IS_WINDOW (window), NULL); + + gl_debug (DEBUG_UI, "window = %p", window); + + ui = gtk_ui_manager_new (); + + g_signal_connect (ui, "connect_proxy", + G_CALLBACK (connect_proxy_cb), window); + g_signal_connect (ui, "disconnect_proxy", + G_CALLBACK (disconnect_proxy_cb), window); + + actions = gtk_action_group_new ("Actions"); + gtk_action_group_set_translation_domain (actions, NULL); + gtk_action_group_add_actions (actions, entries, n_entries, GTK_WINDOW (window)); + gtk_action_group_add_toggle_actions (actions, + toggle_entries, n_toggle_entries, + window); + gtk_action_group_add_toggle_actions (actions, + ui_toggle_entries, n_ui_toggle_entries, + ui); + + gtk_ui_manager_insert_action_group (ui, actions, 0); + gtk_window_add_accel_group (GTK_WINDOW (window), gtk_ui_manager_get_accel_group (ui)); + + gl_debug (DEBUG_UI, "Creating ui from string"); + if (!gtk_ui_manager_add_ui_from_string (ui, ui_info, strlen (ui_info), &error)) { + g_message ("building menus failed: %s", error->message); + g_error_free (error); + } + + /* Set the toolbar styles according to prefs */ + set_app_main_toolbar_style (ui); + set_app_drawing_toolbar_style (ui); + + /* Set view grid and markup visibility according to prefs */ + set_view_style (ui); + + /* add an Open Recents Submenu */ + recent_menu = gl_recent_create_menu (); + g_signal_connect (G_OBJECT (recent_menu), "item-activated", + G_CALLBACK (gl_ui_cmd_file_open_recent), window); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (gtk_ui_manager_get_widget (ui, "/MenuBar/FileMenu/FileRecentsMenu")), + recent_menu); + + + gl_ui_util_set_verb_list_sensitive (ui, doc_verbs, FALSE); + + gl_debug (DEBUG_UI, "END"); + + return ui; +} + +/*****************************************************************************/ +/** Unref wrapper. */ +/*****************************************************************************/ +void +gl_ui_unref (GtkUIManager *ui) +{ + gl_debug (DEBUG_UI, "START"); + + g_object_unref(ui); + + gl_debug (DEBUG_UI, "END"); +} + +/*****************************************************************************/ +/** Update all verbs of given UI component. */ +/*****************************************************************************/ +void +gl_ui_update_all (GtkUIManager *ui, + glView *view) +{ + glLabel *label; + + gl_debug (DEBUG_UI, "START"); + + gl_ui_util_set_verb_list_sensitive (ui, doc_verbs, TRUE); + + label = view->label; + g_return_if_fail (label != NULL); + + gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditUndo", + gl_label_can_undo (label)); + gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditRedo", + gl_label_can_redo (label)); + + gl_ui_util_set_verb_list_sensitive (ui, doc_modified_verbs, + gl_label_is_modified (label)); + + gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomIn", + !gl_view_is_zoom_max (view)); + gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomOut", + !gl_view_is_zoom_min (view)); + + gl_ui_util_set_verb_list_sensitive (ui, selection_verbs, + !gl_view_is_selection_empty (view)); + + gl_ui_util_set_verb_list_sensitive (ui, atomic_selection_verbs, + gl_view_is_selection_atomic (view)); + + gl_ui_util_set_verb_list_sensitive (ui, multi_selection_verbs, + !gl_view_is_selection_empty (view) + && !gl_view_is_selection_atomic (view)); + + gl_debug (DEBUG_UI, "END"); +} + +/*****************************************************************************/ +/** Update all verbs of given UI component to "no document" state. */ +/*****************************************************************************/ +void +gl_ui_update_nodoc (GtkUIManager *ui) +{ + gl_debug (DEBUG_UI, "START"); + + gl_ui_util_set_verb_list_sensitive (ui, doc_verbs, FALSE); + + gl_debug (DEBUG_UI, "END"); +} + +/*****************************************************************************/ +/** Update label modified verbs of given UI component. */ +/*****************************************************************************/ +void +gl_ui_update_modified_verbs (GtkUIManager *ui, + glLabel *label) +{ + gl_debug (DEBUG_UI, "START"); + + gl_ui_util_set_verb_list_sensitive (ui, + doc_modified_verbs, + gl_label_is_modified (label)); + + gl_debug (DEBUG_UI, "END"); +} + +/*****************************************************************************/ +/** Update verbs associated with selection state of given UI component. */ +/*****************************************************************************/ +void +gl_ui_update_selection_verbs (GtkUIManager *ui, + glView *view) +{ + gl_debug (DEBUG_UI, "START"); + + gl_ui_util_set_verb_list_sensitive (ui, selection_verbs, + !gl_view_is_selection_empty (view)); + + gl_ui_util_set_verb_list_sensitive (ui, atomic_selection_verbs, + gl_view_is_selection_atomic (view)); + + gl_ui_util_set_verb_list_sensitive (ui, multi_selection_verbs, + !gl_view_is_selection_empty (view) + && !gl_view_is_selection_atomic (view)); + + gl_debug (DEBUG_UI, "END"); +} + +/*****************************************************************************/ +/** Update verbs associated with zoom level of given UI component. */ +/*****************************************************************************/ +void +gl_ui_update_zoom_verbs (GtkUIManager *ui, + glView *view) +{ + gl_debug (DEBUG_UI, "START"); + + gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomIn", + !gl_view_is_zoom_max (view)); + gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomOut", + !gl_view_is_zoom_min (view)); + + gl_debug (DEBUG_UI, "END"); +} + +/*****************************************************************************/ +/** Update undo/redo verbs of given UI component. */ +/*****************************************************************************/ +void +gl_ui_update_undo_redo_verbs (GtkUIManager *ui, + glLabel *label) +{ + gl_debug (DEBUG_UI, "START"); + + gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditUndo", + gl_label_can_undo (label)); + + gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditRedo", + gl_label_can_redo (label)); + + gl_debug (DEBUG_UI, "END"); +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. View menu item toggled callback. */ +/*---------------------------------------------------------------------------*/ +static void +view_ui_item_toggled_cb (GtkToggleAction *action, + GtkUIManager *ui) +{ + const gchar *name; + gboolean state; + + gl_debug (DEBUG_UI, "START"); + + g_return_if_fail (action && GTK_IS_TOGGLE_ACTION (action)); + + name = gtk_action_get_name (GTK_ACTION (action)); + state = gtk_toggle_action_get_active (action); + + gl_debug (DEBUG_UI, "Action = %s, State = %d", name, state); + + if (strcmp (name, "ViewMainToolBar") == 0) + { + gl_prefs->main_toolbar_visible = state; + set_app_main_toolbar_style (ui); + gl_prefs_model_save_settings (gl_prefs); + } + + if (strcmp (name, "ViewMainToolBarToolTips") == 0) + { + gl_prefs->main_toolbar_view_tooltips = state; + set_app_main_toolbar_style (ui); + gl_prefs_model_save_settings (gl_prefs); + } + + if (strcmp (name, "ViewDrawingToolBar") == 0) + { + gl_prefs->drawing_toolbar_visible = state; + set_app_drawing_toolbar_style (ui); + gl_prefs_model_save_settings (gl_prefs); + } + + if (strcmp (name, "ViewDrawingToolBarToolTips") == 0) + { + gl_prefs->drawing_toolbar_view_tooltips = state; + set_app_drawing_toolbar_style (ui); + gl_prefs_model_save_settings (gl_prefs); + } + + gl_debug (DEBUG_UI, ""); +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. Set main toolbar style. */ +/*---------------------------------------------------------------------------*/ +static void +set_app_main_toolbar_style (GtkUIManager *ui) +{ + GtkWidget *toolbar; + + gl_debug (DEBUG_UI, "START"); + + g_return_if_fail (ui && GTK_IS_UI_MANAGER (ui)); + + /* Updated view menu */ + gl_ui_util_set_verb_state (ui, "/ui/ViewMenu/ViewMainToolBar", + gl_prefs->main_toolbar_visible); + + gl_ui_util_set_verb_sensitive (ui, "/ui/ViewMenu/ViewMainToolBarToolTips", + gl_prefs->main_toolbar_visible); + + gl_ui_util_set_verb_state (ui, "/ui/ViewMenu/ViewMainToolBarToolTips", + gl_prefs->main_toolbar_view_tooltips); + + + toolbar = gtk_ui_manager_get_widget (ui, "/MainToolBar"); + + gtk_toolbar_set_tooltips (GTK_TOOLBAR (toolbar), + gl_prefs->main_toolbar_view_tooltips); + + if (gl_prefs->main_toolbar_visible) { + gtk_widget_show_all (toolbar); + } else { + gtk_widget_hide (toolbar); + } + + gl_debug (DEBUG_UI, "END"); +} + + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. Set drawing toolbar style. */ +/*---------------------------------------------------------------------------*/ +static void +set_app_drawing_toolbar_style (GtkUIManager *ui) +{ + GtkWidget *toolbar; + + gl_debug (DEBUG_UI, "START"); + + g_return_if_fail (ui && GTK_IS_UI_MANAGER (ui)); + + /* Updated view menu */ + gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenu/ViewDrawingToolBar", + gl_prefs->drawing_toolbar_visible); + + gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewDrawingToolBarToolTips", + gl_prefs->drawing_toolbar_visible); + + gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenuDrawingToolBarToolTips", + gl_prefs->drawing_toolbar_view_tooltips); + + + toolbar = gtk_ui_manager_get_widget (ui, "/DrawingToolBar"); + + gtk_toolbar_set_tooltips (GTK_TOOLBAR (toolbar), + gl_prefs->drawing_toolbar_view_tooltips); + + gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS); + + if (gl_prefs->drawing_toolbar_visible) { + gtk_widget_show_all (toolbar); + } else { + gtk_widget_hide (toolbar); + } + + gl_debug (DEBUG_UI, "END"); +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. Set visibility of grid and markup. */ +/*---------------------------------------------------------------------------*/ +static void +set_view_style (GtkUIManager *ui) +{ + gl_debug (DEBUG_UI, "START"); + + g_return_if_fail (ui && GTK_IS_UI_MANAGER(ui)); + + gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenu/ViewGrid", + gl_prefs->grid_visible); + + gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenu/ViewMarkup", + gl_prefs->markup_visible); + + gl_debug (DEBUG_UI, "END"); +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. Connect proxy callback. */ +/*---------------------------------------------------------------------------*/ +static void +connect_proxy_cb (GtkUIManager *ui, + GtkAction *action, + GtkWidget *proxy, + glWindow *window) +{ + if (GTK_IS_MENU_ITEM (proxy)) + { + g_signal_connect (proxy, "select", + G_CALLBACK (menu_item_select_cb), window); + g_signal_connect (proxy, "deselect", + G_CALLBACK (menu_item_deselect_cb), window); + } +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. Disconnect proxy callback. */ +/*---------------------------------------------------------------------------*/ +static void +disconnect_proxy_cb (GtkUIManager *ui, + GtkAction *action, + GtkWidget *proxy, + glWindow *window) +{ + if (GTK_IS_MENU_ITEM (proxy)) + { + g_signal_handlers_disconnect_by_func + (proxy, G_CALLBACK (menu_item_select_cb), window); + g_signal_handlers_disconnect_by_func + (proxy, G_CALLBACK (menu_item_deselect_cb), window); + } +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. Menu item select callback. */ +/*---------------------------------------------------------------------------*/ +static void +menu_item_select_cb (GtkMenuItem *proxy, + glWindow *window) +{ + GtkAction *action; + char *message; + + g_return_if_fail (window && GL_IS_WINDOW (window)); + g_return_if_fail (window->status_bar && GTK_IS_STATUSBAR (window->status_bar)); + + action = g_object_get_data (G_OBJECT (proxy), "gtk-action"); + g_return_if_fail (action != NULL); + + g_object_get (G_OBJECT (action), "tooltip", &message, NULL); + if (message) + { + gtk_statusbar_push (GTK_STATUSBAR (window->status_bar), + window->menu_tips_context_id, message); + g_free (message); + } +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. Menu item deselect callback. */ +/*---------------------------------------------------------------------------*/ +static void +menu_item_deselect_cb (GtkMenuItem *proxy, + glWindow *window) +{ + g_return_if_fail (window && GL_IS_WINDOW (window)); + g_return_if_fail (window->status_bar && GTK_IS_STATUSBAR (window->status_bar)); + + gtk_statusbar_pop (GTK_STATUSBAR (window->status_bar), + window->menu_tips_context_id); +} + diff --git a/src/ui.h b/src/ui.h new file mode 100644 index 00000000..19135d53 --- /dev/null +++ b/src/ui.h @@ -0,0 +1,57 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * ui.h: GLabels UI module header file + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __GL_UI_H__ +#define __GL_UI_H__ + +#include + +#include "window.h" +#include "view.h" + +G_BEGIN_DECLS + +GtkUIManager *gl_ui_new (glWindow *window); + +void gl_ui_unref (GtkUIManager *ui); + +void gl_ui_update_all (GtkUIManager *ui, + glView *view); + +void gl_ui_update_nodoc (GtkUIManager *ui); + +void gl_ui_update_modified_verbs (GtkUIManager *ui, + glLabel *label); + +void gl_ui_update_selection_verbs (GtkUIManager *ui, + glView *view); + +void gl_ui_update_zoom_verbs (GtkUIManager *ui, + glView *view); + +void gl_ui_update_undo_redo_verbs (GtkUIManager *ui, + glLabel *label); + +G_END_DECLS + +#endif /* __GL_UI_H__ */ diff --git a/src/util.c b/src/util.c new file mode 100644 index 00000000..1e852eca --- /dev/null +++ b/src/util.c @@ -0,0 +1,345 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * util.c: various small utility functions + * + * Copyright (C) 2001 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "util.h" + +#include +#include +#include +#include +#include +#include +#include + +#define FRAC_EPSILON 0.00005 + + +/****************************************************************************/ +/* Append ".glabels" extension to filename if needed. */ +/****************************************************************************/ +gchar * +gl_util_add_extension (const gchar *orig_filename) +{ + gchar *new_filename, *extension; + + extension = strrchr (orig_filename, '.'); + if (extension == NULL) { + new_filename = g_strconcat (orig_filename, ".glabels", NULL); + } else { + if (g_strcasecmp (extension, ".glabels") != 0) { + new_filename = + g_strconcat (orig_filename, ".glabels", NULL); + } else { + new_filename = g_strdup (orig_filename); + } + } + + return new_filename; +} + +/****************************************************************************/ +/* Remove ".glabels" extension from filename if needed. */ +/****************************************************************************/ +gchar * +gl_util_remove_extension (const gchar *orig_filename) +{ + gchar *new_filename, *extension; + + new_filename = g_strdup (orig_filename); + + extension = strrchr (new_filename, '.'); + if (extension != NULL) { + if (g_strcasecmp (extension, ".glabels") == 0) { + *extension = 0; /* truncate string, rm extension */ + } + } + + return new_filename; +} + +/****************************************************************************/ +/* Make sure we have an absolute path to filename. */ +/****************************************************************************/ +gchar * +gl_util_make_absolute (const gchar *filename) +{ + gchar *pwd, *absolute_filename; + + if (g_path_is_absolute (filename)) { + absolute_filename = g_strdup (filename); + } else { + pwd = g_get_current_dir (); + absolute_filename = g_build_filename (pwd, filename, NULL); + g_free (pwd); + } + + return absolute_filename; +} + +/****************************************************************************/ +/* Create fractional representation of number, if possible. */ +/****************************************************************************/ +gchar * +gl_util_fraction (gdouble x) +{ + static gdouble denom[] = { 1., 2., 3., 4., 8., 16., 32., 0. }; + gint i; + gdouble product, remainder; + gint n, d; + + for ( i=0; denom[i] != 0.0; i++ ) { + product = x * denom[i]; + remainder = fabs(product - ((gint)(product+0.5))); + if ( remainder < FRAC_EPSILON ) break; + } + + if ( denom[i] == 0.0 ) { + /* None of our denominators work. */ + return g_strdup_printf ("%.5g", x); + } + if ( denom[i] == 1.0 ) { + /* Simple integer. */ + return g_strdup_printf ("%d", (gint)x); + } + n = (gint)( x * denom[i] + 0.5 ); + d = (gint)denom[i]; + if ( n > d ) { + return g_strdup_printf ("%d_%d/%d", (n/d), (n%d), d); + } else { + return g_strdup_printf ("%d/%d", (n%d), d); + } +} + +/****************************************************************************/ +/* Utilities to deal with PangoAlignment types. */ +/****************************************************************************/ +const gchar * +gl_util_align_to_string (PangoAlignment align) +{ + switch (align) { + case PANGO_ALIGN_LEFT: + return "Left"; + case PANGO_ALIGN_CENTER: + return "Center"; + case PANGO_ALIGN_RIGHT: + return "Right"; + default: + return "?"; + } +} + +PangoAlignment +gl_util_string_to_align (const gchar *string) +{ + + if (g_strcasecmp (string, "Left") == 0) { + return PANGO_ALIGN_LEFT; + } else if (g_strcasecmp (string, "Center") == 0) { + return PANGO_ALIGN_CENTER; + } else if (g_strcasecmp (string, "Right") == 0) { + return PANGO_ALIGN_RIGHT; + } else { + return PANGO_ALIGN_LEFT; + } + +} + +/****************************************************************************/ +/* Utilities to deal with PangoWeight types */ +/****************************************************************************/ +const gchar * +gl_util_weight_to_string (PangoWeight weight) +{ + switch (weight) { + case PANGO_WEIGHT_NORMAL: + return "Regular"; + case PANGO_WEIGHT_BOLD: + return "Bold"; + default: + return "?"; + } +} + +PangoWeight +gl_util_string_to_weight (const gchar *string) +{ + + if (g_strcasecmp (string, "Regular") == 0) { + return PANGO_WEIGHT_NORMAL; + } else if (g_strcasecmp (string, "Bold") == 0) { + return PANGO_WEIGHT_BOLD; + } else { + return PANGO_WEIGHT_NORMAL; + } + +} + +/****************************************************************************/ +/* Convienience function to set strings in a text combo_box from a GList */ +/****************************************************************************/ +void +gl_util_combo_box_set_strings (GtkComboBox *combo, + GList *list) +{ + GtkTreeModel *model; + GList *p; + + g_return_if_fail (list); + + model = gtk_combo_box_get_model(combo); + gtk_list_store_clear (GTK_LIST_STORE (model)); + + for (p=list; p!=NULL; p=p->next) { + if (p->data) { + gtk_combo_box_append_text (combo, p->data); + } + } +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. gl_util_combo_box_set_active_text support. */ +/*---------------------------------------------------------------------------*/ + +typedef struct { + const gchar *text; + GtkTreeIter iter; + gboolean found; +} TextSearchData; + +static gboolean +search_text_func (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data) +{ + TextSearchData *search_data = (TextSearchData *)data; + gchar *text = NULL; + + gtk_tree_model_get (model, iter, 0, &text, -1); + + if (strcmp (text,search_data->text) == 0) { + search_data->found = TRUE; + search_data->iter = *iter; + } + + g_free (text); + + return FALSE; +} + +/****************************************************************************/ +/* Convienience function to set active text in a text combo_box from text */ +/****************************************************************************/ +void +gl_util_combo_box_set_active_text (GtkComboBox *combo, + const gchar *text) +{ + GtkTreeModel *model = gtk_combo_box_get_model(combo); + + g_return_if_fail (GTK_IS_LIST_STORE (model)); + + if (!text) { + + gtk_combo_box_set_active (combo, -1); + + } else { + TextSearchData search_data; + + search_data.text = text; + search_data.found = FALSE; + + gtk_tree_model_foreach (model, search_text_func, &search_data); + if (search_data.found) { + gtk_combo_box_set_active_iter (combo, + &search_data.iter); + } else { + gtk_combo_box_set_active (combo, -1); + } + + } + +} + +/****************************************************************************/ +/* Convienience function to add a simple text model to an existing */ +/* combo_box. This is needed since combo_boxes created with glade do not */ +/* use the gtk_combo_box_new_text() constructor. */ +/****************************************************************************/ +void +gl_util_combo_box_add_text_model (GtkComboBox *combo) +{ + GtkCellRenderer *cell; + GtkListStore *store; + + store = gtk_list_store_new (1, G_TYPE_STRING); + gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store)); + g_object_unref (store); + + cell = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, + "text", 0, + NULL); +} + + +/****************************************************************************/ +/* Get list of available font families. */ +/****************************************************************************/ +GList * +gl_util_get_font_family_list (void) +{ + static GList *list = NULL; + PangoFontMap *fontmap; + PangoContext *context; + PangoFontFamily **families; + gint n; + gint i; + gchar *name; + + if ( !list ) + { + fontmap = pango_cairo_font_map_new (); + context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap)); + + pango_context_list_families (context, &families, &n); + + for ( i=0; i. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __UTIL_H__ +#define __UTIL_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +gchar *gl_util_add_extension (const gchar *orig_filename); +gchar *gl_util_remove_extension (const gchar *orig_filename); + +gchar *gl_util_make_absolute (const gchar *filename); + +gchar *gl_util_fraction (gdouble x); + +const gchar *gl_util_align_to_string (PangoAlignment align); +PangoAlignment gl_util_string_to_align (const gchar *string); + +const gchar *gl_util_weight_to_string (PangoWeight weight); +PangoWeight gl_util_string_to_weight (const gchar *string); + +void gl_util_combo_box_set_strings (GtkComboBox *combo, + GList *list); +void gl_util_combo_box_set_active_text (GtkComboBox *combo, + const gchar *text); +void gl_util_combo_box_add_text_model (GtkComboBox *combo); + +GList *gl_util_get_font_family_list (void); + +G_END_DECLS + +#endif /* __UTIL_H__ */ diff --git a/src/view-barcode.c b/src/view-barcode.c new file mode 100644 index 00000000..522d334c --- /dev/null +++ b/src/view-barcode.c @@ -0,0 +1,424 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_barcode.c: GLabels label barcode object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "view-barcode.h" + +#include +#include + +#include "color.h" +#include "object-editor.h" +#include "stock.h" + +#include "pixmaps/cursor_barcode.xbm" +#include "pixmaps/cursor_barcode_mask.xbm" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glViewBarcodePrivate { +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_view_barcode_finalize (GObject *object); + +static GtkWidget *construct_properties_editor (glViewObject *view_object); + +static void update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object); + +static void update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor); + +static void update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor); + +static gboolean object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y); + + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glViewBarcode, gl_view_barcode, GL_TYPE_VIEW_OBJECT); + + +static void +gl_view_barcode_class_init (glViewBarcodeClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); + + gl_debug (DEBUG_VIEW, "START"); + + gl_view_barcode_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_view_barcode_finalize; + + view_object_class->construct_editor = construct_properties_editor; + view_object_class->object_at = object_at; + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_barcode_init (glViewBarcode *view_barcode) +{ + gl_debug (DEBUG_VIEW, "START"); + + view_barcode->priv = g_new0 (glViewBarcodePrivate, 1); + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_barcode_finalize (GObject *object) +{ + glViewBarcode *view_barcode = GL_VIEW_BARCODE (object); + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (object && GL_IS_VIEW_BARCODE (object)); + + g_free (view_barcode->priv); + + G_OBJECT_CLASS (gl_view_barcode_parent_class)->finalize (object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* NEW barcode object view. */ +/*****************************************************************************/ +glViewObject * +gl_view_barcode_new (glLabelBarcode *object, + glView *view) +{ + glViewBarcode *view_barcode; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_BARCODE (object), NULL); + g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); + + view_barcode = g_object_new (gl_view_barcode_get_type(), NULL); + + gl_view_object_set_object (GL_VIEW_OBJECT(view_barcode), + GL_LABEL_OBJECT(object), + GL_VIEW_OBJECT_HANDLES_BOX); + gl_view_object_set_view (GL_VIEW_OBJECT(view_barcode), view); + + gl_debug (DEBUG_VIEW, "END"); + + return GL_VIEW_OBJECT (view_barcode); +} + +/*****************************************************************************/ +/* Create a properties dialog for a barcode object. */ +/*****************************************************************************/ +static GtkWidget * +construct_properties_editor (glViewObject *view_object) +{ + GtkWidget *editor; + glViewBarcode *view_bc = (glViewBarcode *)view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + object = gl_view_object_get_object (GL_VIEW_OBJECT(view_bc)); + + /* Build editor. */ + editor = gl_object_editor_new (GL_STOCK_BARCODE, _("Barcode object properties"), + object->parent, + GL_OBJECT_EDITOR_POSITION_PAGE, + GL_OBJECT_EDITOR_SIZE_PAGE, + GL_OBJECT_EDITOR_BC_PAGE, + GL_OBJECT_EDITOR_DATA_PAGE, + 0); + + /* Update */ + update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); + update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); + + /* Connect signals. */ + g_signal_connect (G_OBJECT (editor), "changed", + G_CALLBACK(update_object_from_editor_cb), object); + g_signal_connect (G_OBJECT (object), "changed", + G_CALLBACK (update_editor_from_object_cb), editor); + g_signal_connect (G_OBJECT (object), "moved", + G_CALLBACK (update_editor_from_move_cb), editor); + + gl_debug (DEBUG_VIEW, "END"); + + return editor; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. editor "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object) +{ + gdouble x, y, w, h; + glTextNode *text_node; + gchar *id; + gboolean text_flag, cs_flag; + glColorNode *color_node; + guint format_digits; + + gl_debug (DEBUG_VIEW, "START"); + + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + + gl_object_editor_get_position (editor, &x, &y); + gl_label_object_set_position (object, x, y); + + gl_object_editor_get_size (editor, &w, &h); + gl_label_object_set_size (object, w, h); + + text_node = gl_object_editor_get_data (editor); + gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node); + gl_text_node_free (&text_node); + + gl_object_editor_get_bc_style (editor, &id, &text_flag, &cs_flag, &format_digits); + color_node = gl_object_editor_get_bc_color (editor); + gl_label_barcode_set_props (GL_LABEL_BARCODE(object), + id, text_flag, cs_flag, format_digits); + gl_label_object_set_line_color (object, color_node); + gl_color_node_free (&color_node); + g_free (id); + + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor) +{ + gdouble w, h; + glTextNode *text_node; + gchar *id; + gboolean text_flag, cs_flag; + glColorNode *color_node; + glMerge *merge; + guint format_digits; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_size (object, &w, &h); + gl_object_editor_set_size (editor, w, h); + + merge = gl_label_get_merge (GL_LABEL(object->parent)); + + gl_label_barcode_get_props (GL_LABEL_BARCODE(object), + &id, &text_flag, &cs_flag, &format_digits); + color_node = gl_label_object_get_line_color (object); + gl_object_editor_set_bc_style (editor, id, text_flag, cs_flag, format_digits); + gl_object_editor_set_bc_color (editor, (merge != NULL), color_node); + gl_color_node_free (&color_node); + g_free (id); + + text_node = gl_label_barcode_get_data (GL_LABEL_BARCODE(object)); + gl_object_editor_set_data (editor, (merge != NULL), text_node); + gl_text_node_free (&text_node); + + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "moved" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor) +{ + gdouble x, y; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_position (object, &x, &y); + gl_object_editor_set_position (editor, x, y); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Is object at (x,y)? */ +/*****************************************************************************/ +static gboolean +object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y) +{ + glLabelObject *object; + gdouble w, h; + + object = gl_view_object_get_object (view_object); + + gl_label_object_get_size (object, &w, &h); + + cairo_rectangle (cr, 0.0, 0.0, w, h); + + if (cairo_in_fill (cr, x, y)) + { + return TRUE; + } + + return FALSE; +} + + +/*****************************************************************************/ +/* Return apropos cursor for create object mode. */ +/*****************************************************************************/ +GdkCursor * +gl_view_barcode_get_create_cursor (void) +{ + GdkCursor *cursor = NULL; + GdkPixmap *pixmap_data, *pixmap_mask; + GdkColor fg = { 0, 0, 0, 0 }; + GdkColor bg = { 0, 65535, 65535, 65535 }; + + gl_debug (DEBUG_VIEW, "START"); + + pixmap_data = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_barcode_bits, + cursor_barcode_width, + cursor_barcode_height); + pixmap_mask = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_barcode_mask_bits, + cursor_barcode_mask_width, + cursor_barcode_mask_height); + cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, + &bg, cursor_barcode_x_hot, + cursor_barcode_y_hot); + + gl_debug (DEBUG_VIEW, "END"); + + return cursor; +} + +/*****************************************************************************/ +/* Object creation handler: button press event. */ +/*****************************************************************************/ +void +gl_view_barcode_create_button_press_event (glView *view, + gdouble x, + gdouble y) +{ + GObject *object; + glTextNode *text_node; + glColorNode *line_color_node; + + gl_view_unselect_all (view); + + line_color_node = gl_color_node_new_default (); + + object = gl_label_barcode_new (view->label); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + text_node = gl_text_node_new_from_text ("123456789"); + gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node); + line_color_node->color = gl_color_set_opacity (gl_view_get_default_line_color(view), 0.5); + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), + line_color_node); + + gl_color_node_free (&line_color_node); + + view->create_object = GL_LABEL_OBJECT (object); + view->create_x0 = x; + view->create_y0 = y; +} + +/*****************************************************************************/ +/* Object creation handler: motion event. */ +/*****************************************************************************/ +void +gl_view_barcode_create_motion_event (glView *view, + gdouble x, + gdouble y) +{ + gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), x, y); +} + +/*****************************************************************************/ +/* Object creation handler: button relesase event. */ +/*****************************************************************************/ +void +gl_view_barcode_create_button_release_event (glView *view, + gdouble x, + gdouble y) +{ + glColorNode *line_color_node; + + line_color_node = gl_color_node_new_default (); + + gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), x, y); + line_color_node->color = gl_view_get_default_line_color(view); + gl_label_object_set_line_color (GL_LABEL_OBJECT(view->create_object), line_color_node); + gl_color_node_free (&line_color_node); +} + diff --git a/src/view-barcode.h b/src/view-barcode.h new file mode 100644 index 00000000..1587f195 --- /dev/null +++ b/src/view-barcode.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_barcode.h: GLabels label barcode object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __VIEW_BARCODE_H__ +#define __VIEW_BARCODE_H__ + +#include "view-object.h" +#include "label-barcode.h" + +G_BEGIN_DECLS + + +#define GL_TYPE_VIEW_BARCODE (gl_view_barcode_get_type ()) +#define GL_VIEW_BARCODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_BARCODE, glViewBarcode)) +#define GL_VIEW_BARCODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_BARCODE, glViewBarcodeClass)) +#define GL_IS_VIEW_BARCODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_BARCODE)) +#define GL_IS_VIEW_BARCODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_BARCODE)) + +typedef struct _glViewBarcode glViewBarcode; +typedef struct _glViewBarcodeClass glViewBarcodeClass; + +typedef struct _glViewBarcodePrivate glViewBarcodePrivate; + +struct _glViewBarcode { + glViewObject parent_object; + + glViewBarcodePrivate *priv; +}; + +struct _glViewBarcodeClass { + glViewObjectClass parent_class; +}; + + +GType gl_view_barcode_get_type (void) G_GNUC_CONST; + +glViewObject *gl_view_barcode_new (glLabelBarcode *object, + glView *view); + + +/* cursor for creating barcode objects */ +GdkCursor *gl_view_barcode_get_create_cursor (void); + +/* Object creation handlers. */ +void gl_view_barcode_create_button_press_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_barcode_create_motion_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_barcode_create_button_release_event (glView *view, + gdouble x, + gdouble y); + + +G_END_DECLS + +#endif /* __VIEW_BARCODE_H__ */ diff --git a/src/view-box.c b/src/view-box.c new file mode 100644 index 00000000..42f39803 --- /dev/null +++ b/src/view-box.c @@ -0,0 +1,486 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_box.c: GLabels label box object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "view-box.h" + +#include +#include + +#include "color.h" +#include "object-editor.h" +#include "stock.h" + +#include "pixmaps/cursor_box.xbm" +#include "pixmaps/cursor_box_mask.xbm" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glViewBoxPrivate { +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_view_box_finalize (GObject *object); + +static GtkWidget *construct_properties_editor (glViewObject *view_object); + +static void update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object); + +static void update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor); + +static void update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor); + +static gboolean object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y); + + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glViewBox, gl_view_box, GL_TYPE_VIEW_OBJECT); + + +static void +gl_view_box_class_init (glViewBoxClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); + + gl_debug (DEBUG_VIEW, "START"); + + gl_view_box_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_view_box_finalize; + + view_object_class->construct_editor = construct_properties_editor; + view_object_class->object_at = object_at; + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_box_init (glViewBox *view_box) +{ + gl_debug (DEBUG_VIEW, "START"); + + view_box->priv = g_new0 (glViewBoxPrivate, 1); + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_box_finalize (GObject *object) +{ + glViewBox *view_box = GL_VIEW_BOX (object); + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (object && GL_IS_VIEW_BOX (object)); + + g_free (view_box->priv); + + G_OBJECT_CLASS (gl_view_box_parent_class)->finalize (object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* NEW box object view. */ +/*****************************************************************************/ +glViewObject * +gl_view_box_new (glLabelBox *object, + glView *view) +{ + glViewBox *view_box; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_BOX (object), NULL); + g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); + + view_box = g_object_new (gl_view_box_get_type(), NULL); + + gl_view_object_set_object (GL_VIEW_OBJECT(view_box), + GL_LABEL_OBJECT(object), + GL_VIEW_OBJECT_HANDLES_BOX); + gl_view_object_set_view (GL_VIEW_OBJECT(view_box), view); + + gl_debug (DEBUG_VIEW, "END"); + + return GL_VIEW_OBJECT (view_box); +} + +/*****************************************************************************/ +/* Create a properties dialog for a box object. */ +/*****************************************************************************/ +static GtkWidget * +construct_properties_editor (glViewObject *view_object) +{ + GtkWidget *editor; + glViewBox *view_box = (glViewBox *)view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + object = gl_view_object_get_object (GL_VIEW_OBJECT(view_box)); + + /* Build editor. */ + editor = gl_object_editor_new (GL_STOCK_BOX, _("Box object properties"), + object->parent, + GL_OBJECT_EDITOR_SHADOW_PAGE, + GL_OBJECT_EDITOR_POSITION_PAGE, + GL_OBJECT_EDITOR_SIZE_PAGE, + GL_OBJECT_EDITOR_FILL_PAGE, + GL_OBJECT_EDITOR_LINE_PAGE, + 0); + + /* Update */ + update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); + update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); + + /* Connect signals. */ + g_signal_connect (G_OBJECT (editor), "changed", + G_CALLBACK(update_object_from_editor_cb), object); + g_signal_connect (G_OBJECT (object), "changed", + G_CALLBACK (update_editor_from_object_cb), editor); + g_signal_connect (G_OBJECT (object), "moved", + G_CALLBACK (update_editor_from_move_cb), editor); + + gl_debug (DEBUG_VIEW, "END"); + + return editor; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. editor "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object) +{ + gdouble x, y, w, h; + glColorNode *line_color_node; + gdouble line_width; + glColorNode *fill_color_node; + gboolean shadow_state; + gdouble shadow_x, shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + + + gl_debug (DEBUG_VIEW, "START"); + + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_object_editor_get_position (editor, &x, &y); + gl_label_object_set_position (object, x, y); + + gl_object_editor_get_size (editor, &w, &h); + gl_label_object_set_size (object, w, h); + + fill_color_node = gl_object_editor_get_fill_color (editor); + gl_label_object_set_fill_color (object, fill_color_node); + gl_color_node_free (&fill_color_node); + + line_color_node = gl_object_editor_get_line_color (editor); + gl_label_object_set_line_color (object, line_color_node); + gl_color_node_free (&line_color_node); + + line_width = gl_object_editor_get_line_width (editor); + gl_label_object_set_line_width (object, line_width); + + shadow_state = gl_object_editor_get_shadow_state (editor); + gl_label_object_set_shadow_state (object, shadow_state); + + gl_object_editor_get_shadow_offset (editor, &shadow_x, &shadow_y); + gl_label_object_set_shadow_offset (object, shadow_x, shadow_y); + + shadow_color_node = gl_object_editor_get_shadow_color (editor); + gl_label_object_set_shadow_color (object, shadow_color_node); + gl_color_node_free (&shadow_color_node); + + shadow_opacity = gl_object_editor_get_shadow_opacity (editor); + gl_label_object_set_shadow_opacity (object, shadow_opacity); + + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor) +{ + gdouble w, h; + glColorNode *line_color_node; + gdouble line_width; + glColorNode *fill_color_node; + gboolean shadow_state; + gdouble shadow_x, shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + glMerge *merge; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_size (object, &w, &h); + gl_object_editor_set_size (editor, w, h); + merge = gl_label_get_merge (GL_LABEL(object->parent)); + + fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object)); + gl_object_editor_set_fill_color (editor, (merge != NULL), fill_color_node); + gl_color_node_free (&fill_color_node); + + line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); + gl_object_editor_set_line_color (editor, (merge != NULL), line_color_node); + gl_color_node_free (&line_color_node); + + line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); + gl_object_editor_set_line_width (editor, line_width); + + shadow_state = gl_label_object_get_shadow_state (object); + gl_object_editor_set_shadow_state (editor, shadow_state); + + gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); + gl_object_editor_set_shadow_offset (editor, shadow_x, shadow_y); + + shadow_color_node = gl_label_object_get_shadow_color (object); + gl_object_editor_set_shadow_color (editor, (merge != NULL), shadow_color_node); + gl_color_node_free (&shadow_color_node); + + shadow_opacity = gl_label_object_get_shadow_opacity (object); + gl_object_editor_set_shadow_opacity (editor, shadow_opacity); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "moved" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor) +{ + gdouble x, y; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_position (object, &x, &y); + gl_object_editor_set_position (editor, x, y); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Is object at (x,y)? */ +/*****************************************************************************/ +static gboolean +object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y) +{ + glLabelObject *object; + gdouble w, h; + gdouble line_width; + + object = gl_view_object_get_object (view_object); + + gl_label_object_get_size (object, &w, &h); + + cairo_rectangle (cr, 0.0, 0.0, w, h); + + if (cairo_in_fill (cr, x, y)) + { + return TRUE; + } + + line_width = gl_label_object_get_line_width (object); + cairo_set_line_width (cr, line_width); + if (cairo_in_stroke (cr, x, y)) + { + return TRUE; + } + + return FALSE; +} + + +/*****************************************************************************/ +/* Return apropos cursor for create object mode. */ +/*****************************************************************************/ +GdkCursor * +gl_view_box_get_create_cursor (void) +{ + GdkCursor *cursor = NULL; + GdkPixmap *pixmap_data, *pixmap_mask; + GdkColor fg = { 0, 0, 0, 0 }; + GdkColor bg = { 0, 65535, 65535, 65535 }; + + gl_debug (DEBUG_VIEW, "START"); + + pixmap_data = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_box_bits, + cursor_box_width, + cursor_box_height); + pixmap_mask = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_box_mask_bits, + cursor_box_mask_width, + cursor_box_mask_height); + cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, + &bg, cursor_box_x_hot, + cursor_box_y_hot); + + gl_debug (DEBUG_VIEW, "END"); + + return cursor; +} + +/*****************************************************************************/ +/* Object creation handler: button press event. */ +/*****************************************************************************/ +void +gl_view_box_create_button_press_event (glView *view, + gdouble x, + gdouble y) +{ + GObject *object; + glColorNode *fill_color_node; + glColorNode *line_color_node; + + gl_view_unselect_all (view); + + fill_color_node = gl_color_node_new_default (); + line_color_node = gl_color_node_new_default (); + + object = gl_label_box_new (view->label); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + gl_label_object_set_size (GL_LABEL_OBJECT(object), 0.0, 0.0); + line_color_node->color = gl_color_set_opacity (gl_view_get_default_line_color(view), 0.5); + fill_color_node->color = gl_color_set_opacity (gl_view_get_default_fill_color(view), 0.5); + gl_label_object_set_line_width (GL_LABEL_OBJECT(object), + gl_view_get_default_line_width(view)); + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), + line_color_node); + gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), + fill_color_node); + + gl_color_node_free (&fill_color_node); + gl_color_node_free (&line_color_node); + + view->create_object = GL_LABEL_OBJECT (object); + view->create_x0 = x; + view->create_y0 = y; +} + +/*****************************************************************************/ +/* Object creation handler: motion event. */ +/*****************************************************************************/ +void +gl_view_box_create_motion_event (glView *view, + gdouble x, + gdouble y) +{ + gdouble w, h; + + gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), + MIN (x, view->create_x0), MIN (y, view->create_y0)); + w = MAX (x, view->create_x0) - MIN (x, view->create_x0); + h = MAX (y, view->create_y0) - MIN (y, view->create_y0); + gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); +} + +/*****************************************************************************/ +/* Object creation handler: button relesase event. */ +/*****************************************************************************/ +void +gl_view_box_create_button_release_event (glView *view, + gdouble x, + gdouble y) +{ + glColorNode *fill_color_node; + glColorNode *line_color_node; + gdouble w, h; + + fill_color_node = gl_color_node_new_default (); + line_color_node = gl_color_node_new_default (); + + if ((view->create_x0 == x) && (view->create_y0 == y)) { + x = view->create_x0 + 36.0; + y = view->create_y0 + 36.0; + } + gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), + MIN (x, view->create_x0), MIN (y, view->create_y0)); + w = MAX (x, view->create_x0) - MIN (x, view->create_x0); + h = MAX (y, view->create_y0) - MIN (y, view->create_y0); + gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); + line_color_node->color = gl_view_get_default_line_color(view); + gl_label_object_set_line_color (GL_LABEL_OBJECT(view->create_object), line_color_node); + fill_color_node->color = gl_view_get_default_fill_color(view); + gl_label_object_set_fill_color (GL_LABEL_OBJECT(view->create_object), fill_color_node); + gl_color_node_free (&fill_color_node); + gl_color_node_free (&line_color_node); +} + diff --git a/src/view-box.h b/src/view-box.h new file mode 100644 index 00000000..f2ebb058 --- /dev/null +++ b/src/view-box.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_box.h: GLabels label box object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __VIEW_BOX_H__ +#define __VIEW_BOX_H__ + +#include "view-object.h" +#include "label-box.h" + +G_BEGIN_DECLS + + +#define GL_TYPE_VIEW_BOX (gl_view_box_get_type ()) +#define GL_VIEW_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_BOX, glViewBox)) +#define GL_VIEW_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_BOX, glViewBoxClass)) +#define GL_IS_VIEW_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_BOX)) +#define GL_IS_VIEW_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_BOX)) + +typedef struct _glViewBox glViewBox; +typedef struct _glViewBoxClass glViewBoxClass; + +typedef struct _glViewBoxPrivate glViewBoxPrivate; + +struct _glViewBox { + glViewObject parent_object; + + glViewBoxPrivate *priv; +}; + +struct _glViewBoxClass { + glViewObjectClass parent_class; +}; + + +GType gl_view_box_get_type (void) G_GNUC_CONST; + +glViewObject *gl_view_box_new (glLabelBox *object, + glView *view); + + +/* cursor for creating box objects */ +GdkCursor *gl_view_box_get_create_cursor (void); + +/* Object creation handlers. */ +void gl_view_box_create_button_press_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_box_create_motion_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_box_create_button_release_event (glView *view, + gdouble x, + gdouble y); + + +G_END_DECLS + +#endif /* __VIEW_BOX_H__ */ diff --git a/src/view-ellipse.c b/src/view-ellipse.c new file mode 100644 index 00000000..85474704 --- /dev/null +++ b/src/view-ellipse.c @@ -0,0 +1,486 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_ellipse.c: GLabels label ellipse object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "view-ellipse.h" + +#include +#include +#include + +#include "cairo-ellipse-path.h" +#include "color.h" +#include "object-editor.h" +#include "stock.h" + +#include "pixmaps/cursor_ellipse.xbm" +#include "pixmaps/cursor_ellipse_mask.xbm" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glViewEllipsePrivate { +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_view_ellipse_finalize (GObject *object); + +static GtkWidget *construct_properties_editor (glViewObject *view_object); + +static void update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object); + +static void update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor); + +static void update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor); + +static gboolean object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y); + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glViewEllipse, gl_view_ellipse, GL_TYPE_VIEW_OBJECT); + + +static void +gl_view_ellipse_class_init (glViewEllipseClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); + + gl_debug (DEBUG_VIEW, "START"); + + gl_view_ellipse_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_view_ellipse_finalize; + + view_object_class->construct_editor = construct_properties_editor; + view_object_class->object_at = object_at; + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_ellipse_init (glViewEllipse *view_ellipse) +{ + gl_debug (DEBUG_VIEW, "START"); + + view_ellipse->priv = g_new0 (glViewEllipsePrivate, 1); + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_ellipse_finalize (GObject *object) +{ + glViewEllipse *view_ellipse = GL_VIEW_ELLIPSE (object); + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (object && GL_IS_VIEW_ELLIPSE (object)); + + g_free (view_ellipse->priv); + + G_OBJECT_CLASS (gl_view_ellipse_parent_class)->finalize (object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* NEW ellipse object view. */ +/*****************************************************************************/ +glViewObject * +gl_view_ellipse_new (glLabelEllipse *object, + glView *view) +{ + glViewEllipse *view_ellipse; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_ELLIPSE (object), NULL); + g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); + + view_ellipse = g_object_new (gl_view_ellipse_get_type(), NULL); + + gl_view_object_set_object (GL_VIEW_OBJECT(view_ellipse), + GL_LABEL_OBJECT(object), + GL_VIEW_OBJECT_HANDLES_BOX); + gl_view_object_set_view (GL_VIEW_OBJECT(view_ellipse), view); + + gl_debug (DEBUG_VIEW, "END"); + + return GL_VIEW_OBJECT (view_ellipse); +} + +/*****************************************************************************/ +/* Create a properties dialog for a ellipse object. */ +/*****************************************************************************/ +static GtkWidget * +construct_properties_editor (glViewObject *view_object) +{ + GtkWidget *editor; + glViewEllipse *view_ellipse = (glViewEllipse *)view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + object = gl_view_object_get_object (GL_VIEW_OBJECT(view_ellipse)); + + /* Build editor. */ + editor = gl_object_editor_new (GL_STOCK_ELLIPSE, _("Ellipse object properties"), + object->parent, + GL_OBJECT_EDITOR_SHADOW_PAGE, + GL_OBJECT_EDITOR_POSITION_PAGE, + GL_OBJECT_EDITOR_SIZE_PAGE, + GL_OBJECT_EDITOR_FILL_PAGE, + GL_OBJECT_EDITOR_LINE_PAGE, + 0); + + /* Update */ + update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); + update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); + + /* Connect signals. */ + g_signal_connect (G_OBJECT (editor), "changed", + G_CALLBACK(update_object_from_editor_cb), object); + g_signal_connect (G_OBJECT (object), "changed", + G_CALLBACK (update_editor_from_object_cb), editor); + g_signal_connect (G_OBJECT (object), "moved", + G_CALLBACK (update_editor_from_move_cb), editor); + + gl_debug (DEBUG_VIEW, "END"); + + return editor; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. editor "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object) +{ + gdouble x, y, w, h; + glColorNode *line_color_node; + gdouble line_width; + glColorNode *fill_color_node; + gboolean shadow_state; + gdouble shadow_x, shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + + + gl_debug (DEBUG_VIEW, "START"); + + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_object_editor_get_position (editor, &x, &y); + gl_label_object_set_position (object, x, y); + + gl_object_editor_get_size (editor, &w, &h); + gl_label_object_set_size (object, w, h); + + fill_color_node = gl_object_editor_get_fill_color (editor); + gl_label_object_set_fill_color (object, fill_color_node); + gl_color_node_free (&fill_color_node); + + line_color_node = gl_object_editor_get_line_color (editor); + gl_label_object_set_line_color (object, line_color_node); + gl_color_node_free (&line_color_node); + + line_width = gl_object_editor_get_line_width (editor); + gl_label_object_set_line_width (object, line_width); + + shadow_state = gl_object_editor_get_shadow_state (editor); + gl_label_object_set_shadow_state (object, shadow_state); + + gl_object_editor_get_shadow_offset (editor, &shadow_x, &shadow_y); + gl_label_object_set_shadow_offset (object, shadow_x, shadow_y); + + shadow_color_node = gl_object_editor_get_shadow_color (editor); + gl_label_object_set_shadow_color (object, shadow_color_node); + gl_color_node_free (&shadow_color_node); + + shadow_opacity = gl_object_editor_get_shadow_opacity (editor); + gl_label_object_set_shadow_opacity (object, shadow_opacity); + + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor) +{ + gdouble w, h; + glColorNode *line_color_node; + gdouble line_width; + glColorNode *fill_color_node; + gboolean shadow_state; + gdouble shadow_x, shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + glMerge *merge; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_size (object, &w, &h); + gl_object_editor_set_size (editor, w, h); + merge = gl_label_get_merge (GL_LABEL(object->parent)); + + fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object)); + gl_object_editor_set_fill_color (editor, (merge != NULL), fill_color_node); + gl_color_node_free (&fill_color_node); + + line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); + gl_object_editor_set_line_color (editor, (merge != NULL), line_color_node); + gl_color_node_free (&line_color_node); + + line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); + gl_object_editor_set_line_width (editor, line_width); + + shadow_state = gl_label_object_get_shadow_state (object); + gl_object_editor_set_shadow_state (editor, shadow_state); + + gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); + gl_object_editor_set_shadow_offset (editor, shadow_x, shadow_y); + + shadow_color_node = gl_label_object_get_shadow_color (object); + gl_object_editor_set_shadow_color (editor, (merge != NULL), shadow_color_node); + gl_color_node_free (&shadow_color_node); + + shadow_opacity = gl_label_object_get_shadow_opacity (object); + gl_object_editor_set_shadow_opacity (editor, shadow_opacity); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "moved" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor) +{ + gdouble x, y; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_position (object, &x, &y); + gl_object_editor_set_position (editor, x, y); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Is object at (x,y)? */ +/*****************************************************************************/ +static gboolean +object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y) +{ + glLabelObject *object; + gdouble w, h; + gdouble line_width; + + object = gl_view_object_get_object (view_object); + + gl_label_object_get_size (object, &w, &h); + + gl_cairo_ellipse_path (cr, w/2, h/2); + + if (cairo_in_fill (cr, x, y)) + { + return TRUE; + } + + line_width = gl_label_object_get_line_width (object); + cairo_set_line_width (cr, line_width); + if (cairo_in_stroke (cr, x, y)) + { + return TRUE; + } + + return FALSE; +} + + +/*****************************************************************************/ +/* Return apropos cursor for create object mode. */ +/*****************************************************************************/ +GdkCursor * +gl_view_ellipse_get_create_cursor (void) +{ + GdkCursor *cursor = NULL; + GdkPixmap *pixmap_data, *pixmap_mask; + GdkColor fg = { 0, 0, 0, 0 }; + GdkColor bg = { 0, 65535, 65535, 65535 }; + + gl_debug (DEBUG_VIEW, "START"); + + pixmap_data = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_ellipse_bits, + cursor_ellipse_width, + cursor_ellipse_height); + pixmap_mask = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_ellipse_mask_bits, + cursor_ellipse_mask_width, + cursor_ellipse_mask_height); + cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, + &bg, cursor_ellipse_x_hot, + cursor_ellipse_y_hot); + + gl_debug (DEBUG_VIEW, "END"); + + return cursor; +} + +/*****************************************************************************/ +/* Object creation handler: button press event. */ +/*****************************************************************************/ +void +gl_view_ellipse_create_button_press_event (glView *view, + gdouble x, + gdouble y) +{ + GObject *object; + glColorNode *fill_color_node; + glColorNode *line_color_node; + + gl_view_unselect_all (view); + + fill_color_node = gl_color_node_new_default (); + line_color_node = gl_color_node_new_default (); + + object = gl_label_ellipse_new (view->label); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + gl_label_object_set_size (GL_LABEL_OBJECT(object), 0.0, 0.0); + line_color_node->color = gl_color_set_opacity (gl_view_get_default_line_color(view), 0.5); + fill_color_node->color = gl_color_set_opacity (gl_view_get_default_fill_color(view), 0.5); + gl_label_object_set_line_width (GL_LABEL_OBJECT(object), + gl_view_get_default_line_width(view)); + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), + line_color_node); + gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), + fill_color_node); + + gl_color_node_free (&fill_color_node); + gl_color_node_free (&line_color_node); + + view->create_object = GL_LABEL_OBJECT (object); + view->create_x0 = x; + view->create_y0 = y; +} + +/*****************************************************************************/ +/* Object creation handler: motion event. */ +/*****************************************************************************/ +void +gl_view_ellipse_create_motion_event (glView *view, + gdouble x, + gdouble y) +{ + gdouble w, h; + + gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), + MIN (x, view->create_x0), MIN (y, view->create_y0)); + w = MAX (x, view->create_x0) - MIN (x, view->create_x0); + h = MAX (y, view->create_y0) - MIN (y, view->create_y0); + gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); +} + +/*****************************************************************************/ +/* Object creation handler: button relesase event. */ +/*****************************************************************************/ +void +gl_view_ellipse_create_button_release_event (glView *view, + gdouble x, + gdouble y) +{ + glColorNode *fill_color_node; + glColorNode *line_color_node; + gdouble w, h; + + fill_color_node = gl_color_node_new_default (); + line_color_node = gl_color_node_new_default (); + + if ((view->create_x0 == x) && (view->create_y0 == y)) { + x = view->create_x0 + 36.0; + y = view->create_y0 + 36.0; + } + gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), + MIN (x, view->create_x0), MIN (y, view->create_y0)); + w = MAX (x, view->create_x0) - MIN (x, view->create_x0); + h = MAX (y, view->create_y0) - MIN (y, view->create_y0); + gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); + line_color_node->color = gl_view_get_default_line_color(view); + gl_label_object_set_line_color (GL_LABEL_OBJECT(view->create_object), line_color_node); + fill_color_node->color = gl_view_get_default_fill_color(view); + gl_label_object_set_fill_color (GL_LABEL_OBJECT(view->create_object), fill_color_node); + gl_color_node_free (&fill_color_node); + gl_color_node_free (&line_color_node); +} + diff --git a/src/view-ellipse.h b/src/view-ellipse.h new file mode 100644 index 00000000..b6d6aae2 --- /dev/null +++ b/src/view-ellipse.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_ellipse.h: GLabels label ellipse object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __VIEW_ELLIPSE_H__ +#define __VIEW_ELLIPSE_H__ + +#include "view-object.h" +#include "label-ellipse.h" + +G_BEGIN_DECLS + + +#define GL_TYPE_VIEW_ELLIPSE (gl_view_ellipse_get_type ()) +#define GL_VIEW_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_ELLIPSE, glViewEllipse)) +#define GL_VIEW_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_ELLIPSE, glViewEllipseClass)) +#define GL_IS_VIEW_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_ELLIPSE)) +#define GL_IS_VIEW_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_ELLIPSE)) + +typedef struct _glViewEllipse glViewEllipse; +typedef struct _glViewEllipseClass glViewEllipseClass; + +typedef struct _glViewEllipsePrivate glViewEllipsePrivate; + +struct _glViewEllipse { + glViewObject parent_object; + + glViewEllipsePrivate *priv; +}; + +struct _glViewEllipseClass { + glViewObjectClass parent_class; +}; + + +GType gl_view_ellipse_get_type (void) G_GNUC_CONST; + +glViewObject *gl_view_ellipse_new (glLabelEllipse *object, + glView *view); + + +/* cursor for creating ellipse objects */ +GdkCursor *gl_view_ellipse_get_create_cursor (void); + +/* Object creation handlers. */ +void gl_view_ellipse_create_button_press_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_ellipse_create_motion_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_ellipse_create_button_release_event (glView *view, + gdouble x, + gdouble y); + + +G_END_DECLS + +#endif /* __VIEW_ELLIPSE_H__ */ diff --git a/src/view-image.c b/src/view-image.c new file mode 100644 index 00000000..7612284d --- /dev/null +++ b/src/view-image.c @@ -0,0 +1,420 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_image.c: GLabels label image object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "view-image.h" + +#include +#include + +#include "color.h" +#include "object-editor.h" +#include "stock.h" + +#include "pixmaps/cursor_image.xbm" +#include "pixmaps/cursor_image_mask.xbm" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glViewImagePrivate { +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_view_image_finalize (GObject *object); + +static GtkWidget *construct_properties_editor (glViewObject *view_object); + +static void update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object); + +static void update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor); + +static void update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor); + +static gboolean object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y); + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glViewImage, gl_view_image, GL_TYPE_VIEW_OBJECT); + + +static void +gl_view_image_class_init (glViewImageClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); + + gl_debug (DEBUG_VIEW, "START"); + + gl_view_image_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_view_image_finalize; + + view_object_class->construct_editor = construct_properties_editor; + view_object_class->object_at = object_at; + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_image_init (glViewImage *view_image) +{ + gl_debug (DEBUG_VIEW, "START"); + + view_image->priv = g_new0 (glViewImagePrivate, 1); + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_image_finalize (GObject *object) +{ + glViewImage *view_image = GL_VIEW_IMAGE (object); + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (object && GL_IS_VIEW_IMAGE (object)); + + g_free (view_image->priv); + + G_OBJECT_CLASS (gl_view_image_parent_class)->finalize (object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* NEW image object view. */ +/*****************************************************************************/ +glViewObject * +gl_view_image_new (glLabelImage *object, + glView *view) +{ + glViewImage *view_image; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_IMAGE (object), NULL); + g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); + + view_image = g_object_new (gl_view_image_get_type(), NULL); + + gl_view_object_set_object (GL_VIEW_OBJECT(view_image), + GL_LABEL_OBJECT(object), + GL_VIEW_OBJECT_HANDLES_BOX); + gl_view_object_set_view (GL_VIEW_OBJECT(view_image), view); + + gl_debug (DEBUG_VIEW, "END"); + + return GL_VIEW_OBJECT (view_image); +} + +/*****************************************************************************/ +/* Create a properties dialog for a image object. */ +/*****************************************************************************/ +static GtkWidget * +construct_properties_editor (glViewObject *view_object) +{ + GtkWidget *editor; + glViewImage *view_image = (glViewImage *)view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + object = gl_view_object_get_object (GL_VIEW_OBJECT(view_image)); + + /* Build editor. */ + editor = gl_object_editor_new (GL_STOCK_IMAGE, _("Image object properties"), + object->parent, + GL_OBJECT_EDITOR_POSITION_PAGE, + GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE, + GL_OBJECT_EDITOR_IMAGE_PAGE, + 0); + + /* Update */ + update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); + update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); + + /* Connect signals. */ + g_signal_connect (G_OBJECT (editor), "changed", + G_CALLBACK(update_object_from_editor_cb), object); + g_signal_connect (G_OBJECT (object), "changed", + G_CALLBACK (update_editor_from_object_cb), editor); + g_signal_connect (G_OBJECT (object), "moved", + G_CALLBACK (update_editor_from_move_cb), editor); + + gl_debug (DEBUG_VIEW, "END"); + + return editor; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. editor "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object) +{ + gdouble x, y, w, h; + glTextNode *filename; + const GdkPixbuf *pixbuf; + gdouble image_w, image_h; + gdouble new_w, new_h; + + gl_debug (DEBUG_VIEW, "START"); + + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + + gl_object_editor_get_position (editor, &x, &y); + gl_label_object_set_position (object, x, y); + + gl_object_editor_get_size (editor, &w, &h); + gl_label_object_set_size (object, w, h); + + filename = gl_object_editor_get_image (editor); + gl_label_image_set_filename (GL_LABEL_IMAGE(object), filename); + gl_text_node_free (&filename); + + /* Setting filename may have modified the size. */ + gl_label_object_get_size (object, &new_w, &new_h); + if ( (new_w != w) || (new_h != h) ) + { + gl_object_editor_set_size (editor, new_w, new_h); + } + + /* It may also have a new base size. */ + pixbuf = gl_label_image_get_pixbuf (GL_LABEL_IMAGE(object), NULL); + image_w = gdk_pixbuf_get_width (pixbuf); + image_h = gdk_pixbuf_get_height (pixbuf); + gl_object_editor_set_base_size (editor, image_w, image_h); + + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor) +{ + gdouble w, h; + const GdkPixbuf *pixbuf; + gdouble image_w, image_h; + glTextNode *filename; + glMerge *merge; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_size (object, &w, &h); + gl_object_editor_set_size (editor, w, h); + + pixbuf = gl_label_image_get_pixbuf (GL_LABEL_IMAGE(object), NULL); + image_w = gdk_pixbuf_get_width (pixbuf); + image_h = gdk_pixbuf_get_height (pixbuf); + gl_object_editor_set_base_size (editor, image_w, image_h); + + filename = gl_label_image_get_filename (GL_LABEL_IMAGE(object)); + merge = gl_label_get_merge (GL_LABEL(object->parent)); + if ( filename != NULL ) { + gl_object_editor_set_image (editor, (merge != NULL), filename); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "moved" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor) +{ + gdouble x, y; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_position (object, &x, &y); + gl_object_editor_set_position (editor, x, y); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Is object at (x,y)? */ +/*****************************************************************************/ +static gboolean +object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y) +{ + glLabelObject *object; + gdouble w, h; + + object = gl_view_object_get_object (view_object); + + gl_label_object_get_size (object, &w, &h); + + cairo_rectangle (cr, 0.0, 0.0, w, h); + + if (cairo_in_fill (cr, x, y)) + { + return TRUE; + } + + return FALSE; +} + + +/*****************************************************************************/ +/* Return apropos cursor for create object mode. */ +/*****************************************************************************/ +GdkCursor * +gl_view_image_get_create_cursor (void) +{ + GdkCursor *cursor = NULL; + GdkPixmap *pixmap_data, *pixmap_mask; + GdkColor fg = { 0, 0, 0, 0 }; + GdkColor bg = { 0, 65535, 65535, 65535 }; + + gl_debug (DEBUG_VIEW, "START"); + + pixmap_data = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_image_bits, + cursor_image_width, + cursor_image_height); + pixmap_mask = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_image_mask_bits, + cursor_image_mask_width, + cursor_image_mask_height); + cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, + &bg, cursor_image_x_hot, + cursor_image_y_hot); + + gl_debug (DEBUG_VIEW, "END"); + + return cursor; +} + +/*****************************************************************************/ +/* Object creation handler: button press event. */ +/*****************************************************************************/ +void +gl_view_image_create_button_press_event (glView *view, + gdouble x, + gdouble y) +{ + GObject *object; + + gl_view_unselect_all (view); + + object = gl_label_image_new (view->label); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + gl_label_object_set_size (GL_LABEL_OBJECT(object), 0.0, 0.0); + + view->create_object = GL_LABEL_OBJECT (object); + view->create_x0 = x; + view->create_y0 = y; +} + +/*****************************************************************************/ +/* Object creation handler: motion event. */ +/*****************************************************************************/ +void +gl_view_image_create_motion_event (glView *view, + gdouble x, + gdouble y) +{ + gdouble w, h; + + gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), + MIN (x, view->create_x0), MIN (y, view->create_y0)); + w = MAX (x, view->create_x0) - MIN (x, view->create_x0); + h = MAX (y, view->create_y0) - MIN (y, view->create_y0); + gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); +} + +/*****************************************************************************/ +/* Object creation handler: button relesase event. */ +/*****************************************************************************/ +void +gl_view_image_create_button_release_event (glView *view, + gdouble x, + gdouble y) +{ + gdouble w, h; + + if ((view->create_x0 == x) && (view->create_y0 == y)) { + x = view->create_x0 + 36.0; + y = view->create_y0 + 36.0; + } + gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), + MIN (x, view->create_x0), MIN (y, view->create_y0)); + w = MAX (x, view->create_x0) - MIN (x, view->create_x0); + h = MAX (y, view->create_y0) - MIN (y, view->create_y0); + gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); +} + diff --git a/src/view-image.h b/src/view-image.h new file mode 100644 index 00000000..7bb3ce10 --- /dev/null +++ b/src/view-image.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_image.h: GLabels label image object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __VIEW_IMAGE_H__ +#define __VIEW_IMAGE_H__ + +#include "view-object.h" +#include "label-image.h" + +G_BEGIN_DECLS + + +#define GL_TYPE_VIEW_IMAGE (gl_view_image_get_type ()) +#define GL_VIEW_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_IMAGE, glViewImage)) +#define GL_VIEW_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_IMAGE, glViewImageClass)) +#define GL_IS_VIEW_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_IMAGE)) +#define GL_IS_VIEW_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_IMAGE)) + +typedef struct _glViewImage glViewImage; +typedef struct _glViewImageClass glViewImageClass; + +typedef struct _glViewImagePrivate glViewImagePrivate; + +struct _glViewImage { + glViewObject parent_object; + + glViewImagePrivate *priv; +}; + +struct _glViewImageClass { + glViewObjectClass parent_class; +}; + + +GType gl_view_image_get_type (void) G_GNUC_CONST; + +glViewObject *gl_view_image_new (glLabelImage *object, + glView *view); + + +/* cursor for creating image objects */ +GdkCursor *gl_view_image_get_create_cursor (void); + +/* Object creation handlers. */ +void gl_view_image_create_button_press_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_image_create_motion_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_image_create_button_release_event (glView *view, + gdouble x, + gdouble y); + + +G_END_DECLS + +#endif /* __VIEW_IMAGE_H__ */ diff --git a/src/view-line.c b/src/view-line.c new file mode 100644 index 00000000..12f29a41 --- /dev/null +++ b/src/view-line.c @@ -0,0 +1,455 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_line.c: GLabels label line object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "view-line.h" + +#include +#include + +#include "color.h" +#include "object-editor.h" +#include "stock.h" + +#include "pixmaps/cursor_line.xbm" +#include "pixmaps/cursor_line_mask.xbm" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glViewLinePrivate { +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_view_line_finalize (GObject *object); + +static GtkWidget *construct_properties_editor (glViewObject *view_object); + +static void update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object); + +static void update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor); + +static void update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor); + +static gboolean object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y); + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glViewLine, gl_view_line, GL_TYPE_VIEW_OBJECT); + + +static void +gl_view_line_class_init (glViewLineClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); + + gl_debug (DEBUG_VIEW, "START"); + + gl_view_line_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_view_line_finalize; + + view_object_class->construct_editor = construct_properties_editor; + view_object_class->object_at = object_at; + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_line_init (glViewLine *view_line) +{ + gl_debug (DEBUG_VIEW, "START"); + + view_line->priv = g_new0 (glViewLinePrivate, 1); + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_line_finalize (GObject *object) +{ + glViewLine *view_line = GL_VIEW_LINE (object); + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (object && GL_IS_VIEW_LINE (object)); + + g_free (view_line->priv); + + G_OBJECT_CLASS (gl_view_line_parent_class)->finalize (object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* NEW line object view. */ +/*****************************************************************************/ +glViewObject * +gl_view_line_new (glLabelLine *object, + glView *view) +{ + glViewLine *view_line; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_LINE (object), NULL); + g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); + + view_line = g_object_new (gl_view_line_get_type(), NULL); + + gl_view_object_set_object (GL_VIEW_OBJECT(view_line), + GL_LABEL_OBJECT(object), + GL_VIEW_OBJECT_HANDLES_LINE); + gl_view_object_set_view (GL_VIEW_OBJECT(view_line), view); + + gl_debug (DEBUG_VIEW, "END"); + + return GL_VIEW_OBJECT (view_line); +} + +/*****************************************************************************/ +/* Create a properties dialog for a line object. */ +/*****************************************************************************/ +static GtkWidget * +construct_properties_editor (glViewObject *view_object) +{ + GtkWidget *editor; + glViewLine *view_line = (glViewLine *)view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + object = gl_view_object_get_object (GL_VIEW_OBJECT(view_line)); + + /* Build editor. */ + editor = gl_object_editor_new (GL_STOCK_LINE, _("Line object properties"), + object->parent, + GL_OBJECT_EDITOR_SHADOW_PAGE, + GL_OBJECT_EDITOR_POSITION_PAGE, + GL_OBJECT_EDITOR_SIZE_LINE_PAGE, + GL_OBJECT_EDITOR_LINE_PAGE, + 0); + + /* Update */ + update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); + update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); + + /* Connect signals. */ + g_signal_connect (G_OBJECT (editor), "changed", + G_CALLBACK(update_object_from_editor_cb), object); + g_signal_connect (G_OBJECT (object), "changed", + G_CALLBACK (update_editor_from_object_cb), editor); + g_signal_connect (G_OBJECT (object), "moved", + G_CALLBACK (update_editor_from_move_cb), editor); + + gl_debug (DEBUG_VIEW, "END"); + + return editor; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. editor "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object) +{ + gdouble x, y, w, h; + glColorNode *line_color_node; + gdouble line_width; + gboolean shadow_state; + gdouble shadow_x, shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + + + gl_debug (DEBUG_VIEW, "START"); + + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_object_editor_get_position (editor, &x, &y); + gl_label_object_set_position (object, x, y); + + gl_object_editor_get_lsize (editor, &w, &h); + gl_label_object_set_size (object, w, h); + + line_color_node = gl_object_editor_get_line_color (editor); + gl_label_object_set_line_color (object, line_color_node); + gl_color_node_free (&line_color_node); + + line_width = gl_object_editor_get_line_width (editor); + gl_label_object_set_line_width (object, line_width); + + shadow_state = gl_object_editor_get_shadow_state (editor); + gl_label_object_set_shadow_state (object, shadow_state); + + gl_object_editor_get_shadow_offset (editor, &shadow_x, &shadow_y); + gl_label_object_set_shadow_offset (object, shadow_x, shadow_y); + + shadow_color_node = gl_object_editor_get_shadow_color (editor); + gl_label_object_set_shadow_color (object, shadow_color_node); + gl_color_node_free (&shadow_color_node); + + shadow_opacity = gl_object_editor_get_shadow_opacity (editor); + gl_label_object_set_shadow_opacity (object, shadow_opacity); + + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor) +{ + gdouble w, h; + glColorNode *line_color_node; + gdouble line_width; + gboolean shadow_state; + gdouble shadow_x, shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + glMerge *merge; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_size (object, &w, &h); + gl_object_editor_set_lsize (editor, w, h); + merge = gl_label_get_merge (GL_LABEL(object->parent)); + + line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); + gl_object_editor_set_line_color (editor, (merge != NULL), line_color_node); + gl_color_node_free (&line_color_node); + + line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); + gl_object_editor_set_line_width (editor, line_width); + + shadow_state = gl_label_object_get_shadow_state (object); + gl_object_editor_set_shadow_state (editor, shadow_state); + + gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); + gl_object_editor_set_shadow_offset (editor, shadow_x, shadow_y); + + shadow_color_node = gl_label_object_get_shadow_color (object); + gl_object_editor_set_shadow_color (editor, (merge != NULL), shadow_color_node); + gl_color_node_free (&shadow_color_node); + + shadow_opacity = gl_label_object_get_shadow_opacity (object); + gl_object_editor_set_shadow_opacity (editor, shadow_opacity); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "moved" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor) +{ + gdouble x, y; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_position (object, &x, &y); + gl_object_editor_set_position (editor, x, y); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Is object at (x,y)? */ +/*****************************************************************************/ +static gboolean +object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y) +{ + glLabelObject *object; + gdouble w, h; + gdouble line_width; + + object = gl_view_object_get_object (view_object); + + gl_label_object_get_size (object, &w, &h); + + cairo_move_to (cr, 0.0, 0.0); + cairo_line_to (cr, w, h); + + line_width = gl_label_object_get_line_width (object); + cairo_set_line_width (cr, line_width); + if (cairo_in_stroke (cr, x, y)) + { + return TRUE; + } + + return FALSE; +} + + +/*****************************************************************************/ +/* Return apropos cursor for create object mode. */ +/*****************************************************************************/ +GdkCursor * +gl_view_line_get_create_cursor (void) +{ + GdkCursor *cursor = NULL; + GdkPixmap *pixmap_data, *pixmap_mask; + GdkColor fg = { 0, 0, 0, 0 }; + GdkColor bg = { 0, 65535, 65535, 65535 }; + + gl_debug (DEBUG_VIEW, "START"); + + pixmap_data = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_line_bits, + cursor_line_width, + cursor_line_height); + pixmap_mask = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_line_mask_bits, + cursor_line_mask_width, + cursor_line_mask_height); + cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, + &bg, cursor_line_x_hot, + cursor_line_y_hot); + + gl_debug (DEBUG_VIEW, "END"); + + return cursor; +} + +/*****************************************************************************/ +/* Object creation handler: button press event. */ +/*****************************************************************************/ +void +gl_view_line_create_button_press_event (glView *view, + gdouble x, + gdouble y) +{ + GObject *object; + glColorNode *line_color_node; + + gl_view_unselect_all (view); + + line_color_node = gl_color_node_new_default (); + + object = gl_label_line_new (view->label); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + gl_label_object_set_size (GL_LABEL_OBJECT(object), 0.0, 0.0); + line_color_node->color = gl_color_set_opacity (gl_view_get_default_line_color(view), 0.5); + gl_label_object_set_line_width (GL_LABEL_OBJECT(object), + gl_view_get_default_line_width(view)); + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), + line_color_node); + + gl_color_node_free (&line_color_node); + + view->create_object = GL_LABEL_OBJECT (object); + view->create_x0 = x; + view->create_y0 = y; +} + +/*****************************************************************************/ +/* Object creation handler: motion event. */ +/*****************************************************************************/ +void +gl_view_line_create_motion_event (glView *view, + gdouble x, + gdouble y) +{ + gdouble w, h; + + w = x - view->create_x0; + h = y - view->create_y0; + gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); +} + +/*****************************************************************************/ +/* Object creation handler: button relesase event. */ +/*****************************************************************************/ +void +gl_view_line_create_button_release_event (glView *view, + gdouble x, + gdouble y) +{ + glColorNode *line_color_node; + gdouble w, h; + + line_color_node = gl_color_node_new_default (); + + if ((view->create_x0 == x) && (view->create_y0 == y)) { + x = view->create_x0 + 36.0; + y = view->create_y0 + 36.0; + } + w = x - view->create_x0; + h = y - view->create_y0; + gl_label_object_set_size (GL_LABEL_OBJECT(view->create_object), w, h); + line_color_node->color = gl_view_get_default_line_color(view); + gl_label_object_set_line_color (GL_LABEL_OBJECT(view->create_object), line_color_node); + gl_color_node_free (&line_color_node); +} + diff --git a/src/view-line.h b/src/view-line.h new file mode 100644 index 00000000..a938a115 --- /dev/null +++ b/src/view-line.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_line.h: GLabels label line object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __VIEW_LINE_H__ +#define __VIEW_LINE_H__ + +#include "view-object.h" +#include "label-line.h" + +G_BEGIN_DECLS + + +#define GL_TYPE_VIEW_LINE (gl_view_line_get_type ()) +#define GL_VIEW_LINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_LINE, glViewLine)) +#define GL_VIEW_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_LINE, glViewLineClass)) +#define GL_IS_VIEW_LINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_LINE)) +#define GL_IS_VIEW_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_LINE)) + +typedef struct _glViewLine glViewLine; +typedef struct _glViewLineClass glViewLineClass; + +typedef struct _glViewLinePrivate glViewLinePrivate; + +struct _glViewLine { + glViewObject parent_object; + + glViewLinePrivate *priv; +}; + +struct _glViewLineClass { + glViewObjectClass parent_class; +}; + + +GType gl_view_line_get_type (void) G_GNUC_CONST; + +glViewObject *gl_view_line_new (glLabelLine *object, + glView *view); + + +/* cursor for creating line objects */ +GdkCursor *gl_view_line_get_create_cursor (void); + +/* Object creation handlers. */ +void gl_view_line_create_button_press_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_line_create_motion_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_line_create_button_release_event (glView *view, + gdouble x, + gdouble y); + + +G_END_DECLS + +#endif /* __VIEW_LINE_H__ */ diff --git a/src/view-object.c b/src/view-object.c new file mode 100644 index 00000000..394735a3 --- /dev/null +++ b/src/view-object.c @@ -0,0 +1,765 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_object.c: GLabels label object base class + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "view-object.h" + +#include + +#include "debug.h" + +/*========================================================*/ +/* Private constants and macros. */ +/*========================================================*/ + +#define HANDLE_FILL_RGBA_ARGS 0.0, 0.75, 0.0, 0.4 +#define HANDLE_OUTLINE_RGBA_ARGS 0.0, 0.0, 0.0, 0.8 + +#define HANDLE_OUTLINE_WIDTH_PIXELS 1.0 +#define HANDLE_PIXELS 7 + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glViewObjectPrivate { + + glLabelObject *object; + + glView *view; + glViewObjectHandlesStyle handles_style; + + GtkWidget *property_editor; +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_view_object_finalize (GObject *object); + +static void object_removed_cb (glViewObject *view_object, + glLabelObject *object); + +static void object_top_cb (glViewObject *view_object, + glLabelObject *object); + +static void object_bottom_cb (glViewObject *view_object, + glLabelObject *object); + + + + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glViewObject, gl_view_object, G_TYPE_OBJECT); + +static void +gl_view_object_class_init (glViewObjectClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_VIEW, "START"); + + gl_view_object_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_view_object_finalize; + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_object_init (glViewObject *view_object) +{ + gl_debug (DEBUG_VIEW, "START"); + + view_object->priv = g_new0 (glViewObjectPrivate, 1); + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_object_finalize (GObject *object) +{ + glViewObject *view_object = GL_VIEW_OBJECT (object); + glView *view; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (object && GL_IS_VIEW_OBJECT (object)); + + view = view_object->priv->view; + view->object_list = g_list_remove (view->object_list, object); + view->selected_object_list = + g_list_remove (view->selected_object_list, object); + + g_object_unref (view_object->priv->object); + if (view_object->priv->property_editor) { + gl_debug (DEBUG_VIEW, "Destroy editor"); + g_object_unref (G_OBJECT(view_object->priv->property_editor)); + } + g_free (view_object->priv); + + G_OBJECT_CLASS (gl_view_object_parent_class)->finalize (object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* NEW object view. */ +/*****************************************************************************/ +GObject * +gl_view_object_new (void) +{ + glViewObject *view_object; + + gl_debug (DEBUG_VIEW, "START"); + + view_object = g_object_new (gl_view_object_get_type(), NULL); + + gl_debug (DEBUG_VIEW, "END"); + + return G_OBJECT (view_object); +} + +/*****************************************************************************/ +/* Set parent view to which this object view belongs. */ +/*****************************************************************************/ +void +gl_view_object_set_view (glViewObject *view_object, + glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); + g_return_if_fail (view && GL_IS_VIEW (view)); + + view_object->priv->view = view; + + view->object_list = g_list_append (view->object_list, view_object); + + g_signal_connect_swapped (G_OBJECT (view_object->priv->object), "changed", + G_CALLBACK (gl_view_update), view); + g_signal_connect_swapped (G_OBJECT (view_object->priv->object), "moved", + G_CALLBACK (gl_view_update), view); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Set Label object to follow. */ +/*****************************************************************************/ +void +gl_view_object_set_object (glViewObject *view_object, + glLabelObject *object, + glViewObjectHandlesStyle style) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + view_object->priv->object = g_object_ref (G_OBJECT (object)); + view_object->priv->handles_style = style; + + g_signal_connect_swapped (G_OBJECT (object), "removed", + G_CALLBACK (object_removed_cb), view_object); + g_signal_connect_swapped (G_OBJECT (object), "top", + G_CALLBACK (object_top_cb), view_object); + g_signal_connect_swapped (G_OBJECT (object), "bottom", + G_CALLBACK (object_bottom_cb), view_object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Handle object "removed" signal. */ +/*---------------------------------------------------------------------------*/ +static void +object_removed_cb (glViewObject *view_object, + glLabelObject *object) +{ + glView *view; + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + view = gl_view_object_get_view (view_object); + view->object_list = g_list_remove (view->object_list, view_object); + g_object_unref (G_OBJECT (view_object)); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Handle object "top" signal. */ +/*---------------------------------------------------------------------------*/ +static void +object_top_cb (glViewObject *view_object, + glLabelObject *object) +{ + glView *view; + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + view = gl_view_object_get_view (view_object); + + /* Move to end of list, representing front most object */ + view->object_list = g_list_remove (view->object_list, view_object); + view->object_list = g_list_append (view->object_list, view_object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Handle object "removed" signal. */ +/*---------------------------------------------------------------------------*/ +static void +object_bottom_cb (glViewObject *view_object, + glLabelObject *object) +{ + glView *view; + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + view = gl_view_object_get_view (view_object); + + /* Move to front of list, representing rear most object */ + view->object_list = g_list_remove (view->object_list, view_object); + view->object_list = g_list_prepend (view->object_list, view_object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Return parent view associated with this view. */ +/*****************************************************************************/ +glView * +gl_view_object_get_view (glViewObject *view_object) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object), NULL); + + gl_debug (DEBUG_VIEW, "END"); + + return view_object->priv->view; +} + +/*****************************************************************************/ +/* Return label object that we are following. */ +/*****************************************************************************/ +glLabelObject * +gl_view_object_get_object (glViewObject *view_object) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object), NULL); + + gl_debug (DEBUG_VIEW, "END"); + + return view_object->priv->object; +} + +/*****************************************************************************/ +/* Get property editor. */ +/*****************************************************************************/ +GtkWidget * +gl_view_object_get_editor (glViewObject *view_object) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object), NULL); + + if ( GL_VIEW_OBJECT_GET_CLASS(view_object)->construct_editor != NULL ) { + + if (view_object->priv->property_editor == NULL) { + view_object->priv->property_editor = + GL_VIEW_OBJECT_GET_CLASS(view_object)->construct_editor (view_object); + } + g_signal_connect (G_OBJECT (view_object->priv->property_editor), + "destroy", + G_CALLBACK (gtk_widget_destroyed), + &view_object->priv->property_editor); + + gtk_widget_show (view_object->priv->property_editor); + + } + + + gl_debug (DEBUG_VIEW, "END"); + + return view_object->priv->property_editor; +} + + +/*****************************************************************************/ +/* Select object. */ +/*****************************************************************************/ +void +gl_view_object_select (glViewObject *view_object) +{ + gl_debug (DEBUG_VIEW, "START"); + + gl_view_select_object(view_object->priv->view, view_object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Is object at (x,y)? */ +/*****************************************************************************/ +gboolean +gl_view_object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y) +{ + glLabelObject *object = view_object->priv->object; + gdouble x0, y0; + cairo_matrix_t matrix; + gboolean return_val = FALSE; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object), FALSE); + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), FALSE); + + gl_label_object_get_position (object, &x0, &y0); + gl_label_object_get_matrix (object, &matrix); + + cairo_save (cr); + cairo_translate (cr, x0, y0); + cairo_transform (cr, &matrix); + + cairo_device_to_user (cr, &x, &y); + + if ( GL_VIEW_OBJECT_GET_CLASS(view_object)->object_at != NULL ) { + + return_val = GL_VIEW_OBJECT_GET_CLASS(view_object)->object_at (view_object, cr, x, y); + + } + + cairo_restore (cr); + + return return_val; + + gl_debug (DEBUG_VIEW, "END"); +} + + +/*--------------------------------------------------------------------------*/ +/* Create handle path */ +/*--------------------------------------------------------------------------*/ +static void +create_handle_path (cairo_t *cr, + glLabelObject *object, + gdouble scale, + gdouble x_handle, + gdouble y_handle) +{ + gl_debug (DEBUG_VIEW, "START"); + + cairo_rectangle (cr, + x_handle - HANDLE_PIXELS/scale/2, y_handle - HANDLE_PIXELS/scale/2, + HANDLE_PIXELS/scale, HANDLE_PIXELS/scale); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Draw object handles */ +/*****************************************************************************/ +void +gl_view_object_draw_handles (glViewObject *view_object, + cairo_t *cr) +{ + glLabelObject *object = view_object->priv->object; + gdouble x0, y0; + cairo_matrix_t matrix; + gdouble scale; + gdouble w, h; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object)); + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + scale = view_object->priv->view->home_scale * view_object->priv->view->zoom; + + gl_label_object_get_position (object, &x0, &y0); + gl_label_object_get_matrix (object, &matrix); + + gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h); + + cairo_save (cr); + + cairo_translate (cr, x0, y0); + cairo_transform (cr, &matrix); + + switch (view_object->priv->handles_style) + { + case GL_VIEW_OBJECT_HANDLES_BOX: + + /* North */ + cairo_new_path (cr); + create_handle_path (cr, object, scale, w/2, 0); + + /* North East */ + cairo_new_sub_path (cr); + create_handle_path (cr, object, scale, w, 0); + + /* East */ + cairo_new_sub_path (cr); + create_handle_path (cr, object, scale, w, h/2); + + /* South East */ + cairo_new_sub_path (cr); + create_handle_path (cr, object, scale, w, h); + + /* South */ + cairo_new_sub_path (cr); + create_handle_path (cr, object, scale, w/2, h); + + /* South West */ + cairo_new_sub_path (cr); + create_handle_path (cr, object, scale, 0, h); + + /* West */ + cairo_new_sub_path (cr); + create_handle_path (cr, object, scale, 0, h/2); + + /* North West */ + cairo_new_sub_path (cr); + create_handle_path (cr, object, scale, 0, 0); + + break; + + case GL_VIEW_OBJECT_HANDLES_LINE: + /* P1 */ + cairo_new_path (cr); + create_handle_path (cr, object, scale, 0, 0); + + /* P2 */ + cairo_new_sub_path (cr); + create_handle_path (cr, object, scale, w, h); + + break; + } + + cairo_set_source_rgba (cr, HANDLE_FILL_RGBA_ARGS); + cairo_fill_preserve (cr); + + cairo_set_line_width (cr, HANDLE_OUTLINE_WIDTH_PIXELS/scale); + cairo_set_source_rgba (cr, HANDLE_OUTLINE_RGBA_ARGS); + cairo_stroke (cr); + + cairo_restore (cr); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Is there an object handle at (x,y). */ +/*****************************************************************************/ +glViewObjectHandle +gl_view_object_handle_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y) +{ + glLabelObject *object = view_object->priv->object; + gdouble x0, y0; + cairo_matrix_t matrix; + gdouble scale; + gdouble w, h; + glViewObjectHandle handle = GL_VIEW_OBJECT_HANDLE_NONE; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view_object && GL_IS_VIEW_OBJECT (view_object), handle); + g_return_val_if_fail (object && GL_IS_LABEL_OBJECT (object), handle); + + scale = view_object->priv->view->home_scale * view_object->priv->view->zoom; + + gl_label_object_get_position (object, &x0, &y0); + gl_label_object_get_matrix (object, &matrix); + + gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h); + + cairo_save (cr); + + cairo_translate (cr, x0, y0); + cairo_transform (cr, &matrix); + + cairo_device_to_user (cr, &x, &y); + + switch (view_object->priv->handles_style) + { + case GL_VIEW_OBJECT_HANDLES_BOX: + + /* South East */ + create_handle_path (cr, object, scale, w, h); + if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_SE; break;} + + /* South West */ + create_handle_path (cr, object, scale, 0, h); + if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_SW; break;} + + /* North East */ + create_handle_path (cr, object, scale, w, 0); + if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_NE; break;} + + /* North West */ + create_handle_path (cr, object, scale, 0, 0); + if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_NW; break;} + + /* East */ + create_handle_path (cr, object, scale, w, h/2); + if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_E; break;} + + /* South */ + create_handle_path (cr, object, scale, w/2, h); + if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_S; break;} + + /* West */ + create_handle_path (cr, object, scale, 0, h/2); + if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_W; break;} + + /* North */ + create_handle_path (cr, object, scale, w/2, 0); + if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_N; break;} + + break; + + case GL_VIEW_OBJECT_HANDLES_LINE: + /* P2 */ + create_handle_path (cr, object, scale, w, h); + if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_P2; break;} + + /* P1 */ + create_handle_path (cr, object, scale, 0, 0); + if (cairo_in_fill (cr, x, y)) {handle = GL_VIEW_OBJECT_HANDLE_P1; break;} + + break; + + } + + cairo_restore (cr); + + return handle; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Resize object. */ +/*---------------------------------------------------------------------------*/ +void +gl_view_object_resize_event (glViewObject *view_object, + glViewObjectHandle handle, + gboolean honor_aspect, + cairo_t *cr, + gdouble x, + gdouble y) +{ + glLabelObject *object; + cairo_matrix_t matrix; + gdouble x0, y0, x1, y1, x2, y2; + gdouble w, h; + gdouble dx=0, dy=0; + + gl_debug (DEBUG_VIEW, "x,y world = %g, %g", x, y); + + object = view_object->priv->object; + + /* + * Change to item relative coordinates + */ + cairo_save (cr); + gl_label_object_get_position (object, &x0, &y0); + cairo_translate (cr, x0, y0); + gl_label_object_get_matrix (object, &matrix); + cairo_transform (cr, &matrix); + + /* + * Initialize origin and 2 corners in object relative coordinates. + */ + x0 = 0.0; + y0 = 0.0; + + x1 = 0.0; + y1 = 0.0; + + gl_label_object_get_size (object, &x2, &y2); + + gl_debug (DEBUG_VIEW, "x0,y0 object = %g, %g", x0, y0); + gl_debug (DEBUG_VIEW, "x1,y1 object = %g, %g", x1, y1); + gl_debug (DEBUG_VIEW, "x2,y2 object = %g, %g", x2, y2); + + /* + * Translate x,y into object relative coordinates. + */ + cairo_device_to_user (cr, &x, &y); + + gl_debug (DEBUG_VIEW, "x,y object = %g, %g", x, y); + + /* + * Get new size + */ + switch (handle) + { + + case GL_VIEW_OBJECT_HANDLE_NW: + w = MAX (x2 - x, 0); + h = MAX (y2 - y, 0); + break; + + case GL_VIEW_OBJECT_HANDLE_N: + w = x2 - x1; + h = MAX (y2 - y, 0); + break; + + case GL_VIEW_OBJECT_HANDLE_NE: + w = MAX (x - x1, 0); + h = MAX (y2 - y, 0); + break; + + case GL_VIEW_OBJECT_HANDLE_E: + w = MAX (x - x1, 0); + h = y2 - y1; + break; + + case GL_VIEW_OBJECT_HANDLE_SE: + w = MAX (x - x1, 0); + h = MAX (y - y1, 0); + break; + + case GL_VIEW_OBJECT_HANDLE_S: + w = x2 - x1; + h = MAX (y - y1, 0); + break; + + case GL_VIEW_OBJECT_HANDLE_SW: + w = MAX (x2 - x, 0); + h = MAX (y - y1, 0); + break; + + case GL_VIEW_OBJECT_HANDLE_W: + w = MAX (x2 - x, 0); + h = y2 - y1; + break; + case GL_VIEW_OBJECT_HANDLE_P1: + x1 = x; + y1 = y; + dx = (x2 - x); + dy = (y2 - y); + x0 = x0 + x1; + y0 = y0 + y1; + break; + + case GL_VIEW_OBJECT_HANDLE_P2: + dx = x - x1; + dy = y - y1; + x0 = x0 + x1; + y0 = y0 + y1; + break; + + default: + g_print ("Invalid handle.\n"); /* Should not happen! */ + + } + if ( (handle != GL_VIEW_OBJECT_HANDLE_P1) && (handle != GL_VIEW_OBJECT_HANDLE_P2) ) + { + if ( honor_aspect ) + { + gl_label_object_set_size_honor_aspect (object, w, h); + } + else + { + gl_label_object_set_size (object, w, h); + } + + /* + * Query the new size in case it was constrained. + */ + gl_label_object_get_size (object, &w, &h); + + /* + * Get new position + */ + switch (handle) + { + + case GL_VIEW_OBJECT_HANDLE_NW: + x0 += x2 - w; + y0 += y2 - h; + break; + + case GL_VIEW_OBJECT_HANDLE_N: + case GL_VIEW_OBJECT_HANDLE_NE: + /* x unchanged */ + y0 += y2 - h; + break; + + case GL_VIEW_OBJECT_HANDLE_E: + case GL_VIEW_OBJECT_HANDLE_SE: + case GL_VIEW_OBJECT_HANDLE_S: + /* unchanged */ + break; + + case GL_VIEW_OBJECT_HANDLE_SW: + case GL_VIEW_OBJECT_HANDLE_W: + x0 += x2 - w; + /* y unchanged */ + break; + + default: + g_print ("Invalid handle.\n"); /* Should not happen! */ + } + } + else + { + gl_label_object_set_size (object, dx, dy); + } + + /* + * Put new origin back into world coordinates and set. + */ + cairo_user_to_device (cr, &x0, &y0); + cairo_restore (cr); + cairo_device_to_user (cr, &x0, &y0); + gl_label_object_set_position (object, x0, y0); +} diff --git a/src/view-object.h b/src/view-object.h new file mode 100644 index 00000000..2ae9f84f --- /dev/null +++ b/src/view-object.h @@ -0,0 +1,137 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_object.h: GLabels canvas item wrapper widget + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __VIEW_OBJECT_H__ +#define __VIEW_OBJECT_H__ + +#include +#include "label-object.h" + +typedef enum { + GL_VIEW_OBJECT_HANDLES_BOX, + GL_VIEW_OBJECT_HANDLES_LINE, +} glViewObjectHandlesStyle; + +typedef enum { + GL_VIEW_OBJECT_HANDLE_NONE = 0, + GL_VIEW_OBJECT_HANDLE_N, + GL_VIEW_OBJECT_HANDLE_E, + GL_VIEW_OBJECT_HANDLE_W, + GL_VIEW_OBJECT_HANDLE_S, + GL_VIEW_OBJECT_HANDLE_NW, + GL_VIEW_OBJECT_HANDLE_NE, + GL_VIEW_OBJECT_HANDLE_SE, + GL_VIEW_OBJECT_HANDLE_SW, + GL_VIEW_OBJECT_HANDLE_P1, + GL_VIEW_OBJECT_HANDLE_P2, +} glViewObjectHandle; + + +#define GL_TYPE_VIEW_OBJECT (gl_view_object_get_type ()) +#define GL_VIEW_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_OBJECT, glViewObject)) +#define GL_VIEW_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_OBJECT, glViewObjectClass)) +#define GL_IS_VIEW_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_OBJECT)) +#define GL_IS_VIEW_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_OBJECT)) +#define GL_VIEW_OBJECT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_VIEW_OBJECT, glViewObjectClass)) + +typedef struct _glViewObject glViewObject; +typedef struct _glViewObjectClass glViewObjectClass; + +typedef struct _glViewObjectPrivate glViewObjectPrivate; + + +#include "view.h" + +#include "cairo.h" + +struct _glViewObject { + GObject parent_object; + + glViewObjectPrivate *priv; +}; + +struct _glViewObjectClass { + GObjectClass parent_class; + + /* + * Methods + */ + + GtkWidget * (*construct_editor) (glViewObject *view_object); + + gboolean (*object_at) (glViewObject *view_object, + cairo_t *cr, + gdouble x_device, + gdouble y_device); +}; + + + + +G_BEGIN_DECLS + +GType gl_view_object_get_type (void) G_GNUC_CONST; + +GObject *gl_view_object_new (void); + + +void gl_view_object_set_view (glViewObject *view_object, + glView *view); + +void gl_view_object_set_object (glViewObject *view_object, + glLabelObject *object, + glViewObjectHandlesStyle style); + +gboolean gl_view_object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y); + +void gl_view_object_draw_handles (glViewObject *view_object, + cairo_t *cr); + +glViewObjectHandle gl_view_object_handle_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y); + +glView *gl_view_object_get_view (glViewObject *view_object); + +glLabelObject *gl_view_object_get_object (glViewObject *view_object); + +GtkWidget *gl_view_object_get_editor (glViewObject *view_object); + +void gl_view_object_select (glViewObject *view_object); + +void gl_view_object_resize_event (glViewObject *view_object, + glViewObjectHandle handle, + gboolean honor_aspect, + cairo_t *cr, + gdouble x, + gdouble y); + + +G_END_DECLS + +#endif /* __VIEW_OBJECT_H__ */ diff --git a/src/view-text.c b/src/view-text.c new file mode 100644 index 00000000..ca930129 --- /dev/null +++ b/src/view-text.c @@ -0,0 +1,530 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_text.c: GLabels label text object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +#include "view-text.h" + +#include +#include + +#include "color.h" +#include "object-editor.h" +#include "stock.h" + +#include "pixmaps/cursor_text.xbm" +#include "pixmaps/cursor_text_mask.xbm" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +struct _glViewTextPrivate { +}; + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static void gl_view_text_finalize (GObject *object); + +static GtkWidget *construct_properties_editor (glViewObject *view_object); + +static void update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object); + +static void update_object_from_editor_size_cb (glObjectEditor *editor, + glLabelObject *object); + +static void update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor); + +static void update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor); + +static gboolean object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y); + + + + +/*****************************************************************************/ +/* Boilerplate object stuff. */ +/*****************************************************************************/ +G_DEFINE_TYPE (glViewText, gl_view_text, GL_TYPE_VIEW_OBJECT); + + +static void +gl_view_text_class_init (glViewTextClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + glViewObjectClass *view_object_class = GL_VIEW_OBJECT_CLASS (class); + + gl_debug (DEBUG_VIEW, "START"); + + gl_view_text_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_view_text_finalize; + + view_object_class->construct_editor = construct_properties_editor; + view_object_class->object_at = object_at; + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_text_init (glViewText *view_text) +{ + gl_debug (DEBUG_VIEW, "START"); + + view_text->priv = g_new0 (glViewTextPrivate, 1); + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_text_finalize (GObject *object) +{ + glViewText *view_text = GL_VIEW_TEXT (object); + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (object && GL_IS_VIEW_TEXT (object)); + + g_free (view_text->priv); + + G_OBJECT_CLASS (gl_view_text_parent_class)->finalize (object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* NEW text object view. */ +/*****************************************************************************/ +glViewObject * +gl_view_text_new (glLabelText *object, + glView *view) +{ + glViewText *view_text; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (object && GL_IS_LABEL_TEXT (object), NULL); + g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); + + view_text = g_object_new (gl_view_text_get_type(), NULL); + + gl_view_object_set_object (GL_VIEW_OBJECT(view_text), + GL_LABEL_OBJECT(object), + GL_VIEW_OBJECT_HANDLES_BOX); + gl_view_object_set_view (GL_VIEW_OBJECT(view_text), view); + + gl_debug (DEBUG_VIEW, "END"); + + return GL_VIEW_OBJECT (view_text); +} + +/*****************************************************************************/ +/* Create a properties dialog for a text object. */ +/*****************************************************************************/ +static GtkWidget * +construct_properties_editor (glViewObject *view_object) +{ + GtkWidget *editor; + glViewText *view_text = (glViewText *)view_object; + glLabelObject *object; + GtkTextBuffer *buffer; + + gl_debug (DEBUG_VIEW, "START"); + + object = gl_view_object_get_object (GL_VIEW_OBJECT(view_text)); + + /* Build editor. */ + editor = gl_object_editor_new (GL_STOCK_TEXT, _("Text object properties"), + object->parent, + GL_OBJECT_EDITOR_SHADOW_PAGE, + GL_OBJECT_EDITOR_POSITION_PAGE, + GL_OBJECT_EDITOR_SIZE_PAGE, + GL_OBJECT_EDITOR_TEXT_PAGE, + GL_OBJECT_EDITOR_EDIT_PAGE, + 0); + + buffer = gl_label_text_get_buffer (GL_LABEL_TEXT(object)); + gl_object_editor_set_text_buffer (GL_OBJECT_EDITOR(editor), buffer); + + /* Update */ + update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor)); + update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor)); + + /* Connect signals. */ + g_signal_connect (G_OBJECT (editor), "changed", + G_CALLBACK(update_object_from_editor_cb), object); + g_signal_connect (G_OBJECT (editor), "size_changed", + G_CALLBACK(update_object_from_editor_size_cb), object); + g_signal_connect (G_OBJECT (object), "changed", + G_CALLBACK (update_editor_from_object_cb), editor); + g_signal_connect (G_OBJECT (object), "moved", + G_CALLBACK (update_editor_from_move_cb), editor); + + gl_debug (DEBUG_VIEW, "END"); + + return editor; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. editor "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_object_from_editor_cb (glObjectEditor *editor, + glLabelObject *object) +{ + gdouble x, y; + gchar *font_family; + gdouble font_size; + PangoWeight font_weight; + gboolean font_italic_flag; + glColorNode *color_node; + PangoAlignment align; + gdouble text_line_spacing; + gboolean auto_shrink; + gboolean shadow_state; + gdouble shadow_x, shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + + gl_debug (DEBUG_VIEW, "START"); + + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_object_editor_get_position (editor, &x, &y); + font_family = gl_object_editor_get_font_family (editor); + font_size = gl_object_editor_get_font_size (editor); + font_weight = gl_object_editor_get_font_weight (editor); + font_italic_flag = gl_object_editor_get_font_italic_flag (editor); + color_node = gl_object_editor_get_text_color (editor); + align = gl_object_editor_get_text_alignment (editor); + text_line_spacing = gl_object_editor_get_text_line_spacing (editor); + auto_shrink = gl_object_editor_get_text_auto_shrink (editor); + + gl_label_object_set_position (object, x, y); + gl_label_object_set_font_family (object, font_family); + gl_label_object_set_font_size (object, font_size); + gl_label_object_set_font_weight (object, font_weight); + gl_label_object_set_font_italic_flag (object, font_italic_flag); + gl_label_object_set_text_color (object, color_node); + gl_label_object_set_text_alignment (object, align); + gl_label_object_set_text_line_spacing (object, text_line_spacing); + gl_label_text_set_auto_shrink (GL_LABEL_TEXT (object), auto_shrink); + + gl_color_node_free (&color_node); + g_free (font_family); + + shadow_state = gl_object_editor_get_shadow_state (editor); + gl_label_object_set_shadow_state (object, shadow_state); + + gl_object_editor_get_shadow_offset (editor, &shadow_x, &shadow_y); + gl_label_object_set_shadow_offset (object, shadow_x, shadow_y); + + shadow_color_node = gl_object_editor_get_shadow_color (editor); + gl_label_object_set_shadow_color (object, shadow_color_node); + gl_color_node_free (&shadow_color_node); + + shadow_opacity = gl_object_editor_get_shadow_opacity (editor); + gl_label_object_set_shadow_opacity (object, shadow_opacity); + + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. editor "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_object_from_editor_size_cb (glObjectEditor *editor, + glLabelObject *object) +{ + gdouble w, h; + + gl_debug (DEBUG_VIEW, "START"); + + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_block_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_object_editor_get_size (editor, &w, &h); + + gl_label_object_set_size (object, w, h); + + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_object_cb, + editor); + g_signal_handlers_unblock_by_func (G_OBJECT(object), + update_editor_from_move_cb, + editor); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_object_cb (glLabelObject *object, + glObjectEditor *editor) +{ + gdouble w, h; + gchar *font_family; + gdouble font_size; + PangoWeight font_weight; + gboolean font_italic_flag; + glColorNode *color_node; + PangoAlignment align; + gdouble text_line_spacing; + gboolean auto_shrink; + gboolean shadow_state; + gdouble shadow_x, shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + glMerge *merge; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_size (object, &w, &h); + gl_object_editor_set_size (editor, w, h); + merge = gl_label_get_merge (GL_LABEL(object->parent)); + + font_family = gl_label_object_get_font_family (object); + font_size = gl_label_object_get_font_size (object); + font_weight = gl_label_object_get_font_weight (object); + font_italic_flag = gl_label_object_get_font_italic_flag (object); + color_node = gl_label_object_get_text_color (object); + align = gl_label_object_get_text_alignment (object); + text_line_spacing = gl_label_object_get_text_line_spacing (object); + auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); + + gl_object_editor_set_font_family (editor, font_family); + gl_object_editor_set_font_size (editor, font_size); + gl_object_editor_set_font_weight (editor, font_weight); + gl_object_editor_set_font_italic_flag (editor, font_italic_flag); + gl_object_editor_set_text_color (editor, (merge != NULL), color_node); + gl_object_editor_set_text_alignment (editor, align); + gl_object_editor_set_text_line_spacing (editor, text_line_spacing); + gl_object_editor_set_text_auto_shrink (editor, auto_shrink); + + gl_color_node_free (&color_node); + g_free (font_family); + + shadow_state = gl_label_object_get_shadow_state (object); + gl_object_editor_set_shadow_state (editor, shadow_state); + + gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); + gl_object_editor_set_shadow_offset (editor, shadow_x, shadow_y); + + shadow_color_node = gl_label_object_get_shadow_color (object); + gl_object_editor_set_shadow_color (editor, (merge != NULL), shadow_color_node); + gl_color_node_free (&shadow_color_node); + + shadow_opacity = gl_label_object_get_shadow_opacity (object); + gl_object_editor_set_shadow_opacity (editor, shadow_opacity); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. label object "moved" callback. */ +/*---------------------------------------------------------------------------*/ +static void +update_editor_from_move_cb (glLabelObject *object, + gdouble dx, + gdouble dy, + glObjectEditor *editor) +{ + gdouble x, y; + + gl_debug (DEBUG_VIEW, "START"); + + gl_label_object_get_position (object, &x, &y); + gl_object_editor_set_position (editor, x, y); + + gl_debug (DEBUG_VIEW, "END"); +} + + +/*****************************************************************************/ +/* Is object at (x,y)? */ +/*****************************************************************************/ +static gboolean +object_at (glViewObject *view_object, + cairo_t *cr, + gdouble x, + gdouble y) +{ + glLabelObject *object; + gdouble w, h; + + object = gl_view_object_get_object (view_object); + + gl_label_object_get_size (object, &w, &h); + + cairo_rectangle (cr, 0.0, 0.0, w, h); + + if (cairo_in_fill (cr, x, y)) + { + return TRUE; + } + + return FALSE; +} + + +/*****************************************************************************/ +/* Return apropos cursor for create object mode. */ +/*****************************************************************************/ +GdkCursor * +gl_view_text_get_create_cursor (void) +{ + GdkCursor *cursor = NULL; + GdkPixmap *pixmap_data, *pixmap_mask; + GdkColor fg = { 0, 0, 0, 0 }; + GdkColor bg = { 0, 65535, 65535, 65535 }; + + gl_debug (DEBUG_VIEW, "START"); + + pixmap_data = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_text_bits, + cursor_text_width, + cursor_text_height); + pixmap_mask = gdk_bitmap_create_from_data (NULL, + (gchar *)cursor_text_mask_bits, + cursor_text_mask_width, + cursor_text_mask_height); + cursor = gdk_cursor_new_from_pixmap (pixmap_data, pixmap_mask, &fg, + &bg, cursor_text_x_hot, + cursor_text_y_hot); + + gl_debug (DEBUG_VIEW, "END"); + + return cursor; +} + +/*****************************************************************************/ +/* Object creation handler: button press event. */ +/*****************************************************************************/ +void +gl_view_text_create_button_press_event (glView *view, + gdouble x, + gdouble y) +{ + GObject *object; + GList *lines; + gchar *family; + glColorNode *color_node; + + gl_view_unselect_all (view); + + object = gl_label_text_new (view->label); + color_node = gl_color_node_new_default (); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + family = gl_view_get_default_font_family (view); + gl_label_object_set_font_family (GL_LABEL_OBJECT(object), family); + gl_label_object_set_font_size (GL_LABEL_OBJECT(object), + gl_view_get_default_font_size (view)); + gl_label_object_set_font_weight (GL_LABEL_OBJECT(object), + gl_view_get_default_font_weight (view)); + gl_label_object_set_font_italic_flag (GL_LABEL_OBJECT(object), + gl_view_get_default_font_italic_flag (view)); + + color_node->color = gl_color_set_opacity (gl_view_get_default_text_color (view), 0.5); + gl_label_object_set_text_color (GL_LABEL_OBJECT(object), + color_node); + gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object), + gl_view_get_default_text_alignment (view)); + gl_label_object_set_text_line_spacing (GL_LABEL_OBJECT(object), gl_view_get_default_text_line_spacing (view)); + + g_free (family); + lines = gl_text_node_lines_new_from_text (_("Text")); + gl_label_text_set_lines (GL_LABEL_TEXT(object), lines); + gl_color_node_free (&color_node); + + view->create_object = GL_LABEL_OBJECT (object); + view->create_x0 = x; + view->create_y0 = y; +} + +/*****************************************************************************/ +/* Object creation handler: motion event. */ +/*****************************************************************************/ +void +gl_view_text_create_motion_event (glView *view, + gdouble x, + gdouble y) +{ + gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), x, y); +} + +/*****************************************************************************/ +/* Object creation handler: button relesase event. */ +/*****************************************************************************/ +void +gl_view_text_create_button_release_event (glView *view, + gdouble x, + gdouble y) +{ + glColorNode *color_node; + + color_node = gl_color_node_new_default (); + gl_label_object_set_position (GL_LABEL_OBJECT(view->create_object), x, y); + color_node->color = gl_view_get_default_text_color(view); + gl_label_object_set_text_color (GL_LABEL_OBJECT(view->create_object), color_node); + gl_color_node_free (&color_node); +} + diff --git a/src/view-text.h b/src/view-text.h new file mode 100644 index 00000000..bb28c90b --- /dev/null +++ b/src/view-text.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view_text.h: GLabels label text object view + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __VIEW_TEXT_H__ +#define __VIEW_TEXT_H__ + +#include "view-object.h" +#include "label-text.h" + +G_BEGIN_DECLS + + +#define GL_TYPE_VIEW_TEXT (gl_view_text_get_type ()) +#define GL_VIEW_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_VIEW_TEXT, glViewText)) +#define GL_VIEW_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW_TEXT, glViewTextClass)) +#define GL_IS_VIEW_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW_TEXT)) +#define GL_IS_VIEW_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW_TEXT)) + +typedef struct _glViewText glViewText; +typedef struct _glViewTextClass glViewTextClass; + +typedef struct _glViewTextPrivate glViewTextPrivate; + +struct _glViewText { + glViewObject parent_object; + + glViewTextPrivate *priv; +}; + +struct _glViewTextClass { + glViewObjectClass parent_class; +}; + + +GType gl_view_text_get_type (void) G_GNUC_CONST; + +glViewObject *gl_view_text_new (glLabelText *object, + glView *view); + + +/* cursor for creating text objects */ +GdkCursor *gl_view_text_get_create_cursor (void); + +/* Object creation handlers. */ +void gl_view_text_create_button_press_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_text_create_motion_event (glView *view, + gdouble x, + gdouble y); + +void gl_view_text_create_button_release_event (glView *view, + gdouble x, + gdouble y); + + +G_END_DECLS + +#endif /* __VIEW_TEXT_H__ */ diff --git a/src/view.c b/src/view.c new file mode 100644 index 00000000..f7ad1850 --- /dev/null +++ b/src/view.c @@ -0,0 +1,3642 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view.c: GLabels View module + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "view.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "label.h" +#include "cairo-label-path.h" +#include "cairo-markup-path.h" +#include "view-object.h" +#include "view-box.h" +#include "view-ellipse.h" +#include "view-line.h" +#include "view-image.h" +#include "view-text.h" +#include "view-barcode.h" +#include "xml-label.h" +#include "color.h" +#include "prefs.h" +#include "marshal.h" + +#include "debug.h" + +/*==========================================================================*/ +/* Private macros and constants. */ +/*==========================================================================*/ + +#define BG_COLOR GL_COLOR (192, 192, 192) + +#define PAPER_RGB_ARGS 1.0, 1.0, 1.0 +#define GRID_RGB_ARGS 0.753, 0.753, 0.753 +#define MARKUP_RGB_ARGS 0.94, 0.39, 0.39 +#define OUTLINE_RGB_ARGS 0.68, 0.85, 0.90 +#define SELECT_LINE_RGBA_ARGS 0.0, 0.0, 1.0, 0.5 +#define SELECT_FILL_RGBA_ARGS 0.75, 0.75, 1.0, 0.5 + +#define GRID_LINE_WIDTH_PIXELS 1.0 +#define MARKUP_LINE_WIDTH_PIXELS 1.0 +#define OUTLINE_WIDTH_PIXELS 3.0 +#define SELECT_LINE_WIDTH_PIXELS 3.0 + +#define ZOOMTOFIT_PAD 16 + +#define POINTS_PER_MM 2.83464566929 + +/*==========================================================================*/ +/* Private types. */ +/*==========================================================================*/ + +enum { + SELECTION_CHANGED, + CONTEXT_MENU_ACTIVATE, + ZOOM_CHANGED, + POINTER_MOVED, + POINTER_EXIT, + MODE_CHANGED, + LAST_SIGNAL +}; + + +/*==========================================================================*/ +/* Private globals */ +/*==========================================================================*/ + +static guint signals[LAST_SIGNAL] = {0}; + +/* "CLIPBOARD" selection */ +static GdkAtom clipboard_atom = GDK_NONE; + +static gdouble zooms[] = { + 8.00, + 6.00, + 4.00, + 3.00, + 2.00, + 1.50, + 1.00, + 0.75, + 0.67, + 0.50, + 0.33, + 0.25, + 0.20, + 0.15, + 0.10, +}; +#define N_ZOOMS G_N_ELEMENTS(zooms) + + +/*==========================================================================*/ +/* Local function prototypes */ +/*==========================================================================*/ + +static void gl_view_finalize (GObject *object); + +static void gl_view_construct (glView *view, + glLabel *label); + +static gdouble get_home_scale (glView *view); + +static gboolean expose_cb (glView *view, + GdkEventExpose *event); + +static void realize_cb (glView *view); + +static void size_allocate_cb (glView *view, + GtkAllocation *allocation); + +static void screen_changed_cb (glView *view); + +static void label_changed_cb (glView *view); + +static void label_resized_cb (glView *view); + +static void label_object_added_cb (glView *view, + glLabelObject *object); + +static void draw_layers (glView *view, + cairo_t *cr); + +static void draw_bg_layer (glView *view, + cairo_t *cr); +static void draw_grid_layer (glView *view, + cairo_t *cr); +static void draw_markup_layer (glView *view, + cairo_t *cr); +static void draw_objects_layer (glView *view, + cairo_t *cr); +static void draw_fg_layer (glView *view, + cairo_t *cr); +static void draw_highlight_layer (glView *view, + cairo_t *cr); +static void draw_select_region_layer (glView *view, + cairo_t *cr); + +static void select_object_real (glView *view, + glViewObject *view_object); +static void unselect_object_real (glView *view, + glViewObject *view_object); + +static glViewObject *view_view_object_at (glView *view, + cairo_t *cr, + gdouble x, + gdouble y); + +static void set_zoom_real (glView *view, + gdouble zoom, + gboolean scale_to_fit_flag); + +static void selection_clear_cb (GtkWidget *widget, + GdkEventSelection *event, + glView *view); + +static void selection_get_cb (GtkWidget *widget, + GtkSelectionData *selection_data, + guint info, + guint time, + glView *view); + +static void selection_received_cb (GtkWidget *widget, + GtkSelectionData *selection_data, + guint time, + glView *view); + +static gboolean focus_in_event_cb (glView *view, + GdkEventFocus *event); + +static gboolean focus_out_event_cb (glView *view, + GdkEventFocus *event); + +static gboolean enter_notify_event_cb (glView *view, + GdkEventCrossing *event); + +static gboolean leave_notify_event_cb (glView *view, + GdkEventCrossing *event); + +static gboolean motion_notify_event_cb (glView *view, + GdkEventMotion *event); + +static gboolean button_press_event_cb (glView *view, + GdkEventButton *event); + +static gboolean button_release_event_cb (glView *view, + GdkEventButton *event); + +static gboolean key_press_event_cb (glView *view, + GdkEventKey *event); + + +/****************************************************************************/ +/* Boilerplate Object stuff. */ +/****************************************************************************/ +G_DEFINE_TYPE (glView, gl_view, GTK_TYPE_VBOX); + +static void +gl_view_class_init (glViewClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_VIEW, "START"); + + gl_view_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_view_finalize; + + signals[SELECTION_CHANGED] = + g_signal_new ("selection_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glViewClass, selection_changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + signals[CONTEXT_MENU_ACTIVATE] = + g_signal_new ("context_menu_activate", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glViewClass, context_menu_activate), + NULL, NULL, + gl_marshal_VOID__INT_UINT, + G_TYPE_NONE, + 2, G_TYPE_INT, G_TYPE_UINT); + + signals[ZOOM_CHANGED] = + g_signal_new ("zoom_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glViewClass, zoom_changed), + NULL, NULL, + gl_marshal_VOID__DOUBLE, + G_TYPE_NONE, + 1, G_TYPE_DOUBLE); + + signals[POINTER_MOVED] = + g_signal_new ("pointer_moved", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glViewClass, pointer_moved), + NULL, NULL, + gl_marshal_VOID__DOUBLE_DOUBLE, + G_TYPE_NONE, + 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE); + + signals[POINTER_EXIT] = + g_signal_new ("pointer_exit", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glViewClass, pointer_exit), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + signals[MODE_CHANGED] = + g_signal_new ("mode_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glViewClass, mode_changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_init (glView *view) +{ + GtkWidget *wscroll; + GdkColor *bg_color; + + gl_debug (DEBUG_VIEW, "START"); + + view->label = NULL; + view->grid_visible = TRUE; + view->grid_spacing = 9; + view->markup_visible = TRUE; + view->default_font_family = NULL; + view->mode = GL_VIEW_MODE_ARROW; + view->object_list = NULL; + view->selected_object_list = NULL; + view->zoom = 1.0; + view->home_scale = get_home_scale (view); + + /* + * Canvas + */ + view->canvas = gtk_layout_new (NULL, NULL); + wscroll = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (wscroll), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_box_pack_start (GTK_BOX (view), wscroll, TRUE, TRUE, 0); + gtk_container_add (GTK_CONTAINER (wscroll), view->canvas); + + bg_color = gl_color_to_gdk_color (BG_COLOR); + gtk_widget_modify_bg (GTK_WIDGET (view->canvas), GTK_STATE_NORMAL, bg_color); + g_free (bg_color); + + GTK_WIDGET_SET_FLAGS (GTK_WIDGET (view->canvas), GTK_CAN_FOCUS); + + gtk_widget_add_events (GTK_WIDGET (view->canvas), + (GDK_FOCUS_CHANGE_MASK | + GDK_ENTER_NOTIFY_MASK | + GDK_LEAVE_NOTIFY_MASK | + GDK_POINTER_MOTION_MASK | + GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_RELEASE_MASK | + GDK_KEY_PRESS_MASK)); + + g_signal_connect_swapped (G_OBJECT (view->canvas), "expose-event", + G_CALLBACK (expose_cb), view); + g_signal_connect_swapped (G_OBJECT (view->canvas), "realize", + G_CALLBACK (realize_cb), view); + g_signal_connect_swapped (G_OBJECT (view->canvas), "size-allocate", + G_CALLBACK (size_allocate_cb), view); + g_signal_connect_swapped (G_OBJECT (view->canvas), "screen-changed", + G_CALLBACK (screen_changed_cb), view); + g_signal_connect_swapped (G_OBJECT (view->canvas), "focus-in-event", + G_CALLBACK (focus_in_event_cb), view); + g_signal_connect_swapped (G_OBJECT (view->canvas), "focus-out-event", + G_CALLBACK (focus_out_event_cb), view); + g_signal_connect_swapped (G_OBJECT (view->canvas), "enter-notify-event", + G_CALLBACK (enter_notify_event_cb), view); + g_signal_connect_swapped (G_OBJECT (view->canvas), "leave-notify-event", + G_CALLBACK (leave_notify_event_cb), view); + g_signal_connect_swapped (G_OBJECT (view->canvas), "motion-notify-event", + G_CALLBACK (motion_notify_event_cb), view); + g_signal_connect_swapped (G_OBJECT (view->canvas), "button-press-event", + G_CALLBACK (button_press_event_cb), view); + g_signal_connect_swapped (G_OBJECT (view->canvas), "button-release-event", + G_CALLBACK (button_release_event_cb), view); + g_signal_connect_swapped (G_OBJECT (view->canvas), "key-press-event", + G_CALLBACK (key_press_event_cb), view); + + /* + * Clipboard + */ + view->have_selection = FALSE; + view->selection_data = NULL; + view->invisible = gtk_invisible_new (); + if (!clipboard_atom) { + clipboard_atom = gdk_atom_intern ("GLABELS_CLIPBOARD", FALSE); + } + gtk_selection_add_target (view->invisible, + clipboard_atom, GDK_SELECTION_TYPE_STRING, 1); + g_signal_connect (G_OBJECT (view->invisible), + "selection_clear_event", + G_CALLBACK (selection_clear_cb), view); + g_signal_connect (G_OBJECT (view->invisible), "selection_get", + G_CALLBACK (selection_get_cb), view); + g_signal_connect (G_OBJECT (view->invisible), + "selection_received", + G_CALLBACK (selection_received_cb), view); + + /* + * Defaults from preferences + */ + gl_view_set_default_font_family (view, gl_prefs->default_font_family); + gl_view_set_default_font_size (view, gl_prefs->default_font_size); + gl_view_set_default_font_weight (view, gl_prefs->default_font_weight); + gl_view_set_default_font_italic_flag (view, gl_prefs->default_font_italic_flag); + gl_view_set_default_text_color (view, gl_prefs->default_text_color); + gl_view_set_default_text_alignment (view, gl_prefs->default_text_alignment); + gl_view_set_default_text_line_spacing (view, gl_prefs->default_text_line_spacing); + gl_view_set_default_line_width (view, gl_prefs->default_line_width); + gl_view_set_default_line_color (view, gl_prefs->default_line_color); + gl_view_set_default_fill_color (view, gl_prefs->default_fill_color); + + gl_debug (DEBUG_VIEW, "END"); +} + +static void +gl_view_finalize (GObject *object) +{ + glView *view = GL_VIEW (object); + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_VIEW (object)); + + if (view->default_font_family) { + g_free (view->default_font_family); + } + + G_OBJECT_CLASS (gl_view_parent_class)->finalize (object); + + gl_debug (DEBUG_VIEW, "END"); +} + +/****************************************************************************/ +/* NEW view object. */ +/****************************************************************************/ +GtkWidget * +gl_view_new (glLabel *label) +{ + glView *view; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (label && GL_IS_LABEL (label), NULL); + + view = g_object_new (GL_TYPE_VIEW, NULL); + + gl_view_construct (view, label); + + gl_debug (DEBUG_VIEW, "END"); + + return GTK_WIDGET (view); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Construct composite widget. */ +/*---------------------------------------------------------------------------*/ +static void +gl_view_construct (glView *view, + glLabel *label) +{ + GList *p_obj; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (GL_IS_VIEW (view)); + + view->label = label; + + for (p_obj = label->objects; p_obj != NULL; p_obj = p_obj->next) + { + object = GL_LABEL_OBJECT (p_obj->data); + + if (GL_IS_LABEL_BOX (object)) { + gl_view_box_new (GL_LABEL_BOX(object), view); + } else if (GL_IS_LABEL_ELLIPSE (object)) { + gl_view_ellipse_new (GL_LABEL_ELLIPSE(object), view); + } else if (GL_IS_LABEL_LINE (object)) { + gl_view_line_new (GL_LABEL_LINE(object), view); + } else if (GL_IS_LABEL_IMAGE (object)) { + gl_view_image_new (GL_LABEL_IMAGE(object), view); + } else if (GL_IS_LABEL_TEXT (object)) { + gl_view_text_new (GL_LABEL_TEXT(object), view); + } else if (GL_IS_LABEL_BARCODE (object)) { + gl_view_barcode_new (GL_LABEL_BARCODE(object), view); + } else { + /* Should not happen! */ + g_message ("Invalid label object type."); + } + } + + g_signal_connect_swapped (G_OBJECT (view->label), "changed", + G_CALLBACK (label_changed_cb), view); + g_signal_connect_swapped (G_OBJECT (view->label), "size_changed", + G_CALLBACK (label_resized_cb), view); + g_signal_connect_swapped (G_OBJECT (view->label), "object_added", + G_CALLBACK (label_object_added_cb), view); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIAVTE. Calculate 1:1 scale for screen. */ +/*---------------------------------------------------------------------------*/ +static gdouble +get_home_scale (glView *view) +{ + GdkScreen *screen; + gdouble screen_width_pixels; + gdouble screen_width_mm; + gdouble screen_height_pixels; + gdouble screen_height_mm; + gdouble x_pixels_per_mm; + gdouble y_pixels_per_mm; + gdouble scale; + + if (view->canvas == NULL) return 1.0; + + if (!gtk_widget_has_screen (GTK_WIDGET (view->canvas))) return 1.0; + + screen = gtk_widget_get_screen (GTK_WIDGET (view->canvas)); + + gl_debug (DEBUG_VIEW, "Screen = %p", screen); + + screen_width_pixels = gdk_screen_get_width (screen); + screen_width_mm = gdk_screen_get_width_mm (screen); + screen_height_pixels = gdk_screen_get_height (screen); + screen_height_mm = gdk_screen_get_height_mm (screen); + + x_pixels_per_mm = screen_width_pixels / screen_width_mm; + y_pixels_per_mm = screen_height_pixels / screen_height_mm; + + gl_debug (DEBUG_VIEW, "Horizontal dot pitch: %g pixels/mm (%g dpi)", + x_pixels_per_mm, x_pixels_per_mm * 25.4); + gl_debug (DEBUG_VIEW, "Vertical dot pitch: %g pixels/mm (%g dpi)", + y_pixels_per_mm, y_pixels_per_mm * 25.4); + + scale = (x_pixels_per_mm + y_pixels_per_mm) / 2.0; + + gl_debug (DEBUG_VIEW, "Average dot pitch: %g pixels/mm (%g dpi)", + scale, scale * 25.4); + + scale /= POINTS_PER_MM; + + gl_debug (DEBUG_VIEW, "Scale = %g pixels/point", scale); + + /* Make sure scale is somewhat sane. */ + if ( (scale < 0.25) || (scale > 4.0) ) return 1.0; + + return scale; +} + +/*---------------------------------------------------------------------------*/ +/* Schedule canvas update. */ +/*---------------------------------------------------------------------------*/ +void +gl_view_update (glView *view) +{ + GtkWidget *widget; + GdkRegion *region; + + gl_debug (DEBUG_VIEW, "START"); + + widget = GTK_WIDGET (view->canvas); + + if (!widget->window) return; + + if ( !view->update_scheduled_flag ) + { + view->update_scheduled_flag = TRUE; + + region = gdk_drawable_get_clip_region (widget->window); + /* redraw the cairo canvas completely by exposing it */ + gdk_window_invalidate_region (widget->window, region, TRUE); + gdk_region_destroy (region); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* Schedule canvas region update. */ +/*---------------------------------------------------------------------------*/ +void +gl_view_update_region (glView *view, + cairo_t *cr, + glLabelRegion *region) +{ + GtkWidget *widget; + GdkRectangle rect; + gdouble x, y, w, h; + + gl_debug (DEBUG_VIEW, "START"); + + widget = GTK_WIDGET (view->canvas); + + if (!widget->window) return; + + x = MIN (region->x1, region->x2); + y = MIN (region->y1, region->y2); + w = fabs (region->x2 - region->x1); + h = fabs (region->y2 - region->y1); + + cairo_user_to_device (cr, &x, &y); + cairo_user_to_device_distance (cr, &w, &h); + + rect.x = x - 3; + rect.y = y - 3; + rect.width = w + 6; + rect.height = h + 6; + + gdk_window_invalidate_rect (widget->window, &rect, TRUE); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Expose handler. */ +/*---------------------------------------------------------------------------*/ +static gboolean +expose_cb (glView *view, + GdkEventExpose *event) +{ + cairo_t *cr; + + gl_debug (DEBUG_VIEW, "START"); + + view->update_scheduled_flag = FALSE; + + /* get a cairo_t */ + cr = gdk_cairo_create (GTK_LAYOUT (view->canvas)->bin_window); + + cairo_rectangle (cr, + event->area.x, event->area.y, + event->area.width, event->area.height); + cairo_clip (cr); + + draw_layers (view, cr); + + cairo_destroy (cr); + + gl_debug (DEBUG_VIEW, "END"); + + return FALSE; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Realize handler. */ +/*---------------------------------------------------------------------------*/ +static void +realize_cb (glView *view) +{ + g_return_if_fail (view && GL_IS_VIEW (view)); + + gl_debug (DEBUG_VIEW, "START"); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Size allocation changed callback. */ +/*---------------------------------------------------------------------------*/ +static void +size_allocate_cb (glView *view, + GtkAllocation *allocation) +{ + gl_debug (DEBUG_VIEW, "START"); + + GTK_LAYOUT (view->canvas)->hadjustment->page_size = allocation->width; + GTK_LAYOUT (view->canvas)->hadjustment->page_increment = allocation->width / 2; + + GTK_LAYOUT (view->canvas)->vadjustment->page_size = allocation->height; + GTK_LAYOUT (view->canvas)->vadjustment->page_increment = allocation->height / 2; + + g_signal_emit_by_name (GTK_LAYOUT (view->canvas)->hadjustment, "changed"); + g_signal_emit_by_name (GTK_LAYOUT (view->canvas)->vadjustment, "changed"); + + if (view->zoom_to_fit_flag) { + /* Maintain best fit zoom */ + gl_view_zoom_to_fit (view); + } + + gl_debug (DEBUG_VIEW, "END"); +} + + + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Screen changed callback. */ +/*---------------------------------------------------------------------------*/ +static void +screen_changed_cb (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + if (gtk_widget_has_screen (GTK_WIDGET (view->canvas))) { + + view->home_scale = get_home_scale (view); + + if (view->zoom_to_fit_flag) { + /* Maintain best fit zoom */ + gl_view_zoom_to_fit (view); + } + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Handle label changed event. */ +/*---------------------------------------------------------------------------*/ +static void +label_changed_cb (glView *view) +{ + g_return_if_fail (view && GL_IS_VIEW (view)); + + gl_debug (DEBUG_VIEW, "START"); + + gl_view_update (view); + + gl_debug (DEBUG_VIEW, "END"); +} + + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Handle label resize event. */ +/*---------------------------------------------------------------------------*/ +static void +label_resized_cb (glView *view) +{ + g_return_if_fail (view && GL_IS_VIEW (view)); + + gl_debug (DEBUG_VIEW, "START"); + + g_signal_emit_by_name (GTK_LAYOUT (view->canvas)->hadjustment, "changed"); + g_signal_emit_by_name (GTK_LAYOUT (view->canvas)->vadjustment, "changed"); + + gl_view_update (view); + + gl_debug (DEBUG_VIEW, "END"); +} + + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Handle new label object. */ +/*---------------------------------------------------------------------------*/ +static void +label_object_added_cb (glView *view, + glLabelObject *object) +{ + glViewObject *view_object; + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (object && GL_IS_LABEL_OBJECT (object)); + + if (GL_IS_LABEL_BOX (object)) { + view_object = gl_view_box_new (GL_LABEL_BOX(object), view); + } else if (GL_IS_LABEL_ELLIPSE (object)) { + view_object = gl_view_ellipse_new (GL_LABEL_ELLIPSE(object), view); + } else if (GL_IS_LABEL_LINE (object)) { + view_object = gl_view_line_new (GL_LABEL_LINE(object), view); + } else if (GL_IS_LABEL_IMAGE (object)) { + view_object = gl_view_image_new (GL_LABEL_IMAGE(object), view); + } else if (GL_IS_LABEL_TEXT (object)) { + view_object = gl_view_text_new (GL_LABEL_TEXT(object), view); + } else if (GL_IS_LABEL_BARCODE (object)) { + view_object = gl_view_barcode_new (GL_LABEL_BARCODE(object), view); + } else { + /* Should not happen! */ + view_object = NULL; + g_message ("Invalid label object type."); + } + + gl_view_select_object (view, view_object); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Create, draw and order layers. */ +/*---------------------------------------------------------------------------*/ +static void +draw_layers (glView *view, + cairo_t *cr) +{ + gdouble scale; + gdouble w, h; + gint canvas_w, canvas_h; + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (view->label && GL_IS_LABEL (view->label)); + + gl_debug (DEBUG_VIEW, "START"); + + scale = view->zoom * view->home_scale; + + gl_label_get_size (view->label, &w, &h); + + scale = view->home_scale * view->zoom; + gtk_layout_set_size (GTK_LAYOUT (view->canvas), w*scale+8, h*scale+8); + + gdk_drawable_get_size (GTK_LAYOUT (view->canvas)->bin_window, &canvas_w, &canvas_h); + + view->x0 = (canvas_w/scale - w) / 2.0; + view->y0 = (canvas_h/scale - h) / 2.0; + view->w = w; + view->h = h; + + cairo_save (cr); + + cairo_scale (cr, scale, scale); + cairo_translate (cr, view->x0, view->y0); + + draw_bg_layer (view, cr); + draw_grid_layer (view, cr); + draw_markup_layer (view, cr); + draw_objects_layer (view, cr); + draw_fg_layer (view, cr); + draw_highlight_layer (view, cr); + draw_select_region_layer (view, cr); + + cairo_restore (cr); + + gl_debug (DEBUG_VIEW, "END"); + +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw background */ +/*---------------------------------------------------------------------------*/ +static void +draw_bg_layer (glView *view, + cairo_t *cr) +{ + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (view->label && GL_IS_LABEL (view->label)); + + gl_cairo_label_path (cr, view->label->template, view->label->rotate_flag, FALSE); + + cairo_set_source_rgb (cr, PAPER_RGB_ARGS); + cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); + cairo_fill (cr); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw grid lines. */ +/*---------------------------------------------------------------------------*/ +static void +draw_grid_layer (glView *view, + cairo_t *cr) +{ + gdouble w, h; + gdouble x, y; + gdouble x0, y0; + const lglTemplateFrame *frame; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (view->label && GL_IS_LABEL(view->label)); + + if (view->grid_visible) + { + + frame = (lglTemplateFrame *)view->label->template->frames->data; + + gl_label_get_size (view->label, &w, &h); + + if (frame->shape == LGL_TEMPLATE_FRAME_SHAPE_RECT) { + x0 = 0.0; + y0 = 0.0; + } else { + /* round labels, adjust grid to line up with center of label. */ + x0 = fmod (w/2.0, view->grid_spacing); + y0 = fmod (h/2.0, view->grid_spacing); + } + + + cairo_save (cr); + + cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); + cairo_set_line_width (cr, GRID_LINE_WIDTH_PIXELS/(view->home_scale * view->zoom)); + cairo_set_source_rgb (cr, GRID_RGB_ARGS); + + for ( x=x0+view->grid_spacing; x < w; x += view->grid_spacing ) + { + cairo_move_to (cr, x, 0); + cairo_line_to (cr, x, h); + cairo_stroke (cr); + } + + for ( y=y0+view->grid_spacing; y < h; y += view->grid_spacing ) + { + cairo_move_to (cr, 0, y); + cairo_line_to (cr, w, y); + cairo_stroke (cr); + } + + cairo_restore (cr); + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw markup layer. */ +/*---------------------------------------------------------------------------*/ +static void +draw_markup_layer (glView *view, + cairo_t *cr) +{ + glLabel *label; + const lglTemplateFrame *frame; + GList *p; + lglTemplateMarkup *markup; + gdouble width, height; + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (view->label && GL_IS_LABEL (view->label)); + + if (view->markup_visible) + { + + label = view->label; + frame = (lglTemplateFrame *)view->label->template->frames->data; + + cairo_save (cr); + + if (label->rotate_flag) + { + lgl_template_frame_get_size (frame, &width, &height); + cairo_rotate (cr, -M_PI/2.0); + cairo_translate (cr, -width, 0.0); + } + + cairo_set_line_width (cr, MARKUP_LINE_WIDTH_PIXELS/(view->home_scale * view->zoom)); + cairo_set_source_rgb (cr, MARKUP_RGB_ARGS); + + for ( p=frame->all.markups; p != NULL; p=p->next ) + { + markup = (lglTemplateMarkup *)p->data; + + gl_cairo_markup_path (cr, markup, label); + + cairo_stroke (cr); + } + + cairo_restore (cr); + } + +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw objects layer. */ +/*---------------------------------------------------------------------------*/ +static void +draw_objects_layer (glView *view, + cairo_t *cr) +{ + gl_label_draw (view->label, cr, TRUE, NULL); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw foreground */ +/*---------------------------------------------------------------------------*/ +static void +draw_fg_layer (glView *view, + cairo_t *cr) +{ + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (view->label && GL_IS_LABEL (view->label)); + + gl_cairo_label_path (cr, view->label->template, view->label->rotate_flag, FALSE); + + cairo_set_line_width (cr, OUTLINE_WIDTH_PIXELS/(view->home_scale * view->zoom)); + cairo_set_source_rgb (cr, OUTLINE_RGB_ARGS); + cairo_stroke (cr); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Create highlight layer. */ +/*---------------------------------------------------------------------------*/ +static void +draw_highlight_layer (glView *view, + cairo_t *cr) +{ + GList *p_obj; + glViewObject *view_object; + + g_return_if_fail (view && GL_IS_VIEW (view)); + + cairo_save (cr); + + cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); + + for (p_obj = view->selected_object_list; p_obj != NULL; p_obj = p_obj->next) + { + view_object = GL_VIEW_OBJECT (p_obj->data); + + gl_view_object_draw_handles (view_object, cr); + } + + cairo_restore (cr); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Draw select region layer. */ +/*---------------------------------------------------------------------------*/ +static void +draw_select_region_layer (glView *view, + cairo_t *cr) +{ + gdouble x1, y1; + gdouble w, h; + + g_return_if_fail (view && GL_IS_VIEW (view)); + + if (view->select_region_visible) + { + x1 = MIN (view->select_region.x1, view->select_region.x2); + y1 = MIN (view->select_region.y1, view->select_region.y2); + w = fabs (view->select_region.x2 - view->select_region.x1); + h = fabs (view->select_region.y2 - view->select_region.y1); + + cairo_save (cr); + + cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); + + cairo_rectangle (cr, x1, y1, w, h); + + cairo_set_source_rgba (cr, SELECT_FILL_RGBA_ARGS); + cairo_fill_preserve (cr); + + cairo_set_line_width (cr, SELECT_LINE_WIDTH_PIXELS/(view->home_scale * view->zoom)); + cairo_set_source_rgba (cr, SELECT_LINE_RGBA_ARGS); + cairo_stroke (cr); + + cairo_restore (cr); + } +} + +/*****************************************************************************/ +/* Show grid. */ +/*****************************************************************************/ +void +gl_view_show_grid (glView *view) +{ + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->grid_visible = TRUE; + gl_view_update (view); +} + +/*****************************************************************************/ +/* Hide grid. */ +/*****************************************************************************/ +void +gl_view_hide_grid (glView *view) +{ + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->grid_visible = FALSE; + gl_view_update (view); +} + +/*****************************************************************************/ +/* Set grid spacing. */ +/*****************************************************************************/ +void +gl_view_set_grid_spacing (glView *view, + gdouble spacing) +{ + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->grid_spacing = spacing; + gl_view_update (view); +} + +/*****************************************************************************/ +/* Show markup. */ +/*****************************************************************************/ +void +gl_view_show_markup (glView *view) +{ + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->markup_visible = TRUE; + gl_view_update (view); +} + +/*****************************************************************************/ +/* Hide markup. */ +/*****************************************************************************/ +void +gl_view_hide_markup (glView *view) +{ + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->markup_visible = FALSE; + gl_view_update (view); +} + +/*****************************************************************************/ +/* Set arrow mode. */ +/*****************************************************************************/ +void +gl_view_arrow_mode (glView *view) +{ + GdkCursor *cursor; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + cursor = gdk_cursor_new (GDK_LEFT_PTR); + gdk_window_set_cursor (view->canvas->window, cursor); + gdk_cursor_unref (cursor); + + view->mode = GL_VIEW_MODE_ARROW; + view->state = GL_VIEW_IDLE; + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Set create text object mode. */ +/*****************************************************************************/ +void +gl_view_object_create_mode (glView *view, + glLabelObjectType type) +{ + GdkCursor *cursor = NULL; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + switch (type) + { + case GL_LABEL_OBJECT_BOX: + cursor = gl_view_box_get_create_cursor (); + break; + case GL_LABEL_OBJECT_ELLIPSE: + cursor = gl_view_ellipse_get_create_cursor (); + break; + case GL_LABEL_OBJECT_LINE: + cursor = gl_view_line_get_create_cursor (); + break; + case GL_LABEL_OBJECT_IMAGE: + cursor = gl_view_image_get_create_cursor (); + break; + case GL_LABEL_OBJECT_TEXT: + cursor = gl_view_text_get_create_cursor (); + break; + case GL_LABEL_OBJECT_BARCODE: + cursor = gl_view_barcode_get_create_cursor (); + break; + default: + g_message ("Invalid label object type.");/*Should not happen!*/ + break; + } + + gdk_window_set_cursor (view->canvas->window, cursor); + gdk_cursor_unref (cursor); + + view->mode = GL_VIEW_MODE_OBJECT_CREATE; + view->state = GL_VIEW_IDLE; + view->create_type = type; + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Select given object (adding to current selection). */ +/*****************************************************************************/ +void +gl_view_select_object (glView *view, + glViewObject *view_object) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + select_object_real (view, view_object); + + g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Unselect given object (removing from current selection). */ +/*****************************************************************************/ +void +gl_view_unselect_object (glView *view, + glViewObject *view_object) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + unselect_object_real (view, view_object); + + g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Select all items. */ +/*****************************************************************************/ +void +gl_view_select_all (glView *view) +{ + GList *p, *p_next; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + /* 1st unselect anything already selected. */ + for (p = view->selected_object_list; p != NULL; p = p_next) { + p_next = p->next; + unselect_object_real (view, GL_VIEW_OBJECT (p->data)); + } + + /* Finally select all objects. */ + for (p = view->object_list; p != NULL; p = p->next) { + select_object_real (view, GL_VIEW_OBJECT (p->data)); + } + + g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Remove all selections */ +/*****************************************************************************/ +void +gl_view_unselect_all (glView *view) +{ + GList *p; + GList *p_next; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p_next) { + p_next = p->next; + unselect_object_real (view, GL_VIEW_OBJECT (p->data)); + } + + g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Select all objects within given rectangular region (adding to selection). */ +/*****************************************************************************/ +void +gl_view_select_region (glView *view, + glLabelRegion *region) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + gdouble r_x1, r_y1; + gdouble r_x2, r_y2; + glLabelRegion obj_extent; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + r_x1 = MIN (region->x1, region->x2); + r_y1 = MIN (region->y1, region->y2); + r_x2 = MAX (region->x1, region->x2); + r_y2 = MAX (region->y1, region->y2); + + for (p = view->object_list; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT(p->data); + if (!gl_view_is_object_selected (view, view_object)) + { + + object = gl_view_object_get_object (view_object); + + gl_label_object_get_extent (object, &obj_extent); + if ((obj_extent.x1 >= r_x1) && + (obj_extent.x2 <= r_x2) && + (obj_extent.y1 >= r_y1) && + (obj_extent.y2 <= r_y2)) + { + select_object_real (view, view_object); + } + + } + } + + g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Select an object. */ +/*---------------------------------------------------------------------------*/ +static void +select_object_real (glView *view, + glViewObject *view_object) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (GL_IS_VIEW_OBJECT (view_object)); + + if (!gl_view_is_object_selected (view, view_object)) { + view->selected_object_list = + g_list_append (view->selected_object_list, view_object); + } + gtk_widget_grab_focus (GTK_WIDGET (view->canvas)); + + gl_view_update (view); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Un-select object. */ +/*---------------------------------------------------------------------------*/ +static void +unselect_object_real (glView *view, + glViewObject *view_object) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (GL_IS_VIEW_OBJECT (view_object)); + + view->selected_object_list = + g_list_remove (view->selected_object_list, view_object); + + gl_view_update (view); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Return object at (x,y). */ +/*---------------------------------------------------------------------------*/ +static glViewObject * +view_view_object_at (glView *view, + cairo_t *cr, + gdouble x, + gdouble y) +{ + GList *p_obj; + glViewObject *view_object; + + g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); + + for (p_obj = g_list_last (view->object_list); p_obj != NULL; p_obj = p_obj->prev) + { + + view_object = GL_VIEW_OBJECT (p_obj->data); + + if (gl_view_object_at (view_object, cr, x, y)) + { + return view_object; + } + + } + + return NULL; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Return object handle at (x,y). */ +/*---------------------------------------------------------------------------*/ +static glViewObject * +view_handle_at (glView *view, + cairo_t *cr, + gdouble x, + gdouble y, + glViewObjectHandle *handle) +{ + GList *p_obj; + glViewObject *view_object; + + g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); + + for (p_obj = g_list_last (view->selected_object_list); p_obj != NULL; p_obj = p_obj->prev) + { + + view_object = GL_VIEW_OBJECT (p_obj->data); + + if ((*handle = gl_view_object_handle_at (view_object, cr, x, y))) + { + return view_object; + } + + } + + return NULL; +} + +/*****************************************************************************/ +/* Is the object in our current selection? */ +/*****************************************************************************/ +gboolean +gl_view_is_object_selected (glView *view, + glViewObject *view_object) +{ + gl_debug (DEBUG_VIEW, ""); + + g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); + g_return_val_if_fail (GL_IS_VIEW_OBJECT (view_object), FALSE); + + if (g_list_find (view->selected_object_list, view_object) == NULL) { + return FALSE; + } + return TRUE; +} + +/*****************************************************************************/ +/* Is our current selection empty? */ +/*****************************************************************************/ +gboolean +gl_view_is_selection_empty (glView *view) +{ + gl_debug (DEBUG_VIEW, ""); + + g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); + + if (view->selected_object_list == NULL) { + return TRUE; + } else { + return FALSE; + } +} + +/*****************************************************************************/ +/* Is our current selection atomic? I.e. only one item selected. */ +/*****************************************************************************/ +gboolean +gl_view_is_selection_atomic (glView *view) +{ + gl_debug (DEBUG_VIEW, ""); + + g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); + + if (view->selected_object_list == NULL) + return FALSE; + if (view->selected_object_list->next == NULL) + return TRUE; + return FALSE; +} + +/*****************************************************************************/ +/* Delete selected objects. (Bypass clipboard) */ +/*****************************************************************************/ +void +gl_view_delete_selection (glView *view) +{ + GList *object_list; + GList *p; + GList *p_next; + glViewObject *view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + object_list = view->selected_object_list; + view->selected_object_list = NULL; + g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); + + for (p = object_list; p != NULL; p = p_next) { + p_next = p->next; + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_remove (object); + } + + g_list_free (object_list); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Get object property editor of first selected object. */ +/*****************************************************************************/ +GtkWidget * +gl_view_get_editor (glView *view) +{ + glViewObject *view_object; + GtkWidget *editor = NULL; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); + + if (!gl_view_is_selection_empty (view)) { + + view_object = GL_VIEW_OBJECT(view->selected_object_list->data); + editor = gl_view_object_get_editor (view_object); + + } + + gl_debug (DEBUG_VIEW, "END"); + + return editor; +} + +/*****************************************************************************/ +/* Raise selected items to top. */ +/*****************************************************************************/ +void +gl_view_raise_selection (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_raise_to_top (object); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Lower selected items to bottom. */ +/*****************************************************************************/ +void +gl_view_lower_selection (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_lower_to_bottom (object); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Rotate selected objects by given angle. */ +/*****************************************************************************/ +void +gl_view_rotate_selection (glView *view, + gdouble theta_degs) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_rotate (object, theta_degs); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Rotate selected objects 90 degrees left. */ +/*****************************************************************************/ +void +gl_view_rotate_selection_left (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_rotate (object, -90.0); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Rotate selected objects 90 degrees right. */ +/*****************************************************************************/ +void +gl_view_rotate_selection_right (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_rotate (object, 90.0); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Flip selected objects horizontally. */ +/*****************************************************************************/ +void +gl_view_flip_selection_horiz (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_flip_horiz (object); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Flip selected objects vertically. */ +/*****************************************************************************/ +void +gl_view_flip_selection_vert (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_flip_vert (object); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Align selected objects to left most edge. */ +/*****************************************************************************/ +void +gl_view_align_selection_left (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + gdouble dx, x1_min; + glLabelRegion obj_extent; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + g_return_if_fail (!gl_view_is_selection_empty (view) && + !gl_view_is_selection_atomic (view)); + + /* find left most edge */ + p = view->selected_object_list; + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + x1_min = obj_extent.x1; + for (p = p->next; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + if ( obj_extent.x1 < x1_min ) x1_min = obj_extent.x1; + } + + /* now adjust the object positions to line up the left edges */ + for (p = view->selected_object_list; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + dx = x1_min - obj_extent.x1; + gl_label_object_set_position_relative (object, dx, 0.0); + } + + gl_debug (DEBUG_VIEW, "END"); +} + + +/*****************************************************************************/ +/* Align selected objects to right most edge. */ +/*****************************************************************************/ +void +gl_view_align_selection_right (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + gdouble dx, x2_max; + glLabelRegion obj_extent; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + g_return_if_fail (!gl_view_is_selection_empty (view) && + !gl_view_is_selection_atomic (view)); + + /* find right most edge */ + p = view->selected_object_list; + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + x2_max = obj_extent.x2; + for (p = p->next; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + if ( obj_extent.x2 > x2_max ) x2_max = obj_extent.x2; + } + + /* now adjust the object positions to line up the right edges */ + for (p = view->selected_object_list; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + dx = x2_max - obj_extent.x2; + gl_label_object_set_position_relative (object, dx, 0.0); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Align selected objects to horizontal center of objects. */ +/*****************************************************************************/ +void +gl_view_align_selection_hcenter (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + gdouble dx; + gdouble dxmin; + gdouble xsum, xavg; + glLabelRegion obj_extent; + gdouble xcenter; + gint n; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + g_return_if_fail (!gl_view_is_selection_empty (view) && + !gl_view_is_selection_atomic (view)); + + /* find average center of objects */ + xsum = 0.0; + n = 0; + for (p = view->selected_object_list; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + xsum += (obj_extent.x1 + obj_extent.x2) / 2.0; + n++; + } + xavg = xsum / n; + + /* find center of object closest to average center */ + p = view->selected_object_list; + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + dxmin = fabs (xavg - (obj_extent.x1 + obj_extent.x2)/2.0); + xcenter = (obj_extent.x1 + obj_extent.x2)/2.0; + for (p = p->next; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + dx = fabs (xavg - (obj_extent.x1 + obj_extent.x2)/2.0); + if ( dx < dxmin ) + { + dxmin = dx; + xcenter = (obj_extent.x1 + obj_extent.x2)/2.0; + } + } + + /* now adjust the object positions to line up this center */ + for (p = view->selected_object_list; p != NULL; p = p->next) { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + dx = xcenter - (obj_extent.x1 + obj_extent.x2)/2.0; + gl_label_object_set_position_relative (object, dx, 0.0); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Align selected objects to top most edge. */ +/*****************************************************************************/ +void +gl_view_align_selection_top (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + gdouble dy, y1_min; + glLabelRegion obj_extent; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + g_return_if_fail (!gl_view_is_selection_empty (view) && + !gl_view_is_selection_atomic (view)); + + /* find top most edge */ + p = view->selected_object_list; + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + y1_min = obj_extent.y1; + for (p = p->next; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + if ( obj_extent.y1 < y1_min ) y1_min = obj_extent.y1; + } + + /* now adjust the object positions to line up the top edges */ + for (p = view->selected_object_list; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + dy = y1_min - obj_extent.y1; + gl_label_object_set_position_relative (object, 0.0, dy); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Align selected objects to bottom most edge. */ +/*****************************************************************************/ +void +gl_view_align_selection_bottom (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + gdouble dy, y2_max; + glLabelRegion obj_extent; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + g_return_if_fail (!gl_view_is_selection_empty (view) && + !gl_view_is_selection_atomic (view)); + + /* find bottom most edge */ + p = view->selected_object_list; + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + y2_max = obj_extent.y2; + for (p = p->next; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + if ( obj_extent.y2 > y2_max ) y2_max = obj_extent.y2; + } + + /* now adjust the object positions to line up the bottom edges */ + for (p = view->selected_object_list; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + dy = y2_max - obj_extent.y2; + gl_label_object_set_position_relative (object, 0.0, dy); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Align selected objects to viertical center of objects. */ +/*****************************************************************************/ +void +gl_view_align_selection_vcenter (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + gdouble dy; + gdouble dymin; + gdouble ysum, yavg; + glLabelRegion obj_extent; + gdouble ycenter; + gint n; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + g_return_if_fail (!gl_view_is_selection_empty (view) && + !gl_view_is_selection_atomic (view)); + + /* find average center of objects */ + ysum = 0.0; + n = 0; + for (p = view->selected_object_list; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + ysum += (obj_extent.y1 + obj_extent.y2) / 2.0; + n++; + } + yavg = ysum / n; + + /* find center of object closest to average center */ + p = view->selected_object_list; + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + dymin = fabs (yavg - (obj_extent.y1 + obj_extent.y2)/2.0); + ycenter = (obj_extent.y1 + obj_extent.y2)/2.0; + for (p = p->next; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + dy = fabs (yavg - (obj_extent.y1 + obj_extent.y2)/2.0); + if ( dy < dymin ) + { + dymin = dy; + ycenter = (obj_extent.y1 + obj_extent.y2)/2.0; + } + } + + /* now adjust the object positions to line up this center */ + for (p = view->selected_object_list; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + dy = ycenter - (obj_extent.y1 + obj_extent.y2)/2.0; + gl_label_object_set_position_relative (object, 0.0, dy); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Center selected objects to in center of label. */ +/*****************************************************************************/ +void +gl_view_center_selection_horiz (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + gdouble dx; + gdouble x_label_center; + gdouble x_obj_center; + glLabelRegion obj_extent; + gdouble w, h; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + g_return_if_fail (!gl_view_is_selection_empty (view)); + + gl_label_get_size (view->label, &w, &h); + x_label_center = w / 2.0; + + /* adjust the object positions */ + for (p = view->selected_object_list; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + x_obj_center = (obj_extent.x1 + obj_extent.x2) / 2.0; + dx = x_label_center - x_obj_center; + gl_label_object_set_position_relative (object, dx, 0.0); + } + + gl_debug (DEBUG_VIEW, "END"); +} + + +/*****************************************************************************/ +/* Center selected objects to in center of label. */ +/*****************************************************************************/ +void +gl_view_center_selection_vert (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + gdouble dy; + gdouble y_label_center; + gdouble y_obj_center; + glLabelRegion obj_extent; + gdouble w, h; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + g_return_if_fail (!gl_view_is_selection_empty (view)); + + gl_label_get_size (view->label, &w, &h); + y_label_center = h / 2.0; + + /* adjust the object positions */ + for (p = view->selected_object_list; p != NULL; p = p->next) + { + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + gl_label_object_get_extent (object, &obj_extent); + y_obj_center = (obj_extent.y1 + obj_extent.y2) / 2.0; + dy = y_label_center - y_obj_center; + gl_label_object_set_position_relative (object, 0.0, dy); + } + + gl_debug (DEBUG_VIEW, "END"); +} + + +/*****************************************************************************/ +/* Move selected objects */ +/*****************************************************************************/ +void +gl_view_move_selection (glView *view, + gdouble dx, + gdouble dy) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) + { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + gl_label_object_set_position_relative (object, dx, dy); + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Can text properties be set for selection? */ +/*****************************************************************************/ +gboolean +gl_view_can_selection_text (glView *view) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, ""); + + g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); + + for (p = view->selected_object_list; p != NULL; p = p->next) + { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + if (gl_label_object_can_text (object)) + { + return TRUE; + } + + } + + return FALSE; +} + +/*****************************************************************************/ +/* Set font family for all text contained in selected objects. */ +/*****************************************************************************/ +void +gl_view_set_selection_font_family (glView *view, + const gchar *font_family) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + gl_label_object_set_font_family (object, font_family); + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Set font size for all text contained in selected objects. */ +/*****************************************************************************/ +void +gl_view_set_selection_font_size (glView *view, + gdouble font_size) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + gl_label_object_set_font_size (object, font_size); + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Set font weight for all text contained in selected objects. */ +/*****************************************************************************/ +void +gl_view_set_selection_font_weight (glView *view, + PangoWeight font_weight) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + gl_label_object_set_font_weight (object, font_weight); + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Set font italic flag for all text contained in selected objects. */ +/*****************************************************************************/ +void +gl_view_set_selection_font_italic_flag (glView *view, + gboolean font_italic_flag) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + gl_label_object_set_font_italic_flag (object, font_italic_flag); + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Set text alignment for all text contained in selected objects. */ +/*****************************************************************************/ +void +gl_view_set_selection_text_alignment (glView *view, + PangoAlignment text_alignment) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + gl_label_object_set_text_alignment (object, text_alignment); + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Set text line spacing for all text contained in selected objects. */ +/*****************************************************************************/ +void +gl_view_set_selection_text_line_spacing (glView *view, + gdouble text_line_spacing) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + gl_label_object_set_text_line_spacing (object, text_line_spacing); + + } + + gl_debug (DEBUG_VIEW, "END"); +} +/*****************************************************************************/ +/* Set text color for all text contained in selected objects. */ +/*****************************************************************************/ +void +gl_view_set_selection_text_color (glView *view, + glColorNode *text_color_node) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + gl_label_object_set_text_color (object, text_color_node); + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Can fill properties be set for selection? */ +/*****************************************************************************/ +gboolean +gl_view_can_selection_fill (glView *view) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, ""); + + g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + if (gl_label_object_can_fill (object)) { + return TRUE; + } + + } + + return FALSE; +} + +/*****************************************************************************/ +/* Set fill color for all selected objects. */ +/*****************************************************************************/ +void +gl_view_set_selection_fill_color (glView *view, + glColorNode *fill_color_node) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + gl_label_object_set_fill_color (object, fill_color_node); + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Can line color properties be set for selection? */ +/*****************************************************************************/ +gboolean +gl_view_can_selection_line_color (glView *view) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, ""); + + g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + if (gl_label_object_can_line_color (object)) { + return TRUE; + } + + } + + return FALSE; +} + +/*****************************************************************************/ +/* Set line color for all selected objects. */ +/*****************************************************************************/ +void +gl_view_set_selection_line_color (glView *view, + glColorNode *line_color_node) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + gl_label_object_set_line_color (object, line_color_node); + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Can line width properties be set for selection? */ +/*****************************************************************************/ +gboolean +gl_view_can_selection_line_width (glView *view) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, ""); + + g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + if (gl_label_object_can_line_width (object)) { + return TRUE; + } + + } + + return FALSE; +} + +/*****************************************************************************/ +/* Set line width for all selected objects. */ +/*****************************************************************************/ +void +gl_view_set_selection_line_width (glView *view, + gdouble line_width) +{ + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + object = gl_view_object_get_object(GL_VIEW_OBJECT (p->data)); + gl_label_object_set_line_width (object, line_width); + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* "Cut" selected items and place in clipboard selections. */ +/*****************************************************************************/ +void +gl_view_cut (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + gl_view_copy (view); + gl_view_delete_selection (view); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* "Copy" selected items to clipboard selections. */ +/*****************************************************************************/ +void +gl_view_copy (glView *view) +{ + GList *p; + glViewObject *view_object; + glLabelObject *object; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + if (view->selected_object_list) { + + if ( view->selection_data ) { + g_object_unref (view->selection_data); + } + view->selection_data = GL_LABEL(gl_label_new ()); + gl_label_set_template (view->selection_data, view->label->template); + gl_label_set_rotate_flag (view->selection_data, view->label->rotate_flag); + + for (p = view->selected_object_list; p != NULL; p = p->next) { + + view_object = GL_VIEW_OBJECT (p->data); + object = gl_view_object_get_object (view_object); + + gl_label_object_dup (object, view->selection_data); + + } + + gtk_selection_owner_set (view->invisible, + clipboard_atom, GDK_CURRENT_TIME); + view->have_selection = TRUE; + + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* "Paste" from private clipboard selection. */ +/*****************************************************************************/ +void +gl_view_paste (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + gtk_selection_convert (GTK_WIDGET (view->invisible), + clipboard_atom, GDK_SELECTION_TYPE_STRING, + GDK_CURRENT_TIME); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Zoom in one "notch" */ +/*****************************************************************************/ +void +gl_view_zoom_in (glView *view) +{ + gint i, i_min; + gdouble dist, dist_min; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + /* Find index of current scale (or best match) */ + i_min = 1; /* start with 2nd largest scale */ + dist_min = fabs (zooms[1] - view->zoom); + for (i = 2; i < N_ZOOMS; i++) { + dist = fabs (zooms[i] - view->zoom); + if (dist < dist_min) { + i_min = i; + dist_min = dist; + } + } + + /* zoom in one "notch" */ + i = MAX (0, i_min - 1); + gl_debug (DEBUG_VIEW, "zoom[%d] = %g", i, zooms[i]); + set_zoom_real (view, zooms[i], FALSE); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Zoom out one "notch" */ +/*****************************************************************************/ +void +gl_view_zoom_out (glView *view) +{ + gint i, i_min; + gdouble dist, dist_min; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + /* Find index of current scale (or best match) */ + i_min = 0; /* start with largest scale */ + dist_min = fabs (zooms[0] - view->zoom); + for (i = 1; i < N_ZOOMS; i++) { + dist = fabs (zooms[i] - view->zoom); + if (dist < dist_min) { + i_min = i; + dist_min = dist; + } + } + + /* zoom out one "notch" */ + if (i_min >= N_ZOOMS) + return; + i = i_min + 1; + if (i >= N_ZOOMS) + return; + set_zoom_real (view, zooms[i], FALSE); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*****************************************************************************/ +/* Set zoom to best fit. */ +/*****************************************************************************/ +void +gl_view_zoom_to_fit (glView *view) +{ + gint w_view, h_view; + gdouble w_label, h_label; + gdouble x_scale, y_scale, scale; + + gl_debug (DEBUG_VIEW, ""); + + if ( ! GTK_WIDGET_VISIBLE(view)) { + set_zoom_real (view, 1.0, TRUE); + return; + } + + w_view = GTK_WIDGET(view)->allocation.width; + h_view = GTK_WIDGET(view)->allocation.height; + + gl_label_get_size (GL_LABEL(view->label), &w_label, &h_label); + + gl_debug (DEBUG_VIEW, "View size: %d, %d", w_view, h_view); + gl_debug (DEBUG_VIEW, "Label size: %g, %g", w_label, h_label); + + /* Calculate best scale */ + x_scale = (double)(w_view - ZOOMTOFIT_PAD) / w_label; + y_scale = (double)(h_view - ZOOMTOFIT_PAD) / h_label; + scale = MIN (x_scale, y_scale); + gl_debug (DEBUG_VIEW, "Candidate zooms: %g, %g => %g", x_scale, y_scale, scale); + + /* Limit */ + gl_debug (DEBUG_VIEW, "Scale: %g", scale); + scale = MIN (scale, zooms[0]*view->home_scale); + scale = MAX (scale, zooms[N_ZOOMS-1]*view->home_scale); + gl_debug (DEBUG_VIEW, "Limitted scale: %g", scale); + + set_zoom_real (view, scale/view->home_scale, TRUE); +} + +/*****************************************************************************/ +/* Set current zoom factor to explicit value. */ +/*****************************************************************************/ +void +gl_view_set_zoom (glView *view, + gdouble zoom) +{ + gl_debug (DEBUG_VIEW, "START"); + + set_zoom_real (view, zoom, FALSE); + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Set canvas scale. */ +/*---------------------------------------------------------------------------*/ +static void +set_zoom_real (glView *view, + gdouble zoom, + gboolean zoom_to_fit_flag) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (zoom > 0.0); + + /* Limit, if needed */ + gl_debug (DEBUG_VIEW, "Zoom requested: %g", zoom); + zoom = MIN (zoom, zooms[0]); + zoom = MAX (zoom, zooms[N_ZOOMS-1]); + gl_debug (DEBUG_VIEW, "Limitted zoom: %g", zoom); + + if ( zoom != view->zoom ) { + + view->zoom = zoom; + view->zoom_to_fit_flag = zoom_to_fit_flag; + + gl_view_update (view); + + g_signal_emit (G_OBJECT(view), signals[ZOOM_CHANGED], 0, zoom); + + } + + gl_debug (DEBUG_VIEW, "END"); + +} + + +/*****************************************************************************/ +/* Get current zoom factor. */ +/*****************************************************************************/ +gdouble +gl_view_get_zoom (glView *view) +{ + gl_debug (DEBUG_VIEW, ""); + + g_return_val_if_fail (view && GL_IS_VIEW (view), 1.0); + + return view->zoom; +} + +/*****************************************************************************/ +/* Is this the maximum zoom level. */ +/*****************************************************************************/ +gboolean +gl_view_is_zoom_max (glView *view) +{ + gl_debug (DEBUG_VIEW, ""); + + g_return_val_if_fail (GL_IS_VIEW (view), FALSE); + + return view->zoom >= zooms[0]; +} + +/*****************************************************************************/ +/* Is this the minimum zoom level. */ +/*****************************************************************************/ +gboolean +gl_view_is_zoom_min (glView *view) +{ + gl_debug (DEBUG_VIEW, ""); + + g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); + + return view->zoom <= zooms[N_ZOOMS-1]; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Handle "selection-clear" signal. */ +/*---------------------------------------------------------------------------*/ +static void +selection_clear_cb (GtkWidget *widget, + GdkEventSelection *event, + glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->have_selection = FALSE; + g_object_unref (view->selection_data); + view->selection_data = NULL; + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Handle "selection-get" signal. */ +/*---------------------------------------------------------------------------*/ +static void +selection_get_cb (GtkWidget *widget, + GtkSelectionData *selection_data, + guint info, + guint time, + glView *view) +{ + gchar *buffer; + glXMLLabelStatus status; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + if (view->have_selection) { + + buffer = gl_xml_label_save_buffer (view->selection_data, + &status); + gtk_selection_data_set (selection_data, + GDK_SELECTION_TYPE_STRING, 8, + (guchar *)buffer, strlen (buffer)); + g_free (buffer); + } + + gl_debug (DEBUG_VIEW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Handle "selection-received" signal. (Result of Paste) */ +/*---------------------------------------------------------------------------*/ +static void +selection_received_cb (GtkWidget *widget, + GtkSelectionData *selection_data, + guint time, + glView *view) +{ + glLabel *label = NULL; + glXMLLabelStatus status; + GList *p, *p_next; + glLabelObject *object, *newobject; + + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + if (selection_data->length < 0) { + return; + } + if (selection_data->type != GDK_SELECTION_TYPE_STRING) { + return; + } + + gl_view_unselect_all (view); + + label = gl_xml_label_open_buffer ((gchar *)selection_data->data, &status); + for (p = label->objects; p != NULL; p = p_next) { + p_next = p->next; + + object = (glLabelObject *) p->data; + newobject = gl_label_object_dup (object, view->label); + + gl_debug (DEBUG_VIEW, "object pasted"); + } + g_object_unref (label); + + gl_debug (DEBUG_VIEW, "END"); +} + +/****************************************************************************/ +/* Set default font family. */ +/****************************************************************************/ +void +gl_view_set_default_font_family (glView *view, + const gchar *font_family) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + if (view->default_font_family) { + g_free (view->default_font_family); + } + view->default_font_family = g_strdup (font_family); + + gl_debug (DEBUG_VIEW, "END"); +} + + +/****************************************************************************/ +/* Set default font size. */ +/****************************************************************************/ +void +gl_view_set_default_font_size (glView *view, + gdouble font_size) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->default_font_size = font_size; + + gl_debug (DEBUG_VIEW, "END"); +} + + +/****************************************************************************/ +/* Set default font weight. */ +/****************************************************************************/ +void +gl_view_set_default_font_weight (glView *view, + PangoWeight font_weight) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->default_font_weight = font_weight; + + gl_debug (DEBUG_VIEW, "END"); +} + + +/****************************************************************************/ +/* Set default font italic flag. */ +/****************************************************************************/ +void +gl_view_set_default_font_italic_flag (glView *view, + gboolean font_italic_flag) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->default_font_italic_flag = font_italic_flag; + + gl_debug (DEBUG_VIEW, "END"); +} + + +/****************************************************************************/ +/* Set default text color. */ +/****************************************************************************/ +void +gl_view_set_default_text_color (glView *view, + guint text_color) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->default_text_color = text_color; + + gl_debug (DEBUG_VIEW, "END"); +} + + +/****************************************************************************/ +/* Set default text alignment. */ +/****************************************************************************/ +void +gl_view_set_default_text_alignment (glView *view, + PangoAlignment text_alignment) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->default_text_alignment = text_alignment; + gl_debug (DEBUG_VIEW, "END"); +} + +/****************************************************************************/ +/* Set default text line spacing. */ +/****************************************************************************/ +void +gl_view_set_default_text_line_spacing (glView *view, + gdouble text_line_spacing) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->default_text_line_spacing = text_line_spacing; + + gl_debug (DEBUG_VIEW, "END"); +} + + +/****************************************************************************/ +/* Set default line width. */ +/****************************************************************************/ +void +gl_view_set_default_line_width (glView *view, + gdouble line_width) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->default_line_width = line_width; + + gl_debug (DEBUG_VIEW, "END"); +} + + +/****************************************************************************/ +/* Set default line color. */ +/****************************************************************************/ +void +gl_view_set_default_line_color (glView *view, + guint line_color) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->default_line_color = line_color; + + gl_debug (DEBUG_VIEW, "END"); +} + + +/****************************************************************************/ +/* Set default fill color. */ +/****************************************************************************/ +void +gl_view_set_default_fill_color (glView *view, + guint fill_color) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + + view->default_fill_color = fill_color; + + gl_debug (DEBUG_VIEW, "END"); +} + + + +/****************************************************************************/ +/* Get default font family. */ +/****************************************************************************/ +gchar * +gl_view_get_default_font_family (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view && GL_IS_VIEW (view), NULL); + + gl_debug (DEBUG_VIEW, "END"); + + return g_strdup (view->default_font_family); +} + + +/****************************************************************************/ +/* Get default font size. */ +/****************************************************************************/ +gdouble +gl_view_get_default_font_size (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view && GL_IS_VIEW (view), 12.0); + + gl_debug (DEBUG_VIEW, "END"); + + return view->default_font_size; +} + + +/****************************************************************************/ +/* Get default font weight. */ +/****************************************************************************/ +PangoWeight +gl_view_get_default_font_weight (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view && GL_IS_VIEW (view), PANGO_WEIGHT_NORMAL); + + gl_debug (DEBUG_VIEW, "END"); + + return view->default_font_weight; +} + + +/****************************************************************************/ +/* Get default font italic flag. */ +/****************************************************************************/ +gboolean +gl_view_get_default_font_italic_flag (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view && GL_IS_VIEW (view), FALSE); + + gl_debug (DEBUG_VIEW, "END"); + + return view->default_font_italic_flag; +} + + +/****************************************************************************/ +/* Get default text color. */ +/****************************************************************************/ +guint +gl_view_get_default_text_color (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view && GL_IS_VIEW (view), 0); + + gl_debug (DEBUG_VIEW, "END"); + + return view->default_text_color; +} + + +/****************************************************************************/ +/* Get default text alignment. */ +/****************************************************************************/ +PangoAlignment +gl_view_get_default_text_alignment (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view && GL_IS_VIEW (view), PANGO_ALIGN_LEFT); + + gl_debug (DEBUG_VIEW, "END"); + + return view->default_text_alignment; +} + +/****************************************************************************/ +/* Get default text line spacing. */ +/****************************************************************************/ +gdouble +gl_view_get_default_text_line_spacing (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view && GL_IS_VIEW (view), 1.0); + + gl_debug (DEBUG_VIEW, "END"); + + return view->default_text_line_spacing; +} + + + +/****************************************************************************/ +/* Get default line width. */ +/****************************************************************************/ +gdouble +gl_view_get_default_line_width (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view && GL_IS_VIEW (view), 1.0); + + gl_debug (DEBUG_VIEW, "END"); + + return view->default_line_width; +} + + +/****************************************************************************/ +/* Get default line color. */ +/****************************************************************************/ +guint +gl_view_get_default_line_color (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view && GL_IS_VIEW (view), 0); + + gl_debug (DEBUG_VIEW, "END"); + + return view->default_line_color; +} + + +/****************************************************************************/ +/* Get default fill color. */ +/****************************************************************************/ +guint +gl_view_get_default_fill_color (glView *view) +{ + gl_debug (DEBUG_VIEW, "START"); + + g_return_val_if_fail (view && GL_IS_VIEW (view), 0); + + gl_debug (DEBUG_VIEW, "END"); + + return view->default_fill_color; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Focus in event handler. */ +/*---------------------------------------------------------------------------*/ +static gboolean +focus_in_event_cb (glView *view, + GdkEventFocus *event) +{ + GTK_WIDGET_SET_FLAGS (GTK_WIDGET (view->canvas), GTK_HAS_FOCUS); + + return FALSE; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Focus out event handler. */ +/*---------------------------------------------------------------------------*/ +static gboolean +focus_out_event_cb (glView *view, + GdkEventFocus *event) +{ + GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (view->canvas), GTK_HAS_FOCUS); + + return FALSE; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Enter notify event handler. */ +/*---------------------------------------------------------------------------*/ +static gboolean +enter_notify_event_cb (glView *view, + GdkEventCrossing *event) +{ + gtk_widget_grab_focus(GTK_WIDGET (view->canvas)); + + return FALSE; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Leave notify event handler. */ +/*---------------------------------------------------------------------------*/ +static gboolean +leave_notify_event_cb (glView *view, + GdkEventCrossing *event) +{ + + g_signal_emit (G_OBJECT(view), signals[POINTER_EXIT], 0); + + return FALSE; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Motion notify event handler. */ +/*---------------------------------------------------------------------------*/ +static gboolean +motion_notify_event_cb (glView *view, + GdkEventMotion *event) +{ + gboolean return_value = FALSE; + cairo_t *cr; + gdouble scale; + gdouble x, y; + GdkCursor *cursor; + glViewObjectHandle handle; + + cr = gdk_cairo_create (GTK_LAYOUT (view->canvas)->bin_window); + + /* + * Translate to label coordinates + */ + scale = view->zoom * view->home_scale; + cairo_scale (cr, scale, scale); + cairo_translate (cr, view->x0, view->y0); + + x = event->x; + y = event->y; + cairo_device_to_user (cr, &x, &y); + + /* + * Emit signal regardless of mode + */ + g_signal_emit (G_OBJECT(view), signals[POINTER_MOVED], 0, x, y); + + /* + * Handle event as appropriate for mode + */ + switch (view->mode) + { + + case GL_VIEW_MODE_ARROW: + switch (view->state) + { + + case GL_VIEW_IDLE: + if ( gl_view_is_selection_atomic (view) && + view_handle_at (view, cr, event->x, event->y, &handle) ) + { + cursor = gdk_cursor_new (GDK_CROSSHAIR); + } + else if (view_view_object_at (view, cr, event->x, event->y)) + { + cursor = gdk_cursor_new (GDK_FLEUR); + } + else + { + cursor = gdk_cursor_new (GDK_LEFT_PTR); + } + gdk_window_set_cursor (view->canvas->window, cursor); + gdk_cursor_unref (cursor); + break; + + case GL_VIEW_ARROW_SELECT_REGION: +#ifdef CLIP_UPDATES + gl_view_update_region (view, cr, &view->select_region); +#endif + view->select_region.x2 = x; + view->select_region.y2 = y; +#ifdef CLIP_UPDATES + gl_view_update_region (view, cr, &view->select_region); +#else + gl_view_update (view); +#endif + break; + + case GL_VIEW_ARROW_MOVE: + gl_view_move_selection (view, + (x - view->move_last_x), + (y - view->move_last_y)); + view->move_last_x = x; + view->move_last_y = y; + break; + + case GL_VIEW_ARROW_RESIZE: + gl_view_object_resize_event (view->resize_object, + view->resize_handle, + view->resize_honor_aspect, + cr, + event->x, + event->y); + break; + + default: + g_message ("Invalid arrow state."); /*Should not happen!*/ + } + return_value = TRUE; + break; + + + case GL_VIEW_MODE_OBJECT_CREATE: + if (view->state != GL_VIEW_IDLE) + { + switch (view->create_type) + { + case GL_LABEL_OBJECT_BOX: + gl_view_box_create_motion_event (view, x, y); + break; + case GL_LABEL_OBJECT_ELLIPSE: + gl_view_ellipse_create_motion_event (view, x, y); + break; + case GL_LABEL_OBJECT_LINE: + gl_view_line_create_motion_event (view, x, y); + break; + case GL_LABEL_OBJECT_IMAGE: + gl_view_image_create_motion_event (view, x, y); + break; + case GL_LABEL_OBJECT_TEXT: + gl_view_text_create_motion_event (view, x, y); + break; + case GL_LABEL_OBJECT_BARCODE: + gl_view_barcode_create_motion_event (view, x, y); + break; + default: + g_message ("Invalid create type."); /*Should not happen!*/ + } + } + break; + + + default: + g_message ("Invalid view mode."); /*Should not happen!*/ + + } + + cairo_destroy (cr); + + /* + * FIXME: we re-establish grabs here if the grab has been lost. We seem to be + * losing grabs when we emit signals that lead to the manipulation of + * the GtkUIManager. Needs more investigation + */ + if (view->grabbed_flag && !gdk_pointer_is_grabbed ()) + { + gdk_pointer_grab (GTK_LAYOUT (view->canvas)->bin_window, + FALSE, + (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK), + NULL, + NULL, + event->time); + } + + return return_value; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Button press event handler. */ +/*---------------------------------------------------------------------------*/ +static gboolean +button_press_event_cb (glView *view, + GdkEventButton *event) +{ + gboolean return_value = FALSE; + cairo_t *cr; + gdouble scale; + gdouble x, y; + glViewObject *view_object; + glViewObjectHandle handle; + + cr = gdk_cairo_create (GTK_LAYOUT (view->canvas)->bin_window); + + /* + * Translate to label coordinates + */ + scale = view->zoom * view->home_scale; + cairo_scale (cr, scale, scale); + cairo_translate (cr, view->x0, view->y0); + + x = event->x; + y = event->y; + cairo_device_to_user (cr, &x, &y); + + switch (event->button) + { + + case 1: + /* + * Handle event as appropriate for mode + */ + switch (view->mode) + { + case GL_VIEW_MODE_ARROW: + if ( gl_view_is_selection_atomic (view) && + (view_object = view_handle_at (view, cr, event->x, event->y, &handle)) ) + { + view->resize_object = view_object; + view->resize_handle = handle; + view->resize_honor_aspect = event->state & GDK_CONTROL_MASK; + + view->state = GL_VIEW_ARROW_RESIZE; + } + else if ((view_object = view_view_object_at (view, cr, event->x, event->y))) + { + if (event->state & GDK_CONTROL_MASK) + { + if (gl_view_is_object_selected (view, view_object)) + { + /* Un-selecting a selected item */ + gl_view_unselect_object (view, view_object); + } else { + /* Add to current selection */ + gl_view_select_object (view, view_object); + } + } + else + { + if (!gl_view_is_object_selected (view, view_object)) + { + /* remove any selections before adding */ + gl_view_unselect_all (view); + /* Add to current selection */ + gl_view_select_object (view, view_object); + } + } + view->move_last_x = x; + view->move_last_y = y; + + view->state = GL_VIEW_ARROW_MOVE; + } + else + { + if (!(event->state & GDK_CONTROL_MASK)) + { + gl_view_unselect_all (view); + } + + view->select_region_visible = TRUE; + view->select_region.x1 = x; + view->select_region.y1 = y; + view->select_region.x2 = x; + view->select_region.y2 = y; + + view->state = GL_VIEW_ARROW_SELECT_REGION; + } + + + return_value = TRUE; + break; + + case GL_VIEW_MODE_OBJECT_CREATE: + switch (view->create_type) + { + case GL_LABEL_OBJECT_BOX: + gl_view_box_create_button_press_event (view, x, y); + break; + case GL_LABEL_OBJECT_ELLIPSE: + gl_view_ellipse_create_button_press_event (view, x, y); + break; + case GL_LABEL_OBJECT_LINE: + gl_view_line_create_button_press_event (view, x, y); + break; + case GL_LABEL_OBJECT_IMAGE: + gl_view_image_create_button_press_event (view, x, y); + break; + case GL_LABEL_OBJECT_TEXT: + gl_view_text_create_button_press_event (view, x, y); + break; + case GL_LABEL_OBJECT_BARCODE: + gl_view_barcode_create_button_press_event (view, x, y); + break; + default: + g_message ("Invalid create type."); /*Should not happen!*/ + } + view->state = GL_VIEW_CREATE_DRAG; + return_value = TRUE; + break; + + default: + g_message ("Invalid view mode."); /*Should not happen!*/ + } + + view->grabbed_flag = TRUE; + gdk_pointer_grab (GTK_LAYOUT (view->canvas)->bin_window, + FALSE, + (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK), + NULL, + NULL, + event->time); + break; + + case 3: + g_signal_emit (G_OBJECT (view), + signals[CONTEXT_MENU_ACTIVATE], 0, + event->button, event->time); + return_value = TRUE; + break; + + } + + cairo_destroy (cr); + + return return_value; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Button release event handler. */ +/*---------------------------------------------------------------------------*/ +static gboolean +button_release_event_cb (glView *view, + GdkEventButton *event) +{ + gboolean return_value = FALSE; + cairo_t *cr; + gdouble scale; + gdouble x, y; + GdkCursor *cursor; + + cr = gdk_cairo_create (GTK_LAYOUT (view->canvas)->bin_window); + + /* + * Translate to label coordinates + */ + scale = view->zoom * view->home_scale; + cairo_scale (cr, scale, scale); + cairo_translate (cr, view->x0, view->y0); + + x = event->x; + y = event->y; + cairo_device_to_user (cr, &x, &y); + + switch (event->button) + { + + case 1: + view->grabbed_flag = FALSE; + gdk_pointer_ungrab (event->time); + /* + * Handle event as appropriate for mode + */ + switch (view->mode) + { + case GL_VIEW_MODE_ARROW: + switch (view->state) + { + case GL_VIEW_ARROW_RESIZE: + view->resize_object = NULL; + + view->state = GL_VIEW_IDLE; + break; + + case GL_VIEW_ARROW_SELECT_REGION: +#ifdef CLIP_UPDATES + gl_view_update_region (view, cr, &view->select_region); +#else + gl_view_update (view); +#endif + + view->select_region_visible = FALSE; + view->select_region.x2 = x; + view->select_region.y2 = y; + + gl_view_select_region (view, &view->select_region); + + view->state = GL_VIEW_IDLE; + break; + + default: + view->state = GL_VIEW_IDLE; + break; + + } + + return_value = TRUE; + break; + + + case GL_VIEW_MODE_OBJECT_CREATE: + switch (view->create_type) + { + case GL_LABEL_OBJECT_BOX: + gl_view_box_create_button_release_event (view, x, y); + break; + case GL_LABEL_OBJECT_ELLIPSE: + gl_view_ellipse_create_button_release_event (view, x, y); + break; + case GL_LABEL_OBJECT_LINE: + gl_view_line_create_button_release_event (view, x, y); + break; + case GL_LABEL_OBJECT_IMAGE: + gl_view_image_create_button_release_event (view, x, y); + break; + case GL_LABEL_OBJECT_TEXT: + gl_view_text_create_button_release_event (view, x, y); + break; + case GL_LABEL_OBJECT_BARCODE: + gl_view_barcode_create_button_release_event (view, x, y); + break; + default: + g_message ("Invalid create type."); /*Should not happen!*/ + } + view->mode = GL_VIEW_MODE_ARROW; + view->state = GL_VIEW_IDLE; + cursor = gdk_cursor_new (GDK_LEFT_PTR); + gdk_window_set_cursor (view->canvas->window, cursor); + gdk_cursor_unref (cursor); + break; + + + default: + g_message ("Invalid view mode."); /*Should not happen!*/ + } + + } + + cairo_destroy (cr); + + return return_value; +} + +/*---------------------------------------------------------------------------*/ +/* PRIVATE. Key press event handler. */ +/*---------------------------------------------------------------------------*/ +static gboolean +key_press_event_cb (glView *view, + GdkEventKey *event) +{ + GdkCursor *cursor; + + gl_debug (DEBUG_VIEW, ""); + + if ( (view->mode == GL_VIEW_MODE_ARROW) && + (view->state == GL_VIEW_IDLE) ) + { + switch (event->keyval) { + + case GDK_Left: + case GDK_KP_Left: + gl_view_move_selection (view, -1.0 / (view->zoom), 0.0); + break; + case GDK_Up: + case GDK_KP_Up: + gl_view_move_selection (view, 0.0, -1.0 / (view->zoom)); + break; + case GDK_Right: + case GDK_KP_Right: + gl_view_move_selection (view, 1.0 / (view->zoom), 0.0); + break; + case GDK_Down: + case GDK_KP_Down: + gl_view_move_selection (view, 0.0, 1.0 / (view->zoom)); + break; + case GDK_Delete: + case GDK_KP_Delete: + gl_view_delete_selection (view); + cursor = gdk_cursor_new (GDK_LEFT_PTR); + gdk_window_set_cursor (GTK_WIDGET (view->canvas)->window +, cursor); + gdk_cursor_unref (cursor); + break; + default: + return FALSE; + + } + } + return TRUE; /* We handled this or we were dragging. */ +} + diff --git a/src/view.h b/src/view.h new file mode 100644 index 00000000..38c3ed80 --- /dev/null +++ b/src/view.h @@ -0,0 +1,357 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * view.h: GLabels View module header file + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __VIEW_H__ +#define __VIEW_H__ + +#include + +#include "label-object.h" + +typedef enum { + GL_VIEW_MODE_ARROW, + GL_VIEW_MODE_OBJECT_CREATE +} glViewMode; + +typedef enum { + GL_VIEW_IDLE = 0, + GL_VIEW_ARROW_SELECT_REGION, + GL_VIEW_ARROW_MOVE, + GL_VIEW_ARROW_RESIZE, + GL_VIEW_CREATE_DRAG, +} glViewState; + +#define GL_TYPE_VIEW (gl_view_get_type ()) +#define GL_VIEW(obj) (GTK_CHECK_CAST((obj), GL_TYPE_VIEW, glView )) +#define GL_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW, glViewClass)) +#define GL_IS_VIEW(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_VIEW)) +#define GL_IS_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW)) + +typedef struct _glView glView; +typedef struct _glViewClass glViewClass; + +#include "view-object.h" +#include "color.h" + +struct _glView { + GtkVBox parent_widget; + + glLabel *label; + + GtkWidget *canvas; + gdouble zoom; + gboolean zoom_to_fit_flag; + gdouble home_scale; + gdouble x0, y0; + gdouble w, h; + + gboolean update_scheduled_flag; + gboolean grid_visible; + gdouble grid_spacing; + + gboolean markup_visible; + + glViewMode mode; + glLabelObjectType create_type; + glViewState state; + gboolean grabbed_flag; + + /* GL_VIEW_ARROW_MOVE state */ + gdouble move_last_x; + gdouble move_last_y; + + /* GL_VIEW_ARROW_SELECT_REGION state */ + gboolean select_region_visible; + glLabelRegion select_region; + + /* GL_VIEW_ARROW_RESIZE state */ + glViewObject *resize_object; + glViewObjectHandle resize_handle; + gboolean resize_honor_aspect; + + /* GL_VIEW_CREATE_DRAG state */ + glLabelObject *create_object; + gdouble create_x0; + gdouble create_y0; + + GList *object_list; /* glViewObjects */ + GList *selected_object_list; /* glViewObjects */ + + /* Clipboard selection stuff */ + gint have_selection; + glLabel *selection_data; + GtkWidget *invisible; + + /* Default object text properties */ + gchar *default_font_family; + gdouble default_font_size; + PangoWeight default_font_weight; + gboolean default_font_italic_flag; + guint default_text_color; + PangoAlignment default_text_alignment; + gdouble default_text_line_spacing; + + /* Default object line properties */ + gdouble default_line_width; + guint default_line_color; + + /* Default object fill properties */ + guint default_fill_color; + +}; + +struct _glViewClass { + GtkVBoxClass parent_class; + + /* Selection changed signal */ + void (*selection_changed) (glView *view, + gpointer user_data); + + /* Signal to launch a context menu */ + void (*context_menu_activate) (glView *view, + gint button, + guint32 activate_time, + gpointer user_data); + + /* Signals to support a status bar */ + void (*zoom_changed) (glView *view, + gdouble zoom, + gpointer user_data); + void (*pointer_moved) (glView *view, + gdouble x, + gdouble y, + gpointer user_data); + void (*pointer_exit) (glView *view, + gpointer user_data); + void (*mode_changed) (glView *view, + gpointer user_data); +}; + +G_BEGIN_DECLS + +GType gl_view_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_view_new (glLabel *label); + + +void gl_view_update (glView *view); + +void gl_view_update_region (glView *view, + cairo_t *cr, + glLabelRegion *region); + +void gl_view_show_grid (glView *view); + +void gl_view_hide_grid (glView *view); + +void gl_view_set_grid_spacing (glView *view, + gdouble spacing); + +void gl_view_show_markup (glView *view); + +void gl_view_hide_markup (glView *view); + +void gl_view_arrow_mode (glView *view); + +void gl_view_object_create_mode (glView *view, + glLabelObjectType type); + + +void gl_view_select_object (glView *view, + glViewObject *view_object); + +void gl_view_unselect_object (glView *view, + glViewObject *view_object); + +void gl_view_select_all (glView *view); + +void gl_view_unselect_all (glView *view); + +void gl_view_select_region (glView *view, + glLabelRegion *region); + +gboolean gl_view_is_object_selected (glView *view, + glViewObject *view_object); + +gboolean gl_view_is_selection_empty (glView *view); + +gboolean gl_view_is_selection_atomic (glView *view); + +void gl_view_delete_selection (glView *view); + +GtkWidget *gl_view_get_editor (glView *view); + +void gl_view_raise_selection (glView *view); + +void gl_view_lower_selection (glView *view); + +void gl_view_rotate_selection (glView *view, + gdouble theta_degs); + +void gl_view_rotate_selection_left (glView *view); + +void gl_view_rotate_selection_right (glView *view); + +void gl_view_flip_selection_horiz (glView *view); + +void gl_view_flip_selection_vert (glView *view); + +void gl_view_align_selection_left (glView *view); + +void gl_view_align_selection_right (glView *view); + +void gl_view_align_selection_hcenter (glView *view); + +void gl_view_align_selection_top (glView *view); + +void gl_view_align_selection_bottom (glView *view); + +void gl_view_align_selection_vcenter (glView *view); + +void gl_view_center_selection_horiz (glView *view); + +void gl_view_center_selection_vert (glView *view); + +void gl_view_move_selection (glView *view, + gdouble dx, + gdouble dy); + +gboolean gl_view_can_selection_text (glView *view); + +void gl_view_set_selection_font_family (glView *view, + const gchar *font_family); + +void gl_view_set_selection_font_size (glView *view, + gdouble font_size); + +void gl_view_set_selection_font_weight (glView *view, + PangoWeight font_weight); + +void gl_view_set_selection_text_line_spacing (glView *view, + gdouble text_line_spacing); + +void gl_view_set_selection_font_italic_flag (glView *view, + gboolean font_italic_flag); + +void gl_view_set_selection_text_alignment (glView *view, + PangoAlignment text_alignment); + +void gl_view_set_selection_text_color (glView *view, + glColorNode *text_color_node); + +gboolean gl_view_can_selection_fill (glView *view); + +void gl_view_set_selection_fill_color (glView *view, + glColorNode *fill_color); + +gboolean gl_view_can_selection_line_color (glView *view); + +void gl_view_set_selection_line_color (glView *view, + glColorNode *line_color_node); + +gboolean gl_view_can_selection_line_width (glView *view); + +void gl_view_set_selection_line_width (glView *view, + gdouble line_width); + + +void gl_view_cut (glView *view); + +void gl_view_copy (glView *view); + +void gl_view_paste (glView *view); + + +void gl_view_zoom_in (glView *view); + +void gl_view_zoom_out (glView *view); + +void gl_view_zoom_to_fit (glView *view); + +void gl_view_set_zoom (glView *view, + gdouble zoom); + +gdouble gl_view_get_zoom (glView *view); + +gboolean gl_view_is_zoom_max (glView *view); + +gboolean gl_view_is_zoom_min (glView *view); + + +void gl_view_set_default_font_family (glView *view, + const gchar *font_family); + +void gl_view_set_default_font_size (glView *view, + gdouble font_size); + +void gl_view_set_default_font_weight (glView *view, + PangoWeight font_weight); + +void gl_view_set_default_font_italic_flag (glView *view, + gboolean font_italic_flag); + +void gl_view_set_default_text_color (glView *view, + guint text_color); + +void gl_view_set_default_text_alignment (glView *view, + PangoAlignment text_alignment); + +void gl_view_set_default_line_width (glView *view, + gdouble line_width); + +void gl_view_set_default_line_color (glView *view, + guint line_color); + +void gl_view_set_default_fill_color (glView *view, + guint fill_color); +void gl_view_set_default_text_line_spacing (glView *view, + gdouble text_line_spacing); + + + +gchar *gl_view_get_default_font_family (glView *view); + +gdouble gl_view_get_default_font_size (glView *view); + +PangoWeight gl_view_get_default_font_weight (glView *view); + +gboolean gl_view_get_default_font_italic_flag (glView *view); + +guint gl_view_get_default_text_color (glView *view); + +PangoAlignment gl_view_get_default_text_alignment (glView *view); + +gdouble gl_view_get_default_text_line_spacing (glView *view); + +gdouble gl_view_get_default_line_width (glView *view); + +guint gl_view_get_default_line_color (glView *view); + +guint gl_view_get_default_fill_color (glView *view); + + + +G_END_DECLS + +#endif diff --git a/src/warning-handler.c b/src/warning-handler.c new file mode 100644 index 00000000..84e32441 --- /dev/null +++ b/src/warning-handler.c @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * warning-handler.c: non-critical error handler + * + * Copyright (C) 2005 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include + +#include "warning-handler.h" + +#include +#include +#include +#include +#include + +static void warning_handler (const gchar *log_domain, + GLogLevelFlags log_level, + const gchar *message, + gpointer user_data); + + +/***************************************************************************/ +/* Initialize error handler. */ +/***************************************************************************/ +void +gl_warning_handler_init (void) +{ + g_log_set_handler ("LibGlabels", + G_LOG_LEVEL_WARNING, + warning_handler, + "libglabels"); + + g_log_set_handler (G_LOG_DOMAIN, + G_LOG_LEVEL_WARNING, + warning_handler, + "glabels"); +} + +/*-------------------------------------------------------------------------*/ +/* PRIVATE. Actual error handler. */ +/*-------------------------------------------------------------------------*/ +static void +warning_handler (const gchar *log_domain, + GLogLevelFlags log_level, + const gchar *message, + gpointer user_data) +{ + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_CLOSE, + _("gLabels Error!")); + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + "%s", message); + + gtk_dialog_run (GTK_DIALOG (dialog)); + + gtk_widget_destroy (GTK_WIDGET (dialog)); +} + diff --git a/src/warning-handler.h b/src/warning-handler.h new file mode 100644 index 00000000..911cc16a --- /dev/null +++ b/src/warning-handler.h @@ -0,0 +1,36 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * warning-handler.h: non-critical error handler header file + * + * Copyright (C) 2005 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __WARNING_HANDLER_H__ +#define __WARNING_HANDLER_H__ + +#include + +G_BEGIN_DECLS + +void gl_warning_handler_init (void); + +G_END_DECLS + +#endif diff --git a/src/wdgt-chain-button.c b/src/wdgt-chain-button.c new file mode 100644 index 00000000..7491311f --- /dev/null +++ b/src/wdgt-chain-button.c @@ -0,0 +1,324 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* wdgt-chain-button.c + * Modified version of gimpchainbutton.c for gLabels: + * + * LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * gimpchainbutton.c + * Copyright (C) 1999-2000 Sven Neumann + * + * Modified or gLabels by Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "wdgt-chain-button.h" + +#include +#include +#include + +#include "stock.h" + + +enum +{ + TOGGLED, + LAST_SIGNAL +}; + + +static void gl_wdgt_chain_button_clicked_callback (GtkWidget *widget, + glWdgtChainButton *button); +static gboolean gl_wdgt_chain_button_draw_lines (GtkWidget *widget, + GdkEventExpose *eevent, + glWdgtChainButton *button); + + +static const gchar *gl_wdgt_chain_stock_items[] = +{ + GL_STOCK_HCHAIN, + GL_STOCK_HCHAIN_BROKEN, + GL_STOCK_VCHAIN, + GL_STOCK_VCHAIN_BROKEN +}; + + +static guint gl_wdgt_chain_button_signals[LAST_SIGNAL] = { 0 }; + + + +G_DEFINE_TYPE (glWdgtChainButton, gl_wdgt_chain_button, GTK_TYPE_TABLE); + + +static void +gl_wdgt_chain_button_class_init (glWdgtChainButtonClass *class) +{ + gl_wdgt_chain_button_parent_class = g_type_class_peek_parent (class); + + gl_wdgt_chain_button_signals[TOGGLED] = + g_signal_new ("toggled", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (glWdgtChainButtonClass, toggled), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + class->toggled = NULL; +} + +static void +gl_wdgt_chain_button_init (glWdgtChainButton *button) +{ + button->position = GL_WDGT_CHAIN_TOP; + button->active = FALSE; + + button->line1 = gtk_drawing_area_new (); + button->line2 = gtk_drawing_area_new (); + button->image = gtk_image_new (); + + button->button = gtk_button_new (); + + gtk_button_set_relief (GTK_BUTTON (button->button), GTK_RELIEF_NONE); + gtk_container_add (GTK_CONTAINER (button->button), button->image); + gtk_widget_show (button->image); + + g_signal_connect (button->button, "clicked", + G_CALLBACK (gl_wdgt_chain_button_clicked_callback), + button); + g_signal_connect (button->line1, "expose_event", + G_CALLBACK (gl_wdgt_chain_button_draw_lines), + button); + g_signal_connect (button->line2, "expose_event", + G_CALLBACK (gl_wdgt_chain_button_draw_lines), + button); +} + + +/** + * gl_wdgt_chain_button_new: + * @position: The position you are going to use for the button + * with respect to the widgets you want to chain. + * + * Creates a new #glWdgtChainButton widget. + * + * This returns a button showing either a broken or a linked chain and + * small clamps attached to both sides that visually group the two widgets + * you want to connect. This widget looks best when attached + * to a table taking up two columns (or rows respectively) next + * to the widgets that it is supposed to connect. It may work + * for more than two widgets, but the look is optimized for two. + * + * Returns: Pointer to the new #glWdgtChainButton, which is inactive + * by default. Use gl_wdgt_chain_button_set_active() to + * change its state. + */ +GtkWidget * +gl_wdgt_chain_button_new (glWdgtChainPosition position) +{ + glWdgtChainButton *button; + + button = g_object_new (GL_WDGT_TYPE_CHAIN_BUTTON, NULL); + + button->position = position; + + gtk_image_set_from_stock + (GTK_IMAGE (button->image), + gl_wdgt_chain_stock_items[((position & GL_WDGT_CHAIN_LEFT) << 1) + ! button->active], + GTK_ICON_SIZE_BUTTON); + + if (position & GL_WDGT_CHAIN_LEFT) /* are we a vertical chainbutton? */ + { + gtk_table_resize (GTK_TABLE (button), 3, 1); + gtk_table_attach (GTK_TABLE (button), button->button, 0, 1, 1, 2, + GTK_SHRINK, GTK_SHRINK, 0, 0); + gtk_table_attach_defaults (GTK_TABLE (button), + button->line1, 0, 1, 0, 1); + gtk_table_attach_defaults (GTK_TABLE (button), + button->line2, 0, 1, 2, 3); + } + else + { + gtk_table_resize (GTK_TABLE (button), 1, 3); + gtk_table_attach (GTK_TABLE (button), button->button, 1, 2, 0, 1, + GTK_SHRINK, GTK_SHRINK, 0, 0); + gtk_table_attach_defaults (GTK_TABLE (button), + button->line1, 0, 1, 0, 1); + gtk_table_attach_defaults (GTK_TABLE (button), + button->line2, 2, 3, 0, 1); + } + + gtk_widget_show (button->button); + gtk_widget_show (button->line1); + gtk_widget_show (button->line2); + + return GTK_WIDGET (button); +} + +/** + * gl_wdgt_chain_button_set_active: + * @button: Pointer to a #glWdgtChainButton. + * @active: The new state. + * + * Sets the state of the #glWdgtChainButton to be either locked (%TRUE) or + * unlocked (%FALSE) and changes the showed pixmap to reflect the new state. + */ +void +gl_wdgt_chain_button_set_active (glWdgtChainButton *button, + gboolean active) +{ + g_return_if_fail (GL_WDGT_IS_CHAIN_BUTTON (button)); + + if (button->active != active) + { + guint num; + + button->active = active ? TRUE : FALSE; + + num = ((button->position & GL_WDGT_CHAIN_LEFT) << 1) + (active ? 0 : 1); + + gtk_image_set_from_stock (GTK_IMAGE (button->image), + gl_wdgt_chain_stock_items[num], + GTK_ICON_SIZE_BUTTON); + } +} + +/** + * gl_wdgt_chain_button_get_active + * @button: Pointer to a #glWdgtChainButton. + * + * Checks the state of the #glWdgtChainButton. + * + * Returns: %TRUE if the #glWdgtChainButton is active (locked). + */ +gboolean +gl_wdgt_chain_button_get_active (glWdgtChainButton *button) +{ + g_return_val_if_fail (GL_WDGT_IS_CHAIN_BUTTON (button), FALSE); + + return button->active; +} + +static void +gl_wdgt_chain_button_clicked_callback (GtkWidget *widget, + glWdgtChainButton *button) +{ + g_return_if_fail (GL_WDGT_IS_CHAIN_BUTTON (button)); + + gl_wdgt_chain_button_set_active (button, ! button->active); + + g_signal_emit (button, gl_wdgt_chain_button_signals[TOGGLED], 0); +} + +static gboolean +gl_wdgt_chain_button_draw_lines (GtkWidget *widget, + GdkEventExpose *eevent, + glWdgtChainButton *button) +{ + GdkPoint points[3]; + GdkPoint buf; + GtkShadowType shadow; + glWdgtChainPosition position; + gint which_line; + +#define SHORT_LINE 4 + /* don't set this too high, there's no check against drawing outside + the widgets bounds yet (and probably never will be) */ + + g_return_val_if_fail (GL_WDGT_IS_CHAIN_BUTTON (button), FALSE); + + points[0].x = widget->allocation.width / 2; + points[0].y = widget->allocation.height / 2; + + which_line = (widget == button->line1) ? 1 : -1; + + position = button->position; + + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) + switch (position) + { + case GL_WDGT_CHAIN_LEFT: + position = GL_WDGT_CHAIN_RIGHT; + break; + case GL_WDGT_CHAIN_RIGHT: + position = GL_WDGT_CHAIN_LEFT; + break; + default: + break; + } + + switch (position) + { + case GL_WDGT_CHAIN_LEFT: + points[0].x += SHORT_LINE; + points[1].x = points[0].x - SHORT_LINE; + points[1].y = points[0].y; + points[2].x = points[1].x; + points[2].y = (which_line == 1) ? widget->allocation.height - 1 : 0; + shadow = GTK_SHADOW_ETCHED_IN; + break; + case GL_WDGT_CHAIN_RIGHT: + points[0].x -= SHORT_LINE; + points[1].x = points[0].x + SHORT_LINE; + points[1].y = points[0].y; + points[2].x = points[1].x; + points[2].y = (which_line == 1) ? widget->allocation.height - 1 : 0; + shadow = GTK_SHADOW_ETCHED_OUT; + break; + case GL_WDGT_CHAIN_TOP: + points[0].y += SHORT_LINE; + points[1].x = points[0].x; + points[1].y = points[0].y - SHORT_LINE; + points[2].x = (which_line == 1) ? widget->allocation.width - 1 : 0; + points[2].y = points[1].y; + shadow = GTK_SHADOW_ETCHED_OUT; + break; + case GL_WDGT_CHAIN_BOTTOM: + points[0].y -= SHORT_LINE; + points[1].x = points[0].x; + points[1].y = points[0].y + SHORT_LINE; + points[2].x = (which_line == 1) ? widget->allocation.width - 1 : 0; + points[2].y = points[1].y; + shadow = GTK_SHADOW_ETCHED_IN; + break; + default: + return FALSE; + } + + if ( ((shadow == GTK_SHADOW_ETCHED_OUT) && (which_line == -1)) || + ((shadow == GTK_SHADOW_ETCHED_IN) && (which_line == 1)) ) + { + buf = points[0]; + points[0] = points[2]; + points[2] = buf; + } + + gtk_paint_polygon (widget->style, + widget->window, + GTK_STATE_NORMAL, + shadow, + &eevent->area, + widget, + "chainbutton", + points, + 3, + FALSE); + + return TRUE; +} diff --git a/src/wdgt-chain-button.h b/src/wdgt-chain-button.h new file mode 100644 index 00000000..382af2a4 --- /dev/null +++ b/src/wdgt-chain-button.h @@ -0,0 +1,98 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* wdgt-chain-button.h + * Modified version of gimpchainbutton.h for gLabels: + * + * LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * gimpchainbutton.h + * Copyright (C) 1999-2000 Sven Neumann + * + * Modified or gLabels by Jim Evins + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * This implements a widget derived from GtkTable that visualizes + * it's state with two different pixmaps showing a closed and a + * broken chain. It's intented to be used with the GimpSizeEntry + * widget. The usage is quite similar to the one the GtkToggleButton + * provides. + */ + +#ifndef __WDGT_CHAIN_BUTTON_H__ +#define __WDGT_CHAIN_BUTTON_H__ + +#include + +G_BEGIN_DECLS + + +typedef enum +{ + GL_WDGT_CHAIN_TOP, + GL_WDGT_CHAIN_LEFT, + GL_WDGT_CHAIN_BOTTOM, + GL_WDGT_CHAIN_RIGHT +} glWdgtChainPosition; + + +#define GL_WDGT_TYPE_CHAIN_BUTTON (gl_wdgt_chain_button_get_type ()) +#define GL_WDGT_CHAIN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_WDGT_TYPE_CHAIN_BUTTON, glWdgtChainButton)) +#define GL_WDGT_CHAIN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_WDGT_TYPE_CHAIN_BUTTON, glWdgtChainButtonClass)) +#define GL_WDGT_IS_CHAIN_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_WDGT_TYPE_CHAIN_BUTTON)) +#define GL_WDGT_IS_CHAIN_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_WDGT_TYPE_CHAIN_BUTTON)) +#define GL_WDGT_CHAIN_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GL_WDGT_TYPE_CHAIN_BUTTON, glWdgtChainButtonClass)) + + +typedef struct _glWdgtChainButton glWdgtChainButton; +typedef struct _glWdgtChainButtonClass glWdgtChainButtonClass; + +struct _glWdgtChainButton +{ + GtkTable parent_instance; + + glWdgtChainPosition position; + gboolean active; + + GtkWidget *button; + GtkWidget *line1; + GtkWidget *line2; + GtkWidget *image; +}; + +struct _glWdgtChainButtonClass +{ + GtkTableClass parent_class; + + void (* toggled) (glWdgtChainButton *button); +}; + + +GType gl_wdgt_chain_button_get_type (void) G_GNUC_CONST; + +GtkWidget * gl_wdgt_chain_button_new (glWdgtChainPosition position); + +void gl_wdgt_chain_button_set_active (glWdgtChainButton *button, + gboolean active); +gboolean gl_wdgt_chain_button_get_active (glWdgtChainButton *button); + + +G_END_DECLS + +#endif /* __WDGT_CHAIN_BUTTON_H__ */ diff --git a/src/wdgt-media-select.c b/src/wdgt-media-select.c new file mode 100644 index 00000000..edb469aa --- /dev/null +++ b/src/wdgt-media-select.c @@ -0,0 +1,878 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * wdgt_media_select.c: media selection widget module + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "wdgt-media-select.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mini-preview-pixbuf-cache.h" +#include "prefs.h" +#include "util.h" +#include "color.h" +#include "marshal.h" +#include + +#include "debug.h" + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +enum { + NAME_COLUMN, + PREVIEW_COLUMN, + PREVIEW_COLUMN_STOCK, + PREVIEW_COLUMN_STOCK_SIZE, + DESCRIPTION_COLUMN, + N_COLUMNS +}; + +struct _glWdgtMediaSelectPrivate { + + GtkWidget *notebook; + guint current_page_num; + + gint recent_page_num; + GtkWidget *recent_tab_vbox; + GtkWidget *recent_treeview; + GtkListStore *recent_store; + + gint search_all_page_num; + GtkWidget *search_all_tab_vbox; + GtkWidget *brand_combo; + GtkWidget *page_size_combo; + GtkWidget *category_combo; + GtkWidget *search_all_treeview; + GtkListStore *search_all_store; + + /* Prevent recursion */ + gboolean stop_signals; +}; + +enum { + CHANGED, + LAST_SIGNAL +}; + +typedef void (*glWdgtMediaSelectSignal) (GObject * object, gpointer data); + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +static gint wdgt_media_select_signals[LAST_SIGNAL] = { 0 }; + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_wdgt_media_select_finalize (GObject *object); + +static void gl_wdgt_media_select_construct (glWdgtMediaSelect *media_select); + +static void filter_changed_cb (GtkComboBox *combo, + gpointer user_data); +static void selection_changed_cb (GtkTreeSelection *selection, + gpointer user_data); +static void page_changed_cb (GtkNotebook *notebook, + GtkNotebookPage *page, + guint page_num, + gpointer user_data); + +static gchar *get_layout_desc (const lglTemplate *template); +static gchar *get_label_size_desc (const lglTemplate *template); +static void load_recent_list (GtkListStore *store, + GtkTreeSelection *selection, + GSList *list); +static void load_search_all_list (GtkListStore *store, + GtkTreeSelection *selection, + GList *list); + +/****************************************************************************/ +/* Boilerplate Object stuff. */ +/****************************************************************************/ +G_DEFINE_TYPE (glWdgtMediaSelect, gl_wdgt_media_select, GTK_TYPE_VBOX); + + +static void +gl_wdgt_media_select_class_init (glWdgtMediaSelectClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + gl_wdgt_media_select_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_wdgt_media_select_finalize; + + wdgt_media_select_signals[CHANGED] = + g_signal_new ("changed", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glWdgtMediaSelectClass, changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + gl_debug (DEBUG_MEDIA_SELECT, "END"); +} + +static void +gl_wdgt_media_select_init (glWdgtMediaSelect *media_select) +{ + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + media_select->priv = g_new0 (glWdgtMediaSelectPrivate, 1); + + gl_debug (DEBUG_MEDIA_SELECT, "END"); +} + +static void +gl_wdgt_media_select_finalize (GObject *object) +{ + glWdgtMediaSelect *media_select = GL_WDGT_MEDIA_SELECT (object); + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_WDGT_MEDIA_SELECT (object)); + + g_object_unref (media_select->priv->recent_store); + g_object_unref (media_select->priv->search_all_store); + g_free (media_select->priv); + + G_OBJECT_CLASS (gl_wdgt_media_select_parent_class)->finalize (object); + + gl_debug (DEBUG_MEDIA_SELECT, "END"); +} + +GtkWidget * +gl_wdgt_media_select_new (void) +{ + glWdgtMediaSelect *media_select; + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + media_select = g_object_new (gl_wdgt_media_select_get_type (), NULL); + + gl_wdgt_media_select_construct (media_select); + + gl_debug (DEBUG_MEDIA_SELECT, "END"); + + return GTK_WIDGET (media_select); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct composite widget. */ +/*--------------------------------------------------------------------------*/ +static void +gl_wdgt_media_select_construct (glWdgtMediaSelect *media_select) +{ + GladeXML *gui; + GtkWidget *hbox; + GList *brands = NULL; + GList *page_sizes = NULL; + GList *categories = NULL; + GList *search_all_names = NULL; + const gchar *page_size_id; + gchar *page_size_name; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + GtkTreeSelection *recent_selection; + GtkTreeSelection *search_all_selection; + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + g_return_if_fail (GL_IS_WDGT_MEDIA_SELECT (media_select)); + g_return_if_fail (media_select->priv != NULL); + + gui = glade_xml_new (GLABELS_GLADE_DIR "wdgt-media-select.glade", + "wdgt_media_select_hbox", NULL); + + if (!gui) { + g_critical ("Could not open wdgt-media-select.glade. gLabels may not be installed correctly!"); + return; + } + + hbox = glade_xml_get_widget (gui, "wdgt_media_select_hbox"); + gtk_container_add (GTK_CONTAINER (media_select), hbox); + + media_select->priv->notebook = + glade_xml_get_widget (gui, "notebook"); + + media_select->priv->recent_tab_vbox = + glade_xml_get_widget (gui, "recent_tab_vbox"); + media_select->priv->recent_treeview = + glade_xml_get_widget (gui, "recent_treeview"); + + media_select->priv->search_all_tab_vbox = + glade_xml_get_widget (gui, "search_all_tab_vbox"); + media_select->priv->brand_combo = + glade_xml_get_widget (gui, "brand_combo"); + media_select->priv->page_size_combo = + glade_xml_get_widget (gui, "page_size_combo"); + media_select->priv->category_combo = + glade_xml_get_widget (gui, "category_combo"); + media_select->priv->search_all_treeview = + glade_xml_get_widget (gui, "search_all_treeview"); + + g_object_unref (gui); + + media_select->priv->recent_page_num = + gtk_notebook_page_num (GTK_NOTEBOOK (media_select->priv->notebook), + media_select->priv->recent_tab_vbox); + media_select->priv->search_all_page_num = + gtk_notebook_page_num (GTK_NOTEBOOK (media_select->priv->notebook), + media_select->priv->search_all_tab_vbox); + + /* Recent templates treeview */ + media_select->priv->recent_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING); + gtk_tree_view_set_model (GTK_TREE_VIEW (media_select->priv->recent_treeview), + GTK_TREE_MODEL (media_select->priv->recent_store)); + renderer = gtk_cell_renderer_pixbuf_new (); + column = gtk_tree_view_column_new_with_attributes ("", renderer, + "pixbuf", PREVIEW_COLUMN, + "stock-id", PREVIEW_COLUMN_STOCK, + "stock-size", PREVIEW_COLUMN_STOCK_SIZE, + NULL); + gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_append_column (GTK_TREE_VIEW (media_select->priv->recent_treeview), column); + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("", renderer, + "markup", DESCRIPTION_COLUMN, + NULL); + gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_append_column (GTK_TREE_VIEW (media_select->priv->recent_treeview), column); + recent_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->recent_treeview)); + load_recent_list (media_select->priv->recent_store, recent_selection, gl_prefs->recent_templates); + + page_size_id = gl_prefs_get_page_size (); + page_size_name = lgl_db_lookup_paper_name_from_id (page_size_id); + + /* Brand selection control */ + gl_util_combo_box_add_text_model (GTK_COMBO_BOX (media_select->priv->brand_combo)); + brands = lgl_db_get_brand_list (NULL, NULL); + brands = g_list_prepend (brands, g_strdup (_("Any"))); + gl_util_combo_box_set_strings (GTK_COMBO_BOX (media_select->priv->brand_combo), brands); + lgl_db_free_brand_list (brands); + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->brand_combo), + _("Any")); + + /* Page size selection control */ + gl_util_combo_box_add_text_model (GTK_COMBO_BOX (media_select->priv->page_size_combo)); + page_sizes = lgl_db_get_paper_name_list (); + page_sizes = g_list_prepend (page_sizes, g_strdup (_("Any"))); + gl_util_combo_box_set_strings (GTK_COMBO_BOX (media_select->priv->page_size_combo), page_sizes); + lgl_db_free_paper_name_list (page_sizes); + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->page_size_combo), + page_size_name); + + /* Category selection control */ + gl_util_combo_box_add_text_model (GTK_COMBO_BOX (media_select->priv->category_combo)); + categories = lgl_db_get_category_name_list (); + categories = g_list_prepend (categories, g_strdup (_("Any"))); + gl_util_combo_box_set_strings (GTK_COMBO_BOX (media_select->priv->category_combo), categories); + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->category_combo), + _("Any")); + lgl_db_free_category_name_list (categories); + + /* Search all treeview */ + media_select->priv->search_all_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING); + gtk_tree_view_set_model (GTK_TREE_VIEW (media_select->priv->search_all_treeview), + GTK_TREE_MODEL (media_select->priv->search_all_store)); + renderer = gtk_cell_renderer_pixbuf_new (); + column = gtk_tree_view_column_new_with_attributes ("", renderer, + "pixbuf", PREVIEW_COLUMN, + "stock-id", PREVIEW_COLUMN_STOCK, + "stock-size", PREVIEW_COLUMN_STOCK_SIZE, + NULL); + gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_append_column (GTK_TREE_VIEW (media_select->priv->search_all_treeview), column); + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("", renderer, + "markup", DESCRIPTION_COLUMN, + NULL); + gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_append_column (GTK_TREE_VIEW (media_select->priv->search_all_treeview), column); + search_all_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->search_all_treeview)); + search_all_names = lgl_db_get_template_name_list_all (NULL, page_size_id, NULL); + load_search_all_list (media_select->priv->search_all_store, search_all_selection, search_all_names); + lgl_db_free_template_name_list (search_all_names); + + /* Connect signals to controls */ + g_signal_connect (G_OBJECT (media_select->priv->brand_combo), "changed", + G_CALLBACK (filter_changed_cb), + media_select); + g_signal_connect (G_OBJECT (media_select->priv->page_size_combo), "changed", + G_CALLBACK (filter_changed_cb), + media_select); + g_signal_connect (G_OBJECT (media_select->priv->category_combo), "changed", + G_CALLBACK (filter_changed_cb), + media_select); + g_signal_connect (G_OBJECT (recent_selection), "changed", + G_CALLBACK (selection_changed_cb), + media_select); + g_signal_connect (G_OBJECT (search_all_selection), "changed", + G_CALLBACK (selection_changed_cb), + media_select); + g_signal_connect (G_OBJECT (media_select->priv->notebook), "switch-page", + G_CALLBACK (page_changed_cb), + media_select); + + g_free (page_size_name); + + gtk_widget_show_all (GTK_WIDGET (media_select)); + if ( gl_prefs->recent_templates ) + { + gtk_notebook_set_current_page (GTK_NOTEBOOK (media_select->priv->notebook), + media_select->priv->recent_page_num); + } + else + { + gtk_notebook_set_current_page (GTK_NOTEBOOK (media_select->priv->notebook), + media_select->priv->search_all_page_num); + } + + gl_debug (DEBUG_MEDIA_SELECT, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. modify widget due to change in selection */ +/*--------------------------------------------------------------------------*/ +static void +filter_changed_cb (GtkComboBox *combo, + gpointer user_data) +{ + glWdgtMediaSelect *media_select = GL_WDGT_MEDIA_SELECT (user_data); + gchar *brand; + gchar *page_size_name, *page_size_id; + gchar *category_name, *category_id; + GList *search_all_names; + GtkTreeSelection *selection; + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + + media_select->priv->stop_signals = TRUE; + + /* Update template selections for new filter settings */ + brand = gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->brand_combo)); + page_size_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->page_size_combo)); + category_name = gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->category_combo)); + if ( brand && strlen(brand) && + page_size_name && strlen(page_size_name) && + category_name && strlen(category_name) ) + { + gl_debug (DEBUG_MEDIA_SELECT, "brand = \"%s\"", brand); + gl_debug (DEBUG_MEDIA_SELECT, "page_size_name = \"%s\"", page_size_name); + gl_debug (DEBUG_MEDIA_SELECT, "category_name = \"%s\"", category_name); + if (!g_utf8_collate (brand, _("Any"))) + { + g_free (brand); + brand = NULL; + } + page_size_id = lgl_db_lookup_paper_id_from_name (page_size_name); + category_id = lgl_db_lookup_category_id_from_name (category_name); + gl_debug (DEBUG_MEDIA_SELECT, "page_size_id = \"%s\"", page_size_id); + gl_debug (DEBUG_MEDIA_SELECT, "category_id = \"%s\"", category_id); + search_all_names = lgl_db_get_template_name_list_all (brand, page_size_id, category_id); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->search_all_treeview)); + load_search_all_list (media_select->priv->search_all_store, selection, search_all_names); + lgl_db_free_template_name_list (search_all_names); + g_free (page_size_id); + g_free (category_id); + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (user_data), + wdgt_media_select_signals[CHANGED], 0); + } + g_free (brand); + g_free (page_size_name); + g_free (category_name); + + + media_select->priv->stop_signals = FALSE; + + gl_debug (DEBUG_MEDIA_SELECT, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. modify widget due to change in selection */ +/*--------------------------------------------------------------------------*/ +static void +selection_changed_cb (GtkTreeSelection *selection, + gpointer user_data) +{ + glWdgtMediaSelect *media_select = GL_WDGT_MEDIA_SELECT (user_data); + + if (media_select->priv->stop_signals) return; + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (user_data), + wdgt_media_select_signals[CHANGED], 0); + + gl_debug (DEBUG_MEDIA_SELECT, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. modify widget due to change in selection */ +/*--------------------------------------------------------------------------*/ +static void +page_changed_cb (GtkNotebook *notebook, + GtkNotebookPage *page, + guint page_num, + gpointer user_data) +{ + glWdgtMediaSelect *media_select = GL_WDGT_MEDIA_SELECT (user_data); + + if (media_select->priv->stop_signals) return; + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + /* + * Store new current page, because this signal is emitted before the actual page change. + */ + media_select->priv->current_page_num = page_num; + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (user_data), + wdgt_media_select_signals[CHANGED], 0); + + gl_debug (DEBUG_MEDIA_SELECT, "END"); +} + +/****************************************************************************/ +/* query selected label template name. */ +/****************************************************************************/ +gchar * +gl_wdgt_media_select_get_name (glWdgtMediaSelect *media_select) +{ + gint page_num; + GtkTreeSelection *selection; + GtkTreeIter iter; + GtkTreeModel *model; + gchar *name; + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + page_num = media_select->priv->current_page_num; + if (page_num == media_select->priv->recent_page_num) + { + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->recent_treeview)); + } + else if (page_num == media_select->priv->search_all_page_num) + { + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->search_all_treeview)); + } + else + { + g_print ("notebook page = %d\n", page_num); + g_assert_not_reached (); + } + + if (gtk_tree_selection_get_mode (selection) == GTK_SELECTION_NONE) + { + name = NULL; + } + else + { + gtk_tree_selection_get_selected (selection, &model, &iter); + gtk_tree_model_get (model, &iter, NAME_COLUMN, &name, -1); + } + + gl_debug (DEBUG_MEDIA_SELECT, "END"); + return name; +} + +/****************************************************************************/ +/* set selected label template name. */ +/****************************************************************************/ +void +gl_wdgt_media_select_set_name (glWdgtMediaSelect *media_select, + gchar *name) +{ + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + GtkTreePath *path; + gchar *name_i; + gboolean flag; + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (media_select->priv->search_all_treeview)); + g_return_if_fail (GTK_IS_TREE_SELECTION (selection)); + + model = GTK_TREE_MODEL (media_select->priv->search_all_store); + + for ( flag = gtk_tree_model_get_iter_first (model, &iter); + flag; + flag = gtk_tree_model_iter_next(model, &iter) ) + { + gtk_tree_model_get (model, &iter, NAME_COLUMN, &name_i, -1); + if (strcasecmp(name, name_i) == 0) + { + gtk_tree_selection_select_iter (selection, &iter); + path = gtk_tree_model_get_path (model, &iter); + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (media_select->priv->search_all_treeview), + path, + NULL, + TRUE, 0.5, 0.0); + gtk_tree_path_free (path); + break; + } + } + + gl_debug (DEBUG_MEDIA_SELECT, "END"); +} + +/****************************************************************************/ +/* query current filter parameters. */ +/****************************************************************************/ +void +gl_wdgt_media_select_get_filter_parameters (glWdgtMediaSelect *media_select, + gchar **page_size_id, + gchar **category_id) +{ + gchar *page_size_name, *category_name; + + gl_debug (DEBUG_MEDIA_SELECT, ""); + + g_free (*page_size_id); + g_free (*category_id); + + page_size_name = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->page_size_combo)); + + *page_size_id = lgl_db_lookup_paper_id_from_name (page_size_name); + + category_name = + gtk_combo_box_get_active_text (GTK_COMBO_BOX (media_select->priv->category_combo)); + + *category_id = lgl_db_lookup_category_id_from_name (category_name); + + g_free (page_size_name); + g_free (category_name); +} + +/****************************************************************************/ +/* set filter parameters. */ +/****************************************************************************/ +void +gl_wdgt_media_select_set_filter_parameters (glWdgtMediaSelect *media_select, + const gchar *page_size_id, + const gchar *category_id) +{ + gchar *page_size_name; + gchar *category_name; + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + page_size_name = lgl_db_lookup_paper_name_from_id (page_size_id); + if (page_size_name == NULL) + { + page_size_name = g_strdup (_("Any")); + } + + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->page_size_combo), + page_size_name); + + category_name = lgl_db_lookup_category_name_from_id (category_id); + if (category_name == NULL) + { + category_name = g_strdup (_("Any")); + } + + gl_util_combo_box_set_active_text (GTK_COMBO_BOX (media_select->priv->category_combo), + category_name); + g_free (page_size_name); + g_free (category_name); + + gl_debug (DEBUG_MEDIA_SELECT, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Get a description of the layout and number of labels. */ +/*--------------------------------------------------------------------------*/ +static gchar * +get_layout_desc (const lglTemplate *template) +{ + const lglTemplateFrame *frame; + gint n_labels; + gchar *string; + + frame = (lglTemplateFrame *)template->frames->data; + + n_labels = lgl_template_frame_get_n_labels (frame); + + string = g_strdup_printf (_("%d per sheet"), n_labels); + + return string; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Get label size description. */ +/*--------------------------------------------------------------------------*/ +static gchar * +get_label_size_desc (const lglTemplate *template) +{ + lglUnitsType units; + const gchar *units_string; + gdouble units_per_point; + const lglTemplateFrame *frame; + gchar *string = NULL; + + units = gl_prefs_get_units (); + units_string = gl_prefs_get_units_string (); + units_per_point = gl_prefs_get_units_per_point (); + + frame = (lglTemplateFrame *)template->frames->data; + + switch (frame->shape) { + case LGL_TEMPLATE_FRAME_SHAPE_RECT: + if ( units == LGL_UNITS_INCH ) { + gchar *xstr, *ystr; + + xstr = gl_util_fraction (frame->rect.w*units_per_point); + ystr = gl_util_fraction (frame->rect.h*units_per_point); + string = g_strdup_printf (_("%s x %s %s"), + xstr, ystr, units_string); + g_free (xstr); + g_free (ystr); + } else { + string = g_strdup_printf (_("%.5g x %.5g %s"), + frame->rect.w*units_per_point, + frame->rect.h*units_per_point, + units_string); + } + break; + case LGL_TEMPLATE_FRAME_SHAPE_ROUND: + if ( units == LGL_UNITS_INCH ) { + gchar *dstr; + + dstr = gl_util_fraction (2.0*frame->round.r*units_per_point); + string = g_strdup_printf (_("%s %s diameter"), + dstr, units_string); + g_free (dstr); + } else { + string = g_strdup_printf (_("%.5g %s diameter"), + 2.0*frame->round.r*units_per_point, + units_string); + } + break; + case LGL_TEMPLATE_FRAME_SHAPE_CD: + if ( units == LGL_UNITS_INCH ) { + gchar *dstr; + + dstr = gl_util_fraction (2.0*frame->cd.r1*units_per_point); + string = g_strdup_printf (_("%s %s diameter"), + dstr, units_string); + g_free (dstr); + } else { + string = g_strdup_printf (_("%.5g %s diameter"), + 2.0*frame->cd.r1*units_per_point, + units_string); + } + break; + default: + break; + } + + return string; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Load list store from template name list. */ +/*--------------------------------------------------------------------------*/ +static void +load_recent_list (GtkListStore *store, + GtkTreeSelection *selection, + GSList *list) +{ + GSList *p; + GtkTreeIter iter; + lglTemplate *template; + GdkPixbuf *pixbuf; + gchar *size; + gchar *layout; + gchar *description; + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + gtk_list_store_clear (store); + + if (list) + { + + for ( p=list; p!=NULL; p=p->next ) + { + + gl_debug (DEBUG_MEDIA_SELECT, "p->data = \"%s\"", p->data); + + template = lgl_db_lookup_template_from_name (p->data); + pixbuf = gl_mini_preview_pixbuf_cache_get_pixbuf (p->data); + + size = get_label_size_desc (template); + layout = get_layout_desc (template); + description = g_strdup_printf ("%s: %s\n%s\n%s", + (gchar *)p->data, + template->description, + size, + layout); + g_free (size); + g_free (layout); + + lgl_template_free (template); + + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + NAME_COLUMN, p->data, + PREVIEW_COLUMN, pixbuf, + DESCRIPTION_COLUMN, description, + -1); + + g_object_unref (G_OBJECT (pixbuf)); + g_free (description); + } + + gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); + gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter); + gtk_tree_selection_select_iter (selection, &iter); + + } + else + { + gchar *text = g_strdup_printf ("%s\n%s", + _("No recent templates found."), + _("Try selecting a template from the \"Search all templates\" page.")); + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + NAME_COLUMN, "empty", + PREVIEW_COLUMN_STOCK, GTK_STOCK_DIALOG_WARNING, + PREVIEW_COLUMN_STOCK_SIZE, GTK_ICON_SIZE_DIALOG, + DESCRIPTION_COLUMN, text, + -1); + g_free (text); + + gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE); + + } + + gl_debug (DEBUG_MEDIA_SELECT, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Load list store from template name list. */ +/*--------------------------------------------------------------------------*/ +static void +load_search_all_list (GtkListStore *store, + GtkTreeSelection *selection, + GList *list) +{ + GList *p; + GtkTreeIter iter; + lglTemplate *template; + GdkPixbuf *pixbuf; + gchar *size; + gchar *layout; + gchar *description; + + gl_debug (DEBUG_MEDIA_SELECT, "START"); + + gtk_list_store_clear (store); + + if (list) + { + + for ( p=list; p!=NULL; p=p->next ) + { + + gl_debug (DEBUG_MEDIA_SELECT, "p->data = \"%s\"", p->data); + + template = lgl_db_lookup_template_from_name (p->data); + pixbuf = gl_mini_preview_pixbuf_cache_get_pixbuf (p->data); + + size = get_label_size_desc (template); + layout = get_layout_desc (template); + description = g_strdup_printf ("%s: %s\n%s\n%s", + (gchar *)p->data, + template->description, + size, + layout); + g_free (size); + g_free (layout); + + lgl_template_free (template); + + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + NAME_COLUMN, p->data, + PREVIEW_COLUMN, pixbuf, + DESCRIPTION_COLUMN, description, + -1); + + g_object_unref (G_OBJECT (pixbuf)); + g_free (description); + } + + gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); + gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter); + gtk_tree_selection_select_iter (selection, &iter); + + } + else + { + gchar *text = g_strdup_printf ("%s\n%s", + _("No match."), + _("Try selecting a different brand, page size or category.")); + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, + NAME_COLUMN, "empty", + PREVIEW_COLUMN_STOCK, GTK_STOCK_DIALOG_WARNING, + PREVIEW_COLUMN_STOCK_SIZE, GTK_ICON_SIZE_DIALOG, + DESCRIPTION_COLUMN, text, + -1); + g_free (text); + + gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE); + + } + + gl_debug (DEBUG_MEDIA_SELECT, "END"); +} + diff --git a/src/wdgt-media-select.h b/src/wdgt-media-select.h new file mode 100644 index 00000000..c8e95fce --- /dev/null +++ b/src/wdgt-media-select.h @@ -0,0 +1,78 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * wdgt_media_select.h: media selection widget module header file + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __WDGT_MEDIA_SELECT_H__ +#define __WDGT_MEDIA_SELECT_H__ + +#include + +G_BEGIN_DECLS + +#define GL_TYPE_WDGT_MEDIA_SELECT (gl_wdgt_media_select_get_type ()) +#define GL_WDGT_MEDIA_SELECT(obj) \ + (GTK_CHECK_CAST((obj), GL_TYPE_WDGT_MEDIA_SELECT, glWdgtMediaSelect )) +#define GL_WDGT_MEDIA_SELECT_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WDGT_MEDIA_SELECT, glWdgtMediaSelectClass)) +#define GL_IS_WDGT_MEDIA_SELECT(obj) \ + (GTK_CHECK_TYPE ((obj), GL_TYPE_WDGT_MEDIA_SELECT)) +#define GL_IS_WDGT_MEDIA_SELECT_CLASS(klass) \ + (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WDGT_MEDIA_SELECT)) + +typedef struct _glWdgtMediaSelect glWdgtMediaSelect; +typedef struct _glWdgtMediaSelectClass glWdgtMediaSelectClass; + +typedef struct _glWdgtMediaSelectPrivate glWdgtMediaSelectPrivate; + +struct _glWdgtMediaSelect { + GtkVBox parent_widget; + + glWdgtMediaSelectPrivate *priv; +}; + +struct _glWdgtMediaSelectClass { + GtkVBoxClass parent_class; + + void (*changed) (glWdgtMediaSelect * media_select, gpointer user_data); +}; + +GType gl_wdgt_media_select_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_wdgt_media_select_new (void); + +gchar *gl_wdgt_media_select_get_name (glWdgtMediaSelect *media_select); + +void gl_wdgt_media_select_set_name (glWdgtMediaSelect *media_select, + gchar *name); + +void gl_wdgt_media_select_get_filter_parameters (glWdgtMediaSelect *media_select, + gchar **page_size_id, + gchar **category_id); + +void gl_wdgt_media_select_set_filter_parameters (glWdgtMediaSelect *media_select, + const gchar *page_size_id, + const gchar *category_id); + +G_END_DECLS + +#endif diff --git a/src/wdgt-mini-preview.c b/src/wdgt-mini-preview.c new file mode 100644 index 00000000..c539e6bf --- /dev/null +++ b/src/wdgt-mini-preview.c @@ -0,0 +1,724 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * wdgt_mini_preview.c: mini preview widget module + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "wdgt-mini-preview.h" + +#include + +#include "libglabels/db.h" +#include "cairo-label-path.h" +#include "marshal.h" +#include "color.h" + +#include "debug.h" + +/*===========================================*/ +/* Private macros and constants. */ +/*===========================================*/ + +#define PAPER_RGB_ARGS 1.0, 1.0, 1.0 +#define PAPER_OUTLINE_RGB_ARGS 0.0, 0.0, 0.0 +#define LABEL_OUTLINE_RGB_ARGS 0.5, 0.5, 0.5 + +#define SHADOW_X_OFFSET 5 +#define SHADOW_Y_OFFSET 5 + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +enum { + CLICKED, + PRESSED, + LAST_SIGNAL +}; + +typedef struct { + gdouble x; + gdouble y; +} LabelCenter; + +struct _glWdgtMiniPreviewPrivate { + + gint height; + gint width; + + lglTemplate *template; + gdouble scale; + gdouble offset_x; + gdouble offset_y; + gint labels_per_sheet; + LabelCenter *centers; + + gint highlight_first; + gint highlight_last; + + gboolean dragging; + gint first_i; + gint last_i; + gint prev_i; +}; + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +static gint wdgt_mini_preview_signals[LAST_SIGNAL] = { 0 }; + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_wdgt_mini_preview_finalize (GObject *object); + +static void gl_wdgt_mini_preview_construct (glWdgtMiniPreview *preview, + gint height, + gint width); + +static gboolean expose_event_cb (GtkWidget *widget, + GdkEventExpose *event); +static void style_set_cb (GtkWidget *widget, + GtkStyle *previous_style); +static gboolean button_press_event_cb (GtkWidget *widget, + GdkEventButton *event); +static gboolean motion_notify_event_cb (GtkWidget *widget, + GdkEventMotion *event); +static gboolean button_release_event_cb (GtkWidget *widget, + GdkEventButton *event); + + +static void redraw (GtkWidget *widget); +static void draw (glWdgtMiniPreview *preview, + cairo_t *cr); + +static void draw_shadow (glWdgtMiniPreview *preview, + cairo_t *cr, + gdouble x, + gdouble y, + gdouble width, + gdouble height); +static void draw_paper (glWdgtMiniPreview *preview, + cairo_t *cr, + gdouble width, + gdouble height, + gdouble line_width); +static void draw_labels (glWdgtMiniPreview *preview, + cairo_t *cr, + lglTemplate *template, + gdouble line_width); + +static gint find_closest_label (glWdgtMiniPreview *preview, + gdouble x, + gdouble y); + + + +/****************************************************************************/ +/* Boilerplate Object stuff. */ +/****************************************************************************/ +G_DEFINE_TYPE (glWdgtMiniPreview, gl_wdgt_mini_preview, GTK_TYPE_DRAWING_AREA); + + +static void +gl_wdgt_mini_preview_class_init (glWdgtMiniPreviewClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + gl_wdgt_mini_preview_parent_class = gtk_type_class (gtk_hbox_get_type ()); + + object_class->finalize = gl_wdgt_mini_preview_finalize; + + widget_class->expose_event = expose_event_cb; + widget_class->style_set = style_set_cb; + widget_class->button_press_event = button_press_event_cb; + widget_class->motion_notify_event = motion_notify_event_cb; + widget_class->button_release_event = button_release_event_cb; + + wdgt_mini_preview_signals[CLICKED] = + g_signal_new ("clicked", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glWdgtMiniPreviewClass, clicked), + NULL, NULL, + gl_marshal_VOID__INT, + G_TYPE_NONE, 1, G_TYPE_INT); + + wdgt_mini_preview_signals[PRESSED] = + g_signal_new ("pressed", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glWdgtMiniPreviewClass, pressed), + NULL, NULL, + gl_marshal_VOID__INT_INT, + G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +static void +gl_wdgt_mini_preview_init (glWdgtMiniPreview *preview) +{ + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + preview->priv = g_new0 (glWdgtMiniPreviewPrivate, 1); + + gtk_widget_add_events (GTK_WIDGET (preview), + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_POINTER_MOTION_MASK); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +static void +gl_wdgt_mini_preview_finalize (GObject *object) +{ + glWdgtMiniPreview *preview = GL_WDGT_MINI_PREVIEW (object); + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_WDGT_MINI_PREVIEW (object)); + + lgl_template_free (preview->priv->template); + g_free (preview->priv->centers); + g_free (preview->priv); + + G_OBJECT_CLASS (gl_wdgt_mini_preview_parent_class)->finalize (object); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +GtkWidget * +gl_wdgt_mini_preview_new (gint height, + gint width) +{ + glWdgtMiniPreview *preview; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + preview = g_object_new (gl_wdgt_mini_preview_get_type (), NULL); + + gl_wdgt_mini_preview_construct (preview, height, width); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); + + return GTK_WIDGET (preview); +} + +/*--------------------------------------------------------------------------*/ +/* Construct composite widget. */ +/*--------------------------------------------------------------------------*/ +static void +gl_wdgt_mini_preview_construct (glWdgtMiniPreview *preview, + gint height, + gint width) +{ + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + preview->priv->height = height; + preview->priv->width = width; + + gtk_widget_set_size_request (GTK_WIDGET (preview), width, height); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +/****************************************************************************/ +/* Set label for mini-preview to determine geometry. */ +/****************************************************************************/ +void gl_wdgt_mini_preview_set_label_by_name (glWdgtMiniPreview *preview, + const gchar *name) +{ + lglTemplate *template; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + /* Fetch template */ + template = lgl_db_lookup_template_from_name (name); + + gl_wdgt_mini_preview_set_template (preview, template); + + lgl_template_free (template); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +/****************************************************************************/ +/* Set label for mini-preview to determine geometry. */ +/****************************************************************************/ +void gl_wdgt_mini_preview_set_template (glWdgtMiniPreview *preview, + const lglTemplate *template) +{ + const lglTemplateFrame *frame; + lglTemplateOrigin *origins; + gdouble w, h; + gint i; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + frame = (lglTemplateFrame *)template->frames->data; + + /* + * Set template + */ + lgl_template_free (preview->priv->template); + preview->priv->template = lgl_template_dup (template); + + /* + * Set scale and offsets + */ + w = preview->priv->width - 4 - 2*SHADOW_X_OFFSET; + h = preview->priv->height - 4 - 2*SHADOW_Y_OFFSET; + if ( (w/template->page_width) > (h/template->page_height) ) { + preview->priv->scale = h / template->page_height; + } else { + preview->priv->scale = w / template->page_width; + } + preview->priv->offset_x = (preview->priv->width/preview->priv->scale - template->page_width) / 2.0; + preview->priv->offset_y = (preview->priv->height/preview->priv->scale - template->page_height) / 2.0; + + /* + * Set labels per sheet + */ + preview->priv->labels_per_sheet = lgl_template_frame_get_n_labels (frame); + + /* + * Initialize centers + */ + g_free (preview->priv->centers); + preview->priv->centers = g_new0 (LabelCenter, preview->priv->labels_per_sheet); + origins = lgl_template_frame_get_origins (frame); + lgl_template_frame_get_size (frame, &w, &h); + for ( i=0; ipriv->labels_per_sheet; i++ ) + { + preview->priv->centers[i].x = origins[i].x + w/2.0; + preview->priv->centers[i].y = origins[i].y + h/2.0; + } + g_free (origins); + + /* + * Redraw modified preview + */ + redraw( GTK_WIDGET (preview)); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +/****************************************************************************/ +/* Highlight given label outlines. */ +/****************************************************************************/ +void +gl_wdgt_mini_preview_highlight_range (glWdgtMiniPreview *preview, + gint first_label, + gint last_label) +{ + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + preview->priv->highlight_first = first_label; + preview->priv->highlight_last = last_label; + + redraw( GTK_WIDGET (preview)); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + + +/*--------------------------------------------------------------------------*/ +/* Expose event handler. */ +/*--------------------------------------------------------------------------*/ +static gboolean +expose_event_cb (GtkWidget *widget, + GdkEventExpose *event) +{ + cairo_t *cr; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + cr = gdk_cairo_create (widget->window); + + cairo_rectangle (cr, + event->area.x, event->area.y, + event->area.width, event->area.height); + cairo_clip (cr); + + draw (GL_WDGT_MINI_PREVIEW (widget), cr); + + cairo_destroy (cr); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); + return FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* Button press event handler */ +/*--------------------------------------------------------------------------*/ +static gboolean +button_press_event_cb (GtkWidget *widget, + GdkEventButton *event) +{ + glWdgtMiniPreview *preview = GL_WDGT_MINI_PREVIEW (widget); + cairo_t *cr; + gdouble x, y; + gint i; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + if ( event->button == 1 ) + { + cr = gdk_cairo_create (widget->window); + + /* Set transformation. */ + cairo_identity_matrix (cr); + cairo_scale (cr, preview->priv->scale, preview->priv->scale); + cairo_translate (cr, preview->priv->offset_x, preview->priv->offset_y); + + x = event->x; + y = event->y; + cairo_device_to_user (cr, &x, &y); + + i = find_closest_label (preview, x, y); + + g_signal_emit (G_OBJECT(preview), + wdgt_mini_preview_signals[CLICKED], + 0, i); + + preview->priv->first_i = i; + preview->priv->last_i = i; + g_signal_emit (G_OBJECT(preview), + wdgt_mini_preview_signals[PRESSED], + 0, preview->priv->first_i, preview->priv->last_i); + + preview->priv->dragging = TRUE; + preview->priv->prev_i = i; + + cairo_destroy (cr); + } + + gl_debug (DEBUG_MINI_PREVIEW, "END"); + return FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* Motion notify event handler */ +/*--------------------------------------------------------------------------*/ +static gboolean +motion_notify_event_cb (GtkWidget *widget, + GdkEventMotion *event) +{ + glWdgtMiniPreview *preview = GL_WDGT_MINI_PREVIEW (widget); + cairo_t *cr; + gdouble x, y; + gint i; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + if (preview->priv->dragging) + { + cr = gdk_cairo_create (widget->window); + + /* Set transformation. */ + cairo_identity_matrix (cr); + cairo_scale (cr, preview->priv->scale, preview->priv->scale); + cairo_translate (cr, preview->priv->offset_x, preview->priv->offset_y); + + x = event->x; + y = event->y; + cairo_device_to_user (cr, &x, &y); + + i = find_closest_label (preview, x, y); + + if ( i != preview->priv->prev_i ) + { + preview->priv->last_i = i; + + g_signal_emit (G_OBJECT(preview), + wdgt_mini_preview_signals[PRESSED], + 0, + MIN (preview->priv->first_i, preview->priv->last_i), + MAX (preview->priv->first_i, preview->priv->last_i)); + + preview->priv->prev_i = i; + } + cairo_destroy (cr); + } + + gl_debug (DEBUG_MINI_PREVIEW, "END"); + return FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* Button release event handler */ +/*--------------------------------------------------------------------------*/ +static gboolean +button_release_event_cb (GtkWidget *widget, + GdkEventButton *event) +{ + glWdgtMiniPreview *preview = GL_WDGT_MINI_PREVIEW (widget); + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + if ( event->button == 1 ) + { + preview->priv->dragging = FALSE; + + } + + gl_debug (DEBUG_MINI_PREVIEW, "END"); + return FALSE; +} + +/*--------------------------------------------------------------------------*/ +/* Style set handler (updates colors when style/theme changes). */ +/*--------------------------------------------------------------------------*/ +static void +style_set_cb (GtkWidget *widget, + GtkStyle *previous_style) +{ + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + redraw( widget ); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* Redraw. */ +/*--------------------------------------------------------------------------*/ +static void +redraw (GtkWidget *widget) +{ + GdkRegion *region; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + if (widget->window) + { + + region = gdk_drawable_get_clip_region (widget->window); + + gdk_window_invalidate_region (widget->window, region, TRUE); + gdk_window_process_updates (widget->window, TRUE); + + gdk_region_destroy (region); + } + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* Find index+1 of label closest to given coordinates. */ +/*--------------------------------------------------------------------------*/ +static gint +find_closest_label (glWdgtMiniPreview *preview, + gdouble x, + gdouble y) +{ + gint i; + gint min_i; + gdouble dx, dy, d2, min_d2; + + dx = x - preview->priv->centers[0].x; + dy = y - preview->priv->centers[0].y; + min_d2 = dx*dx + dy*dy; + min_i = 0; + + for ( i=1; ipriv->labels_per_sheet; i++ ) + { + dx = x - preview->priv->centers[i].x; + dy = y - preview->priv->centers[i].y; + d2 = dx*dx + dy*dy; + + if ( d2 < min_d2 ) + { + min_d2 = d2; + min_i = i; + } + } + + return min_i + 1; +} + +/*--------------------------------------------------------------------------*/ +/* Draw mini preview. */ +/*--------------------------------------------------------------------------*/ +static void +draw (glWdgtMiniPreview *preview, + cairo_t *cr) +{ + lglTemplate *template = preview->priv->template; + gdouble shadow_x, shadow_y; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + if (template) + { + + /* Set transformation. */ + cairo_identity_matrix (cr); + cairo_scale (cr, preview->priv->scale, preview->priv->scale); + cairo_translate (cr, preview->priv->offset_x, preview->priv->offset_y); + + + /* update shadow */ + shadow_x = SHADOW_X_OFFSET/preview->priv->scale; + shadow_y = SHADOW_Y_OFFSET/preview->priv->scale; + + draw_shadow (preview, cr, + shadow_x, shadow_y, + template->page_width, template->page_height); + + draw_paper (preview, cr, + template->page_width, template->page_height, + 1.0/preview->priv->scale); + + draw_labels (preview, cr, template, 1.0/preview->priv->scale); + + } + + gl_debug (DEBUG_MINI_PREVIEW, "END"); + +} + + +/*--------------------------------------------------------------------------*/ +/* Draw page shadow */ +/*--------------------------------------------------------------------------*/ +static void +draw_shadow (glWdgtMiniPreview *preview, + cairo_t *cr, + gdouble x, + gdouble y, + gdouble width, + gdouble height) +{ + GtkStyle *style; + guint shadow_color; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + cairo_save (cr); + + cairo_rectangle (cr, x, y, width, height); + + style = gtk_widget_get_style (GTK_WIDGET(preview)); + shadow_color = gl_color_from_gdk_color (&style->bg[GTK_STATE_ACTIVE]); + cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (shadow_color)); + + cairo_fill (cr); + + cairo_restore (cr); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* Draw page */ +/*--------------------------------------------------------------------------*/ +static void +draw_paper (glWdgtMiniPreview *preview, + cairo_t *cr, + gdouble width, + gdouble height, + gdouble line_width) +{ + cairo_save (cr); + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + cairo_rectangle (cr, 0.0, 0.0, width, height); + + cairo_set_source_rgb (cr, PAPER_RGB_ARGS); + cairo_fill_preserve (cr); + + cairo_set_source_rgb (cr, PAPER_OUTLINE_RGB_ARGS); + cairo_set_line_width (cr, line_width); + cairo_stroke (cr); + + cairo_restore (cr); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* Draw labels */ +/*--------------------------------------------------------------------------*/ +static void +draw_labels (glWdgtMiniPreview *preview, + cairo_t *cr, + lglTemplate *template, + gdouble line_width) +{ + const lglTemplateFrame *frame; + gint i, n_labels; + lglTemplateOrigin *origins; + GtkStyle *style; + guint highlight_color; + + gl_debug (DEBUG_MINI_PREVIEW, "START"); + + frame = (lglTemplateFrame *)template->frames->data; + + n_labels = lgl_template_frame_get_n_labels (frame); + origins = lgl_template_frame_get_origins (frame); + + style = gtk_widget_get_style (GTK_WIDGET(preview)); + highlight_color = gl_color_from_gdk_color (&style->base[GTK_STATE_SELECTED]); + + for ( i=0; i < n_labels; i++ ) { + + cairo_save (cr); + + cairo_translate (cr, origins[i].x, origins[i].y); + gl_cairo_label_path (cr, template, FALSE, FALSE); + + if ( ((i+1) >= preview->priv->highlight_first) && + ((i+1) <= preview->priv->highlight_last) ) + { + cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (highlight_color)); + } + else + { + cairo_set_source_rgb (cr, PAPER_RGB_ARGS); + } + cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); + cairo_fill_preserve (cr); + + cairo_set_line_width (cr, line_width); + cairo_set_source_rgb (cr, LABEL_OUTLINE_RGB_ARGS); + cairo_stroke (cr); + + cairo_restore (cr); + + } + + g_free (origins); + + gl_debug (DEBUG_MINI_PREVIEW, "END"); +} + diff --git a/src/wdgt-mini-preview.h b/src/wdgt-mini-preview.h new file mode 100644 index 00000000..8754b857 --- /dev/null +++ b/src/wdgt-mini-preview.h @@ -0,0 +1,83 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * wdgt_mini_preview.h: mini-preview widget module header file + * + * Copyright (C) 2001-2007 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __WDGT_MINI_PREVIEW_H__ +#define __WDGT_MINI_PREVIEW_H__ + +#include +#include "label.h" + +G_BEGIN_DECLS + +#define GL_TYPE_WDGT_MINI_PREVIEW (gl_wdgt_mini_preview_get_type ()) +#define GL_WDGT_MINI_PREVIEW(obj) \ + (GTK_CHECK_CAST((obj), GL_TYPE_WDGT_MINI_PREVIEW, glWdgtMiniPreview )) +#define GL_WDGT_MINI_PREVIEW_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WDGT_MINI_PREVIEW, glWdgtMiniPreviewClass)) +#define GL_IS_WDGT_MINI_PREVIEW(obj) \ + (GTK_CHECK_TYPE ((obj), GL_TYPE_WDGT_MINI_PREVIEW)) +#define GL_IS_WDGT_MINI_PREVIEW_CLASS(klass) \ + (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WDGT_MINI_PREVIEW)) + +typedef struct _glWdgtMiniPreview glWdgtMiniPreview; +typedef struct _glWdgtMiniPreviewPrivate glWdgtMiniPreviewPrivate; +typedef struct _glWdgtMiniPreviewClass glWdgtMiniPreviewClass; + +struct _glWdgtMiniPreview { + GtkDrawingArea parent_widget; + + glWdgtMiniPreviewPrivate *priv; +}; + +struct _glWdgtMiniPreviewClass { + GtkDrawingAreaClass parent_class; + + void (*clicked) (glWdgtMiniPreview *preview, + gint index, + gpointer user_data); + + void (*pressed) (glWdgtMiniPreview *preview, + gint index1, + gint index2, + gpointer user_data); +}; + +GType gl_wdgt_mini_preview_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_wdgt_mini_preview_new (gint height, + gint width); + +void gl_wdgt_mini_preview_set_label_by_name (glWdgtMiniPreview *preview, + const gchar *name); + +void gl_wdgt_mini_preview_set_template (glWdgtMiniPreview *preview, + const lglTemplate *template); + +void gl_wdgt_mini_preview_highlight_range (glWdgtMiniPreview *preview, + gint first_label, + gint last_label); + +G_END_DECLS + +#endif diff --git a/src/wdgt-print-copies.c b/src/wdgt-print-copies.c new file mode 100644 index 00000000..7d2f35b1 --- /dev/null +++ b/src/wdgt-print-copies.c @@ -0,0 +1,363 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * wdgt_print_copies.c: custom print copies widget module + * + * Copyright (C) 2001 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "wdgt-print-copies.h" + +#include +#include +#include +#include +#include +#include + +#include "hig.h" +#include "wdgt-mini-preview.h" +#include "marshal.h" + +#include "debug.h" + +#define WDGT_MINI_PREVIEW_HEIGHT 175 +#define WDGT_MINI_PREVIEW_WIDTH 150 + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_wdgt_print_copies_finalize (GObject * object); + +static void gl_wdgt_print_copies_construct (glWdgtPrintCopies * copies, + glLabel * label); + +static void sheets_radio_cb (GtkToggleButton * togglebutton, + gpointer user_data); +static void first_spin_cb (GtkSpinButton * spinbutton, + gpointer user_data); +static void last_spin_cb (GtkSpinButton * spinbutton, + gpointer user_data); + +static void +preview_pressed (glWdgtMiniPreview *mini_preview, + gint first, gint last, gpointer user_data); + + +/****************************************************************************/ +/* Boilerplate Object stuff. */ +/****************************************************************************/ +G_DEFINE_TYPE (glWdgtPrintCopies, gl_wdgt_print_copies, GTK_TYPE_HBOX); + +static void +gl_wdgt_print_copies_class_init (glWdgtPrintCopiesClass * class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_wdgt_print_copies_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_wdgt_print_copies_finalize; +} + +static void +gl_wdgt_print_copies_init (glWdgtPrintCopies * copies) +{ + copies->labels_per_sheet = 0; + + copies->mini_preview = NULL; + + copies->sheets_radio = NULL; + copies->sheets_spin = NULL; + + copies->labels_radio = NULL; + copies->first_spin = NULL; + copies->last_spin = NULL; +} + +static void +gl_wdgt_print_copies_finalize (GObject * object) +{ + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_WDGT_PRINT_COPIES (object)); + + G_OBJECT_CLASS (gl_wdgt_print_copies_parent_class)->finalize (object); +} + +GtkWidget * +gl_wdgt_print_copies_new (glLabel * label) +{ + glWdgtPrintCopies *copies; + + copies = g_object_new (gl_wdgt_print_copies_get_type (), NULL); + + gl_wdgt_print_copies_construct (copies, label); + + return GTK_WIDGET (copies); +} + +/*--------------------------------------------------------------------------*/ +/* Construct composite widget. */ +/*--------------------------------------------------------------------------*/ +static void +gl_wdgt_print_copies_construct (glWdgtPrintCopies *copies, + glLabel *label) +{ + const lglTemplateFrame *frame; + GtkWidget *whbox, *wvbox, *whbox1; + GSList *radio_group = NULL; + GtkObject *adjust; + + whbox = GTK_WIDGET (copies); + + frame = (lglTemplateFrame *)label->template->frames->data; + + copies->labels_per_sheet = lgl_template_frame_get_n_labels (frame); + + /* mini_preview canvas */ + copies->mini_preview = gl_wdgt_mini_preview_new (WDGT_MINI_PREVIEW_HEIGHT, + WDGT_MINI_PREVIEW_WIDTH); + gl_wdgt_mini_preview_set_template (GL_WDGT_MINI_PREVIEW(copies->mini_preview), + label->template); + gtk_box_pack_start (GTK_BOX(whbox), copies->mini_preview, FALSE, FALSE, 0); + + wvbox = gtk_vbox_new (FALSE, GL_HIG_PAD1); + gtk_box_pack_start (GTK_BOX(whbox), wvbox, FALSE, FALSE, 0); + + /* Sheet controls */ + whbox1 = gtk_hbox_new (FALSE, GL_HIG_PAD2); + gtk_box_pack_start (GTK_BOX(wvbox), whbox1, FALSE, FALSE, 0); + copies->sheets_radio = + gtk_radio_button_new_with_label (radio_group, _("Sheets:")); + gtk_box_pack_start (GTK_BOX(whbox1), copies->sheets_radio, FALSE, FALSE, 0); + adjust = gtk_adjustment_new (1, 1.0, 100.0, 1.0, 10.0, 0.0); + copies->sheets_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust), + 1.0, 0); + gtk_box_pack_start (GTK_BOX(whbox1), copies->sheets_spin, FALSE, FALSE, 0); + gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(copies->mini_preview), + 1, copies->labels_per_sheet); + + /* Blank line */ + gtk_box_pack_start (GTK_BOX(wvbox), gtk_label_new (""), FALSE, FALSE, 0); + + /* Label controls */ + whbox1 = gtk_hbox_new (FALSE, GL_HIG_PAD2); + gtk_box_pack_start (GTK_BOX(wvbox), whbox1, FALSE, FALSE, 0); + radio_group = + gtk_radio_button_get_group (GTK_RADIO_BUTTON (copies->sheets_radio)); + copies->labels_radio = + gtk_radio_button_new_with_label (radio_group, _("Labels")); + gtk_box_pack_start (GTK_BOX(whbox1), copies->labels_radio, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX(whbox1), gtk_label_new (_("from:")), FALSE, FALSE, 0); + adjust = gtk_adjustment_new (1, 1.0, copies->labels_per_sheet, 1.0, 10.0, 0.0); + copies->first_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust), + 1.0, 0); + gtk_box_pack_start (GTK_BOX(whbox1), copies->first_spin, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX(whbox1), gtk_label_new (_("to:")), FALSE, FALSE, 0); + adjust = gtk_adjustment_new (copies->labels_per_sheet, 1.0, copies->labels_per_sheet, 1.0, 10.0, 0.0); + copies->last_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust), + 1.0, 0); + gtk_box_pack_start (GTK_BOX(whbox1), copies->last_spin, FALSE, FALSE, 0); + gtk_widget_set_sensitive (copies->first_spin, FALSE); + gtk_widget_set_sensitive (copies->last_spin, FALSE); + + /* Connect signals to controls */ + g_signal_connect (G_OBJECT (copies->mini_preview), "pressed", + G_CALLBACK (preview_pressed), copies); + g_signal_connect (G_OBJECT (copies->sheets_radio), "toggled", + G_CALLBACK (sheets_radio_cb), copies); + g_signal_connect (G_OBJECT (copies->first_spin), "changed", + G_CALLBACK (first_spin_cb), copies); + g_signal_connect (G_OBJECT (copies->last_spin), "changed", + G_CALLBACK (last_spin_cb), copies); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Enable/Disable appropriate controls due to radio button toggle.*/ +/*--------------------------------------------------------------------------*/ +static void +sheets_radio_cb (GtkToggleButton * togglebutton, + gpointer user_data) +{ + glWdgtPrintCopies *copies = GL_WDGT_PRINT_COPIES (user_data); + gint first, last; + + if (gtk_toggle_button_get_active (togglebutton)) { + + gtk_widget_set_sensitive (copies->sheets_spin, TRUE); + gtk_widget_set_sensitive (copies->first_spin, FALSE); + gtk_widget_set_sensitive (copies->last_spin, FALSE); + + gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(copies->mini_preview), + 1, copies->labels_per_sheet); + + } else { + + gtk_widget_set_sensitive (copies->sheets_spin, FALSE); + gtk_widget_set_sensitive (copies->first_spin, TRUE); + gtk_widget_set_sensitive (copies->last_spin, TRUE); + + first = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (copies->first_spin)); + last = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (copies->last_spin)); + gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(copies->mini_preview), + first, last); + + } +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. modify widget due to change of first spin button */ +/*--------------------------------------------------------------------------*/ +static void +first_spin_cb (GtkSpinButton * spinbutton, + gpointer user_data) +{ + glWdgtPrintCopies *copies = GL_WDGT_PRINT_COPIES (user_data); + gint first, last; + + first = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (copies->first_spin)); + last = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (copies->last_spin)); + + gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (copies->last_spin))->lower = first; + + gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(copies->mini_preview), + first, last); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. modify widget due to change of last spin button */ +/*--------------------------------------------------------------------------*/ +static void +last_spin_cb (GtkSpinButton * spinbutton, + gpointer user_data) +{ + glWdgtPrintCopies *copies = GL_WDGT_PRINT_COPIES (user_data); + gint first, last; + + first = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (copies->first_spin)); + last = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (copies->last_spin)); + + gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (copies->first_spin))->upper = last; + + gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(copies->mini_preview), + first, last); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Canvas event handler, select first and last items. */ +/*--------------------------------------------------------------------------*/ +static void +preview_pressed (glWdgtMiniPreview *mini_preview, + gint first, + gint last, + gpointer user_data) +{ + glWdgtPrintCopies *copies = GL_WDGT_PRINT_COPIES (user_data); + + gl_wdgt_print_copies_set_range (copies, 1, first, last); +} + +/****************************************************************************/ +/* query selected range of labels within sheet or number of sheets. */ +/****************************************************************************/ +void +gl_wdgt_print_copies_get_range (glWdgtPrintCopies * copies, + gint * n_sheets, + gint * first_label, + gint * last_label) +{ + gboolean sheets_active; + + sheets_active = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (copies->sheets_radio)); + + if (sheets_active) { + *n_sheets = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (copies->sheets_spin)); + *first_label = 1; + *last_label = copies->labels_per_sheet; + } else { + *n_sheets = 1; + *first_label = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (copies->first_spin)); + *last_label = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (copies->last_spin)); + } +} + +/****************************************************************************/ +/* set range of labels within sheet or number of sheets */ +/****************************************************************************/ +void +gl_wdgt_print_copies_set_range (glWdgtPrintCopies * copies, + gint n_sheets, + gint first_label, + gint last_label) +{ + gint old_first_label; + + old_first_label = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (copies->first_spin)); + + if (first_label > old_first_label) { + gtk_spin_button_set_value (GTK_SPIN_BUTTON (copies->last_spin), + last_label); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (copies->first_spin), + first_label); + } else { + gtk_spin_button_set_value (GTK_SPIN_BUTTON (copies->first_spin), + first_label); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (copies->last_spin), + last_label); + } + if ((first_label == 1) && (last_label == copies->labels_per_sheet)) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (copies->sheets_radio), TRUE); + gtk_spin_button_set_value (GTK_SPIN_BUTTON + (copies->sheets_spin), n_sheets); + } else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (copies->labels_radio), TRUE); + gtk_spin_button_set_value (GTK_SPIN_BUTTON + (copies->sheets_spin), 1.0); + } +} diff --git a/src/wdgt-print-copies.h b/src/wdgt-print-copies.h new file mode 100644 index 00000000..7e24dee3 --- /dev/null +++ b/src/wdgt-print-copies.h @@ -0,0 +1,81 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * wdgt_print_copies.h: custom print copies widget module header file + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __WDGT_PRINT_COPIES_H__ +#define __WDGT_PRINT_COPIES_H__ + +#include "label.h" +#include + +G_BEGIN_DECLS + +#define GL_TYPE_WDGT_PRINT_COPIES (gl_wdgt_print_copies_get_type ()) +#define GL_WDGT_PRINT_COPIES(obj) \ + (GTK_CHECK_CAST((obj), GL_TYPE_WDGT_PRINT_COPIES, glWdgtPrintCopies )) +#define GL_WDGT_PRINT_COPIES_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WDGT_PRINT_COPIES, glWdgtPrintCopiesClass)) +#define GL_IS_WDGT_PRINT_COPIES(obj) \ + (GTK_CHECK_TYPE ((obj), GL_TYPE_WDGT_PRINT_COPIES)) +#define GL_IS_WDGT_PRINT_COPIES_CLASS(klass) \ + (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WDGT_PRINT_COPIES)) + +typedef struct _glWdgtPrintCopies glWdgtPrintCopies; +typedef struct _glWdgtPrintCopiesClass glWdgtPrintCopiesClass; + +struct _glWdgtPrintCopies { + GtkHBox parent_widget; + + gint labels_per_sheet; + + GtkWidget *mini_preview; + + GtkWidget *sheets_radio; + GtkWidget *sheets_spin; + + GtkWidget *labels_radio; + GtkWidget *first_spin; + GtkWidget *last_spin; +}; + +struct _glWdgtPrintCopiesClass { + GtkHBoxClass parent_class; +}; + +GType gl_wdgt_print_copies_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_wdgt_print_copies_new (glLabel *label); + +void gl_wdgt_print_copies_get_range (glWdgtPrintCopies *copies, + gint *n_sheets, + gint *first_label, + gint *last_label); + +void gl_wdgt_print_copies_set_range (glWdgtPrintCopies *copies, + gint n_sheets, + gint first_label, + gint last_label); + +G_END_DECLS + +#endif diff --git a/src/wdgt-print-merge.c b/src/wdgt-print-merge.c new file mode 100644 index 00000000..f05d4eda --- /dev/null +++ b/src/wdgt-print-merge.c @@ -0,0 +1,313 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * wdgt_print_merge.c: print merge widget module + * + * Copyright (C) 2001 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "wdgt-print-merge.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "hig.h" +#include "wdgt-mini-preview.h" +#include "marshal.h" + +#include "pixmaps/collate.xpm" +#include "pixmaps/nocollate.xpm" + +#include "debug.h" + +#define WDGT_MINI_PREVIEW_HEIGHT 175 +#define WDGT_MINI_PREVIEW_WIDTH 150 + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_wdgt_print_merge_finalize (GObject * object); + +static void gl_wdgt_print_merge_construct (glWdgtPrintMerge * merge, + glLabel * label); + +static void preview_clicked (glWdgtMiniPreview *mini_preview, + gint i_label, + gpointer user_data); + +static void collate_check_cb (GtkToggleButton * togglebutton, + gpointer user_data); +static void spin_cb (GtkSpinButton * spinbutton, + gpointer user_data); + + +/****************************************************************************/ +/* Boilerplate Object stuff. */ +/****************************************************************************/ +G_DEFINE_TYPE (glWdgtPrintMerge, gl_wdgt_print_merge, GTK_TYPE_HBOX); + + +static void +gl_wdgt_print_merge_class_init (glWdgtPrintMergeClass * class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_wdgt_print_merge_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_wdgt_print_merge_finalize; +} + +static void +gl_wdgt_print_merge_init (glWdgtPrintMerge * merge) +{ + merge->mini_preview = NULL; + + merge->copies_spin = NULL; + merge->first_spin = NULL; + merge->collate_image = NULL; + merge->collate_check = NULL; +} + +static void +gl_wdgt_print_merge_finalize (GObject * object) +{ + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_WDGT_PRINT_MERGE (object)); + + G_OBJECT_CLASS (gl_wdgt_print_merge_parent_class)->finalize (object); +} + +GtkWidget * +gl_wdgt_print_merge_new (glLabel * label) +{ + glWdgtPrintMerge *merge; + + merge = g_object_new (gl_wdgt_print_merge_get_type (), NULL); + + gl_wdgt_print_merge_construct (merge, label); + + return GTK_WIDGET (merge); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Construct composite widget. */ +/*--------------------------------------------------------------------------*/ +static void +gl_wdgt_print_merge_construct (glWdgtPrintMerge * merge, + glLabel * label) +{ + const lglTemplateFrame *frame; + GtkWidget *whbox, *wvbox, *whbox1; + GtkObject *adjust; + GdkPixbuf *pixbuf; + + whbox = GTK_WIDGET (merge); + + frame = (lglTemplateFrame *)label->template->frames->data; + + merge->labels_per_sheet = lgl_template_frame_get_n_labels (frame); + + /* mini_preview canvas */ + merge->mini_preview = gl_wdgt_mini_preview_new (WDGT_MINI_PREVIEW_HEIGHT, + WDGT_MINI_PREVIEW_WIDTH); + gl_wdgt_mini_preview_set_template( GL_WDGT_MINI_PREVIEW (merge->mini_preview), + label->template ); + gtk_box_pack_start (GTK_BOX(whbox), merge->mini_preview, FALSE, FALSE, 0); + gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(merge->mini_preview), + 1, 1); + + wvbox = gtk_vbox_new (FALSE, GL_HIG_PAD1); + gtk_box_pack_start (GTK_BOX(whbox), wvbox, FALSE, FALSE, 0); + + /* First Label controls */ + whbox1 = gtk_hbox_new (FALSE, GL_HIG_PAD2); + gtk_box_pack_start (GTK_BOX(wvbox), whbox1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX(whbox1), + gtk_label_new (_("Start on label")), FALSE, FALSE, 0); + adjust = gtk_adjustment_new (1, 1.0, merge->labels_per_sheet, 1.0, 10.0, 0.0); + merge->first_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust), 1.0, 0); + gtk_box_pack_start (GTK_BOX(whbox1), merge->first_spin, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX(whbox1), + gtk_label_new (_("on 1st sheet")), FALSE, FALSE, 0); + + /* Blank line */ + gtk_box_pack_start (GTK_BOX(wvbox), gtk_label_new (""), FALSE, FALSE, 0); + + /* Copy & collate controls*/ + whbox1 = gtk_hbox_new (FALSE, GL_HIG_PAD2); + gtk_box_pack_start (GTK_BOX(wvbox), whbox1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX(whbox1), + gtk_label_new (_("Copies:")), FALSE, FALSE, 0); + adjust = gtk_adjustment_new (1, 1.0, 100.0, 1.0, 10.0, 0.0); + merge->copies_spin = gtk_spin_button_new (GTK_ADJUSTMENT (adjust), 1.0, 0); + gtk_box_pack_start (GTK_BOX(whbox1), merge->copies_spin, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX(whbox1), gtk_label_new (" "), FALSE, FALSE, 0); + merge->collate_check = gtk_check_button_new_with_label (_("Collate")); + gtk_box_pack_start (GTK_BOX(whbox1), merge->collate_check, FALSE, FALSE, 0); + pixbuf = gdk_pixbuf_new_from_xpm_data ( (const char **)nocollate_xpm); + merge->collate_image = gtk_image_new_from_pixbuf(pixbuf); + gtk_widget_set_sensitive (merge->collate_check, FALSE); + gtk_widget_set_sensitive (merge->collate_image, FALSE); + + gtk_box_pack_start (GTK_BOX(whbox1), merge->collate_image, FALSE, FALSE, 0); + + /* Connect signals to controls */ + g_signal_connect (G_OBJECT (merge->mini_preview), "clicked", + G_CALLBACK (preview_clicked), merge); + g_signal_connect (G_OBJECT (merge->collate_check), "toggled", + G_CALLBACK (collate_check_cb), merge); + g_signal_connect (G_OBJECT (merge->copies_spin), "changed", + G_CALLBACK (spin_cb), merge); + g_signal_connect (G_OBJECT (merge->first_spin), "changed", + G_CALLBACK (spin_cb), merge); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Enable/Disable appropriate controls due to radio button toggle.*/ +/*--------------------------------------------------------------------------*/ +static void +collate_check_cb (GtkToggleButton * togglebutton, + gpointer user_data) +{ + glWdgtPrintMerge *merge = GL_WDGT_PRINT_MERGE (user_data); + GdkPixbuf *pixbuf; + + if (gtk_toggle_button_get_active (togglebutton)) { + + pixbuf = + gdk_pixbuf_new_from_xpm_data ( (const char **)collate_xpm); + + } else { + + pixbuf = + gdk_pixbuf_new_from_xpm_data ( (const char **)nocollate_xpm); + + } + gtk_image_set_from_pixbuf (GTK_IMAGE (merge->collate_image), + pixbuf); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. modify widget due to change of first spin button */ +/*--------------------------------------------------------------------------*/ +static void +spin_cb (GtkSpinButton * spinbutton, + gpointer user_data) +{ + glWdgtPrintMerge *merge = GL_WDGT_PRINT_MERGE (user_data); + gint first, last, n_copies; + + first = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (merge->first_spin)); + + n_copies = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (merge->copies_spin)); + last = first + (n_copies * merge->n_records) - 1; + gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW(merge->mini_preview), + first, last ); + + gtk_widget_set_sensitive (merge->collate_check, (n_copies > 1)); + gtk_widget_set_sensitive (merge->collate_image, (n_copies > 1)); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Canvas event handler, select first and last items. */ +/*--------------------------------------------------------------------------*/ +static void +preview_clicked (glWdgtMiniPreview *mini_preview, + gint first, + gpointer user_data) +{ + glWdgtPrintMerge *merge = GL_WDGT_PRINT_MERGE (user_data); + gint n_copies, last; + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (merge->first_spin), + first); + + n_copies = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (merge->copies_spin)); + last = first + (n_copies * merge->n_records) - 1; + gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW (merge->mini_preview), + first, last); + +} + +/****************************************************************************/ +/* query selected range of labels within sheet or number of sheets. */ +/****************************************************************************/ +void +gl_wdgt_print_merge_get_copies (glWdgtPrintMerge *merge, + gint *n_copies, + gint *first_label, + gboolean *collate_flag, + gint *n_sheets) +{ + *n_copies = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (merge->copies_spin)); + *first_label = + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON + (merge->first_spin)); + *collate_flag = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (merge->collate_check)); + + *n_sheets = ceil ( (double)(*first_label - 1 + (*n_copies * merge->n_records))/ (double)merge->labels_per_sheet ); +} + +/****************************************************************************/ +/* set range of labels within sheet or number of sheets */ +/****************************************************************************/ +void +gl_wdgt_print_merge_set_copies (glWdgtPrintMerge * merge, + gint n_copies, + gint first_label, + gint n_records, + gboolean collate_flag) +{ + gint last_label; + + merge->n_records = n_records; + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (merge->copies_spin), + n_copies); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (merge->first_spin), + first_label); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (merge->collate_check), + collate_flag); + + last_label = first_label + (n_copies * n_records) - 1; + gl_wdgt_mini_preview_highlight_range (GL_WDGT_MINI_PREVIEW (merge->mini_preview), + first_label, last_label ); +} diff --git a/src/wdgt-print-merge.h b/src/wdgt-print-merge.h new file mode 100644 index 00000000..9e3a24da --- /dev/null +++ b/src/wdgt-print-merge.h @@ -0,0 +1,82 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * wdgt_print_merge.h: print merge widget module header file + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __WDGT_PRINT_MERGE_H__ +#define __WDGT_PRINT_MERGE_H__ + +#include "label.h" +#include + +G_BEGIN_DECLS + +#define GL_TYPE_WDGT_PRINT_MERGE (gl_wdgt_print_merge_get_type ()) +#define GL_WDGT_PRINT_MERGE(obj) \ + (GTK_CHECK_CAST((obj), GL_TYPE_WDGT_PRINT_MERGE, glWdgtPrintMerge )) +#define GL_WDGT_PRINT_MERGE_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WDGT_PRINT_MERGE, glWdgtPrintMergeClass)) +#define GL_IS_WDGT_PRINT_MERGE(obj) \ + (GTK_CHECK_TYPE ((obj), GL_TYPE_WDGT_PRINT_MERGE)) +#define GL_IS_WDGT_PRINT_MERGE_CLASS(klass) \ + (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WDGT_PRINT_MERGE)) + +typedef struct _glWdgtPrintMerge glWdgtPrintMerge; +typedef struct _glWdgtPrintMergeClass glWdgtPrintMergeClass; + +struct _glWdgtPrintMerge { + GtkHBox parent_widget; + + gint labels_per_sheet; + GtkWidget *mini_preview; + + gint n_records; + + GtkWidget *copies_spin; + GtkWidget *first_spin; + GtkWidget *collate_image; + GtkWidget *collate_check; +}; + +struct _glWdgtPrintMergeClass { + GtkHBoxClass parent_class; +}; + +GType gl_wdgt_print_merge_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_wdgt_print_merge_new (glLabel *label); + +void gl_wdgt_print_merge_get_copies (glWdgtPrintMerge *merge, + gint *n_copies, + gint *first_label, + gboolean *collate_flag, + gint *n_sheets); + +void gl_wdgt_print_merge_set_copies (glWdgtPrintMerge *merge, + gint n_copies, + gint first_label, + gint n_records, + gboolean collate_flag); + +G_END_DECLS + +#endif diff --git a/src/wdgt-rotate-label.c b/src/wdgt-rotate-label.c new file mode 100644 index 00000000..4edca601 --- /dev/null +++ b/src/wdgt-rotate-label.c @@ -0,0 +1,395 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * wdgt_rotate_label.c: label rotate selection widget module + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "wdgt-rotate-label.h" + +#include +#include +#include +#include +#include +#include + +#include "marshal.h" +#include "color.h" +#include +#include "cairo-label-path.h" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ +#define MINI_PREVIEW_MAX_PIXELS 48 +#define MINI_PREVIEW_CANVAS_PIXELS (MINI_PREVIEW_MAX_PIXELS + 8) + +#define LINE_COLOR GL_COLOR(0,0,0) +#define FILL_COLOR GL_COLOR(255,255,255) + +#define LINE_WIDTH_PIXELS 1.0 + +#define SHADOW_X_OFFSET 3 +#define SHADOW_Y_OFFSET 3 + + +/*===========================================*/ +/* Private types */ +/*===========================================*/ + +struct _glWdgtRotateLabelPrivate { + + GtkWidget *rotate_check; + GtkWidget *rotate_drawingarea; + + lglTemplate *template; +}; + +enum { + CHANGED, + LAST_SIGNAL +}; + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ + +static gint wdgt_rotate_label_signals[LAST_SIGNAL] = { 0 }; + +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ + +static void gl_wdgt_rotate_label_finalize (GObject *object); + +static void gl_wdgt_rotate_label_construct (glWdgtRotateLabel *rotate_label); + +static void entry_changed_cb (GtkToggleButton *toggle, + gpointer user_data); + +static void drawingarea_update (GtkDrawingArea *drawing_area, + lglTemplate *template, + gboolean rotate_flag); + +static gboolean expose_cb (GtkWidget *drawingarea, + GdkEventExpose *event, + gpointer user_data); + + +/****************************************************************************/ +/* Boilerplate Object stuff. */ +/****************************************************************************/ +G_DEFINE_TYPE (glWdgtRotateLabel, gl_wdgt_rotate_label, GTK_TYPE_VBOX); + + +static void +gl_wdgt_rotate_label_class_init (glWdgtRotateLabelClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + gl_wdgt_rotate_label_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_wdgt_rotate_label_finalize; + + wdgt_rotate_label_signals[CHANGED] = + g_signal_new ("changed", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (glWdgtRotateLabelClass, changed), + NULL, NULL, + gl_marshal_VOID__VOID, + G_TYPE_NONE, 0); + +} + +static void +gl_wdgt_rotate_label_init (glWdgtRotateLabel *rotate_label) +{ + rotate_label->priv = g_new0 (glWdgtRotateLabelPrivate, 1); +} + +static void +gl_wdgt_rotate_label_finalize (GObject *object) +{ + glWdgtRotateLabel *rotate_label = GL_WDGT_ROTATE_LABEL (object); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_WDGT_ROTATE_LABEL (object)); + + if (rotate_label->priv->template) { + lgl_template_free (rotate_label->priv->template); + rotate_label->priv->template = NULL; + } + g_free (rotate_label->priv); + + G_OBJECT_CLASS (gl_wdgt_rotate_label_parent_class)->finalize (object); +} + +GtkWidget * +gl_wdgt_rotate_label_new (void) +{ + glWdgtRotateLabel *rotate_label; + + rotate_label = g_object_new (gl_wdgt_rotate_label_get_type (), NULL); + + gl_wdgt_rotate_label_construct (rotate_label); + + return GTK_WIDGET (rotate_label); +} + +/*--------------------------------------------------------------------------*/ +/* Construct composite widget. */ +/*--------------------------------------------------------------------------*/ +static void +gl_wdgt_rotate_label_construct (glWdgtRotateLabel *rotate_label) +{ + GladeXML *gui; + GtkWidget *hbox; + + g_return_if_fail (GL_IS_WDGT_ROTATE_LABEL (rotate_label)); + g_return_if_fail (rotate_label->priv != NULL); + + gui = glade_xml_new (GLABELS_GLADE_DIR "wdgt-rotate-label.glade", + "rotate_hbox", NULL); + + if (!gui) { + g_critical ("Could not open wdgt-media-select.glade. gLabels may not be installed correctly!"); + return; + } + + hbox = glade_xml_get_widget (gui, "rotate_hbox"); + gtk_container_add (GTK_CONTAINER (rotate_label), hbox); + + rotate_label->priv->rotate_check = glade_xml_get_widget (gui, "rotate_check"); + rotate_label->priv->rotate_drawingarea = glade_xml_get_widget (gui, "rotate_drawingarea"); + + g_object_unref (gui); + + + gtk_widget_set_size_request (rotate_label->priv->rotate_drawingarea, + MINI_PREVIEW_CANVAS_PIXELS, + MINI_PREVIEW_CANVAS_PIXELS); + + /* Connect signals to controls */ + g_signal_connect (G_OBJECT (rotate_label->priv->rotate_check), + "toggled", + G_CALLBACK (entry_changed_cb), rotate_label); + g_signal_connect (G_OBJECT (rotate_label->priv->rotate_drawingarea), + "expose_event", + G_CALLBACK (expose_cb), rotate_label); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. modify widget due to change of check button */ +/*--------------------------------------------------------------------------*/ +static void +entry_changed_cb (GtkToggleButton *toggle, + gpointer user_data) +{ + glWdgtRotateLabel *rotate_label = GL_WDGT_ROTATE_LABEL (user_data); + + if (rotate_label->priv->template != NULL) { + /* Update mini_preview canvas & details with template */ + drawingarea_update (GTK_DRAWING_AREA (rotate_label->priv->rotate_drawingarea), + rotate_label->priv->template, + gtk_toggle_button_get_active (toggle)); + } + + /* Emit our "changed" signal */ + g_signal_emit (G_OBJECT (user_data), + wdgt_rotate_label_signals[CHANGED], 0); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Update mini-preview from template . */ +/*--------------------------------------------------------------------------*/ +static void +drawingarea_update (GtkDrawingArea *drawing_area, + lglTemplate *template, + gboolean rotate_flag) +{ + const lglTemplateFrame *frame; + gdouble m, m_canvas, w, h, scale; + GtkStyle *style; + guint line_color, fill_color, shadow_color; + cairo_t *cr; + + if (!GTK_WIDGET_DRAWABLE (GTK_WIDGET (drawing_area))) + { + return; + } + + /* Clear surface */ + gdk_window_clear (GTK_WIDGET (drawing_area)->window); + + if (template == NULL) + { + return; + } + + frame = (lglTemplateFrame *)template->frames->data; + + if (rotate_flag) + { + lgl_template_frame_get_size (frame, &h, &w); + } + else + { + lgl_template_frame_get_size (frame, &w, &h); + } + m = MAX (w, h); + scale = MINI_PREVIEW_MAX_PIXELS / m; + m_canvas = MINI_PREVIEW_CANVAS_PIXELS / scale; + + style = gtk_widget_get_style (GTK_WIDGET (drawing_area)); + + /* Adjust sensitivity (should the canvas be grayed?) */ + if (w != h) { + line_color = LINE_COLOR; + fill_color = FILL_COLOR; + } else { + line_color = gl_color_from_gdk_color (&style->text[GTK_STATE_INSENSITIVE]); + fill_color = gl_color_from_gdk_color (&style->base[GTK_STATE_INSENSITIVE]); + } + + shadow_color = gl_color_from_gdk_color (&style->bg[GTK_STATE_ACTIVE]); + + + cr = gdk_cairo_create (GTK_WIDGET (drawing_area)->window); + + cairo_identity_matrix (cr); + cairo_translate (cr, MINI_PREVIEW_CANVAS_PIXELS/2, MINI_PREVIEW_CANVAS_PIXELS/2); + cairo_scale (cr, scale, scale); + cairo_translate (cr, -w/2.0, -h/2.0); + + /* + * Shadow + */ + cairo_save (cr); + cairo_translate (cr, SHADOW_X_OFFSET/scale, SHADOW_Y_OFFSET/scale); + gl_cairo_label_path (cr, template, rotate_flag, FALSE); + + cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (shadow_color)); + cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); + cairo_fill (cr); + cairo_restore (cr); + + /* + * Label + outline + */ + gl_cairo_label_path (cr, template, rotate_flag, FALSE); + + cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (fill_color)); + cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); + cairo_fill_preserve (cr); + + cairo_set_line_width (cr, LINE_WIDTH_PIXELS/scale); + cairo_set_source_rgb (cr, GL_COLOR_RGB_ARGS (line_color)); + cairo_stroke (cr); + + + cairo_destroy (cr); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Expose handler. */ +/*--------------------------------------------------------------------------*/ +static gboolean +expose_cb (GtkWidget *drawingarea, GdkEventExpose *event, gpointer user_data) +{ + glWdgtRotateLabel *rotate_label = GL_WDGT_ROTATE_LABEL (user_data); + + drawingarea_update (GTK_DRAWING_AREA (drawingarea), + rotate_label->priv->template, + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rotate_label->priv->rotate_check))); + + return FALSE; +} + +/****************************************************************************/ +/* query state of widget. */ +/****************************************************************************/ +gboolean +gl_wdgt_rotate_label_get_state (glWdgtRotateLabel *rotate_label) +{ + return + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (rotate_label->priv->rotate_check)); +} + +/****************************************************************************/ +/* set state of widget. */ +/****************************************************************************/ +void +gl_wdgt_rotate_label_set_state (glWdgtRotateLabel *rotate_label, + gboolean state) +{ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (rotate_label->priv->rotate_check), state); +} + +/****************************************************************************/ +/* set template for widget. */ +/****************************************************************************/ +void +gl_wdgt_rotate_label_set_template_name (glWdgtRotateLabel *rotate_label, + gchar *name) +{ + lglTemplate *template; + const lglTemplateFrame *frame; + gdouble raw_w, raw_h; + + if (name == NULL) + { + rotate_label->priv->template = NULL; + + gtk_widget_set_sensitive (rotate_label->priv->rotate_check, + FALSE); + + drawingarea_update (GTK_DRAWING_AREA (rotate_label->priv->rotate_drawingarea), + NULL, + FALSE); + } + else + { + template = lgl_db_lookup_template_from_name (name); + frame = (lglTemplateFrame *)template->frames->data; + + rotate_label->priv->template = template; + lgl_template_frame_get_size (frame, &raw_w, &raw_h); + + gtk_widget_set_sensitive (rotate_label->priv->rotate_check, + (raw_w != raw_h)); + + drawingarea_update (GTK_DRAWING_AREA (rotate_label->priv->rotate_drawingarea), + rotate_label->priv->template, + FALSE); + } + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (rotate_label->priv->rotate_check), FALSE); +} + diff --git a/src/wdgt-rotate-label.h b/src/wdgt-rotate-label.h new file mode 100644 index 00000000..3d8b412e --- /dev/null +++ b/src/wdgt-rotate-label.h @@ -0,0 +1,74 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * wdgt_rotate_label.h: label rotate selection widget module header file + * + * Copyright (C) 2001-2006 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __WDGT_ROTATE_LABEL_H__ +#define __WDGT_ROTATE_LABEL_H__ + +#include + +G_BEGIN_DECLS + +#define GL_TYPE_WDGT_ROTATE_LABEL (gl_wdgt_rotate_label_get_type ()) +#define GL_WDGT_ROTATE_LABEL(obj) \ + (GTK_CHECK_CAST((obj), GL_TYPE_WDGT_ROTATE_LABEL, glWdgtRotateLabel )) +#define GL_WDGT_ROTATE_LABEL_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WDGT_ROTATE_LABEL, glWdgtRotateLabelClass)) +#define GL_IS_WDGT_ROTATE_LABEL(obj) \ + (GTK_CHECK_TYPE ((obj), GL_TYPE_WDGT_ROTATE_LABEL)) +#define GL_IS_WDGT_ROTATE_LABEL_CLASS(klass) \ + (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WDGT_ROTATE_LABEL)) + +typedef struct _glWdgtRotateLabel glWdgtRotateLabel; +typedef struct _glWdgtRotateLabelClass glWdgtRotateLabelClass; + +typedef struct _glWdgtRotateLabelPrivate glWdgtRotateLabelPrivate; + +struct _glWdgtRotateLabel { + GtkVBox parent_widget; + + glWdgtRotateLabelPrivate *priv; +}; + +struct _glWdgtRotateLabelClass { + GtkVBoxClass parent_class; + + void (*changed) (glWdgtRotateLabel *wdgt_rotate_label, + gpointer user_data); +}; + +GType gl_wdgt_rotate_label_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_wdgt_rotate_label_new (void); + +gboolean gl_wdgt_rotate_label_get_state (glWdgtRotateLabel *rotate_label); + +void gl_wdgt_rotate_label_set_state (glWdgtRotateLabel *rotate_label, + gboolean state); + +void gl_wdgt_rotate_label_set_template_name (glWdgtRotateLabel *rotate_label, + gchar *name); + +G_END_DECLS + +#endif diff --git a/src/window.c b/src/window.c new file mode 100644 index 00000000..33e3b7e7 --- /dev/null +++ b/src/window.c @@ -0,0 +1,616 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * window.c: a gLabels app window + * + * Copyright (C) 2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "window.h" + +#include +#include +#include +#include +#include +#include + +#include "ui.h" +#include "ui-commands.h" +#include "util.h" +#include "xml-label.h" +#include "prefs.h" +#include "file.h" + +#include "debug.h" + +/*===========================================================================*/ +/* Private macros and constants. */ +/*===========================================================================*/ + +#define DEFAULT_WINDOW_WIDTH 788 +#define DEFAULT_WINDOW_HEIGHT 600 + +#define CURSOR_INFO_WIDTH 150 +#define ZOOM_INFO_WIDTH 50 + +/*===========================================================================*/ +/* Private globals */ +/*===========================================================================*/ + +static GList *window_list = NULL; + + +/*===========================================================================*/ +/* Local function prototypes */ +/*===========================================================================*/ + +static void gl_window_finalize (GObject *object); +static void gl_window_destroy (GtkObject *gtk_object); + +static void set_window_title (glWindow *window, + glLabel *label); + +static gboolean window_delete_event_cb (glWindow *window, + GdkEvent *event, + gpointer user_data); + +static void selection_changed_cb (glView *view, + glWindow *window); + +static void context_menu_activate_cb (glView *view, + gint button, + guint32 activate_time, + glWindow *window); + +static void zoom_changed_cb (glView *view, + gdouble zoom, + glWindow *window); + +static void pointer_moved_cb (glView *view, + gdouble x, + gdouble y, + glWindow *window); + +static void pointer_exit_cb (glView *view, + glWindow *window); + +static void name_changed_cb (glLabel *label, + glWindow *window); + +static void modified_changed_cb (glLabel *label, + glWindow *window); + + +/****************************************************************************/ +/* Boilerplate Object stuff. */ +/****************************************************************************/ +G_DEFINE_TYPE (glWindow, gl_window, GTK_TYPE_WINDOW); + + +static void +gl_window_class_init (glWindowClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (class); + + gl_debug (DEBUG_WINDOW, "START"); + + gl_window_parent_class = g_type_class_peek_parent (class); + + object_class->finalize = gl_window_finalize; + + gtk_object_class->destroy = gl_window_destroy; + + gl_debug (DEBUG_WINDOW, "END"); +} + +static void +gl_window_init (glWindow *window) +{ + GtkWidget *vbox1; + GtkUIManager *ui; + GtkWidget *status_hbox; + + gl_debug (DEBUG_WINDOW, "START"); + + vbox1 = gtk_vbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (window), vbox1); + + window->ui = ui = gl_ui_new (window); + gtk_box_pack_start (GTK_BOX (vbox1), + gtk_ui_manager_get_widget (ui, "/MenuBar"), + FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox1), + gtk_ui_manager_get_widget (ui, "/MainToolBar"), + FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox1), + gtk_ui_manager_get_widget (ui, "/DrawingToolBar"), + FALSE, FALSE, 0); + + window->hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox1), window->hbox, TRUE, TRUE, 0); + + window->sidebar = GL_UI_SIDEBAR (gl_ui_sidebar_new ()); + gtk_box_pack_end (GTK_BOX (window->hbox), GTK_WIDGET (window->sidebar), FALSE, FALSE, 0); + + window->property_bar = GL_UI_PROPERTY_BAR (gl_ui_property_bar_new ()); + gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (window->property_bar), FALSE, FALSE, 0); + + status_hbox = gtk_hbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox1), status_hbox, FALSE, FALSE, 0); + + window->status_bar = gtk_statusbar_new (); + gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (window->status_bar), FALSE); + gtk_box_pack_start (GTK_BOX (status_hbox), + window->status_bar, + TRUE, TRUE, 0); + window->zoom_info = gtk_label_new (NULL); + gtk_widget_set_size_request (window->zoom_info, ZOOM_INFO_WIDTH, -1); + window->zoom_info_frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME(window->zoom_info_frame), GTK_SHADOW_IN); + gtk_container_add (GTK_CONTAINER(window->zoom_info_frame), window->zoom_info); + gtk_widget_show_all (window->zoom_info_frame); + gtk_box_pack_end (GTK_BOX (status_hbox), + window->zoom_info_frame, + FALSE, FALSE, 0); + + window->cursor_info = gtk_label_new (NULL); + gtk_widget_set_size_request (window->cursor_info, CURSOR_INFO_WIDTH, -1); + window->cursor_info_frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME(window->cursor_info_frame), GTK_SHADOW_IN); + gtk_container_add (GTK_CONTAINER(window->cursor_info_frame), window->cursor_info); + gtk_widget_show_all (window->cursor_info_frame); + gtk_box_pack_end (GTK_BOX (status_hbox), + window->cursor_info_frame, + FALSE, FALSE, 0); + + gtk_window_set_default_size (GTK_WINDOW (window), + DEFAULT_WINDOW_WIDTH, + DEFAULT_WINDOW_HEIGHT); + + g_signal_connect (G_OBJECT(window), "delete-event", + G_CALLBACK(window_delete_event_cb), NULL); + + window->menu_tips_context_id = + gtk_statusbar_get_context_id (GTK_STATUSBAR (window->status_bar), "menu_tips"); + + window->print_settings = NULL; + window->merge_dialog = NULL; + window->context_menu = GTK_MENU (gtk_ui_manager_get_widget (ui, "/ContextMenu")); + window->empty_selection_context_menu = + GTK_MENU (gtk_ui_manager_get_widget (ui, "/EmptySelectionContextMenu")); + + window->view = NULL; + + window_list = g_list_append (window_list, window); + + gl_debug (DEBUG_WINDOW, "END"); +} + +static void +gl_window_finalize (GObject *object) +{ + gl_debug (DEBUG_WINDOW, "START"); + + g_return_if_fail (object != NULL); + g_return_if_fail (GL_IS_WINDOW (object)); + + G_OBJECT_CLASS (gl_window_parent_class)->finalize (object); + + gl_debug (DEBUG_WINDOW, "END"); +} + +static void +gl_window_destroy (GtkObject *gtk_object) +{ + glWindow *window; + + gl_debug (DEBUG_WINDOW, "START"); + + g_return_if_fail (gtk_object != NULL); + g_return_if_fail (GL_IS_WINDOW (gtk_object)); + + window = GL_WINDOW (gtk_object); + window_list = g_list_remove (window_list, window); + + if (window->ui) { + gl_ui_unref(window->ui); + window->ui = NULL; + } + + if (GTK_OBJECT_CLASS (gl_window_parent_class)->destroy) { + GTK_OBJECT_CLASS (gl_window_parent_class)->destroy (gtk_object); + } + + gl_debug (DEBUG_WINDOW, "END"); +} + + +/****************************************************************************/ +/** Create a glabels window. */ +/****************************************************************************/ +GtkWidget * +gl_window_new (void) +{ + glWindow *window; + + gl_debug (DEBUG_WINDOW, "START"); + + window = g_object_new (GL_TYPE_WINDOW, + "title", _("(none) - gLabels"), + NULL); + + gl_debug (DEBUG_WINDOW, "window=%p", window); + gl_debug (DEBUG_WINDOW, "view=%p", window->view); + + gl_debug (DEBUG_WINDOW, "END"); + + return GTK_WIDGET(window); +} + +/****************************************************************************/ +/** Create a glabels window from a label. */ +/****************************************************************************/ +GtkWidget* +gl_window_new_from_label (glLabel *label) +{ + glWindow *window; + + gl_debug (DEBUG_WINDOW, "START"); + + window = GL_WINDOW (gl_window_new ()); + + gl_window_set_label (window, label); + + gl_debug (DEBUG_WINDOW, "END"); + + return GTK_WIDGET(window); +} + +/****************************************************************************/ +/** Create a glabels window from a glabels file. */ +/****************************************************************************/ +GtkWidget* +gl_window_new_from_file (const gchar *filename) +{ + glWindow *window; + glLabel *label; + gchar *abs_filename; + glXMLLabelStatus status; + + gl_debug (DEBUG_WINDOW, "START"); + + window = GL_WINDOW (gl_window_new ()); + + abs_filename = gl_util_make_absolute (filename); + label = gl_xml_label_open (abs_filename, &status); + g_free (abs_filename); + + gl_window_set_label (window, label); + + gl_debug (DEBUG_WINDOW, "END"); + + return GTK_WIDGET(window); +} + +/****************************************************************************/ +/** Is window empty? */ +/****************************************************************************/ +gboolean +gl_window_is_empty (glWindow *window) +{ + g_return_val_if_fail (GL_IS_WINDOW (window), FALSE); + + gl_debug (DEBUG_WINDOW, "return %d", (window->view == NULL) ); + return ( window->view == NULL ); +} + +/****************************************************************************/ +/** Create view from label and place in window. */ +/****************************************************************************/ +void +gl_window_set_label (glWindow *window, + glLabel *label) +{ + gchar *string; + + gl_debug (DEBUG_WINDOW, "START"); + + g_return_if_fail (GL_IS_WINDOW (window)); + g_return_if_fail (GL_IS_LABEL (label)); + + gl_label_clear_modified (label); + + set_window_title (window, label); + + if ( window->view != NULL ) { + gtk_widget_destroy (window->view); + window->view = NULL; + } + + window->view = gl_view_new (label); + gtk_box_pack_start (GTK_BOX (window->hbox), window->view,TRUE, TRUE, 0); + + gtk_widget_show_all (window->view); + + gl_view_zoom_to_fit (GL_VIEW(window->view)); + + if (gl_prefs->grid_visible) { + gl_view_show_grid (GL_VIEW(window->view)); + } else { + gl_view_hide_grid (GL_VIEW(window->view)); + } + + if (gl_prefs->markup_visible) { + gl_view_show_markup (GL_VIEW(window->view)); + } else { + gl_view_hide_markup (GL_VIEW(window->view)); + } + + gl_ui_update_all (window->ui, GL_VIEW(window->view)); + + gl_ui_property_bar_set_view (window->property_bar, GL_VIEW(window->view)); + gl_ui_sidebar_set_view (window->sidebar, GL_VIEW(window->view)); + + string = g_strdup_printf ("%3.0f%%", + 100.0*gl_view_get_zoom (GL_VIEW(window->view))); + gtk_label_set_text (GTK_LABEL(window->zoom_info), string); + g_free (string); + + g_signal_connect (G_OBJECT(window->view), "selection_changed", + G_CALLBACK(selection_changed_cb), window); + + g_signal_connect (G_OBJECT(window->view), "context_menu_activate", + G_CALLBACK(context_menu_activate_cb), window); + + g_signal_connect (G_OBJECT(window->view), "zoom_changed", + G_CALLBACK(zoom_changed_cb), window); + + g_signal_connect (G_OBJECT(window->view), "pointer_moved", + G_CALLBACK(pointer_moved_cb), window); + + g_signal_connect (G_OBJECT(window->view), "pointer_exit", + G_CALLBACK(pointer_exit_cb), window); + + g_signal_connect (G_OBJECT(label), "name_changed", + G_CALLBACK(name_changed_cb), window); + + g_signal_connect (G_OBJECT(label), "modified_changed", + G_CALLBACK(modified_changed_cb), window); + + gl_debug (DEBUG_WINDOW, "END"); +} + +/****************************************************************************/ +/** Return list of glabels windows. */ +/****************************************************************************/ +const GList * +gl_window_get_window_list (void) +{ + gl_debug (DEBUG_WINDOW, ""); + return window_list; +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. Set window title based on name and state of label. */ +/*---------------------------------------------------------------------------*/ +static void +set_window_title (glWindow *window, + glLabel *label) +{ + gchar *name, *title; + + gl_debug (DEBUG_WINDOW, "START"); + + g_return_if_fail (window && GL_IS_WINDOW (window)); + g_return_if_fail (label && GL_IS_LABEL (label)); + + name = gl_label_get_short_name (label); + g_return_if_fail (name != NULL); + + if (gl_label_is_modified (label)) { + title = g_strdup_printf ("%s %s - gLabels", + name, _("(modified)")); + } else { + title = g_strdup_printf ("%s - gLabels", name); + } + + gtk_window_set_title (GTK_WINDOW(window), title); + + g_free (name); + g_free (title); + + gl_debug (DEBUG_WINDOW, "END"); +} + +/*-------------------------------------------------------------------------*/ +/** PRIVATE. Window "delete-event" callback. */ +/*-------------------------------------------------------------------------*/ +static gboolean +window_delete_event_cb (glWindow *window, + GdkEvent *event, + gpointer user_data) +{ + gl_debug (DEBUG_WINDOW, "START"); + + g_return_val_if_fail (window && GL_IS_WINDOW (window), TRUE); + + gl_file_close (window); + + gl_debug (DEBUG_WINDOW, "END"); + + return TRUE; +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. View "selection state changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +selection_changed_cb (glView *view, + glWindow *window) +{ + gl_debug (DEBUG_WINDOW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (window && GL_IS_WINDOW (window)); + + gl_ui_update_selection_verbs (window->ui, view); + + gl_debug (DEBUG_WINDOW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. View "context menu activate" callback. */ +/*---------------------------------------------------------------------------*/ +static void +context_menu_activate_cb (glView *view, + gint button, + guint32 activate_time, + glWindow *window) +{ + gl_debug (DEBUG_WINDOW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (window && GL_IS_WINDOW (window)); + + if (gl_view_is_selection_empty (view)) { + + gtk_menu_popup (GTK_MENU (window->empty_selection_context_menu), + NULL, NULL, NULL, NULL, button, activate_time); + + } else { + + gtk_menu_popup (GTK_MENU (window->context_menu), + NULL, NULL, NULL, NULL, button, activate_time); + + } + + gl_debug (DEBUG_WINDOW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. View "zoom state changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +zoom_changed_cb (glView *view, + gdouble zoom, + glWindow *window) +{ + gchar *string; + + gl_debug (DEBUG_WINDOW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (window && GL_IS_WINDOW (window)); + + string = g_strdup_printf ("%3.0f%%", 100.0*zoom); + gtk_label_set_text (GTK_LABEL(window->zoom_info), string); + g_free (string); + + gl_ui_update_zoom_verbs (window->ui, view); + + gl_debug (DEBUG_WINDOW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. View "pointer moved" callback. */ +/*---------------------------------------------------------------------------*/ +static void +pointer_moved_cb (glView *view, + gdouble x, + gdouble y, + glWindow *window) +{ + gchar *string; + gdouble units_per_point; + gint units_precision; + + gl_debug (DEBUG_WINDOW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (window && GL_IS_WINDOW (window)); + + units_per_point = gl_prefs_get_units_per_point (); + units_precision = gl_prefs_get_units_precision (); + + string = g_strdup_printf ("%.*f, %.*f", + units_precision, x*units_per_point, + units_precision, y*units_per_point); + gtk_label_set_text (GTK_LABEL(window->cursor_info), string); + g_free (string); + + gl_debug (DEBUG_WINDOW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. View "pointer exit" callback. */ +/*---------------------------------------------------------------------------*/ +static void +pointer_exit_cb (glView *view, + glWindow *window) +{ + gl_debug (DEBUG_WINDOW, "START"); + + g_return_if_fail (view && GL_IS_VIEW (view)); + g_return_if_fail (window && GL_IS_WINDOW (window)); + + gtk_label_set_text (GTK_LABEL(window->cursor_info), ""); + + gl_debug (DEBUG_WINDOW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. Label "name changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +name_changed_cb (glLabel *label, + glWindow *window) +{ + gl_debug (DEBUG_WINDOW, "START"); + + g_return_if_fail (label && GL_IS_LABEL (label)); + g_return_if_fail (window && GL_IS_WINDOW (window)); + + set_window_title (window, label); + + gl_debug (DEBUG_WINDOW, "END"); +} + +/*---------------------------------------------------------------------------*/ +/** PRIVATE. Label "modified state changed" callback. */ +/*---------------------------------------------------------------------------*/ +static void +modified_changed_cb (glLabel *label, + glWindow *window) +{ + gl_debug (DEBUG_WINDOW, "START"); + + g_return_if_fail (label && GL_IS_LABEL (label)); + g_return_if_fail (window && GL_IS_WINDOW (window)); + + set_window_title (window, label); + + gl_ui_update_modified_verbs (window->ui, label); + + gl_debug (DEBUG_WINDOW, "END"); +} + diff --git a/src/window.h b/src/window.h new file mode 100644 index 00000000..e5a63ab1 --- /dev/null +++ b/src/window.h @@ -0,0 +1,101 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * window.h: a gLabels app window + * + * Copyright (C) 2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __WINDOW_H__ +#define __WINDOW_H__ + +#include +#include +#include + +#include "view.h" +#include "label.h" +#include "ui-property-bar.h" +#include "ui-sidebar.h" +#include "print-op.h" +#include "merge-properties-dialog.h" + +G_BEGIN_DECLS + +#define GL_TYPE_WINDOW (gl_window_get_type ()) +#define GL_WINDOW(obj) \ + (GTK_CHECK_CAST((obj), GL_TYPE_WINDOW, glWindow )) +#define GL_WINDOW_CLASS(klass) \ + (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WINDOW, glWindowClass)) +#define GL_IS_WINDOW(obj) \ + (GTK_CHECK_TYPE ((obj), GL_TYPE_WINDOW)) +#define GL_IS_WINDOW_CLASS(klass) \ + (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WINDOW)) + +typedef struct _glWindow glWindow; +typedef struct _glWindowClass glWindowClass; + +struct _glWindow { + GtkWindow parent_widget; + + GtkUIManager *ui; + + GtkWidget *view; + + GtkWidget *hbox; + + glUIPropertyBar *property_bar; + glUISidebar *sidebar; + + GtkWidget *status_bar; + GtkWidget *cursor_info; + GtkWidget *cursor_info_frame; + GtkWidget *zoom_info; + GtkWidget *zoom_info_frame; + + guint menu_tips_context_id; + + glPrintOpSettings *print_settings; + glMergePropertiesDialog *merge_dialog; + GtkMenu *context_menu; + GtkMenu *empty_selection_context_menu; +}; + +struct _glWindowClass { + GtkWindowClass parent_class; +}; + +GType gl_window_get_type (void) G_GNUC_CONST; + +GtkWidget *gl_window_new (void); + +GtkWidget *gl_window_new_from_file (const gchar *filename); + +GtkWidget *gl_window_new_from_label (glLabel *label); + +gboolean gl_window_is_empty (glWindow *window); + +void gl_window_set_label (glWindow *window, + glLabel *label); + +const GList *gl_window_get_window_list (void); + +G_END_DECLS + +#endif /* __WINDOW_H__ */ diff --git a/src/xml-label-04.c b/src/xml-label-04.c new file mode 100644 index 00000000..89a94b6b --- /dev/null +++ b/src/xml-label-04.c @@ -0,0 +1,504 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * xml-label-04.c: GLabels xml label compat module + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "xml-label-04.h" + +#include + +#include "label-text.h" +#include "label-box.h" +#include "label-line.h" +#include "label-ellipse.h" +#include "label-image.h" +#include "label-barcode.h" +#include +#include + +#include "util.h" +#include "debug.h" + +static gboolean xml04_parse_media_description (xmlNodePtr node, + glLabel *label); +static void xml04_parse_object (xmlNodePtr node, + glLabelObject *object); +static void xml04_parse_text_props (xmlNodePtr node, + glLabelText *object); +static void xml04_parse_box_props (xmlNodePtr node, + glLabelBox *object); +static void xml04_parse_line_props (xmlNodePtr node, + glLabelLine *object); +static void xml04_parse_ellipse_props (xmlNodePtr node, + glLabelEllipse *object); +static void xml04_parse_image_props (xmlNodePtr node, + glLabelImage *object); +static void xml04_parse_barcode_props (xmlNodePtr node, + glLabelBarcode *object); +static void xml04_parse_merge_properties (xmlNodePtr node, + glLabel *label); + + +/****************************************************************************/ +/* PRIVATE. Parse xml doc structure and create label. */ +/****************************************************************************/ +glLabel *gl_xml_label_04_parse (xmlNodePtr root, + glXMLLabelStatus *status) +{ + glLabel *label; + xmlNodePtr node; + GObject *object; + gboolean rotate_flag; + + gl_debug (DEBUG_XML, "START"); + + *status = XML_LABEL_OK; + + if (!xmlStrEqual (root->name, (xmlChar *)"Label")) { + g_message (_("Bad root node = \"%s\""), root->name); + *status = XML_LABEL_ERROR_OPEN_PARSE; + return NULL; + } + + label = GL_LABEL (gl_label_new ()); + + rotate_flag = lgl_xml_get_prop_boolean (root, "rotate", FALSE); + gl_label_set_rotate_flag (label, rotate_flag); + + for (node = root->xmlChildrenNode; node != NULL; node = node->next) { + + gl_debug (DEBUG_XML, "node name = \"%s\"", node->name); + + if (!xmlNodeIsText (node)) { + if (xmlStrEqual (node->name, (xmlChar *)"Media_Type")) { + if (!xml04_parse_media_description (node, label)) { + *status = XML_LABEL_UNKNOWN_MEDIA; + } + } else if (xmlStrEqual (node->name, (xmlChar *)"Text")) { + object = gl_label_text_new (label); + xml04_parse_object (node, GL_LABEL_OBJECT(object)); + xml04_parse_text_props (node, GL_LABEL_TEXT(object)); + } else if (xmlStrEqual (node->name, (xmlChar *)"Box")) { + object = gl_label_box_new (label); + xml04_parse_object (node, GL_LABEL_OBJECT(object)); + xml04_parse_box_props (node, GL_LABEL_BOX(object)); + } else if (xmlStrEqual (node->name, (xmlChar *)"Line")) { + object = gl_label_line_new (label); + xml04_parse_object (node, GL_LABEL_OBJECT(object)); + xml04_parse_line_props (node, GL_LABEL_LINE(object)); + } else if (xmlStrEqual (node->name, (xmlChar *)"Ellipse")) { + object = gl_label_ellipse_new (label); + xml04_parse_object (node, GL_LABEL_OBJECT(object)); + xml04_parse_ellipse_props (node, + GL_LABEL_ELLIPSE(object)); + } else if (xmlStrEqual (node->name, (xmlChar *)"Image")) { + object = gl_label_image_new (label); + xml04_parse_object (node, GL_LABEL_OBJECT(object)); + xml04_parse_image_props (node, GL_LABEL_IMAGE(object)); + } else if (xmlStrEqual (node->name, (xmlChar *)"Barcode")) { + object = gl_label_barcode_new (label); + xml04_parse_object (node, GL_LABEL_OBJECT(object)); + xml04_parse_barcode_props (node, + GL_LABEL_BARCODE(object)); + } else if (xmlStrEqual (node->name, (xmlChar *)"Merge_Properties")) { + xml04_parse_merge_properties (node, label); + } else { + g_message (_("bad node = \"%s\""), node->name); + } + } + } + + gl_debug (DEBUG_XML, "END"); + + return label; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse Media Description node. */ +/*--------------------------------------------------------------------------*/ +static gboolean +xml04_parse_media_description (xmlNodePtr node, + glLabel *label) +{ + xmlChar *template_name; + lglTemplate *template; + gboolean ret; + + gl_debug (DEBUG_XML, "START"); + + template_name = xmlNodeGetContent (node); + + template = lgl_db_lookup_template_from_name ((gchar *)template_name); + if (template == NULL) { + g_message ("Undefined template \"%s\"", template_name); + /* Get a default */ + template = lgl_db_lookup_template_from_name (NULL); + ret = FALSE; + } else { + ret = TRUE; + } + + gl_label_set_template (label, template); + + lgl_template_free (template); + xmlFree (template_name); + + gl_debug (DEBUG_XML, "END"); + + return ret; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Object Node */ +/*--------------------------------------------------------------------------*/ +static void +xml04_parse_object (xmlNodePtr object_node, + glLabelObject *object) +{ + gdouble x, y; + + gl_debug (DEBUG_XML, "START"); + + x = lgl_xml_get_prop_double (object_node, "x", 0); + y = lgl_xml_get_prop_double (object_node, "y", 0); + + gl_label_object_set_position (object, x, y); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Label->Text Node Properties */ +/*--------------------------------------------------------------------------*/ +static void +xml04_parse_text_props (xmlNodePtr object_node, + glLabelText *object) +{ + xmlChar *font_family; + gdouble font_size; + PangoWeight font_weight; + gboolean font_italic_flag; + glColorNode *color_node; + PangoAlignment align; + xmlNodePtr line_node, text_node; + glTextNode *node_text; + GList *nodes, *lines; + gdouble w, h, x, y; + xmlChar *string; + + gl_debug (DEBUG_XML, "START"); + + font_family = xmlGetProp (object_node, (xmlChar *)"font_family"); + font_size = lgl_xml_get_prop_double (object_node, "font_size", 0); + string = xmlGetProp (object_node, (xmlChar *)"font_weight"); + font_weight = gl_util_string_to_weight ((gchar *)string); + xmlFree (string); + font_italic_flag = lgl_xml_get_prop_boolean (object_node, "font_italic", FALSE); + + string = xmlGetProp (object_node, (xmlChar *)"justify"); + align = gl_util_string_to_align ((gchar *)string); + xmlFree (string); + + color_node = gl_color_node_new_default (); + color_node->color = lgl_xml_get_prop_uint (object_node, "color", 0); + + gl_label_object_set_font_family (GL_LABEL_OBJECT(object), (gchar *)font_family); + gl_label_object_set_font_size (GL_LABEL_OBJECT(object), font_size); + gl_label_object_set_font_weight (GL_LABEL_OBJECT(object), font_weight); + gl_label_object_set_font_italic_flag (GL_LABEL_OBJECT(object), font_italic_flag); + gl_label_object_set_text_color (GL_LABEL_OBJECT(object), color_node); + gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object), align); + + gl_color_node_free (&color_node); + + lines = NULL; + for (line_node = object_node->xmlChildrenNode; line_node != NULL; + line_node = line_node->next) { + + if (xmlStrEqual (line_node->name, (xmlChar *)"Line")) { + + gl_debug (DEBUG_XML, "->Line node"); + + nodes = NULL; + for (text_node = line_node->xmlChildrenNode; + text_node != NULL; text_node = text_node->next) { + + if (xmlStrEqual (text_node->name, (xmlChar *)"Field")) { + gl_debug (DEBUG_XML, "->Line->Field node"); + node_text = g_new0 (glTextNode, 1); + node_text->field_flag = TRUE; + node_text->data = + (gchar *)xmlGetProp (text_node, (xmlChar *)"name"); + nodes = + g_list_append (nodes, node_text); + } else if (xmlNodeIsText (text_node)) { + gl_debug (DEBUG_XML, "->Line->\"literal\" node"); + node_text = g_new0 (glTextNode, 1); + node_text->field_flag = FALSE; + node_text->data = + (gchar *)xmlNodeGetContent (text_node); + gl_debug (DEBUG_XML, "text = \"%s\"", + node_text->data); + nodes = + g_list_append (nodes, node_text); + } else { + g_message ("Unexpected Text Line child: \"%s\"", + text_node->name); + } + + } + lines = g_list_append (lines, nodes); + + } else if (!xmlNodeIsText (line_node)) { + g_message ("Unexpected Text child: \"%s\"", + line_node->name); + } + + } + + gl_label_text_set_lines (object, lines); + + gl_text_node_lines_free (&lines); + xmlFree (font_family); + + /* Adjust location. In 0.4.x, text was anchored at x,y */ + gl_label_object_get_position (GL_LABEL_OBJECT(object), &x, &y); + gl_label_object_get_size (GL_LABEL_OBJECT(object), &w, &h); + switch (align) { + case PANGO_ALIGN_LEFT: + /* nothing */ + break; + case PANGO_ALIGN_CENTER: + x -= w/2.0; + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + break; + case PANGO_ALIGN_RIGHT: + x -= w; + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + break; + default: + /* should not happen */ + break; + } + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Label->Box Node Properties */ +/*--------------------------------------------------------------------------*/ +static void +xml04_parse_box_props (xmlNodePtr node, + glLabelBox *object) +{ + gdouble w, h, line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; + + gl_debug (DEBUG_XML, "START"); + + w = lgl_xml_get_prop_double (node, "w", 0); + h = lgl_xml_get_prop_double (node, "h", 0); + + line_width = lgl_xml_get_prop_double (node, "line_width", 0); + + line_color_node = gl_color_node_new_default (); + line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); + + fill_color_node = gl_color_node_new_default (); + fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0); + + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); + gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); + gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color_node); + + gl_color_node_free (&line_color_node); + gl_color_node_free (&fill_color_node); + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Label->Line Node Properties */ +/*--------------------------------------------------------------------------*/ +static void +xml04_parse_line_props (xmlNodePtr node, + glLabelLine *object) +{ + gdouble w, h, line_width; + glColorNode *line_color_node; + + gl_debug (DEBUG_XML, "START"); + + w = lgl_xml_get_prop_double (node, "dx", 0); + h = lgl_xml_get_prop_double (node, "dy", 0); + + line_width = lgl_xml_get_prop_double (node, "line_width", 0); + + line_color_node = gl_color_node_new_default (); + line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); + + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); + gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); + + gl_color_node_free (&line_color_node); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Label->Ellipse Node Properties */ +/*--------------------------------------------------------------------------*/ +static void +xml04_parse_ellipse_props (xmlNodePtr node, + glLabelEllipse *object) +{ + gdouble w, h, line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; + + gl_debug (DEBUG_XML, "START"); + + w = lgl_xml_get_prop_double (node, "w", 0); + h = lgl_xml_get_prop_double (node, "h", 0); + + line_width = lgl_xml_get_prop_double (node, "line_width", 0); + + line_color_node = gl_color_node_new_default (); + line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); + + fill_color_node = gl_color_node_new_default (); + fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0); + + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); + gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); + gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color_node); + + gl_color_node_free (&line_color_node); + gl_color_node_free (&fill_color_node); + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Label->Image Node Properties */ +/*--------------------------------------------------------------------------*/ +static void +xml04_parse_image_props (xmlNodePtr node, + glLabelImage *object) +{ + gdouble w, h; + glTextNode *filename; + + gl_debug (DEBUG_XML, "START"); + + filename = g_new0 (glTextNode, 1); + filename->field_flag = FALSE; + filename->data = (gchar *)xmlGetProp (node, (xmlChar *)"filename"); + gl_label_image_set_filename (object, filename); + gl_text_node_free (&filename); + + w = lgl_xml_get_prop_double (node, "w", 0); + h = lgl_xml_get_prop_double (node, "h", 0); + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Label->Barcode Node Properties */ +/*--------------------------------------------------------------------------*/ +static void +xml04_parse_barcode_props (xmlNodePtr node, + glLabelBarcode *object) +{ + xmlChar *id; + gboolean text_flag; + glColorNode *color_node; + gdouble scale; + xmlNodePtr child; + glTextNode *text_node; + + gl_debug (DEBUG_XML, "START"); + + color_node = gl_color_node_new_default (); + color_node->color = lgl_xml_get_prop_uint (node, "color", 0); + + id = xmlGetProp (node, (xmlChar *)"style"); + + text_flag = lgl_xml_get_prop_boolean (node, "text", FALSE); + scale = lgl_xml_get_prop_double (node, "scale", 1.0); + if (scale == 0.0) { + scale = 0.5; /* Set to a valid value */ + } + gl_label_barcode_set_props (object, (gchar *)id, text_flag, TRUE, 0); + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), color_node); + + child = node->xmlChildrenNode; + text_node = g_new0 (glTextNode, 1); + if (xmlStrEqual (child->name, (xmlChar *)"Field")) { + text_node->field_flag = TRUE; + text_node->data = (gchar *)xmlGetProp (child, (xmlChar *)"name"); + } else if (xmlNodeIsText (child)) { + text_node->field_flag = FALSE; + text_node->data = (gchar *)xmlNodeGetContent (child); + } else { + g_message ("Unexpected Barcode child: \"%s\"", child->name); + } + gl_label_barcode_set_data (object, text_node); + + gl_color_node_free (&color_node); + gl_text_node_free (&text_node); + xmlFree (id); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML merge properties tag. */ +/*--------------------------------------------------------------------------*/ +static void +xml04_parse_merge_properties (xmlNodePtr node, + glLabel *label) +{ + glMerge *merge; + xmlChar *string; + + gl_debug (DEBUG_XML, "START"); + + string = xmlGetProp (node, (xmlChar *)"type"); + merge = gl_merge_new ((gchar *)string); + xmlFree (string); + + string = xmlGetProp (node, (xmlChar *)"src"); + gl_merge_set_src (merge, (gchar *)string); + xmlFree (string); + + gl_label_set_merge (label, merge); + + g_object_unref (G_OBJECT(merge)); + + gl_debug (DEBUG_XML, "END"); +} diff --git a/src/xml-label-04.h b/src/xml-label-04.h new file mode 100644 index 00000000..be11bafd --- /dev/null +++ b/src/xml-label-04.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * xml-label-04.h: GLabels xml label compat module header file + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __XML_LABEL_04_H__ +#define __XML_LABEL_04_H__ + +#include +#include + +#include "xml-label.h" + +G_BEGIN_DECLS + +extern glLabel *gl_xml_label_04_parse (xmlNodePtr root, + glXMLLabelStatus *status); + +G_END_DECLS + + +#endif /* __XML_LABEL_04_H__ */ diff --git a/src/xml-label.c b/src/xml-label.c new file mode 100644 index 00000000..0f8e104c --- /dev/null +++ b/src/xml-label.c @@ -0,0 +1,1794 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * label.c: GLabels xml label module + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "xml-label.h" + +#include +#include +#include +#include +#include + +#include "label.h" +#include "label-object.h" +#include "label-text.h" +#include "label-box.h" +#include "label-line.h" +#include "label-ellipse.h" +#include "label-image.h" +#include "label-barcode.h" +#include "base64.h" +#include "xml-label-04.h" +#include +#include +#include +#include "util.h" + +#include "debug.h" + +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ +#define COMPAT01_NAME_SPACE "http://snaught.com/glabels/0.1/" +#define COMPAT04_NAME_SPACE "http://snaught.com/glabels/0.4/" +#define COMPAT20_NAME_SPACE "http://snaught.com/glabels/2.0/" + +/*========================================================*/ +/* Private types. */ +/*========================================================*/ + +/*========================================================*/ +/* Private globals. */ +/*========================================================*/ + +/*========================================================*/ +/* Private function prototypes. */ +/*========================================================*/ + +static glLabel *xml_doc_to_label (xmlDocPtr doc, + glXMLLabelStatus *status); + +static glLabel *xml_parse_label (xmlNodePtr root, + glXMLLabelStatus *status); + +static void xml_parse_objects (xmlNodePtr node, + glLabel *label); + +static void xml_parse_object_text (xmlNodePtr node, + glLabel *label); + +static void xml_parse_object_box (xmlNodePtr node, + glLabel *label); + +static void xml_parse_object_ellipse (xmlNodePtr node, + glLabel *label); + +static void xml_parse_object_line (xmlNodePtr node, + glLabel *label); + +static void xml_parse_object_image (xmlNodePtr node, + glLabel *label); + +static void xml_parse_object_barcode (xmlNodePtr node, + glLabel *label); + +static void xml_parse_merge_fields (xmlNodePtr node, + glLabel *label); + +static void xml_parse_data (xmlNodePtr node, + glLabel *label); + +static void xml_parse_pixdata (xmlNodePtr node, + glLabel *label); + +static void xml_parse_toplevel_span (xmlNodePtr node, + glLabelObject *object); + +static void xml_parse_affine_attrs (xmlNodePtr node, + glLabelObject *object); + +static void xml_parse_shadow_attrs (xmlNodePtr node, + glLabelObject *object); + +static xmlDocPtr xml_label_to_doc (glLabel *label, + glXMLLabelStatus *status); + +static void xml_create_objects (xmlNodePtr root, + xmlNsPtr ns, + glLabel *label); + +static void xml_create_object_text (xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object); + +static void xml_create_object_box (xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object); + +static void xml_create_object_line (xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object); + +static void xml_create_object_ellipse(xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object); + +static void xml_create_object_image (xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object); + +static void xml_create_object_barcode(xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object); + +static void xml_create_merge_fields (xmlNodePtr root, + xmlNsPtr ns, + glLabel *label); + +static void xml_create_data (xmlNodePtr root, + xmlNsPtr ns, + glLabel *label); + +static void xml_create_pixdata (xmlNodePtr root, + xmlNsPtr ns, + glLabel *label, + gchar *name); + +static void xml_create_toplevel_span (xmlNodePtr node, + xmlNsPtr ns, + glLabelText *object_text); + +static void xml_create_affine_attrs (xmlNodePtr node, + glLabelObject *object); + +static void xml_create_shadow_attrs (xmlNodePtr node, + glLabelObject *object); + + +/****************************************************************************/ +/* Open and read label from xml file. */ +/****************************************************************************/ +glLabel * +gl_xml_label_open (const gchar *utf8_filename, + glXMLLabelStatus *status) +{ + xmlDocPtr doc; + glLabel *label; + gchar *filename; + + gl_debug (DEBUG_XML, "START"); + + filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); + g_return_val_if_fail (filename, NULL); + + doc = xmlParseFile (filename); + if (!doc) { + g_message (_("xmlParseFile error")); + *status = XML_LABEL_ERROR_OPEN_PARSE; + return NULL; + } + + xmlXIncludeProcess (doc); + xmlReconciliateNs (doc, xmlDocGetRootElement (doc)); + + label = xml_doc_to_label (doc, status); + + xmlFreeDoc (doc); + + if (label) { + gl_label_set_filename (label, utf8_filename); + gl_label_clear_modified (label); + } + + g_free (filename); + gl_debug (DEBUG_XML, "END"); + + return label; +} + +/****************************************************************************/ +/* Read label from xml buffer. */ +/****************************************************************************/ +glLabel * +gl_xml_label_open_buffer (const gchar *buffer, + glXMLLabelStatus *status) +{ + xmlDocPtr doc; + glLabel *label; + + gl_debug (DEBUG_XML, "START"); + + doc = xmlParseDoc ((xmlChar *) buffer); + if (!doc) { + g_message (_("xmlParseFile error")); + *status = XML_LABEL_ERROR_OPEN_PARSE; + return NULL; + } + + label = xml_doc_to_label (doc, status); + + xmlFreeDoc (doc); + + if (label) { + gl_label_clear_modified (label); + } + + gl_debug (DEBUG_XML, "END"); + + return label; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse xml doc structure and create label. */ +/*--------------------------------------------------------------------------*/ +static glLabel * +xml_doc_to_label (xmlDocPtr doc, + glXMLLabelStatus *status) +{ + xmlNodePtr root; + glLabel *label; + + gl_debug (DEBUG_XML, "START"); + + LIBXML_TEST_VERSION; + + *status = XML_LABEL_OK; + + root = xmlDocGetRootElement (doc); + if (!root || !root->name) { + g_message (_("No document root")); + *status = XML_LABEL_ERROR_OPEN_PARSE; + return NULL; + } + + /* Try compatability mode 0.1 */ + if (xmlSearchNsByHref (doc, root, (xmlChar *)COMPAT01_NAME_SPACE)) + { + g_message (_("Importing from glabels 0.1 format")); + g_message ("TODO"); + label = NULL; /* TODO */ + return label; + } + + /* Try compatability mode 0.4 */ + if (xmlSearchNsByHref (doc, root, (xmlChar *)COMPAT04_NAME_SPACE)) + { + g_message (_("Importing from glabels 0.4 format")); + label = gl_xml_label_04_parse (root, status); + return label; + } + + /* Test for current namespaces. */ + if ( !xmlSearchNsByHref (doc, root, (xmlChar *)COMPAT20_NAME_SPACE) && + !xmlSearchNsByHref (doc, root, (xmlChar *)LGL_XML_NAME_SPACE) ) + { + g_message (_("Unknown glabels Namespace -- Using %s"), + LGL_XML_NAME_SPACE); + } + + label = xml_parse_label (root, status); + if (label) + { + gl_label_set_compression (label, xmlGetDocCompressMode (doc)); + } + + gl_debug (DEBUG_XML, "END"); + + return label; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse xml root node and create label. */ +/*--------------------------------------------------------------------------*/ +static glLabel * +xml_parse_label (xmlNodePtr root, + glXMLLabelStatus *status) +{ + xmlNodePtr child_node; + glLabel *label; + lglTemplate *template; + + gl_debug (DEBUG_XML, "START"); + + *status = XML_LABEL_OK; + + if (!lgl_xml_is_node (root, "Glabels-document")) { + g_message (_("Bad root node = \"%s\""), root->name); + *status = XML_LABEL_ERROR_OPEN_PARSE; + return NULL; + } + + label = GL_LABEL(gl_label_new ()); + + /* Pass 1, extract data nodes to pre-load cache. */ + for (child_node = root->xmlChildrenNode; child_node != NULL; child_node = child_node->next) { + if (lgl_xml_is_node (child_node, "Data")) { + xml_parse_data (child_node, label); + } + } + + /* Pass 2, now extract everything else. */ + for (child_node = root->xmlChildrenNode; + child_node != NULL; + child_node = child_node->next) { + + if (lgl_xml_is_node (child_node, "Template")) { + template = lgl_xml_template_parse_template_node (child_node); + if (!template) { + g_object_unref (label); + *status = XML_LABEL_UNKNOWN_MEDIA; + return NULL; + } + lgl_db_register_template (template); + gl_label_set_template (label, template); + lgl_template_free (template); + } else if (lgl_xml_is_node (child_node, "Objects")) { + xml_parse_objects (child_node, label); + } else if (lgl_xml_is_node (child_node, "Merge")) { + xml_parse_merge_fields (child_node, label); + } else if (lgl_xml_is_node (child_node, "Data")) { + /* Handled in pass 1. */ + } else { + if (!xmlNodeIsText (child_node)) { + g_message (_("bad node in Document node = \"%s\""), + child_node->name); + g_object_unref (label); + *status = XML_LABEL_ERROR_OPEN_PARSE; + return NULL; + } + } + } + + gl_debug (DEBUG_XML, "END"); + + return label; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse Objects node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_objects (xmlNodePtr node, + glLabel *label) +{ + gboolean rotate_flag; + xmlNodePtr child; + + gl_debug (DEBUG_XML, "START"); + + rotate_flag = lgl_xml_get_prop_boolean (node, "rotate", FALSE); + gl_label_set_rotate_flag (label, rotate_flag); + + for (child = node->xmlChildrenNode; child != NULL; child = child->next) { + + if (lgl_xml_is_node (child, "Object-text")) { + xml_parse_object_text (child, label); + } else if (lgl_xml_is_node (child, "Object-box")) { + xml_parse_object_box (child, label); + } else if (lgl_xml_is_node (child, "Object-ellipse")) { + xml_parse_object_ellipse (child, label); + } else if (lgl_xml_is_node (child, "Object-line")) { + xml_parse_object_line (child, label); + } else if (lgl_xml_is_node (child, "Object-image")) { + xml_parse_object_image (child, label); + } else if (lgl_xml_is_node (child, "Object-barcode")) { + xml_parse_object_barcode (child, label); + } else { + if (!xmlNodeIsText (child)) { + g_message (_("bad node = \"%s\""), child->name); + break; + } + } + } + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Objects->Object-text Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_object_text (xmlNodePtr node, + glLabel *label) +{ + GObject *object; + gdouble x, y; + gdouble w, h; + gchar *string; + PangoAlignment align; + gboolean auto_shrink; + xmlNodePtr child; + + gl_debug (DEBUG_XML, "START"); + + object = gl_label_text_new (label); + + /* position attrs */ + x = lgl_xml_get_prop_length (node, "x", 0.0); + y = lgl_xml_get_prop_length (node, "y", 0.0); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + + /* implied size attrs */ + w = lgl_xml_get_prop_length (node, "w", 0); + h = lgl_xml_get_prop_length (node, "h", 0); + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); + + /* justify attr */ + string = lgl_xml_get_prop_string (node, "justify", NULL); + align = gl_util_string_to_align (string); + g_free (string); + gl_label_object_set_text_alignment (GL_LABEL_OBJECT(object), align); + + /* auto_shrink attr */ + auto_shrink = lgl_xml_get_prop_boolean (node, "auto_shrink", FALSE); + gl_label_text_set_auto_shrink (GL_LABEL_TEXT(object), auto_shrink); + + /* affine attrs */ + xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); + + /* shadow attrs */ + xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); + + /* Process children */ + for (child = node->xmlChildrenNode; child != NULL; child = child->next) { + if (lgl_xml_is_node (child, "Span")) { + xml_parse_toplevel_span (child, GL_LABEL_OBJECT(object)); + break; + } else { + if (!xmlNodeIsText (child)) { + g_message ("Unexpected Object-text child: \"%s\"", + child->name); + } + } + } + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Objects->Object-box Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_object_box (xmlNodePtr node, + glLabel *label) +{ + GObject *object; + gdouble x, y; + gdouble w, h; + gdouble line_width; + glColorNode *line_color_node; + gchar *string; + glColorNode *fill_color_node; + + gl_debug (DEBUG_XML, "START"); + + object = gl_label_box_new (label); + + /* position attrs */ + x = lgl_xml_get_prop_length (node, "x", 0.0); + y = lgl_xml_get_prop_length (node, "y", 0.0); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + + /* size attrs */ + w = lgl_xml_get_prop_length (node, "w", 0); + h = lgl_xml_get_prop_length (node, "h", 0); + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); + + /* line attrs */ + line_width = lgl_xml_get_prop_length (node, "line_width", 1.0); + gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); + + line_color_node = gl_color_node_new_default (); + string = lgl_xml_get_prop_string (node, "line_color_field", NULL); + if ( string ) { + line_color_node->field_flag = TRUE; + line_color_node->key = string; + } else { + line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); + } + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); + gl_color_node_free (&line_color_node); + + + /* fill attrs */ + fill_color_node = gl_color_node_new_default (); + string = lgl_xml_get_prop_string (node, "fill_color_field", NULL); + if ( string ) { + fill_color_node->field_flag = TRUE; + fill_color_node->key = string; + } else { + fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0); + } + gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color_node); + gl_color_node_free (&fill_color_node); + + /* affine attrs */ + xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); + + /* shadow attrs */ + xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Objects->Object-ellipse Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_object_ellipse (xmlNodePtr node, + glLabel *label) +{ + GObject *object; + gdouble x, y; + gdouble w, h; + gdouble line_width; + glColorNode *line_color_node; + gchar *string; + glColorNode *fill_color_node; + + gl_debug (DEBUG_XML, "START"); + + object = gl_label_ellipse_new (label); + + /* position attrs */ + x = lgl_xml_get_prop_length (node, "x", 0.0); + y = lgl_xml_get_prop_length (node, "y", 0.0); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + + /* size attrs */ + w = lgl_xml_get_prop_length (node, "w", 0); + h = lgl_xml_get_prop_length (node, "h", 0); + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); + + /* line attrs */ + line_width = lgl_xml_get_prop_length (node, "line_width", 1.0); + gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); + + line_color_node = gl_color_node_new_default (); + string = lgl_xml_get_prop_string (node, "line_color_field", NULL); + if ( string ) { + line_color_node->field_flag = TRUE; + line_color_node->key = string; + } else { + line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); + } + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); + gl_color_node_free (&line_color_node); + + + /* fill attrs */ + fill_color_node = gl_color_node_new_default (); + string = lgl_xml_get_prop_string (node, "fill_color_field", NULL); + if ( string ) { + fill_color_node->field_flag = TRUE; + fill_color_node->key = string; + } else { + fill_color_node->color = lgl_xml_get_prop_uint (node, "fill_color", 0); + } + gl_label_object_set_fill_color (GL_LABEL_OBJECT(object), fill_color_node); + gl_color_node_free (&fill_color_node); + + /* affine attrs */ + xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); + + /* shadow attrs */ + xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Objects->Object-line Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_object_line (xmlNodePtr node, + glLabel *label) +{ + GObject *object; + gdouble x, y; + gdouble dx, dy; + gdouble line_width; + glColorNode *line_color_node; + gchar *string; + + gl_debug (DEBUG_XML, "START"); + + object = gl_label_line_new (label); + + /* position attrs */ + x = lgl_xml_get_prop_length (node, "x", 0.0); + y = lgl_xml_get_prop_length (node, "y", 0.0); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + + /* length attrs */ + dx = lgl_xml_get_prop_length (node, "dx", 0); + dy = lgl_xml_get_prop_length (node, "dy", 0); + gl_label_object_set_size (GL_LABEL_OBJECT(object), dx, dy); + + /* line attrs */ + line_width = lgl_xml_get_prop_length (node, "line_width", 1.0); + gl_label_object_set_line_width (GL_LABEL_OBJECT(object), line_width); + + line_color_node = gl_color_node_new_default (); + string = lgl_xml_get_prop_string (node, "line_color_field", NULL); + if ( string ) { + line_color_node->field_flag = TRUE; + line_color_node->key = string; + } else { + line_color_node->color = lgl_xml_get_prop_uint (node, "line_color", 0); + } + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), line_color_node); + gl_color_node_free (&line_color_node); + + /* affine attrs */ + xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); + + /* shadow attrs */ + xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Objects->Object-image Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_object_image (xmlNodePtr node, + glLabel *label) +{ + GObject *object; + gdouble x, y; + gdouble w, h; + gchar *string; + glTextNode *filename; + + gl_debug (DEBUG_XML, "START"); + + object = gl_label_image_new (label); + + /* position attrs */ + x = lgl_xml_get_prop_length (node, "x", 0.0); + y = lgl_xml_get_prop_length (node, "y", 0.0); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + + /* src or field attr */ + string = lgl_xml_get_prop_string (node, "src", NULL); + if ( string ) { + filename = g_new0 (glTextNode, 1); + filename->field_flag = FALSE; + filename->data = g_strdup ((gchar *)string); + gl_label_image_set_filename (GL_LABEL_IMAGE(object), filename); + gl_text_node_free (&filename); + xmlFree (string); + } else { + string = lgl_xml_get_prop_string (node, "field", NULL); + if ( string ) { + filename = g_new0 (glTextNode, 1); + filename->field_flag = TRUE; + filename->data = g_strdup ((gchar *)string); + gl_label_image_set_filename (GL_LABEL_IMAGE(object), filename); + gl_text_node_free (&filename); + xmlFree (string); + } else { + g_message ("Missing Object-image src or field attr"); + } + } + + /* size attrs */ + w = lgl_xml_get_prop_length (node, "w", 0); + h = lgl_xml_get_prop_length (node, "h", 0); + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); + + /* affine attrs */ + xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); + + /* shadow attrs */ + xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML Objects->Object-barcode Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_object_barcode (xmlNodePtr node, + glLabel *label) +{ + GObject *object; + gdouble x, y; + gdouble w, h; + gchar *string; + glTextNode *text_node; + gchar *id; + gboolean text_flag; + gboolean checksum_flag; + glColorNode *color_node; + guint format_digits; + + gl_debug (DEBUG_XML, "START"); + + object = gl_label_barcode_new (label); + + /* position attrs */ + x = lgl_xml_get_prop_length (node, "x", 0.0); + y = lgl_xml_get_prop_length (node, "y", 0.0); + gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y); + + /* size attrs */ + w = lgl_xml_get_prop_length (node, "w", 0); + h = lgl_xml_get_prop_length (node, "h", 0); + gl_label_object_set_size (GL_LABEL_OBJECT(object), w, h); + + /* prop attrs */ + id = lgl_xml_get_prop_string (node, "style", NULL); + text_flag = lgl_xml_get_prop_boolean (node, "text", FALSE); + checksum_flag = lgl_xml_get_prop_boolean (node, "checksum", TRUE); + format_digits = lgl_xml_get_prop_uint (node, "format", 10); + gl_label_barcode_set_props (GL_LABEL_BARCODE(object), + (gchar *)id, text_flag, checksum_flag, format_digits); + g_free (id); + + color_node = gl_color_node_new_default (); + string = lgl_xml_get_prop_string (node, "color_field", NULL); + if ( string ) { + color_node->field_flag = TRUE; + color_node->key = string; + } else { + color_node->color = lgl_xml_get_prop_uint (node, "color", 0); + } + gl_label_object_set_line_color (GL_LABEL_OBJECT(object), color_node); + gl_color_node_free (&color_node); + + /* data or field attr */ + string = lgl_xml_get_prop_string (node, "data", NULL); + if ( string ) { + text_node = g_new0 (glTextNode, 1); + text_node->field_flag = FALSE; + text_node->data = string; + gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node); + gl_text_node_free (&text_node); + } else { + string = lgl_xml_get_prop_string (node, "field", NULL); + if ( string ) { + text_node = g_new0 (glTextNode, 1); + text_node->field_flag = TRUE; + text_node->data = string; + gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node); + gl_text_node_free (&text_node); + } else { + g_message ("Missing Object-barcode data or field attr"); + } + } + + /* affine attrs */ + xml_parse_affine_attrs (node, GL_LABEL_OBJECT(object)); + + /* shadow attrs */ + xml_parse_shadow_attrs (node, GL_LABEL_OBJECT(object)); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML merge fields tag. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_merge_fields (xmlNodePtr node, + glLabel *label) +{ + gchar *string; + glMerge *merge; + + gl_debug (DEBUG_XML, "START"); + + string = lgl_xml_get_prop_string (node, "type", NULL); + merge = gl_merge_new (string); + g_free (string); + + string = lgl_xml_get_prop_string (node, "src", NULL); + gl_merge_set_src (merge, string); + g_free (string); + + gl_label_set_merge (label, merge); + + g_object_unref (G_OBJECT(merge)); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML data tag. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_data (xmlNodePtr node, + glLabel *label) +{ + xmlNodePtr child; + + gl_debug (DEBUG_XML, "START"); + + for (child = node->xmlChildrenNode; child != NULL; child = child->next) { + + if (lgl_xml_is_node (child, "Pixdata")) { + xml_parse_pixdata (child, label); + } else { + if (!xmlNodeIsText (child)) { + g_message (_("bad node in Data node = \"%s\""), + child->name); + } + } + } + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse XML pixbuf data tag. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_pixdata (xmlNodePtr node, + glLabel *label) +{ + gchar *name, *base64; + guchar *stream; + guint stream_length; + gboolean ret; + GdkPixdata *pixdata; + GdkPixbuf *pixbuf; + GHashTable *pixbuf_cache; + + gl_debug (DEBUG_XML, "START"); + + name = lgl_xml_get_prop_string (node, "name", NULL); + base64 = lgl_xml_get_node_content (node); + + stream = gl_base64_decode ((gchar *)base64, &stream_length); + pixdata = g_new0 (GdkPixdata, 1); + ret = gdk_pixdata_deserialize (pixdata, stream_length, stream, NULL); + + if (ret) { + pixbuf = gdk_pixbuf_from_pixdata (pixdata, TRUE, NULL); + + pixbuf_cache = gl_label_get_pixbuf_cache (label); + gl_pixbuf_cache_add_pixbuf (pixbuf_cache, (gchar *)name, pixbuf); + } + + g_free (name); + g_free (base64); + + g_free (stream); + g_free (pixdata); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse top-level Span tag. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_toplevel_span (xmlNodePtr node, + glLabelObject *object) +{ + gchar *font_family; + gdouble font_size; + PangoWeight font_weight; + gboolean font_italic_flag; + glColorNode *color_node; + gdouble text_line_spacing; + gchar *string; + GList *lines, *text_nodes; + xmlNodePtr child; + glTextNode *text_node; + + gl_debug (DEBUG_XML, "START"); + + /* Font family attr */ + font_family = lgl_xml_get_prop_string (node, "font_family", "Sans"); + gl_label_object_set_font_family (object, font_family); + g_free (font_family); + + /* Font size attr */ + font_size = lgl_xml_get_prop_double (node, "font_size", 0.0); + gl_label_object_set_font_size (object, font_size); + + /* Font weight attr */ + string = lgl_xml_get_prop_string (node, "font_weight", NULL); + font_weight = gl_util_string_to_weight (string); + g_free (string); + gl_label_object_set_font_weight (object, font_weight); + + /* Font italic flag attr */ + font_italic_flag = lgl_xml_get_prop_boolean (node, "font_italic", FALSE); + gl_label_object_set_font_italic_flag (object, font_italic_flag); + + /* Text color attr */ + color_node = gl_color_node_new_default (); + string = lgl_xml_get_prop_string (node, "color_field", NULL); + if ( string ) { + color_node->field_flag = TRUE; + color_node->key = string; + } else { + color_node->color = lgl_xml_get_prop_uint (node, "color", 0); + } + gl_label_object_set_text_color (object, color_node); + gl_color_node_free (&color_node); + + + /* Text line spacing attr */ + text_line_spacing = lgl_xml_get_prop_double (node, "line_spacing", 1.0); + gl_label_object_set_text_line_spacing (object, text_line_spacing); + + /* Now descend children, and build lines of text nodes */ + lines = NULL; + text_nodes = NULL; + for (child = node->xmlChildrenNode; child != NULL; child = child->next) { + + if (xmlNodeIsText (child)) { + gchar *data = lgl_xml_get_node_content (child); + + /* Hack: if the first char is LF, it's an xml formatting string */ + if (data[0] != '\n') { + /* Literal text */ + text_node = g_new0 (glTextNode, 1); + text_node->field_flag = FALSE; + text_node->data = g_strdup ((gchar *)data); + text_nodes = g_list_append (text_nodes, text_node); + } + g_free (data); + + } else if (lgl_xml_is_node (child, "Span")) { + + g_message ("Unexpected rich text (not supported, yet!)"); + + } else if (lgl_xml_is_node (child, "Field")) { + + /* Field node */ + string = lgl_xml_get_prop_string (child, "name", NULL); + text_node = g_new0 (glTextNode, 1); + text_node->field_flag = TRUE; + text_node->data = string; + text_nodes = g_list_append (text_nodes, text_node); + + } else if (lgl_xml_is_node (child, "NL")) { + + /* Store line. */ + lines = g_list_append (lines, text_nodes); + text_nodes = NULL; + + } else { + g_message ("Unexpected Span child: \"%s\"", child->name); + } + + } + if ( text_nodes ) { + /* Store last line. */ + lines = g_list_append (lines, text_nodes); + text_nodes = NULL; + } + gl_label_text_set_lines (GL_LABEL_TEXT(object), lines); + gl_text_node_lines_free (&lines); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse affine attributes. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_affine_attrs (xmlNodePtr node, + glLabelObject *object) +{ + gdouble a[6]; + cairo_matrix_t matrix; + + a[0] = lgl_xml_get_prop_double (node, "a0", 0.0); + a[1] = lgl_xml_get_prop_double (node, "a1", 0.0); + a[2] = lgl_xml_get_prop_double (node, "a2", 0.0); + a[3] = lgl_xml_get_prop_double (node, "a3", 0.0); + a[4] = lgl_xml_get_prop_double (node, "a4", 0.0); + a[5] = lgl_xml_get_prop_double (node, "a5", 0.0); + + cairo_matrix_init (&matrix, a[0], a[1], a[2], a[3], a[4], a[5]); + + gl_label_object_set_matrix (object, &matrix); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Parse shadow attributes. */ +/*--------------------------------------------------------------------------*/ +static void +xml_parse_shadow_attrs (xmlNodePtr node, + glLabelObject *object) +{ + gboolean shadow_state; + gdouble shadow_x; + gdouble shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + gchar *string; + + shadow_state = lgl_xml_get_prop_boolean (node, "shadow", FALSE); + gl_label_object_set_shadow_state (object, shadow_state); + + if (shadow_state) + { + shadow_x = lgl_xml_get_prop_length (node, "shadow_x", 0.0); + shadow_y = lgl_xml_get_prop_length (node, "shadow_y", 0.0); + gl_label_object_set_shadow_offset (object, shadow_x, shadow_y); + + shadow_color_node = gl_color_node_new_default (); + string = lgl_xml_get_prop_string (node, "shadow_color_field", NULL); + if ( string ) { + shadow_color_node->field_flag = TRUE; + shadow_color_node->key = string; + } else { + shadow_color_node->color = lgl_xml_get_prop_uint (node, "shadow_color", 0); + } + gl_label_object_set_shadow_color (object, shadow_color_node); + gl_color_node_free (&shadow_color_node); + + shadow_opacity = lgl_xml_get_prop_double (node, "shadow_opacity", 1.0); + gl_label_object_set_shadow_opacity (object, shadow_opacity); + } +} + +/****************************************************************************/ +/* Save label to xml label file. */ +/****************************************************************************/ +void +gl_xml_label_save (glLabel *label, + const gchar *utf8_filename, + glXMLLabelStatus *status) +{ + xmlDocPtr doc; + gint xml_ret; + gchar *filename; + + gl_debug (DEBUG_XML, "START"); + + doc = xml_label_to_doc (label, status); + + filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL); + if (!filename) + g_message (_("Utf8 conversion error.")); + else { + xmlSetDocCompressMode (doc, gl_label_get_compression (label)); + xml_ret = xmlSaveFormatFile (filename, doc, TRUE); + xmlFreeDoc (doc); + if (xml_ret == -1) { + + g_message (_("Problem saving xml file.")); + *status = XML_LABEL_ERROR_SAVE_FILE; + + } else { + + gl_label_set_filename (label, utf8_filename); + gl_label_clear_modified (label); + + } + g_free (filename); + } + + gl_debug (DEBUG_XML, "END"); +} + +/****************************************************************************/ +/* Save label to xml buffer. */ +/****************************************************************************/ +gchar * +gl_xml_label_save_buffer (glLabel *label, + glXMLLabelStatus *status) +{ + xmlDocPtr doc; + gint size; + guchar *buffer; + + gl_debug (DEBUG_XML, "START"); + + doc = xml_label_to_doc (label, status); + + xmlDocDumpMemory (doc, &buffer, &size); + xmlFreeDoc (doc); + + gl_label_clear_modified (label); + + gl_debug (DEBUG_XML, "END"); + + return (gchar *)buffer; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Convert label to xml doc structure. */ +/*--------------------------------------------------------------------------*/ +static xmlDocPtr +xml_label_to_doc (glLabel *label, + glXMLLabelStatus *status) +{ + xmlDocPtr doc; + xmlNsPtr ns; + glMerge *merge; + + gl_debug (DEBUG_XML, "START"); + + LIBXML_TEST_VERSION; + + doc = xmlNewDoc ((xmlChar *)"1.0"); + doc->xmlRootNode = xmlNewDocNode (doc, NULL, (xmlChar *)"Glabels-document", NULL); + + ns = xmlNewNs (doc->xmlRootNode, (xmlChar *)LGL_XML_NAME_SPACE, NULL); + xmlSetNs (doc->xmlRootNode, ns); + + lgl_xml_template_create_template_node (label->template, doc->xmlRootNode, ns); + + xml_create_objects (doc->xmlRootNode, ns, label); + + merge = gl_label_get_merge (label); + gl_debug (DEBUG_XML, "merge=%p", merge); + if (merge != NULL) { + xml_create_merge_fields (doc->xmlRootNode, ns, label); + g_object_unref (G_OBJECT(merge)); + } + + xml_create_data (doc->xmlRootNode, ns, label); + + gl_debug (DEBUG_XML, "END"); + + *status = XML_LABEL_OK; + return doc; +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Objects Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_objects (xmlNodePtr root, + xmlNsPtr ns, + glLabel *label) +{ + xmlNodePtr node; + GList *p; + glLabelObject *object; + + gl_debug (DEBUG_XML, "START"); + + node = xmlNewChild (root, ns, (xmlChar *)"Objects", NULL); + lgl_xml_set_prop_string (node, "id", "0"); + lgl_xml_set_prop_boolean (node, "rotate", label->rotate_flag); + + for (p = label->objects; p != NULL; p = p->next) { + + object = GL_LABEL_OBJECT(p->data); + + if ( GL_IS_LABEL_TEXT(object) ) { + xml_create_object_text (node, ns, object); + } else if ( GL_IS_LABEL_BOX(object) ) { + xml_create_object_box (node, ns, object); + } else if ( GL_IS_LABEL_ELLIPSE(object) ) { + xml_create_object_ellipse (node, ns, object); + } else if ( GL_IS_LABEL_LINE(object) ) { + xml_create_object_line (node, ns, object); + } else if ( GL_IS_LABEL_IMAGE(object) ) { + xml_create_object_image (node, ns, object); + } else if ( GL_IS_LABEL_BARCODE(object) ) { + xml_create_object_barcode (node, ns, object); + } else { + g_message ("Unknown label object"); + } + + } + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Objects->Object-text Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_object_text (xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object) +{ + xmlNodePtr node; + gdouble x, y; + gdouble w, h; + PangoAlignment align; + gboolean auto_shrink; + + gl_debug (DEBUG_XML, "START"); + + node = xmlNewChild (root, ns, (xmlChar *)"Object-text", NULL); + + /* position attrs */ + gl_label_object_get_position (object, &x, &y); + lgl_xml_set_prop_length (node, "x", x); + lgl_xml_set_prop_length (node, "y", y); + + /* size attrs */ + gl_label_object_get_raw_size ( object, &w, &h); + lgl_xml_set_prop_length (node, "w", w); + lgl_xml_set_prop_length (node, "h", h); + + /* justify attr */ + align = gl_label_object_get_text_alignment (object); + lgl_xml_set_prop_string (node, "justify", gl_util_align_to_string (align)); + + /* auto_shrink attr */ + auto_shrink = gl_label_text_get_auto_shrink (GL_LABEL_TEXT (object)); + lgl_xml_set_prop_boolean (node, "auto_shrink", auto_shrink); + + /* affine attrs */ + xml_create_affine_attrs (node, object); + + /* shadow attrs */ + xml_create_shadow_attrs (node, object); + + /* Add children */ + xml_create_toplevel_span (node, ns, GL_LABEL_TEXT(object)); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Objects->Object-box Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_object_box (xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object) +{ + xmlNodePtr node; + gdouble x, y; + gdouble w, h; + gdouble line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; + + gl_debug (DEBUG_XML, "START"); + + node = xmlNewChild (root, ns, (xmlChar *)"Object-box", NULL); + + /* position attrs */ + gl_label_object_get_position (object, &x, &y); + lgl_xml_set_prop_length (node, "x", x); + lgl_xml_set_prop_length (node, "y", y); + + /* size attrs */ + gl_label_object_get_size (object, &w, &h); + lgl_xml_set_prop_length (node, "w", w); + lgl_xml_set_prop_length (node, "h", h); + + /* line attrs */ + line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); + lgl_xml_set_prop_length (node, "line_width", line_width); + + line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); + if (line_color_node->field_flag) + { + lgl_xml_set_prop_string (node, "line_color_field", line_color_node->key); + } + else + { + lgl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color); + } + gl_color_node_free (&line_color_node); + + /* fill attrs (color or field) */ + fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object)); + if (fill_color_node->field_flag) + { + lgl_xml_set_prop_string (node, "fill_color_field", fill_color_node->key); + } + else + { + lgl_xml_set_prop_uint_hex (node, "fill_color", fill_color_node->color); + } + gl_color_node_free (&fill_color_node); + + /* affine attrs */ + xml_create_affine_attrs (node, object); + + /* shadow attrs */ + xml_create_shadow_attrs (node, object); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Objects->Object-ellipse Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_object_ellipse (xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object) +{ + xmlNodePtr node; + gdouble x, y; + gdouble w, h; + gdouble line_width; + glColorNode *line_color_node; + glColorNode *fill_color_node; + + gl_debug (DEBUG_XML, "START"); + + node = xmlNewChild (root, ns, (xmlChar *)"Object-ellipse", NULL); + + /* position attrs */ + gl_label_object_get_position (object, &x, &y); + lgl_xml_set_prop_length (node, "x", x); + lgl_xml_set_prop_length (node, "y", y); + + /* size attrs */ + gl_label_object_get_size (object, &w, &h); + lgl_xml_set_prop_length (node, "w", w); + lgl_xml_set_prop_length (node, "h", h); + + /* line attrs */ + line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); + lgl_xml_set_prop_length (node, "line_width", line_width); + + line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); + if (line_color_node->field_flag) + { + lgl_xml_set_prop_string (node, "line_color_field", line_color_node->key); + } + else + { + lgl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color); + } + gl_color_node_free (&line_color_node); + + + /* fill attrs (color or field) */ + fill_color_node = gl_label_object_get_fill_color (GL_LABEL_OBJECT(object)); + if (fill_color_node->field_flag) + { + lgl_xml_set_prop_string (node, "fill_color_field", fill_color_node->key); + } + else + { + lgl_xml_set_prop_uint_hex (node, "fill_color", fill_color_node->color); + } + gl_color_node_free (&fill_color_node); + + /* affine attrs */ + xml_create_affine_attrs (node, object); + + /* shadow attrs */ + xml_create_shadow_attrs (node, object); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Objects->Object-line Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_object_line (xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object) +{ + xmlNodePtr node; + gdouble x, y; + gdouble dx, dy; + gdouble line_width; + glColorNode *line_color_node; + + gl_debug (DEBUG_XML, "START"); + + node = xmlNewChild (root, ns, (xmlChar *)"Object-line", NULL); + + /* position attrs */ + gl_label_object_get_position (object, &x, &y); + lgl_xml_set_prop_length (node, "x", x); + lgl_xml_set_prop_length (node, "y", y); + + /* length attrs */ + gl_label_object_get_size (object, &dx, &dy); + lgl_xml_set_prop_length (node, "dx", dx); + lgl_xml_set_prop_length (node, "dy", dy); + + /* line attrs */ + line_width = gl_label_object_get_line_width (GL_LABEL_OBJECT(object)); + lgl_xml_set_prop_length (node, "line_width", line_width); + + line_color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); + if (line_color_node->field_flag) + { + lgl_xml_set_prop_string (node, "line_color_field", line_color_node->key); + } + else + { + lgl_xml_set_prop_uint_hex (node, "line_color", line_color_node->color); + } + gl_color_node_free (&line_color_node); + + + /* affine attrs */ + xml_create_affine_attrs (node, object); + + /* shadow attrs */ + xml_create_shadow_attrs (node, object); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Objects->Object-image Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_object_image (xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object) +{ + xmlNodePtr node; + gdouble x, y; + gdouble w, h; + glTextNode *filename; + + gl_debug (DEBUG_XML, "START"); + + node = xmlNewChild (root, ns, (xmlChar *)"Object-image", NULL); + + /* position attrs */ + gl_label_object_get_position (object, &x, &y); + lgl_xml_set_prop_length (node, "x", x); + lgl_xml_set_prop_length (node, "y", y); + + /* size attrs */ + gl_label_object_get_size (object, &w, &h); + lgl_xml_set_prop_length (node, "w", w); + lgl_xml_set_prop_length (node, "h", h); + + /* src OR field attr */ + filename = gl_label_image_get_filename (GL_LABEL_IMAGE(object)); + if (filename->field_flag) { + lgl_xml_set_prop_string (node, "field", filename->data); + } else { + lgl_xml_set_prop_string (node, "src", filename->data); + } + gl_text_node_free (&filename); + + /* affine attrs */ + xml_create_affine_attrs (node, object); + + /* shadow attrs */ + xml_create_shadow_attrs (node, object); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Objects->Object-barcode Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_object_barcode (xmlNodePtr root, + xmlNsPtr ns, + glLabelObject *object) +{ + xmlNodePtr node; + gdouble x, y; + gdouble w, h; + glTextNode *text_node; + gchar *id; + gboolean text_flag; + gboolean checksum_flag; + glColorNode *color_node; + guint format_digits; + + gl_debug (DEBUG_XML, "START"); + + node = xmlNewChild (root, ns, (xmlChar *)"Object-barcode", NULL); + + /* position attrs */ + gl_label_object_get_position (object, &x, &y); + lgl_xml_set_prop_length (node, "x", x); + lgl_xml_set_prop_length (node, "y", y); + + /* size attrs */ + gl_label_object_get_raw_size (object, &w, &h); + lgl_xml_set_prop_length (node, "w", w); + lgl_xml_set_prop_length (node, "h", h); + + /* Barcode properties attrs */ + gl_label_barcode_get_props (GL_LABEL_BARCODE(object), + &id, &text_flag, &checksum_flag, &format_digits); + lgl_xml_set_prop_string (node, "style", id); + lgl_xml_set_prop_boolean (node, "text", text_flag); + lgl_xml_set_prop_boolean (node, "checksum", checksum_flag); + + g_free (id); + + color_node = gl_label_object_get_line_color (GL_LABEL_OBJECT(object)); + if (color_node->field_flag) + { + lgl_xml_set_prop_string (node, "color_field", color_node->key); + } + else + { + lgl_xml_set_prop_uint_hex (node, "color", color_node->color); + } + gl_color_node_free (&color_node); + + + /* data OR field attr */ + text_node = gl_label_barcode_get_data (GL_LABEL_BARCODE(object)); + if (text_node->field_flag) { + lgl_xml_set_prop_string (node, "field", text_node->data); + lgl_xml_set_prop_int (node, "format", format_digits); + } else { + lgl_xml_set_prop_string (node, "data", text_node->data); + } + gl_text_node_free (&text_node); + + /* affine attrs */ + xml_create_affine_attrs (node, object); + + /* shadow attrs */ + xml_create_shadow_attrs (node, object); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Label Merge Fields Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_merge_fields (xmlNodePtr root, + xmlNsPtr ns, + glLabel *label) +{ + xmlNodePtr node; + gchar *string; + glMerge *merge; + + gl_debug (DEBUG_XML, "START"); + + merge = gl_label_get_merge (label); + + node = xmlNewChild (root, ns, (xmlChar *)"Merge", NULL); + + string = gl_merge_get_name (merge); + lgl_xml_set_prop_string (node, "type", string); + g_free (string); + + string = gl_merge_get_src (merge); + lgl_xml_set_prop_string (node, "src", string); + g_free (string); + + g_object_unref (G_OBJECT(merge)); + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Label Data Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_data (xmlNodePtr root, + xmlNsPtr ns, + glLabel *label) +{ + xmlNodePtr node; + GList *name_list, *p; + GHashTable *pixbuf_cache; + + gl_debug (DEBUG_XML, "START"); + + node = xmlNewChild (root, ns, (xmlChar *)"Data", NULL); + + pixbuf_cache = gl_label_get_pixbuf_cache (label); + name_list = gl_pixbuf_cache_get_name_list (pixbuf_cache); + + for (p = name_list; p != NULL; p=p->next) { + xml_create_pixdata (node, ns, label, p->data); + } + + gl_pixbuf_cache_free_name_list (name_list); + + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Add XML Label Data Pixbuf Node */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_pixdata (xmlNodePtr root, + xmlNsPtr ns, + glLabel *label, + gchar *name) +{ + xmlNodePtr node; + GHashTable *pixbuf_cache; + GdkPixbuf *pixbuf; + GdkPixdata *pixdata; + guchar *stream; + guint stream_length; + gchar *base64; + + gl_debug (DEBUG_XML, "START"); + + pixbuf_cache = gl_label_get_pixbuf_cache (label); + + pixbuf = gl_pixbuf_cache_get_pixbuf (pixbuf_cache, name); + if ( pixbuf != NULL ) { + + pixdata = g_new0 (GdkPixdata, 1); + gdk_pixdata_from_pixbuf (pixdata, pixbuf, FALSE); + stream = gdk_pixdata_serialize (pixdata, &stream_length); + base64 = gl_base64_encode (stream, stream_length); + + node = xmlNewChild (root, ns, (xmlChar *)"Pixdata", (xmlChar *)base64); + lgl_xml_set_prop_string (node, "name", name); + lgl_xml_set_prop_string (node, "encoding", "Base64"); + + gl_pixbuf_cache_remove_pixbuf (pixbuf_cache, name); + + g_free (pixdata); + g_free (stream); + g_free (base64); + } + + + gl_debug (DEBUG_XML, "END"); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Create top-level Span node. */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_toplevel_span (xmlNodePtr root, + xmlNsPtr ns, + glLabelText *object_text) +{ + xmlNodePtr node; + gchar *font_family; + gdouble font_size; + PangoWeight font_weight; + gboolean font_italic_flag; + glColorNode *color_node; + PangoAlignment align; + gdouble text_line_spacing; + GList *lines, *p_line, *p_node; + glTextNode *text_node; + xmlNodePtr child; + + node = xmlNewChild (root, ns, (xmlChar *)"Span", NULL); + + /* All span attrs at top level. */ + font_family = gl_label_object_get_font_family (GL_LABEL_OBJECT(object_text)); + font_size = gl_label_object_get_font_size (GL_LABEL_OBJECT(object_text)); + text_line_spacing = gl_label_object_get_text_line_spacing (GL_LABEL_OBJECT(object_text)); + font_weight = gl_label_object_get_font_weight (GL_LABEL_OBJECT(object_text)); + font_italic_flag = gl_label_object_get_font_italic_flag (GL_LABEL_OBJECT(object_text)); + + color_node = gl_label_object_get_text_color (GL_LABEL_OBJECT(object_text)); + if (color_node->field_flag) + { + lgl_xml_set_prop_string (node, "color_field", color_node->key); + } + else + { + lgl_xml_set_prop_uint_hex (node, "color", color_node->color); + } + gl_color_node_free (&color_node); + + align = gl_label_object_get_text_alignment (GL_LABEL_OBJECT(object_text)); + lgl_xml_set_prop_string (node, "font_family", font_family); + lgl_xml_set_prop_double (node, "font_size", font_size); + lgl_xml_set_prop_string (node, "font_weight", gl_util_weight_to_string (font_weight)); + lgl_xml_set_prop_boolean (node, "font_italic", font_italic_flag); + + lgl_xml_set_prop_double (node, "line_spacing", text_line_spacing); + + /* Build children. */ + lines = gl_label_text_get_lines (GL_LABEL_TEXT(object_text)); + for (p_line = lines; p_line != NULL; p_line = p_line->next) { + + for (p_node = (GList *) p_line->data; p_node != NULL; + p_node = p_node->next) { + text_node = (glTextNode *) p_node->data; + + if (text_node->field_flag) { + child = xmlNewChild (node, ns, (xmlChar *)"Field", NULL); + lgl_xml_set_prop_string (child, "name", text_node->data); + } else { + xmlNodeAddContent (node, (xmlChar *)text_node->data); + } + + } + + if ( p_line->next ) { + child = xmlNewChild (node, ns, (xmlChar *)"NL", NULL); + } + + } + + gl_text_node_lines_free (&lines); + g_free (font_family); + +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Create affine attributes. */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_affine_attrs (xmlNodePtr node, + glLabelObject *object) +{ + cairo_matrix_t matrix; + + gl_label_object_get_matrix (object, &matrix); + + lgl_xml_set_prop_double (node, "a0", matrix.xx); + lgl_xml_set_prop_double (node, "a1", matrix.yx); + lgl_xml_set_prop_double (node, "a2", matrix.xy); + lgl_xml_set_prop_double (node, "a3", matrix.yy); + lgl_xml_set_prop_double (node, "a4", matrix.x0); + lgl_xml_set_prop_double (node, "a5", matrix.y0); +} + +/*--------------------------------------------------------------------------*/ +/* PRIVATE. Create shadow attributes. */ +/*--------------------------------------------------------------------------*/ +static void +xml_create_shadow_attrs (xmlNodePtr node, + glLabelObject *object) +{ + gboolean shadow_state; + gdouble shadow_x; + gdouble shadow_y; + glColorNode *shadow_color_node; + gdouble shadow_opacity; + + shadow_state = gl_label_object_get_shadow_state (object); + + if (shadow_state) + { + lgl_xml_set_prop_boolean (node, "shadow", shadow_state); + + gl_label_object_get_shadow_offset (object, &shadow_x, &shadow_y); + lgl_xml_set_prop_length (node, "shadow_x", shadow_x); + lgl_xml_set_prop_length (node, "shadow_y", shadow_y); + + shadow_color_node = gl_label_object_get_shadow_color (object); + if (shadow_color_node->field_flag) + { + lgl_xml_set_prop_string (node, "shadow_color_field", shadow_color_node->key); + } + else + { + lgl_xml_set_prop_uint_hex (node, "shadow_color", shadow_color_node->color); + } + gl_color_node_free (&shadow_color_node); + + shadow_opacity = gl_label_object_get_shadow_opacity (object); + lgl_xml_set_prop_double (node, "shadow_opacity", shadow_opacity); + } +} + + diff --git a/src/xml-label.h b/src/xml-label.h new file mode 100644 index 00000000..5c5f0c37 --- /dev/null +++ b/src/xml-label.h @@ -0,0 +1,55 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ + +/* + * (GLABELS) Label and Business Card Creation program for GNOME + * + * xml-label.h: GLabels xml label module header file + * + * Copyright (C) 2001-2002 Jim Evins . + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __XML_LABEL_H__ +#define __XML_LABEL_H__ + +#include "label.h" + +G_BEGIN_DECLS + + +typedef enum { + XML_LABEL_UNKNOWN_MEDIA = 1, + XML_LABEL_OK = 0, + XML_LABEL_ERROR_OPEN_PARSE = -10, + XML_LABEL_ERROR_SAVE_FILE = -20, +} glXMLLabelStatus; + + +extern glLabel *gl_xml_label_open (const gchar * filename, + glXMLLabelStatus *status); +extern glLabel *gl_xml_label_open_buffer (const gchar * buffer, + glXMLLabelStatus *status); + +extern void gl_xml_label_save (glLabel * label, + const gchar * filename, + glXMLLabelStatus *status); +extern gchar *gl_xml_label_save_buffer (glLabel * label, + glXMLLabelStatus *status); + + +G_END_DECLS + + +#endif /* __XML_LABEL_H__ */