/branches/Scribus/Scribus/INSTALL |
---|
File deleted |
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/COPYING |
=================================================================== |
--- Scribus/Scribus/COPYING (revision 6) |
+++ Scribus/Scribus/COPYING (nonexistent) |
@@ -1,280 +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 |
/Scribus/Scribus/COPYING |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/stamp-h |
=================================================================== |
--- Scribus/Scribus/stamp-h (revision 6) |
+++ Scribus/Scribus/stamp-h (nonexistent) |
@@ -1 +0,0 @@ |
-timestamp |
/Scribus/Scribus/stamp-h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/Makefile.am |
=================================================================== |
--- Scribus/Scribus/Makefile.am (revision 6) |
+++ Scribus/Scribus/Makefile.am (nonexistent) |
@@ -1,31 +0,0 @@ |
-####### kdevelop will overwrite this part!!! (begin)########## |
- |
-SUBDIRS = scribus |
- |
-EXTRA_DIST = scribus.kdevprj AUTHORS COPYING ChangeLog INSTALL README TODO scribus.lsm scribus.desktop |
- |
-####### kdevelop will overwrite this part!!! (end)############ |
-# not a GNU package. You can remove this line, if |
-# have all needed files, that a GNU package needs |
-AUTOMAKE_OPTIONS = foreign |
- |
-#$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs |
-# cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ; |
- |
-$(top_srcdir)/subdirs: |
- cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs |
- |
-$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in |
- @cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4 |
- |
-MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files |
- |
-package-messages: |
- $(MAKE) -f admin/Makefile.common package-messages |
- $(MAKE) -C po merge |
- |
-EXTRA_DIST += admin |
- |
-dist-hook: |
- cd $(top_distdir) && perl admin/am_edit -padmin |
- cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs |
/Scribus/Scribus/Makefile.am |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/icc34.h |
=================================================================== |
--- Scribus/Scribus/scribus/icc34.h (revision 6) |
+++ Scribus/Scribus/scribus/icc34.h (nonexistent) |
@@ -1,979 +0,0 @@ |
-/* Header file guard bands */ |
-#ifndef ICC_H |
-#define ICC_H |
- |
-/***************************************************************** |
- Copyright (c) 1994-1996 SunSoft, Inc. |
- |
- Rights Reserved |
- |
-Permission is hereby granted, free of charge, to any person |
-obtaining a copy of this software and associated documentation |
-files (the "Software"), to deal in the Software without restrict- |
-ion, including without limitation the rights to use, copy, modify, |
-merge, publish distribute, sublicense, and/or sell copies of the |
-Software, and to permit persons to whom the Software is furnished |
-to do so, subject to the following conditions: |
- |
-The above copyright notice and this permission notice shall be |
-included in all copies or substantial portions of the Software. |
- |
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- |
-INFRINGEMENT. IN NO EVENT SHALL SUNSOFT, INC. OR ITS PARENT |
-COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
-OTHER DEALINGS IN THE SOFTWARE. |
- |
-Except as contained in this notice, the name of SunSoft, Inc. |
-shall not be used in advertising or otherwise to promote the |
-sale, use or other dealings in this Software without written |
-authorization from SunSoft Inc. |
-******************************************************************/ |
- |
-/* |
- * This version of the header file corresponds to the profile |
- * specification version 3.4. |
- * |
- * All header file entries are pre-fixed with "ic" to help |
- * avoid name space collisions. Signatures are pre-fixed with |
- * icSig. |
- * |
- * The structures defined in this header file were created to |
- * represent a description of an ICC profile on disk. Rather |
- * than use pointers a technique is used where a single byte array |
- * was placed at the end of each structure. This allows us in "C" |
- * to extend the structure by allocating more data than is needed |
- * to account for variable length structures. |
- * |
- * This also ensures that data following is allocated |
- * contiguously and makes it easier to write and read data from |
- * the file. |
- * |
- * For example to allocate space for a 256 count length UCR |
- * and BG array, and fill the allocated data. Note strlen + 1 |
- * to remember NULL terminator. |
- * |
- icUcrBgCurve *ucrCurve, *bgCurve; |
- int ucr_nbytes, bg_nbytes, string_bytes; |
- icUcrBg *ucrBgWrite; |
- char ucr_string[100], *ucr_char; |
- |
- strcpy(ucr_string, "Example ucrBG curves"); |
- ucr_nbytes = sizeof(icUInt32Number) + |
- (UCR_CURVE_SIZE * sizeof(icUInt16Number)); |
- bg_nbytes = sizeof(icUInt32Number) + |
- (BG_CURVE_SIZE * sizeof(icUInt16Number)); |
- string_bytes = strlen(ucr_string) + 1; |
- |
- ucrBgWrite = (icUcrBg *)malloc( |
- (ucr_nbytes + bg_nbytes + string_bytes)); |
- |
- ucrCurve = (icUcrBgCurve *)ucrBgWrite->data; |
- ucrCurve->count = UCR_CURVE_SIZE; |
- for (i=0; i<ucrCurve->count; i++) |
- ucrCurve->curve[i] = (icUInt16Number)i; |
- |
- bgCurve = (icUcrBgCurve *)((char *)ucrCurve + ucr_nbytes); |
- bgCurve->count = BG_CURVE_SIZE; |
- for (i=0; i<bgCurve->count; i++) |
- bgCurve->curve[i] = 255 - (icUInt16Number)i; |
- |
- ucr_char = (char *)((char *)bgCurve + bg_nbytes); |
- memcpy(ucr_char, ucr_string, string_bytes); |
- * |
- */ |
- |
-/* |
- * Many of the structures contain variable length arrays. This |
- * is represented by the use of the convention. |
- * |
- * type data[icAny]; |
- */ |
- |
-/*------------------------------------------------------------------------*/ |
-/* |
- * Defines used in the specification |
- */ |
-#define icMagicNumber 0x61637370L /* 'acsp' */ |
-#define icVersionNumber 0x02100000L /* 2.1.0, BCD */ |
- |
-/* Screening Encodings */ |
-#define icPrtrDefaultScreensFalse 0x00000000L /* Bit pos 0 */ |
-#define icPrtrDefaultScreensTrue 0x00000001L /* Bit pos 0 */ |
-#define icLinesPerInch 0x00000002L /* Bit pos 1 */ |
-#define icLinesPerCm 0x00000000L /* Bit pos 1 */ |
- |
-/* |
- * Device attributes, currently defined values correspond |
- * to the low 4 bytes of the 8 byte attribute quantity, see |
- * the header for their location. |
- */ |
-#define icReflective 0x00000000L /* Bit pos 0 */ |
-#define icTransparency 0x00000001L /* Bit pos 0 */ |
-#define icGlossy 0x00000000L /* Bit pos 1 */ |
-#define icMatte 0x00000002L /* Bit pos 1 */ |
- |
-/* |
- * Profile header flags, the low 16 bits are reserved for consortium |
- * use. |
- */ |
-#define icEmbeddedProfileFalse 0x00000000L /* Bit pos 0 */ |
-#define icEmbeddedProfileTrue 0x00000001L /* Bit pos 0 */ |
-#define icUseAnywhere 0x00000000L /* Bit pos 1 */ |
-#define icUseWithEmbeddedDataOnly 0x00000002L /* Bit pos 1 */ |
- |
-/* Ascii or Binary data */ |
-#define icAsciiData 0x00000000L |
-#define icBinaryData 0x00000001L |
- |
-/* |
- * Define used to indicate that this is a variable length array |
- */ |
-#define icAny 1 |
- |
- |
-/*------------------------------------------------------------------------*/ |
-/* |
- * Use this area to translate platform definitions of long |
- * etc into icXXX form. The rest of the header uses the icXXX |
- * typedefs. Signatures are 4 byte quantities. |
- * |
- */ |
- |
-#ifdef __sgi |
-#include "sgidefs.h" |
- |
-typedef __int32_t icSignature; |
- |
-/* |
- * Number definitions |
- */ |
- |
-/* Unsigned integer numbers */ |
-typedef unsigned char icUInt8Number; |
-typedef unsigned short icUInt16Number; |
-typedef __uint32_t icUInt32Number; |
-typedef __uint32_t icUInt64Number[2]; |
- |
-/* Signed numbers */ |
-typedef char icInt8Number; |
-typedef short icInt16Number; |
-typedef __int32_t icInt32Number; |
-typedef __int32_t icInt64Number[2]; |
- |
-/* Fixed numbers */ |
-typedef __int32_t icS15Fixed16Number; |
-typedef __uint32_t icU16Fixed16Number; |
- |
-#else |
-#if defined(__GNUC__) || defined(__unix__) |
- |
-#include <sys/types.h> |
- |
-/* Sept-6-2001: added these type definitions. Modified by Marti Maria |
- * in order to provide wider portability. |
- */ |
- |
-typedef int32_t icSignature; |
- |
-/* Unsigned integer numbers */ |
-typedef u_int8_t icUInt8Number; |
-typedef u_int16_t icUInt16Number; |
-typedef u_int32_t icUInt32Number; |
-typedef u_int32_t icUInt64Number[2]; |
- |
-/* Signed numbers */ |
-typedef int8_t icInt8Number; |
-typedef int16_t icInt16Number; |
-typedef int32_t icInt32Number; |
-typedef int32_t icInt64Number[2]; |
- |
-/* Fixed numbers */ |
-typedef int32_t icS15Fixed16Number; |
-typedef u_int32_t icU16Fixed16Number; |
- |
-#else /* default definitions */ |
- |
-typedef long icSignature; |
- |
-/* |
- * Number definitions |
- */ |
- |
-/* Unsigned integer numbers */ |
-typedef unsigned char icUInt8Number; |
-typedef unsigned short icUInt16Number; |
-typedef unsigned long icUInt32Number; |
-typedef unsigned long icUInt64Number[2]; |
- |
-/* Signed numbers */ |
-typedef char icInt8Number; |
-typedef short icInt16Number; |
-typedef long icInt32Number; |
-typedef long icInt64Number[2]; |
- |
-/* Fixed numbers */ |
-typedef long icS15Fixed16Number; |
-typedef unsigned long icU16Fixed16Number; |
-#endif /* default defs */ |
-#endif |
- |
-/*------------------------------------------------------------------------*/ |
-/* public tags and sizes */ |
-typedef enum { |
- icSigAToB0Tag = 0x41324230L, /* 'A2B0' */ |
- icSigAToB1Tag = 0x41324231L, /* 'A2B1' */ |
- icSigAToB2Tag = 0x41324232L, /* 'A2B2' */ |
- icSigBlueColorantTag = 0x6258595AL, /* 'bXYZ' */ |
- icSigBlueTRCTag = 0x62545243L, /* 'bTRC' */ |
- icSigBToA0Tag = 0x42324130L, /* 'B2A0' */ |
- icSigBToA1Tag = 0x42324131L, /* 'B2A1' */ |
- icSigBToA2Tag = 0x42324132L, /* 'B2A2' */ |
- icSigCalibrationDateTimeTag = 0x63616C74L, /* 'calt' */ |
- icSigCharTargetTag = 0x74617267L, /* 'targ' */ |
- icSigCopyrightTag = 0x63707274L, /* 'cprt' */ |
- icSigCrdInfoTag = 0x63726469L, /* 'crdi' */ |
- icSigDeviceMfgDescTag = 0x646D6E64L, /* 'dmnd' */ |
- icSigDeviceModelDescTag = 0x646D6464L, /* 'dmdd' */ |
- icSigGamutTag = 0x67616D74L, /* 'gamt ' */ |
- icSigGrayTRCTag = 0x6b545243L, /* 'kTRC' */ |
- icSigGreenColorantTag = 0x6758595AL, /* 'gXYZ' */ |
- icSigGreenTRCTag = 0x67545243L, /* 'gTRC' */ |
- icSigLuminanceTag = 0x6C756d69L, /* 'lumi' */ |
- icSigMeasurementTag = 0x6D656173L, /* 'meas' */ |
- icSigMediaBlackPointTag = 0x626B7074L, /* 'bkpt' */ |
- icSigMediaWhitePointTag = 0x77747074L, /* 'wtpt' */ |
- icSigNamedColorTag = 0x6E636f6CL, /* 'ncol' |
- * OBSOLETE, use ncl2 */ |
- icSigNamedColor2Tag = 0x6E636C32L, /* 'ncl2' */ |
- icSigPreview0Tag = 0x70726530L, /* 'pre0' */ |
- icSigPreview1Tag = 0x70726531L, /* 'pre1' */ |
- icSigPreview2Tag = 0x70726532L, /* 'pre2' */ |
- icSigProfileDescriptionTag = 0x64657363L, /* 'desc' */ |
- icSigProfileSequenceDescTag = 0x70736571L, /* 'pseq' */ |
- icSigPs2CRD0Tag = 0x70736430L, /* 'psd0' */ |
- icSigPs2CRD1Tag = 0x70736431L, /* 'psd1' */ |
- icSigPs2CRD2Tag = 0x70736432L, /* 'psd2' */ |
- icSigPs2CRD3Tag = 0x70736433L, /* 'psd3' */ |
- icSigPs2CSATag = 0x70733273L, /* 'ps2s' */ |
- icSigPs2RenderingIntentTag = 0x70733269L, /* 'ps2i' */ |
- icSigRedColorantTag = 0x7258595AL, /* 'rXYZ' */ |
- icSigRedTRCTag = 0x72545243L, /* 'rTRC' */ |
- icSigScreeningDescTag = 0x73637264L, /* 'scrd' */ |
- icSigScreeningTag = 0x7363726EL, /* 'scrn' */ |
- icSigTechnologyTag = 0x74656368L, /* 'tech' */ |
- icSigUcrBgTag = 0x62666420L, /* 'bfd ' */ |
- icSigViewingCondDescTag = 0x76756564L, /* 'vued' */ |
- icSigViewingConditionsTag = 0x76696577L, /* 'view' */ |
- icMaxEnumTag = 0xFFFFFFFFL |
-} icTagSignature; |
- |
-/* technology signature descriptions */ |
-typedef enum { |
- icSigDigitalCamera = 0x6463616DL, /* 'dcam' */ |
- icSigFilmScanner = 0x6673636EL, /* 'fscn' */ |
- icSigReflectiveScanner = 0x7273636EL, /* 'rscn' */ |
- icSigInkJetPrinter = 0x696A6574L, /* 'ijet' */ |
- icSigThermalWaxPrinter = 0x74776178L, /* 'twax' */ |
- icSigElectrophotographicPrinter = 0x6570686FL, /* 'epho' */ |
- icSigElectrostaticPrinter = 0x65737461L, /* 'esta' */ |
- icSigDyeSublimationPrinter = 0x64737562L, /* 'dsub' */ |
- icSigPhotographicPaperPrinter = 0x7270686FL, /* 'rpho' */ |
- icSigFilmWriter = 0x6670726EL, /* 'fprn' */ |
- icSigVideoMonitor = 0x7669646DL, /* 'vidm' */ |
- icSigVideoCamera = 0x76696463L, /* 'vidc' */ |
- icSigProjectionTelevision = 0x706A7476L, /* 'pjtv' */ |
- icSigCRTDisplay = 0x43525420L, /* 'CRT ' */ |
- icSigPMDisplay = 0x504D4420L, /* 'PMD ' */ |
- icSigAMDisplay = 0x414D4420L, /* 'AMD ' */ |
- icSigPhotoCD = 0x4B504344L, /* 'KPCD' */ |
- icSigPhotoImageSetter = 0x696D6773L, /* 'imgs' */ |
- icSigGravure = 0x67726176L, /* 'grav' */ |
- icSigOffsetLithography = 0x6F666673L, /* 'offs' */ |
- icSigSilkscreen = 0x73696C6BL, /* 'silk' */ |
- icSigFlexography = 0x666C6578L, /* 'flex' */ |
- icMaxEnumTechnology = 0xFFFFFFFFL |
-} icTechnologySignature; |
- |
-/* type signatures */ |
-typedef enum { |
- icSigCurveType = 0x63757276L, /* 'curv' */ |
- icSigDataType = 0x64617461L, /* 'data' */ |
- icSigDateTimeType = 0x6474696DL, /* 'dtim' */ |
- icSigLut16Type = 0x6d667432L, /* 'mft2' */ |
- icSigLut8Type = 0x6d667431L, /* 'mft1' */ |
- icSigMeasurementType = 0x6D656173L, /* 'meas' */ |
- icSigNamedColorType = 0x6E636f6CL, /* 'ncol' |
- * OBSOLETE, use ncl2 */ |
- icSigProfileSequenceDescType = 0x70736571L, /* 'pseq' */ |
- icSigS15Fixed16ArrayType = 0x73663332L, /* 'sf32' */ |
- icSigScreeningType = 0x7363726EL, /* 'scrn' */ |
- icSigSignatureType = 0x73696720L, /* 'sig ' */ |
- icSigTextType = 0x74657874L, /* 'text' */ |
- icSigTextDescriptionType = 0x64657363L, /* 'desc' */ |
- icSigU16Fixed16ArrayType = 0x75663332L, /* 'uf32' */ |
- icSigUcrBgType = 0x62666420L, /* 'bfd ' */ |
- icSigUInt16ArrayType = 0x75693136L, /* 'ui16' */ |
- icSigUInt32ArrayType = 0x75693332L, /* 'ui32' */ |
- icSigUInt64ArrayType = 0x75693634L, /* 'ui64' */ |
- icSigUInt8ArrayType = 0x75693038L, /* 'ui08' */ |
- icSigViewingConditionsType = 0x76696577L, /* 'view' */ |
- icSigXYZType = 0x58595A20L, /* 'XYZ ' */ |
- icSigXYZArrayType = 0x58595A20L, /* 'XYZ ' */ |
- icSigNamedColor2Type = 0x6E636C32L, /* 'ncl2' */ |
- icSigCrdInfoType = 0x63726469L, /* 'crdi' */ |
- icMaxEnumType = 0xFFFFFFFFL |
-} icTagTypeSignature; |
- |
-/* |
- * Color Space Signatures |
- * Note that only icSigXYZData and icSigLabData are valid |
- * Profile Connection Spaces (PCSs) |
- */ |
-typedef enum { |
- icSigXYZData = 0x58595A20L, /* 'XYZ ' */ |
- icSigLabData = 0x4C616220L, /* 'Lab ' */ |
- icSigLuvData = 0x4C757620L, /* 'Luv ' */ |
- icSigYCbCrData = 0x59436272L, /* 'YCbr' */ |
- icSigYxyData = 0x59787920L, /* 'Yxy ' */ |
- icSigRgbData = 0x52474220L, /* 'RGB ' */ |
- icSigGrayData = 0x47524159L, /* 'GRAY' */ |
- icSigHsvData = 0x48535620L, /* 'HSV ' */ |
- icSigHlsData = 0x484C5320L, /* 'HLS ' */ |
- icSigCmykData = 0x434D594BL, /* 'CMYK' */ |
- icSigCmyData = 0x434D5920L, /* 'CMY ' */ |
- icSig2colorData = 0x32434C52L, /* '2CLR' */ |
- icSig3colorData = 0x33434C52L, /* '3CLR' */ |
- icSig4colorData = 0x34434C52L, /* '4CLR' */ |
- icSig5colorData = 0x35434C52L, /* '5CLR' */ |
- icSig6colorData = 0x36434C52L, /* '6CLR' */ |
- icSig7colorData = 0x37434C52L, /* '7CLR' */ |
- icSig8colorData = 0x38434C52L, /* '8CLR' */ |
- icSig9colorData = 0x39434C52L, /* '9CLR' */ |
- icSig10colorData = 0x41434C52L, /* 'ACLR' */ |
- icSig11colorData = 0x42434C52L, /* 'BCLR' */ |
- icSig12colorData = 0x43434C52L, /* 'CCLR' */ |
- icSig13colorData = 0x44434C52L, /* 'DCLR' */ |
- icSig14colorData = 0x45434C52L, /* 'ECLR' */ |
- icSig15colorData = 0x46434C52L, /* 'FCLR' */ |
- icMaxEnumData = 0xFFFFFFFFL |
-} icColorSpaceSignature; |
- |
-/* profileClass enumerations */ |
-typedef enum { |
- icSigInputClass = 0x73636E72L, /* 'scnr' */ |
- icSigDisplayClass = 0x6D6E7472L, /* 'mntr' */ |
- icSigOutputClass = 0x70727472L, /* 'prtr' */ |
- icSigLinkClass = 0x6C696E6BL, /* 'link' */ |
- icSigAbstractClass = 0x61627374L, /* 'abst' */ |
- icSigColorSpaceClass = 0x73706163L, /* 'spac' */ |
- icSigNamedColorClass = 0x6e6d636cL, /* 'nmcl' */ |
- icMaxEnumClass = 0xFFFFFFFFL |
-} icProfileClassSignature; |
- |
-/* Platform Signatures */ |
-typedef enum { |
- icSigMacintosh = 0x4150504CL, /* 'APPL' */ |
- icSigMicrosoft = 0x4D534654L, /* 'MSFT' */ |
- icSigSolaris = 0x53554E57L, /* 'SUNW' */ |
- icSigSGI = 0x53474920L, /* 'SGI ' */ |
- icSigTaligent = 0x54474E54L, /* 'TGNT' */ |
- icMaxEnumPlatform = 0xFFFFFFFFL |
-} icPlatformSignature; |
- |
-/*------------------------------------------------------------------------*/ |
-/* |
- * Other enums |
- */ |
- |
-/* Measurement Flare, used in the measurmentType tag */ |
-typedef enum { |
- icFlare0 = 0x00000000L, /* 0% flare */ |
- icFlare100 = 0x00000001L, /* 100% flare */ |
- icMaxFlare = 0xFFFFFFFFL |
-} icMeasurementFlare; |
- |
-/* Measurement Geometry, used in the measurmentType tag */ |
-typedef enum { |
- icGeometryUnknown = 0x00000000L, /* Unknown */ |
- icGeometry045or450 = 0x00000001L, /* 0/45, 45/0 */ |
- icGeometry0dord0 = 0x00000002L, /* 0/d or d/0 */ |
- icMaxGeometry = 0xFFFFFFFFL |
-} icMeasurementGeometry; |
- |
-/* Rendering Intents, used in the profile header */ |
-typedef enum { |
- icPerceptual = 0, |
- icRelativeColorimetric = 1, |
- icSaturation = 2, |
- icAbsoluteColorimetric = 3, |
- icMaxEnumIntent = 0xFFFFFFFFL |
-} icRenderingIntent; |
- |
-/* Different Spot Shapes currently defined, used for screeningType */ |
-typedef enum { |
- icSpotShapeUnknown = 0, |
- icSpotShapePrinterDefault = 1, |
- icSpotShapeRound = 2, |
- icSpotShapeDiamond = 3, |
- icSpotShapeEllipse = 4, |
- icSpotShapeLine = 5, |
- icSpotShapeSquare = 6, |
- icSpotShapeCross = 7, |
- icMaxEnumSpot = 0xFFFFFFFFL |
-} icSpotShape; |
- |
-/* Standard Observer, used in the measurmentType tag */ |
-typedef enum { |
- icStdObsUnknown = 0x00000000L, /* Unknown */ |
- icStdObs1931TwoDegrees = 0x00000001L, /* 2 deg */ |
- icStdObs1964TenDegrees = 0x00000002L, /* 10 deg */ |
- icMaxStdObs = 0xFFFFFFFFL |
-} icStandardObserver; |
- |
-/* Pre-defined illuminants, used in measurement and viewing conditions type */ |
-typedef enum { |
- icIlluminantUnknown = 0x00000000L, |
- icIlluminantD50 = 0x00000001L, |
- icIlluminantD65 = 0x00000002L, |
- icIlluminantD93 = 0x00000003L, |
- icIlluminantF2 = 0x00000004L, |
- icIlluminantD55 = 0x00000005L, |
- icIlluminantA = 0x00000006L, |
- icIlluminantEquiPowerE = 0x00000007L, |
- icIlluminantF8 = 0x00000008L, |
- icMaxEnumIluminant = 0xFFFFFFFFL |
-} icIlluminant; |
- |
- |
-/*------------------------------------------------------------------------*/ |
-/* |
- * Arrays of numbers |
- */ |
- |
-/* Int8 Array */ |
-typedef struct { |
- icInt8Number data[icAny]; /* Variable array of values */ |
-} icInt8Array; |
- |
-/* UInt8 Array */ |
-typedef struct { |
- icUInt8Number data[icAny]; /* Variable array of values */ |
-} icUInt8Array; |
- |
-/* uInt16 Array */ |
-typedef struct { |
- icUInt16Number data[icAny]; /* Variable array of values */ |
-} icUInt16Array; |
- |
-/* Int16 Array */ |
-typedef struct { |
- icInt16Number data[icAny]; /* Variable array of values */ |
-} icInt16Array; |
- |
-/* uInt32 Array */ |
-typedef struct { |
- icUInt32Number data[icAny]; /* Variable array of values */ |
-} icUInt32Array; |
- |
-/* Int32 Array */ |
-typedef struct { |
- icInt32Number data[icAny]; /* Variable array of values */ |
-} icInt32Array; |
- |
-/* UInt64 Array */ |
-typedef struct { |
- icUInt64Number data[icAny]; /* Variable array of values */ |
-} icUInt64Array; |
- |
-/* Int64 Array */ |
-typedef struct { |
- icInt64Number data[icAny]; /* Variable array of values */ |
-} icInt64Array; |
- |
-/* u16Fixed16 Array */ |
-typedef struct { |
- icU16Fixed16Number data[icAny]; /* Variable array of values */ |
-} icU16Fixed16Array; |
- |
-/* s15Fixed16 Array */ |
-typedef struct { |
- icS15Fixed16Number data[icAny]; /* Variable array of values */ |
-} icS15Fixed16Array; |
- |
-/* The base date time number */ |
-typedef struct { |
- icUInt16Number year; |
- icUInt16Number month; |
- icUInt16Number day; |
- icUInt16Number hours; |
- icUInt16Number minutes; |
- icUInt16Number seconds; |
-} icDateTimeNumber; |
- |
-/* XYZ Number */ |
-typedef struct { |
- icS15Fixed16Number X; |
- icS15Fixed16Number Y; |
- icS15Fixed16Number Z; |
-} icXYZNumber; |
- |
-/* XYZ Array */ |
-typedef struct { |
- icXYZNumber data[icAny]; /* Variable array of XYZ numbers */ |
-} icXYZArray; |
- |
-/* Curve */ |
-typedef struct { |
- icUInt32Number count; /* Number of entries */ |
- icUInt16Number data[icAny]; /* The actual table data, real |
- * number is determined by count |
- * Interpretation depends on how |
- * data is used with a given tag |
- */ |
-} icCurve; |
- |
-/* Data */ |
-typedef struct { |
- icUInt32Number dataFlag; /* 0 = ascii, 1 = binary */ |
- icInt8Number data[icAny]; /* Data, size from tag */ |
-} icData; |
- |
-/* lut16 */ |
-typedef struct { |
- icUInt8Number inputChan; /* Number of input channels */ |
- icUInt8Number outputChan; /* Number of output channels */ |
- icUInt8Number clutPoints; /* Number of grid points */ |
- icInt8Number pad; /* Padding for byte alignment */ |
- icS15Fixed16Number e00; /* e00 in the 3 * 3 */ |
- icS15Fixed16Number e01; /* e01 in the 3 * 3 */ |
- icS15Fixed16Number e02; /* e02 in the 3 * 3 */ |
- icS15Fixed16Number e10; /* e10 in the 3 * 3 */ |
- icS15Fixed16Number e11; /* e11 in the 3 * 3 */ |
- icS15Fixed16Number e12; /* e12 in the 3 * 3 */ |
- icS15Fixed16Number e20; /* e20 in the 3 * 3 */ |
- icS15Fixed16Number e21; /* e21 in the 3 * 3 */ |
- icS15Fixed16Number e22; /* e22 in the 3 * 3 */ |
- icUInt16Number inputEnt; /* Num of in-table entries */ |
- icUInt16Number outputEnt; /* Num of out-table entries */ |
- icUInt16Number data[icAny]; /* Data follows see spec */ |
-/* |
- * Data that follows is of this form |
- * |
- * icUInt16Number inputTable[inputChan][icAny]; * The in-table |
- * icUInt16Number clutTable[icAny]; * The clut |
- * icUInt16Number outputTable[outputChan][icAny]; * The out-table |
- */ |
-} icLut16; |
- |
-/* lut8, input & output tables are always 256 bytes in length */ |
-typedef struct { |
- icUInt8Number inputChan; /* Num of input channels */ |
- icUInt8Number outputChan; /* Num of output channels */ |
- icUInt8Number clutPoints; /* Num of grid points */ |
- icInt8Number pad; |
- icS15Fixed16Number e00; /* e00 in the 3 * 3 */ |
- icS15Fixed16Number e01; /* e01 in the 3 * 3 */ |
- icS15Fixed16Number e02; /* e02 in the 3 * 3 */ |
- icS15Fixed16Number e10; /* e10 in the 3 * 3 */ |
- icS15Fixed16Number e11; /* e11 in the 3 * 3 */ |
- icS15Fixed16Number e12; /* e12 in the 3 * 3 */ |
- icS15Fixed16Number e20; /* e20 in the 3 * 3 */ |
- icS15Fixed16Number e21; /* e21 in the 3 * 3 */ |
- icS15Fixed16Number e22; /* e22 in the 3 * 3 */ |
- icUInt8Number data[icAny]; /* Data follows see spec */ |
-/* |
- * Data that follows is of this form |
- * |
- * icUInt8Number inputTable[inputChan][256]; * The in-table |
- * icUInt8Number clutTable[icAny]; * The clut |
- * icUInt8Number outputTable[outputChan][256]; * The out-table |
- */ |
-} icLut8; |
- |
-/* Measurement Data */ |
-typedef struct { |
- icStandardObserver stdObserver; /* Standard observer */ |
- icXYZNumber backing; /* XYZ for backing */ |
- icMeasurementGeometry geometry; /* Meas. geometry */ |
- icMeasurementFlare flare; /* Measurement flare */ |
- icIlluminant illuminant; /* Illuminant */ |
-} icMeasurement; |
- |
-/* Named color */ |
- |
-/* |
- * icNamedColor2 takes the place of icNamedColor |
- */ |
-typedef struct { |
- icUInt32Number vendorFlag; /* Bottom 16 bits for IC use */ |
- icUInt32Number count; /* Count of named colors */ |
- icUInt32Number nDeviceCoords; /* Num of device coordinates */ |
- icInt8Number prefix[32]; /* Prefix for each color name */ |
- icInt8Number suffix[32]; /* Suffix for each color name */ |
- icInt8Number data[icAny]; /* Named color data follows */ |
-/* |
- * Data that follows is of this form |
- * |
- * icInt8Number root1[32]; * Root name for 1st color |
- * icUInt16Number pcsCoords1[icAny]; * PCS coords of 1st color |
- * icUInt16Number deviceCoords1[icAny]; * Dev coords of 1st color |
- * icInt8Number root2[32]; * Root name for 2nd color |
- * icUInt16Number pcsCoords2[icAny]; * PCS coords of 2nd color |
- * icUInt16Number deviceCoords2[icAny]; * Dev coords of 2nd color |
- * : |
- * : |
- * Repeat for name and PCS and device color coordinates up to (count-1) |
- * |
- * NOTES: |
- * PCS and device space can be determined from the header. |
- * |
- * PCS coordinates are icUInt16 numbers and are described in Annex A of |
- * the ICC spec. Only 16 bit L*a*b* and XYZ are allowed. The number of |
- * coordinates is consistent with the headers PCS. |
- * |
- * Device coordinates are icUInt16 numbers where 0x0000 represents |
- * the minimum value and 0xFFFF represents the maximum value. |
- * If the nDeviceCoords value is 0 this field is not given. |
- */ |
-} icNamedColor2; |
- |
-/* Profile sequence structure */ |
-typedef struct { |
- icSignature deviceMfg; /* Dev Manufacturer */ |
- icSignature deviceModel; /* Dev Model */ |
- icUInt64Number attributes; /* Dev attributes */ |
- icTechnologySignature technology; /* Technology sig */ |
- icInt8Number data[icAny]; /* Desc text follows */ |
-/* |
- * Data that follows is of this form, this is an icInt8Number |
- * to avoid problems with a compiler generating bad code as |
- * these arrays are variable in length. |
- * |
- * icTextDescription deviceMfgDesc; * Manufacturer text |
- * icTextDescription modelDesc; * Model text |
- */ |
-} icDescStruct; |
- |
-/* Profile sequence description */ |
-typedef struct { |
- icUInt32Number count; /* Number of descriptions */ |
- icUInt8Number data[icAny]; /* Array of desc structs */ |
-} icProfileSequenceDesc; |
- |
-/* textDescription */ |
-typedef struct { |
- icUInt32Number count; /* Description length */ |
- icInt8Number data[icAny]; /* Descriptions follow */ |
-/* |
- * Data that follows is of this form |
- * |
- * icInt8Number desc[count] * NULL terminated ascii string |
- * icUInt32Number ucLangCode; * UniCode language code |
- * icUInt32Number ucCount; * UniCode description length |
- * icInt16Number ucDesc[ucCount];* The UniCode description |
- * icUInt16Number scCode; * ScriptCode code |
- * icUInt8Number scCount; * ScriptCode count |
- * icInt8Number scDesc[67]; * ScriptCode Description |
- */ |
-} icTextDescription; |
- |
-/* Screening Data */ |
-typedef struct { |
- icS15Fixed16Number frequency; /* Frequency */ |
- icS15Fixed16Number angle; /* Screen angle */ |
- icSpotShape spotShape; /* Spot Shape encodings below */ |
-} icScreeningData; |
- |
-typedef struct { |
- icUInt32Number screeningFlag; /* Screening flag */ |
- icUInt32Number channels; /* Number of channels */ |
- icScreeningData data[icAny]; /* Array of screening data */ |
-} icScreening; |
- |
-/* Text Data */ |
-typedef struct { |
- icInt8Number data[icAny]; /* Variable array of chars */ |
-} icText; |
- |
-/* Structure describing either a UCR or BG curve */ |
-typedef struct { |
- icUInt32Number count; /* Curve length */ |
- icUInt16Number curve[icAny]; /* The array of curve values */ |
-} icUcrBgCurve; |
- |
-/* Under color removal, black generation */ |
-typedef struct { |
- icInt8Number data[icAny]; /* The Ucr BG data */ |
-/* |
- * Data that follows is of this form, this is a icInt8Number |
- * to avoid problems with a compiler generating bad code as |
- * these arrays are variable in length. |
- * |
- * icUcrBgCurve ucr; * Ucr curve |
- * icUcrBgCurve bg; * Bg curve |
- * icInt8Number string; * UcrBg description |
- */ |
-} icUcrBg; |
- |
-/* viewingConditionsType */ |
-typedef struct { |
- icXYZNumber illuminant; /* In candelas per sq. meter */ |
- icXYZNumber surround; /* In candelas per sq. meter */ |
- icIlluminant stdIluminant; /* See icIlluminant defines */ |
-} icViewingCondition; |
- |
-/* CrdInfo type */ |
-typedef struct { |
- icUInt32Number count; /* Char count includes NULL */ |
- icInt8Number desc[icAny]; /* Null terminated string */ |
-} icCrdInfo; |
- |
-/*------------------------------------------------------------------------*/ |
-/* |
- * Tag Type definitions |
- */ |
- |
-/* |
- * Many of the structures contain variable length arrays. This |
- * is represented by the use of the convention. |
- * |
- * type data[icAny]; |
- */ |
- |
-/* The base part of each tag */ |
-typedef struct { |
- icTagTypeSignature sig; /* Signature */ |
- icInt8Number reserved[4]; /* Reserved, set to 0 */ |
-} icTagBase; |
- |
-/* curveType */ |
-typedef struct { |
- icTagBase base; /* Signature, "curv" */ |
- icCurve curve; /* The curve data */ |
-} icCurveType; |
- |
-/* dataType */ |
-typedef struct { |
- icTagBase base; /* Signature, "data" */ |
- icData data; /* The data structure */ |
-} icDataType; |
- |
-/* dateTimeType */ |
-typedef struct { |
- icTagBase base; /* Signature, "dtim" */ |
- icDateTimeNumber date; /* The date */ |
-} icDateTimeType; |
- |
-/* lut16Type */ |
-typedef struct { |
- icTagBase base; /* Signature, "mft2" */ |
- icLut16 lut; /* Lut16 data */ |
-} icLut16Type; |
- |
-/* lut8Type, input & output tables are always 256 bytes in length */ |
-typedef struct { |
- icTagBase base; /* Signature, "mft1" */ |
- icLut8 lut; /* Lut8 data */ |
-} icLut8Type; |
- |
-/* Measurement Type */ |
-typedef struct { |
- icTagBase base; /* Signature, "meas" */ |
- icMeasurement measurement; /* Measurement data */ |
-} icMeasurementType; |
- |
-/* Named color type */ |
-/* icNamedColor2Type, replaces icNamedColorType */ |
-typedef struct { |
- icTagBase base; /* Signature, "ncl2" */ |
- icNamedColor2 ncolor; /* Named color data */ |
-} icNamedColor2Type; |
- |
-/* Profile sequence description type */ |
-typedef struct { |
- icTagBase base; /* Signature, "pseq" */ |
- icProfileSequenceDesc desc; /* The seq description */ |
-} icProfileSequenceDescType; |
- |
-/* textDescriptionType */ |
-typedef struct { |
- icTagBase base; /* Signature, "desc" */ |
- icTextDescription desc; /* The description */ |
-} icTextDescriptionType; |
- |
-/* s15Fixed16Type */ |
-typedef struct { |
- icTagBase base; /* Signature, "sf32" */ |
- icS15Fixed16Array data; /* Array of values */ |
-} icS15Fixed16ArrayType; |
- |
-typedef struct { |
- icTagBase base; /* Signature, "scrn" */ |
- icScreening screen; /* Screening structure */ |
-} icScreeningType; |
- |
-/* sigType */ |
-typedef struct { |
- icTagBase base; /* Signature, "sig" */ |
- icSignature signature; /* The signature data */ |
-} icSignatureType; |
- |
-/* textType */ |
-typedef struct { |
- icTagBase base; /* Signature, "text" */ |
- icText data; /* Variable array of chars */ |
-} icTextType; |
- |
-/* u16Fixed16Type */ |
-typedef struct { |
- icTagBase base; /* Signature, "uf32" */ |
- icU16Fixed16Array data; /* Variable array of values */ |
-} icU16Fixed16ArrayType; |
- |
-/* Under color removal, black generation type */ |
-typedef struct { |
- icTagBase base; /* Signature, "bfd " */ |
- icUcrBg data; /* ucrBg structure */ |
-} icUcrBgType; |
- |
-/* uInt16Type */ |
-typedef struct { |
- icTagBase base; /* Signature, "ui16" */ |
- icUInt16Array data; /* Variable array of values */ |
-} icUInt16ArrayType; |
- |
-/* uInt32Type */ |
-typedef struct { |
- icTagBase base; /* Signature, "ui32" */ |
- icUInt32Array data; /* Variable array of values */ |
-} icUInt32ArrayType; |
- |
-/* uInt64Type */ |
-typedef struct { |
- icTagBase base; /* Signature, "ui64" */ |
- icUInt64Array data; /* Variable array of values */ |
-} icUInt64ArrayType; |
- |
-/* uInt8Type */ |
-typedef struct { |
- icTagBase base; /* Signature, "ui08" */ |
- icUInt8Array data; /* Variable array of values */ |
-} icUInt8ArrayType; |
- |
-/* viewingConditionsType */ |
-typedef struct { |
- icTagBase base; /* Signature, "view" */ |
- icViewingCondition view; /* Viewing conditions */ |
-} icViewingConditionType; |
- |
-/* XYZ Type */ |
-typedef struct { |
- icTagBase base; /* Signature, "XYZ" */ |
- icXYZArray data; /* Variable array of XYZ nums */ |
-} icXYZType; |
- |
-/* CRDInfoType where [0] is the CRD product name count and string and |
- * [1] -[5] are the rendering intents 0-4 counts and strings |
- */ |
-typedef struct { |
- icTagBase base; /* Signature, "crdi" */ |
- icCrdInfo info; /* 5 sets of counts & strings */ |
-}icCrdInfoType; |
- /* icCrdInfo productName; PS product count/string */ |
- /* icCrdInfo CRDName0; CRD name for intent 0 */ |
- /* icCrdInfo CRDName1; CRD name for intent 1 */ |
- /* icCrdInfo CRDName2; CRD name for intent 2 */ |
- /* icCrdInfo CRDName3; CRD name for intent 3 */ |
- |
-/*------------------------------------------------------------------------*/ |
- |
-/* |
- * Lists of tags, tags, profile header and profile structure |
- */ |
- |
-/* A tag */ |
-typedef struct { |
- icTagSignature sig; /* The tag signature */ |
- icUInt32Number offset; /* Start of tag relative to |
- * start of header, Spec |
- * Clause 5 */ |
- icUInt32Number size; /* Size in bytes */ |
-} icTag; |
- |
-/* A Structure that may be used independently for a list of tags */ |
-typedef struct { |
- icUInt32Number count; /* Num tags in the profile */ |
- icTag tags[icAny]; /* Variable array of tags */ |
-} icTagList; |
- |
-/* The Profile header */ |
-typedef struct { |
- icUInt32Number size; /* Prof size in bytes */ |
- icSignature cmmId; /* CMM for profile */ |
- icUInt32Number version; /* Format version */ |
- icProfileClassSignature deviceClass; /* Type of profile */ |
- icColorSpaceSignature colorSpace; /* Clr space of data */ |
- icColorSpaceSignature pcs; /* PCS, XYZ or Lab */ |
- icDateTimeNumber date; /* Creation Date */ |
- icSignature magic; /* icMagicNumber */ |
- icPlatformSignature platform; /* Primary Platform */ |
- icUInt32Number flags; /* Various bits */ |
- icSignature manufacturer; /* Dev manufacturer */ |
- icUInt32Number model; /* Dev model number */ |
- icUInt64Number attributes; /* Device attributes */ |
- icUInt32Number renderingIntent;/* Rendering intent */ |
- icXYZNumber illuminant; /* Profile illuminant */ |
- icSignature creator; /* Profile creator */ |
- icInt8Number reserved[44]; /* Reserved */ |
-} icHeader; |
- |
-/* |
- * A profile, |
- * we can't use icTagList here because its not at the end of the structure |
- */ |
-typedef struct { |
- icHeader header; /* The header */ |
- icUInt32Number count; /* Num tags in the profile */ |
- icInt8Number data[icAny]; /* The tagTable and tagData */ |
-/* |
- * Data that follows is of the form |
- * |
- * icTag tagTable[icAny]; * The tag table |
- * icInt8Number tagData[icAny]; * The tag data |
- */ |
-} icProfile; |
- |
-/*------------------------------------------------------------------------*/ |
-/* Obsolete entries */ |
- |
-/* icNamedColor was replaced with icNamedColor2 */ |
-typedef struct { |
- icUInt32Number vendorFlag; /* Bottom 16 bits for IC use */ |
- icUInt32Number count; /* Count of named colors */ |
- icInt8Number data[icAny]; /* Named color data follows */ |
-/* |
- * Data that follows is of this form |
- * |
- * icInt8Number prefix[icAny]; * Prefix |
- * icInt8Number suffix[icAny]; * Suffix |
- * icInt8Number root1[icAny]; * Root name |
- * icInt8Number coords1[icAny]; * Color coordinates |
- * icInt8Number root2[icAny]; * Root name |
- * icInt8Number coords2[icAny]; * Color coordinates |
- * : |
- * : |
- * Repeat for root name and color coordinates up to (count-1) |
- */ |
-} icNamedColor; |
- |
-/* icNamedColorType was replaced by icNamedColor2Type */ |
-typedef struct { |
- icTagBase base; /* Signature, "ncol" */ |
- icNamedColor ncolor; /* Named color data */ |
-} icNamedColorType; |
- |
-#endif /* ICC_H */ |
/Scribus/Scribus/scribus/icc34.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/templates/header_template |
=================================================================== |
--- Scribus/Scribus/scribus/templates/header_template (revision 6) |
+++ Scribus/Scribus/scribus/templates/header_template (nonexistent) |
@@ -1,16 +0,0 @@ |
-/*************************************************************************** |
- |FILENAME| - description |
- ------------------- |
- begin : |DATE| |
- copyright : (C) |YEAR| by |AUTHOR| |
- email : |EMAIL| |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
/Scribus/Scribus/scribus/templates/header_template |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/templates/.cvsignore |
=================================================================== |
--- Scribus/Scribus/scribus/templates/.cvsignore (revision 6) |
+++ Scribus/Scribus/scribus/templates/.cvsignore (nonexistent) |
@@ -1,4 +0,0 @@ |
-Makefile |
-Makefile.in |
-*.moc.cpp |
-*.moc |
/Scribus/Scribus/scribus/templates/.cvsignore |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/templates/cpp_template |
=================================================================== |
--- Scribus/Scribus/scribus/templates/cpp_template (revision 6) |
+++ Scribus/Scribus/scribus/templates/cpp_template (nonexistent) |
@@ -1,16 +0,0 @@ |
-/*************************************************************************** |
- |FILENAME| - description |
- ------------------- |
- begin : |DATE| |
- copyright : (C) |YEAR| by |AUTHOR| |
- email : |EMAIL| |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
/Scribus/Scribus/scribus/templates/cpp_template |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/templates |
=================================================================== |
--- Scribus/Scribus/scribus/templates (revision 6) |
+++ Scribus/Scribus/scribus/templates (nonexistent) |
/Scribus/Scribus/scribus/templates |
---|
Property changes: |
Deleted: svn:ignore |
## -1,4 +0,0 ## |
-Makefile |
-Makefile.in |
-*.moc.cpp |
-*.moc |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/iso8859-2ps.enc |
=================================================================== |
--- Scribus/Scribus/scribus/iso8859-2ps.enc (revision 6) |
+++ Scribus/Scribus/scribus/iso8859-2ps.enc (nonexistent) |
@@ -1,95 +0,0 @@ |
-16#A1 /Aogonek |
-16#A2 /breve |
-16#A3 /Lslash |
-16#A4 /currency |
-16#A5 /Lcaron |
-16#A6 /Sacute |
-16#A7 /section |
-16#A8 /dieresis |
-16#A9 /Scaron |
-16#AA /Scedilla |
-16#AB /Tcaron |
-16#AC /Zacute |
-16#AD /hyphen |
-16#AE /Zcaron |
-16#AF /Zdotaccent |
-16#B0 /degree |
-16#B1 /aogonek |
-16#B2 /ogonek |
-16#B3 /lslash |
-16#B4 /acute |
-16#B5 /lcaron |
-16#B6 /sacute |
-16#B7 /caron |
-16#B8 /cedilla |
-16#B9 /scaron |
-16#BA /scedilla |
-16#BB /tcaron |
-16#BC /zacute |
-16#BD /hungarumlaut |
-16#BE /zcaron |
-16#BF /zdotaccent |
-16#C0 /Racute |
-16#C1 /Aacute |
-16#C2 /Acircumflex |
-16#C3 /Abreve |
-16#C4 /Adieresis |
-16#C5 /Lacute |
-16#C6 /Cacute |
-16#C7 /Ccedilla |
-16#C8 /Ccaron |
-16#C9 /Eacute |
-16#CA /Eogonek |
-16#CB /Edieresis |
-16#CC /Ecaron |
-16#CD /Iacute |
-16#CE /Icircumflex |
-16#CF /Dcaron |
-16#D0 /Eth |
-16#D1 /Nacute |
-16#D2 /Ncaron |
-16#D3 /Oacute |
-16#D4 /Ocircumflex |
-16#D5 /Ohungarumlaut |
-16#D6 /Odieresis |
-16#D7 /multiply |
-16#D8 /Rcaron |
-16#D9 /Uring |
-16#DA /Uacute |
-16#DB /Uhungarumlaut |
-16#DC /Udieresis |
-16#DD /Yacute |
-16#DE /Tcommaaccent |
-16#DF /germandbls |
-16#E0 /racute |
-16#E1 /aacute |
-16#E2 /acircumflex |
-16#E3 /abreve |
-16#E4 /adieresis |
-16#E5 /lacute |
-16#E6 /cacute |
-16#E7 /ccedilla |
-16#E8 /ccaron |
-16#E9 /eacute |
-16#EA /eogonek |
-16#EB /edieresis |
-16#EC /ecaron |
-16#ED /iacute |
-16#EE /icircumflex |
-16#EF /dcaron |
-16#F0 /eth |
-16#F1 /nacute |
-16#F2 /ncaron |
-16#F3 /oacute |
-16#F4 /ocircumflex |
-16#F5 /ohungarumlaut |
-16#F6 /odieresis |
-16#F7 /divide |
-16#F8 /rcaron |
-16#F9 /uring |
-16#FA /uacute |
-16#FB /uhungarumlaut |
-16#FC /udieresis |
-16#FD /yacute |
-16#FE /tcommaaccent |
-16#FF /dotaccent |
/Scribus/Scribus/scribus/iso8859-2ps.enc |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/serializer.h |
=================================================================== |
--- Scribus/Scribus/scribus/serializer.h (revision 6) |
+++ Scribus/Scribus/scribus/serializer.h (nonexistent) |
@@ -1,42 +0,0 @@ |
-/*************************************************************************** |
- serializer.h - description |
- ------------------- |
- begin : Sat May 5 2001 |
- copyright : (C) 2001 by Franz Schmid |
- email : Franz.Schmid@altmuehlnet.de |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
- |
-#ifndef SERIALIZER_H |
-#define SERIALIZER_H |
- |
-#include <qstring.h> |
-#include "scribusview.h" |
-/** |
- *@author Franz Schmid |
- */ |
- |
-class Serializer { |
-public: |
- Serializer(QString name); |
- ~Serializer() {}; |
- QString Filename; |
- QString Objekt; |
- int Count; |
- |
- QString GetObjekt(); |
- void PutText(PageItem *Item); |
- void GetText(PageItem *Item, int Absatz, bool Append = false); |
- bool Write(); |
- bool Read(); |
-}; |
- |
-#endif |
/Scribus/Scribus/scribus/serializer.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/bookpalette.h |
=================================================================== |
--- Scribus/Scribus/scribus/bookpalette.h (revision 6) |
+++ Scribus/Scribus/scribus/bookpalette.h (nonexistent) |
@@ -1,45 +0,0 @@ |
-/*************************************************************************** |
- bookpalette.h - description |
- ------------------- |
- begin : Son Jan 19 2003 |
- copyright : (C) 2003 by Franz Schmid |
- email : Franz.Schmid@altmuehlnet.de |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
- |
-#ifndef BOOKPALETTE_H |
-#define BOOKPALETTE_H |
- |
-#include <qdialog.h> |
-#include <qlayout.h> |
-#include <bookmwin.h> |
-/** |
- *@author Franz Schmid |
- */ |
- |
-class BookPalette : public QDialog |
-{ |
- Q_OBJECT |
- |
-public: |
- BookPalette(QWidget* parent); |
- ~BookPalette() {}; |
- void closeEvent(QCloseEvent *ce); |
- BookMView *BView; |
- |
-signals: |
- void Schliessen(); |
- |
-protected: |
- QVBoxLayout* PaletteLayout; |
-}; |
- |
-#endif |
/Scribus/Scribus/scribus/bookpalette.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/vruler.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/vruler.cpp (revision 6) |
+++ Scribus/Scribus/scribus/vruler.cpp (nonexistent) |
@@ -1,152 +0,0 @@ |
-/*************************************************************************** |
- vruler.cpp - description |
- ------------------- |
- begin : Wed Apr 11 2001 |
- copyright : (C) 2001 by Franz Schmid |
- email : Franz.Schmid@altmuehlnet.de |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
- |
-#include "vruler.h" |
-#include "vruler.moc" |
-#include "page.h" |
-#include <qcursor.h> |
-Vruler::Vruler(QScrollView *pa, ScribusDoc *doc) : QWidget(pa) |
-{ |
- setEraseColor(QColor(255,255,255)); |
- doku = doc; |
- rfont = font(); |
- rfont.setPointSize(9); |
- offs = -12; |
- Markp = 0; |
- oldMark = 0; |
- Mpressed = false; |
-} |
- |
-void Vruler::mousePressEvent(QMouseEvent *) |
-{ |
- Mpressed = true; |
- qApp->setOverrideCursor(QCursor(SplitVCursor), true); |
-} |
- |
-void Vruler::mouseReleaseEvent(QMouseEvent *m) |
-{ |
- Mpressed = false; |
- doku->ActPage->DrVX = -1; |
- doku->ActPage->SetXGuide(m); |
- qApp->setOverrideCursor(QCursor(ArrowCursor), true); |
-} |
- |
-void Vruler::mouseMoveEvent(QMouseEvent *m) |
-{ |
- if ((Mpressed) && (m->pos().x() > width())) |
- doku->ActPage->FromVRuler(m); |
-} |
- |
-void Vruler::paintEvent(QPaintEvent *) |
-{ |
- int xx, pc; |
- float of, xl, iter, iter2; |
- float sc = doku->Scale; |
- switch (doku->Einheit) |
- { |
- case 0: |
- iter = 10.0; |
- iter2 = iter * 10.0; |
- break; |
- case 1: |
- iter = (10.0 / 25.4) * 72.0; |
- iter2 = iter * 10.0; |
- break; |
- case 2: |
- iter = 18.0; |
- iter2 = 72.0; |
- break; |
- case 3: |
- iter = 12.0; |
- iter2 = 120.0; |
- break; |
- } |
- QPainter p; |
- p.begin(this); |
- p.drawLine(24, 0, 24, height()); |
- p.translate(0, -offs); |
- p.setBrush(black); |
- p.setPen(black); |
- p.setFont(rfont); |
- p.scale(1.0, sc); |
- if ((doku->PageFP) && (doku->PagesSbS)) |
- { |
- if (doku->FirstPageLeft) |
- { |
- if (doku->PageC % 2 == 0) |
- pc = doku->PageC / 2; |
- else |
- pc = (doku->PageC+1) / 2; |
- } |
- else |
- { |
- if (doku->PageC % 2 == 0) |
- pc = doku->PageC / 2 + 1; |
- else |
- pc = doku->PageC / 2 + 1; |
- } |
- } |
- else |
- pc = doku->PageC; |
- for (xx = 0; xx < pc; ++xx) |
- { |
- of = xx * (doku->PageH+30.0); |
- for (xl = 0; xl < doku->PageH; xl += iter) |
- { |
- p.drawLine(18, static_cast<int>(xl+of), 24, static_cast<int>(xl+of)); |
- } |
- for (xl = 0; xl < doku->PageH+(iter2/2); xl += iter2) |
- { |
- p.drawLine(11, static_cast<int>(xl+of), 24, static_cast<int>(xl+of)); |
- p.save(); |
- p.scale(1.0, 1.0 / sc); |
- switch (doku->Einheit) |
- { |
- case 2: |
- p.drawText(9, static_cast<int>((xl+of+qRound(10/sc)) * sc), QString::number(xl / iter2)); |
- break; |
- case 3: |
- p.drawText(9, static_cast<int>((xl+of+qRound(10/sc)) * sc), QString::number(xl / iter)); |
- break; |
- default: |
- p.drawText(9, static_cast<int>((xl+of+qRound(10/sc)) * sc), QString::number(xl / iter * 10)); |
- break; |
- } |
- p.restore(); |
- } |
- } |
- p.end(); |
-} |
-/** Zeichnet den Pfeil */ |
-void Vruler::Draw(int wo) |
-{ |
- Markp = wo-qRound(10*doku->Scale); |
- QPainter p; |
- p.begin(this); |
- p.translate(0, -offs); |
- p.setPen(white); |
- p.setBrush(white); |
- p.drawRect(0, oldMark-3, 10, 6); |
- p.setPen(red); |
- p.setBrush(red); |
- QPointArray cr; |
- cr.setPoints(3, 9, Markp, 0, Markp+2, 0, Markp-2); |
- p.drawPolygon(cr); |
- p.end(); |
- oldMark = Markp; |
-} |
- |
/Scribus/Scribus/scribus/vruler.cpp |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/kimageeffect.h |
=================================================================== |
--- Scribus/Scribus/scribus/kimageeffect.h (revision 6) |
+++ Scribus/Scribus/scribus/kimageeffect.h (nonexistent) |
@@ -1,555 +0,0 @@ |
-/* This file is part of the KDE libraries |
- Copyright (C) 1998, 1999, 2001, 2002 Daniel M. Duley <mosfet@interaccess.com> |
- (C) 1998, 1999 Christian Tibirna <ctibirna@total.net> |
- (C) 1998, 1999 Dirk A. Mueller <mueller@kde.org> |
- |
-Redistribution and use in source and binary forms, with or without |
-modification, are permitted provided that the following conditions |
-are met: |
- |
-1. Redistributions of source code must retain the above copyright |
- notice, this list of conditions and the following disclaimer. |
-2. Redistributions in binary form must reproduce the above copyright |
- notice, this list of conditions and the following disclaimer in the |
- documentation and/or other materials provided with the distribution. |
- |
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
- |
-*/ |
- |
-// $Id$ |
- |
-#ifndef __KIMAGE_EFFECT_H |
-#define __KIMAGE_EFFECT_H |
- |
-class QImage; |
-class QSize; |
-class QColor; |
- |
-/** |
- * This class includes various @ref QImage based graphical effects. |
- * |
- * Everything is |
- * static, so there is no need to create an instance of this class. You can |
- * just call the static methods. They are encapsulated here merely to provide |
- * a common namespace. |
- */ |
- |
-class KImageEffect |
-{ |
-public: |
- enum GradientType { VerticalGradient, HorizontalGradient, |
- DiagonalGradient, CrossDiagonalGradient, |
- PyramidGradient, RectangleGradient, |
- PipeCrossGradient, EllipticGradient }; |
- enum RGBComponent { Red, Green, Blue, Gray, All }; |
- |
- enum Lighting {NorthLite, NWLite, WestLite, SWLite, |
- SouthLite, SELite, EastLite, NELite}; |
- |
- enum ModulationType { Intensity, Saturation, HueShift, Contrast }; |
- |
- enum NoiseType { UniformNoise=0, GaussianNoise, MultiplicativeGaussianNoise, |
- ImpulseNoise, LaplacianNoise, PoissonNoise}; |
- |
- enum RotateDirection{ Rotate90, Rotate180, Rotate270 }; |
- |
- /** |
- * Create a gradient from color a to color b of the specified type. |
- * |
- * @param size The desired size of the gradient. |
- * @param ca Color a |
- * @param cb Color b |
- * @param type The type of gradient. |
- * @param ncols The number of colors to use when not running on a |
- * truecolor display. The gradient will be dithered to this number of |
- * colors. Pass 0 to prevent dithering. |
- */ |
- static QImage gradient(const QSize &size, const QColor &ca, |
- const QColor &cb, GradientType type, int ncols=3); |
- |
- /** |
- * Create an unbalanced gradient. |
- |
- * An unbalanced gradient is a gradient where the transition from |
- * color a to color b is not linear, but in this case, exponential. |
- * |
- * @param size The desired size of the gradient. |
- * @param ca Color a |
- * @param cb Color b |
- * @param type The type of gradient. |
- * @param xfactor The x decay length. Use a value between -200 and 200. |
- * @param yfactor The y decay length. |
- * @param ncols The number of colors. See KPixmapEffect:gradient. |
- */ |
- static QImage unbalancedGradient(const QSize &size, const QColor &ca, |
- const QColor &cb, GradientType type, int xfactor = 100, |
- int yfactor = 100, int ncols = 3); |
- |
- /** |
- * Blends a color into the destination image, using an opacity |
- * value for blending one into another. Very fast direct pixel |
- * manipulation is used. |
- * |
- * @author Karol Szwed (gallium@kde.org) |
- * @param clr source color to be blended into the destination image. |
- * @param dst destination image in which the source will be blended into. |
- * @param opacity opacity (in percent) which determines how much the source |
- * color will be blended into the destination image. |
- * @return The destination image (dst) containing the result. |
- */ |
- static QImage& blend(const QColor& clr, QImage& dst, float opacity); |
- |
- /** |
- * Blend the src image into the destination image, using an opacity |
- * value for blending one into another. Very fast direct pixel |
- * manipulation is used. |
- * |
- * @author Karol Szwed (gallium@kde.org) |
- * @param src source image to be blended into the destination image. |
- * @param dst destination image in which the source will be blended into. |
- * @param opacity opacity (in percent) which determines how much the source |
- * image will be blended into the destination image. |
- * @return The destination image (dst) containing the result. |
- */ |
- static QImage& blend(QImage& src, QImage& dst, float opacity); |
- |
- /** |
- * Blend the provided image into a background of the indicated color. |
- * |
- * @param initial_intensity this parameter takes values from -1 to 1: |
- * a) if positive: how much to fade the image in its |
- * less affected spot |
- * b) if negative: roughly indicates how much of the image |
- * remains unaffected |
- * @param bgnd indicates the color of the background to blend in |
- * @param eff lets you choose what kind of blending you like |
- * @param anti_dir blend in the opposite direction (makes no much sense |
- * with concentric blending effects) |
- * @param image must be 32bpp |
- */ |
- static QImage& blend(QImage &image, float initial_intensity, |
- const QColor &bgnd, GradientType eff, |
- bool anti_dir=false); |
- |
- /** |
- * Blend an image into another one, using a gradient type |
- * for blending from one to another. |
- * |
- * @param image1 source1 and result of blending |
- * @param image2 source2 of blending |
- * @param gt gradient type for blending between source1 and source2 |
- * @param xf x decay length for unbalanced gradient tpye |
- * @param yf y decay length for unbalanced gradient tpye |
- */ |
- static QImage& blend(QImage &image1,QImage &image2, |
- GradientType gt, int xf=100, int yf=100); |
- |
- /** |
- * Blend an image into another one, using a color channel of a |
- * third image for the decision of blending from one to another. |
- * |
- * @param image1 Source 1 and result of blending |
- * @param image2 Source 2 of blending |
- * @param blendImage If the gray value of of pixel is 0, the result |
- * for this pixel is that of image1; for a gray value |
- * of 1, the pixel of image2 is used; for a value |
- * inbetween, a corresponding blending is used. |
- * @param channel The RBG channel to use for the blending decision. |
- */ |
- static QImage& blend(QImage &image1, QImage &image2, |
- QImage &blendImage, RGBComponent channel); |
- |
- /** |
- * Blend an image into another one, using alpha in the expected way. |
- * @author Rik Hemsley (rikkus) <rik@kde.org> |
- */ |
- static bool blend(const QImage & upper, const QImage & lower, QImage & output); |
-// Not yet... static bool blend(const QImage & image1, const QImage & image2, QImage & output, const QRect & destRect); |
- |
- /** |
- * Blend an image into another one, using alpha in the expected way and |
- * over coordinates @p x and @p y with respect to the lower image. |
- * The output is a QImage which is the @p upper image already blended |
- * with the @p lower one, so its size will be (in general) the same than |
- * @p upper instead of the same size than @p lower like the method above. |
- * In fact, the size of @p output is like upper's one only when it can be |
- * painted on lower, if there has to be some clipping, output's size will |
- * be the clipped area and x and y will be set to the correct up-left corner |
- * where the clipped rectangle begins. |
- */ |
- static bool blend(int &x, int &y, const QImage & upper, const QImage & lower, QImage & output); |
- /** |
- * Blend an image into another one, using alpha in the expected way and |
- * over coordinates @p x and @p y with respect to the lower image. |
- * The output is painted in the own @p lower image. This is an optimization |
- * of the @ref blend method above provided by convenience. |
- */ |
- static bool blendOnLower(int x, int y, const QImage & upper, const QImage & lower); |
- |
- /** |
- * Modifies the intensity of a pixmap's RGB channel component. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param image The QImage to process. |
- * @param percent Percent value. Use a negative value to dim. |
- * @param channel Which channel(s) should be modified |
- * @return The @p image, provided for convenience. |
- */ |
- static QImage& channelIntensity(QImage &image, float percent, |
- RGBComponent channel); |
- |
- /** |
- * Fade an image to a certain background color. |
- * |
- * The number of colors will not be changed. |
- * |
- * @param image The QImage to process. |
- * @param val The strength of the effect. 0 <= val <= 1. |
- * @param color The background color. |
- * @return Returns the @ref image(), provided for convenience. |
- */ |
- static QImage& fade(QImage &img, float val, const QColor &color); |
- |
- |
- /** |
- * This recolors a pixmap. The most dark color will become color a, |
- * the most bright one color b, and in between. |
- * |
- * @param image A QImage to process. |
- * @param ca Color a |
- * @param cb Color b |
- */ |
- static QImage& flatten(QImage &image, const QColor &ca, |
- const QColor &cb, int ncols=0); |
- |
- /** |
- * Build a hash on any given @ref QImage |
- * |
- * @param image The QImage to process |
- * @param lite The hash faces the indicated lighting (cardinal poles). |
- * @param spacing How many unmodified pixels inbetween hashes. |
- * @return Returns the @ref image(), provided for convenience. |
- */ |
- static QImage& hash(QImage &image, Lighting lite=NorthLite, |
- unsigned int spacing=0); |
- |
- /** |
- * Either brighten or dim the image by a specified percent. |
- * For example, .50 will modify the colors by 50%. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param image The QImage to process. |
- * @param percent The percent value. Use a negative value to dim. |
- * @return Returns The @ref image(), provided for convenience. |
- */ |
- static QImage& intensity(QImage &image, float percent); |
- |
- /** |
- * Modulate the image with a color channel of another image. |
- * |
- * @param image The QImage to modulate and result. |
- * @param modImage The QImage to use for modulation. |
- * @param reverse Invert the meaning of image/modImage; result is image! |
- * @param type The modulation Type to use. |
- * @param factor The modulation amplitude; with 0 no effect [-200;200]. |
- * @param channel The RBG channel of image2 to use for modulation. |
- * @return Returns the @ref image(), provided for convenience. |
- */ |
- static QImage& modulate(QImage &image, QImage &modImage, bool reverse, |
- ModulationType type, int factor, RGBComponent channel); |
- |
- /** |
- * Convert an image to grayscale. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param image The @ref QImage to process. |
- * @param fast Set to @p true in order to use a faster but non-photographic |
- * quality algorithm. Appropriate for things such as toolbar icons. |
- * @return Returns the @ref image(), provided for convenience. |
- */ |
- static QImage& toGray(QImage &image, bool fast = false); |
- |
- /** |
- * Desaturate an image evenly. |
- * |
- * @param image The QImage to process. |
- * @param desat A value between 0 and 1 setting the degree of desaturation |
- * @return Returns the @ref image(), provided for convenience. |
- */ |
- static QImage& desaturate(QImage &image, float desat = 0.3); |
- |
- /** |
- * Fast, but low quality contrast of an image. Also see contrastHSV. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param image The QImage to process. |
- * @param c A contrast value between -255 to 255. |
- * @return The @ref image(), provided for convenience. |
- */ |
- static QImage& contrast(QImage &image, int c); |
- |
- /** |
- * Dither an image using Floyd-Steinberg dithering for low-color |
- * situations. |
- * |
- * @param image The QImage to process. |
- * @param palette The color palette to use |
- * @param size The size of the palette |
- * @return Returns the @ref image(), provided for convenience. |
- */ |
- static QImage& dither(QImage &img, const QColor *palette, int size); |
- |
- /** |
- * Calculate the image for a selected image, for instance a selected icon |
- * on the desktop. |
- * @param img the QImage to select |
- * @param col the selected color, usually from QColorGroup::highlight(). |
- */ |
- static QImage& selectedImage( QImage &img, const QColor &col ); |
- |
- /** |
- * High quality, expensive HSV contrast. You can do a faster one by just |
- * taking a intensity threshold (ie: 128) and incrementing RGB color |
- * channels above it and decrementing those below it, but this gives much |
- * better results. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param img The QImage to process. |
- * @param sharpen If true sharpness is increase, (spiffed). Otherwise |
- * it is decreased, (dulled). |
- */ |
- static void contrastHSV(QImage &img, bool sharpen=true); |
- |
- /** |
- * Normalizes the pixel values to span the full range of color values. |
- * This is a contrast enhancement technique. |
- * @author Daniel M. Duley (mosfet) |
- */ |
- static void normalize(QImage &img); |
- |
- /** |
- * Performs histogram equalization on the reference |
- * image. |
- * @author Daniel M. Duley (mosfet) |
- */ |
- static void equalize(QImage &img); |
- |
- /** |
- * Thresholds the reference image. You can also threshold images by using |
- * ThresholdDither in the various QPixmap/QImage convert methods, but this |
- * lets you specify a threshold value. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param img The QImage to process. |
- * @param value The threshold value. |
- */ |
- static void threshold(QImage &img, unsigned int value=128); |
- |
- /** |
- * Produces a 'solarization' effect seen when exposing a photographic |
- * film to light during the development process. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param img The QImage to process. |
- * @param factor The extent of the solarization (0-99.9) |
- */ |
- static void solarize(QImage &img, double factor=50.0); |
- |
- /** |
- * Embosses the source image. This involves highlighting the edges |
- * and applying various other enhancements in order to get a metal |
- * effect. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @return The embossed image. The original is not changed. |
- */ |
- static QImage emboss(QImage &src); |
- |
- /** |
- * Minimizes speckle noise in the source image using the 8 hull |
- * algorithm. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @return The despeckled image. The original is not changed. |
- */ |
- static QImage despeckle(QImage &src); |
- |
- /** |
- * Produces a neat little "charcoal" effect. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param factor The factor for detecting lines (0-99.0). |
- * @return The charcoal image. The original is not changed. |
- */ |
- static QImage charcoal(QImage &src, double factor=50.0); |
- |
- /** |
- * Rotates the image by the specified amount |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param r The rotate direction. |
- * @return The rotated image. The original is not changed. |
- */ |
- static QImage rotate(QImage &src, RotateDirection r); |
- |
- /** |
- * Scales an image using simple pixel sampling. This does not produce |
- * nearly as nice a result as QImage::smoothScale(), but has the |
- * advantage of being much faster - only a few milliseconds. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param w The new width. |
- * @param h The new height. |
- * @return The scaled image. The original is not changed. |
- */ |
- static QImage sample(QImage &src, int w, int h); |
- |
- /** |
- * Adds noise to an image. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param type The algorithm used to generate the noise. |
- * @return The image with noise added. The original is not changed. |
- */ |
- static QImage addNoise(QImage &src, NoiseType type = GaussianNoise); |
- |
- /** |
- * Blurs an image by convolving pixel neighborhoods. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param factor The percent weight to give to the center pixel. |
- * @return The blurred image. The original is not changed. |
- */ |
- static QImage blur(QImage &src, double factor=50.0); |
- |
- /** |
- * Detects edges in an image using pixel neighborhoods and an edge |
- * detection mask. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param factor The percent weight to give to the center pixel. |
- * @return The image with edges detected. The original is not changed. |
- */ |
- static QImage edge(QImage &src, double factor=50.0); |
- |
- /** |
- * Implodes an image by a specified percent. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param factor The extent of the implosion. |
- * @param background An RGBA value to use for the background. After the |
- * effect some pixels may be "empty". This value is used for those pixels. |
- * @return The imploded image. The original is not changed. |
- */ |
- static QImage implode(QImage &src, double factor=30.0, |
- unsigned int background = 0xFFFFFFFF); |
- /** |
- * Produces an oil painting effect. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param radius The radius of the pixel neighborhood used in applying the |
- * effect. |
- * @return The new image. The original is not changed. |
- */ |
- static QImage oilPaint(QImage &src, int radius=3); |
- |
- /** |
- * Sharpens the pixels in the image using pixel neighborhoods. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param factor The percent weight to give to the center pixel. |
- * @return The sharpened image. The original is not changed. |
- */ |
- static QImage sharpen(QImage &src, double factor=30.0); |
- |
- /** |
- * Randomly displaces pixels. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param amount The vicinity for choosing a random pixel to swap. |
- * @return The image with pixels displaced. The original is not changed. |
- */ |
- static QImage spread(QImage &src, unsigned int amount=3); |
- |
- /** |
- * Shades the image using a distance light source. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param color_shading If true do color shading, otherwise do grayscale. |
- * @param azimuth Determines the light source and direction. |
- * @param elevation Determines the light source and direction. |
- * @return The shaded image. The original is not changed. |
- */ |
- static QImage shade(QImage &src, bool color_shading=true, double azimuth=30.0, |
- double elevation=30.0); |
- /** |
- * Swirls the image by a specified amount |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param degrees The tightness of the swirl. |
- * @param background An RGBA value to use for the background. After the |
- * effect some pixels may be "empty". This value is used for those pixels. |
- * @return The swirled image. The original is not changed. |
- */ |
- static QImage swirl(QImage &src, double degrees=50.0, unsigned int background = |
- 0xFFFFFFFF); |
- |
- /** |
- * Modifies the pixels along a sine wave. |
- * |
- * @author Daniel M. Duley (mosfet) |
- * @param src The QImage to process. |
- * @param amplitude The amplitude of the sine wave. |
- * @param wavelength The frequency of the sine wave. |
- * @return The new image. The original is not changed. |
- */ |
- static QImage wave(QImage &src, double amplitude=25.0, double frequency=150.0, |
- unsigned int background = 0xFFFFFFFF); |
- |
-private: |
- |
- /** |
- * Helper function to fast calc some altered (lighten, shaded) colors |
- * |
- */ |
- static unsigned int lHash(unsigned int c); |
- static unsigned int uHash(unsigned int c); |
- |
- /** |
- * Helper function to find the nearest color to the RBG triplet |
- */ |
- static int nearestColor( int r, int g, int b, const QColor *pal, int size ); |
- |
- static void hull(const int x_offset, const int y_offset, const int polarity, |
- const int width, const int height, |
- unsigned int *f, unsigned int *g); |
- static unsigned int generateNoise(unsigned int pixel, NoiseType type); |
- static unsigned int interpolateColor(QImage *image, double x, double y, |
- unsigned int background); |
-}; |
- |
-#endif |
/Scribus/Scribus/scribus/kimageeffect.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/edit1format.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/edit1format.cpp (revision 6) |
+++ Scribus/Scribus/scribus/edit1format.cpp (nonexistent) |
@@ -1,295 +0,0 @@ |
-#include "edit1format.h" |
-#include "edit1format.moc" |
-extern QPixmap loadIcon(QString nam); |
-#include <qmessagebox.h> |
- |
-EditStyle::EditStyle( QWidget* parent, struct StVorL *vor, QValueList<StVorL> v, bool neu, SCFonts *avail, float au) |
- : QDialog( parent, "EditST", true, 0) |
-{ |
- setCaption( tr( "Edit Style" ) ); |
- setIcon(loadIcon("AppIcon.xpm")); |
- AutoVal = au; |
- EditStyleLayout = new QGridLayout( this ); |
- EditStyleLayout->setSpacing( 6 ); |
- EditStyleLayout->setMargin( 10 ); |
- |
- TextLabel1 = new QLabel( this, "TextLabel1" ); |
- TextLabel1->setText( tr( "Name:" ) ); |
- EditStyleLayout->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 ); |
- |
- Name = new QLineEdit( this, "Name" ); |
- Name->setMinimumSize( QSize( 200, 22 ) ); |
- Name->setText( vor->Vname ); |
- OldName = vor->Vname; |
- IsNew = neu; |
- EditStyleLayout->addMultiCellWidget( Name, 1, 1, 0, 1 ); |
- |
- GroupFont = new QGroupBox( this, "GroupFont" ); |
- GroupFont->setTitle( tr( "Character" ) ); |
- GroupFont->setColumnLayout(0, Qt::Vertical ); |
- GroupFont->layout()->setSpacing( 5 ); |
- GroupFont->layout()->setMargin( 10 ); |
- GroupFontLayout = new QGridLayout( GroupFont->layout() ); |
- GroupFontLayout->setAlignment( Qt::AlignTop ); |
- TextF1 = new QLabel( GroupFont, "TextF1" ); |
- TextF1->setMinimumSize( QSize( 50, 22 ) ); |
- TextF1->setText( tr( "Face:" ) ); |
- GroupFontLayout->addWidget( TextF1, 0, 0 ); |
- FontC = new QComboBox( true, GroupFont, "FontC" ); |
- FontC->setEditable(false); |
- FontC->setMinimumSize( QSize( 140, 22 ) ); |
- QStringList rlist; |
- rlist.clear(); |
- SCFontsIterator it(*avail); |
- for ( ; it.current(); ++it) |
- { |
- if (it.current()->UseFont) |
- rlist.append(it.currentKey()); |
- } |
- rlist.sort(); |
- FontC->insertStringList(rlist); |
- for (int fc=0; fc<FontC->count(); ++fc) |
- { |
- if (FontC->text(fc) == vor->Font) |
- { |
- FontC->setCurrentItem(fc); |
- break; |
- } |
- } |
- |
- GroupFontLayout->addWidget( FontC, 0, 1 ); |
- SizeC = new QSpinBox( GroupFont, "SizeC" ); |
- SizeC->setMinimumSize( QSize( 70, 22 ) ); |
- SizeC->setSuffix( tr( " pt" ) ); |
- SizeC->setMinValue(1); |
- SizeC->setMaxValue(512); |
- SizeC->setValue(vor->FontSize); |
- |
- GroupFontLayout->addWidget( SizeC, 1, 1 ); |
- TextF2 = new QLabel( GroupFont, "TextF2" ); |
- TextF2->setMinimumSize( QSize( 50, 22 ) ); |
- TextF2->setText( tr( "Size:" ) ); |
- GroupFontLayout->addWidget( TextF2, 1, 0 ); |
- EditStyleLayout->addWidget( GroupFont, 2, 0 ); |
- |
- GroupBox10 = new QGroupBox( this, "GroupBox10" ); |
- GroupBox10->setTitle( tr( "Indentation" ) ); |
- GroupBox10->setColumnLayout(0, Qt::Vertical ); |
- GroupBox10->layout()->setSpacing( 0 ); |
- GroupBox10->layout()->setMargin( 0 ); |
- GroupBox10Layout = new QGridLayout( GroupBox10->layout() ); |
- GroupBox10Layout->setAlignment( Qt::AlignTop ); |
- GroupBox10Layout->setSpacing( 5 ); |
- GroupBox10Layout->setMargin( 10 ); |
- TextLabel1_2 = new QLabel( GroupBox10, "TextLabel1_2" ); |
- TextLabel1_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel1_2->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel1_2->setMinimumSize( QSize( 90, 22 ) ); |
- TextLabel1_2->setText( tr( "Left Indent:" ) ); |
- GroupBox10Layout->addWidget( TextLabel1_2, 1, 0 ); |
- TextLabel2 = new QLabel( GroupBox10, "TextLabel2" ); |
- TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel2->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel2->setMinimumSize( QSize( 90, 22 ) ); |
- TextLabel2->setText( tr( "First Line:" ) ); |
- GroupBox10Layout->addWidget( TextLabel2, 0, 0 ); |
- |
- LeftInd = new MSpinBox( GroupBox10, 1 ); |
- LeftInd->setSuffix( tr( " pt" ) ); |
- LeftInd->setMaxValue( 3000 ); |
- LeftInd->setMinValue( -3000 ); |
- LeftInd->setLineStep(10); |
- LeftInd->setValue(qRound(vor->Indent * 10)); |
- GroupBox10Layout->addWidget( LeftInd, 1, 1 ); |
- |
- FirstLin = new MSpinBox( GroupBox10, 1); |
- FirstLin->setSuffix( tr( " pt" ) ); |
- FirstLin->setMaxValue( 3000 ); |
- FirstLin->setMinValue( -3000 ); |
- FirstLin->setLineStep(10); |
- FirstLin->setValue(qRound(vor->First * 10)); |
- GroupBox10Layout->addWidget( FirstLin, 0, 1 ); |
- EditStyleLayout->addWidget( GroupBox10, 3, 1 ); |
- |
- ButtonGroup1 = new QButtonGroup( this, "ButtonGroup1" ); |
- ButtonGroup1->setTitle( tr( "Alignment" ) ); |
- ButtonGroup1->setColumnLayout(0, Qt::Vertical ); |
- ButtonGroup1->layout()->setSpacing( 0 ); |
- ButtonGroup1->layout()->setMargin( 0 ); |
- ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() ); |
- ButtonGroup1Layout->setAlignment( Qt::AlignTop ); |
- ButtonGroup1Layout->setSpacing( 5 ); |
- ButtonGroup1Layout->setMargin( 10 ); |
- |
- Left = new QRadioButton( ButtonGroup1, "Left" ); |
- Left->setText( tr( "Left" ) ); |
- Left->setChecked( true ); |
- ButtonGroup1Layout->addWidget( Left, 0, 0 ); |
- |
- Right = new QRadioButton( ButtonGroup1, "Right" ); |
- Right->setText( tr( "Right" ) ); |
- ButtonGroup1Layout->addWidget( Right, 1, 0 ); |
- |
- Center = new QRadioButton( ButtonGroup1, "Center" ); |
- Center->setText( tr( "Center" ) ); |
- ButtonGroup1Layout->addWidget( Center, 0, 1 ); |
- |
- Full = new QRadioButton( ButtonGroup1, "Full" ); |
- Full->setText( tr( "Block" ) ); |
- ButtonGroup1Layout->addWidget( Full, 1, 1 ); |
- |
- Forced = new QRadioButton( ButtonGroup1, "Full" ); |
- Forced->setText( tr( "Forced" ) ); |
- ButtonGroup1Layout->addWidget( Forced, 2, 1 ); |
- switch (vor->Ausri) |
- { |
- case 0 : |
- Left->setChecked( true ); |
- break; |
- case 1 : |
- Center->setChecked( true ); |
- break; |
- case 2 : |
- Right->setChecked( true ); |
- break; |
- case 3 : |
- Full->setChecked( true ); |
- break; |
- case 4 : |
- Forced->setChecked( true ); |
- break; |
- } |
- EditStyleLayout->addWidget( ButtonGroup1, 3, 0 ); |
- |
- AbstandV = new QGroupBox( this, "AbstandV" ); |
- AbstandV->setTitle( tr( "Vertical Spaces" ) ); |
- AbstandV->setColumnLayout(0, Qt::Vertical ); |
- AbstandV->layout()->setSpacing( 0 ); |
- AbstandV->layout()->setMargin( 0 ); |
- AbstandVLayout = new QGridLayout( AbstandV->layout() ); |
- AbstandVLayout->setAlignment( Qt::AlignTop ); |
- AbstandVLayout->setSpacing( 5 ); |
- AbstandVLayout->setMargin( 10 ); |
- |
- AboveV = new MSpinBox( AbstandV, 1 ); |
- AboveV->setMinimumSize( QSize( 70, 22 ) ); |
- AboveV->setSuffix( tr( " pt" ) ); |
- AboveV->setMaxValue( 3000 ); |
- AboveV->setMinValue( 0 ); |
- AboveV->setValue(qRound(vor->Avor * 10)); |
- AboveV->setLineStep(10); |
- AbstandVLayout->addWidget( AboveV, 0, 1 ); |
- |
- BelowV = new MSpinBox( AbstandV, 1 ); |
- BelowV->setMinimumSize( QSize( 70, 22 ) ); |
- BelowV->setSuffix( tr( " pt" ) ); |
- BelowV->setMaxValue( 3000 ); |
- BelowV->setMinValue( 0 ); |
- BelowV->setValue(qRound(vor->Anach * 10)); |
- BelowV->setLineStep(10); |
- AbstandVLayout->addWidget( BelowV, 1, 1 ); |
- |
- LineSpVal = new MSpinBox( AbstandV, 1 ); |
- LineSpVal->setMinimumSize( QSize( 70, 22 ) ); |
- LineSpVal->setSuffix( tr( " pt" ) ); |
- LineSpVal->setMaxValue( 3000 ); |
- LineSpVal->setMinValue( 1 ); |
- LineSpVal->setLineStep(10); |
- LineSpVal->setValue(qRound(vor->LineSpa * 10)); |
- AbstandVLayout->addWidget( LineSpVal, 2, 1 ); |
- |
- TextLabel3 = new QLabel( AbstandV, "TextLabel3" ); |
- TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel3->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel3->setMinimumSize( QSize( 90, 22 ) ); |
- TextLabel3->setText( tr( "Linespacing" ) ); |
- AbstandVLayout->addWidget( TextLabel3, 2, 0 ); |
- TextLabel1_2_2 = new QLabel( AbstandV, "TextLabel1_2_2" ); |
- TextLabel1_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel1_2_2->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel1_2_2->setMinimumSize( QSize( 90, 22 ) ); |
- TextLabel1_2_2->setText( tr( "Above:" ) ); |
- AbstandVLayout->addWidget( TextLabel1_2_2, 0, 0 ); |
- TextLabel1_2_3 = new QLabel( AbstandV, "TextLabel1_2_3" ); |
- TextLabel1_2_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel1_2_3->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel1_2_3->setMinimumSize( QSize( 90, 22 ) ); |
- TextLabel1_2_3->setText( tr( "Below:" ) ); |
- AbstandVLayout->addWidget( TextLabel1_2_3, 1, 0 ); |
-// EditStyleLayout->addWidget( AbstandV, 3, 1 ); |
- EditStyleLayout->addWidget( AbstandV, 2, 1 ); |
- |
- Layout17 = new QHBoxLayout; |
- Layout17->setSpacing( 6 ); |
- Layout17->setMargin( 0 ); |
- QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- Layout17->addItem( spacer2 ); |
- OkButton = new QPushButton( this, "OkButton" ); |
- OkButton->setText( tr( "OK" ) ); |
- Layout17->addWidget( OkButton ); |
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- Layout17->addItem( spacer ); |
- Cancel = new QPushButton( this, "Cancel" ); |
- Cancel->setText( tr( "Cancel" ) ); |
- Cancel->setDefault( true ); |
- Layout17->addWidget( Cancel ); |
- QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- Layout17->addItem( spacer_3 ); |
- EditStyleLayout->addMultiCellLayout( Layout17, 4, 4, 0, 1 ); |
- werte = vor; |
- allV = v; |
- // signals and slots connections |
- connect( Cancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); |
- connect( OkButton, SIGNAL( clicked() ), this, SLOT( Verlassen() ) ); |
- connect(SizeC, SIGNAL(valueChanged(int)), this, SLOT(FontChange(int))); |
-} |
- |
-void EditStyle::FontChange(int val) |
-{ |
- LineSpVal->setValue(static_cast<int>(((val * AutoVal / 100) + val) * 10)); |
-} |
- |
-void EditStyle::Verlassen() |
-{ |
- if (IsNew) |
- { |
- for (uint x=0; x<allV.count()-1; ++x) |
- { |
- if (Name->text() == allV[x].Vname) |
- { |
- QMessageBox::information(this,tr("Warning"),tr("Name of the Style is not unique"),tr("OK"),0, 0, 0, 1); |
- Name->selectAll(); |
- return; |
- } |
- } |
- } |
- else |
- { |
- if (OldName != Name->text()) |
- { |
- for (uint x=0; x<allV.count(); ++x) |
- { |
- if (Name->text() == allV[x].Vname) |
- { |
- QMessageBox::information(this,tr("Warning"),tr("Name of the Style is not unique"),tr("OK"),0, 0, 0, 1); |
- Name->selectAll(); |
- return; |
- } |
- } |
- } |
- } |
- if (Left->isChecked()) |
- werte->Ausri = 0; |
- if (Center->isChecked()) |
- werte->Ausri = 1; |
- if (Right->isChecked()) |
- werte->Ausri = 2; |
- if (Full->isChecked()) |
- werte->Ausri = 3; |
- if (Forced->isChecked()) |
- werte->Ausri = 4; |
- werte->LineSpa = static_cast<float>(LineSpVal->value()) / 10; |
- werte->Indent = static_cast<float>(LeftInd->value() / 10); |
- werte->First = static_cast<float>(FirstLin->value() / 10); |
- werte->Avor = static_cast<float>(AboveV->value() / 10); |
- werte->Anach = static_cast<float>(BelowV->value() / 10); |
- werte->Vname = Name->text(); |
- werte->Font = FontC->currentText(); |
- werte->FontSize = SizeC->value(); |
- accept(); |
-} |
/Scribus/Scribus/scribus/edit1format.cpp |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/libpostscript/Makefile.am |
=================================================================== |
--- Scribus/Scribus/scribus/libpostscript/Makefile.am (revision 6) |
+++ Scribus/Scribus/scribus/libpostscript/Makefile.am (nonexistent) |
@@ -1,23 +0,0 @@ |
-libdir = $(prefix)/lib/scribus/libs |
-AM_CPPFLAGS = -I$(top_builddir)/scribus |
-lib_LTLIBRARIES = libpostscript.la |
- |
-INCLUDES = $(LIBFREETYPE_CFLAGS) $(all_includes) |
- |
-libpostscript_la_LDFLAGS = -version-info 0:0:0 |
- |
-libpostscript_la_METASOURCES = AUTO |
- |
-libpostscript_la_SOURCES = pslib.cpp |
-KDE_OPTIONS = qtonly |
- |
-EXTRA_DIST = pslib.cpp pslib.h |
- |
-install-data-local: |
- $(mkinstalldirs) $(prefix)/include/scribus/libpostscript/ |
- $(INSTALL_DATA) $(srcdir)/pslib.h $(prefix)/include/scribus/libpostscript/pslib.h |
- |
-uninstall-local: |
- -rm -f $(prefix)/include/scribus/libpostscript/pslib.h |
- |
-AM_LDFLAGS = -s $(LIBFREETYPE_LIBS) |
/Scribus/Scribus/scribus/libpostscript/Makefile.am |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/libpostscript/pslib.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/libpostscript/pslib.cpp (revision 6) |
+++ Scribus/Scribus/scribus/libpostscript/pslib.cpp (nonexistent) |
@@ -1,1238 +0,0 @@ |
-/*************************************************************************** |
- pslib.cpp - description |
- ------------------- |
- begin : Sat May 26 2001 |
- copyright : (C) 2001 by Franz Schmid |
- email : Franz.Schmid@altmuehlnet.de |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
-#include <qfileinfo.h> |
-#include <qtextstream.h> |
-#include <qimage.h> |
-#include <qcolor.h> |
-#include <qcstring.h> |
-#include <qfontinfo.h> |
-#include <cstdlib> |
-#include <qregexp.h> |
-#include "config.h" |
-#include "pslib.h" |
-#include "scfonts.h" |
-#include <cmath> |
- |
-extern bool loadText(QString nam, QString *Buffer); |
-extern QImage LoadPict(QString fn); |
-extern QString CompressStr(QString *in); |
-extern QString ImageToCMYK_PS(QImage *im, int pl, bool pre); |
-extern QString MaskToTxt(QImage *im, bool PDF = true); |
-extern char *toHex( uchar u ); |
-extern QString String2Hex(QString *in, bool lang = true); |
-#ifdef HAVE_CMS |
-extern bool CMSuse; |
-extern QImage LoadPictCol(QString fn, QString Prof, bool UseEmbedded, bool *realCMYK); |
-#endif |
- |
-extern "C" void* Run(bool psart, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, CListe DocColors, bool pdf); |
- |
-void* Run(bool psart, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, CListe DocColors, bool pdf) |
-{ |
- PSLib *dia = new PSLib(psart, AllFonts, DocFonts, DocColors, pdf); |
- return dia; |
-} |
- |
-PSLib::PSLib(bool psart, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, CListe DocColors, bool pdf) |
-{ |
- QString tmp, tmp2, tmp3, tmp4, CHset; |
- QStringList wt; |
- int IsoInUse = 0; |
- QString Epfad = PREL; |
- Seiten = 0; |
- User = ""; |
- Creator = "PSlib-0.3"; |
- Titel = ""; |
- FillColor = "0.0 0.0 0.0 0.0"; |
- StrokeColor = "0.0 0.0 0.0 0.0"; |
- if (psart) |
- { |
- Header = "%!PS-Adobe-3.0\n"; |
- } |
- else |
- { |
- Header = "%!PS-Adobe-3.0 EPSF-3.0\n"; |
- } |
- BBox = ""; |
- BBoxH = ""; |
- Art = psart; |
- isPDF = pdf; |
- UsedFonts.clear(); |
- Fonts = ""; |
- FontDesc = ""; |
- GraySc = false; |
- DoSep = false; |
-#ifdef HAVE_LIBZ |
- CompAvail = true; |
-#else |
- CompAvail = false; |
-#endif |
- GrayCalc = "/setcmykcolor {exch 0.11 mul add exch 0.59 mul add exch 0.3 mul add\n"; |
- GrayCalc += " dup 1 gt {pop 1} if 1 exch sub oldsetgray} bind def\n"; |
- GrayCalc += "/setrgbcolor {0.11 mul exch 0.59 mul add exch 0.3 mul add\n"; |
- GrayCalc += " oldsetgray} bind def\n"; |
- Farben = "%%CMYKCustomColor: "; |
- FNamen = "%%DocumentCustomColors: "; |
- CListe::Iterator itf; |
- int c, m, y, k; |
- bool erst = true; |
- for (itf = DocColors.begin(); itf != DocColors.end(); ++itf) |
- { |
- if ((itf.key() != "Cyan") && (itf.key() != "Magenta") && (itf.key() != "Yellow") && (itf.key() != "Black")) |
- { |
- DocColors[itf.key()].getCMYK(&c, &m, &y, &k); |
- if (!erst) |
- { |
- Farben += "%%+ "; |
- FNamen += "%%+ "; |
- } |
- Farben += ToStr(float(c) / 255) + " " + ToStr(float(m) / 255) + " "; |
- Farben += ToStr(float(y) / 255) + " " + ToStr(float(k) / 255) + " (" + itf.key() + ")\n"; |
- FNamen += "(" + itf.key() + ")\n"; |
- erst = false; |
- } |
- } |
- QMap<QString,QFont>::Iterator it; |
- int a = 0; |
- for (it = DocFonts.begin(); it != DocFonts.end(); ++it) |
- { |
- UsedFonts.insert(it.key(), "/Fo"+IToStr(a)); |
- CHset = AllFonts[it.key()]->FontEnc; |
- if ((CHset == "iso8859-1") || (CHset == "ascii-0") || (CHset == "iso8859-15")) |
- Fonts += "/"+AllFonts[it.key()]->RealName()+" /Fo"+IToStr(a)+" cf ef\n"; |
- if (CHset == "iso8859-2") |
- { |
- Fonts += "/"+AllFonts[it.key()]->RealName()+" /Fo"+IToStr(a)+" iso2f ef\n"; |
- IsoInUse = 2; |
- } |
- if (CHset == "iso8859-3") |
- { |
- Fonts += "/"+AllFonts[it.key()]->RealName()+" /Fo"+IToStr(a)+" iso3f ef\n"; |
- IsoInUse = 3; |
- } |
- if (CHset == "iso8859-4") |
- { |
- Fonts += "/"+AllFonts[it.key()]->RealName()+" /Fo"+IToStr(a)+" iso4f ef\n"; |
- IsoInUse = 4; |
- } |
- if (CHset == "iso8859-5") |
- { |
- Fonts += "/"+AllFonts[it.key()]->RealName()+" /Fo"+IToStr(a)+" iso5f ef\n"; |
- IsoInUse = 5; |
- } |
- if (CHset == "iso8859-7") |
- { |
- Fonts += "/"+AllFonts[it.key()]->RealName()+" /Fo"+IToStr(a)+" iso7f ef\n"; |
- IsoInUse = 7; |
- } |
- if (CHset == "iso8859-9") |
- { |
- Fonts += "/"+AllFonts[it.key()]->RealName()+" /Fo"+IToStr(a)+" iso9f ef\n"; |
- IsoInUse = 9; |
- } |
- if (CHset == "iso8859-10") |
- { |
- Fonts += "/"+AllFonts[it.key()]->RealName()+" /Fo"+IToStr(a)+" iso10f ef\n"; |
- IsoInUse = 10; |
- } |
- if (CHset == "iso8859-13") |
- { |
- Fonts += "/"+AllFonts[it.key()]->RealName()+" /Fo"+IToStr(a)+" iso13f ef\n"; |
- IsoInUse = 13; |
- } |
- if (CHset.startsWith("koi8")) |
- { |
- Fonts += "/"+AllFonts[it.key()]->RealName()+" /Fo"+IToStr(a)+" koi8f ef\n"; |
- IsoInUse = 99; |
- } |
- if (CHset == "adobe-fontspecific") |
- Fonts += "/Fo"+IToStr(a)+" /"+AllFonts[it.key()]->RealName()+" findfont definefont pop\n"; |
- if (AllFonts[it.key()]->EmbedPS) |
- { |
- QString tmp; |
- if(AllFonts[it.key()]->EmbedFont(tmp)) |
- { |
- GListe gl; |
- AllFonts[it.key()]->GlNames(&gl); |
- GlyphsOfFont.insert(it.key(), gl); |
- FontDesc += "%%BeginFont: " + AllFonts[it.key()]->RealName() + "\n"; |
- FontDesc += tmp + "\n%%EndFont\n"; |
- } |
- } |
- a++; |
- } |
- Prolog = "%%BeginProlog\n"; |
- Prolog += "/Scribusdict 100 dict def\n"; |
- Prolog += "Scribusdict begin\n"; |
- Prolog += "/sp {showpage} bind def\n"; |
- Prolog += "/oldsetgray /setgray load def\n"; |
- Prolog += "/cmyk {setcmykcolor} def\n"; |
- Prolog += "/m {moveto} bind def\n"; |
- Prolog += "/li {lineto} bind def\n"; |
- Prolog += "/cl {closepath} bind def\n"; |
- Prolog += "/gs {gsave} bind def\n"; |
- Prolog += "/gr {grestore} bind def\n"; |
- Prolog += "/tr {translate} bind def\n"; |
- Prolog += "/ro {rotate} bind def\n"; |
- Prolog += "/sh {show} bind def\n"; |
- Prolog += "/ftt {currentfont /FontType get 42 eq { 1000 } { 1 } ifelse div} bind def\n"; |
- Prolog += "/shg {setcmykcolor moveto glyphshow} def\n"; |
- Prolog += "/shm {setcmykcolor moveto\n"; |
- Prolog += " dup (\\55) eq\n"; |
- Prolog += " {pop /hyphen glyphshow}\n"; |
- Prolog += " {show}\n"; |
- Prolog += " ifelse} def\n"; |
- Prolog += "/sc {scale} bind def\n"; |
- Prolog += "/se {selectfont} bind def\n"; |
- Prolog += "/sf {setfont} bind def\n"; |
- Prolog += "/sw {setlinewidth} bind def\n"; |
- Prolog += "/srt {2 setlinecap currentfont dup /FontMatrix get\n"; |
- Prolog += " exch /FontInfo get dup /UnderlinePosition get ftt exch\n"; |
- Prolog += " /UnderlineThickness get ftt 3 -1 roll dtransform\n"; |
- Prolog += " setlinewidth 0 exch rmoveto stringwidth rlineto stroke} bind def\n"; |
- Prolog += "/srd {2 setlinecap currentfont dup /FontMatrix get\n"; |
- Prolog += " exch /FontInfo get dup /UnderlinePosition get ftt exch\n"; |
- Prolog += " /UnderlineThickness get ftt 3 -1 roll dtransform\n"; |
- Prolog += " setlinewidth pop stringwidth rlineto stroke} bind def\n"; |
- Prolog += "/f {findfont} bind def\n"; |
- Prolog += "/mf {makefont} bind def\n"; |
- Prolog += "/ss {scalefont setfont} bind def\n"; |
- Prolog += "/ci {newpath 0 0 1 0 360 arc} bind def\n"; |
- Prolog += "/fi {fill} bind def\n"; |
- Prolog += "/st {stroke} bind def\n"; |
- QString isoenc; |
- if (IsoInUse != 0) |
- { |
- switch (IsoInUse) |
- { |
- case 2: |
- Prolog += "/iso2f [\n"; |
- loadText(Epfad+"/lib/scribus/iso8859-2ps.enc", &isoenc); |
- Prolog += isoenc; |
- Prolog += "] def\n"; |
- break; |
- case 3: |
- Prolog += "/iso3f [\n"; |
- loadText(Epfad+"/lib/scribus/iso8859-3ps.enc", &isoenc); |
- Prolog += isoenc; |
- Prolog += "] def\n"; |
- break; |
- case 4: |
- Prolog += "/iso4f [\n"; |
- loadText(Epfad+"/lib/scribus/iso8859-4ps.enc", &isoenc); |
- Prolog += isoenc; |
- Prolog += "] def\n"; |
- break; |
- case 5: |
- Prolog += "/iso5f [\n"; |
- loadText(Epfad+"/lib/scribus/iso8859-5ps.enc", &isoenc); |
- Prolog += isoenc; |
- Prolog += "] def\n"; |
- break; |
- case 7: |
- Prolog += "/iso7f [\n"; |
- loadText(Epfad+"/lib/scribus/iso8859-7ps.enc", &isoenc); |
- Prolog += isoenc; |
- Prolog += "] def\n"; |
- break; |
- case 9: |
- Prolog += "/iso9f [\n"; |
- loadText(Epfad+"/lib/scribus/iso8859-9ps.enc", &isoenc); |
- Prolog += isoenc; |
- Prolog += "] def\n"; |
- break; |
- case 10: |
- Prolog += "/iso10f [\n"; |
- loadText(Epfad+"/lib/scribus/iso8859-10ps.enc", &isoenc); |
- Prolog += isoenc; |
- Prolog += "] def\n"; |
- break; |
- case 13: |
- Prolog += "/iso13f [\n"; |
- loadText(Epfad+"/lib/scribus/iso8859-13ps.enc", &isoenc); |
- Prolog += isoenc; |
- Prolog += "] def\n"; |
- break; |
- case 99: |
- Prolog += "/koi8f [\n"; |
- loadText(Epfad+"/lib/scribus/koi8ps.enc", &isoenc); |
- Prolog += isoenc; |
- Prolog += "] def\n"; |
- break; |
- } |
- } |
- Prolog += "/cf [\n"; |
- Prolog += " 16#2d /hyphen\n"; |
- Prolog += " 16#80 /Euro\n"; |
- Prolog += " 16#82 /quotesinglbase\n"; |
- Prolog += " 16#83 /florin\n"; |
- Prolog += " 16#84 /quotedblbase\n"; |
- Prolog += " 16#85 /ellipsis\n"; |
- Prolog += " 16#86 /dagger\n"; |
- Prolog += " 16#87 /daggerdbl\n"; |
- Prolog += " 16#88 /circumflex\n"; |
- Prolog += " 16#89 /perthousand\n"; |
- Prolog += " 16#8a /Scaron\n"; |
- Prolog += " 16#8b /guilsinglleft\n"; |
- Prolog += " 16#8c /OE\n"; |
- Prolog += " 16#8e /zcaron\n"; |
- Prolog += " 16#91 /quoteleft\n"; |
- Prolog += " 16#92 /quoteright\n"; |
- Prolog += " 16#93 /quotedblleft\n"; |
- Prolog += " 16#94 /quotedblright\n"; |
- Prolog += " 16#95 /bullet\n"; |
- Prolog += " 16#96 /endash\n"; |
- Prolog += " 16#97 /emdash\n"; |
- Prolog += " 16#98 /tilde\n"; |
- Prolog += " 16#99 /trademark\n"; |
- Prolog += " 16#9a /scaron\n"; |
- Prolog += " 16#9b /guilsinglright\n"; |
- Prolog += " 16#9c /oe\n"; |
- Prolog += " 16#9e /zcaron\n"; |
- Prolog += " 16#9f /Ydieresis\n"; |
- Prolog += "] def\n"; |
- Prolog += "/ski /ISOLatin1Encoding where{pop true}{false}ifelse def\n"; |
- Prolog += "/reencodesmalldict 12 dict def\n"; |
- Prolog += "/ef {\n"; |
- Prolog += " reencodesmalldict begin\n"; |
- Prolog += " /newcodesandnames exch def\n"; |
- Prolog += " /newfontname exch def\n"; |
- Prolog += " /basefontname exch def\n"; |
- Prolog += " /basefontdict basefontname findfont def\n"; |
- Prolog += " /newfont basefontdict maxlength dict def\n"; |
- Prolog += " basefontdict\n"; |
- Prolog += " {\n"; |
- Prolog += " exch dup /FID ne\n"; |
- Prolog += " {\n"; |
- Prolog += " dup /Encoding eq\n"; |
- Prolog += " {\n"; |
- Prolog += " ski\n"; |
- Prolog += " {\n"; |
- Prolog += " exch pop\n"; |
- Prolog += " ISOLatin1Encoding dup length array copy\n"; |
- Prolog += " }{\n"; |
- Prolog += " exch dup length array copy\n"; |
- Prolog += " }\n"; |
- Prolog += " ifelse\n"; |
- Prolog += " newfont 3 1 roll put\n"; |
- Prolog += " }{\n"; |
- Prolog += " exch newfont 3 1 roll put\n"; |
- Prolog += " }\n"; |
- Prolog += " ifelse\n"; |
- Prolog += " }{\n"; |
- Prolog += " pop pop\n"; |
- Prolog += " }\n"; |
- Prolog += " ifelse\n"; |
- Prolog += " } forall\n"; |
- Prolog += " newfont /FontName newfontname put\n"; |
- Prolog += " newcodesandnames aload pop\n"; |
- Prolog += " newcodesandnames length 2 idiv\n"; |
- Prolog += " {\n"; |
- Prolog += " newfont /Encoding get 3 1 roll put\n"; |
- Prolog += " } repeat\n"; |
- Prolog += " newfontname newfont definefont pop\n"; |
- Prolog += " end\n"; |
- Prolog += " } def\n"; |
- Prolog += "/bEPS {\n"; |
- Prolog += " /b4_Inc_state save def\n"; |
- Prolog += " /dict_count countdictstack def\n"; |
- Prolog += " /op_count count 1 sub def\n"; |
- Prolog += " userdict begin\n"; |
- Prolog += " /showpage { } def\n"; |
- Prolog += " 0 setgray 0 setlinecap\n"; |
- Prolog += " 1 setlinewidth 0 setlinejoin\n"; |
- Prolog += " 10 setmiterlimit [ ] 0 setdash newpath\n"; |
- Prolog += " /languagelevel where\n"; |
- Prolog += " {pop languagelevel\n"; |
- Prolog += " 1 ne\n"; |
- Prolog += " {false setstrokeadjust false setoverprint\n"; |
- Prolog += " } if } if } bind def\n"; |
- Prolog += "/eEPS { count op_count sub {pop} repeat\n"; |
- Prolog += " countdictstack dict_count sub {end} repeat\n"; |
- Prolog += " b4_Inc_state restore } bind def\n"; |
- Prolog += " end\n"; |
- Prolog += "%%EndProlog\n"; |
-} |
-PSLib::~PSLib() |
-{ |
-} |
- |
-void PSLib::PutSeite(QString c) |
-{ |
- QTextStream t(&Spool); |
- t.writeRawBytes(c, c.length()); |
-} |
- |
-void PSLib::PutDoc(QString c) |
-{ |
- QTextStream t(&Spool); |
- t.writeRawBytes(c, c.length()); |
-} |
- |
-QString PSLib::ToStr(float c) |
-{ |
- QString cc; |
- return cc.setNum(c); |
-} |
- |
-QString PSLib::IToStr(int c) |
-{ |
- QString cc; |
- return cc.setNum(c); |
-} |
- |
-void PSLib::PS_set_Info(QString art, QString was) |
-{ |
- if (art == "Author") |
- User = was; |
- if (art == "Creator") |
- Creator = was; |
- if (art == "Title") |
- Titel = was; |
-} |
- |
-bool PSLib::PS_set_file(QString fn) |
-{ |
- Spool.setName(fn); |
- return Spool.open(IO_WriteOnly); |
-} |
- |
-void PSLib::PS_begin_doc(int Ori, float breite, float hoehe, int numpage) |
-{ |
- PutDoc(Header); |
- PutDoc("%%For: " + User + "\n"); |
- PutDoc("%%Title: " + Titel + "\n"); |
- PutDoc("%%Creator: " + Creator + "\n"); |
- PutDoc("%%Pages: " + IToStr(numpage) + "\n"); |
- BBox = "%%BoundingBox: 0 0 " + IToStr(qRound(breite)) + " " + IToStr(qRound(hoehe)) + "\n"; |
- BBoxH = "%%HiResBoundingBox: 0 0 " + ToStr(breite) + " " + ToStr(hoehe) + "\n"; |
- if (!Art) |
- { |
- PutDoc(BBox); |
- PutDoc(BBoxH); |
- } |
- PutDoc(FNamen); |
- PutDoc(Farben); |
- PutDoc("%%LanguageLevel: 3\n"); |
- PutDoc("%%EndComments\n"); |
- PutDoc(Prolog); |
- PutDoc("%%BeginSetup\n"); |
- PutDoc("/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse\n"); |
- if (FontDesc != "") |
- { |
- PutDoc(FontDesc); |
- } |
- PutDoc("Scribusdict begin\n"); |
- PutDoc(Fonts); |
- if (GraySc) |
- PutDoc(GrayCalc); |
- PutDoc("%%EndSetup\n"); |
- if ((Art) && (Ori != 0)) |
- { |
- PutSeite("<< /PageSize [ "+ToStr(breite)+" "+ToStr(hoehe)+" ]\n"); |
-// if (Ori != 0) |
- PutSeite("/Orientation 3\n"); |
- PutSeite(">> setpagedevice\n"); |
- } |
- Prolog = ""; |
- FontDesc = ""; |
-} |
- |
-QString PSLib::PSEncode(QString in) |
-{ |
- QString tmp = ""; |
- QString cc; |
- for (uint d = 0; d < in.length(); ++d) |
- { |
- cc = in.at(d); |
- if ((cc == "(") || (cc == ")") || (cc == "\\")) |
- tmp += "\\"; |
- tmp += cc; |
- } |
- tmp = tmp.simplifyWhiteSpace().replace( QRegExp("\\s"), "" ); |
- return tmp; |
-} |
- |
-void PSLib::PS_TemplateStart(QString Name, float breite, float hoehe) |
-{ |
- PutDoc("/"+PSEncode(Name)+"\n<<\n"); |
- PutDoc("/FormType 1\n"); |
- PutDoc("/BBox [0 0 "+ToStr(breite)+" "+ToStr(hoehe)+"]\n"); |
- PutDoc("/Matrix [1 0 0 1 0 0]\n"); |
- PutDoc("/PaintProc\n{\n"); |
-} |
- |
-void PSLib::PS_UseTemplate(QString Name) |
-{ |
- PutDoc(PSEncode(Name)+" execform\n"); |
-} |
- |
-void PSLib::PS_TemplateEnd() |
-{ |
- PutDoc("pop } bind\n"); |
- PutDoc(">> def\n"); |
-} |
- |
-void PSLib::PS_begin_page(float breite, float hoehe, struct Margs* Ma) |
-{ |
- PDev = ToStr(Ma->Left) + " " + ToStr(Ma->Bottom) + " m\n"; |
- PDev += ToStr(breite - Ma->Right) + " " + ToStr(Ma->Bottom) + " li\n"; |
- PDev += ToStr(breite - Ma->Right) + " " + ToStr(hoehe - Ma->Top) + " li\n"; |
- PDev += ToStr(Ma->Left) + " " + ToStr(hoehe - Ma->Top) + " li cl clip newpath\n"; |
- Seiten++; |
- PutSeite("%%Page: " + IToStr(Seiten) + " " + IToStr(Seiten) + "\nsave\n" + PDev); |
- PutSeite("/DeviceCMYK setcolorspace\n"); |
-} |
- |
-void PSLib::PS_end_page() |
-{ |
- PutSeite("%%PageTrailer\nrestore\nsp\n"); |
-} |
- |
-void PSLib::PS_rect(float x, float y, float b, float h) |
-{ |
- PutSeite(ToStr(x) + " " + ToStr(y) + " m\n"); |
- PutSeite(ToStr(x) + " " + ToStr(y+h) + " li\n"); |
- PutSeite(ToStr(x+b) + " " + ToStr(y+h) + " li\n"); |
- PutSeite(ToStr(x+b) + " " + ToStr(y) + " li\n"); |
- PutSeite("cl\n"); |
-} |
- |
-void PSLib::PS_RoundRect(float x, float y, float b, float h, float r) |
-{ |
- PutSeite(ToStr(x+r) + " " + ToStr(y) + " m\n"); |
- PutSeite(ToStr(x+b) + " " + ToStr(y) + " " + ToStr(x+b) + " " + ToStr(y+h) + " " + ToStr(r) + " arct\n"); |
- PutSeite(ToStr(x+b) + " " + ToStr(y+h) + " " + ToStr(x) + " " + ToStr(y+h) + " " + ToStr(r) + " arct\n"); |
- PutSeite(ToStr(x) + " " + ToStr(y+h) + " " + ToStr(x) + " " + ToStr(y) + " " + ToStr(r) + " arct\n"); |
- PutSeite(ToStr(x) + " " + ToStr(y) + " " + ToStr(x+b) + " " + ToStr(y) + " " + ToStr(r) + " arct\n"); |
- PutSeite("cl\n"); |
-} |
- |
-void PSLib::PS_circle(float r, float r2) |
-{ |
- PutSeite("/cmtx matrix currentmatrix def\n"); |
- PutSeite(ToStr(r) + " " + ToStr(r2) + " scale ci\n"); |
- PutSeite("cmtx setmatrix\n"); |
-} |
- |
-void PSLib::PS_curve(float x1, float y1, float x2, float y2, float x3, float y3) |
-{ |
- PutSeite(ToStr(x1) + " " + ToStr(y1) + " " + ToStr(x2) + " " + ToStr(y2) + " " + ToStr(x3) + " " + ToStr(y3) + " curveto\n"); |
-} |
- |
-void PSLib::PS_moveto(float x, float y) |
-{ |
- PutSeite(ToStr(x) + " " + ToStr(y) + " m\n"); |
-} |
- |
-void PSLib::PS_lineto(float x, float y) |
-{ |
- PutSeite(ToStr(x) + " " + ToStr(y) + " li\n"); |
-} |
- |
-void PSLib::PS_closepath() |
-{ |
- PutSeite("cl\n"); |
-} |
- |
-void PSLib::PS_translate(float x, float y) |
-{ |
- PutSeite(ToStr(x) + " " + ToStr(y) + " tr\n"); |
-} |
- |
-void PSLib::PS_scale(float x, float y) |
-{ |
- PutSeite(ToStr(x) + " " + ToStr(y) + " sc\n"); |
-} |
- |
-void PSLib::PS_rotate(float x) |
-{ |
- PutSeite(ToStr(x) + " ro\n"); |
-} |
- |
-void PSLib::PS_clip(bool mu) |
-{ |
- if (mu) |
- PutSeite("eoclip newpath\n"); |
- else |
- PutSeite("clip newpath\n"); |
-} |
- |
-void PSLib::PS_save() |
-{ |
- PutSeite("gs\n"); |
-} |
- |
-void PSLib::PS_restore() |
-{ |
- PutSeite("gr\n"); |
-} |
- |
-void PSLib::PS_setcmykcolor_fill(float c, float m, float y, float k) |
-{ |
- FillColor = ToStr(c) + " " + ToStr(m) + " " + ToStr(y) + " " + ToStr(k); |
-} |
- |
-void PSLib::PS_setcmykcolor_dummy() |
-{ |
- PutSeite("0 0 0 0 cmyk\n"); |
-} |
- |
-void PSLib::PS_setcmykcolor_stroke(float c, float m, float y, float k) |
-{ |
- StrokeColor = ToStr(c) + " " + ToStr(m) + " " + ToStr(y) + " " + ToStr(k); |
-} |
- |
-void PSLib::PS_setlinewidth(float w) |
-{ |
- PutSeite(ToStr(w) + " sw\n"); |
- LineW = w; |
-} |
- |
-void PSLib::PS_setdash(Qt::PenStyle st, Qt::PenCapStyle ca, Qt::PenJoinStyle jo) |
-{ |
- QString Dt = ToStr(QMAX(LineW, 1)); |
- QString Da = ToStr(QMAX(3*LineW, 1)); |
- switch (st) |
- { |
- case Qt::SolidLine: |
- PutSeite("[] 0 setdash\n"); |
- break; |
- case Qt::DashLine: |
- PutSeite("["+Da+" "+Dt+"] 0 setdash\n"); |
- break; |
- case Qt::DotLine: |
- PutSeite("["+Dt+"] 0 setdash\n"); |
- break; |
- case Qt::DashDotLine: |
- PutSeite("["+Da+" "+Dt+" "+Dt+" "+Dt+"] 0 setdash\n"); |
- break; |
- case Qt::DashDotDotLine: |
- PutSeite("["+Da+" "+Dt+" "+Dt+" "+Dt+" "+Dt+" "+Dt+"] 0 setdash\n"); |
- break; |
- default: |
- PutSeite("[] 0 setdash\n"); |
- break; |
- } |
- switch (ca) |
- { |
- case Qt::FlatCap: |
- PutSeite("0 setlinecap\n"); |
- break; |
- case Qt::SquareCap: |
- PutSeite("2 setlinecap\n"); |
- break; |
- case Qt::RoundCap: |
- PutSeite("1 setlinecap\n"); |
- break; |
- default: |
- PutSeite("0 setlinecap\n"); |
- break; |
- } |
- switch (jo) |
- { |
- case Qt::MiterJoin: |
- PutSeite("0 setlinejoin\n"); |
- break; |
- case Qt::BevelJoin: |
- PutSeite("2 setlinejoin\n"); |
- break; |
- case Qt::RoundJoin: |
- PutSeite("1 setlinejoin\n"); |
- break; |
- default: |
- PutSeite("0 setlinejoin\n"); |
- break; |
- } |
-} |
- |
-void PSLib::PS_selectfont(QString f, int s) |
-{ |
- PutSeite(UsedFonts[f] + " " + IToStr(s) + " se\n"); |
-} |
- |
-void PSLib::PS_fill(bool mu) |
-{ |
- if (mu) |
- PutSeite(FillColor + " cmyk eofill\n"); |
- else |
- PutSeite(FillColor + " cmyk fi\n"); |
-} |
- |
-void PSLib::PS_stroke() |
-{ |
- PutSeite(StrokeColor + " cmyk st\n"); |
-} |
- |
-void PSLib::PS_fill_stroke(bool mu) |
-{ |
- PS_save(); |
- PS_fill(mu); |
- PS_restore(); |
- PS_stroke(); |
-} |
- |
-void PSLib::PS_newpath() |
-{ |
- PutSeite("newpath\n"); |
-} |
- |
-void PSLib::PS_GradientCol1(float c, float m, float y, float k) |
-{ |
- GrColor1 = ToStr(c) + " " + ToStr(m) + " " + ToStr(y) + " " + ToStr(k); |
-} |
- |
-void PSLib::PS_GradientCol2(float c, float m, float y, float k) |
-{ |
- GrColor2 = ToStr(c) + " " + ToStr(m) + " " + ToStr(y) + " " + ToStr(k); |
-} |
- |
-void PSLib::PS_LinGradient(float w, float h, int item, int grad, bool mu) |
-{ |
- if (item == 1) |
- PutSeite("-"+ToStr(w / 2.0)+" "+ToStr(-h / 2.0)+" tr\n"); |
- if (mu) |
- PutSeite("eoclip\n"); |
- else |
- PutSeite("clip\n"); |
- PutSeite("<<\n"); |
- PutSeite("/ShadingType 2\n"); |
- if (DoSep) |
- PutSeite("/ColorSpace /DeviceGray\n"); |
- else |
- PutSeite("/ColorSpace /DeviceCMYK\n"); |
- switch (grad) |
- { |
- case 1: |
- PutSeite("/Coords [0 "+ToStr(h / 2.0)+" "+ToStr(w)+" "+ToStr(h / 2.0)+"]\n"); |
- break; |
- case 2: |
- PutSeite("/Coords ["+ToStr(w / 2.0)+" 0 "+ToStr(w / 2.0)+" "+ToStr(h)+"]\n"); |
- break; |
- case 3: |
- PutSeite("/Coords [0 0 "+ToStr(w)+" "+ToStr(h)+"]\n"); |
- break; |
- case 4: |
- PutSeite("/Coords ["+ToStr(w)+" 0 0 "+ToStr(h)+"]\n"); |
- break; |
- } |
- PutSeite("/BBox [0 "+ToStr(h)+" "+ToStr(w)+" 0]\n"); |
- if (DoSep) |
- PutSeite("/Background [0]\n"); |
- else |
- PutSeite("/Background ["+FillColor+"]\n"); |
- PutSeite("/Extend [false false]\n"); |
- PutSeite("/Function\n"); |
- PutSeite("<<\n"); |
- PutSeite("/FunctionType 2\n"); |
- PutSeite("/Domain [0 1]\n"); |
- if (DoSep) |
- { |
- int pla = Plate - 1; |
- if (pla < 0) |
- pla = 3; |
- QStringList cols1 = QStringList::split(" ", GrColor2); |
- QStringList cols2 = QStringList::split(" ", GrColor1); |
- PutSeite("/C1 ["+ToStr(1-cols1[pla].toFloat())+"]\n"); |
- PutSeite("/C0 ["+ToStr(1-cols2[pla].toFloat())+"]\n"); |
- } |
- else |
- { |
- PutSeite("/C0 ["+GrColor1+"]\n"); |
- PutSeite("/C1 ["+GrColor2+"]\n"); |
- } |
- PutSeite("/N 1\n"); |
- PutSeite(">>\n"); |
- PutSeite(">>\n"); |
- PutSeite("shfill\n"); |
-} |
- |
-void PSLib::PS_RadGradient(float w, float h, int item, bool mu) |
-{ |
- float w2, h2, rad; |
- w2 = w / 2.0; |
- h2 = h / 2.0; |
- rad = QMIN(w, fabs(h)) / 2.0; |
- PutSeite("/cmtx matrix currentmatrix def\n"); |
- if (mu) |
- PutSeite("eoclip\n"); |
- else |
- PutSeite("clip\n"); |
- PutSeite("<<\n"); |
- PutSeite("/ShadingType 3\n"); |
- if (DoSep) |
- PutSeite("/ColorSpace /DeviceGray\n"); |
- else |
- PutSeite("/ColorSpace /DeviceCMYK\n"); |
- PutSeite("/Coords ["+ToStr(w2)+" "+ToStr(h2)+" 0 "+ToStr(w2)+" "+ToStr(h2)+" "+ToStr(rad)+"]\n"); |
- PutSeite("/BBox [0 "+ToStr(h)+" "+ToStr(w)+" 0]\n"); |
- if (DoSep) |
- PutSeite("/Background [0]\n"); |
- else |
- PutSeite("/Background ["+FillColor+"]\n"); |
- PutSeite("/Extend [true true]\n"); |
- PutSeite("/Function\n"); |
- PutSeite("<<\n"); |
- PutSeite("/FunctionType 2\n"); |
- PutSeite("/Domain [0 1]\n"); |
- if (DoSep) |
- { |
- int pla = Plate - 1; |
- if (pla < 0) |
- pla = 3; |
- QStringList cols1 = QStringList::split(" ", GrColor2); |
- QStringList cols2 = QStringList::split(" ", GrColor1); |
- PutSeite("/C0 ["+ToStr(1-cols1[pla].toFloat())+"]\n"); |
- PutSeite("/C1 ["+ToStr(1-cols2[pla].toFloat())+"]\n"); |
- } |
- else |
- { |
- PutSeite("/C0 ["+GrColor2+"]\n"); |
- PutSeite("/C1 ["+GrColor1+"]\n"); |
- } |
- PutSeite("/N 1\n"); |
- PutSeite(">>\n"); |
- PutSeite(">>\n"); |
- if (item == 1) |
- { |
- if (w > fabs(h)) |
- PutSeite("-"+ToStr(w2*(w2 / rad))+" "+ToStr(fabs(h2))+" tr\n"); |
- else |
- PutSeite("-"+ToStr(w2*(w2 / rad))+" "+ToStr(fabs(h2)*(fabs(h2) /rad))+" tr\n"); |
- } |
- else |
- { |
- if (w > fabs(h)) |
- PutSeite("-"+ToStr(w2*(w2 / rad)-w2)+" 0 tr\n"); |
- else |
- { |
- if (w < fabs(h)) |
- PutSeite("0 "+ToStr(fabs(h2)*(fabs(h2) /rad)-fabs(h2))+" tr\n"); |
- } |
- } |
- PutSeite(ToStr(w2 / rad)+" "+ToStr(fabs(h2) / rad)+" scale\n"); |
- PutSeite("shfill\n"); |
- PutSeite("cmtx setmatrix\n"); |
-} |
- |
-void PSLib::PS_underline(QCString ch, float x, float y) |
-{ |
- PS_moveto(x, y); |
- PutSeite("("+QString(ch)+") srt\n"); |
-} |
- |
-void PSLib::PS_strikeout(QCString ch, float x, float y) |
-{ |
- PS_moveto(x, y); |
- PutSeite("("+QString(ch)+") srd\n"); |
-} |
- |
-void PSLib::PS_show_xy(QCString ch, float x, float y) |
-{ |
- PutSeite("("+QString(ch)+") "+ToStr(x)+" "+ToStr(y)+" "+StrokeColor+" shm\n"); |
-} |
- |
-void PSLib::PS_show_xyG(QString font, QString ch, float x, float y) |
-{ |
- QString Name; |
- uint cc = ch[0].unicode(); |
- if (GlyphsOfFont[font].contains(cc)) |
- Name = GlyphsOfFont[font][cc]; |
- else |
- Name = ".notdef"; |
- PutSeite("/"+Name+" "+ToStr(x)+" "+ToStr(y)+" "+StrokeColor+" shg\n"); |
-} |
- |
-void PSLib::PS_show(float x, float y) |
-{ |
- PS_moveto(x, y); |
- PutSeite("/hyphen glyphshow\n"); |
-} |
- |
-void PSLib::PS_ImageData(QString fn, QString Name, QString Prof, bool UseEmbedded, bool UseProf) |
-{ |
- QString tmp; |
- QFileInfo fi = QFileInfo(fn); |
- QString ext = fi.extension(false).lower(); |
- if (ext == "eps") |
- { |
- if (loadText(fn, &tmp)) |
- { |
- PutSeite("currentfile 1 (%ENDEPSDATA) /SubFileDecode filter /ReusableStreamDecode filter\n"); |
- PutSeite("%%BeginDocument: " + fi.fileName() + "\n"); |
- PutSeite(tmp+"\n"); |
- PutSeite("%ENDEPSDATA\n"); |
- PutSeite("%%EndDocument\n"); |
- PutSeite("/"+PSEncode(Name)+"Bild exch def\n"); |
- } |
- return; |
- } |
- QString ImgStr = ""; |
- QImage image; |
-#ifdef HAVE_CMS |
- QImage image2; |
- bool cmy = false; |
- if ((CMSuse) && (UseProf)) |
- { |
- image = LoadPict(fn); |
- image = image.convertDepth(32); |
- image2 = LoadPictCol(fn, Prof, UseEmbedded, &cmy); |
- ImgStr = ImageToCMYK_PS(&image2, -1, cmy); |
- } |
- else |
- { |
- image = LoadPict(fn); |
- ImgStr = ImageToCMYK_PS(&image, -1, false); |
- } |
-#else |
- image = LoadPict(fn); |
- image = image.convertDepth(32); |
- ImgStr = ImageToCMYK_PS(&image, -1, false); |
-#endif |
- if (CompAvail) |
- { |
- PutSeite("currentfile /ASCIIHexDecode filter /FlateDecode filter /ReusableStreamDecode filter\n"); |
- ImgStr = CompressStr(&ImgStr); |
- } |
- else |
- PutSeite("currentfile /ASCIIHexDecode filter /ReusableStreamDecode filter\n"); |
- ImgStr = String2Hex(&ImgStr); |
- PutSeite(ImgStr); |
- PutSeite("\n>\n"); |
- PutSeite("/"+PSEncode(Name)+"Bild exch def\n"); |
- ImgStr = ""; |
- if (image.hasAlphaBuffer()) |
- { |
- QImage iMask = image.createAlphaMask(); |
- ImgStr = MaskToTxt(&iMask, false); |
- if (CompAvail) |
- { |
- PutSeite("currentfile /ASCIIHexDecode filter /FlateDecode filter /ReusableStreamDecode filter\n"); |
- ImgStr = CompressStr(&ImgStr); |
- } |
- else |
- PutSeite("currentfile /ASCIIHexDecode filter /ReusableStreamDecode filter\n"); |
- ImgStr = String2Hex(&ImgStr); |
- PutSeite(ImgStr); |
- PutSeite("\n>\n"); |
- PutSeite("/"+PSEncode(Name)+"Mask exch def\n"); |
- } |
-} |
- |
-void PSLib::PS_image(float x, float y, QString fn, float scalex, float scaley, QString Prof, bool UseEmbedded, bool UseProf, QString Name) |
-{ |
- QString tmp; |
- QFileInfo fi = QFileInfo(fn); |
- QString ext = fi.extension(false).lower(); |
- if (ext == "eps") |
- { |
- if (loadText(fn, &tmp)) |
- { |
- if (Name != "") |
- { |
- PutSeite("bEPS\n"); |
- PutSeite(ToStr(scalex) + " " + ToStr(scaley) + " sc\n"); |
- PutSeite(ToStr(x) + " " + ToStr(y) + " tr\n"); |
- PutSeite(PSEncode(Name)+"Bild cvx exec\n"); |
- PutSeite(PSEncode(Name)+"Bild resetfile\n"); |
- PutSeite("eEPS\n"); |
- } |
- else |
- { |
- PutSeite("bEPS\n"); |
- PutSeite(ToStr(scalex) + " " + ToStr(scaley) + " sc\n"); |
- PutSeite(ToStr(x) + " " + ToStr(y) + " tr\n"); |
- PutSeite("%%BeginDocument: " + fi.fileName() + "\n"); |
- PutSeite(tmp+"\n"); |
- PutSeite("%%EndDocument\n"); |
- PutSeite("eEPS\n"); |
- } |
- } |
- } |
- else |
- { |
- QString ImgStr = ""; |
- QImage image; |
-#ifdef HAVE_CMS |
- QImage image2; |
- bool cmy = false; |
- if ((CMSuse) && (UseProf)) |
- { |
- image = LoadPict(fn); |
- image = image.convertDepth(32); |
- image2 = LoadPictCol(fn, Prof, UseEmbedded, &cmy); |
- } |
- else |
- { |
- image = LoadPict(fn); |
- image = image.convertDepth(32); |
- } |
-#else |
- image = LoadPict(fn); |
- image = image.convertDepth(32); |
-#endif |
- int w = image.width(); |
- int h = image.height(); |
- PutSeite(ToStr(x*scalex) + " " + ToStr(y*scaley) + " tr\n"); |
- PutSeite(ToStr(scalex*w) + " " + ToStr(scaley*h) + " sc\n"); |
- if ((!DoSep) && (!GraySc)) |
- PutSeite("/DeviceCMYK setcolorspace\n"); |
- else |
- PutSeite("/DeviceGray setcolorspace\n"); |
- if (image.hasAlphaBuffer()) |
- { |
- QImage iMask = image.createAlphaMask(); |
-#ifdef HAVE_CMS |
- if ((CMSuse) && (UseProf)) |
- { |
- if (DoSep) |
- ImgStr = ImageToCMYK_PS(&image2, Plate, cmy); |
- else |
- { |
- if (GraySc) |
- ImgStr = ImageToCMYK_PS(&image2, -2, cmy); |
- else |
- ImgStr = ImageToCMYK_PS(&image2, -1, cmy); |
- } |
- } |
- else |
- { |
- if (DoSep) |
- ImgStr = ImageToCMYK_PS(&image, Plate, false); |
- else |
- { |
- if (GraySc) |
- ImgStr = ImageToCMYK_PS(&image, -2, false); |
- else |
- ImgStr = ImageToCMYK_PS(&image, -1, false); |
- } |
- } |
-#else |
- if (DoSep) |
- ImgStr = ImageToCMYK_PS(&image, Plate, false); |
- else |
- { |
- if (GraySc) |
- ImgStr = ImageToCMYK_PS(&image, -2, false); |
- else |
- ImgStr = ImageToCMYK_PS(&image, -1, false); |
- } |
-#endif |
- if (Name == "") |
- { |
- if (CompAvail) |
- { |
- PutSeite("currentfile /ASCIIHexDecode filter /FlateDecode filter /ReusableStreamDecode filter\n"); |
- ImgStr = CompressStr(&ImgStr); |
- } |
- else |
- PutSeite("currentfile /ASCIIHexDecode filter /ReusableStreamDecode filter\n"); |
- ImgStr = String2Hex(&ImgStr); |
- PutSeite(ImgStr); |
- ImgStr = ""; |
- PutSeite("\n>\n"); |
- PutSeite("/Bild exch def\n"); |
- ImgStr = MaskToTxt(&iMask, false); |
- if (CompAvail) |
- { |
- PutSeite("currentfile /ASCIIHexDecode filter /FlateDecode filter /ReusableStreamDecode filter\n"); |
- ImgStr = CompressStr(&ImgStr); |
- } |
- else |
- PutSeite("currentfile /ASCIIHexDecode filter /ReusableStreamDecode filter\n"); |
- ImgStr = String2Hex(&ImgStr); |
- PutSeite(ImgStr); |
- PutSeite("\n>\n"); |
- PutSeite("/Mask exch def\n"); |
- } |
- PutSeite("<<\n"); |
- PutSeite(" /PaintType 1\n"); |
- PutSeite(" /PatternType 1\n"); |
- PutSeite(" /TilingType 3\n"); |
- PutSeite(" /BBox [ 0 0 1 1 ]\n"); |
- PutSeite(" /XStep 2\n"); |
- PutSeite(" /YStep 2\n"); |
- PutSeite(" /PaintProc {\n"); |
- PutSeite(" pop\n"); |
- PutSeite(" 1 1 1 1 setcmykcolor\n"); |
- PutSeite(" <<\n"); |
- PutSeite(" /ImageType 1\n"); |
- PutSeite(" /Height " + IToStr(h) + "\n"); |
- PutSeite(" /Width " + IToStr(w) + "\n"); |
- PutSeite(" /ImageMatrix [" + IToStr(w) + " 0 0 " + IToStr(-h) + " 0 " + IToStr(h) +"]\n"); |
- if (DoSep) |
- PutSeite(" /Decode [1 0]\n"); |
- else |
- { |
- if (GraySc) |
- PutSeite(" /Decode [1 0]\n"); |
- else |
- PutSeite(" /Decode [0 1 0 1 0 1 0 1]\n"); |
- } |
- PutSeite(" /BitsPerComponent 8\n"); |
- PutSeite(" /DataSource "+PSEncode(Name)+"Bild\n"); |
- PutSeite(" >>\n"); |
- PutSeite(" image\n"); |
- PutSeite(" }\n"); |
- PutSeite(">> matrix makepattern setpattern\n"); |
- PutSeite("<< /ImageType 1\n"); |
- PutSeite(" /Width " + IToStr(w) + "\n"); |
- PutSeite(" /Height " + IToStr(h) + "\n"); |
- PutSeite(" /BitsPerComponent 1\n"); |
- PutSeite(" /Decode [1 0]\n"); |
- PutSeite(" /ImageMatrix [" + IToStr(w) + " 0 0 " + IToStr(-h) + " 0 " + IToStr(h) + "]\n"); |
- PutSeite(" /DataSource "+PSEncode(Name)+"Mask\n"); |
- PutSeite(">>\n"); |
- PutSeite("imagemask\n"); |
- if (Name != "") |
- { |
- PutSeite(PSEncode(Name)+"Bild resetfile\n"); |
- PutSeite(PSEncode(Name)+"Mask resetfile\n"); |
- } |
- } |
- else |
- { |
- PutSeite("<< /ImageType 1\n"); |
- PutSeite(" /Width " + IToStr(w) + "\n"); |
- PutSeite(" /Height " + IToStr(h) + "\n"); |
- PutSeite(" /BitsPerComponent 8\n"); |
- if (DoSep) |
- PutSeite(" /Decode [1 0]\n"); |
- else |
- { |
- if (GraySc) |
- PutSeite(" /Decode [1 0]\n"); |
- else |
- PutSeite(" /Decode [0 1 0 1 0 1 0 1]\n"); |
- } |
- PutSeite(" /ImageMatrix [" + IToStr(w) + " 0 0 " + IToStr(-h) + " 0 " + IToStr(h) + "]\n"); |
- if (Name != "") |
- { |
- PutSeite(" /DataSource "+PSEncode(Name)+"Bild >>\n"); |
- PutSeite("image\n"); |
- PutSeite(PSEncode(Name)+"Bild resetfile\n"); |
- } |
- else |
- { |
- if (CompAvail) |
- PutSeite(" /DataSource currentfile /ASCIIHexDecode filter /FlateDecode filter >>\n"); |
- else |
- PutSeite(" /DataSource currentfile /ASCIIHexDecode filter >>\n"); |
- PutSeite("image\n"); |
-#ifdef HAVE_CMS |
- if ((CMSuse) && (UseProf)) |
- { |
- if (DoSep) |
- ImgStr = ImageToCMYK_PS(&image2, Plate, cmy); |
- else |
- { |
- if (GraySc) |
- ImgStr = ImageToCMYK_PS(&image2, -2, cmy); |
- else |
- ImgStr = ImageToCMYK_PS(&image2, -1, cmy); |
- } |
- } |
- else |
- { |
- if (DoSep) |
- ImgStr = ImageToCMYK_PS(&image, Plate, false); |
- else |
- { |
- if (GraySc) |
- ImgStr = ImageToCMYK_PS(&image, -2, false); |
- else |
- ImgStr = ImageToCMYK_PS(&image, -1, false); |
- } |
- } |
-#else |
- if (DoSep) |
- ImgStr = ImageToCMYK_PS(&image, Plate, false); |
- else |
- { |
- if (GraySc) |
- ImgStr = ImageToCMYK_PS(&image, -2, false); |
- else |
- ImgStr = ImageToCMYK_PS(&image, -1, false); |
- } |
-#endif |
- if (CompAvail) |
- ImgStr = CompressStr(&ImgStr); |
- ImgStr = String2Hex(&ImgStr); |
- PutSeite(ImgStr); |
- PutSeite("\n>\n"); |
- } |
- } |
- } |
-} |
- |
-void PSLib::PS_plate(int nr) |
-{ |
- switch (nr) |
- { |
- case 0: |
- PutSeite("%%PlateColor Black\n"); |
- PutSeite("/setcmykcolor {exch pop exch pop exch pop 1 exch sub oldsetgray} bind def\n"); |
- PutSeite("/setrgbcolor {pop pop pop 1 oldsetgray} bind def\n"); |
- break; |
- case 1: |
- PutSeite("%%PlateColor Cyan\n"); |
- PutSeite("/setcmykcolor {pop pop pop 1 exch sub oldsetgray} bind def\n"); |
- PutSeite("/setrgbcolor {pop pop oldsetgray} bind def\n"); |
- break; |
- case 2: |
- PutSeite("%%PlateColor Magenta\n"); |
- PutSeite("/setcmykcolor {pop pop exch pop 1 exch sub oldsetgray} bind def\n"); |
- PutSeite("/setrgbcolor {pop exch pop oldsetgray} bind def\n"); |
- break; |
- case 3: |
- PutSeite("%%PlateColor Yellow\n"); |
- PutSeite("/setcmykcolor {pop exch pop exch pop 1 exch sub oldsetgray} bind def\n"); |
- PutSeite("/setrgbcolor {exch pop exch pop oldsetgray} bind def\n"); |
- break; |
- } |
- Plate = nr; |
- DoSep = true; |
-} |
- |
-void PSLib::PS_setGray() |
-{ |
- GraySc = true; |
-} |
- |
-void PSLib::PDF_Bookmark(QString text, uint Seite) |
-{ |
- PutSeite("[/Title ("+text+") /Page "+IToStr(Seite)+" /View [/Fit]\n"); |
- PutSeite("/OUT pdfmark\n"); |
- isPDF = true; |
-} |
- |
-void PSLib::PDF_Annotation(QString text, float x, float y, float b, float h) |
-{ |
- PutSeite("[ /Rect [ "+ToStr(static_cast<int>(x))+" "+ToStr(static_cast<int>(y))+" "+ToStr(static_cast<int>(b))+" "+ToStr(static_cast<int>(h))+" ]\n"); |
- PutSeite(" /Contents ("+text+")\n /Open false\n"); |
- PutSeite("/ANN pdfmark\n"); |
- isPDF = true; |
-} |
- |
- |
-void PSLib::PS_close() |
-{ |
- PutDoc("%%Trailer\n"); |
- PutDoc("end\n"); |
- PutDoc("%%EOF\n"); |
- Spool.close(); |
-} |
/Scribus/Scribus/scribus/libpostscript/pslib.cpp |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/libpostscript/pslib.h |
=================================================================== |
--- Scribus/Scribus/scribus/libpostscript/pslib.h (revision 6) |
+++ Scribus/Scribus/scribus/libpostscript/pslib.h (nonexistent) |
@@ -1,119 +0,0 @@ |
-/*************************************************************************** |
- pslib.h - description |
- ------------------- |
- begin : Sat May 26 2001 |
- copyright : (C) 2001 by Franz Schmid |
- email : Franz.Schmid@altmuehlnet.de |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
- |
-#ifndef PSLIB_H |
-#define PSLIB_H |
-#include <qstring.h> |
-#include <qcstring.h> |
-#include <qpen.h> |
-#include <qfile.h> |
-#include "scribusdoc.h" |
- |
-/** |
- *@author Franz Schmid |
- * Diese Klasse erzeugt Postscript-Dateien |
- */ |
- |
-class PSLib { |
-public: |
- PSLib(bool psart, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, CListe DocColors, bool pdf = false); |
- virtual ~PSLib(); |
- virtual bool PS_set_file(QString fn); |
- virtual void PS_set_Info(QString art, QString was); |
- virtual void PS_begin_doc(int Ori, float breite, float hoehe, int numpage); |
- virtual void PS_begin_page(float breite, float hoehe, struct Margs* Ma); |
- virtual void PS_end_page(); |
- virtual void PS_rect(float x, float y, float b, float h); |
- virtual void PS_RoundRect(float x, float y, float b, float h, float r); |
- virtual void PS_circle(float r, float r2); |
- virtual void PS_curve(float x1, float y1, float x2, float y2, float x3, float y3); |
- virtual void PS_moveto(float x, float y); |
- virtual void PS_lineto(float x, float y); |
- virtual void PS_closepath(); |
- virtual void PS_translate(float x, float y); |
- virtual void PS_scale(float x, float y); |
- virtual void PS_rotate(float x); |
- virtual void PS_clip(bool mu); |
- virtual void PS_save(); |
- virtual void PS_restore(); |
- virtual void PS_setcmykcolor_fill(float c, float m, float y, float k); |
- virtual void PS_setcmykcolor_dummy(); |
- virtual void PS_setcmykcolor_stroke(float c, float m, float y, float k); |
- virtual void PS_setlinewidth(float w); |
- virtual void PS_setdash(Qt::PenStyle st, Qt::PenCapStyle ca, Qt::PenJoinStyle jo); |
- virtual void PS_selectfont(QString f, int s); |
- virtual void PS_fill(bool mu); |
- virtual void PS_stroke(); |
- virtual void PS_fill_stroke(bool mu); |
- virtual void PS_newpath(); |
- virtual void PS_GradientCol1(float c, float m, float y, float k); |
- virtual void PS_GradientCol2(float c, float m, float y, float k); |
- virtual void PS_LinGradient(float w, float h, int item, int grad, bool mu); |
- virtual void PS_RadGradient(float w, float h, int item, bool mu); |
- virtual void PS_underline(QCString ch, float x, float y); |
- virtual void PS_strikeout(QCString ch, float x, float y); |
- virtual void PS_show_xy(QCString ch, float x, float y); |
- virtual void PS_show(float x, float y); |
- virtual void PS_show_xyG(QString font, QString ch, float x, float y); |
- virtual void PS_image(float x, float y, QString fn, float scalex, float scaley, QString Prof, bool UseEmbedded, bool UseProf, QString Name = ""); |
- virtual void PS_plate(int nr); |
- virtual void PS_setGray(); |
- virtual void PDF_Bookmark(QString text, uint Seite); |
- virtual void PDF_Annotation(QString text, float x, float y, float b, float h); |
- virtual void PS_close(); |
- virtual void PS_TemplateStart(QString Name, float breite, float hoehe); |
- virtual void PS_TemplateEnd(); |
- virtual void PS_UseTemplate(QString Name); |
- virtual void PS_ImageData(QString fn, QString Name, QString Prof, bool UseEmbedded, bool UseProf); |
-private: |
- void PutSeite(QString c); |
- void PutDoc(QString c); |
- QString ToStr(float c); |
- QString IToStr(int c); |
- QString PSEncode(QString in); |
- bool Art; |
- QString Prolog; |
- QString Header; |
- QString Creator; |
- QString User; |
- QString Titel; |
- QString BBox; |
- QString BBoxH; |
- QString Farben; |
- QString FNamen; |
- QString PDev; |
- QString GrayCalc; |
- bool GraySc; |
- int Seiten; |
- QString FillColor; |
- QString StrokeColor; |
- QString GrColor1; |
- QString GrColor2; |
- float LineW; |
- QString Fonts; |
- QString FontDesc; |
- QMap<QString, QString> UsedFonts; |
- typedef QMap<uint, QString> GListe; |
- QMap<QString, GListe> GlyphsOfFont; |
- bool isPDF; |
- QFile Spool; |
- bool CompAvail; |
- int Plate; |
- bool DoSep; |
-}; |
- |
-#endif |
/Scribus/Scribus/scribus/libpostscript/pslib.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/pdfopts.h |
=================================================================== |
--- Scribus/Scribus/scribus/pdfopts.h (revision 6) |
+++ Scribus/Scribus/scribus/pdfopts.h (nonexistent) |
@@ -1,201 +0,0 @@ |
-/**************************************************************************** |
-** Form interface generated from reading ui file 'PDFOpts.ui' |
-** |
-** Created: Mon Jun 4 10:02:30 2001 |
-** by: The User Interface Compiler (uic) |
-** |
-** WARNING! All changes made in this file will be lost! |
-****************************************************************************/ |
-#ifndef PDF_OPTS_H |
-#define PDF_OPTS_H |
- |
-#include <qdialog.h> |
-#include <qbuttongroup.h> |
-#include <qgroupbox.h> |
-#include <qcheckbox.h> |
-#include <qcombobox.h> |
-#include <qlabel.h> |
-#include <qlineedit.h> |
-#include <qpushbutton.h> |
-#include <qradiobutton.h> |
-#include <qspinbox.h> |
-#include <qtabwidget.h> |
-#include <qtoolbutton.h> |
-#include <qwidget.h> |
-#include <qlayout.h> |
-#include <qtooltip.h> |
-#include <qmap.h> |
-#include <qvaluelist.h> |
-#include <qlistbox.h> |
-#include "bookmwin.h" |
-#include "mspinbox.h" |
- |
-class PDF_Opts : public QDialog |
-{ |
- Q_OBJECT |
- |
-public: |
- PDF_Opts( QWidget* parent, QString Fname, QMap<QString,QFont> DocFonts, ScribusView *vie, PDFOpt *Optionen, QValueList<PreSet> Eff, ProfilesL *PDFXProfiles, SCFonts &AllFonts ); |
- ~PDF_Opts(); |
- |
- QLabel* Name; |
- QLabel* TextLabel1; |
- QTabWidget* Options; |
- QWidget* tab; |
- QSpinBox* ValC; |
- QSpinBox* Resolution; |
- QCheckBox* DSColor; |
- QCheckBox* Article; |
- QCheckBox* Compression; |
- QToolButton* FileC; |
- QPushButton* OK; |
- QPushButton* Cancel; |
- QLineEdit* Datei; |
- BookMView *BView; |
- QGroupBox* GroupBox1; |
- QGroupBox* GroupBox2; |
- QLabel* TextLabel2; |
- QComboBox* ComboBox1; |
- QLabel* TextLabel1x; |
- QComboBox* ComboBind; |
- QCheckBox* CheckBox1; |
- QCheckBox* CheckBox10; |
- QPushButton* EonAllPg; |
- QWidget* tab_3; |
- QWidget* tab_5; |
- QLabel* TextLabel1e; |
- QLabel* TextLabel2e; |
- QLabel* TextLabel3e; |
- QLabel* TextLabel4e; |
- QLabel* TextLabel5e; |
- QLabel* TextLabel6e; |
- QComboBox* EffectType; |
- QComboBox* EDirection; |
- QComboBox* EDirection_2; |
- QComboBox* EDirection_2_2; |
- QSpinBox* PageTime; |
- QSpinBox* EffectTime; |
- QListBox* Pages; |
- QGroupBox* Effects; |
- QCheckBox* PagePrev; |
- QCheckBox* CheckBM; |
- QCheckBox* EmbedFonts; |
- QGroupBox* GroupFont; |
- QLabel* TextFont1; |
- QListBox* AvailFlist; |
- QPushButton* ToEmbed; |
- QPushButton* FromEmbed; |
- QLabel* TextFont1_2; |
- QButtonGroup* RangeGroup; |
- QRadioButton* AllPages; |
- QRadioButton* OnlySome; |
- QSpinBox* LastPage; |
- QLabel* RText; |
- QSpinBox* FirstPage; |
- QListBox* EmbedList; |
- QWidget* tabcolor; |
- QGroupBox* ColorGroup; |
- QGroupBox* GroupBox9; |
- QLabel* ColorText1; |
- QComboBox* OutCombo; |
- QCheckBox* EmbedProfs; |
- QCheckBox* EmbedProfs2; |
- QGroupBox* ProfsGroup; |
- QComboBox* SolidPr; |
- QLabel* ProfsTxt1; |
- QComboBox* ImageP; |
- QCheckBox* NoEmbedded; |
- QLabel* ProfsTxt3; |
- QLabel* ProfsTxt4; |
- QLabel* ProfsTxt2; |
- QComboBox* IntendS; |
- QComboBox* IntendI; |
- QWidget* tabpdfx; |
- QGroupBox* X3Group; |
- QComboBox* PrintProfC; |
- QLineEdit* InfoString; |
- QLabel* PDFX2; |
- QLabel* PDFX1; |
- QGroupBox* BleedGroup; |
- QLabel* BleedIcon; |
- MSpinBox* BleedTop; |
- MSpinBox* BleedBottom; |
- MSpinBox* BleedRight; |
- MSpinBox* BleedLeft; |
- QWidget* tabsec; |
- QGroupBox* GroupPass; |
- QLabel* TextSec2; |
- QLabel* TextSec1; |
- QLineEdit* PassOwner; |
- QLineEdit* PassUser; |
- QGroupBox* GroupSecSet; |
- QCheckBox* PrintSec; |
- QCheckBox* PrintSec2; |
- QCheckBox* ModifySec; |
- QCheckBox* CopySec; |
- QCheckBox* AddSec; |
- QCheckBox* Encry; |
- QValueList<QString> FontsToEmbed; |
- ScribusView *view; |
- QValueList<PreSet> EffVal; |
- int PgSel; |
- int Einheit; |
- |
-public slots: |
- void ToggleEncr(); |
- void BleedChanged(); |
- void EnablePDFX(int a); |
- void DoDownsample(); |
- void RemoveEmbed(); |
- void PutToEmbed(); |
- void SelAFont(QListBoxItem*); |
- void SelEFont(QListBoxItem*); |
- void EmbedAll(); |
- void ChangeFile(); |
- void PagePr(); |
- void SetPgEff(int nr); |
- void SetEffOpts(int nr); |
- void ValidDI(int nr); |
- void DoEffects(); |
- void EffectOnAll(); |
- void SelRange(bool e); |
- void ChFrom(); |
- void ChTo(); |
- void EnablePr(int a); |
- void EnablePG(); |
- void EnablePGI(); |
- void EnablePGI2(); |
- |
-protected: |
- QVBoxLayout* PDFOptsLayout; |
- QHBoxLayout* Layout5; |
- QVBoxLayout* tabLayout; |
- QVBoxLayout* Layout3; |
- QHBoxLayout* Layout2; |
- QVBoxLayout* tabLayout_3; |
- QHBoxLayout* GroupFontLayout; |
- QVBoxLayout* Layout4_2; |
- QVBoxLayout* Layout5_2; |
- QVBoxLayout* Layout6; |
- QHBoxLayout* Layout7; |
- QGridLayout* GroupBox1Layout; |
- QGridLayout* GroupBox9Layout; |
- QGridLayout* GroupBox2Layout; |
- QGridLayout* tabLayout_5; |
- QGridLayout* EffectsLayout; |
- QHBoxLayout* Layout13; |
- QVBoxLayout* RangeGroupLayout; |
- QGridLayout* Layout11; |
- QVBoxLayout* tabcolorLayout; |
- QHBoxLayout* ColorGroupLayout; |
- QGridLayout* ProfsGroupLayout; |
- QVBoxLayout* tabpdfxLayout; |
- QGridLayout* X3GroupLayout; |
- QGridLayout* BleedGroupLayout; |
- QVBoxLayout* tabsecLayout; |
- QGridLayout* GroupPassLayout; |
- QVBoxLayout* GroupSecSetLayout; |
- |
-}; |
- |
-#endif // PDF_OPTS_H |
/Scribus/Scribus/scribus/pdfopts.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/libprefs/prefs.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/libprefs/prefs.cpp (revision 6) |
+++ Scribus/Scribus/scribus/libprefs/prefs.cpp (nonexistent) |
@@ -1,2057 +0,0 @@ |
-#include "prefs.h" |
-#include "prefs.moc" |
-#include "keymanager.h" |
-#include <qfont.h> |
-#include <qcolordialog.h> |
-#include <qcolor.h> |
-#include <qstringlist.h> |
-#include <qstylefactory.h> |
-#include <qpointarray.h> |
-#include <qpainter.h> |
-#include <qrect.h> |
-#include <qwmatrix.h> |
-#include <cmath> |
- |
-extern QPixmap loadIcon(QString nam); |
-extern QPointArray RegularPolygon(float w, float h, uint c, bool star, float factor, float rota); |
- |
-extern "C" void* Run(QWidget *d, preV *Vor); |
- |
-void* Run(QWidget *d, preV *Vor) |
-{ |
- Preferences *dia = new Preferences(d, Vor); |
- return dia; |
-} |
- |
-Preferences::Preferences( QWidget* parent, preV *Vor) |
- : QDialog( parent, "pref", true, 0 ) |
-{ |
- fon = &Vor->AvailFonts; |
- ap = (ScribusApp*)parent; |
- Umrech = 1.0; |
- if (ap->HaveDoc) |
- Einheit = ap->doc->Einheit; |
- else |
- Einheit = Vor->Einheit; |
- KKC = Vor->KeyActions; |
- setCaption( tr( "Preferences" ) ); |
- setIcon(loadIcon("AppIcon.xpm")); |
- setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); |
- PrefsLayout = new QVBoxLayout( this ); |
- PrefsLayout->setSpacing( 6 ); |
- PrefsLayout->setMargin( 11 ); |
- TabWidget3 = new QTabWidget( this, "TabWidget3" ); |
- TabWidget3->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); |
- tab = new QWidget( TabWidget3, "tab" ); |
- tabLayout = new QGridLayout( tab ); |
- tabLayout->setSpacing( 6 ); |
- tabLayout->setMargin( 10 ); |
- ButtonGroup1 = new QButtonGroup( tab, "ButtonGroup1" ); |
- ButtonGroup1->setTitle( tr( "GUI" ) ); |
- ButtonGroup1->setColumnLayout(0, Qt::Vertical ); |
- ButtonGroup1->layout()->setSpacing( 0 ); |
- ButtonGroup1->layout()->setMargin( 0 ); |
- ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() ); |
- ButtonGroup1Layout->setAlignment( Qt::AlignTop ); |
- ButtonGroup1Layout->setSpacing( 6 ); |
- ButtonGroup1Layout->setMargin( 10 ); |
- TextGstil = new QLabel(ButtonGroup1, "dd"); |
- TextGstil->setText(tr("Theme")); |
- ButtonGroup1Layout->addWidget( TextGstil, 0, 0 ); |
- GUICombo = new QComboBox( true, ButtonGroup1, "GUICombo" ); |
- QStringList STtest; |
- STtest = QStyleFactory::keys(); |
- for (uint stt = 0; stt < STtest.count(); ++stt) |
- { |
- GUICombo->insertItem(STtest[stt]); |
- } |
- GUICombo->setEditable(false); |
- GUICombo->setCurrentText(Vor->GUI); |
- ButtonGroup1Layout->addWidget( GUICombo, 0, 1, Qt::AlignRight ); |
- TextGstil2 = new QLabel(ButtonGroup1, "dd"); |
- TextGstil2->setText(tr("Fontsize")); |
- ButtonGroup1Layout->addWidget( TextGstil2, 1, 0 ); |
- GFsize = new QSpinBox(ButtonGroup1, "gfs" ); |
- GFsize->setSuffix( tr( " pts" ) ); |
- GFsize->setMaxValue( 22 ); |
- GFsize->setMinValue( 8 ); |
- GFsize->setValue( Vor->AppFontSize ); |
- ButtonGroup1Layout->addWidget( GFsize, 1, 1, Qt::AlignRight ); |
- tabLayout->addWidget( ButtonGroup1, 0, 0 ); |
- GroupBox20 = new QGroupBox( tab, "GroupBox20" ); |
- GroupBox20->setTitle( tr( "Units" ) ); |
- GroupBox20->setColumnLayout(0, Qt::Vertical ); |
- GroupBox20->layout()->setSpacing( 0 ); |
- GroupBox20->layout()->setMargin( 0 ); |
- GroupBox20Layout = new QHBoxLayout( GroupBox20->layout() ); |
- GroupBox20Layout->setAlignment( Qt::AlignTop ); |
- GroupBox20Layout->setSpacing( 0 ); |
- GroupBox20Layout->setMargin( 25 ); |
- UnitCombo = new QComboBox( true, GroupBox20, "UnitCombo" ); |
- UnitCombo->insertItem( tr( "Points (pt)" ) ); |
- UnitCombo->insertItem( tr( "Millimeters (mm)" ) ); |
- UnitCombo->insertItem( tr( "Inches (in)" ) ); |
- UnitCombo->insertItem( tr( "Picas (p)" ) ); |
- UnitCombo->setEditable(false); |
- if (ap->HaveDoc) |
- UnitCombo->setCurrentItem(ap->doc->Einheit); |
- else |
- UnitCombo->setCurrentItem(Vor->Einheit); |
- GroupBox20Layout->addWidget( UnitCombo ); |
- tabLayout->addWidget( GroupBox20, 1, 0 ); |
- Mouse = new QGroupBox( tab, "Mouse" ); |
- Mouse->setTitle( tr( "Mouse-Settings" ) ); |
- Mouse->setColumnLayout(0, Qt::Vertical ); |
- Mouse->layout()->setSpacing( 0 ); |
- Mouse->layout()->setMargin( 0 ); |
- MouseLayout = new QHBoxLayout( Mouse->layout() ); |
- MouseLayout->setAlignment( Qt::AlignTop ); |
- MouseLayout->setSpacing( 6 ); |
- MouseLayout->setMargin( 10 ); |
- Layout5 = new QGridLayout; |
- Layout5->setSpacing( 6 ); |
- Layout5->setMargin( 0 ); |
- TextLabel1_2 = new QLabel( Mouse, "TextLabel1_2" ); |
- TextLabel1_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel1_2->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel1_2->setText( tr( "Wheel-Jump" ) ); |
- Layout5->addWidget( TextLabel1_2, 0, 0 ); |
- SpinBox3 = new QSpinBox( Mouse, "SpinBox3" ); |
- SpinBox3->setMaxValue( 1000 ); |
- SpinBox3->setMinValue( 0 ); |
- SpinBox3->setLineStep( 10 ); |
- SpinBox3->setValue( Vor->Wheelval ); |
- Layout5->addWidget( SpinBox3, 0, 1 ); |
- TextLabel1_2_2 = new QLabel( Mouse, "TextLabel1_2_2" ); |
- TextLabel1_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel1_2_2->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel1_2_2->setText( tr( "Grab-Radius" ) ); |
- Layout5->addWidget( TextLabel1_2_2, 1, 0 ); |
- SpinBox3_2 = new QSpinBox( Mouse, "SpinBox3_2" ); |
- SpinBox3_2->setMaxValue( 1000 ); |
- SpinBox3_2->setMinValue( 1 ); |
- SpinBox3_2->setLineStep( 1 ); |
- if (ap->HaveDoc) |
- SpinBox3_2->setValue( ap->doc->GrabRad ); |
- else |
- SpinBox3_2->setValue( Vor->GrabRad ); |
- Layout5->addWidget( SpinBox3_2, 1, 1 ); |
- MouseLayout->addLayout( Layout5 ); |
- tabLayout->addWidget( Mouse, 0, 1 ); |
- |
- GroupBox20b = new QGroupBox( tab, "GroupBox20b" ); |
- GroupBox20b->setTitle( tr( "Menues" ) ); |
- GroupBox20b->setColumnLayout(0, Qt::Vertical ); |
- GroupBox20b->layout()->setSpacing( 0 ); |
- GroupBox20b->layout()->setMargin( 0 ); |
- GroupBox20bLayout = new QGridLayout( GroupBox20b->layout() ); |
- GroupBox20bLayout->setAlignment( Qt::AlignTop ); |
- GroupBox20bLayout->setSpacing( 5 ); |
- GroupBox20bLayout->setMargin( 10 ); |
- TextLabel4c = new QLabel( GroupBox20b, "TextLabel4c" ); |
- TextLabel4c->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel4c->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel4c->setText( tr( "Recent Documents:" ) ); |
- GroupBox20bLayout->addWidget( TextLabel4c, 0, 0); |
- Recen = new QSpinBox( GroupBox20b, "Recen" ); |
- Recen->setMaxValue( 30 ); |
- Recen->setMinValue( 1 ); |
- Recen->setValue( Vor->RecentDCount ); |
- GroupBox20bLayout->addWidget( Recen, 0, 1 ); |
- Shorty = new QPushButton(GroupBox20b, "SH"); |
- Shorty->setText(tr("Keyboard Shortcuts...")); |
- GroupBox20bLayout->addMultiCellWidget( Shorty, 1, 1, 0, 1 ); |
- tabLayout->addWidget( GroupBox20b, 1, 1 ); |
- |
- GroupBox200 = new QGroupBox( tab, "GroupBox200" ); |
- GroupBox200->setTitle( tr( "Paths" ) ); |
- GroupBox200->setColumnLayout(0, Qt::Horizontal ); |
- GroupBox200->layout()->setSpacing( 0 ); |
- GroupBox200->layout()->setMargin( 0 ); |
- GroupBox200Layout = new QHBoxLayout( GroupBox200->layout() ); |
- GroupBox200Layout->setAlignment( Qt::AlignTop ); |
- GroupBox200Layout->setSpacing( 0 ); |
- GroupBox200Layout->setMargin( 5 ); |
- PfadText = new QLabel( GroupBox200, "Pfadtext" ); |
- PfadText->setText(tr("Documents:")); |
- GroupBox200Layout->addWidget( PfadText ); |
- Docs = new QLineEdit( GroupBox200, "Datei" ); |
- Docs->setMinimumSize( QSize( 268, 22 ) ); |
- Docs->setText(Vor->DocDir); |
- GroupBox200Layout->addWidget( Docs ); |
- FileC = new QToolButton( GroupBox200, "FileC" ); |
- FileC->setMinimumSize( QSize( 88, 24 ) ); |
- FileC->setText( tr( "Change..." ) ); |
- GroupBox200Layout->addWidget( FileC ); |
- tabLayout->addMultiCellWidget( GroupBox200, 2, 2, 0, 1 ); |
- |
- TabWidget3->insertTab( tab, tr( "General" ) ); |
- |
- tab_7 = new QWidget( TabWidget3, "tab_7" ); |
- tabLayout_7 = new QHBoxLayout( tab_7, 11, 6, "tabLayout_7"); |
- Layout21 = new QVBoxLayout( 0, 0, 6, "Layout21"); |
- GroupSize = new QButtonGroup( tab_7, "GroupSize" ); |
- GroupSize->setTitle( tr( "Page Size" ) ); |
- GroupSize->setColumnLayout(0, Qt::Vertical ); |
- GroupSize->layout()->setSpacing( 6 ); |
- GroupSize->layout()->setMargin( 10 ); |
- GroupSizeLayout = new QVBoxLayout( GroupSize->layout() ); |
- GroupSizeLayout->setAlignment( Qt::AlignTop ); |
- Layout6 = new QGridLayout( 0, 1, 1, 0, 6, "Layout6"); |
- GZText2 = new QLabel( GroupSize, "GZText2" ); |
- GZText2->setText( tr( "Orientation:" ) ); |
- Layout6->addWidget( GZText2, 1, 0 ); |
- GZComboF = new QComboBox( true, GroupSize, "GZComboF" ); |
- GZComboF->insertItem( tr( "A0" ) ); |
- GZComboF->insertItem( tr( "A1" ) ); |
- GZComboF->insertItem( tr( "A2" ) ); |
- GZComboF->insertItem( tr( "A3" ) ); |
- GZComboF->insertItem( tr( "A4" ) ); |
- GZComboF->insertItem( tr( "A5" ) ); |
- GZComboF->insertItem( tr( "A6" ) ); |
- GZComboF->insertItem( tr( "A7" ) ); |
- GZComboF->insertItem( tr( "A8" ) ); |
- GZComboF->insertItem( tr( "A9" ) ); |
- GZComboF->insertItem( tr( "B0" ) ); |
- GZComboF->insertItem( tr( "B1" ) ); |
- GZComboF->insertItem( tr( "B2" ) ); |
- GZComboF->insertItem( tr( "B3" ) ); |
- GZComboF->insertItem( tr( "B4" ) ); |
- GZComboF->insertItem( tr( "B5" ) ); |
- GZComboF->insertItem( tr( "B6" ) ); |
- GZComboF->insertItem( tr( "B7" ) ); |
- GZComboF->insertItem( tr( "B8" ) ); |
- GZComboF->insertItem( tr( "B9" ) ); |
- GZComboF->insertItem( tr( "B10" ) ); |
- GZComboF->insertItem( tr( "C5E" ) ); |
- GZComboF->insertItem( tr( "Comm10E" ) ); |
- GZComboF->insertItem( tr( "DLE" ) ); |
- GZComboF->insertItem( tr( "Executive" ) ); |
- GZComboF->insertItem( tr( "Folio" ) ); |
- GZComboF->insertItem( tr( "Ledger" ) ); |
- GZComboF->insertItem( tr( "Legal" ) ); |
- GZComboF->insertItem( tr( "Letter" ) ); |
- GZComboF->insertItem( tr( "Tabloid" ) ); |
- GZComboF->insertItem( tr( "Custom" ) ); |
- GZComboF->setEditable(false); |
- GZComboF->setCurrentItem(Vor->PageFormat); |
- Layout6->addWidget( GZComboF, 0, 1 ); |
- |
- GZComboO = new QComboBox( true, GroupSize, "GZComboO" ); |
- GZComboO->insertItem( tr( "Portrait" ) ); |
- GZComboO->insertItem( tr( "Landscape" ) ); |
- GZComboO->setEditable(false); |
- GZComboO->setCurrentItem(Vor->Ausrichtung); |
- |
- Layout6->addWidget( GZComboO, 1, 1 ); |
- |
- GZText1 = new QLabel( GroupSize, "GZText1" ); |
- GZText1->setText( tr( "Size:" ) ); |
- |
- Layout6->addWidget( GZText1, 0, 0 ); |
- GroupSizeLayout->addLayout( Layout6 ); |
- |
- Layout5_2 = new QHBoxLayout( 0, 0, 6, "Layout5_2"); |
- |
- GZText3 = new QLabel( GroupSize, "GZText3" ); |
- GZText3->setText( tr( "Width:" ) ); |
- Layout5_2->addWidget( GZText3 ); |
- |
- Breite = new MSpinBox( GroupSize, 2 ); |
- Breite->setEnabled( false ); |
- Breite->setMinimumSize( QSize( 70, 20 ) ); |
- Breite->setMaxValue( 1000000 ); |
- Breite->setMinValue( 1 ); |
- Layout5_2->addWidget( Breite ); |
- |
- GZText4 = new QLabel( GroupSize, "GZText4" ); |
- GZText4->setText( tr( "Height:" ) ); |
- Layout5_2->addWidget( GZText4 ); |
- |
- Hoehe = new MSpinBox( GroupSize, 2 ); |
- Hoehe->setEnabled( false ); |
- Hoehe->setMinimumSize( QSize( 70, 20 ) ); |
- Hoehe->setMaxValue( 1000000 ); |
- Hoehe->setMinValue( 1 ); |
- Layout5_2->addWidget( Hoehe ); |
- GroupSizeLayout->addLayout( Layout5_2 ); |
- Breite->setValue(qRound(Vor->PageBreite * Umrech) * 100); |
- Hoehe->setValue(qRound(Vor->PageHoehe * Umrech) * 100); |
- Breite->setLineStep(100); |
- Hoehe->setLineStep(100); |
- |
- Layout8 = new QHBoxLayout( 0, 0, 6, "Layout8"); |
- |
- Doppelseiten = new QCheckBox( GroupSize, "Doppelseiten" ); |
- Doppelseiten->setText( tr( "Facing Pages" ) ); |
- Doppelseiten->setChecked(Vor->DoppelSeiten); |
- Layout8->addWidget( Doppelseiten ); |
- |
- Linkszuerst = new QCheckBox( GroupSize, "Linkszuerst" ); |
- Linkszuerst->setText( tr( "Left Page first" ) ); |
- Linkszuerst->setChecked(Vor->ErsteLinks); |
- if (!Doppelseiten->isChecked()) |
- Linkszuerst->setEnabled(false); |
- Layout8->addWidget( Linkszuerst ); |
- GroupSizeLayout->addLayout( Layout8 ); |
- Layout21->addWidget( GroupSize ); |
- |
- GroupRand = new QGroupBox( tab_7, "GroupRand" ); |
- GroupRand->setTitle( tr( "Margin Guides" ) ); |
- GroupRand->setColumnLayout(0, Qt::Vertical ); |
- GroupRand->layout()->setSpacing( 5 ); |
- GroupRand->layout()->setMargin( 10 ); |
- GroupRandLayout = new QGridLayout( GroupRand->layout() ); |
- GroupRandLayout->setAlignment( Qt::AlignTop ); |
- |
- TopR = new MSpinBox( GroupRand, 2 ); |
- TopR->setMinimumSize( QSize( 70, 20 ) ); |
- TopR->setMaxValue( 100000 ); |
- TopR->setMinValue( 0 ); |
- TopR->setValue( qRound(Vor->RandOben * Umrech * 100)); |
- GroupRandLayout->addWidget( TopR, 0, 1 ); |
- BottomR = new MSpinBox( GroupRand, 2 ); |
- BottomR->setMinimumSize( QSize( 70, 20 ) ); |
- BottomR->setMaxValue( 100000 ); |
- BottomR->setMinValue( 0 ); |
- BottomR->setValue( qRound(Vor->RandUnten * Umrech * 100)); |
- GroupRandLayout->addWidget( BottomR, 1, 1 ); |
- RightR = new MSpinBox( GroupRand, 2 ); |
- RightR->setMinimumSize( QSize( 70, 20 ) ); |
- RightR->setMaxValue( 100000 ); |
- RightR->setMinValue( 0 ); |
- RightR->setValue( qRound(Vor->RandRechts * Umrech * 100)); |
- GroupRandLayout->addWidget( RightR, 1, 3 ); |
- LeftR = new MSpinBox( GroupRand, 2 ); |
- LeftR->setMinimumSize( QSize( 70, 20 ) ); |
- LeftR->setMaxValue( 100000 ); |
- LeftR->setMinValue( 0 ); |
- LeftR->setValue( qRound(Vor->RandLinks * Umrech * 100)); |
- GroupRandLayout->addWidget( LeftR, 0, 3 ); |
- Breite->setLineStep(100); |
- Hoehe->setLineStep(100); |
- TopR->setLineStep(100); |
- LeftR->setLineStep(100); |
- RightR->setLineStep(100); |
- BottomR->setLineStep(100); |
- |
- GRText2 = new QLabel( GroupRand, "GRText2" ); |
- GRText2->setText( tr( "Bottom:" ) ); |
- GroupRandLayout->addWidget( GRText2, 1, 0 ); |
- GRText1 = new QLabel( GroupRand, "GRText1" ); |
- GRText1->setText( tr( "Top:" ) ); |
- GroupRandLayout->addWidget( GRText1, 0, 0 ); |
- GRText4 = new QLabel( GroupRand, "GRText4" ); |
- GRText4->setText( tr( "Right:" ) ); |
- GroupRandLayout->addWidget( GRText4, 1, 2 ); |
- GRText3 = new QLabel( GroupRand, "GRText3" ); |
- GRText3->setText( tr( "Left:" ) ); |
- GroupRandLayout->addWidget( GRText3, 0, 2 ); |
- |
- Layout21->addWidget( GroupRand ); |
- tabLayout_7->addLayout( Layout21 ); |
- |
- Layout21b = new QVBoxLayout( 0, 0, 6, "Layout21b"); |
- GroupAS = new QGroupBox( tab_7, "GroupAS" ); |
- GroupAS->setTitle( tr( "Autosave" ) ); |
- GroupAS->setColumnLayout(0, Qt::Vertical ); |
- GroupAS->layout()->setSpacing( 5 ); |
- GroupAS->layout()->setMargin( 10 ); |
- GroupASLayout = new QGridLayout( GroupAS->layout() ); |
- GroupASLayout->setAlignment( Qt::AlignTop ); |
- ASon = new QCheckBox( GroupAS, "Enable Autosave" ); |
- ASon->setText( tr( "Enabled" ) ); |
- if (ap->HaveDoc) |
- ASon->setChecked(ap->doc->AutoSave); |
- else |
- ASon->setChecked(Vor->AutoSave); |
- GroupASLayout->addMultiCellWidget( ASon, 0, 0, 0, 1 ); |
- ASText = new QLabel( GroupAS, "ASText" ); |
- ASText->setText( tr( "Intervall:" ) ); |
- GroupASLayout->addWidget( ASText, 1, 0 ); |
- ASTime = new QSpinBox( GroupAS, "Time" ); |
- ASTime->setMaxValue( 60 ); |
- ASTime->setMinValue( 1 ); |
- ASTime->setSuffix( " min" ); |
- ASTime->setValue(Vor->AutoSaveTime / 1000 / 60); |
- GroupASLayout->addWidget( ASTime, 1, 1 ); |
- Layout21b->addWidget( GroupAS ); |
- QSpacerItem* spacerDocb = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
- Layout21b->addItem( spacerDocb ); |
- tabLayout_7->addLayout( Layout21b ); |
- TabWidget3->insertTab( tab_7, tr( "Document" ) ); |
- |
- tab_2 = new QWidget( TabWidget3, "tab_2" ); |
- tabLayout_2 = new QGridLayout( tab_2 ); |
- tabLayout_2->setSpacing( 6 ); |
- tabLayout_2->setMargin( 11 ); |
- GroupBox1 = new QGroupBox( tab_2, "GroupBox1" ); |
- GroupBox1->setTitle( tr( "Grid Layout" ) ); |
- GroupBox1->setColumnLayout(0, Qt::Vertical ); |
- GroupBox1->layout()->setSpacing( 0 ); |
- GroupBox1->layout()->setMargin( 0 ); |
- GroupBox1Layout = new QHBoxLayout( GroupBox1->layout() ); |
- GroupBox1Layout->setAlignment( Qt::AlignTop ); |
- GroupBox1Layout->setSpacing( 0 ); |
- GroupBox1Layout->setMargin( 10 ); |
- Layout10 = new QGridLayout; |
- Layout10->setSpacing( 6 ); |
- Layout10->setMargin( 0 ); |
- TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); |
- TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel1->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel1->setText( tr( "Minor Grid Spacing:" ) ); |
- Layout10->addWidget( TextLabel1, 0, 0 ); |
- TextLabel2 = new QLabel( GroupBox1, "TextLabel2" ); |
- TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel2->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel2->setText( tr( "Major Grid Spacing:" ) ); |
- Layout10->addWidget( TextLabel2, 1, 0 ); |
- SpinBox1 = new MSpinBox( GroupBox1, 2 ); |
- SpinBox1->setMaxValue( 100000 ); |
- SpinBox1->setMinValue( 1 ); |
- Layout10->addWidget( SpinBox1, 0, 1 ); |
- SpinBox2 = new MSpinBox( GroupBox1, 2 ); |
- SpinBox2->setMaxValue( 100000 ); |
- SpinBox2->setMinValue( 10 ); |
- SpinBox1->setLineStep(100); |
- SpinBox2->setLineStep(100); |
- Layout10->addWidget( SpinBox2, 1, 1 ); |
- TextLabel2g = new QLabel( GroupBox1, "TextLabel2" ); |
- TextLabel2g->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel2->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel2g->setText( tr( "Guide Snap Distance:" ) ); |
- Layout10->addWidget( TextLabel2g, 2, 0 ); |
- SpinBox2g = new MSpinBox( GroupBox1, 2 ); |
- SpinBox2g->setMaxValue( 100000 ); |
- SpinBox2g->setMinValue( 1 ); |
- SpinBox2g->setLineStep(100); |
- Layout10->addWidget( SpinBox2g, 2, 1 ); |
- if (ap->HaveDoc) |
- { |
- SpinBox2->setValue( qRound(ap->doc->majorGrid * Umrech * 100)); |
- SpinBox1->setValue( qRound(ap->doc->minorGrid * Umrech * 100)); |
- SpinBox2g->setValue( qRound(ap->doc->GuideRad * Umrech * 100)); |
- } |
- else |
- { |
- SpinBox2->setValue( qRound(Vor->DmajGrid * Umrech * 100)); |
- SpinBox1->setValue( qRound(Vor->DminGrid * Umrech * 100)); |
- SpinBox2g->setValue( qRound(Vor->GuideRad * Umrech * 100)); |
- } |
- GroupBox1Layout->addLayout( Layout10 ); |
- tabLayout_2->addWidget( GroupBox1, 0, 0 ); |
- GroupBox2 = new QGroupBox( tab_2, "GroupBox2" ); |
- GroupBox2->setTitle( tr( "Grid Colors" ) ); |
- GroupBox2->setColumnLayout(0, Qt::Vertical ); |
- GroupBox2->layout()->setSpacing( 0 ); |
- GroupBox2->layout()->setMargin( 0 ); |
- GroupBox2Layout = new QHBoxLayout( GroupBox2->layout() ); |
- GroupBox2Layout->setAlignment( Qt::AlignTop ); |
- GroupBox2Layout->setSpacing( 6 ); |
- GroupBox2Layout->setMargin( 11 ); |
- Layout11 = new QGridLayout; |
- Layout11->setSpacing( 6 ); |
- Layout11->setMargin( 0 ); |
- TextLabel3 = new QLabel( GroupBox2, "TextLabel3" ); |
- TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel3->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel3->setText( tr( "Minor Grid Color:" ) ); |
- Layout11->addWidget( TextLabel3, 0, 0 ); |
- TextLabel4 = new QLabel( GroupBox2, "TextLabel4" ); |
- TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel4->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel4->setText( tr( "Major Grid Color:" ) ); |
- Layout11->addWidget( TextLabel4, 1, 0 ); |
- minColor = new QPushButton( GroupBox2, "minColor" ); |
- minColor->setText( tr( "" ) ); |
- minColor->setAutoDefault( false ); |
- QPixmap pm = QPixmap(40, 20); |
- if (ap->HaveDoc) |
- { |
- pm.fill(ap->doc->minorColor); |
- Cmin = ap->doc->minorColor; |
- } |
- else |
- { |
- pm.fill(Vor->DminColor); |
- Cmin = Vor->DminColor; |
- } |
- minColor->setPixmap(pm); |
- Layout11->addWidget( minColor, 0, 1 ); |
- MaxColor = new QPushButton( GroupBox2, "MaxColor" ); |
- MaxColor->setText( tr( "" ) ); |
- MaxColor->setAutoDefault( false ); |
- QPixmap pm1 = QPixmap(40, 20); |
- if (ap->HaveDoc) |
- { |
- pm1.fill(ap->doc->majorColor); |
- Cmax = ap->doc->majorColor; |
- } |
- else |
- { |
- pm1.fill(Vor->DmajColor); |
- Cmax = Vor->DmajColor; |
- } |
- MaxColor->setPixmap(pm1); |
- Layout11->addWidget( MaxColor, 1, 1 ); |
- TextLabel4g = new QLabel( GroupBox2, "TextLabel4g" ); |
- TextLabel4g->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel4->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel4g->setText( tr( "User Guides Color:" ) ); |
- Layout11->addWidget( TextLabel4g, 2, 0 ); |
- GuideColor = new QPushButton( GroupBox2, "GuideColor" ); |
- GuideColor->setText( tr( "" ) ); |
- GuideColor->setAutoDefault( false ); |
- QPixmap pm12 = QPixmap(40, 20); |
- if (ap->HaveDoc) |
- { |
- pm12.fill(ap->doc->guideColor); |
- Cgui = ap->doc->guideColor; |
- } |
- else |
- { |
- pm12.fill(Vor->guideColor); |
- Cgui = Vor->guideColor; |
- } |
- GuideColor->setPixmap(pm12); |
- Layout11->addWidget( GuideColor, 2, 1 ); |
- GroupBox2Layout->addLayout( Layout11 ); |
- tabLayout_2->addWidget( GroupBox2, 1, 0 ); |
- ButtonGroup5 = new QButtonGroup( tab_2, "ButtonGroup5" ); |
- ButtonGroup5->setTitle( tr( "Placing" ) ); |
- ButtonGroup5->setExclusive( true ); |
- ButtonGroup5->setColumnLayout(0, Qt::Vertical ); |
- ButtonGroup5->layout()->setSpacing( 0 ); |
- ButtonGroup5->layout()->setMargin( 0 ); |
- ButtonGroup5Layout = new QHBoxLayout( ButtonGroup5->layout() ); |
- ButtonGroup5Layout->setAlignment( Qt::AlignTop ); |
- ButtonGroup5Layout->setSpacing( 6 ); |
- ButtonGroup5Layout->setMargin( 11 ); |
- Layout7 = new QVBoxLayout; |
- Layout7->setSpacing( 6 ); |
- Layout7->setMargin( 0 ); |
- RadioButton6 = new QRadioButton( ButtonGroup5, "RadioButton6" ); |
- RadioButton6->setText( tr( "In the Background" ) ); |
- if (ap->HaveDoc) |
- RadioButton6->setChecked( ap->doc->Before ); |
- else |
- RadioButton6->setChecked( Vor->Before ); |
- Layout7->addWidget( RadioButton6 ); |
- RadioButton7 = new QRadioButton( ButtonGroup5, "RadioButton6_2" ); |
- RadioButton7->setText( tr( "In the Foreground" ) ); |
- if (ap->HaveDoc) |
- RadioButton7->setChecked( !ap->doc->Before ); |
- else |
- RadioButton7->setChecked( !Vor->Before ); |
- Layout7->addWidget( RadioButton7 ); |
- ButtonGroup5Layout->addLayout( Layout7 ); |
- tabLayout_2->addWidget( ButtonGroup5, 0, 1 ); |
- TabWidget3->insertTab( tab_2, tr( "Guides" ) ); |
- |
- tab_4 = new QWidget( TabWidget3, "tab_4" ); |
- tabLayout_3 = new QGridLayout( tab_4 ); |
- tabLayout_3->setSpacing( 6 ); |
- tabLayout_3->setMargin( 11 ); |
- GroupBox4_2 = new QGroupBox( tab_4, "GroupBox4_2" ); |
- GroupBox4_2->setTitle( tr( "Subscript" ) ); |
- GroupBox4_2->setColumnLayout(0, Qt::Vertical ); |
- GroupBox4_2->layout()->setSpacing( 0 ); |
- GroupBox4_2->layout()->setMargin( 0 ); |
- GroupBox4_2Layout = new QHBoxLayout( GroupBox4_2->layout() ); |
- GroupBox4_2Layout->setAlignment( Qt::AlignTop ); |
- GroupBox4_2Layout->setSpacing( 6 ); |
- GroupBox4_2Layout->setMargin( 11 ); |
- |
- Layout12 = new QGridLayout; |
- Layout12->setSpacing( 6 ); |
- Layout12->setMargin( 0 ); |
- TextLabel2_3_2 = new QLabel( GroupBox4_2, "TextLabel2_3_2" ); |
- TextLabel2_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel2_3_2->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel2_3_2->setText( tr( "Scaling:" ) ); |
- Layout12->addWidget( TextLabel2_3_2, 1, 0 ); |
- TextLabel1_5_2 = new QLabel( GroupBox4_2, "TextLabel1_5_2" ); |
- TextLabel1_5_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel1_5_2->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel1_5_2->setText( tr( "Disp.:" ) ); |
- Layout12->addWidget( TextLabel1_5_2, 0, 0 ); |
- VTiefW = new QSpinBox( GroupBox4_2, "VTiefW" ); |
- VTiefW->setSuffix( tr( " %" ) ); |
- VTiefW->setMaxValue( 100 ); |
- VTiefW->setMinValue( 1 ); |
- if (ap->HaveDoc) |
- VTiefW->setValue( ap->doc->VTief ); |
- else |
- VTiefW->setValue( Vor->DVTief ); |
- Layout12->addWidget( VTiefW, 0, 1 ); |
- VTiefWSc = new QSpinBox( GroupBox4_2, "VTiefWSc" ); |
- VTiefWSc->setSuffix( tr( " %" ) ); |
- VTiefWSc->setMaxValue( 100 ); |
- VTiefWSc->setMinValue( 1 ); |
- if (ap->HaveDoc) |
- VTiefWSc->setValue( ap->doc->VTiefSc ); |
- else |
- VTiefWSc->setValue( Vor->DVTiefSc ); |
- Layout12->addWidget( VTiefWSc, 1, 1 ); |
- GroupBox4_2Layout->addLayout( Layout12 ); |
- tabLayout_3->addWidget( GroupBox4_2, 1, 0 ); |
- GroupBox4 = new QGroupBox( tab_4, "GroupBox4" ); |
- GroupBox4->setTitle( tr( "Superscript" ) ); |
- GroupBox4->setColumnLayout(0, Qt::Vertical ); |
- GroupBox4->layout()->setSpacing( 0 ); |
- GroupBox4->layout()->setMargin( 0 ); |
- GroupBox4Layout = new QHBoxLayout( GroupBox4->layout() ); |
- GroupBox4Layout->setAlignment( Qt::AlignTop ); |
- GroupBox4Layout->setSpacing( 6 ); |
- GroupBox4Layout->setMargin( 11 ); |
- Layout13 = new QGridLayout; |
- Layout13->setSpacing( 6 ); |
- Layout13->setMargin( 0 ); |
- TextLabel2_3 = new QLabel( GroupBox4, "TextLabel2_3" ); |
- TextLabel2_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel2_3->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel2_3->setText( tr( "Scaling:" ) ); |
- Layout13->addWidget( TextLabel2_3, 1, 0 ); |
- TextLabel1_5 = new QLabel( GroupBox4, "TextLabel1_5" ); |
- TextLabel1_5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel1_5->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel1_5->setText( tr( "Disp.:" ) ); |
- Layout13->addWidget( TextLabel1_5, 0, 0 ); |
- VHochW = new QSpinBox( GroupBox4, "VHochW" ); |
- VHochW->setSuffix( tr( " %" ) ); |
- VHochW->setMaxValue( 100 ); |
- VHochW->setMinValue( 1 ); |
- if (ap->HaveDoc) |
- VHochW->setValue( ap->doc->VHoch ); |
- else |
- VHochW->setValue( Vor->DVHoch ); |
- Layout13->addWidget( VHochW, 0, 1 ); |
- VHochWSc = new QSpinBox( GroupBox4, "VHochWSc" ); |
- VHochWSc->setSuffix( tr( " %" ) ); |
- VHochWSc->setMaxValue( 100 ); |
- VHochWSc->setMinValue( 1 ); |
- if (ap->HaveDoc) |
- VHochWSc->setValue( ap->doc->VHochSc ); |
- else |
- VHochWSc->setValue( Vor->DVHochSc ); |
- Layout13->addWidget( VHochWSc, 1, 1 ); |
- GroupBox4Layout->addLayout( Layout13 ); |
- tabLayout_3->addWidget( GroupBox4, 0, 0 ); |
- GroupBox4_3 = new QGroupBox( tab_4, "GroupBox4_3" ); |
- GroupBox4_3->setTitle( tr( "Small Caps" ) ); |
- GroupBox4_3->setColumnLayout(0, Qt::Vertical ); |
- GroupBox4_3->layout()->setSpacing( 0 ); |
- GroupBox4_3->layout()->setMargin( 0 ); |
- GroupBox4_3Layout = new QHBoxLayout( GroupBox4_3->layout() ); |
- GroupBox4_3Layout->setAlignment( Qt::AlignTop ); |
- GroupBox4_3Layout->setSpacing( 6 ); |
- GroupBox4_3Layout->setMargin( 11 ); |
- Layout14 = new QHBoxLayout; |
- Layout14->setSpacing( 6 ); |
- Layout14->setMargin( 0 ); |
- TextLabel2_3_3 = new QLabel( GroupBox4_3, "TextLabel2_3_3" ); |
- TextLabel2_3_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel2_3_3->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel2_3_3->setText( tr( "Scaling:" ) ); |
- Layout14->addWidget( TextLabel2_3_3 ); |
- SmallCaps = new QSpinBox( GroupBox4_3, "SmallCaps" ); |
- SmallCaps->setSuffix( tr( " %" ) ); |
- SmallCaps->setMaxValue( 100 ); |
- SmallCaps->setMinValue( 1 ); |
- if (ap->HaveDoc) |
- SmallCaps->setValue( ap->doc->VKapit ); |
- else |
- SmallCaps->setValue( Vor->DVKapit ); |
- Layout14->addWidget( SmallCaps ); |
- GroupBox4_3Layout->addLayout( Layout14 ); |
- tabLayout_3->addWidget( GroupBox4_3, 0, 1 ); |
- |
- GroupBox4_3a = new QGroupBox( tab_4, "GroupBox4_3a" ); |
- GroupBox4_3a->setTitle( tr( "Other" ) ); |
- GroupBox4_3a->setColumnLayout(0, Qt::Vertical ); |
- GroupBox4_3a->layout()->setSpacing( 0 ); |
- GroupBox4_3a->layout()->setMargin( 0 ); |
- GroupBox4_3aLayout = new QHBoxLayout( GroupBox4_3a->layout() ); |
- GroupBox4_3aLayout->setAlignment( Qt::AlignTop ); |
- GroupBox4_3aLayout->setSpacing( 6 ); |
- GroupBox4_3aLayout->setMargin( 11 ); |
- Layout14a = new QHBoxLayout; |
- Layout14a->setSpacing( 6 ); |
- Layout14a->setMargin( 0 ); |
- TextLabel2_3_3a = new QLabel( GroupBox4_3a, "TextLabel2_3_3" ); |
- TextLabel2_3_3a->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel2_3_3a->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel2_3_3a->setText( tr( "Automatic Linespaceing:" ) ); |
- Layout14a->addWidget( TextLabel2_3_3a ); |
- AutoLineV = new QSpinBox( GroupBox4_3a, "LineS" ); |
- AutoLineV->setSuffix( tr( " %" ) ); |
- AutoLineV->setMaxValue( 100 ); |
- AutoLineV->setMinValue( 1 ); |
- if (ap->HaveDoc) |
- AutoLineV->setValue( ap->doc->AutoLine ); |
- else |
- AutoLineV->setValue( Vor->AutoLine ); |
- Layout14a->addWidget( AutoLineV ); |
- GroupBox4_3aLayout->addLayout( Layout14a ); |
- tabLayout_3->addWidget( GroupBox4_3a, 1, 1 ); |
- |
- TabWidget3->insertTab( tab_4, tr( "Typographics" ) ); |
- |
- tab_3 = new QWidget( TabWidget3, "tab_3" ); |
- tabLayout_4 = new QHBoxLayout( tab_3 ); |
- tabLayout_4->setSpacing( 0 ); |
- tabLayout_4->setMargin( 10 ); |
- ButtonGroup2 = new QButtonGroup( tab_3, "ButtonGroup2" ); |
- ButtonGroup2->setTitle( tr( "" ) ); |
- ButtonGroup2->setExclusive( true ); |
- ButtonGroup2->setColumnLayout(0, Qt::Vertical ); |
- ButtonGroup2->layout()->setSpacing( 0 ); |
- ButtonGroup2->layout()->setMargin( 0 ); |
- ButtonGroup2Layout = new QHBoxLayout( ButtonGroup2->layout() ); |
- ButtonGroup2Layout->setAlignment( Qt::AlignTop ); |
- ButtonGroup2Layout->setSpacing( 6 ); |
- ButtonGroup2Layout->setMargin( 5 ); |
- Layout16 = new QGridLayout; |
- Layout16->setSpacing( 6 ); |
- Layout16->setMargin( 0 ); |
- TextButton = new QToolButton( ButtonGroup2, "TextButton" ); |
- TextButton->setText( tr( "" ) ); |
- TextButton->setPixmap(loadIcon("Text.xpm")); |
- TextButton->setToggleButton( true ); |
- TextButton->setOn( true ); |
- ButtonGroup2->insert( TextButton, -1 ); |
- Layout16->addWidget( TextButton, 0, 0 ); |
- BildButton = new QToolButton( ButtonGroup2, "BildButton" ); |
- BildButton->setText( tr( "" ) ); |
- BildButton->setPixmap(loadIcon("Bild.xpm")); |
- BildButton->setToggleButton( true ); |
- ButtonGroup2->insert( BildButton, -1 ); |
- Layout16->addWidget( BildButton, 0, 1 ); |
- RectButton = new QToolButton( ButtonGroup2, "RectButton" ); |
- RectButton->setText( tr( "" ) ); |
- RectButton->setPixmap(loadIcon("Rechtecke.xpm") ); |
- RectButton->setToggleButton( true ); |
- ButtonGroup2->insert( RectButton, -1 ); |
- Layout16->addWidget( RectButton, 1, 0 ); |
- OvalButton = new QToolButton( ButtonGroup2, "OvalButton" ); |
- OvalButton->setText( tr( "" ) ); |
- OvalButton->setPixmap(loadIcon("Kreise.xpm")); |
- OvalButton->setToggleButton( true ); |
- ButtonGroup2->insert( OvalButton, -1 ); |
- Layout16->addWidget( OvalButton, 1, 1 ); |
- ZoomButton = new QToolButton( ButtonGroup2, "ZoomButton" ); |
- ZoomButton->setText( tr( "" ) ); |
- ZoomButton->setPixmap(loadIcon("Lupe.xpm")); |
- ZoomButton->setToggleButton( true ); |
- ButtonGroup2->insert( ZoomButton, -1 ); |
- Layout16->addWidget( ZoomButton, 2, 0 ); |
- LineButton = new QToolButton( ButtonGroup2, "LineButton" ); |
- LineButton->setText( tr( "" ) ); |
- LineButton->setPixmap(loadIcon("Stift.xpm")); |
- LineButton->setToggleButton( true ); |
- ButtonGroup2->insert( LineButton, -1 ); |
- Layout16->addWidget( LineButton, 2, 1 ); |
- PolyButton = new QToolButton( ButtonGroup2, "PolyButton" ); |
- PolyButton->setText( tr( "" ) ); |
- PolyButton->setPixmap(loadIcon("spline.png")); |
- PolyButton->setToggleButton( true ); |
- ButtonGroup2->insert( PolyButton, -1 ); |
- Layout16->addWidget( PolyButton, 3, 0 ); |
- ButtonGroup2Layout->addLayout( Layout16 ); |
- tabLayout_4->addWidget( ButtonGroup2 ); |
- |
- Fram = new QWidgetStack(tab_3); |
- tabLayout_4->addWidget( Fram ); |
- |
- ToolFrame = new QFrame( this, "ToolFrame" ); |
- ToolFrame->setFrameShape( QFrame::Box ); |
- ToolFrame->setFrameShadow( QFrame::Sunken ); |
- ToolFrameLayout = new QHBoxLayout( ToolFrame ); |
- ToolFrameLayout->setSpacing( 0 ); |
- ToolFrameLayout->setMargin( 10 ); |
- Layout15a = new QGridLayout; |
- Layout15a->setSpacing( 6 ); |
- Layout15a->setMargin( 0 ); |
- TextLabel2_2 = new QLabel( ToolFrame, "TextLabel2_2" ); |
- TextLabel2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel2_2->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel2_2->setText( tr( "Default Size:" ) ); |
- Layout15a->addWidget( TextLabel2_2, 1, 0 ); |
- TextLabel1_3 = new QLabel( ToolFrame, "TextLabel1_3" ); |
- TextLabel1_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel1_3->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel1_3->setText( tr( "Default Font:" ) ); |
- Layout15a->addWidget( TextLabel1_3, 0, 0 ); |
- FontCombo = new QComboBox( true, ToolFrame, "FontCombo" ); |
- FontCombo->setEditable(false); |
- QStringList rlist; |
- rlist.clear(); |
- SCFontsIterator it(*fon); |
- for ( ; it.current(); ++it) |
- { |
- if (it.current()->UseFont) |
- rlist.append(it.currentKey()); |
- } |
- rlist.sort(); |
- FontCombo->insertStringList(rlist); |
- if (ap->HaveDoc) |
- { |
- for (int fc=0; fc<FontCombo->count(); ++fc) |
- { |
- if (FontCombo->text(fc) == ap->doc->Dfont) |
- { |
- FontCombo->setCurrentItem(fc); |
- break; |
- } |
- } |
- } |
- else |
- { |
- for (int fc=0; fc<FontCombo->count(); ++fc) |
- { |
- if (FontCombo->text(fc) == Vor->DefFont) |
- { |
- FontCombo->setCurrentItem(fc); |
- break; |
- } |
- } |
- } |
- Layout15a->addWidget( FontCombo, 0, 1 ); |
- SizeCombo = new QComboBox( true, ToolFrame, "SizeCombo" ); |
- SizeCombo->setEditable(false); |
- SizeCombo->insertItem(" 7 pt"); |
- SizeCombo->insertItem(" 9 pt"); |
- SizeCombo->insertItem("10 pt"); |
- SizeCombo->insertItem("12 pt"); |
- SizeCombo->insertItem("14 pt"); |
- SizeCombo->insertItem("18 pt"); |
- SizeCombo->insertItem("24 pt"); |
- SizeCombo->insertItem("36 pt"); |
- SizeCombo->insertItem("48 pt"); |
- SizeCombo->insertItem("60 pt"); |
- SizeCombo->insertItem("72 pt"); |
- int a; |
- if (ap->HaveDoc) |
- { |
- for (a = 0; a < SizeCombo->count(); ++a) |
- { |
- if (SizeCombo->text(a).left(2).toInt() == ap->doc->Dsize) |
- SizeCombo->setCurrentItem(a); |
- } |
- } |
- else |
- { |
- for (a = 0; a < SizeCombo->count(); ++a) |
- { |
- if (SizeCombo->text(a).left(2).toInt() == Vor->DefSize) |
- SizeCombo->setCurrentItem(a); |
- } |
- } |
- Layout15a->addWidget( SizeCombo, 1, 1 ); |
- TextLabelT1 = new QLabel( ToolFrame, "TextLabel1_3_2" ); |
- TextLabelT1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT1->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT1->setText( tr( "Text Color:" ) ); |
- Layout15a->addWidget( TextLabelT1, 2, 0 ); |
- ForegroundT = new QComboBox( true, ToolFrame, "Foreground" ); |
- ForegroundT->setEditable(false); |
- QPixmap pm2; |
- pm2 = QPixmap(15, 15); |
- CListe::Iterator itc; |
- for (itc = Vor->DColors.begin(); itc != Vor->DColors.end(); ++itc) |
- { |
- pm2.fill(Vor->DColors[itc.key()].getRGBColor()); |
- ForegroundT->insertItem(pm2, itc.key()); |
- if (itc.key() == Vor->DpenText) |
- { |
- ForegroundT->setCurrentItem(ForegroundT->count()-1); |
- } |
- } |
- Layout15a->addWidget( ForegroundT, 2, 1 ); |
- TextLabel1_4 = new QLabel( ToolFrame, "TextLabel1_4" ); |
- TextLabel1_4->setMinimumSize(QSize(260, 70)); |
- TextLabel1_4->setText( tr( "Woven silk pyjamas exchanged for blue quartz" ) ); |
- TextLabel1_4->setAlignment( static_cast<int>( QLabel::AlignVCenter | QLabel::AlignLeft ) ); |
- SetSample(); |
- Layout15a->addMultiCellWidget( TextLabel1_4, 3, 3, 0, 1 ); |
- QSpacerItem* sp09 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- ToolFrameLayout->addItem( sp09 ); |
- ToolFrameLayout->addLayout( Layout15a ); |
- QSpacerItem* sp10 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- ToolFrameLayout->addItem( sp10 ); |
- Fram->addWidget(ToolFrame, 1); |
- |
- ToolFrame2 = new QFrame( this, "ToolFrame" ); |
- ToolFrame2->setFrameShape( QFrame::Box ); |
- ToolFrame2->setFrameShadow( QFrame::Sunken ); |
- ToolFrame2Layout = new QHBoxLayout( ToolFrame2 ); |
- ToolFrame2Layout->setSpacing( 0 ); |
- ToolFrame2Layout->setMargin( 10 ); |
- Layout15b = new QGridLayout; |
- Layout15b->setSpacing( 6 ); |
- Layout15b->setMargin( 0 ); |
- TextLabelT21 = new QLabel( ToolFrame2, "TextLabel1_3_2" ); |
- TextLabelT21->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT21->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT21->setText( tr( "Line Color:" ) ); |
- Layout15b->addWidget(TextLabelT21, 0, 0); |
- TextLabelT22 = new QLabel( ToolFrame2, "TextLabel2_2" ); |
- TextLabelT22->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT22->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT22->setText( tr( "Shading:" ) ); |
- Layout15b->addWidget(TextLabelT22, 1, 0); |
- TextLabelT23 = new QLabel( ToolFrame2, "TextLabel1_3" ); |
- TextLabelT23->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT23->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT23->setText( tr( "Fill Color:" ) ); |
- Layout15b->addWidget(TextLabelT23, 2, 0); |
- TextLabelT24 = new QLabel( ToolFrame2, "TextLabel2_2_2" ); |
- TextLabelT24->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT24->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT24->setText( tr( "Shading:" ) ); |
- Layout15b->addWidget(TextLabelT24, 3, 0); |
- TextLabelT25 = new QLabel( ToolFrame2, "TextLabel1_3_3" ); |
- TextLabelT25->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT25->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT25->setText( tr( "Linestyle:" ) ); |
- Layout15b->addWidget(TextLabelT25, 4, 0); |
- TextLabelT26 = new QLabel( ToolFrame2, "TextLabel2_3_4" ); |
- TextLabelT26->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT26->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT26->setText( tr( "Linewidth:" ) ); |
- Layout15b->addWidget(TextLabelT26, 5, 0); |
- Foreground = new QComboBox( true, ToolFrame2, "Foreground" ); |
- Foreground->setEditable(false); |
- Foreground->insertItem(tr("None")); |
- if (Vor->Dpen == "None") |
- Foreground->setCurrentItem(Foreground->count()-1); |
- pm2 = QPixmap(15, 15); |
- for (itc = Vor->DColors.begin(); itc != Vor->DColors.end(); ++itc) |
- { |
- pm2.fill(Vor->DColors[itc.key()].getRGBColor()); |
- Foreground->insertItem(pm2, itc.key()); |
- if (itc.key() == Vor->Dpen) |
- { |
- Foreground->setCurrentItem(Foreground->count()-1); |
- } |
- } |
- Layout15b->addWidget(Foreground, 0, 1); |
- Shade2 = new QSpinBox( ToolFrame2, "Shade2" ); |
- Shade2->setSuffix( tr( " %" ) ); |
- Shade2->setMaxValue( 100 ); |
- Shade2->setMinValue( 0 ); |
- if (ap->HaveDoc) |
- Shade2->setValue( ap->doc->Dshade2 ); |
- else |
- Shade2->setValue( Vor->Dshade2 ); |
- Layout15b->addWidget(Shade2, 1, 1); |
- Background = new QComboBox( true, ToolFrame2, "Background" ); |
- Background->setEditable(false); |
- Background->insertItem(tr("None")); |
- if (Vor->Dbrush == "None") |
- Background->setCurrentItem(Background->count()-1); |
- for (itc = Vor->DColors.begin(); itc != Vor->DColors.end(); ++itc) |
- { |
- pm2.fill(Vor->DColors[itc.key()].getRGBColor()); |
- Background->insertItem(pm2, itc.key()); |
- if (itc.key() == Vor->Dbrush) |
- { |
- Background->setCurrentItem(Background->count()-1); |
- } |
- } |
- Layout15b->addWidget(Background, 2, 1); |
- Shade = new QSpinBox( ToolFrame2, "Shade" ); |
- Shade->setSuffix( tr( " %" ) ); |
- Shade->setMaxValue( 100 ); |
- Shade->setMinValue( 0 ); |
- if (ap->HaveDoc) |
- Shade->setValue( ap->doc->Dshade ); |
- else |
- Shade->setValue( Vor->Dshade ); |
- Layout15b->addWidget(Shade, 3, 1); |
- Linestyle = new LineCombo(ToolFrame2); |
- Linestyle->setEditable(false); |
- int dla; |
- if (ap->HaveDoc) |
- dla = ap->doc->DLineArt; |
- else |
- dla = Vor->DLineArt; |
- switch (dla) |
- { |
- case SolidLine: |
- Linestyle->setCurrentItem(0); |
- break; |
- case DashLine: |
- Linestyle->setCurrentItem(1); |
- break; |
- case DotLine: |
- Linestyle->setCurrentItem(2); |
- break; |
- case DashDotLine: |
- Linestyle->setCurrentItem(3); |
- break; |
- case DashDotDotLine: |
- Linestyle->setCurrentItem(4); |
- break; |
- default: |
- Linestyle->setCurrentItem(0); |
- break; |
- } |
- Layout15b->addWidget(Linestyle, 4, 1); |
- LineW = new MSpinBox( ToolFrame2, 1 ); |
- LineW->setSuffix( tr( " pts" ) ); |
- LineW->setMaxValue( 200 ); |
- LineW->setMinValue( 0 ); |
- LineW->setLineStep(10); |
- if (ap->HaveDoc) |
- LineW->setValue(static_cast<int>(ap->doc->Dwidth*10)); |
- else |
- LineW->setValue(static_cast<int>(Vor->Dwidth*10)); |
- Layout15b->addWidget(LineW, 5, 1); |
- QSpacerItem* sp07 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- ToolFrame2Layout->addItem( sp07 ); |
- ToolFrame2Layout->addLayout( Layout15b ); |
- QSpacerItem* sp08 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- ToolFrame2Layout->addItem( sp08 ); |
- Fram->addWidget(ToolFrame2, 2); |
- |
- ToolFrame3 = new QFrame( this, "ToolFrame" ); |
- ToolFrame3->setFrameShape( QFrame::Box ); |
- ToolFrame3->setFrameShadow( QFrame::Sunken ); |
- ToolFrame3Layout = new QHBoxLayout( ToolFrame3 ); |
- ToolFrame3Layout->setSpacing( 0 ); |
- ToolFrame3Layout->setMargin( 10 ); |
- Layout15c = new QGridLayout; |
- Layout15c->setSpacing( 6 ); |
- Layout15c->setMargin( 0 ); |
- TextLabelT31 = new QLabel( ToolFrame3, "TextLabel1_3_2" ); |
- TextLabelT31->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT31->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT31->setText( tr( "Line Color:" ) ); |
- Layout15c->addWidget(TextLabelT31, 0, 0); |
- TextLabelT32 = new QLabel( ToolFrame3, "TextLabel2_2" ); |
- TextLabelT32->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT32->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT32->setText( tr( "Shading:" ) ); |
- Layout15c->addWidget(TextLabelT32, 1, 0); |
- TextLabelT35 = new QLabel( ToolFrame3, "TextLabel1_3_3" ); |
- TextLabelT35->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT35->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT35->setText( tr( "Linestyle:" ) ); |
- Layout15c->addWidget(TextLabelT35, 2, 0); |
- TextLabelT36 = new QLabel( ToolFrame3, "TextLabel2_3_4" ); |
- TextLabelT36->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT36->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT36->setText( tr( "Linewidth:" ) ); |
- Layout15c->addWidget(TextLabelT36, 3, 0); |
- Foreground2 = new QComboBox( true, ToolFrame3, "Foreground" ); |
- Foreground2->setEditable(false); |
- QPixmap pm3; |
- pm3 = QPixmap(15, 15); |
- CListe::Iterator itc2; |
- for (itc2 = Vor->DColors.begin(); itc2 != Vor->DColors.end(); ++itc2) |
- { |
- pm3.fill(Vor->DColors[itc2.key()].getRGBColor()); |
- Foreground2->insertItem(pm3, itc2.key()); |
- if (itc2.key() == Vor->DpenLine) |
- { |
- Foreground2->setCurrentItem(Foreground2->count()-1); |
- } |
- } |
- Layout15c->addWidget(Foreground2, 0, 1); |
- Shade22 = new QSpinBox( ToolFrame3, "Shade2" ); |
- Shade22->setSuffix( tr( " %" ) ); |
- Shade22->setMaxValue( 100 ); |
- Shade22->setMinValue( 0 ); |
- if (ap->HaveDoc) |
- Shade22->setValue( ap->doc->DshadeLine ); |
- else |
- Shade22->setValue( Vor->DshadeLine ); |
- Layout15c->addWidget(Shade22, 1, 1); |
- Linestyle2 = new LineCombo(ToolFrame3); |
- Linestyle2->setEditable(false); |
- if (ap->HaveDoc) |
- dla = ap->doc->DLstyleLine; |
- else |
- dla = Vor->DLstyleLine; |
- switch (dla) |
- { |
- case SolidLine: |
- Linestyle2->setCurrentItem(0); |
- break; |
- case DashLine: |
- Linestyle2->setCurrentItem(1); |
- break; |
- case DotLine: |
- Linestyle2->setCurrentItem(2); |
- break; |
- case DashDotLine: |
- Linestyle2->setCurrentItem(3); |
- break; |
- case DashDotDotLine: |
- Linestyle2->setCurrentItem(4); |
- break; |
- default: |
- Linestyle2->setCurrentItem(0); |
- break; |
- } |
- Layout15c->addWidget(Linestyle2, 2, 1); |
- LineW2 = new MSpinBox( ToolFrame3, 1 ); |
- LineW2->setSuffix( tr( " pts" ) ); |
- LineW2->setMaxValue( 200 ); |
- LineW2->setMinValue( 1 ); |
- LineW2->setLineStep(10); |
- if (ap->HaveDoc) |
- LineW2->setValue( static_cast<int>(ap->doc->DwidthLine*10) ); |
- else |
- LineW2->setValue( static_cast<int>(Vor->DwidthLine*10) ); |
- Layout15c->addWidget(LineW2, 3, 1); |
- QSpacerItem* sp05 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- ToolFrame3Layout->addItem( sp05 ); |
- ToolFrame3Layout->addLayout( Layout15c ); |
- QSpacerItem* sp06 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- ToolFrame3Layout->addItem( sp06 ); |
- Fram->addWidget(ToolFrame3, 3); |
- |
- ToolFrame4 = new QFrame( this, "ToolFrame" ); |
- ToolFrame4->setFrameShape( QFrame::Box ); |
- ToolFrame4->setFrameShadow( QFrame::Sunken ); |
- ToolFrame4Layout = new QHBoxLayout( ToolFrame4 ); |
- ToolFrame4Layout->setSpacing( 0 ); |
- ToolFrame4Layout->setMargin( 10 ); |
- Layout15d = new QGridLayout; |
- Layout15d->setSpacing( 6 ); |
- Layout15d->setMargin( 0 ); |
- TextLabelT42 = new QLabel( ToolFrame4, "TextLabel2_2" ); |
- TextLabelT42->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT42->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT42->setText( tr( "Minimum:" ) ); |
- Layout15d->addWidget(TextLabelT42, 0, 0); |
- TextLabelT43 = new QLabel( ToolFrame4, "TextLabel2_2_3" ); |
- TextLabelT43->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT43->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT43->setText( tr( "Maximum:" ) ); |
- Layout15d->addWidget(TextLabelT43, 1, 0); |
- TextLabelT44 = new QLabel( ToolFrame4, "TextLabel2_3_4" ); |
- TextLabelT44->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT44->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT44->setText( tr( "Stepping:" ) ); |
- Layout15d->addWidget(TextLabelT44, 2, 0); |
- MinMag = new QSpinBox( ToolFrame4, "Shade2" ); |
- MinMag->setSuffix( tr( " %" ) ); |
- MinMag->setMaxValue( 800 ); |
- MinMag->setMinValue( 10 ); |
- MinMag->setLineStep( 10 ); |
- if (ap->HaveDoc) |
- MinMag->setValue( ap->doc->MagMin ); |
- else |
- MinMag->setValue( Vor->MagMin ); |
- Layout15d->addWidget(MinMag, 0, 1); |
- MaxMag = new QSpinBox( ToolFrame4, "Shade" ); |
- MaxMag->setSuffix( tr( " %" ) ); |
- MaxMag->setMaxValue( 800 ); |
- MaxMag->setMinValue( 10 ); |
- MaxMag->setLineStep( 10 ); |
- if (ap->HaveDoc) |
- MaxMag->setValue( ap->doc->MagMax ); |
- else |
- MaxMag->setValue( Vor->MagMax ); |
- Layout15d->addWidget(MaxMag, 1, 1); |
- StepMag = new QSpinBox( ToolFrame4, "LineW" ); |
- StepMag->setSuffix( tr( " %" ) ); |
- StepMag->setMaxValue( 200 ); |
- StepMag->setMinValue( 1 ); |
- StepMag->setLineStep( 25 ); |
- if (ap->HaveDoc) |
- StepMag->setValue( ap->doc->MagStep ); |
- else |
- StepMag->setValue( Vor->MagStep ); |
- Layout15d->addWidget(StepMag, 2, 1); |
- QSpacerItem* sp03 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- ToolFrame4Layout->addItem( sp03 ); |
- ToolFrame4Layout->addLayout( Layout15d ); |
- QSpacerItem* sp04 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- ToolFrame4Layout->addItem( sp04 ); |
- Fram->addWidget(ToolFrame4, 4); |
- |
- ToolFrame5 = new QButtonGroup( this, "ToolFrame5" ); |
- ToolFrame5->setFrameShape( QFrame::Box ); |
- ToolFrame5->setFrameShadow( QFrame::Sunken ); |
- ToolFrame5->setExclusive( false ); |
- ToolFrame5->setRadioButtonExclusive(true); |
- ToolFrame5Layout = new QHBoxLayout( ToolFrame5 ); |
- ToolFrame5Layout->setSpacing( 0 ); |
- ToolFrame5Layout->setMargin( 20 ); |
- Layout15 = new QGridLayout; |
- Layout15->setSpacing( 6 ); |
- Layout15->setMargin( 0 ); |
- FreeScale = new QRadioButton( ToolFrame5, "FreeScale" ); |
- FreeScale->setText( tr( "Free Scaling" ) ); |
- Layout15->addMultiCellWidget( FreeScale, 0, 0, 0, 3 ); |
- TextLabelT51 = new QLabel( ToolFrame5, "TextLabelT51" ); |
- TextLabelT51->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT51->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT51->setText( tr( "Horizontal Scaling" ) ); |
- Layout15->addWidget( TextLabelT51, 1, 1 ); |
- TextLabelT52 = new QLabel( ToolFrame5, "TextLabelT52" ); |
- TextLabelT52->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT52->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT52->setText( tr( "Vertical Scaling" ) ); |
- Layout15->addWidget( TextLabelT52, 2, 1 ); |
- TextLabelT53 = new QLabel( ToolFrame5, "TextLabelT53" ); |
- TextLabelT53->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT53->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT53->setText( tr( "Fill Color:" ) ); |
- Layout15->addWidget( TextLabelT53, 5, 0 ); |
- TextLabelT54 = new QLabel( ToolFrame5, "TextLabelT54" ); |
- TextLabelT54->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabelT54->sizePolicy().hasHeightForWidth() ) ); |
- TextLabelT54->setText( tr( "Shading:" ) ); |
- Layout15->addWidget( TextLabelT54, 6, 0 ); |
- XScale = new QSpinBox( ToolFrame5, "XScale" ); |
- XScale->setSuffix( tr( " %" ) ); |
- XScale->setMaxValue( 1000 ); |
- XScale->setMinValue( 1 ); |
- if (ap->HaveDoc) |
- XScale->setValue( qRound(ap->doc->ScaleX * 100) ); |
- else |
- XScale->setValue( qRound(Vor->ScaleX * 100) ); |
- Layout15->addWidget( XScale, 1, 2 ); |
- YScale = new QSpinBox( ToolFrame5, "YScale" ); |
- YScale->setSuffix( tr( " %" ) ); |
- YScale->setMaxValue( 1000 ); |
- YScale->setMinValue( 1 ); |
- if (ap->HaveDoc) |
- YScale->setValue( qRound(ap->doc->ScaleY * 100) ); |
- else |
- YScale->setValue( qRound(Vor->ScaleY * 100) ); |
- Layout15->addWidget( YScale, 2, 2 ); |
- Kette = new LinkButton( ToolFrame5 ); |
- Kette->setToggleButton( true ); |
- Kette->setAutoRaise(true); |
- Layout15->addMultiCellWidget( Kette, 1, 2, 3, 3 ); |
- FrameScale = new QRadioButton(ToolFrame5, "FrameScale" ); |
- FrameScale->setText( tr( "Scale Picture to Frame Size" ) ); |
- Layout15->addMultiCellWidget( FrameScale, 3, 3, 0, 3 ); |
- Aspect = new QCheckBox( ToolFrame5, "Aspect" ); |
- Aspect->setText( tr( "Keep Aspect Ratio" ) ); |
- Layout15->addMultiCellWidget( Aspect, 4, 4, 1, 3 ); |
- ShadeP = new QSpinBox( ToolFrame5, "ShadeP" ); |
- ShadeP->setSuffix( tr( " %" ) ); |
- ShadeP->setMaxValue( 100 ); |
- ShadeP->setMinValue( 0 ); |
- if (ap->HaveDoc) |
- ShadeP->setValue( ap->doc->ShadePict ); |
- else |
- ShadeP->setValue( Vor->ShadePict ); |
- Layout15->addWidget( ShadeP, 6, 1 ); |
- BackgroundP = new QComboBox( true, ToolFrame5, "BackgroundP" ); |
- BackgroundP->setEditable(false); |
- BackgroundP->insertItem(tr("None")); |
- if (Vor->DbrushPict == "None") |
- BackgroundP->setCurrentItem(BackgroundP->count()-1); |
- for (itc = Vor->DColors.begin(); itc != Vor->DColors.end(); ++itc) |
- { |
- pm2.fill(Vor->DColors[itc.key()].getRGBColor()); |
- BackgroundP->insertItem(pm2, itc.key()); |
- if (itc.key() == Vor->DbrushPict) |
- { |
- BackgroundP->setCurrentItem(BackgroundP->count()-1); |
- } |
- } |
- Layout15->addMultiCellWidget( BackgroundP, 5, 5, 1, 3 ); |
- QSpacerItem* sp01 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- ToolFrame5Layout->addItem( sp01 ); |
- ToolFrame5Layout->addLayout( Layout15 ); |
- QSpacerItem* sp02 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- ToolFrame5Layout->addItem( sp02 ); |
- if (ap->HaveDoc) |
- Aspect->setChecked(ap->doc->AspectRatio); |
- else |
- Aspect->setChecked(Vor->AspectRatio); |
- bool sct; |
- if (ap->HaveDoc) |
- sct = ap->doc->ScaleType; |
- else |
- sct = Vor->ScaleType; |
- if (sct) |
- { |
- FreeScale->setChecked(true); |
- FrameScale->setChecked(false); |
- } |
- else |
- { |
- FreeScale->setChecked(false); |
- FrameScale->setChecked(true); |
- } |
- ChangeScaling(); |
- Fram->addWidget(ToolFrame5, 5); |
- |
- ToolFrame6 = new QFrame( this, "ToolFrame6" ); |
- ToolFrame6->setFrameShape( QFrame::Box ); |
- ToolFrame6->setFrameShadow( QFrame::Sunken ); |
- Pre = new QPixmap(101, 101); |
- Pre->fill(white); |
- PolygonPropsLayout = new QHBoxLayout( ToolFrame6, 10, 5, "PolygonPropsLayout"); |
- T6_Layout11 = new QHBoxLayout( 0, 0, 5, "Layout11"); |
- T6_Layout10 = new QVBoxLayout( 0, 0, 5, "Layout10"); |
- T6_Layout2 = new QHBoxLayout( 0, 0, 5, "Layout2"); |
- T6_Text1 = new QLabel( ToolFrame6, "Text1" ); |
- T6_Text1->setText( tr( "Corners:" ) ); |
- T6_Layout2->addWidget( T6_Text1 ); |
- T6_Ecken = new QSpinBox( ToolFrame6, "Ecken" ); |
- T6_Ecken->setMaxValue( 999 ); |
- T6_Ecken->setMinValue( 3 ); |
- T6_Ecken->setValue(Vor->PolyC); |
- T6_Layout2->addWidget( T6_Ecken ); |
- T6_Layout10->addLayout( T6_Layout2 ); |
- T6_Layout9_2 = new QHBoxLayout( 0, 0, 5, "Layout9_2"); |
- T6_Layout8_2 = new QVBoxLayout( 0, 0, 5, "Layout8_2"); |
- T6_Layout7_2 = new QHBoxLayout( 0, 0, 5, "Layout7_2"); |
- T6_Text2_2 = new QLabel( ToolFrame6, "Text2_2" ); |
- T6_Text2_2->setText( tr( "Rotation:" ) ); |
- T6_Layout7_2->addWidget( T6_Text2_2 ); |
- T6_Faktor2 = new QSpinBox( ToolFrame6, "Faktor_2" ); |
- T6_Faktor2->setSuffix(" °"); |
- T6_Faktor2->setMaxValue( 180 ); |
- T6_Faktor2->setMinValue( -180 ); |
- T6_Faktor2->setValue(static_cast<int>(Vor->PolyR)); |
- T6_Layout7_2->addWidget( T6_Faktor2 ); |
- T6_Layout8_2->addLayout( T6_Layout7_2 ); |
- T6_Slider2 = new QSlider( ToolFrame6, "Slider1_2" ); |
- T6_Slider2->setMinValue( -180 ); |
- T6_Slider2->setMaxValue( 180 ); |
- T6_Slider2->setValue(static_cast<int>(Vor->PolyR)); |
- T6_Slider2->setOrientation( QSlider::Horizontal ); |
- T6_Slider2->setTickmarks( QSlider::Right ); |
- T6_Layout8_2->addWidget( T6_Slider2 ); |
- T6_Layout9_2->addLayout( T6_Layout8_2 ); |
- T6_Layout10->addLayout( T6_Layout9_2 ); |
- T6_Konvex = new QCheckBox( ToolFrame6, "Konvex" ); |
- T6_Konvex->setText( tr( "Convex Polygon" ) ); |
- T6_Konvex->setChecked(Vor->PolyS); |
- T6_Layout10->addWidget( T6_Konvex ); |
- T6_Layout9 = new QHBoxLayout( 0, 0, 5, "Layout9"); |
- QSpacerItem* T6_spacer = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- T6_Layout9->addItem( T6_spacer ); |
- T6_Layout8 = new QVBoxLayout( 0, 0, 5, "Layout8"); |
- T6_Layout7 = new QHBoxLayout( 0, 0, 5, "Layout7"); |
- T6_Text2 = new QLabel( ToolFrame6, "Text2" ); |
- T6_Text2->setText( tr( "Factor:" ) ); |
- T6_Layout7->addWidget( T6_Text2 ); |
- T6_Faktor = new QSpinBox( ToolFrame6, "Faktor" ); |
- T6_Faktor->setSuffix( tr( " %" ) ); |
- T6_Faktor->setMaxValue( 100 ); |
- T6_Faktor->setMinValue( -100 ); |
- T6_Faktor->setValue(Vor->PolyFd); |
- T6_Layout7->addWidget( T6_Faktor ); |
- T6_Layout8->addLayout( T6_Layout7 ); |
- T6_Slider1 = new QSlider( ToolFrame6, "Slider1" ); |
- T6_Slider1->setMinValue( -100 ); |
- T6_Slider1->setMaxValue( 100 ); |
- T6_Slider1->setOrientation( QSlider::Horizontal ); |
- T6_Slider1->setTickmarks( QSlider::Right ); |
- T6_Slider1->setValue(Vor->PolyFd); |
- T6_Layout8->addWidget( T6_Slider1 ); |
- T6_Layout9->addLayout( T6_Layout8 ); |
- T6_Layout10->addLayout( T6_Layout9 ); |
- T6_Layout11->addLayout( T6_Layout10 ); |
- T6_Preview = new QLabel( ToolFrame6, "Preview" ); |
- T6_Preview->setMinimumSize( QSize( 106, 106 ) ); |
- T6_Preview->setMaximumSize( QSize( 106, 106 ) ); |
- T6_Preview->setFrameShape( QLabel::Panel ); |
- T6_Preview->setFrameShadow( QLabel::Sunken ); |
- T6_Preview->setLineWidth(2); |
- T6_Preview->setAlignment(AlignCenter); |
- T6_Preview->setPixmap(*Pre); |
- T6_Layout11->addWidget( T6_Preview ); |
- QSpacerItem* T6_spacer3 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- PolygonPropsLayout->addItem( T6_spacer3 ); |
- PolygonPropsLayout->addLayout( T6_Layout11 ); |
- QSpacerItem* T6_spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- PolygonPropsLayout->addItem( T6_spacer2 ); |
- UpdatePreView(); |
- Fram->addWidget(ToolFrame6, 6); |
- |
- TabWidget3->insertTab( tab_3, tr( "Tools" ) ); |
- |
- tab_5 = new QWidget( TabWidget3, "tab_5" ); |
- tabLayout_5 = new QGridLayout( tab_5 ); |
- tabLayout_5->setSpacing( 6 ); |
- tabLayout_5->setMargin( 11 ); |
- |
- Saving = new QGroupBox( tab_5, "Saving" ); |
- Saving->setTitle( tr( "Other Options" ) ); |
- Saving->setColumnLayout(0, Qt::Vertical ); |
- Saving->layout()->setSpacing( 0 ); |
- Saving->layout()->setMargin( 0 ); |
- SavingLayout = new QHBoxLayout( Saving->layout() ); |
- SavingLayout->setAlignment( Qt::AlignTop ); |
- SavingLayout->setSpacing( 6 ); |
- SavingLayout->setMargin( 25 ); |
- |
- SaveAtQuit = new QCheckBox( Saving, "SaveAtQuit" ); |
- SaveAtQuit->setText( tr( "Save Contents on Exit" ) ); |
- SaveAtQuit->setChecked(Vor->SaveAtQ); |
- SavingLayout->addWidget( SaveAtQuit ); |
- |
- tabLayout_5->addWidget( Saving, 1, 0 ); |
- |
- Preview = new QGroupBox( tab_5, "Preview" ); |
- Preview->setTitle( tr( "Preview" ) ); |
- Preview->setColumnLayout(0, Qt::Vertical ); |
- Preview->layout()->setSpacing( 0 ); |
- Preview->layout()->setMargin( 0 ); |
- PreviewLayout = new QHBoxLayout( Preview->layout() ); |
- PreviewLayout->setAlignment( Qt::AlignTop ); |
- PreviewLayout->setSpacing( 10 ); |
- PreviewLayout->setMargin( 24 ); |
- |
- TextLabelP = new QLabel( Preview, "TextLabel1_3" ); |
- TextLabelP->setText( tr( "Size:" ) ); |
- PreviewLayout->addWidget( TextLabelP ); |
- |
- PreviewSize = new QComboBox( true, Preview, "PreviewSize" ); |
- PreviewSize->insertItem( tr( "Small" ) ); |
- PreviewSize->insertItem( tr( "Medium" ) ); |
- PreviewSize->insertItem( tr( "Big" ) ); |
- PreviewSize->setEditable(false); |
- switch (Vor->PSize) |
- { |
- case 40: |
- PreviewSize->setCurrentItem(0); |
- break; |
- case 60: |
- PreviewSize->setCurrentItem(1); |
- break; |
- case 80: |
- PreviewSize->setCurrentItem(2); |
- break; |
- } |
- PreviewLayout->addWidget( PreviewSize ); |
- |
- tabLayout_5->addWidget( Preview, 0, 0 ); |
- |
- Frame6 = new QFrame( tab_5, "Frame6" ); |
- Frame6->setFrameShape( QFrame::NoFrame ); |
- Frame6->setFrameShadow( QFrame::Plain ); |
- Frame6->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); |
- |
- tabLayout_5->addMultiCellWidget( Frame6, 0, 1, 1, 1 ); |
- TabWidget3->insertTab( tab_5, tr( "Scrapbook" ) ); |
- |
- tab_6 = new QWidget( TabWidget3, "tab_6" ); |
- tabLayout_6 = new QHBoxLayout( tab_6 ); |
- tabLayout_6->setSpacing( 6 ); |
- tabLayout_6->setMargin( 11 ); |
- GroupBox10 = new QGroupBox( tab_6, "GroupBox10" ); |
- GroupBox10->setTitle( tr( "" ) ); |
- GroupBox10->setColumnLayout(0, Qt::Vertical ); |
- GroupBox10->layout()->setSpacing( 0 ); |
- GroupBox10->layout()->setMargin( 0 ); |
- GroupBox10Layout = new QVBoxLayout( GroupBox10->layout() ); |
- GroupBox10Layout->setAlignment( Qt::AlignTop ); |
- GroupBox10Layout->setSpacing( 6 ); |
- GroupBox10Layout->setMargin( 11 ); |
- FramesVisible = new QCheckBox( GroupBox10, "FramesVisible" ); |
- FramesVisible->setText( tr( "Display Frames" ) ); |
- if (ap->HaveDoc) |
- FramesVisible->setChecked(ap->doc->ShFrames); |
- else |
- FramesVisible->setChecked(Vor->ShFrames); |
- GroupBox10Layout->addWidget( FramesVisible ); |
- SidebySide = new QCheckBox( GroupBox10, "SidebySide" ); |
- SidebySide->setText( tr( "Display Pages Side by Side" ) ); |
- if (ap->HaveDoc) |
- SidebySide->setChecked(ap->doc->PagesSbS); |
- else |
- SidebySide->setChecked(Vor->PagesSbS); |
- GroupBox10Layout->addWidget( SidebySide ); |
- |
- Layout_6b = new QHBoxLayout(); |
- Layout_6b->setSpacing( 0 ); |
- Layout_6b->setMargin( 0 ); |
- GroupBox20a = new QGroupBox( GroupBox10, "GroupBox20" ); |
- GroupBox20a->setTitle( tr( "Page-Colors" ) ); |
- GroupBox20a->setColumnLayout(0, Qt::Vertical ); |
- GroupBox20a->layout()->setSpacing( 0 ); |
- GroupBox20a->layout()->setMargin( 0 ); |
- GroupBox20aLayout = new QHBoxLayout( GroupBox20a->layout() ); |
- GroupBox20aLayout->setAlignment( Qt::AlignTop ); |
- GroupBox20aLayout->setSpacing( 10 ); |
- GroupBox20aLayout->setMargin( 25 ); |
- TextLabel4a = new QLabel( GroupBox20a, "TextLabel4" ); |
- TextLabel4a->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel4a->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel4a->setText( tr( "Background:" ) ); |
- GroupBox20aLayout->addWidget( TextLabel4a); |
- PapColor = new QPushButton( GroupBox20a, "PapColor" ); |
- PapColor->setText( tr( "" ) ); |
- PapColor->setAutoDefault( false ); |
- QPixmap pm1a = QPixmap(40, 20); |
- if (ap->HaveDoc) |
- { |
- pm1a.fill(ap->doc->papColor); |
- Cpaper = ap->doc->papColor; |
- } |
- else |
- { |
- pm1a.fill(Vor->DpapColor); |
- Cpaper = Vor->DpapColor; |
- } |
- PapColor->setPixmap(pm1a); |
- GroupBox20aLayout->addWidget( PapColor ); |
- TextLabel4b = new QLabel( GroupBox20a, "TextLabel4" ); |
- TextLabel4b->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel4b->sizePolicy().hasHeightForWidth() ) ); |
- TextLabel4b->setText( tr( "Margins:" ) ); |
- GroupBox20aLayout->addWidget( TextLabel4b); |
- RandColor = new QPushButton( GroupBox20a, "RColor" ); |
- RandColor->setText( tr( "" ) ); |
- RandColor->setAutoDefault( false ); |
- if (ap->HaveDoc) |
- { |
- pm1a.fill( ap->doc->margColor ); |
- Crand = ap->doc->margColor; |
- } |
- else |
- { |
- pm1a.fill( Vor->DmargColor ); |
- Crand = Vor->DmargColor; |
- } |
- RandColor->setPixmap(pm1a); |
- GroupBox20aLayout->addWidget( RandColor ); |
- Layout_6b->addWidget(GroupBox20a); |
- QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- Layout_6b->addItem( spacer2 ); |
- GroupBox10Layout->addLayout(Layout_6b); |
- RandFarb = new QCheckBox( GroupBox10, "Ran" ); |
- RandFarb->setText( tr( "Display unprintable Area in Margin Color" ) ); |
- if (ap->HaveDoc) |
- RandFarb->setChecked(ap->doc->RandFarbig); |
- else |
- RandFarb->setChecked(Vor->RandFarbig); |
- GroupBox10Layout->addWidget( RandFarb ); |
- UsePDFTrans = new QCheckBox( GroupBox10, "Ran2" ); |
- UsePDFTrans->setText( tr( "Use PDF-1.4 Transparency Features" ) ); |
- UsePDFTrans->setChecked(Vor->PDFTransparency); |
- GroupBox10Layout->addWidget( UsePDFTrans ); |
- tabLayout_6->addWidget( GroupBox10 ); |
- TabWidget3->insertTab( tab_6, tr( "Display" ) ); |
- Fram->raiseWidget(1); |
- |
- PrefsLayout->addWidget( TabWidget3 ); |
- Layout3 = new QHBoxLayout; |
- Layout3->setSpacing( 6 ); |
- Layout3->setMargin( 0 ); |
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- Layout3->addItem( spacer ); |
- buttonOK = new QPushButton( this, "buttonOK" ); |
- buttonOK->setText( tr( "OK" ) ); |
- buttonOK->setDefault( true ); |
- Layout3->addWidget( buttonOK ); |
- QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- Layout3->addItem( spacer_2 ); |
- buttonCancel = new QPushButton( this, "buttonCancel" ); |
- buttonCancel->setText( tr( "Cancel" ) ); |
- buttonCancel->setDefault( false ); |
- Layout3->addWidget( buttonCancel ); |
- QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- Layout3->addItem( spacer_3 ); |
- PrefsLayout->addLayout( Layout3 ); |
- UnitChange(); |
- |
- // signals and slots connections |
- connect( minColor, SIGNAL( clicked() ), this, SLOT( changeMicolor() ) ); |
- connect( MaxColor, SIGNAL( clicked() ), this, SLOT( changeMaColor() ) ); |
- connect( PapColor, SIGNAL( clicked() ), this, SLOT( changePapColor() ) ); |
- connect( RandColor, SIGNAL( clicked() ), this, SLOT( changeRandColor() ) ); |
- connect( GuideColor, SIGNAL( clicked() ), this, SLOT( changeGuideColor() ) ); |
- connect( buttonOK, SIGNAL( clicked() ), this, SLOT( accept() ) ); |
- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); |
- connect(FontCombo, SIGNAL(activated(int)), this, SLOT(SetSample())); |
- connect(SizeCombo, SIGNAL(activated(int)), this, SLOT(SetSample())); |
- connect(TextButton, SIGNAL(clicked()), this, SLOT(SetTool())); |
- connect(RectButton, SIGNAL(clicked()), this, SLOT(SetTool())); |
- connect(OvalButton, SIGNAL(clicked()), this, SLOT(SetTool())); |
- connect(LineButton, SIGNAL(clicked()), this, SLOT(SetTool())); |
- connect(ZoomButton, SIGNAL(clicked()), this, SLOT(SetTool())); |
- connect(BildButton, SIGNAL(clicked()), this, SLOT(SetTool())); |
- connect(PolyButton, SIGNAL(clicked()), this, SLOT(SetTool())); |
- connect(Kette, SIGNAL(clicked()), this, SLOT(ToggleKette())); |
- connect(XScale, SIGNAL(valueChanged(int)), this, SLOT(HChange())); |
- connect(YScale, SIGNAL(valueChanged(int)), this, SLOT(VChange())); |
- connect(UnitCombo, SIGNAL(activated(int)), this, SLOT(UnitChange())); |
- connect(Shorty, SIGNAL(clicked()), this, SLOT(DefKB())); |
- connect(T6_Faktor, SIGNAL(valueChanged(int)), this, SLOT(ValFromSpin(int))); |
- connect(T6_Slider1, SIGNAL(valueChanged(int)), T6_Faktor, SLOT(setValue(int))); |
- connect(T6_Slider1, SIGNAL(valueChanged(int)), this, SLOT(UpdatePreView())); |
- connect(T6_Faktor2, SIGNAL(valueChanged(int)), this, SLOT(ValFromSpin2(int))); |
- connect(T6_Slider2, SIGNAL(valueChanged(int)), T6_Faktor2, SLOT(setValue(int))); |
- connect(T6_Slider2, SIGNAL(valueChanged(int)), this, SLOT(UpdatePreView())); |
- connect(T6_Ecken, SIGNAL(valueChanged(int)), this, SLOT(UpdatePreView())); |
- connect(T6_Konvex, SIGNAL(clicked()), this, SLOT(UpdatePreView())); |
- connect(Breite, SIGNAL(valueChanged(int)), this, SLOT(setBreite(int))); |
- connect(Hoehe, SIGNAL(valueChanged(int)), this, SLOT(setHoehe(int))); |
- connect(GZComboO, SIGNAL(activated(int)), this, SLOT(setOrien(int))); |
- connect(GZComboF, SIGNAL(activated(int)), this, SLOT(setSize(int))); |
- connect(Doppelseiten, SIGNAL(clicked()), this, SLOT(setDS())); |
- connect(FreeScale, SIGNAL(clicked()), this, SLOT(ChangeScaling())); |
- connect(FrameScale, SIGNAL(clicked()), this, SLOT(ChangeScaling())); |
- connect(FileC, SIGNAL(clicked()), this, SLOT(ChangeDocs())); |
- setSize(Vor->PageFormat); |
-} |
- |
-/* |
- * Destroys the object and frees any allocated resources |
- */ |
-Preferences::~Preferences() |
-{ |
- // no need to delete child widgets, Qt does it all for us |
-} |
- |
-void Preferences::ChangeDocs() |
-{ |
- QString s = QFileDialog::getExistingDirectory(Docs->text(), this, "d", tr("Choose a Directory"), true); |
- if (s != "") |
- Docs->setText(s); |
-} |
- |
-void Preferences::ChangeScaling() |
-{ |
- if (FreeScale->isChecked()) |
- { |
- TextLabelT51->setEnabled(true); |
- TextLabelT52->setEnabled(true); |
- XScale->setEnabled(true); |
- YScale->setEnabled(true); |
- Kette->setEnabled(true); |
- Aspect->setEnabled(false); |
- } |
- else |
- { |
- TextLabelT51->setEnabled(false); |
- TextLabelT52->setEnabled(false); |
- XScale->setEnabled(false); |
- YScale->setEnabled(false); |
- Kette->setEnabled(false); |
- Aspect->setEnabled(true); |
- } |
-} |
- |
-void Preferences::setDS() |
-{ |
- if (Doppelseiten->isChecked()) |
- { |
- GRText3->setText( tr( "Inside:" ) ); |
- GRText4->setText( tr( "Outside:" ) ); |
- Linkszuerst->setEnabled(true); |
- } |
- else |
- { |
- GRText3->setText( tr( "Left:" ) ); |
- GRText4->setText( tr( "Right:" ) ); |
- Linkszuerst->setEnabled(false); |
- Linkszuerst->setChecked(false); |
- } |
-} |
- |
-void Preferences::setBreite(int v) |
-{ |
- Pagebr = v / Umrech / 100.0; |
-} |
- |
-void Preferences::setHoehe(int v) |
-{ |
- Pageho = v / Umrech / 100.0; |
-} |
- |
-void Preferences::setSize(int gr) |
-{ |
- Pagebr = Breite->value() / 100.0; |
- Pageho = Hoehe->value() / 100.0; |
- Breite->setEnabled(false); |
- Hoehe->setEnabled(false); |
- switch (gr) |
- { |
- case 0: // A0 |
- Pagebr = 2380; |
- Pageho = 3368; |
- break; |
- case 1: // A1 |
- Pagebr = 1684; |
- Pageho = 2380; |
- break; |
- case 2: // A2 |
- Pagebr = 1190; |
- Pageho = 1684; |
- break; |
- case 3: // A3 |
- Pagebr = 842; |
- Pageho = 1190; |
- break; |
- case 4: // A4 |
- Pagebr = 595; |
- Pageho = 842; |
- break; |
- case 5: // A5 |
- Pagebr = 421; |
- Pageho = 595; |
- break; |
- case 6: // A6 |
- Pagebr = 297; |
- Pageho = 421; |
- break; |
- case 7: // A7 |
- Pagebr = 210; |
- Pageho = 297; |
- break; |
- case 8: // A8 |
- Pagebr = 148; |
- Pageho = 210; |
- break; |
- case 9: // A9 |
- Pagebr = 105; |
- Pageho = 148; |
- break; |
- case 10: // B0 |
- Pagebr = 2836; |
- Pageho = 4008; |
- break; |
- case 11: // B1 |
- Pagebr = 2004; |
- Pageho = 2836; |
- break; |
- case 12: // B2 |
- Pagebr = 1418; |
- Pageho = 2004; |
- break; |
- case 13: // B3 |
- Pagebr = 1002; |
- Pageho = 1418; |
- break; |
- case 14: // B4 |
- Pagebr = 709; |
- Pageho = 1002; |
- break; |
- case 15: // B5 |
- Pagebr = 501; |
- Pageho = 709; |
- break; |
- case 16: // B6 |
- Pagebr = 355; |
- Pageho = 501; |
- break; |
- case 17: // B7 |
- Pagebr = 250; |
- Pageho = 355; |
- break; |
- case 18: // B8 |
- Pagebr = 178; |
- Pageho = 250; |
- break; |
- case 19: // B9 |
- Pagebr = 125; |
- Pageho = 178; |
- break; |
- case 20: // B10 |
- Pagebr = 89; |
- Pageho = 125; |
- break; |
- case 21: // C5E |
- Pagebr = 462; |
- Pageho = 649; |
- break; |
- case 22: // Comm10E |
- Pagebr = 298; |
- Pageho = 683; |
- break; |
- case 23: // DLE |
- Pagebr = 312; |
- Pageho = 624; |
- break; |
- case 24: // Executive |
- Pagebr = 542; |
- Pageho = 720; |
- break; |
- case 25: // Folio |
- Pagebr = 595; |
- Pageho = 935; |
- break; |
- case 26: // Ledger |
- Pagebr = 1224; |
- Pageho = 792; |
- break; |
- case 27: // Legal |
- Pagebr = 612; |
- Pageho = 1008; |
- break; |
- case 28: // Letter |
- Pagebr = 612; |
- Pageho = 792; |
- break; |
- case 29: // Tabloid |
- Pagebr = 792; |
- Pageho = 1224; |
- break; |
- case 30: // Custom |
- Breite->setEnabled(true); |
- Hoehe->setEnabled(true); |
- break; |
- } |
- disconnect(Breite, SIGNAL(valueChanged(int)), this, SLOT(setBreite(int))); |
- disconnect(Hoehe, SIGNAL(valueChanged(int)), this, SLOT(setHoehe(int))); |
- Breite->setValue(qRound(Pagebr * Umrech * 100)); |
- Hoehe->setValue(qRound(Pageho * Umrech * 100)); |
- connect(Breite, SIGNAL(valueChanged(int)), this, SLOT(setBreite(int))); |
- connect(Hoehe, SIGNAL(valueChanged(int)), this, SLOT(setHoehe(int))); |
-} |
- |
-void Preferences::setOrien(int ori) |
-{ |
- int br; |
- setSize(GZComboF->currentItem()); |
- if (ori == 0) |
- { |
- if (GZComboF->currentItem() == 30) |
- { |
- br = Breite->value(); |
- Breite->setValue(Hoehe->value()); |
- Hoehe->setValue(br); |
- } |
- } |
- else |
- { |
- br = Breite->value(); |
- Breite->setValue(Hoehe->value()); |
- Hoehe->setValue(br); |
- } |
-} |
- |
-void Preferences::DefKB() |
-{ |
- KeyManager *dia = new KeyManager(this, KKC); |
- if (dia->exec()) |
- KKC = dia->KK; |
- delete dia; |
-} |
- |
-void Preferences::SetSample() |
-{ |
- QFont fo; |
- fo = (*fon)[FontCombo->currentText()]->Font; |
- fo.setPointSize(SizeCombo->currentText().left(2).toInt()); |
- TextLabel1_4->setFont(fo); |
-} |
- |
-void Preferences::changeMaColor() |
-{ |
- QColor neu = QColor(); |
- neu = QColorDialog::getColor(Cmax, this); |
- if (neu.isValid()) |
- { |
- QPixmap pm = QPixmap(40, 20); |
- pm.fill(neu); |
- Cmax = neu; |
- MaxColor->setPixmap(pm); |
- } |
-} |
- |
-void Preferences::changeMicolor() |
-{ |
- QColor neu = QColor(); |
- neu = QColorDialog::getColor(Cmin, this); |
- if (neu.isValid()) |
- { |
- QPixmap pm = QPixmap(40, 20); |
- pm.fill(neu); |
- Cmin = neu; |
- minColor->setPixmap(pm); |
- } |
-} |
- |
-void Preferences::changePapColor() |
-{ |
- QColor neu = QColor(); |
- neu = QColorDialog::getColor(Cpaper, this); |
- if (neu.isValid()) |
- { |
- QPixmap pm = QPixmap(40, 20); |
- pm.fill(neu); |
- Cpaper = neu; |
- PapColor->setPixmap(pm); |
- } |
-} |
- |
-void Preferences::changeRandColor() |
-{ |
- QColor neu = QColor(); |
- neu = QColorDialog::getColor(Crand, this); |
- if (neu.isValid()) |
- { |
- QPixmap pm = QPixmap(40, 20); |
- pm.fill(neu); |
- Crand = neu; |
- RandColor->setPixmap(pm); |
- } |
-} |
- |
-void Preferences::changeGuideColor() |
-{ |
- QColor neu = QColor(); |
- neu = QColorDialog::getColor(Cgui, this); |
- if (neu.isValid()) |
- { |
- QPixmap pm = QPixmap(40, 20); |
- pm.fill(neu); |
- Cgui = neu; |
- GuideColor->setPixmap(pm); |
- } |
-} |
- |
-void Preferences::SetTool() |
-{ |
- if (TextButton == sender()) |
- Fram->raiseWidget(1); |
- if (RectButton == sender()) |
- Fram->raiseWidget(2); |
- if (OvalButton == sender()) |
- Fram->raiseWidget(2); |
- if (LineButton == sender()) |
- Fram->raiseWidget(3); |
- if (ZoomButton == sender()) |
- Fram->raiseWidget(4); |
- if (BildButton == sender()) |
- Fram->raiseWidget(5); |
- if (PolyButton == sender()) |
- Fram->raiseWidget(6); |
-} |
- |
-void Preferences::ToggleKette() |
-{ |
- if (Kette->isOn()) |
- YScale->setValue(XScale->value()); |
-} |
- |
-void Preferences::HChange() |
-{ |
- if (Kette->isOn()) |
- YScale->setValue(XScale->value()); |
-} |
- |
-void Preferences::VChange() |
-{ |
- if (Kette->isOn()) |
- XScale->setValue(YScale->value()); |
-} |
- |
-void Preferences::UnitChange() |
-{ |
- float AltUmrech = Umrech; |
- switch (UnitCombo->currentItem()) |
- { |
- case 0: |
- Umrech = 1.0; |
- SpinBox1->setSuffix( tr( " pt" ) ); |
- SpinBox2->setSuffix( tr( " pt" ) ); |
- SpinBox2g->setSuffix( tr( " pt" ) ); |
- Breite->setSuffix( tr( " pt" ) ); |
- Hoehe->setSuffix( tr( " pt" ) ); |
- TopR->setSuffix( tr( " pt" ) ); |
- BottomR->setSuffix( tr( " pt" ) ); |
- LeftR->setSuffix( tr( " pt" ) ); |
- RightR->setSuffix( tr( " pt" ) ); |
- break; |
- case 1: |
- Umrech = 0.3527777; |
- SpinBox1->setSuffix( tr( " mm" ) ); |
- SpinBox2->setSuffix( tr( " mm" ) ); |
- SpinBox2g->setSuffix( tr( " mm" ) ); |
- Breite->setSuffix( tr( " mm" ) ); |
- Hoehe->setSuffix( tr( " mm" ) ); |
- TopR->setSuffix( tr( " mm" ) ); |
- BottomR->setSuffix( tr( " mm" ) ); |
- LeftR->setSuffix( tr( " mm" ) ); |
- RightR->setSuffix( tr( " mm" ) ); |
- break; |
- case 2: |
- Umrech = 1.0 / 72.0; |
- SpinBox1->setSuffix( tr( " in" ) ); |
- SpinBox2->setSuffix( tr( " in" ) ); |
- SpinBox2g->setSuffix( tr( " in" ) ); |
- Breite->setSuffix( tr( " in" ) ); |
- Hoehe->setSuffix( tr( " in" ) ); |
- TopR->setSuffix( tr( " in" ) ); |
- BottomR->setSuffix( tr( " in" ) ); |
- LeftR->setSuffix( tr( " in" ) ); |
- RightR->setSuffix( tr( " in" ) ); |
- break; |
- case 3: |
- Umrech = 1.0 / 12.0; |
- SpinBox1->setSuffix( tr( " p" ) ); |
- SpinBox2->setSuffix( tr( " p" ) ); |
- SpinBox2g->setSuffix( tr( " p" ) ); |
- Breite->setSuffix( tr( " p" ) ); |
- Hoehe->setSuffix( tr( " p" ) ); |
- TopR->setSuffix( tr( " p" ) ); |
- BottomR->setSuffix( tr( " p" ) ); |
- LeftR->setSuffix( tr( " p" ) ); |
- RightR->setSuffix( tr( " p" ) ); |
- break; |
- } |
- disconnect(Breite, SIGNAL(valueChanged(int)), this, SLOT(setBreite(int))); |
- disconnect(Hoehe, SIGNAL(valueChanged(int)), this, SLOT(setHoehe(int))); |
- SpinBox1->setValue(qRound(SpinBox1->value() / AltUmrech * Umrech)); |
- SpinBox2->setValue(qRound(SpinBox2->value() / AltUmrech * Umrech)); |
- SpinBox2g->setValue(qRound(SpinBox2g->value() / AltUmrech * Umrech)); |
- if (GZComboF->currentItem() == 30) |
- { |
- Breite->setValue(qRound(Breite->value() / AltUmrech * Umrech)); |
- Hoehe->setValue(qRound(Hoehe->value() / AltUmrech * Umrech)); |
- } |
- else |
- setSize(GZComboF->currentItem()); |
- TopR->setValue(qRound(TopR->value() / AltUmrech * Umrech)); |
- BottomR->setValue(qRound(BottomR->value() / AltUmrech * Umrech)); |
- LeftR->setValue(qRound(LeftR->value() / AltUmrech * Umrech)); |
- RightR->setValue(qRound(RightR->value() / AltUmrech * Umrech)); |
- connect(Breite, SIGNAL(valueChanged(int)), this, SLOT(setBreite(int))); |
- connect(Hoehe, SIGNAL(valueChanged(int)), this, SLOT(setHoehe(int))); |
-} |
- |
-void Preferences::ValFromSpin2(int a) |
-{ |
- disconnect(T6_Slider2, SIGNAL(valueChanged(int)), T6_Faktor2, SLOT(setValue(int))); |
- T6_Slider2->setValue(a); |
- connect(T6_Slider2, SIGNAL(valueChanged(int)), T6_Faktor2, SLOT(setValue(int))); |
-} |
- |
-void Preferences::ValFromSpin(int a) |
-{ |
- disconnect(T6_Slider1, SIGNAL(valueChanged(int)), T6_Faktor, SLOT(setValue(int))); |
- T6_Slider1->setValue(a); |
- connect(T6_Slider1, SIGNAL(valueChanged(int)), T6_Faktor, SLOT(setValue(int))); |
-} |
- |
-void Preferences::UpdatePreView() |
-{ |
- Pre->fill(white); |
- QPainter p; |
- p.begin(Pre); |
- p.setBrush(NoBrush); |
- p.setPen(black); |
- QPointArray pp = RegularPolygon(100, 100, T6_Ecken->value(), T6_Konvex->isChecked(), GetFaktor(), T6_Slider2->value()); |
- QRect br = pp.boundingRect(); |
- if (br.x() < 0) |
- pp.translate(-br.x(), 0); |
- if (br.y() < 0) |
- pp.translate(0, -br.y()); |
- br = pp.boundingRect(); |
- if ((br.height() > 100) || (br.width() > 100)) |
- { |
- QWMatrix ma; |
- float sca = 100.0 / float(QMAX(br.width(), br.height())); |
- ma.scale(sca, sca); |
- pp = ma * pp; |
- } |
- p.drawPolygon(pp); |
- p.end(); |
- T6_Preview->setPixmap(*Pre); |
-} |
- |
-float Preferences::GetZeroFaktor() |
-{ |
- return sqrt(pow(1,2)-pow(((sin((360.0/(T6_Ecken->value()*2))/180*M_PI)* 2.0)/2.0),2)); |
-} |
- |
-float Preferences::GetMaxFaktor() |
-{ |
- float win = (360.0/(T6_Ecken->value()*2)) / 180.0 * M_PI; |
- float ret; |
- if ((360.0/(T6_Ecken->value()*2)) > 45) |
- ret = 1/sin(win); |
- else |
- ret = 1/cos(win); |
- return ret; |
-} |
- |
-float Preferences::GetFaktor() |
-{ |
- int val = T6_Slider1->value(); |
- if (val < 0) |
- { |
- PFactor = GetZeroFaktor() * (100.0 + val) / 100.0; |
- } |
- else |
- { |
- float ma = GetMaxFaktor(); |
- float mi = GetZeroFaktor(); |
- PFactor = ((ma - mi) * val / 100.0) + mi; |
- } |
- return PFactor; |
-} |
- |
/Scribus/Scribus/scribus/libprefs/prefs.cpp |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/libprefs/prefs.h |
=================================================================== |
--- Scribus/Scribus/scribus/libprefs/prefs.h (revision 6) |
+++ Scribus/Scribus/scribus/libprefs/prefs.h (nonexistent) |
@@ -1,321 +0,0 @@ |
-#ifndef PREFS_H |
-#define PREFS_H |
- |
-#include <qdialog.h> |
-#include <qbuttongroup.h> |
-#include <qcombobox.h> |
-#include <qgroupbox.h> |
-#include <qlabel.h> |
-#include <qpushbutton.h> |
-#include <qradiobutton.h> |
-#include <qspinbox.h> |
-#include <qtabwidget.h> |
-#include <qwidget.h> |
-#include <qlayout.h> |
-#include <qtoolbutton.h> |
-#include <qframe.h> |
-#include <qcheckbox.h> |
-#include <qwidgetstack.h> |
-#include <qpixmap.h> |
-#include <qslider.h> |
-#include <qlineedit.h> |
-#include <qfiledialog.h> |
-#include "linecombo.h" |
-#include "linkbutton.h" |
-#include "scribusdoc.h" |
-#include "scfonts.h" |
-#include "mspinbox.h" |
-#include "scribus.h" |
- |
-class Preferences : public QDialog |
-{ |
- Q_OBJECT |
- |
-public: |
- Preferences( QWidget* parent, preV *Vor); |
- ~Preferences(); |
- float GetZeroFaktor(); |
- float GetMaxFaktor(); |
- |
- QPushButton* buttonOK; |
- QPushButton* buttonCancel; |
- QTabWidget* TabWidget3; |
- QWidget* tab; |
- QGroupBox* Mouse; |
- QLabel* TextLabel1_2; |
- QLabel* TextLabel1_2_2; |
- QSpinBox* SpinBox3; |
- QSpinBox* SpinBox3_2; |
- QSpinBox* Recen; |
- QButtonGroup* ButtonGroup1; |
- QLabel* TextGstil; |
- QLabel* TextGstil2; |
- QSpinBox* GFsize; |
- QComboBox* GUICombo; |
- QComboBox* UnitCombo; |
- QGroupBox* GroupBox20; |
- QGroupBox* GroupBox20a; |
- QGroupBox* GroupBox20b; |
- QGroupBox* GroupBox200; |
- QLabel* PfadText; |
- QLineEdit* Docs; |
- QToolButton* FileC; |
- QButtonGroup* ButtonGroup2; |
- QButtonGroup* ButtonGroup5; |
- QRadioButton* RadioButton6; |
- QRadioButton* RadioButton7; |
- QWidget* tab_2; |
- QGroupBox* GroupBox1; |
- QLabel* TextLabel1; |
- QLabel* TextLabel2; |
- QLabel* TextLabel2g; |
- MSpinBox* SpinBox1; |
- MSpinBox* SpinBox2; |
- MSpinBox* SpinBox2g; |
- QGroupBox* GroupBox2; |
- QLabel* TextLabel3; |
- QLabel* TextLabel4; |
- QLabel* TextLabel4a; |
- QLabel* TextLabel4b; |
- QLabel* TextLabel4c; |
- QLabel* TextLabel4g; |
- QPushButton* minColor; |
- QPushButton* MaxColor; |
- QPushButton* GuideColor; |
- QPushButton* PapColor; |
- QPushButton* RandColor; |
- QPushButton* Shorty; |
- QWidget* tab_3; |
- QWidgetStack* Fram; |
- QLabel* TextLabel2_2; |
- QLabel* TextLabel1_3; |
- QComboBox* FontCombo; |
- QComboBox* SizeCombo; |
- QComboBox* ForegroundT; |
- QLabel* TextLabelT1; |
- QLabel* TextLabel1_4; |
- QWidget* tab_4; |
- QGroupBox* GroupBox4_2; |
- QLabel* TextLabel2_3_2; |
- QLabel* TextLabel1_5_2; |
- QSpinBox* VTiefW; |
- QSpinBox* VTiefWSc; |
- QGroupBox* GroupBox4; |
- QLabel* TextLabel2_3; |
- QLabel* TextLabel1_5; |
- QSpinBox* VHochW; |
- QSpinBox* VHochWSc; |
- QGroupBox* GroupBox4_3; |
- QLabel* TextLabel2_3_3; |
- QSpinBox* SmallCaps; |
- QGroupBox* GroupBox4_3a; |
- QLabel* TextLabel2_3_3a; |
- QSpinBox* AutoLineV; |
- QToolButton* TextButton; |
- QToolButton* BildButton; |
- QToolButton* RectButton; |
- QToolButton* OvalButton; |
- QToolButton* LineButton; |
- QToolButton* ZoomButton; |
- QToolButton* PolyButton; |
- QFrame* ToolFrame; |
- QFrame* ToolFrame2; |
- QLabel* TextLabelT21; |
- QLabel* TextLabelT22; |
- QLabel* TextLabelT23; |
- QLabel* TextLabelT24; |
- QLabel* TextLabelT25; |
- QLabel* TextLabelT26; |
- QComboBox* Foreground; |
- QSpinBox* Shade2; |
- QComboBox* Background; |
- QSpinBox* Shade; |
- LineCombo* Linestyle; |
- MSpinBox* LineW; |
- QFrame* ToolFrame3; |
- QLabel* TextLabelT31; |
- QLabel* TextLabelT32; |
- QLabel* TextLabelT35; |
- QLabel* TextLabelT36; |
- QComboBox* Foreground2; |
- QSpinBox* Shade22; |
- LineCombo* Linestyle2; |
- MSpinBox* LineW2; |
- QFrame* ToolFrame4; |
- QLabel* TextLabelT42; |
- QLabel* TextLabelT43; |
- QLabel* TextLabelT44; |
- QSpinBox* MinMag; |
- QSpinBox* MaxMag; |
- QSpinBox* StepMag; |
- QButtonGroup* ToolFrame5; |
- QLabel* TextLabelT51; |
- QLabel* TextLabelT52; |
- QLabel* TextLabelT53; |
- QLabel* TextLabelT54; |
- QRadioButton* FreeScale; |
- QRadioButton* FrameScale; |
- QCheckBox* Aspect; |
- QSpinBox* XScale; |
- QSpinBox* YScale; |
- LinkButton* Kette; |
- QComboBox* BackgroundP; |
- QSpinBox* ShadeP; |
- QLabel* TextLabelP; |
- QWidget* tab_5; |
- QGroupBox* Saving; |
- QCheckBox* SaveAtQuit; |
- QGroupBox* Preview; |
- QComboBox* PreviewSize; |
- QFrame* Frame6; |
- QWidget* tab_6; |
- QGroupBox* GroupBox10; |
- QCheckBox* FramesVisible; |
- QCheckBox* SidebySide; |
- QCheckBox* RandFarb; |
- QFrame* ToolFrame6; |
- QLabel* T6_Text1; |
- QSpinBox* T6_Ecken; |
- QCheckBox* T6_Konvex; |
- QLabel* T6_Text2; |
- QSpinBox* T6_Faktor; |
- QSlider* T6_Slider1; |
- QLabel* T6_Preview; |
- QLabel* T6_Text2_2; |
- QSpinBox* T6_Faktor2; |
- QSlider* T6_Slider2; |
- QWidget* tab_7; |
- QButtonGroup* GroupSize; |
- QLabel* GZText2; |
- QComboBox* GZComboF; |
- QComboBox* GZComboO; |
- QLabel* GZText1; |
- QLabel* GZText3; |
- QLabel* GZText4; |
- MSpinBox* Breite; |
- MSpinBox* Hoehe; |
- QCheckBox* Doppelseiten; |
- QCheckBox* Linkszuerst; |
- QGroupBox* GroupRand; |
- QLabel* GRText3; |
- MSpinBox* TopR; |
- MSpinBox* BottomR; |
- MSpinBox* RightR; |
- MSpinBox* LeftR; |
- QLabel* GRText2; |
- QLabel* GRText1; |
- QLabel* GRText4; |
- QCheckBox *UsePDFTrans; |
- QGroupBox* GroupAS; |
- QCheckBox* ASon; |
- QLabel* ASText; |
- QSpinBox* ASTime; |
- |
- SCFonts *fon; // can't use a reference, and can't copy whole structure... |
- float Umrech; |
- QPixmap* Pre; |
- float PFactor; |
- QMap<int,Keys> KKC; |
- QColor Cmin; |
- QColor Cmax; |
- QColor Crand; |
- QColor Cpaper; |
- QColor Cgui; |
- float Pagebr; |
- float Pageho; |
- int Einheit; |
- ScribusApp *ap; |
- |
-public slots: |
- virtual void changeMaColor(); |
- virtual void changeMicolor(); |
- void ChangeDocs(); |
- void ChangeScaling(); |
- void setDS(); |
- void setBreite(int v); |
- void setHoehe(int v); |
- void setSize(int gr); |
- void setOrien(int ori); |
- void changePapColor(); |
- void changeRandColor(); |
- void changeGuideColor(); |
- void DefKB(); |
- void SetSample(); |
- void SetTool(); |
- void ToggleKette(); |
- void HChange(); |
- void VChange(); |
- void UnitChange(); |
- void UpdatePreView(); |
- float GetFaktor(); |
- void ValFromSpin(int a); |
- void ValFromSpin2(int a); |
- |
-protected: |
- QVBoxLayout* PrefsLayout; |
- QGridLayout* tabLayout; |
- QGridLayout* ButtonGroup1Layout; |
- QHBoxLayout* GroupBox20Layout; |
- QHBoxLayout* GroupBox20aLayout; |
- QGridLayout* GroupBox20bLayout; |
- QHBoxLayout* GroupBox200Layout; |
- QHBoxLayout* MouseLayout; |
- QGridLayout* Layout5; |
- QGridLayout* tabLayout_2; |
- QHBoxLayout* ButtonGroup5Layout; |
- QVBoxLayout* Layout7; |
- QHBoxLayout* GroupBox1Layout; |
- QGridLayout* Layout10; |
- QHBoxLayout* GroupBox2Layout; |
- QGridLayout* Layout11; |
- QGridLayout* tabLayout_3; |
- QHBoxLayout* GroupBox4_2Layout; |
- QGridLayout* Layout12; |
- QHBoxLayout* GroupBox4Layout; |
- QGridLayout* Layout13; |
- QHBoxLayout* GroupBox4_3Layout; |
- QHBoxLayout* Layout14; |
- QHBoxLayout* GroupBox4_3aLayout; |
- QHBoxLayout* Layout14a; |
- QHBoxLayout* tabLayout_4; |
- QHBoxLayout* ButtonGroup2Layout; |
- QGridLayout* Layout16; |
- QHBoxLayout* ToolFrameLayout; |
- QHBoxLayout* ToolFrame2Layout; |
- QHBoxLayout* ToolFrame3Layout; |
- QHBoxLayout* ToolFrame4Layout; |
- QHBoxLayout* ToolFrame5Layout; |
- QGridLayout* Layout15; |
- QGridLayout* Layout15a; |
- QGridLayout* Layout15b; |
- QGridLayout* Layout15c; |
- QGridLayout* Layout15d; |
- QGridLayout* tabLayout_5; |
- QHBoxLayout* SavingLayout; |
- QHBoxLayout* PreviewLayout; |
- QHBoxLayout* tabLayout_6; |
- QHBoxLayout* Layout_6b; |
- QVBoxLayout* GroupBox10Layout; |
- QHBoxLayout* Layout3; |
- QHBoxLayout* PolygonPropsLayout; |
- QHBoxLayout* T6_Layout11; |
- QVBoxLayout* T6_Layout10; |
- QHBoxLayout* T6_Layout2; |
- QHBoxLayout* T6_Layout9; |
- QVBoxLayout* T6_Layout8; |
- QHBoxLayout* T6_Layout7; |
- QHBoxLayout* T6_Layout9_2; |
- QVBoxLayout* T6_Layout8_2; |
- QHBoxLayout* T6_Layout7_2; |
- QHBoxLayout* tabLayout_7; |
- QVBoxLayout* Layout21; |
- QVBoxLayout* Layout21b; |
- QVBoxLayout* GroupSizeLayout; |
- QGridLayout* Layout6; |
- QHBoxLayout* Layout5_2; |
- QHBoxLayout* Layout8; |
- QGridLayout* GroupRandLayout; |
- QGridLayout* GroupASLayout; |
-}; |
- |
-#endif // PREFS_H |
/Scribus/Scribus/scribus/libprefs/prefs.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/libprefs/Makefile.am |
=================================================================== |
--- Scribus/Scribus/scribus/libprefs/Makefile.am (revision 6) |
+++ Scribus/Scribus/scribus/libprefs/Makefile.am (nonexistent) |
@@ -1,15 +0,0 @@ |
-libdir = $(prefix)/lib/scribus/libs |
-AM_CPPFLAGS = -I$(top_builddir)/scribus |
-lib_LTLIBRARIES = libpreferences.la |
- |
-INCLUDES = $(LIBFREETYPE_CFLAGS) $(all_includes) |
- |
-libpreferences_la_LDFLAGS = -version-info 0:0:0 |
- |
-libpreferences_la_METASOURCES = AUTO |
- |
-libpreferences_la_SOURCES = prefs.cpp |
-KDE_OPTIONS = qtonly |
- |
-EXTRA_DIST = prefs.cpp prefs.h |
-AM_LDFLAGS = -s $(LIBFREETYPE_LIBS) |
/Scribus/Scribus/scribus/libprefs/Makefile.am |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/fmitem.h |
=================================================================== |
--- Scribus/Scribus/scribus/fmitem.h (revision 6) |
+++ Scribus/Scribus/scribus/fmitem.h (nonexistent) |
@@ -1,41 +0,0 @@ |
-/*************************************************************************** |
- fmitem.h - description |
- ------------------- |
- begin : Sun May 13 2001 |
- copyright : (C) 2001 by Franz Schmid |
- email : Franz.Schmid@altmuehlnet.de |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
- |
-#ifndef FMITEM_H |
-#define FMITEM_H |
- |
-#include <qsize.h> |
-#include <qpainter.h> |
-#include <qfont.h> |
-#include <qstring.h> |
-#include <qmenudata.h> |
-/** |
- *@author Franz Schmid |
- */ |
- |
-class FmItem : public QCustomMenuItem { |
-public: |
- FmItem(const QString& s, const QFont& f); |
- ~FmItem() {}; |
- void paint(QPainter *p, const QColorGroup& cg, bool act, bool enabled, int x, int y, int w, int h); |
- QSize sizeHint(); |
-private: |
- QString string; |
- QFont font; |
-}; |
- |
-#endif |
/Scribus/Scribus/scribus/fmitem.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/seiten.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/seiten.cpp (revision 6) |
+++ Scribus/Scribus/scribus/seiten.cpp (nonexistent) |
@@ -1,875 +0,0 @@ |
-#include "seiten.h" |
-#include "seiten.moc" |
-#include <qcursor.h> |
-extern QPixmap loadIcon(QString nam); |
- |
-/* Code fuer DragObjekt */ |
-SeDrag::SeDrag(QString secret, QWidget * parent, const char * name): QStoredDrag("page/magic", parent, name) |
-{ |
- QByteArray data(secret.length()); |
- for (uint a = 0; a < secret.length(); ++a) |
- { |
- data[a]= QChar(secret[a]); |
- } |
- setEncodedData( data ); |
-} |
- |
-bool SeDrag::canDecode( QDragMoveEvent* e ) |
-{ |
- return e->provides("page/magic"); |
-} |
- |
-bool SeDrag::decode( QDropEvent* e, QString& str ) |
-{ |
- QByteArray payload = e->data("page/magic"); |
- if (payload.size()) |
- { |
- e->accept(); |
- str = ""; |
- for (uint a = 0; a < payload.size(); ++a) |
- { |
- str += payload[a]; |
- } |
- return true; |
- } |
- return false; |
-} |
- |
-/* IconItems Code */ |
-SeItem::SeItem(QTable* parent, QString text, QPixmap Pix, bool ss) |
- : QTableItem(parent, QTableItem::Never, text, Pix) |
-{ |
- Side = ss; |
- setWordWrap(true); |
-} |
- |
-void SeItem::paint(QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected) |
-{ |
- int px = pixmap().width(); |
- int py = pixmap().height(); |
- SeView *sv; |
- QTable *tt = table(); |
- sv = (SeView*)tt; |
- if (Side) |
- { |
- p->drawPixmap(0, (cr.height()-py)/2, pixmap()); |
- if (sv->Namen) |
- p->drawText(px, 0, cr.width()-px, cr.height(), Qt::AlignLeft | Qt::AlignVCenter | Qt::WordBreak, text()); |
- } |
- else |
- { |
- p->drawPixmap(cr.width()-px-2, (cr.height()-py)/2, pixmap()); |
- if (sv->Namen) |
- p->drawText(0, 0, cr.width()-px-2, cr.height(), Qt::AlignLeft | Qt::AlignVCenter | Qt::WordBreak, text()); |
- } |
-} |
- |
-/* ListBox Subclass */ |
-SeList::SeList(QWidget* parent) : QListBox(parent) |
-{ |
- Mpressed = false; |
- setAcceptDrops(true); |
-} |
- |
-void SeList::mouseReleaseEvent(QMouseEvent *m) |
-{ |
- Mpressed = false; |
- if (m->button() == RightButton) |
- { |
- QPopupMenu *pmen = new QPopupMenu(); |
- qApp->setOverrideCursor(QCursor(ArrowCursor), true); |
- int px = pmen->insertItem(tr("Show Page Previews"), this, SLOT(ToggleTh())); |
- if (Thumb) |
- pmen->setItemChecked(px, true); |
- pmen->exec(QCursor::pos()); |
- delete pmen; |
- } |
-} |
- |
-void SeList::ToggleTh() |
-{ |
- Thumb = !Thumb; |
- emit ThumbChanged(); |
-} |
- |
-void SeList::mousePressEvent(QMouseEvent* e) |
-{ |
- e->accept(); |
- CurItem = 0; |
- QListBoxItem *i = itemAt(e->pos()); |
- if (i) |
- { |
- CurItem = i; |
- Mpos = e->pos(); |
- Mpressed = true; |
- |
- } |
-} |
- |
-void SeList::mouseMoveEvent(QMouseEvent* e) |
-{ |
- if ((Mpressed) && ((Mpos - e->pos()).manhattanLength() > 4)) |
- { |
- Mpressed = false; |
- QListBoxItem *i = itemAt(Mpos); |
- if (i) |
- { |
- QDragObject *dr = new SeDrag("1"+i->text(), this, "te"); |
- dr->setPixmap(loadIcon("doc.png")); |
- dr->drag(); |
- } |
- } |
-} |
- |
-/* QTable Subclass */ |
-SeView::SeView(QWidget* parent) : QTable(parent) |
-{ |
- setDragEnabled(true); |
- setAcceptDrops(true); |
- viewport()->setAcceptDrops(true); |
- setShowGrid(false); |
- Mpressed = false; |
- Doppel = false; |
- Namen = true; |
- pix = QPixmap(2, 34); |
- pix.fill(black); |
- setFocusPolicy(NoFocus); |
-} |
- |
-void SeView::contentsMousePressEvent(QMouseEvent* e) |
-{ |
- e->accept(); |
- Mpos = e->pos(); |
- Mpressed = true; |
-} |
- |
-void SeView::contentsMouseReleaseEvent(QMouseEvent* e) |
-{ |
- e->accept(); |
- Mpressed = false; |
- if (e->button() == RightButton) |
- { |
- QPopupMenu *pmen = new QPopupMenu(); |
- qApp->setOverrideCursor(QCursor(ArrowCursor), true); |
- int px = pmen->insertItem(tr("Show Template Names"), this, SLOT(ToggleNam())); |
- if (Namen) |
- pmen->setItemChecked(px, true); |
- pmen->exec(QCursor::pos()); |
- delete pmen; |
- } |
- emit Click(rowAt(e->pos().y()), columnAt(e->pos().x()), e->button()); |
-} |
- |
-void SeView::ToggleNam() |
-{ |
- Namen = !Namen; |
- if (Namen) |
- { |
- setColumnWidth(1, 100); |
- setColumnWidth(3, 100); |
- } |
- else |
- { |
- setColumnWidth(1, 35); |
- setColumnWidth(3, 35); |
- } |
- hide(); |
- show(); |
-} |
- |
-void SeView::contentsMouseMoveEvent(QMouseEvent* e) |
-{ |
- QString str, tmp; |
- int p; |
- int a = rowAt(e->pos().y()); |
- int b = columnAt(e->pos().x()); |
- if ((Mpressed) && ((Mpos - e->pos()).manhattanLength() > 4)) |
- { |
- Mpressed = false; |
- if ((a != -1) && (b != -1)) |
- { |
- str = text(a, b); |
- p = GetPage(a, b); |
- QDragObject *dr = new SeDrag("2 "+tmp.setNum(p)+" "+str, this, "te"); |
- dr->setPixmap(loadIcon("doc.png")); |
- dr->drag(); |
- } |
- } |
-} |
- |
-void SeView::contentsDropEvent(QDropEvent * e) |
-{ |
- QString str, tmp; |
- if (SeDrag::decode(e, str)) |
- { |
- if (str.startsWith("1")) |
- { |
- int a = rowAt(e->pos().y()); |
- int b = columnAt(e->pos().x()); |
- int p; |
- tmp = str.remove(0,1); |
- if ((a == -1) || (b == -1)) |
- return; |
- if (Doppel) |
- { |
- if (((a % 2) == 1) && ((b == 0) || (b == 2))) |
- { |
- if (Links) |
- { |
- if (b == 0) |
- emit NewPage(a-1, tmp); |
- if (b == 2) |
- emit NewPage(a, tmp); |
- } |
- else |
- { |
- if (b == 0) |
- { |
- if (a == 1) |
- emit NewPage(a-1, tmp); |
- else |
- emit NewPage(a-2, tmp); |
- } |
- if (b == 2) |
- emit NewPage(a-1, tmp); |
- } |
- ClearPix(); |
- } |
- if (a == numRows()-1) |
- emit NewPage(MaxC+1, tmp); |
- if (((a % 2) == 1) && ((b == 1) || (b == 3))) |
- { |
- if (item(a,b) != 0) |
- { |
- p = GetPage(a, b); |
- emit UseTemp(tmp, p); |
- setText(a, b, tmp); |
- } |
- } |
- } |
- else |
- { |
- if ((a == -1) || ((a % 2) == 0)) |
- { |
- setNumRows(numRows()+2); |
- if (a == -1) |
- emit NewPage(numRows()/2-1, tmp); |
- else |
- { |
- emit NewPage(a/2, tmp); |
- clearCell(a, 0); |
- } |
- } |
- else |
- { |
- emit UseTemp(tmp, a/2); |
- setText(a, 0, tmp); |
- } |
- } |
- return; |
- } |
- if (str.startsWith("2")) |
- { |
- int st = str.find(" "); |
- int en = str.find(" ", st+1); |
- tmp = str.mid(en+1); |
- int dr = str.mid(st, en-st).toInt(); |
- int a = rowAt(e->pos().y()); |
- int b = columnAt(e->pos().x()); |
- int p, z; |
- if ((a == -1) || (b == -1)) |
- return; |
- if (Doppel) |
- { |
- if (((a % 2) == 1) && ((b == 0) || (b == 2))) |
- { |
- if (Links) |
- { |
- if (b == 0) |
- z = a-1; |
- if (b == 2) |
- z = a; |
- } |
- else |
- { |
- if (b == 0) |
- { |
- if (a == 1) |
- z = a-1; |
- else |
- z = a-2; |
- } |
- if (b == 2) |
- z = a-1; |
- } |
- if (dr != z) |
- emit MovePage(dr, z); |
- ClearPix(); |
- } |
- if (a == numRows()-1) |
- { |
- z = MaxC; |
- emit MovePage(dr, z); |
- } |
- if (((a % 2) == 1) && ((b == 1) || (b == 3))) |
- { |
- if (item(a,b) != 0) |
- { |
- p = GetPage(a, b); |
- emit UseTemp(tmp, p); |
- setText(a, b, tmp); |
- } |
- } |
- } |
- else |
- { |
- if ((a == -1) || ((a % 2) == 0)) |
- { |
- if (a != -1) |
- { |
- if (dr != a/2) |
- emit MovePage(dr, a/2); |
- clearCell(a, 0); |
- } |
- } |
- else |
- { |
- emit UseTemp(tmp, a/2); |
- setText(a, 0, tmp); |
- } |
- } |
- ClearPix(); |
- return; |
- } |
- } |
-} |
- |
-void SeView::contentsDragEnterEvent(QDragEnterEvent *e) |
-{ |
- if (SeDrag::canDecode(e)) |
- { |
- e->accept(); |
- } |
-} |
- |
-void SeView::contentsDragLeaveEvent(QDragLeaveEvent *e) |
-{ |
- ClearPix(); |
-} |
- |
-void SeView::contentsDragMoveEvent(QDragMoveEvent *e) |
-{ |
- QString str, tmp; |
- if (SeDrag::decode(e, str)) |
- { |
- int a = rowAt(e->pos().y()); |
- int b = columnAt(e->pos().x()); |
- if ((a == -1) || (b == -1)) |
- { |
- ClearPix(); |
- return; |
- } |
- if (Doppel) |
- { |
- if ((((a % 2) == 1) && ((b == 0) || (b == 2))) || (a == numRows()-1)) |
- { |
- QPixmap pm; |
- pm = QPixmap(columnWidth(b), rowHeight(a)); |
- pm.fill(darkBlue); |
- setPixmap(a, b, pm); |
- } |
- else |
- ClearPix(); |
- } |
- else |
- { |
- if ((a % 2) == 0) |
- { |
- QPixmap pm; |
- pm = QPixmap(columnWidth(0), 9); |
- pm.fill(darkBlue); |
- setPixmap(a, 0, pm); |
- } |
- else |
- ClearPix(); |
- } |
- } |
-} |
- |
-void SeView::ClearPix() |
-{ |
- for (int a = 0; a < numRows(); ++a) |
- { |
- if (Doppel) |
- { |
- if ((a % 2) == 1) |
- { |
- clearCell(a,0); |
- setPixmap(a,2, pix); |
- } |
- else |
- { |
- clearCell(a,0); |
- clearCell(a,1); |
- setPixmap(a,2, pix); |
- clearCell(a,3); |
- } |
- } |
- else |
- { |
- if ((a % 2) == 0) |
- clearCell(a, 0); |
- } |
- } |
-} |
- |
-int SeView::GetPage(int r, int c) |
-{ |
- int p; |
- if (Doppel) |
- { |
- if (Links) |
- { |
- if (c == 1) |
- p = r; |
- if (c == 3) |
- p = r+1; |
- } |
- else |
- { |
- if ((c == 1) && ( r == 1)) |
- return 0; |
- if (c == 1) |
- p = r - 1; |
- else |
- p = r; |
- } |
- p--; |
- if (p > MaxC) |
- p = MaxC; |
- } |
- else |
- { |
- p = r / 2; |
- if (p > MaxC) |
- p = MaxC; |
- } |
- return p; |
-} |
- |
-/* Der Muelleimer */ |
-TrashBin::TrashBin(QWidget * parent) : QLabel(parent, "Trash") |
-{ |
- Normal = loadIcon("trashcan.png"); |
- Offen = loadIcon("trashcan2.png"); |
- setPixmap(Normal); |
- setScaledContents(false); |
- setAcceptDrops(true); |
-} |
- |
-void TrashBin::dragEnterEvent(QDragEnterEvent *e) |
-{ |
- if (SeDrag::canDecode(e)) |
- { |
- e->accept(); |
- setPixmap(Offen); |
- } |
-} |
- |
-void TrashBin::dragLeaveEvent(QDragLeaveEvent *) |
-{ |
- setPixmap(Normal); |
-} |
- |
-void TrashBin::dropEvent(QDropEvent * e) |
-{ |
- setPixmap(Normal); |
- QString str, tmp; |
- if (SeDrag::decode(e, str)) |
- { |
- if (str.startsWith("2")) |
- { |
- int st = str.find(" "); |
- int en = str.find(" ", st+1); |
- emit DelPage(str.mid(st, en-st).toInt()); |
- } |
- if (str.startsWith("1")) |
- { |
- tmp = str.remove(0,1); |
- emit DelMaster(tmp); |
- } |
- } |
-} |
- |
- |
-SeitenPal::SeitenPal(QWidget* parent) |
- : QDialog( parent, "SP", false, Qt::WStyle_Customize | Qt::WStyle_Title | Qt::WStyle_Tool) |
-{ |
- setCaption( tr( "Arrange Pages" ) ); |
- setIcon(loadIcon("AppIcon.xpm")); |
- SeitenPalLayout = new QVBoxLayout( this ); |
- SeitenPalLayout->setSpacing( 5 ); |
- SeitenPalLayout->setMargin( 5 ); |
- Splitter1 = new QSplitter( this, "Splitter1" ); |
- Splitter1->setOrientation( QSplitter::Vertical ); |
- QWidget* privateLayoutWidget = new QWidget( Splitter1, "Layout2" ); |
- Layout2 = new QVBoxLayout( privateLayoutWidget, 0, 5, "Layout2"); |
- TextLabel1 = new QLabel( privateLayoutWidget, "TextLabel1" ); |
- TextLabel1->setText( tr( "Available Templates:" ) ); |
- Layout2->addWidget( TextLabel1 ); |
- TemplList = new SeList(privateLayoutWidget); |
- TemplList->setMinimumSize(QSize(130,70)); |
- TemplList->Thumb = false; |
- Layout2->addWidget( TemplList ); |
- QWidget* privateLayoutWidget_2 = new QWidget( Splitter1, "Layout3" ); |
- Layout3 = new QVBoxLayout( privateLayoutWidget_2, 0, 5, "Layout3"); |
- TextLabel2 = new QLabel( privateLayoutWidget_2, "TextLabel2" ); |
- TextLabel2->setText( tr( "Document Pages:" ) ); |
- Layout3->addWidget( TextLabel2 ); |
- PageView = new SeView(privateLayoutWidget_2); |
- PageView->setLeftMargin(0); |
- PageView->verticalHeader()->hide(); |
- PageView->setTopMargin(0); |
- PageView->horizontalHeader()->hide(); |
- PageView->setSorting(false); |
- PageView->setSelectionMode(QTable::NoSelection); |
- PageView->setColumnMovingEnabled(false); |
- PageView->setRowMovingEnabled(false); |
-// PageView->setFocusStyle(QTable::FollowStyle); |
- PageView->setNumRows(1); |
- PageView->setNumCols(1); |
- PageView->setMinimumSize(QSize(130,120)); |
- Layout3->addWidget( PageView ); |
- SeitenPalLayout->addWidget( Splitter1 ); |
- |
- Layout1 = new QHBoxLayout; |
- Layout1->setSpacing( 6 ); |
- Layout1->setMargin( 0 ); |
- |
- Layout4 = new QVBoxLayout; |
- Layout4->setSpacing( 6 ); |
- Layout4->setMargin( 0 ); |
- DS = new QCheckBox(this, "DS"); |
- DS->setText( tr( "Facing Pages" ) ); |
- Layout4->addWidget( DS ); |
- LP = new QCheckBox(this, "LP"); |
- LP->setText( tr( "Left Page first" ) ); |
- Layout4->addWidget( LP ); |
- Layout1->addLayout( Layout4 ); |
- |
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- Layout1->addItem( spacer ); |
- |
- Trash = new TrashBin( this ); |
- Trash->setMinimumSize(QSize(22,22)); |
- Layout1->addWidget( Trash ); |
- SeitenPalLayout->addLayout( Layout1 ); |
- pix = loadIcon("document2.png"); |
- connect(TemplList, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(selTemplate())); |
- connect(TemplList, SIGNAL(ThumbChanged()), this, SLOT(RebuildTemp())); |
- connect(PageView, SIGNAL(Click(int, int, int)), this, SLOT(GotoPage(int, int, int))); |
- connect(PageView, SIGNAL(MovePage(int, int)), this, SLOT(MPage(int, int))); |
- connect(DS, SIGNAL(clicked()), this, SLOT(HandleDS())); |
- connect(LP, SIGNAL(clicked()), this, SLOT(HandleLP())); |
- connect(Trash, SIGNAL(DelMaster(QString)), this, SLOT(DelMPage(QString))); |
- QToolTip::add( Trash, tr( "Drag Pages or Template Pages onto the Trashbin to delete them." ) ); |
- QToolTip::add( PageView, tr( "Here you can see all Pages of your Document." ) ); |
- QToolTip::add( TemplList, tr( "Here are all your Templates, to create a new Page\ndrag a Template to the Pageview below." ) ); |
-} |
- |
- |
-void SeitenPal::closeEvent(QCloseEvent *ce) |
-{ |
- emit Schliessen(); |
- ce->accept(); |
-} |
- |
-void SeitenPal::DelMPage(QString tmp) |
-{ |
- if (tmp == tr("Normal")) |
- return; |
- int Nr = Vie->MasterNames[tmp]; |
- Page* Seite = Vie->MasterPages.at(Nr); |
- Vie->MasterPages.remove(Nr); |
- delete Seite->parentWidget(); |
- Vie->MasterNames.clear(); |
- for (uint aa=0; aa < Vie->MasterPages.count(); ++aa) |
- { |
- Seite = Vie->MasterPages.at(aa); |
- Seite->PageNr = aa; |
- if (Vie->Doc->PageFP) |
- { |
- if (Seite->LeftPg) |
- { |
- Seite->Margins.Left = Vie->Doc->PageM.Right; |
- Seite->Margins.Right = Vie->Doc->PageM.Left; |
- } |
- else |
- { |
- Seite->Margins.Right = Vie->Doc->PageM.Right; |
- Seite->Margins.Left = Vie->Doc->PageM.Left; |
- } |
- } |
- else |
- { |
- Seite->Margins.Right = Vie->Doc->PageM.Right; |
- Seite->Margins.Left = Vie->Doc->PageM.Left; |
- } |
- Seite->Margins.Top = Vie->Doc->PageM.Top; |
- Seite->Margins.Bottom = Vie->Doc->PageM.Bottom; |
- Vie->MasterNames[Seite->PageNam] = aa; |
- } |
- for (uint b=0; b<Vie->DocPages.count(); ++b) |
- { |
- if (Vie->DocPages.at(b)->MPageNam == tmp) |
- Vie->DocPages.at(b)->MPageNam = "Normal"; |
- } |
- Vie->DrawNew(); |
- RebuildTemp(); |
- RebuildPage(); |
- Vie->Doc->setModified(); |
-} |
- |
-void SeitenPal::MPage(int r, int c) |
-{ |
- if (r > c) |
- Vie->movePage(r, r+1, c, 0); |
- else |
- { |
- if (c > PageView->MaxC) |
- Vie->movePage(r, r+1, c, 2); |
- else |
- Vie->movePage(r, r+1, c, 1); |
- } |
- RebuildPage(); |
- Vie->Doc->setModified(); |
-} |
- |
-void SeitenPal::GotoPage(int r, int c, int b) |
-{ |
- int p; |
- if ((b == LeftButton) && (r != -1) && (c != -1)) |
- { |
- p = PageView->GetPage(r, c); |
- emit GotoSeite(p); |
- } |
-} |
- |
-void SeitenPal::DisablePal() |
-{ |
- PageView->setEnabled(false); |
- TemplList->setEnabled(false); |
- DS->setEnabled(false); |
- LP->setEnabled(false); |
-} |
- |
-void SeitenPal::EnablePal() |
-{ |
- PageView->setEnabled(true); |
- TemplList->setEnabled(true); |
- DS->setEnabled(true); |
- if (PageView->Doppel) |
- LP->setEnabled(true); |
- else |
- LP->setEnabled(false); |
-} |
- |
-void SeitenPal::HandleDS() |
-{ |
- float tpr = Vie->Doc->PageM.Top; |
- float lr = Vie->Doc->PageM.Left; |
- float rr = Vie->Doc->PageM.Right; |
- float br = Vie->Doc->PageM.Bottom; |
- bool fp = DS->isChecked(); |
- Vie->Doc->resetPage(tpr, lr, rr, br, fp); |
- Vie->reformPages(); |
- Vie->DrawNew(); |
- Vie->GotoPage(Vie->Doc->ActPage->PageNr); |
- RebuildPage(); |
- Vie->Doc->setModified(); |
- if (fp) |
- LP->setEnabled(true); |
- else |
- LP->setEnabled(false); |
-} |
- |
-void SeitenPal::HandleLP() |
-{ |
- float tpr = Vie->Doc->PageM.Top; |
- float lr = Vie->Doc->PageM.Left; |
- float rr = Vie->Doc->PageM.Right; |
- float br = Vie->Doc->PageM.Bottom; |
- bool fp2 = Vie->Doc->PageFP; |
- if (fp2) |
- Vie->Doc->FirstPageLeft = LP->isChecked(); |
- Vie->Doc->resetPage(tpr, lr, rr, br, fp2); |
- Vie->reformPages(); |
- Vie->DrawNew(); |
- Vie->GotoPage(Vie->Doc->ActPage->PageNr); |
- RebuildPage(); |
- Vie->Doc->setModified(); |
-} |
- |
-void SeitenPal::RebuildTemp() |
-{ |
- TemplList->clear(); |
- if (Vie == 0) |
- return; |
- QMap<QString,int>::Iterator it; |
- for (it = Vie->MasterNames.begin(); it != Vie->MasterNames.end(); ++it) |
- { |
- if (TemplList->Thumb) |
- { |
- if (it.key() == "Normal") |
- TemplList->insertItem(Vie->MPageToPixmap(it.key(),60), tr("Normal")); |
- else |
- TemplList->insertItem(Vie->MPageToPixmap(it.key(),60), it.key()); |
- } |
- else |
- { |
- if (it.key() == "Normal") |
- TemplList->insertItem(tr("Normal")); |
- else |
- TemplList->insertItem(it.key()); |
- } |
- } |
-} |
- |
-void SeitenPal::RebuildPage() |
-{ |
- QString str; |
- disconnect(DS, SIGNAL(clicked()), this, SLOT(HandleDS())); |
- disconnect(LP, SIGNAL(clicked()), this, SLOT(HandleLP())); |
- PageView->setNumRows(1); |
- PageView->setNumCols(1); |
- if (Vie == 0) |
- { |
- connect(DS, SIGNAL(clicked()), this, SLOT(HandleDS())); |
- connect(LP, SIGNAL(clicked()), this, SLOT(HandleLP())); |
- return; |
- } |
- PageView->Doppel = Vie->Doc->PageFP; |
- PageView->Links = Vie->Doc->FirstPageLeft; |
- DS->setChecked(PageView->Doppel); |
- LP->setChecked(PageView->Links); |
- if (PageView->Doppel) |
- LP->setEnabled(true); |
- PageView->MaxC = Vie->Pages.count()-1; |
- if (Vie->Doc->PageFP) |
- { |
- int cc, cb; |
- bool Side; |
- if (PageView->Namen) |
- resize(240, height()); |
- else |
- resize(180, height()); |
- PageView->setNumCols(4); |
- PageView->setColumnWidth(0, 5); |
- PageView->setColumnWidth(2, 5); |
- if (PageView->Namen) |
- { |
- PageView->setColumnWidth(1, 100); |
- PageView->setColumnWidth(3, 100); |
- } |
- else |
- { |
- PageView->setColumnWidth(1, 35); |
- PageView->setColumnWidth(3, 35); |
- } |
- cc = 1; |
- if (Vie->Doc->FirstPageLeft) |
- { |
- PageView->setNumRows(((Vie->Doc->PageC-1)/2 + 1) * 2 + 1); |
- cb = 1; |
- } |
- else |
- { |
- PageView->setNumRows((Vie->Doc->PageC/2 + 1) * 2 +1); |
- cb = 3; |
- } |
- for (uint a = 0; a < Vie->Pages.count(); ++a) |
- { |
- str = Vie->Pages.at(a)->MPageNam; |
- Side = cb == 1 ? false : true; |
- QTableItem *it = new SeItem( PageView, str, CreateIcon(a, pix), Side); |
- PageView->setItem(cc, cb, it); |
- PageView->setRowHeight(cc, pix.height()); |
- PageView->setPixmap(cc, 2, PageView->pix); |
- PageView->setPixmap(cc-1, 2, PageView->pix); |
- PageView->setRowHeight(cc-1, 10); |
- PageView->setRowReadOnly(cc-1, true); |
- PageView->adjustRow(cc); |
- cb += 2; |
- if (cb > 3) |
- { |
- cb = 1; |
- cc += 2; |
- } |
- } |
- } |
- else |
- { |
- PageView->setNumRows(Vie->Pages.count()*2+1); |
- PageView->setNumCols(1); |
- resize(180, height()); |
- int cc = 1; |
- for (uint a = 0; a < Vie->Pages.count(); ++a) |
- { |
- str = Vie->Pages.at(a)->MPageNam; |
- QTableItem *it = new SeItem( PageView, str, CreateIcon(a, pix), true); |
- PageView->setItem(cc, 0, it); |
- PageView->setRowHeight(cc, pix.height()); |
- PageView->adjustRow(cc); |
- PageView->setRowHeight(cc-1, 10); |
- PageView->setRowReadOnly(cc-1, true); |
- cc += 2; |
- } |
- PageView->adjustColumn(0); |
- } |
- PageView->setRowHeight(PageView->numRows()-1, 10); |
- if (Vie->Doc->PageFP) |
- PageView->setPixmap(PageView->numRows()-1, 2, PageView->pix); |
- PageView->setRowReadOnly(PageView->numRows()-1, true); |
- PageView->repaint(); |
- connect(DS, SIGNAL(clicked()), this, SLOT(HandleDS())); |
- connect(LP, SIGNAL(clicked()), this, SLOT(HandleLP())); |
-} |
- |
-void SeitenPal::Rebuild() |
-{ |
- RebuildTemp(); |
- RebuildPage(); |
- if (Vie == 0) |
- DisablePal(); |
- else |
- EnablePal(); |
-} |
- |
-void SeitenPal::SetView(ScribusView *view) |
-{ |
- Vie = view; |
-} |
- |
-void SeitenPal::selTemplate() |
-{ |
- if (TemplList->CurItem != 0) |
- emit EditTemp(TemplList->CurItem->text()); |
-} |
- |
-QPixmap SeitenPal::CreateIcon(int nr, QPixmap ret) |
-{ |
- QString tmp; |
- QPainter p; |
- p.begin(&ret); |
- p.setBrush(white); |
- p.setBackgroundColor(white); |
- p.setBackgroundMode(QPainter::OpaqueMode); |
- p.setPen(QPen(black, 1, SolidLine, FlatCap, MiterJoin)); |
- p.setFont(QFont("Helvetica", 12, QFont::Bold)); |
- tmp = tmp.setNum(nr+1); |
- QRect b = p.boundingRect(3,0, ret.width(), ret.height(), Qt::AlignCenter, tmp); |
- p.drawRect(QRect(b.x()-2, b.y()-2, b.width()+4, b.height()+4)); |
- p.drawText(b, Qt::AlignCenter, tmp); |
- p.end(); |
- return ret; |
-} |
/Scribus/Scribus/scribus/seiten.cpp |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/rc4.c |
=================================================================== |
--- Scribus/Scribus/scribus/rc4.c (revision 6) |
+++ Scribus/Scribus/scribus/rc4.c (nonexistent) |
@@ -1,145 +0,0 @@ |
-/* |
- * "$Id$" |
- * |
- * RC4 functions for HTMLDOC. |
- * |
- * Original code by Tim Martin |
- * Copyright 1999 by Carnegie Mellon University, All Rights Reserved |
- * |
- * Permission to use, copy, modify, and distribute this software and its |
- * documentation for any purpose and without fee is hereby granted, |
- * provided that the above copyright notice appear in all copies and that |
- * both that copyright notice and this permission notice appear in |
- * supporting documentation, and that the name of Carnegie Mellon |
- * University not be used in advertising or publicity pertaining to |
- * distribution of the software without specific, written prior |
- * permission. |
- * |
- * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO |
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
- * FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR |
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT |
- * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
- * |
- * Contents: |
- * |
- * rc4_init() - Initialize an RC4 context with the specified key. |
- * rc4_encrypt() - Encrypt the given buffer. |
- */ |
- |
-#include "rc4.h" |
- |
- |
-/* |
- * 'rc4_init()' - Initialize an RC4 context with the specified key. |
- */ |
- |
-void |
-rc4_init(rc4_context_t *text, /* IO - Context */ |
- const unsigned char *key, /* I - Key */ |
- unsigned keylen) /* I - Length of key */ |
-{ |
- int i, j; /* Looping vars */ |
- unsigned char tmp; /* Temporary variable */ |
- |
- |
- /* |
- * Fill in linearly s0=0, s1=1, ... |
- */ |
- |
- for (i = 0; i < 256; i ++) |
- text->sbox[i] = i; |
- |
- for (i = 0, j = 0; i < 256; i ++) |
- { |
- /* |
- * j = (j + Si + Ki) mod 256 |
- */ |
- |
- j = (j + text->sbox[i] + key[i % keylen]) & 255; |
- |
- /* |
- * Swap Si and Sj... |
- */ |
- |
- tmp = text->sbox[i]; |
- text->sbox[i] = text->sbox[j]; |
- text->sbox[j] = tmp; |
- } |
- |
- /* |
- * Initialized counters to 0 and return... |
- */ |
- |
- text->i = 0; |
- text->j = 0; |
-} |
- |
- |
-/* |
- * 'rc4_encrypt()' - Encrypt the given buffer. |
- */ |
- |
-void |
-rc4_encrypt(rc4_context_t *text, /* I - Context */ |
- const unsigned char *input, /* I - Input buffer */ |
- unsigned char *output, /* O - Output buffer */ |
- unsigned len) /* I - Size of buffers */ |
-{ |
- unsigned char tmp; /* Swap variable */ |
- int i, j; /* Looping vars */ |
- int t; /* Current S box */ |
- |
- |
- /* |
- * Loop through the entire buffer... |
- */ |
- |
- i = text->i; |
- j = text->j; |
- |
- while (len > 0) |
- { |
- /* |
- * Get the next S box indices... |
- */ |
- |
- i = (i + 1) & 255; |
- j = (j + text->sbox[i]) & 255; |
- |
- /* |
- * Swap Si and Sj... |
- */ |
- |
- tmp = text->sbox[i]; |
- text->sbox[i] = text->sbox[j]; |
- text->sbox[j] = tmp; |
- |
- /* |
- * Get the S box index for this byte... |
- */ |
- |
- t = (text->sbox[i] + text->sbox[j]) & 255; |
- |
- /* |
- * Encrypt using the S box... |
- */ |
- |
- *output++ = *input++ ^ text->sbox[t]; |
- len --; |
- } |
- |
- /* |
- * Copy current S box indices back to context... |
- */ |
- |
- text->i = i; |
- text->j = j; |
-} |
- |
- |
-/* |
- * End of "$Id$". |
- */ |
/Scribus/Scribus/scribus/rc4.c |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/scribuswin.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/scribuswin.cpp (revision 6) |
+++ Scribus/Scribus/scribus/scribuswin.cpp (nonexistent) |
@@ -1,115 +0,0 @@ |
-/*************************************************************************** |
- scribuswin.cpp - description |
- ------------------- |
- begin : Mit Nov 6 2002 |
- copyright : (C) 2002 by Franz Schmid |
- email : Franz.Schmid@altmuehlnet.de |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
- |
-#include "scribuswin.h" |
-#include "scribuswin.moc" |
-extern QPixmap loadIcon(QString nam); |
- |
-ScribusWin::ScribusWin(QWidget* parent, ScribusDoc* ddoc) |
- : QMainWindow(parent, "", WDestructiveClose) |
-{ |
- setIcon(loadIcon("AppIcon.xpm")); |
- doc = ddoc; |
- muster = NULL; |
- NrItems = 0; |
- First = 1; |
- Last = 0; |
-} |
- |
-void ScribusWin::setView(ScribusView* dview) |
-{ |
- view = dview; |
-} |
- |
-void ScribusWin::closeEvent(QCloseEvent *ce) |
-{ |
- if (doc->isModified()) |
- { |
- int exit=QMessageBox::information(this, |
- tr("Warning"), |
- tr("Document:")+" "+doc->DocName+"\n"+tr("has been changed since the last save."), |
- tr("Save Now"), |
- tr("Cancel"), |
- tr("Leave Anyway"), |
- 0, 1); |
- switch (exit) |
- { |
- case 0: |
- emit SaveAndClose(); |
- ce->accept(); |
- break; |
- case 1: |
- break; |
- case 2: |
- emit Schliessen(); |
- ce->accept(); |
- break; |
- } |
- } |
- else |
- { |
- emit Schliessen(); |
- ce->accept(); |
- } |
-} |
- |
-void ScribusWin::CloseCMSProfiles() |
-{ |
-#ifdef HAVE_CMS |
- cmsCloseProfile(doc->DocInputProf); |
- cmsCloseProfile(doc->DocOutputProf); |
- cmsCloseProfile(doc->DocPrinterProf); |
- cmsDeleteTransform(stdTrans); |
- cmsDeleteTransform(stdProof); |
- cmsDeleteTransform(stdTransImg); |
- cmsDeleteTransform(stdProofImg); |
-#endif |
-} |
- |
-void ScribusWin::OpenCMSProfiles(ProfilesL InPo, ProfilesL MoPo, ProfilesL PrPo) |
-{ |
-#ifdef HAVE_CMS |
- QString pfad = PREL; |
- pfad += "/lib/scribus/profiles/"; |
- doc->DocInputProf = cmsOpenProfileFromFile(InPo[doc->CMSSettings.DefaultInputProfile2], "r"); |
- doc->DocOutputProf = cmsOpenProfileFromFile(pfad + MoPo[doc->CMSSettings.DefaultMonitorProfile], "r"); |
- doc->DocPrinterProf = cmsOpenProfileFromFile(pfad + PrPo[doc->CMSSettings.DefaultPrinterProfile], "r"); |
- int dcmsFlags = 0; |
- if (Gamut) |
- dcmsFlags |= cmsFLAGS_GAMUTCHECK; |
- else |
- dcmsFlags |= cmsFLAGS_SOFTPROOFING; |
- stdProof = cmsCreateProofingTransform(doc->DocInputProf, TYPE_RGB_16, |
- doc->DocOutputProf, TYPE_RGB_16, |
- doc->DocPrinterProf, |
- IntentPrinter, |
- IntentMonitor, dcmsFlags); |
- stdTrans = cmsCreateTransform(doc->DocInputProf, TYPE_RGB_16, |
- doc->DocOutputProf, TYPE_RGB_16, |
- IntentMonitor, |
- cmsFLAGS_NOTPRECALC); |
- stdProofImg = cmsCreateProofingTransform(doc->DocInputProf, TYPE_RGBA_8, |
- doc->DocOutputProf, TYPE_RGBA_8, |
- doc->DocPrinterProf, |
- IntentPrinter, |
- IntentMonitor, dcmsFlags); |
- stdTransImg = cmsCreateTransform(doc->DocInputProf, TYPE_RGBA_8, |
- doc->DocOutputProf, TYPE_RGBA_8, |
- IntentMonitor, |
- cmsFLAGS_NOTPRECALC); |
-#endif |
-} |
/Scribus/Scribus/scribus/scribuswin.cpp |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/delpages.h |
=================================================================== |
--- Scribus/Scribus/scribus/delpages.h (revision 6) |
+++ Scribus/Scribus/scribus/delpages.h (nonexistent) |
@@ -1,44 +0,0 @@ |
-/**************************************************************************** |
-** Form interface generated from reading ui file 'DelPage.ui' |
-** |
-** Created: Thu Jun 14 11:37:35 2001 |
-** by: The User Interface Compiler (uic) |
-** |
-** WARNING! All changes made in this file will be lost! |
-****************************************************************************/ |
-#ifndef DELPAGES_H |
-#define DELPAGES_H |
- |
-#include <qdialog.h> |
-#include <qlabel.h> |
-#include <qlayout.h> |
-#include <qpushbutton.h> |
-#include <qspinbox.h> |
- |
-class DelPages : public QDialog |
-{ |
- Q_OBJECT |
- |
-public: |
- DelPages( QWidget* parent, int act, int max ); |
- ~DelPages() {}; |
- |
- QPushButton* Cancel; |
- QPushButton* OK; |
- QLabel* TextLabel2; |
- QSpinBox* ToPage; |
- QLabel* TextLabel1; |
- QSpinBox* FromPage; |
- |
-protected: |
- QVBoxLayout* DLayout; |
- QHBoxLayout* Layout4; |
- QHBoxLayout* Layout3; |
- |
-public slots: |
- virtual void FromChanged(int nr); |
- virtual void ToChanged(int nr); |
- |
-}; |
- |
-#endif // DELPAGES_H |
/Scribus/Scribus/scribus/delpages.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/linkbutton.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/linkbutton.cpp (revision 6) |
+++ Scribus/Scribus/scribus/linkbutton.cpp (nonexistent) |
@@ -1,38 +0,0 @@ |
-/*************************************************************************** |
- linkbutton.cpp - description |
- ------------------- |
- begin : Wed Jul 11 2001 |
- copyright : (C) 2001 by Franz Schmid |
- email : Franz.Schmid@altmuehlnet.de |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
- |
-#include "linkbutton.h" |
-#include "icons6.h" |
-#include <qiconset.h> |
-LinkButton::LinkButton(QWidget *pa) : QToolButton(pa) |
-{ |
- setBackgroundMode(PaletteBackground); |
- QIconSet a = QIconSet(); |
- a.setPixmap(QPixmap(ChainC), QIconSet::Automatic, QIconSet::Normal, QIconSet::On); |
- a.setPixmap(QPixmap(ChainO), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off); |
- setIconSet(a); |
-} |
- |
-QSize LinkButton::sizeHint() |
-{ |
- return QSize(QPixmap(ChainC).width(),QPixmap(ChainC).height()); |
-} |
- |
-QSize LinkButton::minimumSizeHint() |
-{ |
- return QSize(QPixmap(ChainC).width(),QPixmap(ChainC).height()); |
-} |
/Scribus/Scribus/scribus/linkbutton.cpp |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/navigator.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/navigator.cpp (revision 6) |
+++ Scribus/Scribus/scribus/navigator.cpp (nonexistent) |
@@ -1,81 +0,0 @@ |
-/*************************************************************************** |
- navigator.cpp - description |
- ------------------- |
- begin : Fri Feb 22 2002 |
- copyright : (C) 2002 by Franz Schmid |
- email : Franz.Schmid@altmuehlnet.de |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
- |
-#include "navigator.h" |
-#include "navigator.moc" |
- |
-Navigator::Navigator(QWidget *parent, int Size, int Seite, ScribusView* vie) : QLabel(parent) |
-{ |
- setScaledContents(false); |
- setAlignment(static_cast<int>( QLabel::AlignLeft | QLabel::AlignTop) ); |
- pmx = vie->PageToPixmap(Seite, Size); |
- resize(pmx.width(), pmx.height()); |
- Xp = 0; |
- Yp = 0; |
- drawMark(0, 0); |
- view = vie; |
-} |
- |
-void Navigator::mouseMoveEvent(QMouseEvent *m) |
-{ |
- drawMark(m->x(), m->y()); |
- emit Coords(static_cast<float>(m->x())/static_cast<float>(width()), |
- static_cast<float>(m->y())/static_cast<float>(height())); |
-} |
- |
-void Navigator::mousePressEvent(QMouseEvent *m) |
-{ |
- drawMark(m->x(), m->y()); |
- emit Coords(static_cast<float>(m->x())/static_cast<float>(width()), |
- static_cast<float>(m->y())/static_cast<float>(height())); |
-} |
- |
-void Navigator::mouseReleaseEvent(QMouseEvent *m) |
-{ |
- emit Coords(static_cast<float>(m->x())/static_cast<float>(width()), |
- static_cast<float>(m->y())/static_cast<float>(height())); |
-} |
- |
-void Navigator::paintEvent(QPaintEvent *e) |
-{ |
- QPainter p; |
- p.begin(this); |
- p.setClipRect(e->rect()); |
- drawMark(Xp, Yp); |
- p.end(); |
-} |
- |
-void Navigator::drawMark(int x, int y) |
-{ |
- QPainter p; |
- p.begin(this); |
- p.drawPixmap(0, 0, pmx); |
- p.setPen(QPen(QColor(black), 1, SolidLine, FlatCap, MiterJoin)); |
- p.drawLine(x-5, y-5, x-1, y-1); |
- p.drawLine(x-5, y+5, x-1, y+1); |
- p.drawLine(x+2, y+2, x+6, y+6); |
- p.drawLine(x+2, y-2, x+6, y-6); |
- p.end(); |
-} |
- |
-void Navigator::SetSeite(int Seite, int Size) |
-{ |
- pmx = view->PageToPixmap(Seite, Size); |
- resize(pmx.width(), pmx.height()); |
- repaint(); |
-} |
- |
/Scribus/Scribus/scribus/navigator.cpp |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/iso8859-13.enc |
=================================================================== |
--- Scribus/Scribus/scribus/iso8859-13.enc (revision 6) |
+++ Scribus/Scribus/scribus/iso8859-13.enc (nonexistent) |
@@ -1,37 +0,0 @@ |
-0 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /space /exclam /quotedbl /numbersign |
-/dollar /percent /ampersand /quotesingle /parenleft |
-/parenright /asterisk /plus /comma /hyphen /period |
-/slash /zero /one /two /three /four /five /six /seven |
-/eight /nine /colon /semicolon /less /equal /greater |
-/question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N |
-/O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash |
-/bracketright /asciicircum /underscore /grave /a /b /c /d |
-/e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w |
-/x /y /z /braceleft /bar /braceright /asciitilde /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /space /guillemotright /cent /pounds |
-/currency /yen /brokenbar /paragraph /Oslash /copyright |
-/ordfeminine /Rcedilla /guillemotleft /logicalnot /less /registered |
-/AE /degree /plusminus /twosuperior /threesuperior /quoteleft |
-/colon /oslash /onesuperior /rcedilla /guillemotright /onequarter |
-/onehalf /threequarters /questiondown /ae /Aogonek /Iogonek |
-/Amacron /Cacute /Adieresis /Aring /Eogonek /Emacron |
-/Ccaron /Eacute /Zacute /Edotaccent /Gcedilla /Kcedilla |
-/Imacron /Lcedilla /Scaron /Nacute /Ncedilla /Oacute |
-/Omacron /Otilde /Odieresis /multiply /Uogonek /Lslash |
-/Sacute /Umacron /Udieresis /Zdotaccent /Zcaron /germandbls |
-/aogonek /iogonek /amacron /cacute /adieresis /aring |
-/eogonek /emacron /ccaron /eacute /zacute /edotaccent |
-/gcedilla /kcedilla /imacron /lcedilla /scaron /nacute |
-/ncedilla /oacute /omacron /otilde /odieresis /divide |
-/uogonek /lslash /sacute /umacron /udieresis /zdotaccent |
-/zcaron /quoteright |
/Scribus/Scribus/scribus/iso8859-13.enc |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/rc4.h |
=================================================================== |
--- Scribus/Scribus/scribus/rc4.h (revision 6) |
+++ Scribus/Scribus/scribus/rc4.h (nonexistent) |
@@ -1,63 +0,0 @@ |
-/* |
- * "$Id$" |
- * |
- * RC4 functions for HTMLDOC. |
- * |
- * Original code by Rob Earhart |
- * Copyright 1999 by Carnegie Mellon University, All Rights Reserved |
- * |
- * Permission to use, copy, modify, and distribute this software and its |
- * documentation for any purpose and without fee is hereby granted, |
- * provided that the above copyright notice appear in all copies and that |
- * both that copyright notice and this permission notice appear in |
- * supporting documentation, and that the name of Carnegie Mellon |
- * University not be used in advertising or publicity pertaining to |
- * distribution of the software without specific, written prior |
- * permission. |
- * |
- * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO |
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND |
- * FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR |
- * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT |
- * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
- */ |
- |
-#ifndef _RC4_H_ |
-# define _RC4_H_ |
- |
-# ifdef __cplusplus |
-extern "C" { |
-# endif /* __cplusplus */ |
- |
- |
-/* |
- * RC4 context... |
- */ |
- |
-typedef struct |
-{ |
- unsigned char sbox[256]; /* S boxes for encryption */ |
- int i, j; /* Current indices into S boxes */ |
-} rc4_context_t; |
- |
- |
-/* |
- * Prototypes... |
- */ |
- |
-extern void rc4_init(rc4_context_t *context, const unsigned char *key, |
- unsigned keylen); |
-extern void rc4_encrypt(rc4_context_t *context, const unsigned char *input, |
- unsigned char *output, unsigned len); |
- |
-# ifdef __cplusplus |
-} |
-# endif /* __cplusplus */ |
- |
-#endif /* !_RC4_H_ */ |
- |
-/* |
- * End of "$Id$". |
- */ |
/Scribus/Scribus/scribus/rc4.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/iso8859-15.enc |
=================================================================== |
--- Scribus/Scribus/scribus/iso8859-15.enc (revision 6) |
+++ Scribus/Scribus/scribus/iso8859-15.enc (nonexistent) |
@@ -1,32 +0,0 @@ |
-0 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl |
-/numbersign /dollar /percent /ampersand /quotesingle /parenleft |
-/parenright /asterisk /plus /comma /hyphen /period /slash /zero |
-/one /two /three /four /five /six /seven /eight /nine /colon /semicolon |
-/less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J |
-/K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft |
-/backslash /bracketright /asciicircum /underscore /grave /a /b /c |
-/d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y |
-/z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef |
-/.notdef /.notdef /space /exclamdown /cent /sterling /Euro /yen |
-/Scaron /section /scaron /copyright /ordfeminine /guillemotleft |
-/logicalnot /hyphen /registered /macron /degree /plusminus |
-/twosuperior /threesuperior /Zcaron /mu /paragraph /bullet /zcaron |
-/onesuperior /ordmasculine /guillemotright /OE /oe /Ydieresis |
-/questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis |
-/Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis |
-/Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde /Ograve |
-/Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave |
-/Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave |
-/aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla |
-/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex |
-/idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde |
-/odieresis /divide /oslash /ugrave /uacute /ucircumflex /udieresis |
-/yacute /thorn /ydieresis |
/Scribus/Scribus/scribus/iso8859-15.enc |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/fpoint.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/fpoint.cpp (revision 6) |
+++ Scribus/Scribus/scribus/fpoint.cpp (nonexistent) |
@@ -1,65 +0,0 @@ |
-/*************************************************************************** |
- fpoint.cpp - description |
- ------------------- |
- begin : Mit Jul 24 2002 |
- copyright : (C) 2002 by Franz Schmid |
- email : Franz.Schmid@altmuehlnet.de |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
- |
-#include "fpoint.h" |
- |
-FPoint::FPoint(float x, float y) |
-{ |
- xp = x; |
- yp = y; |
-} |
- |
-FPoint::FPoint(QPoint p) |
-{ |
- xp = p.x(); |
- yp = p.y(); |
-} |
- |
-float FPoint::x() |
-{ |
- return xp; |
-} |
- |
-float FPoint::y() |
-{ |
- return yp; |
-} |
- |
-void FPoint::setX(float x) |
-{ |
- xp = x; |
-} |
- |
-void FPoint::setY(float y) |
-{ |
- yp = y; |
-} |
- |
-FPoint &FPoint::operator+=( const FPoint &p ) |
-{ |
- xp += p.xp; |
- yp += p.yp; |
- return *this; |
-} |
- |
-FPoint &FPoint::operator-=( const FPoint &p ) |
-{ |
- xp -= p.xp; |
- yp -= p.yp; |
- return *this; |
-} |
- |
/Scribus/Scribus/scribus/fpoint.cpp |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/align.h |
=================================================================== |
--- Scribus/Scribus/scribus/align.h (revision 6) |
+++ Scribus/Scribus/scribus/align.h (nonexistent) |
@@ -1,59 +0,0 @@ |
-#ifndef ALIGN_H |
-#define ALIGN_H |
- |
-#include <qdialog.h> |
-#include <qlayout.h> |
-#include <qbuttongroup.h> |
-#include <qcheckbox.h> |
-#include <qcombobox.h> |
-#include <qlabel.h> |
-#include <qpushbutton.h> |
-#include <qradiobutton.h> |
-#include "mspinbox.h" |
- |
-class Align : public QDialog |
-{ |
- Q_OBJECT |
- |
-public: |
- Align( QWidget* parent, int anz, int ein); |
- ~Align(); |
- |
- QButtonGroup* ButtonGroup1_2; |
- QRadioButton* VerteilenV; |
- QRadioButton* NichtsV; |
- QLabel* TextLabel1_2; |
- QLabel* TextLabelD; |
- QLabel* TextLabelD2; |
- QComboBox* VartV; |
- MSpinBox* AVert; |
- QButtonGroup* ButtonGroup1; |
- QRadioButton* VerteilenH; |
- QRadioButton* NichtsH; |
- MSpinBox* AHor; |
- QComboBox* VartH; |
- QLabel* TextLabel1; |
- QPushButton* OKbutton; |
- QPushButton* ButtonApply; |
- QPushButton* CancelB; |
- QRadioButton* CheckV; |
- QRadioButton* CheckH; |
- int Anzahl; |
- |
-public slots: |
- virtual void DistHoriz(); |
- virtual void DistVert(); |
- virtual void slotApplyDiag(); |
- |
-signals: |
- void ApplyDist(bool, bool, bool, bool, float, float, int, int); |
- |
-protected: |
- QVBoxLayout* AlignLayout; |
- QHBoxLayout* Layout4; |
- QGridLayout* ButtonGroup1Layout; |
- QGridLayout* ButtonGroup1_2Layout; |
- QHBoxLayout* Layout3; |
-}; |
- |
-#endif // ALIGN_H |
/Scribus/Scribus/scribus/align.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/mdup.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/mdup.cpp (revision 6) |
+++ Scribus/Scribus/scribus/mdup.cpp (nonexistent) |
@@ -1,90 +0,0 @@ |
-#include "mdup.h" |
-#include "mdup.moc" |
- |
-#include <qlabel.h> |
-#include <qlineedit.h> |
-#include <qpushbutton.h> |
-#include <qlayout.h> |
-#include <qvariant.h> |
-#include <qtooltip.h> |
-extern QPixmap loadIcon(QString nam); |
-extern float UmReFaktor; |
- |
-Mdup::Mdup( QWidget* parent, float Dx, float Dy, int Ein ) |
- : QDialog( parent, "m", true, 0 ) |
-{ |
- setCaption( tr( "Multiple Duplicate" ) ); |
- setIcon(loadIcon("AppIcon.xpm")); |
- MdupLayout = new QVBoxLayout( this ); |
- MdupLayout->setSpacing( 5 ); |
- MdupLayout->setMargin( 10 ); |
- Layout4 = new QGridLayout; |
- Layout4->setSpacing( 6 ); |
- Layout4->setMargin( 0 ); |
- Ncopies = new QSpinBox( this, "Ncopies" ); |
- Ncopies->setMaxValue( 100 ); |
- Ncopies->setMinValue( 1 ); |
- Ncopies->setValue(1); |
- Layout4->addWidget( Ncopies, 0, 1 ); |
- ShiftV = new MSpinBox( this, 2 ); |
- ShiftV->setMaxValue( 100000 ); |
- ShiftV->setMinValue( -100000 ); |
- ShiftV->setValue(qRound(Dy * 100)); |
- ShiftV->setLineStep(100); |
- Layout4->addWidget( ShiftV, 2, 1 ); |
- ShiftH = new MSpinBox( this, 2 ); |
- ShiftH->setMaxValue( 100000 ); |
- ShiftH->setMinValue( -100000 ); |
- ShiftH->setValue(qRound(Dx * 100)); |
- ShiftH->setLineStep(100); |
- Layout4->addWidget( ShiftH, 1, 1 ); |
- switch (Ein) |
- { |
- case 0: |
- ShiftH->setSuffix( tr( " pt" ) ); |
- ShiftV->setSuffix( tr( " pt" ) ); |
- break; |
- case 1: |
- ShiftH->setSuffix( tr( " mm" ) ); |
- ShiftV->setSuffix( tr( " mm" ) ); |
- break; |
- case 2: |
- ShiftH->setSuffix( tr( " in" ) ); |
- ShiftV->setSuffix( tr( " in" ) ); |
- break; |
- case 3: |
- ShiftH->setSuffix( tr( " p" ) ); |
- ShiftV->setSuffix( tr( " p" ) ); |
- break; |
- } |
- TextLabel1 = new QLabel( this, "TextLabel1" ); |
- TextLabel1->setText( tr( "Number of Copies:" ) ); |
- Layout4->addWidget( TextLabel1, 0, 0 ); |
- TextLabel1_2 = new QLabel( this, "TextLabel1_2" ); |
- TextLabel1_2->setText( tr( "Horizontal Shift:" ) ); |
- Layout4->addWidget( TextLabel1_2, 1, 0 ); |
- TextLabel1_2_2 = new QLabel( this, "TextLabel1_2_2" ); |
- TextLabel1_2_2->setText( tr( "Vertical Shift:" ) ); |
- Layout4->addWidget( TextLabel1_2_2, 2, 0 ); |
- MdupLayout->addLayout( Layout4 ); |
- Layout3 = new QHBoxLayout; |
- Layout3->setSpacing( 6 ); |
- Layout3->setMargin( 0 ); |
- PushButton12 = new QPushButton( this, "PushButton12" ); |
- PushButton12->setText( tr( "OK" ) ); |
- PushButton12->setDefault( true ); |
- Layout3->addWidget( PushButton12 ); |
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- Layout3->addItem( spacer ); |
- PushButton13 = new QPushButton( this, "PushButton13" ); |
- PushButton13->setText( tr( "Cancel" ) ); |
- Layout3->addWidget( PushButton13 ); |
- MdupLayout->addLayout( Layout3 ); |
- setMaximumSize(sizeHint()); |
- |
- // signals and slots connections |
- connect( PushButton12, SIGNAL( clicked() ), this, SLOT( accept() ) ); |
- connect( PushButton13, SIGNAL( clicked() ), this, SLOT( reject() ) ); |
-} |
- |
- |
/Scribus/Scribus/scribus/mdup.cpp |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/colorchart.h |
=================================================================== |
--- Scribus/Scribus/scribus/colorchart.h (revision 6) |
+++ Scribus/Scribus/scribus/colorchart.h (nonexistent) |
@@ -1,49 +0,0 @@ |
-/*************************************************************************** |
- colorchart.h - description |
- ------------------- |
- begin : Sat Sep 15 2001 |
- copyright : (C) 2001 by Franz Schmid |
- email : Franz.Schmid@altmuehlnet.de |
- ***************************************************************************/ |
- |
-/*************************************************************************** |
- * * |
- * This program is free software; you can redistribute it and/or modify * |
- * it under the terms of the GNU General Public License as published by * |
- * the Free Software Foundation; either version 2 of the License, or * |
- * (at your option) any later version. * |
- * * |
- ***************************************************************************/ |
- |
-#ifndef COLORCHART_H |
-#define COLORCHART_H |
- |
-#include <qlabel.h> |
-#include <qpixmap.h> |
- |
-/** |
- *@author Franz Schmid |
- */ |
- |
-class ColorChart : public QLabel { |
- |
-Q_OBJECT |
- |
-public: |
- ColorChart(QWidget *parent); |
- ~ColorChart() {}; |
- void mouseMoveEvent(QMouseEvent *m); |
- void mousePressEvent(QMouseEvent *m); |
- void mouseReleaseEvent(QMouseEvent *m); |
- void paintEvent(QPaintEvent *e); |
- void drawMark(int x, int y); |
- void setMark(int h, int s); |
- void drawPalette(int val); |
- int Xp; |
- int Yp; |
- QPixmap pmx; |
-signals: |
- void ColorVal(int h, int s, bool ende); |
-}; |
- |
-#endif |
/Scribus/Scribus/scribus/colorchart.h |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/kimageeffect.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/kimageeffect.cpp (revision 6) |
+++ Scribus/Scribus/scribus/kimageeffect.cpp (nonexistent) |
@@ -1,3841 +0,0 @@ |
-/* This file is part of the KDE libraries |
- Copyright (C) 1998, 1999, 2001, 2002 Daniel M. Duley <mosfet@kde.org> |
- (C) 1998, 1999 Christian Tibirna <ctibirna@total.net> |
- (C) 1998, 1999 Dirk A. Mueller <mueller@kde.org> |
- (C) 2000 Josef Weidendorfer <weidendo@in.tum.de> |
- |
-Redistribution and use in source and binary forms, with or without |
-modification, are permitted provided that the following conditions |
-are met: |
- |
-1. Redistributions of source code must retain the above copyright |
- notice, this list of conditions and the following disclaimer. |
-2. Redistributions in binary form must reproduce the above copyright |
- notice, this list of conditions and the following disclaimer in the |
- documentation and/or other materials provided with the distribution. |
- |
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
- |
-*/ |
- |
-// $Id$ |
- |
-#include <cmath> |
- |
-#include <qimage.h> |
-#include <cstdlib> |
-#include <iostream> |
- |
-#include "kimageeffect.h" |
- |
-#define MaxRGB 255L |
-#define DegreesToRadians(x) ((x)*M_PI/180.0) |
- |
-using namespace std; |
- |
-inline unsigned int intensityValue(unsigned int color) |
-{ |
- return((unsigned int)((0.299*qRed(color) + |
- 0.587*qGreen(color) + |
- 0.1140000000000001*qBlue(color)))); |
-} |
- |
-//====================================================================== |
-// |
-// Gradient effects |
-// |
-//====================================================================== |
- |
-QImage KImageEffect::gradient(const QSize &size, const QColor &ca, |
- const QColor &cb, GradientType eff, int ncols) |
-{ |
- int rDiff, gDiff, bDiff; |
- int rca, gca, bca, rcb, gcb, bcb; |
- |
- QImage image(size, 32); |
- |
- if (size.width() == 0 || size.height() == 0) { |
-#ifndef NDEBUG |
- cerr << "WARNING: KImageEffect::gradient: invalid image" << endl; |
-#endif |
- return image; |
- } |
- |
- register int x, y; |
- |
- rDiff = (rcb = cb.red()) - (rca = ca.red()); |
- gDiff = (gcb = cb.green()) - (gca = ca.green()); |
- bDiff = (bcb = cb.blue()) - (bca = ca.blue()); |
- |
- if( eff == VerticalGradient || eff == HorizontalGradient ){ |
- |
- uint *p; |
- uint rgb; |
- |
- register int rl = rca << 16; |
- register int gl = gca << 16; |
- register int bl = bca << 16; |
- |
- if( eff == VerticalGradient ) { |
- |
- int rcdelta = ((1<<16) / size.height()) * rDiff; |
- int gcdelta = ((1<<16) / size.height()) * gDiff; |
- int bcdelta = ((1<<16) / size.height()) * bDiff; |
- |
- for ( y = 0; y < size.height(); y++ ) { |
- p = (uint *) image.scanLine(y); |
- |
- rl += rcdelta; |
- gl += gcdelta; |
- bl += bcdelta; |
- |
- rgb = qRgb( (rl>>16), (gl>>16), (bl>>16) ); |
- |
- for( x = 0; x < size.width(); x++ ) { |
- *p = rgb; |
- p++; |
- } |
- } |
- |
- } |
- else { // must be HorizontalGradient |
- |
- unsigned int *o_src = (unsigned int *)image.scanLine(0); |
- unsigned int *src = o_src; |
- |
- int rcdelta = ((1<<16) / size.width()) * rDiff; |
- int gcdelta = ((1<<16) / size.width()) * gDiff; |
- int bcdelta = ((1<<16) / size.width()) * bDiff; |
- |
- for( x = 0; x < size.width(); x++) { |
- |
- rl += rcdelta; |
- gl += gcdelta; |
- bl += bcdelta; |
- |
- *src++ = qRgb( (rl>>16), (gl>>16), (bl>>16)); |
- } |
- |
- src = o_src; |
- |
- // Believe it or not, manually copying in a for loop is faster |
- // than calling memcpy for each scanline (on the order of ms...). |
- // I think this is due to the function call overhead (mosfet). |
- |
- for (y = 1; y < size.height(); ++y) { |
- |
- p = (unsigned int *)image.scanLine(y); |
- src = o_src; |
- for(x=0; x < size.width(); ++x) |
- *p++ = *src++; |
- } |
- } |
- } |
- |
- else { |
- |
- float rfd, gfd, bfd; |
- float rd = rca, gd = gca, bd = bca; |
- |
- unsigned char *xtable[3]; |
- unsigned char *ytable[3]; |
- |
- unsigned int w = size.width(), h = size.height(); |
- xtable[0] = new unsigned char[w]; |
- xtable[1] = new unsigned char[w]; |
- xtable[2] = new unsigned char[w]; |
- ytable[0] = new unsigned char[h]; |
- ytable[1] = new unsigned char[h]; |
- ytable[2] = new unsigned char[h]; |
- w*=2, h*=2; |
- |
- if ( eff == DiagonalGradient || eff == CrossDiagonalGradient) { |
- // Diagonal dgradient code inspired by BlackBox (mosfet) |
- // BlackBox dgradient is (C) Brad Hughes, <bhughes@tcac.net> and |
- // Mike Cole <mike@mydot.com>. |
- |
- rfd = (float)rDiff/w; |
- gfd = (float)gDiff/w; |
- bfd = (float)bDiff/w; |
- |
- int dir; |
- for (x = 0; x < size.width(); x++, rd+=rfd, gd+=gfd, bd+=bfd) { |
- dir = eff == DiagonalGradient? x : size.width() - x - 1; |
- xtable[0][dir] = (unsigned char) rd; |
- xtable[1][dir] = (unsigned char) gd; |
- xtable[2][dir] = (unsigned char) bd; |
- } |
- rfd = (float)rDiff/h; |
- gfd = (float)gDiff/h; |
- bfd = (float)bDiff/h; |
- rd = gd = bd = 0; |
- for (y = 0; y < size.height(); y++, rd+=rfd, gd+=gfd, bd+=bfd) { |
- ytable[0][y] = (unsigned char) rd; |
- ytable[1][y] = (unsigned char) gd; |
- ytable[2][y] = (unsigned char) bd; |
- } |
- |
- for (y = 0; y < size.height(); y++) { |
- unsigned int *scanline = (unsigned int *)image.scanLine(y); |
- for (x = 0; x < size.width(); x++) { |
- scanline[x] = qRgb(xtable[0][x] + ytable[0][y], |
- xtable[1][x] + ytable[1][y], |
- xtable[2][x] + ytable[2][y]); |
- } |
- } |
- } |
- |
- else if (eff == RectangleGradient || |
- eff == PyramidGradient || |
- eff == PipeCrossGradient || |
- eff == EllipticGradient) |
- { |
- int rSign = rDiff>0? 1: -1; |
- int gSign = gDiff>0? 1: -1; |
- int bSign = bDiff>0? 1: -1; |
- |
- rfd = (float)rDiff / size.width(); |
- gfd = (float)gDiff / size.width(); |
- bfd = (float)bDiff / size.width(); |
- |
- rd = (float)rDiff/2; |
- gd = (float)gDiff/2; |
- bd = (float)bDiff/2; |
- |
- for (x = 0; x < size.width(); x++, rd-=rfd, gd-=gfd, bd-=bfd) |
- { |
- xtable[0][x] = (unsigned char) abs((int)rd); |
- xtable[1][x] = (unsigned char) abs((int)gd); |
- xtable[2][x] = (unsigned char) abs((int)bd); |
- } |
- |
- rfd = (float)rDiff/size.height(); |
- gfd = (float)gDiff/size.height(); |
- bfd = (float)bDiff/size.height(); |
- |
- rd = (float)rDiff/2; |
- gd = (float)gDiff/2; |
- bd = (float)bDiff/2; |
- |
- for (y = 0; y < size.height(); y++, rd-=rfd, gd-=gfd, bd-=bfd) |
- { |
- ytable[0][y] = (unsigned char) abs((int)rd); |
- ytable[1][y] = (unsigned char) abs((int)gd); |
- ytable[2][y] = (unsigned char) abs((int)bd); |
- } |
- unsigned int rgb; |
- int h = (size.height()+1)>>1; |
- for (y = 0; y < h; y++) { |
- unsigned int *sl1 = (unsigned int *)image.scanLine(y); |
- unsigned int *sl2 = (unsigned int *)image.scanLine(QMAX(size.height()-y-1, y)); |
- |
- int w = (size.width()+1)>>1; |
- int x2 = size.width()-1; |
- |
- for (x = 0; x < w; x++, x2--) { |
- rgb = 0; |
- if (eff == PyramidGradient) { |
- rgb = qRgb(rcb-rSign*(xtable[0][x]+ytable[0][y]), |
- gcb-gSign*(xtable[1][x]+ytable[1][y]), |
- bcb-bSign*(xtable[2][x]+ytable[2][y])); |
- } |
- if (eff == RectangleGradient) { |
- rgb = qRgb(rcb - rSign * |
- QMAX(xtable[0][x], ytable[0][y]) * 2, |
- gcb - gSign * |
- QMAX(xtable[1][x], ytable[1][y]) * 2, |
- bcb - bSign * |
- QMAX(xtable[2][x], ytable[2][y]) * 2); |
- } |
- if (eff == PipeCrossGradient) { |
- rgb = qRgb(rcb - rSign * |
- QMIN(xtable[0][x], ytable[0][y]) * 2, |
- gcb - gSign * |
- QMIN(xtable[1][x], ytable[1][y]) * 2, |
- bcb - bSign * |
- QMIN(xtable[2][x], ytable[2][y]) * 2); |
- } |
- if (eff == EllipticGradient) { |
- rgb = qRgb(rcb - rSign * |
- (int)sqrt((xtable[0][x]*xtable[0][x] + |
- ytable[0][y]*ytable[0][y])*2.0), |
- gcb - gSign * |
- (int)sqrt((xtable[1][x]*xtable[1][x] + |
- ytable[1][y]*ytable[1][y])*2.0), |
- bcb - bSign * |
- (int)sqrt((xtable[2][x]*xtable[2][x] + |
- ytable[2][y]*ytable[2][y])*2.0)); |
- } |
- |
- sl1[x] = sl2[x] = rgb; |
- sl1[x2] = sl2[x2] = rgb; |
- } |
- } |
- } |
- |
- delete [] xtable[0]; |
- delete [] xtable[1]; |
- delete [] xtable[2]; |
- delete [] ytable[0]; |
- delete [] ytable[1]; |
- delete [] ytable[2]; |
- } |
- |
- // dither if necessary |
- if (ncols && (QPixmap::defaultDepth() < 15 )) { |
- if ( ncols < 2 || ncols > 256 ) |
- ncols = 3; |
- QColor *dPal = new QColor[ncols]; |
- for (int i=0; i<ncols; i++) { |
- dPal[i].setRgb ( rca + rDiff * i / ( ncols - 1 ), |
- gca + gDiff * i / ( ncols - 1 ), |
- bca + bDiff * i / ( ncols - 1 ) ); |
- } |
- dither(image, dPal, ncols); |
- delete [] dPal; |
- } |
- |
- return image; |
-} |
- |
- |
-// ----------------------------------------------------------------------------- |
- |
-//CT this was (before Dirk A. Mueller's speedup changes) |
-// merely the same code as in the above method, but it's supposedly |
-// way less performant since it introduces a lot of supplementary tests |
-// and simple math operations for the calculus of the balance. |
-// (surprizingly, it isn't less performant, in the contrary :-) |
-// Yes, I could have merged them, but then the excellent performance of |
-// the balanced code would suffer with no other gain than a mere |
-// source code and byte code size economy. |
- |
-QImage KImageEffect::unbalancedGradient(const QSize &size, const QColor &ca, |
- const QColor &cb, GradientType eff, int xfactor, int yfactor, |
- int ncols) |
-{ |
- int dir; // general parameter used for direction switches |
- |
- bool _xanti = false , _yanti = false; |
- |
- if (xfactor < 0) _xanti = true; // negative on X direction |
- if (yfactor < 0) _yanti = true; // negative on Y direction |
- |
- xfactor = abs(xfactor); |
- yfactor = abs(yfactor); |
- |
- if (!xfactor) xfactor = 1; |
- if (!yfactor) yfactor = 1; |
- |
- if (xfactor > 200 ) xfactor = 200; |
- if (yfactor > 200 ) yfactor = 200; |
- |
- |
- // float xbal = xfactor/5000.; |
- // float ybal = yfactor/5000.; |
- float xbal = xfactor/30./size.width(); |
- float ybal = yfactor/30./size.height(); |
- float rat; |
- |
- int rDiff, gDiff, bDiff; |
- int rca, gca, bca, rcb, gcb, bcb; |
- |
- QImage image(size, 32); |
- |
- if (size.width() == 0 || size.height() == 0) { |
-#ifndef NDEBUG |
- cerr << "WARNING: KImageEffect::unbalancedGradient : invalid image\n"; |
-#endif |
- return image; |
- } |
- |
- register int x, y; |
- unsigned int *scanline; |
- |
- rDiff = (rcb = cb.red()) - (rca = ca.red()); |
- gDiff = (gcb = cb.green()) - (gca = ca.green()); |
- bDiff = (bcb = cb.blue()) - (bca = ca.blue()); |
- |
- if( eff == VerticalGradient || eff == HorizontalGradient){ |
- QColor cRow; |
- |
- uint *p; |
- uint rgbRow; |
- |
- if( eff == VerticalGradient) { |
- for ( y = 0; y < size.height(); y++ ) { |
- dir = _yanti ? y : size.height() - 1 - y; |
- p = (uint *) image.scanLine(dir); |
- rat = 1 - exp( - (float)y * ybal ); |
- |
- cRow.setRgb( rcb - (int) ( rDiff * rat ), |
- gcb - (int) ( gDiff * rat ), |
- bcb - (int) ( bDiff * rat ) ); |
- |
- rgbRow = cRow.rgb(); |
- |
- for( x = 0; x < size.width(); x++ ) { |
- *p = rgbRow; |
- p++; |
- } |
- } |
- } |
- else { |
- |
- unsigned int *src = (unsigned int *)image.scanLine(0); |
- for(x = 0; x < size.width(); x++ ) |
- { |
- dir = _xanti ? x : size.width() - 1 - x; |
- rat = 1 - exp( - (float)x * xbal ); |
- |
- src[dir] = qRgb(rcb - (int) ( rDiff * rat ), |
- gcb - (int) ( gDiff * rat ), |
- bcb - (int) ( bDiff * rat )); |
- } |
- |
- // Believe it or not, manually copying in a for loop is faster |
- // than calling memcpy for each scanline (on the order of ms...). |
- // I think this is due to the function call overhead (mosfet). |
- |
- for(y = 1; y < size.height(); ++y) |
- { |
- scanline = (unsigned int *)image.scanLine(y); |
- for(x=0; x < size.width(); ++x) |
- scanline[x] = src[x]; |
- } |
- } |
- } |
- |
- else { |
- int w=size.width(), h=size.height(); |
- |
- unsigned char *xtable[3]; |
- unsigned char *ytable[3]; |
- xtable[0] = new unsigned char[w]; |
- xtable[1] = new unsigned char[w]; |
- xtable[2] = new unsigned char[w]; |
- ytable[0] = new unsigned char[h]; |
- ytable[1] = new unsigned char[h]; |
- ytable[2] = new unsigned char[h]; |
- |
- if ( eff == DiagonalGradient || eff == CrossDiagonalGradient) |
- { |
- for (x = 0; x < w; x++) { |
- dir = _xanti ? x : w - 1 - x; |
- rat = 1 - exp( - (float)x * xbal ); |
- |
- xtable[0][dir] = (unsigned char) ( rDiff/2 * rat ); |
- xtable[1][dir] = (unsigned char) ( gDiff/2 * rat ); |
- xtable[2][dir] = (unsigned char) ( bDiff/2 * rat ); |
- } |
- |
- for (y = 0; y < h; y++) { |
- dir = _yanti ? y : h - 1 - y; |
- rat = 1 - exp( - (float)y * ybal ); |
- |
- ytable[0][dir] = (unsigned char) ( rDiff/2 * rat ); |
- ytable[1][dir] = (unsigned char) ( gDiff/2 * rat ); |
- ytable[2][dir] = (unsigned char) ( bDiff/2 * rat ); |
- } |
- |
- for (y = 0; y < h; y++) { |
- unsigned int *scanline = (unsigned int *)image.scanLine(y); |
- for (x = 0; x < w; x++) { |
- scanline[x] = qRgb(rcb - (xtable[0][x] + ytable[0][y]), |
- gcb - (xtable[1][x] + ytable[1][y]), |
- bcb - (xtable[2][x] + ytable[2][y])); |
- } |
- } |
- } |
- |
- else if (eff == RectangleGradient || |
- eff == PyramidGradient || |
- eff == PipeCrossGradient || |
- eff == EllipticGradient) |
- { |
- int rSign = rDiff>0? 1: -1; |
- int gSign = gDiff>0? 1: -1; |
- int bSign = bDiff>0? 1: -1; |
- |
- for (x = 0; x < w; x++) |
- { |
- dir = _xanti ? x : w - 1 - x; |
- rat = 1 - exp( - (float)x * xbal ); |
- |
- xtable[0][dir] = (unsigned char) abs((int)(rDiff*(0.5-rat))); |
- xtable[1][dir] = (unsigned char) abs((int)(gDiff*(0.5-rat))); |
- xtable[2][dir] = (unsigned char) abs((int)(bDiff*(0.5-rat))); |
- } |
- |
- for (y = 0; y < h; y++) |
- { |
- dir = _yanti ? y : h - 1 - y; |
- |
- rat = 1 - exp( - (float)y * ybal ); |
- |
- ytable[0][dir] = (unsigned char) abs((int)(rDiff*(0.5-rat))); |
- ytable[1][dir] = (unsigned char) abs((int)(gDiff*(0.5-rat))); |
- ytable[2][dir] = (unsigned char) abs((int)(bDiff*(0.5-rat))); |
- } |
- |
- for (y = 0; y < h; y++) { |
- unsigned int *scanline = (unsigned int *)image.scanLine(y); |
- for (x = 0; x < w; x++) { |
- if (eff == PyramidGradient) |
- { |
- scanline[x] = qRgb(rcb-rSign*(xtable[0][x]+ytable[0][y]), |
- gcb-gSign*(xtable[1][x]+ytable[1][y]), |
- bcb-bSign*(xtable[2][x]+ytable[2][y])); |
- } |
- if (eff == RectangleGradient) |
- { |
- scanline[x] = qRgb(rcb - rSign * |
- QMAX(xtable[0][x], ytable[0][y]) * 2, |
- gcb - gSign * |
- QMAX(xtable[1][x], ytable[1][y]) * 2, |
- bcb - bSign * |
- QMAX(xtable[2][x], ytable[2][y]) * 2); |
- } |
- if (eff == PipeCrossGradient) |
- { |
- scanline[x] = qRgb(rcb - rSign * |
- QMIN(xtable[0][x], ytable[0][y]) * 2, |
- gcb - gSign * |
- QMIN(xtable[1][x], ytable[1][y]) * 2, |
- bcb - bSign * |
- QMIN(xtable[2][x], ytable[2][y]) * 2); |
- } |
- if (eff == EllipticGradient) |
- { |
- scanline[x] = qRgb(rcb - rSign * |
- (int)sqrt((xtable[0][x]*xtable[0][x] + |
- ytable[0][y]*ytable[0][y])*2.0), |
- gcb - gSign * |
- (int)sqrt((xtable[1][x]*xtable[1][x] + |
- ytable[1][y]*ytable[1][y])*2.0), |
- bcb - bSign * |
- (int)sqrt((xtable[2][x]*xtable[2][x] + |
- ytable[2][y]*ytable[2][y])*2.0)); |
- } |
- } |
- } |
- } |
- |
- if (ncols && (QPixmap::defaultDepth() < 15 )) { |
- if ( ncols < 2 || ncols > 256 ) |
- ncols = 3; |
- QColor *dPal = new QColor[ncols]; |
- for (int i=0; i<ncols; i++) { |
- dPal[i].setRgb ( rca + rDiff * i / ( ncols - 1 ), |
- gca + gDiff * i / ( ncols - 1 ), |
- bca + bDiff * i / ( ncols - 1 ) ); |
- } |
- dither(image, dPal, ncols); |
- delete [] dPal; |
- } |
- |
- delete [] xtable[0]; |
- delete [] xtable[1]; |
- delete [] xtable[2]; |
- delete [] ytable[0]; |
- delete [] ytable[1]; |
- delete [] ytable[2]; |
- |
- } |
- |
- return image; |
-} |
- |
- |
-//====================================================================== |
-// |
-// Intensity effects |
-// |
-//====================================================================== |
- |
- |
-/* This builds a 256 byte unsigned char lookup table with all |
- * the possible percent values prior to applying the effect, then uses |
- * integer math for the pixels. For any image larger than 9x9 this will be |
- * less expensive than doing a float operation on the 3 color components of |
- * each pixel. (mosfet) |
- */ |
- |
-QImage& KImageEffect::intensity(QImage &image, float percent) |
-{ |
- if (image.width() == 0 || image.height() == 0) { |
-#ifndef NDEBUG |
- cerr << "WARNING: KImageEffect::intensity : invalid image\n"; |
-#endif |
- return image; |
- } |
- |
- int segColors = image.depth() > 8 ? 256 : image.numColors(); |
- unsigned char *segTbl = new unsigned char[segColors]; |
- int pixels = image.depth() > 8 ? image.width()*image.height() : |
- image.numColors(); |
- unsigned int *data = image.depth() > 8 ? (unsigned int *)image.bits() : |
- (unsigned int *)image.colorTable(); |
- |
- bool brighten = (percent >= 0); |
- if(percent < 0) |
- percent = -percent; |
- |
- if(brighten){ // keep overflow check out of loops |
- for(int i=0; i < segColors; ++i){ |
- int tmp = (int)(i*percent); |
- if(tmp > 255) |
- tmp = 255; |
- segTbl[i] = tmp; |
- } |
- } |
- else{ |
- for(int i=0; i < segColors; ++i){ |
- int tmp = (int)(i*percent); |
- if(tmp < 0) |
- tmp = 0; |
- segTbl[i] = tmp; |
- } |
- } |
- |
- if(brighten){ // same here |
- for(int i=0; i < pixels; ++i){ |
- int r = qRed(data[i]); |
- int g = qGreen(data[i]); |
- int b = qBlue(data[i]); |
- int a = qAlpha(data[i]); |
- r = r + segTbl[r] > 255 ? 255 : r + segTbl[r]; |
- g = g + segTbl[g] > 255 ? 255 : g + segTbl[g]; |
- b = b + segTbl[b] > 255 ? 255 : b + segTbl[b]; |
- data[i] = qRgba(r, g, b,a); |
- } |
- } |
- else{ |
- for(int i=0; i < pixels; ++i){ |
- int r = qRed(data[i]); |
- int g = qGreen(data[i]); |
- int b = qBlue(data[i]); |
- int a = qAlpha(data[i]); |
- r = r - segTbl[r] < 0 ? 0 : r - segTbl[r]; |
- g = g - segTbl[g] < 0 ? 0 : g - segTbl[g]; |
- b = b - segTbl[b] < 0 ? 0 : b - segTbl[b]; |
- data[i] = qRgba(r, g, b, a); |
- } |
- } |
- delete [] segTbl; |
- |
- return image; |
-} |
- |
-QImage& KImageEffect::channelIntensity(QImage &image, float percent, |
- RGBComponent channel) |
-{ |
- if (image.width() == 0 || image.height() == 0) { |
-#ifndef NDEBUG |
- cerr << "WARNING: KImageEffect::channelIntensity : invalid image\n"; |
-#endif |
- return image; |
- } |
- |
- int segColors = image.depth() > 8 ? 256 : image.numColors(); |
- unsigned char *segTbl = new unsigned char[segColors]; |
- int pixels = image.depth() > 8 ? image.width()*image.height() : |
- image.numColors(); |
- unsigned int *data = image.depth() > 8 ? (unsigned int *)image.bits() : |
- (unsigned int *)image.colorTable(); |
- bool brighten = (percent >= 0); |
- if(percent < 0) |
- percent = -percent; |
- |
- if(brighten){ // keep overflow check out of loops |
- for(int i=0; i < segColors; ++i){ |
- int tmp = (int)(i*percent); |
- if(tmp > 255) |
- tmp = 255; |
- segTbl[i] = tmp; |
- } |
- } |
- else{ |
- for(int i=0; i < segColors; ++i){ |
- int tmp = (int)(i*percent); |
- if(tmp < 0) |
- tmp = 0; |
- segTbl[i] = tmp; |
- } |
- } |
- |
- if(brighten){ // same here |
- if(channel == Red){ // and here ;-) |
- for(int i=0; i < pixels; ++i){ |
- int c = qRed(data[i]); |
- c = c + segTbl[c] > 255 ? 255 : c + segTbl[c]; |
- data[i] = qRgba(c, qGreen(data[i]), qBlue(data[i]), qAlpha(data[i])); |
- } |
- } |
- if(channel == Green){ |
- for(int i=0; i < pixels; ++i){ |
- int c = qGreen(data[i]); |
- c = c + segTbl[c] > 255 ? 255 : c + segTbl[c]; |
- data[i] = qRgba(qRed(data[i]), c, qBlue(data[i]), qAlpha(data[i])); |
- } |
- } |
- else{ |
- for(int i=0; i < pixels; ++i){ |
- int c = qBlue(data[i]); |
- c = c + segTbl[c] > 255 ? 255 : c + segTbl[c]; |
- data[i] = qRgba(qRed(data[i]), qGreen(data[i]), c, qAlpha(data[i])); |
- } |
- } |
- |
- } |
- else{ |
- if(channel == Red){ |
- for(int i=0; i < pixels; ++i){ |
- int c = qRed(data[i]); |
- c = c - segTbl[c] < 0 ? 0 : c - segTbl[c]; |
- data[i] = qRgba(c, qGreen(data[i]), qBlue(data[i]), qAlpha(data[i])); |
- } |
- } |
- if(channel == Green){ |
- for(int i=0; i < pixels; ++i){ |
- int c = qGreen(data[i]); |
- c = c - segTbl[c] < 0 ? 0 : c - segTbl[c]; |
- data[i] = qRgba(qRed(data[i]), c, qBlue(data[i]), qAlpha(data[i])); |
- } |
- } |
- else{ |
- for(int i=0; i < pixels; ++i){ |
- int c = qBlue(data[i]); |
- c = c - segTbl[c] < 0 ? 0 : c - segTbl[c]; |
- data[i] = qRgba(qRed(data[i]), qGreen(data[i]), c, qAlpha(data[i])); |
- } |
- } |
- } |
- delete [] segTbl; |
- |
- return image; |
-} |
- |
-// Modulate an image with an RBG channel of another image |
-// |
-QImage& KImageEffect::modulate(QImage &image, QImage &modImage, bool reverse, |
- ModulationType type, int factor, RGBComponent channel) |
-{ |
- if (image.width() == 0 || image.height() == 0 || |
- modImage.width() == 0 || modImage.height() == 0) { |
-#ifndef NDEBUG |
- cerr << "WARNING: KImageEffect::modulate : invalid image\n"; |
-#endif |
- return image; |
- } |
- |
- int r, g, b, h, s, v, a; |
- QColor clr; |
- int mod=0; |
- unsigned int x1, x2, y1, y2; |
- register int x, y; |
- |
- // for image, we handle only depth 32 |
- if (image.depth()<32) image = image.convertDepth(32); |
- |
- // for modImage, we handle depth 8 and 32 |
- if (modImage.depth()<8) modImage = modImage.convertDepth(8); |
- |
- unsigned int *colorTable2 = (modImage.depth()==8) ? |
- modImage.colorTable():0; |
- unsigned int *data1, *data2; |
- unsigned char *data2b; |
- unsigned int color1, color2; |
- |
- x1 = image.width(); y1 = image.height(); |
- x2 = modImage.width(); y2 = modImage.height(); |
- |
- for (y = 0; y < (int)y1; y++) { |
- data1 = (unsigned int *) image.scanLine(y); |
- data2 = (unsigned int *) modImage.scanLine( y%y2 ); |
- data2b = (unsigned char *) modImage.scanLine( y%y2 ); |
- |
- x=0; |
- while(x < (int)x1) { |
- color2 = (colorTable2) ? colorTable2[*data2b] : *data2; |
- if (reverse) { |
- color1 = color2; |
- color2 = *data1; |
- } |
- else |
- color1 = *data1; |
- |
- if (type == Intensity || type == Contrast) { |
- r = qRed(color1); |
- g = qGreen(color1); |
- b = qBlue(color1); |
- if (channel != All) { |
- mod = (channel == Red) ? qRed(color2) : |
- (channel == Green) ? qGreen(color2) : |
- (channel == Blue) ? qBlue(color2) : |
- (channel == Gray) ? qGray(color2) : 0; |
- mod = mod*factor/50; |
- } |
- |
- if (type == Intensity) { |
- if (channel == All) { |
- r += r * factor/50 * qRed(color2)/256; |
- g += g * factor/50 * qGreen(color2)/256; |
- b += b * factor/50 * qBlue(color2)/256; |
- } |
- else { |
- r += r * mod/256; |
- g += g * mod/256; |
- b += b * mod/256; |
- } |
- } |
- else { // Contrast |
- if (channel == All) { |
- r += (r-128) * factor/50 * qRed(color2)/128; |
- g += (g-128) * factor/50 * qGreen(color2)/128; |
- b += (b-128) * factor/50 * qBlue(color2)/128; |
- } |
- else { |
- r += (r-128) * mod/128; |
- g += (g-128) * mod/128; |
- b += (b-128) * mod/128; |
- } |
- } |
- |
- if (r<0) r=0; if (r>255) r=255; |
- if (g<0) g=0; if (g>255) g=255; |
- if (b<0) b=0; if (b>255) b=255; |
- a = qAlpha(*data1); |
- *data1 = qRgba(r, g, b, a); |
- } |
- else if (type == Saturation || type == HueShift) { |
- clr.setRgb(color1); |
- clr.hsv(&h, &s, &v); |
- mod = (channel == Red) ? qRed(color2) : |
- (channel == Green) ? qGreen(color2) : |
- (channel == Blue) ? qBlue(color2) : |
- (channel == Gray) ? qGray(color2) : 0; |
- mod = mod*factor/50; |
- |
- if (type == Saturation) { |
- s -= s * mod/256; |
- if (s<0) s=0; if (s>255) s=255; |
- } |
- else { // HueShift |
- h += mod; |
- while(h<0) h+=360; |
- h %= 360; |
- } |
- |
- clr.setHsv(h, s, v); |
- a = qAlpha(*data1); |
- *data1 = clr.rgb() | ((uint)(a & 0xff) << 24); |
- } |
- data1++; data2++; data2b++; x++; |
- if ( (x%x2) ==0) { data2 -= x2; data2b -= x2; } |
- } |
- } |
- return image; |
-} |
- |
- |
- |
-//====================================================================== |
-// |
-// Blend effects |
-// |
-//====================================================================== |
- |
- |
-// Nice and fast direct pixel manipulation |
-QImage& KImageEffect::blend(const QColor& clr, QImage& dst, float opacity) |
-{ |
- if (dst.width() <= 0 || dst.height() <= 0) |
- return dst; |
- |
- if (opacity < 0.0 || opacity > 1.0) { |
-#ifndef NDEBUG |
- cerr << "WARNING: KImageEffect::blend : invalid opacity. Range [0, 1]\n"; |
-#endif |
- return dst; |
- } |
- |
- int depth = dst.depth(); |
- if (depth != 32) |
- dst = dst.convertDepth(32); |
- |
- int pixels = dst.width() * dst.height(); |
- int rcol, gcol, bcol; |
- clr.rgb(&rcol, &gcol, &bcol); |
- |
-#ifdef WORDS_BIGENDIAN // ARGB (skip alpha) |
- register unsigned char *data = (unsigned char *)dst.bits() + 1; |
-#else // BGRA |
- register unsigned char *data = (unsigned char *)dst.bits(); |
-#endif |
- |
- for (register int i=0; i<pixels; i++) |
- { |
-#ifdef WORDS_BIGENDIAN |
- *(data++) += (unsigned char)((rcol - *data) * opacity); |
- *(data++) += (unsigned char)((gcol - *data) * opacity); |
- *(data++) += (unsigned char)((bcol - *data) * opacity); |
-#else |
- *(data++) += (unsigned char)((bcol - *data) * opacity); |
- *(data++) += (unsigned char)((gcol - *data) * opacity); |
- *(data++) += (unsigned char)((rcol - *data) * opacity); |
-#endif |
- data++; // skip alpha |
- } |
- return dst; |
-} |
- |
-// Nice and fast direct pixel manipulation |
-QImage& KImageEffect::blend(QImage& src, QImage& dst, float opacity) |
-{ |
- if (src.width() <= 0 || src.height() <= 0) |
- return dst; |
- if (dst.width() <= 0 || dst.height() <= 0) |
- return dst; |
- |
- if (src.width() != dst.width() || src.height() != dst.height()) { |
-#ifndef NDEBUG |
- cerr << "WARNING: KImageEffect::blend : src and destination images are not the same size\n"; |
-#endif |
- return dst; |
- } |
- |
- if (opacity < 0.0 || opacity > 1.0) { |
-#ifndef NDEBUG |
- cerr << "WARNING: KImageEffect::blend : invalid opacity. Range [0, 1]\n"; |
-#endif |
- return dst; |
- } |
- |
- if (src.depth() != 32) src = src.convertDepth(32); |
- if (dst.depth() != 32) dst = dst.convertDepth(32); |
- |
- int pixels = src.width() * src.height(); |
-#ifdef WORDS_BIGENDIAN // ARGB (skip alpha) |
- register unsigned char *data1 = (unsigned char *)dst.bits() + 1; |
- register unsigned char *data2 = (unsigned char *)src.bits() + 1; |
-#else // BGRA |
- register unsigned char *data1 = (unsigned char *)dst.bits(); |
- register unsigned char *data2 = (unsigned char *)src.bits(); |
-#endif |
- |
- for (register int i=0; i<pixels; i++) |
- { |
-#ifdef WORDS_BIGENDIAN |
- *(data1++) += (unsigned char)((*(data2++) - *data1) * opacity); |
- *(data1++) += (unsigned char)((*(data2++) - *data1) * opacity); |
- *(data1++) += (unsigned char)((*(data2++) - *data1) * opacity); |
-#else |
- *(data1++) += (unsigned char)((*(data2++) - *data1) * opacity); |
- *(data1++) += (unsigned char)((*(data2++) - *data1) * opacity); |
- *(data1++) += (unsigned char)((*(data2++) - *data1) * opacity); |
-#endif |
- data1++; // skip alpha |
- data2++; |
- } |
- |
- return dst; |
-} |
- |
- |
-QImage& KImageEffect::blend(QImage &image, float initial_intensity, |
- const QColor &bgnd, GradientType eff, |
- bool anti_dir) |
-{ |
- if (image.width() == 0 || image.height() == 0 || image.depth()!=32 ) { |
-#ifndef NDEBUG |
- cerr << "WARNING: KImageEffect::blend : invalid image\n"; |
-#endif |
- return image; |
- } |
- |
- int r_bgnd = bgnd.red(), g_bgnd = bgnd.green(), b_bgnd = bgnd.blue(); |
- int r, g, b; |
- int ind; |
- |
- unsigned int xi, xf, yi, yf; |
- unsigned int a; |
- |
- // check the boundaries of the initial intesity param |
- float unaffected = 1; |
- if (initial_intensity > 1) initial_intensity = 1; |
- if (initial_intensity < -1) initial_intensity = -1; |
- if (initial_intensity < 0) { |
- unaffected = 1. + initial_intensity; |
- initial_intensity = 0; |
- } |
- |
- |
- float intensity = initial_intensity; |
- float var = 1. - initial_intensity; |
- |
- if (anti_dir) { |
- initial_intensity = intensity = 1.; |
- var = -var; |
- } |
- |
- register int x, y; |
- |
- unsigned int *data = (unsigned int *)image.bits(); |
- |
- int image_width = image.width(); //Those can't change |
- int image_height = image.height(); |
- |
- |
- if( eff == VerticalGradient || eff == HorizontalGradient ) { |
- |
- // set the image domain to apply the effect to |
- xi = 0, xf = image_width; |
- yi = 0, yf = image_height; |
- if (eff == VerticalGradient) { |
- if (anti_dir) yf = (int)(image_height * unaffected); |
- else yi = (int)(image_height * (1 - unaffected)); |
- } |
- else { |
- if (anti_dir) xf = (int)(image_width * unaffected); |
- else xi = (int)(image_height * (1 - unaffected)); |
- } |
- |
- var /= (eff == VerticalGradient?yf-yi:xf-xi); |
- |
- int ind_base; |
- for (y = yi; y < (int)yf; y++) { |
- intensity = eff == VerticalGradient? intensity + var : |
- initial_intensity; |
- ind_base = image_width * y ; |
- for (x = xi; x < (int)xf ; x++) { |
- if (eff == HorizontalGradient) intensity += var; |
- ind = x + ind_base; |
- r = qRed (data[ind]) + (int)(intensity * |
- (r_bgnd - qRed (data[ind]))); |
- g = qGreen(data[ind]) + (int)(intensity * |
- (g_bgnd - qGreen(data[ind]))); |
- b = qBlue (data[ind]) + (int)(intensity * |
- (b_bgnd - qBlue (data[ind]))); |
- if (r > 255) r = 255; if (r < 0 ) r = 0; |
- if (g > 255) g = 255; if (g < 0 ) g = 0; |
- if (b > 255) b = 255; if (b < 0 ) b = 0; |
- a = qAlpha(data[ind]); |
- data[ind] = qRgba(r, g, b, a); |
- } |
- } |
- } |
- else if (eff == DiagonalGradient || eff == CrossDiagonalGradient) { |
- float xvar = var / 2 / image_width; // / unaffected; |
- float yvar = var / 2 / image_height; // / unaffected; |
- float tmp; |
- |
- for (x = 0; x < image_width ; x++) { |
- tmp = xvar * (eff == DiagonalGradient? x : image.width()-x-1); |
- ind = x; |
- for (y = 0; y < image_height ; y++) { |
- intensity = initial_intensity + tmp + yvar * y; |
- |
- r = qRed (data[ind]) + (int)(intensity * |
- (r_bgnd - qRed (data[ind]))); |
- g = qGreen(data[ind]) + (int)(intensity * |
- (g_bgnd - qGreen(data[ind]))); |
- b = qBlue (data[ind]) + (int)(intensity * |
- (b_bgnd - qBlue (data[ind]))); |
- if (r > 255) r = 255; if (r < 0 ) r = 0; |
- if (g > 255) g = 255; if (g < 0 ) g = 0; |
- if (b > 255) b = 255; if (b < 0 ) b = 0; |
- a = qAlpha(data[ind]); |
- data[ind] = qRgba(r, g, b, a); |
- |
- ind += image_width; |
- } |
- } |
- } |
- |
- else if (eff == RectangleGradient || eff == EllipticGradient) { |
- float xvar; |
- float yvar; |
- |
- for (x = 0; x < image_width / 2 + image_width % 2; x++) { |
- xvar = var / image_width * (image_width - x*2/unaffected-1); |
- for (y = 0; y < image_height / 2 + image_height % 2; y++) { |
- yvar = var / image_height * (image_height - y*2/unaffected -1); |
- |
- if (eff == RectangleGradient) |
- intensity = initial_intensity + QMAX(xvar, yvar); |
- else |
- intensity = initial_intensity + sqrt(xvar * xvar + yvar * yvar); |
- if (intensity > 1) intensity = 1; |
- if (intensity < 0) intensity = 0; |
- |
- //NW |
- ind = x + image_width * y ; |
- r = qRed (data[ind]) + (int)(intensity * |
- (r_bgnd - qRed (data[ind]))); |
- g = qGreen(data[ind]) + (int)(intensity * |
- (g_bgnd - qGreen(data[ind]))); |
- b = qBlue (data[ind]) + (int)(intensity * |
- (b_bgnd - qBlue (data[ind]))); |
- if (r > 255) r = 255; if (r < 0 ) r = 0; |
- if (g > 255) g = 255; if (g < 0 ) g = 0; |
- if (b > 255) b = 255; if (b < 0 ) b = 0; |
- a = qAlpha(data[ind]); |
- data[ind] = qRgba(r, g, b, a); |
- |
- //NE |
- ind = image_width - x - 1 + image_width * y ; |
- r = qRed (data[ind]) + (int)(intensity * |
- (r_bgnd - qRed (data[ind]))); |
- g = qGreen(data[ind]) + (int)(intensity * |
- (g_bgnd - qGreen(data[ind]))); |
- b = qBlue (data[ind]) + (int)(intensity * |
- (b_bgnd - qBlue (data[ind]))); |
- if (r > 255) r = 255; if (r < 0 ) r = 0; |
- if (g > 255) g = 255; if (g < 0 ) g = 0; |
- if (b > 255) b = 255; if (b < 0 ) b = 0; |
- a = qAlpha(data[ind]); |
- data[ind] = qRgba(r, g, b, a); |
- } |
- } |
- |
- //CT loop is doubled because of stupid central row/column issue. |
- // other solution? |
- for (x = 0; x < image_width / 2; x++) { |
- xvar = var / image_width * (image_width - x*2/unaffected-1); |
- for (y = 0; y < image_height / 2; y++) { |
- yvar = var / image_height * (image_height - y*2/unaffected -1); |
- |
- if (eff == RectangleGradient) |
- intensity = initial_intensity + QMAX(xvar, yvar); |
- else |
- intensity = initial_intensity + sqrt(xvar * xvar + yvar * yvar); |
- if (intensity > 1) intensity = 1; |
- if (intensity < 0) intensity = 0; |
- |
- //SW |
- ind = x + image_width * (image_height - y -1) ; |
- r = qRed (data[ind]) + (int)(intensity * |
- (r_bgnd - qRed (data[ind]))); |
- g = qGreen(data[ind]) + (int)(intensity * |
- (g_bgnd - qGreen(data[ind]))); |
- b = qBlue (data[ind]) + (int)(intensity * |
- (b_bgnd - qBlue (data[ind]))); |
- if (r > 255) r = 255; if (r < 0 ) r = 0; |
- if (g > 255) g = 255; if (g < 0 ) g = 0; |
- if (b > 255) b = 255; if (b < 0 ) b = 0; |
- a = qAlpha(data[ind]); |
- data[ind] = qRgba(r, g, b, a); |
- |
- //SE |
- ind = image_width-x-1 + image_width * (image_height - y - 1) ; |
- r = qRed (data[ind]) + (int)(intensity * |
- (r_bgnd - qRed (data[ind]))); |
- g = qGreen(data[ind]) + (int)(intensity * |
- (g_bgnd - qGreen(data[ind]))); |
- b = qBlue (data[ind]) + (int)(intensity * |
- (b_bgnd - qBlue (data[ind]))); |
- if (r > 255) r = 255; if (r < 0 ) r = 0; |
- if (g > 255) g = 255; if (g < 0 ) g = 0; |
- if (b > 255) b = 255; if (b < 0 ) b = 0; |
- a = qAlpha(data[ind]); |
- data[ind] = qRgba(r, g, b, a); |
- } |
- } |
- } |
-#ifndef NDEBUG |
- else cerr << "KImageEffect::blend effect not implemented" << endl; |
-#endif |
- return image; |
-} |
- |
-// Not very efficient as we create a third big image... |
-// |
-QImage& KImageEffect::blend(QImage &image1, QImage &image2, |
- GradientType gt, int xf, int yf) |
-{ |
- if (image1.width() == 0 || image1.height() == 0 || |
- image2.width() == 0 || image2.height() == 0) |
- return image1; |
- |
- QImage image3; |
- |
- image3 = KImageEffect::unbalancedGradient(image1.size(), |
- QColor(0,0,0), QColor(255,255,255), |
- gt, xf, yf, 0); |
- |
- return blend(image1,image2,image3, Red); // Channel to use is arbitrary |
-} |
- |
-// Blend image2 into image1, using an RBG channel of blendImage |
-// |
-QImage& KImageEffect::blend(QImage &image1, QImage &image2, |
- QImage &blendImage, RGBComponent channel) |
-{ |
- if (image1.width() == 0 || image1.height() == 0 || |
- image2.width() == 0 || image2.height() == 0 || |
- blendImage.width() == 0 || blendImage.height() == 0) { |
-#ifndef NDEBUG |
- cerr << "KImageEffect::blend effect invalid image" << endl; |
-#endif |
- return image1; |
- } |
- |
- int r, g, b; |
- int ind1, ind2, ind3; |
- |
- unsigned int x1, x2, x3, y1, y2, y3; |
- unsigned int a; |
- |
- register int x, y; |
- |
- // for image1 and image2, we only handle depth 32 |
- if (image1.depth()<32) image1 = image1.convertDepth(32); |
- if (image2.depth()<32) image2 = image2.convertDepth(32); |
- |
- // for blendImage, we handle depth 8 and 32 |
- if (blendImage.depth()<8) blendImage = blendImage.convertDepth(8); |
- |
- unsigned int *colorTable3 = (blendImage.depth()==8) ? |
- blendImage.colorTable():0; |
- |
- unsigned int *data1 = (unsigned int *)image1.bits(); |
- unsigned int *data2 = (unsigned int *)image2.bits(); |
- unsigned int *data3 = (unsigned int *)blendImage.bits(); |
- unsigned char *data3b = (unsigned char *)blendImage.bits(); |
- unsigned int color3; |
- |
- x1 = image1.width(); y1 = image1.height(); |
- x2 = image2.width(); y2 = image2.height(); |
- x3 = blendImage.width(); y3 = blendImage.height(); |
- |
- for (y = 0; y < (int)y1; y++) { |
- ind1 = x1*y; |
- ind2 = x2*(y%y2); |
- ind3 = x3*(y%y3); |
- |
- x=0; |
- while(x < (int)x1) { |
- color3 = (colorTable3) ? colorTable3[data3b[ind3]] : data3[ind3]; |
- |
- a = (channel == Red) ? qRed(color3) : |
- (channel == Green) ? qGreen(color3) : |
- (channel == Blue) ? qBlue(color3) : qGray(color3); |
- |
- r = (a*qRed(data1[ind1]) + (256-a)*qRed(data2[ind2]))/256; |
- g = (a*qGreen(data1[ind1]) + (256-a)*qGreen(data2[ind2]))/256; |
- b = (a*qBlue(data1[ind1]) + (256-a)*qBlue(data2[ind2]))/256; |
- |
- a = qAlpha(data1[ind1]); |
- data1[ind1] = qRgba(r, g, b, a); |
- |
- ind1++; ind2++; ind3++; x++; |
- if ( (x%x2) ==0) ind2 -= x2; |
- if ( (x%x3) ==0) ind3 -= x3; |
- } |
- } |
- return image1; |
-} |
- |
- |
-//====================================================================== |
-// |
-// Hash effects |
-// |
-//====================================================================== |
- |
-unsigned int KImageEffect::lHash(unsigned int c) |
-{ |
- unsigned char r = qRed(c), g = qGreen(c), b = qBlue(c), a = qAlpha(c); |
- unsigned char nr, ng, nb; |
- nr =(r >> 1) + (r >> 2); nr = nr > r ? 0 : nr; |
- ng =(g >> 1) + (g >> 2); ng = ng > g ? 0 : ng; |
- nb =(b >> 1) + (b >> 2); nb = nb > b ? 0 : nb; |
- |
- return qRgba(nr, ng, nb, a); |
-} |
- |
- |
-// ----------------------------------------------------------------------------- |
- |
-unsigned int KImageEffect::uHash(unsigned int c) |
-{ |
- unsigned char r = qRed(c), g = qGreen(c), b = qBlue(c), a = qAlpha(c); |
- unsigned char nr, ng, nb; |
- nr = r + (r >> 3); nr = nr < r ? ~0 : nr; |
- ng = g + (g >> 3); ng = ng < g ? ~0 : ng; |
- nb = b + (b >> 3); nb = nb < b ? ~0 : nb; |
- |
- return qRgba(nr, ng, nb, a); |
-} |
- |
- |
-// ----------------------------------------------------------------------------- |
- |
-QImage& KImageEffect::hash(QImage &image, Lighting lite, unsigned int spacing) |
-{ |
- if (image.width() == 0 || image.height() == 0) { |
-#ifndef NDEBUG |
- cerr << "KImageEffect::hash effect invalid image" << endl; |
-#endif |
- return image; |
- } |
- |
- register int x, y; |
- unsigned int *data = (unsigned int *)image.bits(); |
- unsigned int ind; |
- |
- //CT no need to do it if not enough space |
- if ((lite == NorthLite || |
- lite == SouthLite)&& |
- (unsigned)image.height() < 2+spacing) return image; |
- if ((lite == EastLite || |
- lite == WestLite)&& |
- (unsigned)image.height() < 2+spacing) return image; |
- |
- if (lite == NorthLite || lite == SouthLite) { |
- for (y = 0 ; y < image.height(); y = y + 2 + spacing) { |
- for (x = 0; x < image.width(); x++) { |
- ind = x + image.width() * y; |
- data[ind] = lite==NorthLite?uHash(data[ind]):lHash(data[ind]); |
- |
- ind = ind + image.width(); |
- data[ind] = lite==NorthLite?lHash(data[ind]):uHash(data[ind]); |
- } |
- } |
- } |
- |
- else if (lite == EastLite || lite == WestLite) { |
- for (y = 0 ; y < image.height(); y++) { |
- for (x = 0; x < image.width(); x = x + 2 + spacing) { |
- ind = x + image.width() * y; |
- data[ind] = lite==EastLite?uHash(data[ind]):lHash(data[ind]); |
- |
- ind++; |
- data[ind] = lite==EastLite?lHash(data[ind]):uHash(data[ind]); |
- } |
- } |
- } |
- |
- else if (lite == NWLite || lite == SELite) { |
- for (y = 0 ; y < image.height(); y++) { |
- for (x = 0; |
- x < (int)(image.width() - ((y & 1)? 1 : 0) * spacing); |
- x = x + 2 + spacing) { |
- ind = x + image.width() * y + ((y & 1)? 1 : 0); |
- data[ind] = lite==NWLite?uHash(data[ind]):lHash(data[ind]); |
- |
- ind++; |
- data[ind] = lite==NWLite?lHash(data[ind]):uHash(data[ind]); |
- } |
- } |
- } |
- |
- else if (lite == SWLite || lite == NELite) { |
- for (y = 0 ; y < image.height(); y++) { |
- for (x = 0 + ((y & 1)? 1 : 0); x < image.width(); x = x + 2 + spacing) { |
- ind = x + image.width() * y - ((y & 1)? 1 : 0); |
- data[ind] = lite==SWLite?uHash(data[ind]):lHash(data[ind]); |
- |
- ind++; |
- data[ind] = lite==SWLite?lHash(data[ind]):uHash(data[ind]); |
- } |
- } |
- } |
- |
- return image; |
-} |
- |
- |
-//====================================================================== |
-// |
-// Flatten effects |
-// |
-//====================================================================== |
- |
-QImage& KImageEffect::flatten(QImage &img, const QColor &ca, |
- const QColor &cb, int ncols) |
-{ |
- if (img.width() == 0 || img.height() == 0) |
- return img; |
- |
- // a bitmap is easy... |
- if (img.depth() == 1) { |
- img.setColor(0, ca.rgb()); |
- img.setColor(1, cb.rgb()); |
- return img; |
- } |
- |
- int r1 = ca.red(); int r2 = cb.red(); |
- int g1 = ca.green(); int g2 = cb.green(); |
- int b1 = ca.blue(); int b2 = cb.blue(); |
- int min = 0, max = 255; |
- |
- QRgb col; |
- |
- // Get minimum and maximum greylevel. |
- if (img.numColors()) { |
- // pseudocolor |
- for (int i = 0; i < img.numColors(); i++) { |
- col = img.color(i); |
- int mean = (qRed(col) + qGreen(col) + qBlue(col)) / 3; |
- min = QMIN(min, mean); |
- max = QMAX(max, mean); |
- } |
- } else { |
- // truecolor |
- for (int y=0; y < img.height(); y++) |
- for (int x=0; x < img.width(); x++) { |
- col = img.pixel(x, y); |
- int mean = (qRed(col) + qGreen(col) + qBlue(col)) / 3; |
- min = QMIN(min, mean); |
- max = QMAX(max, mean); |
- } |
- } |
- |
- // Conversion factors |
- float sr = ((float) r2 - r1) / (max - min); |
- float sg = ((float) g2 - g1) / (max - min); |
- float sb = ((float) b2 - b1) / (max - min); |
- |
- |
- // Repaint the image |
- if (img.numColors()) { |
- for (int i=0; i < img.numColors(); i++) { |
- col = img.color(i); |
- int mean = (qRed(col) + qGreen(col) + qBlue(col)) / 3; |
- int r = (int) (sr * (mean - min) + r1 + 0.5); |
- int g = (int) (sg * (mean - min) + g1 + 0.5); |
- int b = (int) (sb * (mean - min) + b1 + 0.5); |
- img.setColor(i, qRgba(r, g, b, qAlpha(col))); |
- } |
- } else { |
- for (int y=0; y < img.height(); y++) |
- for (int x=0; x < img.width(); x++) { |
- col = img.pixel(x, y); |
- int mean = (qRed(col) + qGreen(col) + qBlue(col)) / 3; |
- int r = (int) (sr * (mean - min) + r1 + 0.5); |
- int g = (int) (sg * (mean - min) + g1 + 0.5); |
- int b = (int) (sb * (mean - min) + b1 + 0.5); |
- img.setPixel(x, y, qRgba(r, g, b, qAlpha(col))); |
- } |
- } |
- |
- |
- // Dither if necessary |
- if ( (ncols <= 0) || ((img.numColors() != 0) && (img.numColors() <= ncols))) |
- return img; |
- |
- if (ncols == 1) ncols++; |
- if (ncols > 256) ncols = 256; |
- |
- QColor *pal = new QColor[ncols]; |
- sr = ((float) r2 - r1) / (ncols - 1); |
- sg = ((float) g2 - g1) / (ncols - 1); |
- sb = ((float) b2 - b1) / (ncols - 1); |
- |
- for (int i=0; i<ncols; i++) |
- pal[i] = QColor(r1 + int(sr*i), g1 + int(sg*i), b1 + int(sb*i)); |
- |
- dither(img, pal, ncols); |
- |
- delete[] pal; |
- return img; |
-} |
- |
- |
-//====================================================================== |
-// |
-// Fade effects |
-// |
-//====================================================================== |
- |
-QImage& KImageEffect::fade(QImage &img, float val, const QColor &color) |
-{ |
- if (img.width() == 0 || img.height() == 0) |
- return img; |
- |
- // We don't handle bitmaps |
- if (img.depth() == 1) |
- return img; |
- |
- unsigned char tbl[256]; |
- for (int i=0; i<256; i++) |
- tbl[i] = (int) (val * i + 0.5); |
- |
- int red = color.red(); |
- int green = color.green(); |
- int blue = color.blue(); |
- |
- QRgb col; |
- int r, g, b, cr, cg, cb; |
- |
- if (img.depth() <= 8) { |
- // pseudo color |
- for (int i=0; i<img.numColors(); i++) { |
- col = img.color(i); |
- cr = qRed(col); cg = qGreen(col); cb = qBlue(col); |
- if (cr > red) |
- r = cr - tbl[cr - red]; |
- else |
- r = cr + tbl[red - cr]; |
- if (cg > green) |
- g = cg - tbl[cg - green]; |
- else |
- g = cg + tbl[green - cg]; |
- if (cb > blue) |
- b = cb - tbl[cb - blue]; |
- else |
- b = cb + tbl[blue - cb]; |
- img.setColor(i, qRgba(r, g, b, qAlpha(col))); |
- } |
- |
- } else { |
- // truecolor |
- for (int y=0; y<img.height(); y++) { |
- QRgb *data = (QRgb *) img.scanLine(y); |
- for (int x=0; x<img.width(); x++) { |
- col = *data; |
- cr = qRed(col); cg = qGreen(col); cb = qBlue(col); |
- if (cr > red) |
- r = cr - tbl[cr - red]; |
- else |
- r = cr + tbl[red - cr]; |
- if (cg > green) |
- g = cg - tbl[cg - green]; |
- else |
- g = cg + tbl[green - cg]; |
- if (cb > blue) |
- b = cb - tbl[cb - blue]; |
- else |
- b = cb + tbl[blue - cb]; |
- *data++ = qRgba(r, g, b, qAlpha(col)); |
- } |
- } |
- } |
- |
- return img; |
-} |
- |
-//====================================================================== |
-// |
-// Color effects |
-// |
-//====================================================================== |
- |
-// This code is adapted from code (C) Rik Hemsley <rik@kde.org> |
-// |
-// The formula used (r + b + g) /3 is different from the qGray formula |
-// used by Qt. This is because our formula is much much faster. If, |
-// however, it turns out that this is producing sub-optimal images, |
-// then it will have to change (kurt) |
-// |
-// It does produce lower quality grayscale ;-) Use fast == true for the fast |
-// algorithm, false for the higher quality one (mosfet). |
-QImage& KImageEffect::toGray(QImage &img, bool fast) |
-{ |
- if (img.width() == 0 || img.height() == 0) |
- return img; |
- |
- if(fast){ |
- if (img.depth() == 32) { |
- register uchar * r(img.bits()); |
- register uchar * g(img.bits() + 1); |
- register uchar * b(img.bits() + 2); |
- |
- uchar * end(img.bits() + img.numBytes()); |
- |
- while (r != end) { |
- |
- *r = *g = *b = (((*r + *g) >> 1) + *b) >> 1; // (r + b + g) / 3 |
- |
- r += 4; |
- g += 4; |
- b += 4; |
- } |
- } |
- else |
- { |
- for (int i = 0; i < img.numColors(); i++) |
- { |
- register uint r = qRed(img.color(i)); |
- register uint g = qGreen(img.color(i)); |
- register uint b = qBlue(img.color(i)); |
- |
- register uint gray = (((r + g) >> 1) + b) >> 1; |
- img.setColor(i, qRgba(gray, gray, gray, qAlpha(img.color(i)))); |
- } |
- } |
- } |
- else{ |
- int pixels = img.depth() > 8 ? img.width()*img.height() : |
- img.numColors(); |
- unsigned int *data = img.depth() > 8 ? (unsigned int *)img.bits() : |
- (unsigned int *)img.colorTable(); |
- int val, i; |
- for(i=0; i < pixels; ++i){ |
- val = qGray(data[i]); |
- data[i] = qRgba(val, val, val, qAlpha(data[i])); |
- } |
- } |
- return img; |
-} |
- |
-// CT 29Jan2000 - desaturation algorithms |
-QImage& KImageEffect::desaturate(QImage &img, float desat) |
-{ |
- if (img.width() == 0 || img.height() == 0) |
- return img; |
- |
- if (desat < 0) desat = 0.; |
- if (desat > 1) desat = 1.; |
- int pixels = img.depth() > 8 ? img.width()*img.height() : |
- img.numColors(); |
- unsigned int *data = img.depth() > 8 ? (unsigned int *)img.bits() : |
- (unsigned int *)img.colorTable(); |
- int h, s, v, i; |
- QColor clr; // keep constructor out of loop (mosfet) |
- for(i=0; i < pixels; ++i){ |
- clr.setRgb(data[i]); |
- clr.hsv(&h, &s, &v); |
- clr.setHsv(h, (int)(s * (1. - desat)), v); |
- data[i] = clr.rgb(); |
- } |
- return img; |
-} |
- |
-// Contrast stuff (mosfet) |
-QImage& KImageEffect::contrast(QImage &img, int c) |
-{ |
- if (img.width() == 0 || img.height() == 0) |
- return img; |
- |
- if(c > 255) |
- c = 255; |
- if(c < -255) |
- c = -255; |
- int pixels = img.depth() > 8 ? img.width()*img.height() : |
- img.numColors(); |
- unsigned int *data = img.depth() > 8 ? (unsigned int *)img.bits() : |
- (unsigned int *)img.colorTable(); |
- int i, r, g, b; |
- for(i=0; i < pixels; ++i){ |
- r = qRed(data[i]); |
- g = qGreen(data[i]); |
- b = qBlue(data[i]); |
- if(qGray(data[i]) <= 127){ |
- if(r - c <= 255) |
- r -= c; |
- if(g - c <= 255) |
- g -= c; |
- if(b - c <= 255) |
- b -= c; |
- } |
- else{ |
- if(r + c <= 255) |
- r += c; |
- if(g + c <= 255) |
- g += c; |
- if(b + c <= 255) |
- b += c; |
- } |
- data[i] = qRgba(r, g, b, qAlpha(data[i])); |
- } |
- return(img); |
-} |
- |
-//====================================================================== |
-// |
-// Dithering effects |
-// |
-//====================================================================== |
- |
-// adapted from kFSDither (C) 1997 Martin Jones (mjones@kde.org) |
-// |
-// Floyd-Steinberg dithering |
-// Ref: Bitmapped Graphics Programming in C++ |
-// Marv Luse, Addison-Wesley Publishing, 1993. |
-QImage& KImageEffect::dither(QImage &img, const QColor *palette, int size) |
-{ |
- if (img.width() == 0 || img.height() == 0 || |
- palette == 0 || img.depth() <= 8) |
- return img; |
- |
- QImage dImage( img.width(), img.height(), 8, size ); |
- int i; |
- |
- dImage.setNumColors( size ); |
- for ( i = 0; i < size; i++ ) |
- dImage.setColor( i, palette[ i ].rgb() ); |
- |
- int *rerr1 = new int [ img.width() * 2 ]; |
- int *gerr1 = new int [ img.width() * 2 ]; |
- int *berr1 = new int [ img.width() * 2 ]; |
- |
- memset( rerr1, 0, sizeof( int ) * img.width() * 2 ); |
- memset( gerr1, 0, sizeof( int ) * img.width() * 2 ); |
- memset( berr1, 0, sizeof( int ) * img.width() * 2 ); |
- |
- int *rerr2 = rerr1 + img.width(); |
- int *gerr2 = gerr1 + img.width(); |
- int *berr2 = berr1 + img.width(); |
- |
- for ( int j = 0; j < img.height(); j++ ) |
- { |
- uint *ip = (uint * )img.scanLine( j ); |
- uchar *dp = dImage.scanLine( j ); |
- |
- for ( i = 0; i < img.width(); i++ ) |
- { |
- rerr1[i] = rerr2[i] + qRed( *ip ); |
- rerr2[i] = 0; |
- gerr1[i] = gerr2[i] + qGreen( *ip ); |
- gerr2[i] = 0; |
- berr1[i] = berr2[i] + qBlue( *ip ); |
- berr2[i] = 0; |
- ip++; |
- } |
- |
- *dp++ = nearestColor( rerr1[0], gerr1[0], berr1[0], palette, size ); |
- |
- for ( i = 1; i < img.width()-1; i++ ) |
- { |
- int indx = nearestColor( rerr1[i], gerr1[i], berr1[i], palette, size ); |
- *dp = indx; |
- |
- int rerr = rerr1[i]; |
- rerr -= palette[indx].red(); |
- int gerr = gerr1[i]; |
- gerr -= palette[indx].green(); |
- int berr = berr1[i]; |
- berr -= palette[indx].blue(); |
- |
- // diffuse red error |
- rerr1[ i+1 ] += ( rerr * 7 ) >> 4; |
- rerr2[ i-1 ] += ( rerr * 3 ) >> 4; |
- rerr2[ i ] += ( rerr * 5 ) >> 4; |
- rerr2[ i+1 ] += ( rerr ) >> 4; |
- |
- // diffuse green error |
- gerr1[ i+1 ] += ( gerr * 7 ) >> 4; |
- gerr2[ i-1 ] += ( gerr * 3 ) >> 4; |
- gerr2[ i ] += ( gerr * 5 ) >> 4; |
- gerr2[ i+1 ] += ( gerr ) >> 4; |
- |
- // diffuse red error |
- berr1[ i+1 ] += ( berr * 7 ) >> 4; |
- berr2[ i-1 ] += ( berr * 3 ) >> 4; |
- berr2[ i ] += ( berr * 5 ) >> 4; |
- berr2[ i+1 ] += ( berr ) >> 4; |
- |
- dp++; |
- } |
- |
- *dp = nearestColor( rerr1[i], gerr1[i], berr1[i], palette, size ); |
- } |
- |
- delete [] rerr1; |
- delete [] gerr1; |
- delete [] berr1; |
- |
- img = dImage; |
- return img; |
-} |
- |
-int KImageEffect::nearestColor( int r, int g, int b, const QColor *palette, int size ) |
-{ |
- if (palette == 0) |
- return 0; |
- |
- int dr = palette[0].red() - r; |
- int dg = palette[0].green() - g; |
- int db = palette[0].blue() - b; |
- |
- int minDist = dr*dr + dg*dg + db*db; |
- int nearest = 0; |
- |
- for (int i = 1; i < size; i++ ) |
- { |
- dr = palette[i].red() - r; |
- dg = palette[i].green() - g; |
- db = palette[i].blue() - b; |
- |
- int dist = dr*dr + dg*dg + db*db; |
- |
- if ( dist < minDist ) |
- { |
- minDist = dist; |
- nearest = i; |
- } |
- } |
- |
- return nearest; |
-} |
- |
-bool KImageEffect::blend( |
- const QImage & upper, |
- const QImage & lower, |
- QImage & output |
-) |
-{ |
- if ( |
- upper.width() > lower.width() || |
- upper.height() > lower.height() || |
- upper.depth() != 32 || |
- lower.depth() != 32 |
- ) |
- { |
-#ifndef NDEBUG |
- cerr << "KImageEffect::blend : Sizes not correct\n" ; |
-#endif |
- return false; |
- } |
- |
- output = lower.copy(); |
- |
- register uchar *i, *o; |
- register int a; |
- register int col; |
- register int w = upper.width(); |
- int row(upper.height() - 1); |
- |
- do { |
- |
- i = upper.scanLine(row); |
- o = output.scanLine(row); |
- |
- col = w << 2; |
- --col; |
- |
- do { |
- |
- while (!(a = i[col]) && (col != 3)) { |
- --col; --col; --col; --col; |
- } |
- |
- --col; |
- o[col] += ((i[col] - o[col]) * a) >> 8; |
- |
- --col; |
- o[col] += ((i[col] - o[col]) * a) >> 8; |
- |
- --col; |
- o[col] += ((i[col] - o[col]) * a) >> 8; |
- |
- } while (col--); |
- |
- } while (row--); |
- |
- return true; |
-} |
- |
-#if 0 |
-// Not yet... |
-bool KImageEffect::blend( |
- const QImage & upper, |
- const QImage & lower, |
- QImage & output, |
- const QRect & destRect |
-) |
-{ |
- output = lower.copy(); |
- return output; |
-} |
- |
-#endif |
- |
-bool KImageEffect::blend( |
- int &x, int &y, |
- const QImage & upper, |
- const QImage & lower, |
- QImage & output |
-) |
-{ |
- int cx=0, cy=0, cw=upper.width(), ch=upper.height(); |
- |
- if ( upper.width() + x > lower.width() || |
- upper.height() + y > lower.height() || |
- x < 0 || y < 0 || |
- upper.depth() != 32 || lower.depth() != 32 ) |
- { |
- if ( x > lower.width() || y > lower.height() ) return false; |
- if ( upper.width()<=0 || upper.height() <= 0 ) return false; |
- if ( lower.width()<=0 || lower.height() <= 0 ) return false; |
- |
- if (x<0) {cx=-x; cw+=x; x=0; }; |
- if (cw + x > lower.width()) { cw=lower.width()-x; }; |
- if (y<0) {cy=-y; ch+=y; y=0; }; |
- if (ch + y > lower.height()) { ch=lower.height()-y; }; |
- |
- if ( cx >= upper.width() || cy >= upper.height() ) return true; |
- if ( cw <= 0 || ch <= 0 ) return true; |
- } |
- |
- output.create(cw,ch,32); |
-// output.setAlphaBuffer(true); // I should do some benchmarks to see if |
- // this is worth the effort |
- |
- register QRgb *i, *o, *b; |
- |
- register int a; |
- register int j,k; |
- for (j=0; j<ch; j++) |
- { |
- b=reinterpret_cast<QRgb *>(&lower.scanLine(y+j) [ (x+cw) << 2 ]); |
- i=reinterpret_cast<QRgb *>(&upper.scanLine(cy+j)[ (cx+cw) << 2 ]); |
- o=reinterpret_cast<QRgb *>(&output.scanLine(j) [ cw << 2 ]); |
- |
- k=cw-1; |
- --b; --i; --o; |
- do |
- { |
- while ( !(a=qAlpha(*i)) && k>0 ) |
- { |
- i--; |
-// *o=0; |
- *o=*b; |
- --o; --b; |
- k--; |
- }; |
-// *o=0xFF; |
- *o = qRgb(qRed(*b) + (((qRed(*i) - qRed(*b)) * a) >> 8), |
- qGreen(*b) + (((qGreen(*i) - qGreen(*b)) * a) >> 8), |
- qBlue(*b) + (((qBlue(*i) - qBlue(*b)) * a) >> 8)); |
- --i; --o; --b; |
- } while (k--); |
- } |
- |
- return true; |
-} |
- |
-bool KImageEffect::blendOnLower( |
- int x, int y, |
- const QImage & upper, |
- const QImage & lower |
-) |
-{ |
- int cx=0, cy=0, cw=upper.width(), ch=upper.height(); |
- |
- if ( upper.depth() != 32 || lower.depth() != 32 ) return false; |
- if ( x + cw > lower.width() || |
- y + ch > lower.height() || |
- x < 0 || y < 0 ) |
- { |
- if ( x > lower.width() || y > lower.height() ) return true; |
- if ( upper.width()<=0 || upper.height() <= 0 ) return true; |
- if ( lower.width()<=0 || lower.height() <= 0 ) return true; |
- |
- if (x<0) {cx=-x; cw+=x; x=0; }; |
- if (cw + x > lower.width()) { cw=lower.width()-x; }; |
- if (y<0) {cy=-y; ch+=y; y=0; }; |
- if (ch + y > lower.height()) { ch=lower.height()-y; }; |
- |
- if ( cx >= upper.width() || cy >= upper.height() ) return true; |
- if ( cw <= 0 || ch <= 0 ) return true; |
- } |
- |
- register uchar *i, *b; |
- register int a; |
- register int k; |
- |
- for (int j=0; j<ch; j++) |
- { |
- b=&lower.scanLine(y+j) [ (x+cw) << 2 ]; |
- i=&upper.scanLine(cy+j)[ (cx+cw) << 2 ]; |
- |
- k=cw-1; |
- --b; --i; |
- do |
- { |
- while ( !(a=*i) && k>0 ) |
- { |
- i-=4; b-=4; k--; |
- }; |
- |
- --i; --b; |
- *b += ( ((*i - *b) * a) >> 8 ); |
- --i; --b; |
- *b += ( ((*i - *b) * a) >> 8 ); |
- --i; --b; |
- *b += ( ((*i - *b) * a) >> 8 ); |
- --i; --b; |
- } while (k--); |
- } |
- |
- return true; |
-} |
- |
-// For selected icons |
-// Code added by David Faure - I couldn't find a similar effect |
-// among the existing ones, but I may have overlooked... |
-QImage& KImageEffect::selectedImage( QImage &img, const QColor &col ) |
-{ |
- if ( img.depth() != 32 ) { |
-#ifndef NDEBUG |
- qDebug("KImageEffect::selectedImage converting to 32 bit"); |
-#endif |
- img = img.convertDepth(32); // is this ok? |
- } |
- int w = img.width(); |
- int h = img.height(); |
- //QImage outImg(w, h, 32); |
- |
- if (img.isNull()) |
- return img; |
- |
-#define PIX(x,y) (*((QRgb*)img.scanLine(y)+x) & 0x00ffffff) |
- |
- // Determine background color from the 4 borders, |
- // code taken from QPixmap::createHeuristicMask |
- QRgb background = PIX(0,0); |
- if ( background != PIX(w-1,0) && |
- background != PIX(0,h-1) && |
- background != PIX(w-1,h-1) ) { |
- background = PIX(w-1,0); |
- if ( background != PIX(w-1,h-1) && |
- background != PIX(0,h-1) && |
- PIX(0,h-1) == PIX(w-1,h-1) ) { |
- background = PIX(w-1,h-1); |
- } |
- } |
-#undef PIX |
- //qDebug("background: %s",QString::number(background,16).ascii()); |
- |
- img.setAlphaBuffer( true ); // just in case |
- |
- // Apply an overlay made of the 'selection color' with 50% transparency |
- // (that overlay is a mask of the icon, transparent where the icon is transparent) |
- int red = col.red(); |
- int green = col.green(); |
- int blue = col.blue(); |
- int alpha = 0x7f; |
- |
- for ( int y = 0; y < h; y++ ) { |
- //QRgb *outp = (QRgb*)outImg.scanLine(y); |
- QRgb *p = (QRgb *)img.scanLine(y); |
- QRgb *end = p + w; |
- for ( ; p < end; p++ /*, outp++*/ ) { |
- QRgb pix = *p; |
- if ( (pix & 0x00ffffff) != background ) |
- { |
- int r = ((0xff-alpha) * qRed(pix) + alpha * red) >> 8; |
- int g = ((0xff-alpha) * qGreen(pix) + alpha * green) >> 8; |
- int b = ((0xff-alpha) * qBlue(pix) + alpha * blue) >> 8; |
- |
- *p = qRgba(r, g, b, qAlpha(pix)); |
- } |
- //else // transparent pixel, copy as is |
- // *outp = pix; |
- } |
- } |
- return img; |
-} |
- |
-// |
-// =================================================================== |
-// Effects originally ported from ImageMagick for PixiePlus, plus a few |
-// new ones. (mosfet 12/29/01) |
-// =================================================================== |
-// |
- |
-void KImageEffect::normalize(QImage &img) |
-{ |
- int *histogram, threshold_intensity, intense; |
- int x, y, i; |
- |
- unsigned int gray_value; |
- unsigned int *normalize_map; |
- unsigned int high, low; |
- |
- // allocate histogram and normalize map |
- histogram = (int *)calloc(MaxRGB+1, sizeof(int)); |
- normalize_map = (unsigned int *)malloc((MaxRGB+1)*sizeof(unsigned int)); |
- if(!normalize_map || !histogram){ |
- qWarning("Unable to allocate normalize histogram and map"); |
- free(normalize_map); |
- free(histogram); |
- return; |
- } |
- |
- // form histogram |
- if(img.depth() > 8){ // DirectClass |
- unsigned int *data; |
- for(y=0; y < img.height(); ++y){ |
- data = (unsigned int *)img.scanLine(y); |
- for(x=0; x < img.width(); ++x){ |
- gray_value = intensityValue(data[x]); |
- histogram[gray_value]++; |
- } |
- } |
- } |
- else{ // PsudeoClass |
- unsigned char *data; |
- unsigned int *cTable = img.colorTable(); |
- for(y=0; y < img.height(); ++y){ |
- data = (unsigned char *)img.scanLine(y); |
- for(x=0; x < img.width(); ++x){ |
- gray_value = intensityValue(*(cTable+data[x])); |
- histogram[gray_value]++; |
- } |
- } |
- } |
- |
- // find histogram boundaries by locating the 1 percent levels |
- threshold_intensity = (img.width()*img.height())/100; |
- intense = 0; |
- for(low=0; low < MaxRGB; ++low){ |
- intense+=histogram[low]; |
- if(intense > threshold_intensity) |
- break; |
- } |
- intense=0; |
- for(high=MaxRGB; high != 0; --high){ |
- intense+=histogram[high]; |
- if(intense > threshold_intensity) |
- break; |
- } |
- |
- if (low == high){ |
- // Unreasonable contrast; use zero threshold to determine boundaries. |
- threshold_intensity=0; |
- intense=0; |
- for(low=0; low < MaxRGB; ++low){ |
- intense+=histogram[low]; |
- if(intense > threshold_intensity) |
- break; |
- } |
- intense=0; |
- for(high=MaxRGB; high != 0; --high) |
- { |
- intense+=histogram[high]; |
- if(intense > threshold_intensity) |
- break; |
- } |
- if(low == high) |
- return; // zero span bound |
- } |
- |
- // Stretch the histogram to create the normalized image mapping. |
- for(i=0; i <= MaxRGB; i++){ |
- if (i < (int) low) |
- normalize_map[i]=0; |
- else{ |
- if(i > (int) high) |
- normalize_map[i]=MaxRGB; |
- else |
- normalize_map[i]=(MaxRGB-1)*(i-low)/(high-low); |
- } |
- } |
- // Normalize |
- if(img.depth() > 8){ // DirectClass |
- unsigned int *data; |
- for(y=0; y < img.height(); ++y){ |
- data = (unsigned int *)img.scanLine(y); |
- for(x=0; x < img.width(); ++x){ |
- data[x] = qRgba(normalize_map[qRed(data[x])], |
- normalize_map[qGreen(data[x])], |
- normalize_map[qBlue(data[x])], |
- qAlpha(data[x])); |
- } |
- } |
- } |
- else{ // PsudeoClass |
- int colors = img.numColors(); |
- unsigned int *cTable = img.colorTable(); |
- for(i=0; i < colors; ++i){ |
- cTable[i] = qRgba(normalize_map[qRed(cTable[i])], |
- normalize_map[qGreen(cTable[i])], |
- normalize_map[qBlue(cTable[i])], |
- qAlpha(cTable[i])); |
- } |
- } |
- free(histogram); |
- free(normalize_map); |
-} |
- |
- |
-void KImageEffect::equalize(QImage &img) |
-{ |
- int *histogram, *map, *equalize_map; |
- int x, y, i, j; |
- |
- unsigned int high, low; |
- |
- // allocate histogram and maps |
- histogram = (int *)calloc(MaxRGB+1, sizeof(int)); |
- map = (int *)malloc((MaxRGB+1)*sizeof(unsigned int)); |
- equalize_map = (int *)malloc((MaxRGB+1)*sizeof(unsigned int)); |
- |
- if(!histogram || !map || !equalize_map){ |
- qWarning("Unable to allocate equalize histogram and maps"); |
- free(histogram); |
- free(map); |
- free(equalize_map); |
- return; |
- } |
- // form histogram |
- if(img.depth() > 8){ // DirectClass |
- unsigned int *data; |
- for(y=0; y < img.height(); ++y){ |
- data = (unsigned int *)img.scanLine(y); |
- for(x=0; x < img.width(); ++x){ |
- histogram[intensityValue(data[x])]++; |
- } |
- } |
- } |
- else{ // PsudeoClass |
- unsigned char *data; |
- unsigned int *cTable = img.colorTable(); |
- for(y=0; y < img.height(); ++y){ |
- data = (unsigned char *)img.scanLine(y); |
- for(x=0; x < img.width(); ++x){ |
- histogram[intensityValue(*(cTable+data[x]))]++; |
- } |
- } |
- } |
- |
- // integrate the histogram to get the equalization map. |
- j=0; |
- for(i=0; i <= MaxRGB; i++){ |
- j+=histogram[i]; |
- map[i]=j; |
- } |
- free(histogram); |
- if(map[MaxRGB] == 0){ |
- free(equalize_map); |
- free(map); |
- return; |
- } |
- // equalize |
- low=map[0]; |
- high=map[MaxRGB]; |
- for(i=0; i <= MaxRGB; i++) |
- equalize_map[i]=(unsigned int) |
- ((((double) (map[i]-low))*MaxRGB)/QMAX(high-low,1)); |
- free(map); |
- // stretch the histogram |
- if(img.depth() > 8){ // DirectClass |
- unsigned int *data; |
- for(y=0; y < img.height(); ++y){ |
- data = (unsigned int *)img.scanLine(y); |
- for(x=0; x < img.width(); ++x){ |
- data[x] = qRgba(equalize_map[qRed(data[x])], |
- equalize_map[qGreen(data[x])], |
- equalize_map[qBlue(data[x])], |
- qAlpha(data[x])); |
- } |
- } |
- } |
- else{ // PsudeoClass |
- int colors = img.numColors(); |
- unsigned int *cTable = img.colorTable(); |
- for(i=0; i < colors; ++i){ |
- cTable[i] = qRgba(equalize_map[qRed(cTable[i])], |
- equalize_map[qGreen(cTable[i])], |
- equalize_map[qBlue(cTable[i])], |
- qAlpha(cTable[i])); |
- } |
- } |
- free(equalize_map); |
-} |
- |
-QImage KImageEffect::sample(QImage &src, int w, int h) |
-{ |
- if(w == src.width() && h == src.height()) |
- return(src); |
- |
- double *x_offset, *y_offset; |
- int j, k, y; |
- register int x; |
- QImage dest(w, h, src.depth()); |
- |
- x_offset = (double *)malloc(w*sizeof(double)); |
- y_offset = (double *)malloc(h*sizeof(double)); |
- if(!x_offset || !y_offset){ |
- qWarning("Unable to allocate pixels buffer"); |
- free(x_offset); |
- free(y_offset); |
- return(src); |
- } |
- |
- // init pixel offsets |
- for(x=0; x < w; ++x) |
- x_offset[x] = x*src.width()/((double)w); |
- for(y=0; y < h; ++y) |
- y_offset[y] = y*src.height()/((double)h); |
- |
- // sample each row |
- if(src.depth() > 8){ // DirectClass source image |
- unsigned int *srcData, *destData; |
- unsigned int *pixels; |
- pixels = (unsigned int *)malloc(src.width()*sizeof(unsigned int)); |
- if(!pixels){ |
- qWarning("Unable to allocate pixels buffer"); |
- free(pixels); |
- free(x_offset); |
- free(y_offset); |
- return(src); |
- } |
- j = (-1); |
- for(y=0; y < h; ++y){ |
- destData = (unsigned int *)dest.scanLine(y); |
- if(j != y_offset[y]){ |
- // read a scan line |
- j = (int)(y_offset[y]); |
- srcData = (unsigned int *)src.scanLine(j); |
- (void)memcpy(pixels, srcData, src.width()*sizeof(unsigned int)); |
- } |
- // sample each column |
- for(x=0; x < w; ++x){ |
- k = (int)(x_offset[x]); |
- destData[x] = pixels[k]; |
- } |
- } |
- free(pixels); |
- } |
- else{ // PsudeoClass source image |
- unsigned char *srcData, *destData; |
- unsigned char *pixels; |
- pixels = (unsigned char *)malloc(src.width()*sizeof(unsigned char)); |
- if(!pixels){ |
- qWarning("Unable to allocate pixels buffer"); |
- free(pixels); |
- free(x_offset); |
- free(y_offset); |
- return(src); |
- } |
- // copy colortable |
- dest.setNumColors(src.numColors()); |
- (void)memcpy(dest.colorTable(), src.colorTable(), |
- src.numColors()*sizeof(unsigned int)); |
- |
- // sample image |
- j = (-1); |
- for(y=0; y < h; ++y){ |
- destData = (unsigned char *)dest.scanLine(y); |
- if(j != y_offset[y]){ |
- // read a scan line |
- j = (int)(y_offset[y]); |
- srcData = (unsigned char *)src.scanLine(j); |
- (void)memcpy(pixels, srcData, src.width()*sizeof(unsigned char)); |
- } |
- // sample each column |
- for(x=0; x < w; ++x){ |
- k = (int)(x_offset[x]); |
- destData[x] = pixels[k]; |
- } |
- } |
- free(pixels); |
- } |
- free(x_offset); |
- free(y_offset); |
- return(dest); |
-} |
- |
-void KImageEffect::threshold(QImage &img, unsigned int threshold) |
-{ |
- int i, count; |
- unsigned int *data; |
- if(img.depth() > 8){ // DirectClass |
- count = img.width()*img.height(); |
- data = (unsigned int *)img.bits(); |
- } |
- else{ // PsudeoClass |
- count = img.numColors(); |
- data = (unsigned int *)img.colorTable(); |
- } |
- for(i=0; i < count; ++i) |
- data[i] = intensityValue(data[i]) < threshold ? Qt::black.rgb() : Qt::white.rgb(); |
-} |
- |
-QImage KImageEffect::charcoal(QImage &src, double factor) |
-{ |
- QImage dest(src); |
- dest.detach(); |
- toGray(dest); |
- dest = edge(dest, factor); |
- dest = blur(dest, factor); |
- normalize(dest); |
- dest.invertPixels(false); |
- return(dest); |
-} |
- |
-void KImageEffect::hull(const int x_offset, const int y_offset, |
- const int polarity, const int columns, |
- const int rows, |
- unsigned int *f, unsigned int *g) |
-{ |
- int x, y; |
- |
- unsigned int *p, *q, *r, *s; |
- unsigned int v; |
- if(f == NULL || g == NULL) |
- return; |
- p=f+(columns+2); |
- q=g+(columns+2); |
- r=p+(y_offset*(columns+2)+x_offset); |
- for (y=0; y < rows; y++){ |
- p++; |
- q++; |
- r++; |
- if(polarity > 0) |
- for (x=0; x < columns; x++){ |
- v=(*p); |
- if (*r > v) |
- v++; |
- *q=v; |
- p++; |
- q++; |
- r++; |
- } |
- else |
- for(x=0; x < columns; x++){ |
- v=(*p); |
- if (v > (unsigned int) (*r+1)) |
- v--; |
- *q=v; |
- p++; |
- q++; |
- r++; |
- } |
- p++; |
- q++; |
- r++; |
- } |
- p=f+(columns+2); |
- q=g+(columns+2); |
- r=q+(y_offset*(columns+2)+x_offset); |
- s=q-(y_offset*(columns+2)+x_offset); |
- for(y=0; y < rows; y++){ |
- p++; |
- q++; |
- r++; |
- s++; |
- if(polarity > 0) |
- for(x=0; x < (int) columns; x++){ |
- v=(*q); |
- if (((unsigned int) (*s+1) > v) && (*r > v)) |
- v++; |
- *p=v; |
- p++; |
- q++; |
- r++; |
- s++; |
- } |
- else |
- for (x=0; x < columns; x++){ |
- v=(*q); |
- if (((unsigned int) (*s+1) < v) && (*r < v)) |
- v--; |
- *p=v; |
- p++; |
- q++; |
- r++; |
- s++; |
- } |
- p++; |
- q++; |
- r++; |
- s++; |
- } |
-} |
- |
-QImage KImageEffect::despeckle(QImage &src) |
-{ |
- int i, j, x, y; |
- unsigned int *blue_channel, *red_channel, *green_channel, *buffer, |
- *alpha_channel; |
- int packets; |
- static const int |
- X[4]= {0, 1, 1,-1}, |
- Y[4]= {1, 0, 1, 1}; |
- |
- unsigned int *destData; |
- QImage dest(src.width(), src.height(), 32); |
- |
- packets = (src.width()+2)*(src.height()+2); |
- red_channel = (unsigned int *)calloc(packets, sizeof(unsigned int)); |
- green_channel = (unsigned int *)calloc(packets, sizeof(unsigned int)); |
- blue_channel = (unsigned int *)calloc(packets, sizeof(unsigned int)); |
- alpha_channel = (unsigned int *)calloc(packets, sizeof(unsigned int)); |
- buffer = (unsigned int *)calloc(packets, sizeof(unsigned int)); |
- if(!red_channel || ! green_channel || ! blue_channel || ! alpha_channel || |
- !buffer){ |
- free(red_channel); |
- free(green_channel); |
- free(blue_channel); |
- free(alpha_channel); |
- free(buffer); |
- return(src); |
- } |
- |
- // copy image pixels to color component buffers |
- j = src.width()+2; |
- if(src.depth() > 8){ // DirectClass source image |
- unsigned int *srcData; |
- for(y=0; y < src.height(); ++y){ |
- srcData = (unsigned int *)src.scanLine(y); |
- ++j; |
- for(x=0; x < src.width(); ++x){ |
- red_channel[j] = qRed(srcData[x]); |
- green_channel[j] = qGreen(srcData[x]); |
- blue_channel[j] = qBlue(srcData[x]); |
- alpha_channel[j] = qAlpha(srcData[x]); |
- ++j; |
- } |
- ++j; |
- } |
- } |
- else{ // PsudeoClass source image |
- unsigned char *srcData; |
- unsigned int *cTable = src.colorTable(); |
- unsigned int pixel; |
- for(y=0; y < src.height(); ++y){ |
- srcData = (unsigned char *)src.scanLine(y); |
- ++j; |
- for(x=0; x < src.width(); ++x){ |
- pixel = *(cTable+srcData[x]); |
- red_channel[j] = qRed(pixel); |
- green_channel[j] = qGreen(pixel); |
- blue_channel[j] = qBlue(pixel); |
- alpha_channel[j] = qAlpha(pixel); |
- ++j; |
- } |
- ++j; |
- } |
- } |
- // reduce speckle in red channel |
- for(i=0; i < 4; i++){ |
- hull(X[i],Y[i],1,src.width(),src.height(),red_channel,buffer); |
- hull(-X[i],-Y[i],1,src.width(),src.height(),red_channel,buffer); |
- hull(-X[i],-Y[i],-1,src.width(),src.height(),red_channel,buffer); |
- hull(X[i],Y[i],-1,src.width(),src.height(),red_channel,buffer); |
- } |
- // reduce speckle in green channel |
- for (i=0; i < packets; i++) |
- buffer[i]=0; |
- for (i=0; i < 4; i++){ |
- hull(X[i],Y[i],1,src.width(),src.height(),green_channel,buffer); |
- hull(-X[i],-Y[i],1,src.width(),src.height(),green_channel,buffer); |
- hull(-X[i],-Y[i],-1,src.width(),src.height(),green_channel,buffer); |
- hull(X[i],Y[i],-1,src.width(),src.height(),green_channel,buffer); |
- } |
- // reduce speckle in blue channel |
- for (i=0; i < packets; i++) |
- buffer[i]=0; |
- for (i=0; i < 4; i++){ |
- hull(X[i],Y[i],1,src.width(),src.height(),blue_channel,buffer); |
- hull(-X[i],-Y[i],1,src.width(),src.height(),blue_channel,buffer); |
- hull(-X[i],-Y[i],-1,src.width(),src.height(),blue_channel,buffer); |
- hull(X[i],Y[i],-1,src.width(),src.height(),blue_channel,buffer); |
- } |
- // copy color component buffers to despeckled image |
- j = dest.width()+2; |
- for(y=0; y < dest.height(); ++y) |
- { |
- destData = (unsigned int *)dest.scanLine(y); |
- ++j; |
- for (x=0; x < dest.width(); ++x) |
- { |
- destData[x] = qRgba(red_channel[j], green_channel[j], |
- blue_channel[j], alpha_channel[j]); |
- ++j; |
- } |
- ++j; |
- } |
- free(buffer); |
- free(red_channel); |
- free(green_channel); |
- free(blue_channel); |
- free(alpha_channel); |
- return(dest); |
-} |
- |
-unsigned int KImageEffect::generateNoise(unsigned int pixel, |
- NoiseType noise_type) |
-{ |
-#define NoiseEpsilon 1.0e-5 |
-#define NoiseMask 0x7fff |
-#define SigmaUniform 4.0 |
-#define SigmaGaussian 4.0 |
-#define SigmaImpulse 0.10 |
-#define SigmaLaplacian 10.0 |
-#define SigmaMultiplicativeGaussian 0.5 |
-#define SigmaPoisson 0.05 |
-#define TauGaussian 20.0 |
- |
- double alpha, beta, sigma, value; |
- alpha=(double) (rand() & NoiseMask)/NoiseMask; |
- if (alpha == 0.0) |
- alpha=1.0; |
- switch(noise_type){ |
- case UniformNoise: |
- default: |
- { |
- value=(double) pixel+SigmaUniform*(alpha-0.5); |
- break; |
- } |
- case GaussianNoise: |
- { |
- double tau; |
- |
- beta=(double) (rand() & NoiseMask)/NoiseMask; |
- sigma=sqrt(-2.0*log(alpha))*cos(2.0*M_PI*beta); |
- tau=sqrt(-2.0*log(alpha))*sin(2.0*M_PI*beta); |
- value=(double) pixel+ |
- (sqrt((double) pixel)*SigmaGaussian*sigma)+(TauGaussian*tau); |
- break; |
- } |
- case MultiplicativeGaussianNoise: |
- { |
- if (alpha <= NoiseEpsilon) |
- sigma=MaxRGB; |
- else |
- sigma=sqrt(-2.0*log(alpha)); |
- beta=(rand() & NoiseMask)/NoiseMask; |
- value=(double) pixel+ |
- pixel*SigmaMultiplicativeGaussian*sigma*cos(2.0*M_PI*beta); |
- break; |
- } |
- case ImpulseNoise: |
- { |
- if (alpha < (SigmaImpulse/2.0)) |
- value=0; |
- else |
- if (alpha >= (1.0-(SigmaImpulse/2.0))) |
- value=MaxRGB; |
- else |
- value=pixel; |
- break; |
- } |
- case LaplacianNoise: |
- { |
- if (alpha <= 0.5) |
- { |
- if (alpha <= NoiseEpsilon) |
- value=(double) pixel-MaxRGB; |
- else |
- value=(double) pixel+SigmaLaplacian*log(2.0*alpha); |
- break; |
- } |
- beta=1.0-alpha; |
- if (beta <= (0.5*NoiseEpsilon)) |
- value=(double) pixel+MaxRGB; |
- else |
- value=(double) pixel-SigmaLaplacian*log(2.0*beta); |
- break; |
- } |
- case PoissonNoise: |
- { |
- register int |
- i; |
- |
- for (i=0; alpha > exp(-SigmaPoisson*pixel); i++) |
- { |
- beta=(double) (rand() & NoiseMask)/NoiseMask; |
- alpha=alpha*beta; |
- } |
- value=i/SigmaPoisson; |
- break; |
- } |
- } |
- if(value < 0.0) |
- return(0); |
- if(value > MaxRGB) |
- return(MaxRGB); |
- return((unsigned int) (value+0.5)); |
-} |
- |
-QImage KImageEffect::addNoise(QImage &src, NoiseType noise_type) |
-{ |
- int x, y; |
- QImage dest(src.width(), src.height(), 32); |
- unsigned int *destData; |
- |
- if(src.depth() > 8){ // DirectClass source image |
- unsigned int *srcData; |
- for(y=0; y < src.height(); ++y){ |
- srcData = (unsigned int *)src.scanLine(y); |
- destData = (unsigned int *)dest.scanLine(y); |
- for(x=0; x < src.width(); ++x){ |
- destData[x] = qRgba(generateNoise(qRed(srcData[x]), noise_type), |
- generateNoise(qGreen(srcData[x]), noise_type), |
- generateNoise(qBlue(srcData[x]), noise_type), |
- qAlpha(srcData[x])); |
- } |
- } |
- } |
- else{ // PsudeoClass source image |
- unsigned char *srcData; |
- unsigned int *cTable = src.colorTable(); |
- unsigned int pixel; |
- for(y=0; y < src.height(); ++y){ |
- srcData = (unsigned char *)src.scanLine(y); |
- destData = (unsigned int *)dest.scanLine(y); |
- for(x=0; x < src.width(); ++x){ |
- pixel = *(cTable+srcData[x]); |
- destData[x] = qRgba(generateNoise(qRed(pixel), noise_type), |
- generateNoise(qGreen(pixel), noise_type), |
- generateNoise(qBlue(pixel), noise_type), |
- qAlpha(pixel)); |
- } |
- } |
- |
- } |
- return(dest); |
-} |
- |
-unsigned int KImageEffect::interpolateColor(QImage *image, double x_offset, |
- double y_offset, |
- unsigned int background) |
-{ |
- double alpha, beta; |
- unsigned int p, q, r, s; |
- int x, y; |
- |
- x = (int)x_offset; |
- y = (int)y_offset; |
- if((x < -1) || (x >= image->width()) || (y < -1) || (y >= image->height())) |
- return(background); |
- if(image->depth() > 8){ |
- if((x >= 0) && (y >= 0) && (x < (image->width()-1)) && (y < (image->height()-1))) { |
- unsigned int *t = (unsigned int *)image->scanLine(y); |
- p = t[x]; |
- q = t[x+1]; |
- r = t[x+image->width()]; |
- s = t[x+image->width()+1]; |
- } |
- else{ |
- unsigned int *t = (unsigned int *)image->scanLine(y); |
- p = background; |
- if((x >= 0) && (y >= 0)){ |
- p = t[x]; |
- } |
- q = background; |
- if(((x+1) < image->width()) && (y >= 0)){ |
- q = t[x+1]; |
- } |
- r = background; |
- if((x >= 0) && ((y+1) < image->height())){ |
- t = (unsigned int *)image->scanLine(y+1); |
- r = t[x+image->width()]; |
- } |
- s = background; |
- if(((x+1) < image->width()) && ((y+1) < image->height())){ |
- t = (unsigned int *)image->scanLine(y+1); |
- s = t[x+image->width()+1]; |
- } |
- |
- } |
- } |
- else{ |
- unsigned int *colorTable = (unsigned int *)image->colorTable(); |
- if((x >= 0) && (y >= 0) && (x < (image->width()-1)) && (y < (image->height()-1))) { |
- unsigned char *t; |
- t = (unsigned char *)image->scanLine(y); |
- p = *(colorTable+t[x]); |
- q = *(colorTable+t[x+1]); |
- t = (unsigned char *)image->scanLine(y+1); |
- r = *(colorTable+t[x]); |
- s = *(colorTable+t[x+1]); |
- } |
- else{ |
- unsigned char *t; |
- p = background; |
- if((x >= 0) && (y >= 0)){ |
- t = (unsigned char *)image->scanLine(y); |
- p = *(colorTable+t[x]); |
- } |
- q = background; |
- if(((x+1) < image->width()) && (y >= 0)){ |
- t = (unsigned char *)image->scanLine(y); |
- q = *(colorTable+t[x+1]); |
- } |
- r = background; |
- if((x >= 0) && ((y+1) < image->height())){ |
- t = (unsigned char *)image->scanLine(y+1); |
- r = *(colorTable+t[x]); |
- } |
- s = background; |
- if(((x+1) < image->width()) && ((y+1) < image->height())){ |
- t = (unsigned char *)image->scanLine(y+1); |
- s = *(colorTable+t[x+1]); |
- } |
- |
- } |
- |
- } |
- x_offset -= floor(x_offset); |
- y_offset -= floor(y_offset); |
- alpha = 1.0-x_offset; |
- beta = 1.0-y_offset; |
- |
- return(qRgba((unsigned char)(beta*(alpha*qRed(p)+x_offset*qRed(q))+y_offset*(alpha*qRed(r)+x_offset*qRed(s))), |
- (unsigned char)(beta*(alpha*qGreen(p)+x_offset*qGreen(q))+y_offset*(alpha*qGreen(r)+x_offset*qGreen(s))), |
- (unsigned char)(beta*(alpha*qBlue(p)+x_offset*qBlue(q))+y_offset*(alpha*qBlue(r)+x_offset*qBlue(s))), |
- (unsigned char)(beta*(alpha*qAlpha(p)+x_offset*qAlpha(q))+y_offset*(alpha*qAlpha(r)+x_offset*qAlpha(s))))); |
-} |
- |
-QImage KImageEffect::implode(QImage &src, double factor, |
- unsigned int background) |
-{ |
- double amount, distance, radius; |
- double x_center, x_distance, x_scale; |
- double y_center, y_distance, y_scale; |
- unsigned int *destData; |
- int x, y; |
- |
- QImage dest(src.width(), src.height(), 32); |
- |
- // compute scaling factor |
- x_scale = 1.0; |
- y_scale = 1.0; |
- x_center = (double)0.5*src.width(); |
- y_center = (double)0.5*src.height(); |
- radius=x_center; |
- if(src.width() > src.height()) |
- y_scale = (double)src.width()/src.height(); |
- else if(src.width() < src.height()){ |
- x_scale = (double) src.height()/src.width(); |
- radius = y_center; |
- } |
- amount=factor/10.0; |
- if(amount >= 0) |
- amount/=10.0; |
- if(src.depth() > 8){ // DirectClass source image |
- unsigned int *srcData; |
- for(y=0; y < src.height(); ++y){ |
- srcData = (unsigned int *)src.scanLine(y); |
- destData = (unsigned int *)dest.scanLine(y); |
- y_distance=y_scale*(y-y_center); |
- for(x=0; x < src.width(); ++x){ |
- destData[x] = srcData[x]; |
- x_distance = x_scale*(x-x_center); |
- distance= x_distance*x_distance+y_distance*y_distance; |
- if(distance < (radius*radius)){ |
- double factor; |
- // Implode the pixel. |
- factor=1.0; |
- if(distance > 0.0) |
- factor= |
- pow(sin(0.5000000000000001*M_PI*sqrt(distance)/radius),-amount); |
- destData[x] = interpolateColor(&src, factor*x_distance/x_scale+x_center, |
- factor*y_distance/y_scale+y_center, |
- background); |
- } |
- } |
- } |
- } |
- else{ // PsudeoClass source image |
- unsigned char *srcData; |
- unsigned char idx; |
- unsigned int *cTable = src.colorTable(); |
- for(y=0; y < src.height(); ++y){ |
- srcData = (unsigned char *)src.scanLine(y); |
- destData = (unsigned int *)dest.scanLine(y); |
- y_distance=y_scale*(y-y_center); |
- for(x=0; x < src.width(); ++x){ |
- idx = srcData[x]; |
- destData[x] = cTable[idx]; |
- x_distance = x_scale*(x-x_center); |
- distance= x_distance*x_distance+y_distance*y_distance; |
- if(distance < (radius*radius)){ |
- double factor; |
- // Implode the pixel. |
- factor=1.0; |
- if(distance > 0.0) |
- factor= |
- pow(sin(0.5000000000000001*M_PI*sqrt(distance)/radius),-amount); |
- destData[x] = interpolateColor(&src, factor*x_distance/x_scale+x_center, |
- factor*y_distance/y_scale+y_center, |
- background); |
- } |
- } |
- } |
- |
- } |
- return(dest); |
-} |
- |
-QImage KImageEffect::rotate(QImage &img, RotateDirection r) |
-{ |
- QImage dest; |
- int x, y; |
- if(img.depth() > 8){ |
- unsigned int *srcData, *destData; |
- switch(r){ |
- case Rotate90: |
- dest.create(img.height(), img.width(), img.depth()); |
- for(y=0; y < img.height(); ++y){ |
- srcData = (unsigned int *)img.scanLine(y); |
- for(x=0; x < img.width(); ++x){ |
- destData = (unsigned int *)dest.scanLine(x); |
- destData[img.height()-y-1] = srcData[x]; |
- } |
- } |
- break; |
- case Rotate180: |
- dest.create(img.width(), img.height(), img.depth()); |
- for(y=0; y < img.height(); ++y){ |
- srcData = (unsigned int *)img.scanLine(y); |
- destData = (unsigned int *)dest.scanLine(img.height()-y-1); |
- for(x=0; x < img.width(); ++x) |
- destData[img.width()-x-1] = srcData[x]; |
- } |
- break; |
- case Rotate270: |
- dest.create(img.height(), img.width(), img.depth()); |
- for(y=0; y < img.height(); ++y){ |
- srcData = (unsigned int *)img.scanLine(y); |
- for(x=0; x < img.width(); ++x){ |
- destData = (unsigned int *)dest.scanLine(img.width()-x-1); |
- destData[y] = srcData[x]; |
- } |
- } |
- break; |
- default: |
- dest = img; |
- break; |
- } |
- } |
- else{ |
- unsigned char *srcData, *destData; |
- unsigned int *srcTable, *destTable; |
- switch(r){ |
- case Rotate90: |
- dest.create(img.height(), img.width(), img.depth()); |
- dest.setNumColors(img.numColors()); |
- srcTable = (unsigned int *)img.colorTable(); |
- destTable = (unsigned int *)dest.colorTable(); |
- for(x=0; x < img.numColors(); ++x) |
- destTable[x] = srcTable[x]; |
- for(y=0; y < img.height(); ++y){ |
- srcData = (unsigned char *)img.scanLine(y); |
- for(x=0; x < img.width(); ++x){ |
- destData = (unsigned char *)dest.scanLine(x); |
- destData[img.height()-y-1] = srcData[x]; |
- } |
- } |
- break; |
- case Rotate180: |
- dest.create(img.width(), img.height(), img.depth()); |
- dest.setNumColors(img.numColors()); |
- srcTable = (unsigned int *)img.colorTable(); |
- destTable = (unsigned int *)dest.colorTable(); |
- for(x=0; x < img.numColors(); ++x) |
- destTable[x] = srcTable[x]; |
- for(y=0; y < img.height(); ++y){ |
- srcData = (unsigned char *)img.scanLine(y); |
- destData = (unsigned char *)dest.scanLine(img.height()-y-1); |
- for(x=0; x < img.width(); ++x) |
- destData[img.width()-x-1] = srcData[x]; |
- } |
- break; |
- case Rotate270: |
- dest.create(img.height(), img.width(), img.depth()); |
- dest.setNumColors(img.numColors()); |
- srcTable = (unsigned int *)img.colorTable(); |
- destTable = (unsigned int *)dest.colorTable(); |
- for(x=0; x < img.numColors(); ++x) |
- destTable[x] = srcTable[x]; |
- for(y=0; y < img.height(); ++y){ |
- srcData = (unsigned char *)img.scanLine(y); |
- for(x=0; x < img.width(); ++x){ |
- destData = (unsigned char *)dest.scanLine(img.width()-x-1); |
- destData[y] = srcData[x]; |
- } |
- } |
- break; |
- default: |
- dest = img; |
- break; |
- } |
- |
- } |
- return(dest); |
-} |
- |
-void KImageEffect::solarize(QImage &img, double factor) |
-{ |
- int i, count; |
- int threshold; |
- unsigned int *data; |
- |
- threshold = (int)(factor*(MaxRGB+1)/100.0); |
- if(img.depth() < 32){ |
- data = (unsigned int *)img.colorTable(); |
- count = img.numColors(); |
- } |
- else{ |
- data = (unsigned int *)img.bits(); |
- count = img.width()*img.height(); |
- } |
- for(i=0; i < count; ++i){ |
- data[i] = qRgba(qRed(data[i]) > threshold ? MaxRGB-qRed(data[i]) : qRed(data[i]), |
- qGreen(data[i]) > threshold ? MaxRGB-qGreen(data[i]) : qGreen(data[i]), |
- qBlue(data[i]) > threshold ? MaxRGB-qBlue(data[i]) : qBlue(data[i]), |
- qAlpha(data[i])); |
- } |
-} |
- |
-QImage KImageEffect::spread(QImage &src, unsigned int amount) |
-{ |
- int quantum, x, y; |
- int x_distance, y_distance; |
- if(src.width() < 3 || src.height() < 3) |
- return(src); |
- QImage dest(src); |
- dest.detach(); |
- quantum=(amount+1) >> 1; |
- if(src.depth() > 8){ // DirectClass source image |
- unsigned int *p, *q; |
- for(y=0; y < src.height(); y++){ |
- q = (unsigned int *)dest.scanLine(y); |
- for(x=0; x < src.width(); x++){ |
- x_distance = x + ((rand() & (amount+1))-quantum); |
- y_distance = y + ((rand() & (amount+1))-quantum); |
- x_distance = QMIN(x_distance, src.width()-1); |
- y_distance = QMIN(y_distance, src.height()-1); |
- if(x_distance < 0) |
- x_distance = 0; |
- if(y_distance < 0) |
- y_distance = 0; |
- p = (unsigned int *)src.scanLine(y_distance); |
- p += x_distance; |
- *q++=(*p); |
- } |
- } |
- } |
- else{ // PsudeoClass source image |
- // just do colortable values |
- unsigned char *p, *q; |
- for(y=0; y < src.height(); y++){ |
- q = (unsigned char *)dest.scanLine(y); |
- for(x=0; x < src.width(); x++){ |
- x_distance = x + ((rand() & (amount+1))-quantum); |
- y_distance = y + ((rand() & (amount+1))-quantum); |
- x_distance = QMIN(x_distance, src.width()-1); |
- y_distance = QMIN(y_distance, src.height()-1); |
- if(x_distance < 0) |
- x_distance = 0; |
- if(y_distance < 0) |
- y_distance = 0; |
- p = (unsigned char *)src.scanLine(y_distance); |
- p += x_distance; |
- *q++=(*p); |
- } |
- } |
- } |
- return(dest); |
-} |
- |
-QImage KImageEffect::swirl(QImage &src, double degrees, |
- unsigned int background) |
-{ |
- double cosine, distance, factor, radius, sine, x_center, x_distance, |
- x_scale, y_center, y_distance, y_scale; |
- int x, y; |
- unsigned int *q; |
- QImage dest(src.width(), src.height(), 32); |
- |
- // compute scaling factor |
- x_center = src.width()/2.0; |
- y_center = src.height()/2.0; |
- radius = QMAX(x_center,y_center); |
- x_scale=1.0; |
- y_scale=1.0; |
- if(src.width() > src.height()) |
- y_scale=(double)src.width()/src.height(); |
- else if(src.width() < src.height()) |
- x_scale=(double)src.height()/src.width(); |
- degrees=DegreesToRadians(degrees); |
- // swirl each row |
- if(src.depth() > 8){ // DirectClass source image |
- unsigned int *p; |
- for(y=0; y < src.height(); y++){ |
- p = (unsigned int *)src.scanLine(y); |
- q = (unsigned int *)dest.scanLine(y); |
- y_distance = y_scale*(y-y_center); |
- for(x=0; x < src.width(); x++){ |
- // determine if the pixel is within an ellipse |
- *q=(*p); |
- x_distance = x_scale*(x-x_center); |
- distance = x_distance*x_distance+y_distance*y_distance; |
- if (distance < (radius*radius)){ |
- // swirl |
- factor = 1.0-sqrt(distance)/radius; |
- sine = sin(degrees*factor*factor); |
- cosine = cos(degrees*factor*factor); |
- *q = interpolateColor(&src, |
- (cosine*x_distance-sine*y_distance)/x_scale+x_center, |
- (sine*x_distance+cosine*y_distance)/y_scale+y_center, |
- background); |
- } |
- p++; |
- q++; |
- } |
- } |
- } |
- else{ // PsudeoClass source image |
- unsigned char *p; |
- unsigned int *cTable = (unsigned int *)src.colorTable(); |
- for(y=0; y < src.height(); y++){ |
- p = (unsigned char *)src.scanLine(y); |
- q = (unsigned int *)dest.scanLine(y); |
- y_distance = y_scale*(y-y_center); |
- for(x=0; x < src.width(); x++){ |
- // determine if the pixel is within an ellipse |
- *q = *(cTable+(*p)); |
- x_distance = x_scale*(x-x_center); |
- distance = x_distance*x_distance+y_distance*y_distance; |
- if (distance < (radius*radius)){ |
- // swirl |
- factor = 1.0-sqrt(distance)/radius; |
- sine = sin(degrees*factor*factor); |
- cosine = cos(degrees*factor*factor); |
- *q = interpolateColor(&src, |
- (cosine*x_distance-sine*y_distance)/x_scale+x_center, |
- (sine*x_distance+cosine*y_distance)/y_scale+y_center, |
- background); |
- } |
- p++; |
- q++; |
- } |
- } |
- |
- } |
- return(dest); |
-} |
- |
-QImage KImageEffect::wave(QImage &src, double amplitude, double wavelength, |
- unsigned int background) |
-{ |
- double *sine_map; |
- int x, y; |
- unsigned int *q; |
- |
- QImage dest(src.width(), src.height() + (int)(2*fabs(amplitude)), 32); |
- // allocate sine map |
- sine_map = (double *)malloc(dest.width()*sizeof(double)); |
- if(!sine_map) |
- return(src); |
- for(x=0; x < dest.width(); ++x) |
- sine_map[x]=fabs(amplitude)+amplitude*sin((2*M_PI*x)/wavelength); |
- // wave image |
- for(y=0; y < dest.height(); ++y){ |
- q = (unsigned int *)dest.scanLine(y); |
- for (x=0; x < dest.width(); x++){ |
- *q=interpolateColor(&src, x, (int)(y-sine_map[x]), background); |
- ++q; |
- } |
- } |
- free(sine_map); |
- return(dest); |
-} |
- |
-QImage KImageEffect::oilPaint(QImage &src, int radius) |
-{ |
- // TODO 8bpp src! |
- if(src.depth() < 32){ |
- qWarning("Oil Paint source image < 32bpp. Convert before using!"); |
- return(src); |
- } |
- int j, k, i, x, y; |
- unsigned int *histogram; |
- unsigned int *s; |
- unsigned int count; |
- |
- unsigned int *srcData, *destData; |
- |
- QImage dest(src); |
- dest.detach(); |
- histogram = (unsigned int *) malloc((MaxRGB+1)*sizeof(unsigned int)); |
- if(!histogram) |
- return(src); |
- // paint each row |
- k=0; |
- for(y = radius; y < src.height(); ++y){ |
- srcData = (unsigned int *)src.scanLine(y-radius); |
- destData = (unsigned int *)dest.scanLine(y); |
- srcData += radius*src.width()+radius; |
- destData += radius; |
- for(x=radius; x < src.width()-radius; ++x){ |
- // determine most frequent color |
- count = 0; |
- for(i=0; i < MaxRGB+1; ++i) |
- histogram[i] = 0; |
- for(i=0; i < radius; ++i){ |
- s = srcData-(radius-1)*src.width()-i-1; |
- for(j =0; j < (2*i+1); ++j){ |
- k = intensityValue(*s); |
- histogram[k]++; |
- if(histogram[k] > count){ |
- *destData = *s; |
- count = histogram[k]; |
- } |
- ++s; |
- } |
- s = srcData+(radius-i)*src.width()-i-1; |
- for(j =0; j < (2*i+1); ++j){ |
- k = intensityValue(*s); |
- histogram[k]++; |
- if(histogram[k] > count){ |
- *destData = *s; |
- count = histogram[k]; |
- } |
- ++s; |
- } |
- } |
- s = srcData-radius; |
- for(j =0; j < (2*i+1); ++j){ |
- k = intensityValue(*s); |
- histogram[k]++; |
- if(histogram[k] > count){ |
- *destData = *s; |
- count = histogram[k]; |
- } |
- ++s; |
- } |
- ++srcData; |
- ++destData; |
- } |
- } |
- free(histogram); |
- return(dest); |
-} |
- |
-// |
-// The following methods work by computing a value from neighboring pixels |
-// (mosfet 12/28/01) |
-// |
- |
-QImage KImageEffect::edge(QImage &src, double factor) |
-{ |
-#define Edge(weight) \ |
- total_red+=(weight)*qRed(*s); \ |
- total_green+=(weight)*qGreen(*s); \ |
- total_blue+=(weight)*qBlue(*s); \ |
- total_opacity+=(weight)*qAlpha(*s); \ |
- s++; |
- |
-#define Edge256(weight) \ |
- total_red+=(weight)*qRed(*(cTable+(*s))); \ |
- total_green+=(weight)*qGreen(*(cTable+(*s))); \ |
- total_blue+=(weight)*qBlue(*(cTable+(*s))); \ |
- total_opacity+=(weight)*qAlpha(*(cTable+(*s))); \ |
- s++; |
- |
- if(src.width() < 3 || src.height() < 3) |
- return(src); |
- |
- double total_blue, total_green, total_opacity, total_red, weight; |
- |
- int x, y; |
- |
- unsigned int *q; |
- |
- QImage dest(src.width(), src.height(), 32); |
- weight=factor/8.0; |
- if(src.depth() > 8){ // DirectClass source image |
- unsigned int *p, *s; |
- for(y=0; y < src.height(); ++y){ |
- p = (unsigned int *)src.scanLine(QMIN(QMAX(y-1,0),src.height()-3)); |
- q = (unsigned int *)dest.scanLine(y); |
- // edge detect this row of pixels. |
- *q++=(*(p+src.width())); |
- for(x=1; x < src.width()-1; ++x){ |
- // compute weighted average of target pixel color components. |
- total_red=0.0; |
- total_green=0.0; |
- total_blue=0.0; |
- total_opacity=0.0; |
- s=p; |
- Edge(-weight/8); Edge(-weight/8) Edge(-weight/8); |
- s=p+src.width(); |
- Edge(-weight/8); Edge(weight); Edge(-weight/8); |
- s=p+2*src.width(); |
- Edge(-weight/8); Edge(-weight/8); Edge(-weight/8); |
- *q = qRgba((unsigned char)((total_red < 0) ? 0 : (total_red > MaxRGB) ? MaxRGB : total_red), |
- (unsigned char)((total_green < 0) ? 0 : (total_green > MaxRGB) ? MaxRGB : total_green), |
- (unsigned char)((total_blue < 0) ? 0 : (total_blue > MaxRGB) ? MaxRGB : total_blue), |
- (unsigned char)((total_opacity < 0) ? 0 : (total_opacity > MaxRGB) ? MaxRGB : total_opacity)); |
- p++; |
- q++; |
- } |
- p++; |
- *q++=(*p); |
- } |
- } |
- else{ // PsudeoClass source image |
- unsigned char *p, *p2, *p3, *s; |
- unsigned int *cTable = src.colorTable(); |
- int scanLineIdx; |
- for(y=0; y < src.height(); ++y){ |
- scanLineIdx = QMIN(QMAX(y-1,0),src.height()-3); |
- p = (unsigned char *)src.scanLine(scanLineIdx); |
- p2 = (unsigned char *)src.scanLine(scanLineIdx+1); |
- p3 = (unsigned char *)src.scanLine(scanLineIdx+2); |
- q = (unsigned int *)dest.scanLine(y); |
- // edge detect this row of pixels. |
- *q++=(*(cTable+(*p2))); |
- for(x=1; x < src.width()-1; ++x){ |
- // compute weighted average of target pixel color components. |
- total_red=0.0; |
- total_green=0.0; |
- total_blue=0.0; |
- total_opacity=0.0; |
- s=p; |
- Edge256(-weight/8); Edge256(-weight/8) Edge256(-weight/8); |
- s=p2; |
- Edge256(-weight/8); Edge256(weight); Edge256(-weight/8); |
- s=p3; |
- Edge256(-weight/8); Edge256(-weight/8); Edge256(-weight/8); |
- *q = qRgba((unsigned char)((total_red < 0) ? 0 : (total_red > MaxRGB) ? MaxRGB : total_red), |
- (unsigned char)((total_green < 0) ? 0 : (total_green > MaxRGB) ? MaxRGB : total_green), |
- (unsigned char)((total_blue < 0) ? 0 : (total_blue > MaxRGB) ? MaxRGB : total_blue), |
- (unsigned char)((total_opacity < 0) ? 0 : (total_opacity > MaxRGB) ? MaxRGB : total_opacity)); |
- p++; |
- p2++; |
- p3++; |
- q++; |
- } |
- p++; |
- *q++=(*(cTable+(*p))); |
- } |
- } |
- return(dest); |
-} |
- |
-QImage KImageEffect::sharpen(QImage &src, double factor) |
-{ |
-#define Sharpen(weight) \ |
- total_red+=(weight)*qRed(*s); \ |
- total_green+=(weight)*qGreen(*s); \ |
- total_blue+=(weight)*qBlue(*s); \ |
- total_opacity+=(weight)*qAlpha(*s); \ |
- s++; |
- |
-#define Sharpen256(weight) \ |
- total_red+=(weight)*qRed(*(cTable+(*s))); \ |
- total_green+=(weight)*qGreen(*(cTable+(*s))); \ |
- total_blue+=(weight)*qBlue(*(cTable+(*s))); \ |
- total_opacity+=(weight)*qAlpha(*(cTable+(*s))); \ |
- s++; |
- |
- if(src.width() < 3 || src.height() < 3) |
- return(src); |
- |
- double total_blue, total_green, total_opacity, total_red; |
- double quantum, weight; |
- unsigned char r, g, b, a; |
- |
- int x, y; |
- unsigned int *q; |
- |
- QImage dest(src.width(), src.height(), 32); |
- weight = ((100.0-factor)/2.0+13.0); |
- quantum = QMAX(weight-12.0, 1.0); |
- if(src.depth() > 8){ // DirectClass source image |
- unsigned int *p, *s; |
- for(y=0; y < src.height(); ++y){ |
- p = (unsigned int *)src.scanLine(QMIN(QMAX(y-1,0),src.height()-3)); |
- q = (unsigned int *)dest.scanLine(y); |
- // sharpen this row of pixels. |
- *q++=(*(p+src.width())); |
- for(x=1; x < src.width()-1; ++x){ |
- // compute weighted average of target pixel color components. |
- total_red=0.0; |
- total_green=0.0; |
- total_blue=0.0; |
- total_opacity=0.0; |
- s=p; |
- Sharpen(-1); Sharpen(-2); Sharpen(-1); |
- s=p+src.width(); |
- Sharpen(-2); Sharpen(weight); Sharpen(-2); |
- s=p+2*src.width(); |
- Sharpen(-1); Sharpen(-2); Sharpen(-1); |
- if(total_red < 0) |
- r=0; |
- else if(total_red > (int)(MaxRGB*quantum)) |
- r = (unsigned char)MaxRGB; |
- else |
- r = (unsigned char)((total_red+(quantum/2.0))/quantum); |
- |
- if(total_green < 0) |
- g = 0; |
- else if(total_green > (int)(MaxRGB*quantum)) |
- g = (unsigned char)MaxRGB; |
- else |
- g = (unsigned char)((total_green+(quantum/2.0))/quantum); |
- |
- if(total_blue < 0) |
- b = 0; |
- else if(total_blue > (int)(MaxRGB*quantum)) |
- b = (unsigned char)MaxRGB; |
- else |
- b = (unsigned char)((total_blue+(quantum/2.0))/quantum); |
- |
- if(total_opacity < 0) |
- a = 0; |
- else if(total_opacity > (int)(MaxRGB*quantum)) |
- a = (unsigned char)MaxRGB; |
- else |
- a= (unsigned char)((total_opacity+(quantum/2.0))/quantum); |
- |
- *q = qRgba(r, g, b, a); |
- |
- p++; |
- q++; |
- } |
- p++; |
- *q++=(*p); |
- } |
- } |
- else{ // PsudeoClass source image |
- unsigned char *p, *p2, *p3, *s; |
- unsigned int *cTable = src.colorTable(); |
- int scanLineIdx; |
- for(y=0; y < src.height(); ++y){ |
- scanLineIdx = QMIN(QMAX(y-1,0),src.height()-3); |
- p = (unsigned char *)src.scanLine(scanLineIdx); |
- p2 = (unsigned char *)src.scanLine(scanLineIdx+1); |
- p3 = (unsigned char *)src.scanLine(scanLineIdx+2); |
- q = (unsigned int *)dest.scanLine(y); |
- // sharpen this row of pixels. |
- *q++=(*(cTable+(*p2))); |
- for(x=1; x < src.width()-1; ++x){ |
- // compute weighted average of target pixel color components. |
- total_red=0.0; |
- total_green=0.0; |
- total_blue=0.0; |
- total_opacity=0.0; |
- s=p; |
- Sharpen256(-1); Sharpen256(-2); Sharpen256(-1); |
- s=p2; |
- Sharpen256(-2); Sharpen256(weight); Sharpen256(-2); |
- s=p3; |
- Sharpen256(-1); Sharpen256(-2); Sharpen256(-1); |
- if(total_red < 0) |
- r=0; |
- else if(total_red > (int)(MaxRGB*quantum)) |
- r = (unsigned char)MaxRGB; |
- else |
- r = (unsigned char)((total_red+(quantum/2.0))/quantum); |
- |
- if(total_green < 0) |
- g = 0; |
- else if(total_green > (int)(MaxRGB*quantum)) |
- g = (unsigned char)MaxRGB; |
- else |
- g = (unsigned char)((total_green+(quantum/2.0))/quantum); |
- |
- if(total_blue < 0) |
- b = 0; |
- else if(total_blue > (int)(MaxRGB*quantum)) |
- b = (unsigned char)MaxRGB; |
- else |
- b = (unsigned char)((total_blue+(quantum/2.0))/quantum); |
- |
- if(total_opacity < 0) |
- a = 0; |
- else if(total_opacity > (int)(MaxRGB*quantum)) |
- a = (unsigned char)MaxRGB; |
- else |
- a = (unsigned char)((total_opacity+(quantum/2.0))/quantum); |
- |
- *q = qRgba(r, g, b, a); |
- |
- p++; |
- p2++; |
- p3++; |
- q++; |
- } |
- p++; |
- *q++=(*(cTable+(*p))); |
- } |
- } |
- return(dest); |
-} |
- |
-QImage KImageEffect::emboss(QImage &src) |
-{ |
-#define Emboss(weight) \ |
- total_red+=(weight)*qRed(*s); \ |
- total_green+=(weight)*qGreen(*s); \ |
- total_blue+=(weight)*qBlue(*s); \ |
- s++; |
- |
-#define Emboss256(weight) \ |
- total_red+=(weight)*qRed(*(cTable+(*s))); \ |
- total_green+=(weight)*qGreen(*(cTable+(*s))); \ |
- total_blue+=(weight)*qBlue(*(cTable+(*s))); \ |
- s++; |
- |
- if(src.width() < 3 || src.height() < 3) |
- return(src); |
- |
- double total_blue, total_green, total_red; |
- int x, y; |
- unsigned int *q; |
- |
- QImage dest(src.width(), src.height(), 32); |
- if(src.depth() > 8){ // DirectClass source image |
- unsigned int *p, *s; |
- for(y=0; y < src.height(); ++y){ |
- p = (unsigned int *)src.scanLine(QMIN(QMAX(y-1,0),src.height()-3)); |
- q = (unsigned int *)dest.scanLine(y); |
- // emboss this row of pixels. |
- *q++=(*(p+src.width())); |
- for(x=1; x < src.width()-1; ++x){ |
- // compute weighted average of target pixel color components. |
- total_red=0.0; |
- total_green=0.0; |
- total_blue=0.0; |
- s=p; |
- Emboss(-1); Emboss(-2); Emboss( 0); |
- s=p+src.width(); |
- Emboss(-2); Emboss( 0); Emboss( 2); |
- s=p+2*src.width(); |
- Emboss( 0); Emboss( 2); Emboss( 1); |
- total_red += (MaxRGB+1)/2; |
- total_green += (MaxRGB+1)/2; |
- total_blue += (MaxRGB+1)/2; |
- *q = qRgba((unsigned char)((total_red < 0) ? 0 : (total_red > MaxRGB) ? MaxRGB : total_red), |
- (unsigned char)((total_green < 0) ? 0 : (total_green > MaxRGB) ? MaxRGB : total_green), |
- (unsigned char)((total_blue < 0) ? 0 : (total_blue > MaxRGB) ? MaxRGB : total_blue), |
- 255); |
- p++; |
- q++; |
- } |
- p++; |
- *q++=(*p); |
- } |
- } |
- else{ // PsudeoClass source image |
- unsigned char *p, *p2, *p3, *s; |
- unsigned int *cTable = src.colorTable(); |
- int scanLineIdx; |
- for(y=0; y < src.height(); ++y){ |
- scanLineIdx = QMIN(QMAX(y-1,0),src.height()-3); |
- p = (unsigned char *)src.scanLine(scanLineIdx); |
- p2 = (unsigned char *)src.scanLine(scanLineIdx+1); |
- p3 = (unsigned char *)src.scanLine(scanLineIdx+2); |
- q = (unsigned int *)dest.scanLine(y); |
- // emboss this row of pixels. |
- *q++=(*(cTable+(*p2))); |
- for(x=1; x < src.width()-1; ++x){ |
- // compute weighted average of target pixel color components. |
- total_red=0.0; |
- total_green=0.0; |
- total_blue=0.0; |
- s=p; |
- Emboss256(-1); Emboss256(-2); Emboss256(0); |
- s=p2; |
- Emboss256(-2); Emboss256(0); Emboss256(2); |
- s=p3; |
- Emboss256(0); Emboss256(2); Emboss256(1); |
- total_red += (MaxRGB+1)/2; |
- total_green += (MaxRGB+1)/2; |
- total_blue += (MaxRGB+1)/2; |
- *q = qRgba((unsigned char)((total_red < 0) ? 0 : (total_red > MaxRGB) ? MaxRGB : total_red), |
- (unsigned char)((total_green < 0) ? 0 : (total_green > MaxRGB) ? MaxRGB : total_green), |
- (unsigned char)((total_blue < 0) ? 0 : (total_blue > MaxRGB) ? MaxRGB : total_blue), |
- 255); |
- p++; |
- p2++; |
- p3++; |
- q++; |
- } |
- p++; |
- *q++=(*(cTable+(*p))); |
- } |
- } |
- toGray(dest); |
- normalize(dest); |
- return(dest); |
-} |
- |
-QImage KImageEffect::shade(QImage &src, bool color_shading, double azimuth, |
- double elevation) |
-{ |
- struct PointInfo{ |
- double x, y, z; |
- }; |
- |
- double distance, normal_distance, shade; |
- int x, y; |
- |
- struct PointInfo light, normal; |
- |
- unsigned int *q; |
- |
- QImage dest(src.width(), src.height(), 32); |
- |
- azimuth = DegreesToRadians(azimuth); |
- elevation = DegreesToRadians(elevation); |
- light.x = MaxRGB*cos(azimuth)*cos(elevation); |
- light.y = MaxRGB*sin(azimuth)*cos(elevation); |
- light.z = MaxRGB*sin(elevation); |
- normal.z= 2*MaxRGB; // constant Z of surface normal |
- |
- if(src.depth() > 8){ // DirectClass source image |
- unsigned int *p, *s0, *s1, *s2; |
- for(y=0; y < src.height(); ++y){ |
- p = (unsigned int *)src.scanLine(QMIN(QMAX(y-1,0),src.height()-3)); |
- q = (unsigned int *)dest.scanLine(y); |
- // shade this row of pixels. |
- *q++=(*(p+src.width())); |
- p++; |
- s0 = p; |
- s1 = p + src.width(); |
- s2 = p + 2*src.width(); |
- for(x=1; x < src.width()-1; ++x){ |
- // determine the surface normal and compute shading. |
- normal.x=intensityValue(*(s0-1))+intensityValue(*(s1-1))+intensityValue(*(s2-1))- |
- (double) intensityValue(*(s0+1))-(double) intensityValue(*(s1+1))- |
- (double) intensityValue(*(s2+1)); |
- normal.y=intensityValue(*(s2-1))+intensityValue(*s2)+intensityValue(*(s2+1))- |
- (double) intensityValue(*(s0-1))-(double) intensityValue(*s0)- |
- (double) intensityValue(*(s0+1)); |
- if((normal.x == 0) && (normal.y == 0)) |
- shade=light.z; |
- else{ |
- shade=0.0; |
- distance=normal.x*light.x+normal.y*light.y+normal.z*light.z; |
- if (distance > 0.0){ |
- normal_distance= |
- normal.x*normal.x+normal.y*normal.y+normal.z*normal.z; |
- if(fabs(normal_distance) > 0.0000001) |
- shade=distance/sqrt(normal_distance); |
- } |
- } |
- if(!color_shading){ |
- *q = qRgba((unsigned char)(shade), |
- (unsigned char)(shade), |
- (unsigned char)(shade), |
- qAlpha(*s1)); |
- } |
- else{ |
- *q = qRgba((unsigned char)((shade*qRed(*s1))/(MaxRGB+1)), |
- (unsigned char)((shade*qGreen(*s1))/(MaxRGB+1)), |
- (unsigned char)((shade*qBlue(*s1))/(MaxRGB+1)), |
- qAlpha(*s1)); |
- } |
- ++s0; |
- ++s1; |
- ++s2; |
- q++; |
- } |
- *q++=(*s1); |
- } |
- } |
- else{ // PsudeoClass source image |
- unsigned char *p, *s0, *s1, *s2; |
- int scanLineIdx; |
- unsigned int *cTable = (unsigned int *)src.colorTable(); |
- for(y=0; y < src.height(); ++y){ |
- scanLineIdx = QMIN(QMAX(y-1,0),src.height()-3); |
- p = (unsigned char *)src.scanLine(scanLineIdx); |
- q = (unsigned int *)dest.scanLine(y); |
- // shade this row of pixels. |
- s0 = p; |
- s1 = (unsigned char *) src.scanLine(scanLineIdx+1); |
- s2 = (unsigned char *) src.scanLine(scanLineIdx+2); |
- *q++=(*(cTable+(*s1))); |
- ++p; |
- ++s0; |
- ++s1; |
- ++s2; |
- for(x=1; x < src.width()-1; ++x){ |
- // determine the surface normal and compute shading. |
- normal.x=intensityValue(*(cTable+(*(s0-1))))+intensityValue(*(cTable+(*(s1-1))))+intensityValue(*(cTable+(*(s2-1))))- |
- (double) intensityValue(*(cTable+(*(s0+1))))-(double) intensityValue(*(cTable+(*(s1+1))))- |
- (double) intensityValue(*(cTable+(*(s2+1)))); |
- normal.y=intensityValue(*(cTable+(*(s2-1))))+intensityValue(*(cTable+(*s2)))+intensityValue(*(cTable+(*(s2+1))))- |
- (double) intensityValue(*(cTable+(*(s0-1))))-(double) intensityValue(*(cTable+(*s0)))- |
- (double) intensityValue(*(cTable+(*(s0+1)))); |
- if((normal.x == 0) && (normal.y == 0)) |
- shade=light.z; |
- else{ |
- shade=0.0; |
- distance=normal.x*light.x+normal.y*light.y+normal.z*light.z; |
- if (distance > 0.0){ |
- normal_distance= |
- normal.x*normal.x+normal.y*normal.y+normal.z*normal.z; |
- if(fabs(normal_distance) > 0.0000001) |
- shade=distance/sqrt(normal_distance); |
- } |
- } |
- if(!color_shading){ |
- *q = qRgba((unsigned char)(shade), |
- (unsigned char)(shade), |
- (unsigned char)(shade), |
- qAlpha(*(cTable+(*s1)))); |
- } |
- else{ |
- *q = qRgba((unsigned char)((shade*qRed(*(cTable+(*s1))))/(MaxRGB+1)), |
- (unsigned char)((shade*qGreen(*(cTable+(*s1))))/(MaxRGB+1)), |
- (unsigned char)((shade*qBlue(*(cTable+(*s1))))/(MaxRGB+1)), |
- qAlpha(*s1)); |
- } |
- ++s0; |
- ++s1; |
- ++s2; |
- q++; |
- } |
- *q++=(*(cTable+(*s1))); |
- } |
- } |
- return(dest); |
-} |
- |
-QImage KImageEffect::blur(QImage &src, double factor) |
-{ |
- |
-#define Blur(weight) \ |
- total_red+=(weight)*qRed(*s); \ |
- total_green+=(weight)*qGreen(*s); \ |
- total_blue+=(weight)*qBlue(*s); \ |
- total_opacity+=(weight)*qAlpha(*s); \ |
- s++; |
- |
-#define Blur256(weight) \ |
- total_red+=(weight)*qRed(*(cTable+(*s))); \ |
- total_green+=(weight)*qGreen(*(cTable+(*s))); \ |
- total_blue+=(weight)*qBlue(*(cTable+(*s))); \ |
- total_opacity+=(weight)*qAlpha(*(cTable+(*s))); \ |
- s++; |
- |
- if(src.width() < 3 || src.height() < 3) |
- return(src); |
- |
- double quantum, total_blue, total_green, total_opacity, total_red, weight; |
- |
- int x, y; |
- unsigned int *q; |
- |
- QImage dest(src.width(), src.height(), 32); |
- weight=((100.0-factor)/2)+1; |
- quantum = QMAX(weight+12.0, 1.0); |
- if(src.depth() > 8){ // DirectClass source image |
- unsigned int *p, *s; |
- for(y=0; y < src.height(); ++y){ |
- p = (unsigned int *)src.scanLine(QMIN(QMAX(y-1,0),src.height()-3)); |
- q = (unsigned int *)dest.scanLine(y); |
- // blur this row of pixels. |
- *q++=(*(p+src.width())); |
- for(x=1; x < src.width()-1; ++x){ |
- // compute weighted average of target pixel color components. |
- total_red=0.0; |
- total_green=0.0; |
- total_blue=0.0; |
- total_opacity=0.0; |
- s=p; |
- Blur(1); Blur(2); Blur(1); |
- s=p+src.width(); |
- Blur(2); Blur(weight); Blur(2); |
- s=p+2*src.width(); |
- Blur(1); Blur(2); Blur(1); |
- *q = qRgba((unsigned char)((total_red+(quantum/2))/quantum), |
- (unsigned char)((total_green+(quantum/2))/quantum), |
- (unsigned char)((total_blue+(quantum/2))/quantum), |
- (unsigned char)((total_opacity+(quantum/2))/quantum)); |
- p++; |
- q++; |
- } |
- p++; |
- *q++=(*p); |
- } |
- } |
- else{ // PsudeoClass source image |
- unsigned char *p, *p2, *p3, *s; |
- unsigned int *cTable = src.colorTable(); |
- int scanLineIdx; |
- for(y=0; y < src.height(); ++y){ |
- scanLineIdx = QMIN(QMAX(y-1,0),src.height()-3); |
- p = (unsigned char *)src.scanLine(scanLineIdx); |
- p2 = (unsigned char *)src.scanLine(scanLineIdx+1); |
- p3 = (unsigned char *)src.scanLine(scanLineIdx+2); |
- q = (unsigned int *)dest.scanLine(y); |
- // blur this row of pixels. |
- *q++=(*(cTable+(*p2))); |
- for(x=1; x < src.width()-1; ++x){ |
- // compute weighted average of target pixel color components. |
- total_red=0.0; |
- total_green=0.0; |
- total_blue=0.0; |
- total_opacity=0.0; |
- s=p; |
- Blur256(1); Blur256(2); Blur256(1); |
- s=p2; |
- Blur256(2); Blur256(weight); Blur256(2); |
- s=p3; |
- Blur256(1); Blur256(2); Blur256(1); |
- *q = qRgba((unsigned char)((total_red+(quantum/2))/quantum), |
- (unsigned char)((total_green+(quantum/2))/quantum), |
- (unsigned char)((total_blue+(quantum/2))/quantum), |
- (unsigned char)((total_opacity+(quantum/2))/quantum)); |
- p++; |
- p2++; |
- p3++; |
- q++; |
- } |
- p++; |
- *q++=(*(cTable+(*p))); |
- } |
- } |
- return(dest); |
-} |
- |
-// High quality, expensive HSV contrast. You can do a faster one by just |
-// taking a grayscale threshold (ie: 128) and incrementing RGB color |
-// channels above it and decrementing those below it, but this gives much |
-// better results. (mosfet 12/28/01) |
-void KImageEffect::contrastHSV(QImage &img, bool sharpen) |
-{ |
- int i, sign; |
- unsigned int *data; |
- int count; |
- double brightness, scale, theta; |
- QColor c; |
- int h, s, v; |
- |
- sign = sharpen ? 1 : -1; |
- scale=0.5000000000000001; |
- if(img.depth() > 8){ |
- count = img.width()*img.height(); |
- data = (unsigned int *)img.bits(); |
- } |
- else{ |
- count = img.numColors(); |
- data = (unsigned int *)img.colorTable(); |
- } |
- for(i=0; i < count; ++i){ |
- c.setRgb(data[i]); |
- c.hsv(&h, &s, &v); |
- brightness = v/255.0; |
- theta=(brightness-0.5)*M_PI; |
- brightness+=scale*(((scale*((sin(theta)+1.0)))-brightness)*sign); |
- if (brightness > 1.0) |
- brightness=1.0; |
- else |
- if (brightness < 0) |
- brightness=0.0; |
- v = (int)(brightness*255); |
- c.setHsv(h, s, v); |
- data[i] = qRgba(c.red(), c.green(), c.blue(), qAlpha(data[i])); |
- } |
-} |
- |
- |
- |
- |
/Scribus/Scribus/scribus/kimageeffect.cpp |
---|
Property changes: |
Deleted: svn:eol-style |
## -1 +0,0 ## |
-native |
\ No newline at end of property |
Deleted: svn:keywords |
## -1 +0,0 ## |
-Author Date Id Revision |
\ No newline at end of property |
Index: Scribus/Scribus/scribus/mpalette.cpp |
=================================================================== |
--- Scribus/Scribus/scribus/mpalette.cpp (revision 6) |
+++ Scribus/Scribus/scribus/mpalette.cpp (nonexistent) |
@@ -1,1876 +0,0 @@ |
-#include "mpalette.h" |
-#include "mpalette.moc" |
-#include <cmath> |
-#include <qpoint.h> |
-#include <qwmatrix.h> |
-extern QPixmap loadIcon(QString nam); |
-extern float UmReFaktor; |
- |
-Mpalette::Mpalette( QWidget* parent, QPopupMenu* FontMenu) |
- : QDialog( parent, "Mfloat", false, Qt::WStyle_Customize | Qt::WStyle_Title | Qt::WStyle_Tool) |
-{ |
- setCaption( tr( "Measurements" ) ); |
- HaveDoc = false; |
- HaveItem = false; |
- Umrech = UmReFaktor; |
- setIcon( loadIcon("AppIcon.xpm") ); |
- setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, sizePolicy().hasHeightForWidth() ) ); |
- |
- MpalLayout = new QVBoxLayout( this, 5, 1, "MpalLayout"); |
- setOrientation(Qt::Vertical); |
- QFont f(font()); |
- f.setPointSize(f.pointSize()-1); |
- setFont(f); |
- buttonGroup5 = new QButtonGroup( this, "buttonGroup5" ); |
- buttonGroup5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, buttonGroup5->sizePolicy().hasHeightForWidth() ) ); |
- buttonGroup5->setFrameShape( QButtonGroup::NoFrame ); |
- buttonGroup5->setExclusive( TRUE ); |
- buttonGroup5->setColumnLayout(0, Qt::Vertical ); |
- buttonGroup5->setTitle( QString::null ); |
- buttonGroup5->layout()->setSpacing( 0 ); |
- buttonGroup5->layout()->setMargin( 0 ); |
- buttonGroup5Layout = new QGridLayout( buttonGroup5->layout() ); |
- buttonGroup5Layout->setAlignment( Qt::AlignTop ); |
- SGeom = new QToolButton( buttonGroup5, "toolButton24" ); |
- SGeom->setToggleButton( true ); |
- SGeom->setOn( true ); |
- SGeom->setFont(f); |
- SGeom->setText( tr( "X, Y, Z" ) ); |
- buttonGroup5Layout->addWidget( SGeom, 0, 0 ); |
- SShape = new QToolButton( buttonGroup5, "toolButton25" ); |
- SShape->setToggleButton( true ); |
- SShape->setFont(f); |
- SShape->setText( tr( "Shape" ) ); |
- buttonGroup5Layout->addWidget( SShape, 0, 1 ); |
- SText = new QToolButton( buttonGroup5, "toolButton26" ); |
- SText->setToggleButton( true ); |
- SText->setFont(f); |
- SText->setText( tr( "Text" ) ); |
- buttonGroup5Layout->addWidget( SText, 1, 0 ); |
- SImage = new QToolButton( buttonGroup5, "toolButton27" ); |
- SImage->setToggleButton( true ); |
- SImage->setFont(f); |
- SImage->setText( tr( "Image" ) ); |
- buttonGroup5Layout->addWidget( SImage, 1, 1 ); |
- SLine = new QToolButton( buttonGroup5, "toolButton28" ); |
- SLine->setToggleButton( true ); |
- SLine->setFont(f); |
- SLine->setText( tr( "Line" ) ); |
- buttonGroup5Layout->addWidget( SLine, 2, 0 ); |
- SColor = new QToolButton( buttonGroup5, "toolButton29" ); |
- SColor->setToggleButton( true ); |
- SColor->setFont(f); |
- SColor->setText( tr( "Colors" ) ); |
- buttonGroup5Layout->addWidget( SColor, 2, 1 ); |
- MpalLayout->addWidget( buttonGroup5 ); |
- TabStack = new QWidgetStack( this, "TabStack" ); |
- TabStack->setFrameShape( QWidgetStack::NoFrame ); |
- |
- page = new QWidget( TabStack, "page" ); |
- pageLayout = new QVBoxLayout( page, 0, 5, "pageLayout"); |
- |
- GeoGroup = new QGroupBox( page, "GeoGroup" ); |
- GeoGroup->setTitle( tr( "Geometry" ) ); |
- GeoGroup->setColumnLayout(0, Qt::Vertical ); |
- GeoGroup->layout()->setSpacing( 4 ); |
- GeoGroup->layout()->setMargin( 5 ); |
- GeoGroupLayout = new QGridLayout( GeoGroup->layout() ); |
- GeoGroupLayout->setAlignment( Qt::AlignTop ); |
- Text1 = new QLabel( GeoGroup, "Text1" ); |
- Text1->setText( tr( "X-Pos:" ) ); |
- GeoGroupLayout->addWidget( Text1, 0, 0 ); |
- Text1a = new QLabel( GeoGroup, "Text1a" ); |
- Text1a->setText( tr( "Y-Pos:" ) ); |
- GeoGroupLayout->addWidget( Text1a, 1, 0 ); |
- Text2 = new QLabel( GeoGroup, "Text2" ); |
- Text2->setText( tr( "Width:" ) ); |
- GeoGroupLayout->addWidget( Text2, 2, 0 ); |
- Text2a = new QLabel( GeoGroup, "Text2a" ); |
- Text2a->setText( tr( "Height:" ) ); |
- GeoGroupLayout->addWidget( Text2a, 3, 0 ); |
- Xpos = new MSpinBox( GeoGroup, 2 ); |
- Xpos->setSuffix( tr( " pt" ) ); |
- Xpos->setMaxValue( 300000 ); |
- Xpos->setMinValue( -300000 ); |
- GeoGroupLayout->addWidget( Xpos, 0, 1 ); |
- Ypos = new MSpinBox( GeoGroup, 2 ); |
- Ypos->setSuffix( tr( " pt" ) ); |
- Ypos->setMaxValue( 300000 ); |
- Ypos->setMinValue( -300000 ); |
- GeoGroupLayout->addWidget( Ypos, 1, 1 ); |
- Width = new MSpinBox( GeoGroup, 2 ); |
- Width->setSuffix( tr( " pt" ) ); |
- GeoGroupLayout->addWidget( Width, 2, 1 ); |
- Height = new MSpinBox( GeoGroup, 2 ); |
- Height->setSuffix( tr( " pt" ) ); |
- GeoGroupLayout->addWidget( Height, 3, 1 ); |
- pageLayout->addWidget( GeoGroup ); |
- |
- layout60 = new QHBoxLayout( 0, 0, 5, "layout60"); |
- QSpacerItem* spacer1 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- layout60->addItem( spacer1 ); |
- |
- LayerGroup = new QGroupBox( page, "LayerGroup" ); |
- LayerGroup->setTitle( tr( "Level" ) ); |
- LayerGroup->setColumnLayout(0, Qt::Vertical ); |
- LayerGroup->layout()->setSpacing( 4 ); |
- LayerGroup->layout()->setMargin( 5 ); |
- LayerGroupLayout = new QGridLayout( LayerGroup->layout() ); |
- LayerGroupLayout->setAlignment( Qt::AlignTop ); |
- Zup = new QToolButton( LayerGroup, "Zup" ); |
- Zup->setMaximumSize( QSize( 22, 22 ) ); |
- Zup->setPixmap(loadIcon("up.png")); |
- LayerGroupLayout->addWidget( Zup, 0, 0 ); |
- ZDown = new QToolButton( LayerGroup, "ZDown" ); |
- ZDown->setMaximumSize( QSize( 22, 22 ) ); |
- ZDown->setPixmap(loadIcon("down.png")); |
- LayerGroupLayout->addWidget( ZDown, 1, 0 ); |
- ZTop = new QToolButton( LayerGroup, "ZTop" ); |
- ZTop->setMaximumSize( QSize( 22, 22 ) ); |
- ZTop->setPixmap(loadIcon("top.png")); |
- LayerGroupLayout->addWidget( ZTop, 0, 1 ); |
- ZBottom = new QToolButton( LayerGroup, "ZBottom" ); |
- ZBottom->setMaximumSize( QSize( 22, 22 ) ); |
- ZBottom->setPixmap(loadIcon("bottom.png")); |
- LayerGroupLayout->addWidget( ZBottom, 1, 1 ); |
- |
- layout60->addWidget( LayerGroup ); |
- QSpacerItem* spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- layout60->addItem( spacer2 ); |
- |
- Layout44 = new QVBoxLayout( 0, 0, 4, "Layout44"); |
- QSpacerItem* spacer3 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
- Layout44->addItem( spacer3 ); |
- FlipH = new QToolButton( page, "MirrorH" ); |
- FlipH->setPixmap(loadIcon("FlipH.xpm")); |
- FlipH->setToggleButton( true ); |
- Layout44->addWidget( FlipH ); |
- FlipV = new QToolButton( page, "MirrorV" ); |
- FlipV->setPixmap(loadIcon("FlipV.xpm")); |
- FlipV->setToggleButton( true ); |
- Layout44->addWidget( FlipV ); |
- QSpacerItem* spacer4 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
- Layout44->addItem( spacer4 ); |
- layout60->addLayout( Layout44 ); |
- QSpacerItem* spacer5 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- layout60->addItem( spacer5 ); |
- pageLayout->addLayout( layout60 ); |
- |
- layout60a = new QHBoxLayout( 0, 0, 5, "layout60a"); |
- RotationGroup = new QButtonGroup( page, "RotationGroup" ); |
- RotationGroup->setTitle( tr( "Rotation" ) ); |
- RotationGroup->setColumnLayout(0, Qt::Vertical ); |
- RotationGroup->layout()->setSpacing( 4 ); |
- RotationGroup->layout()->setMargin( 5 ); |
- RotationGroupLayout = new QHBoxLayout( RotationGroup->layout() ); |
- RotationGroupLayout->setAlignment( Qt::AlignTop ); |
- Layout12 = new QGridLayout( 0, 1, 1, 0, 0, "Layout12"); |
- TopLeft = new QRadioButton( RotationGroup, "TopLeft" ); |
- TopLeft->setText( tr( "" ) ); |
- TopLeft->setChecked( true ); |
- Layout12->addWidget( TopLeft, 0, 0 ); |
- Line1 = new QFrame( RotationGroup, "Line1" ); |
- Line1->setMinimumSize( QSize( 20, 4 ) ); |
- Line1->setMaximumSize( QSize( 20, 4 ) ); |
- Line1->setFrameShape( QFrame::HLine ); |
- Line1->setFrameShadow( QFrame::Plain ); |
- Line1->setLineWidth( 3 ); |
- Line1->setFrameShape( QFrame::HLine ); |
- Layout12->addWidget( Line1, 0, 1 ); |
- TopRight = new QRadioButton( RotationGroup, "TopRight" ); |
- TopRight->setText( tr( "" ) ); |
- Layout12->addWidget( TopRight, 0, 2 ); |
- Line2 = new QFrame( RotationGroup, "Line2" ); |
- Line2->setMinimumSize( QSize( 4, 20 ) ); |
- Line2->setMaximumSize( QSize( 4, 20 ) ); |
- Line2->setFrameShape( QFrame::VLine ); |
- Line2->setFrameShadow( QFrame::Plain ); |
- Line2->setLineWidth( 3 ); |
- Line2->setFrameShape( QFrame::VLine ); |
- Layout12->addWidget( Line2, 1, 0, Qt::AlignHCenter ); |
- Center = new QRadioButton( RotationGroup, "Center" ); |
- Center->setText( tr( "" ) ); |
- Layout12->addWidget( Center, 1, 1, Qt::AlignHCenter ); |
- Line4 = new QFrame( RotationGroup, "Line4" ); |
- Line4->setMinimumSize( QSize( 4, 20 ) ); |
- Line4->setMaximumSize( QSize( 4, 20 ) ); |
- Line4->setFrameShape( QFrame::VLine ); |
- Line4->setFrameShadow( QFrame::Plain ); |
- Line4->setLineWidth( 3 ); |
- Line4->setFrameShape( QFrame::VLine ); |
- Layout12->addWidget( Line4, 1, 2, Qt::AlignHCenter ); |
- BottomLeft = new QRadioButton( RotationGroup, "BottomLeft" ); |
- BottomLeft->setText( tr( "" ) ); |
- Layout12->addWidget( BottomLeft, 2, 0 ); |
- Line5 = new QFrame( RotationGroup, "Line5" ); |
- Line5->setMinimumSize( QSize( 20, 4 ) ); |
- Line5->setMaximumSize( QSize( 20, 4 ) ); |
- Line5->setFrameShape( QFrame::HLine ); |
- Line5->setFrameShadow( QFrame::Plain ); |
- Line5->setLineWidth( 3 ); |
- Line5->setFrameShape( QFrame::HLine ); |
- Layout12->addWidget( Line5, 2, 1 ); |
- BottomRight = new QRadioButton( RotationGroup, "BottomRight" ); |
- BottomRight->setText( tr( "" ) ); |
- Layout12->addWidget( BottomRight, 2, 2 ); |
- RotationGroupLayout->addLayout( Layout12 ); |
- Layout15_2 = new QVBoxLayout( 0, 3, 0, "Layout15_2"); |
- Text3 = new QLabel( RotationGroup, "Text3" ); |
- Text3->setText( tr( "by:" ) ); |
- Layout15_2->addWidget( Text3 ); |
- Rot = new MSpinBox( RotationGroup, 2); |
- Rot->setSuffix(" °"); |
- Rot->setWrapping( true ); |
- Layout15_2->addWidget( Rot ); |
- RotationGroupLayout->addLayout( Layout15_2 ); |
- layout60a->addWidget(RotationGroup); |
- QSpacerItem* spacer12 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- layout60a->addItem( spacer12 ); |
- pageLayout->addLayout(layout60a); |
- QSpacerItem* spacer13 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
- pageLayout->addItem( spacer13 ); |
- TabStack->addWidget( page, 0 ); |
- |
- page_2 = new QWidget( TabStack, "page_2" ); |
- pageLayout_2 = new QVBoxLayout( page_2, 0, 5, "pageLayout_2"); |
- |
- ShapeGroup = new QButtonGroup( page_2, "ShapeGroup" ); |
- ShapeGroup->setFrameShape( QButtonGroup::NoFrame ); |
- ShapeGroup->setTitle( tr( "" ) ); |
- ShapeGroup->setExclusive( true ); |
- ShapeGroup->setColumnLayout(0, Qt::Vertical ); |
- ShapeGroup->layout()->setSpacing( 2 ); |
- ShapeGroup->layout()->setMargin( 0 ); |
- ShapeGroupLayout = new QHBoxLayout( ShapeGroup->layout() ); |
- ShapeGroupLayout->setAlignment( Qt::AlignTop ); |
- SRect = new QToolButton( ShapeGroup, "SRect" ); |
- SRect->setMaximumSize( QSize( 22, 22 ) ); |
- SRect->setPixmap(loadIcon("rect.png")); |
- ShapeGroupLayout->addWidget( SRect ); |
- SOval = new QToolButton( ShapeGroup, "SOval" ); |
- SOval->setMaximumSize( QSize( 22, 22 ) ); |
- SOval->setPixmap(loadIcon("oval.png")); |
- ShapeGroupLayout->addWidget( SOval ); |
- SCustom = new QToolButton( ShapeGroup, "SCustom" ); |
- SCustom->setMaximumSize( QSize( 22, 22 ) ); |
- SCustom->setPixmap(loadIcon("irreg.png")); |
- ShapeGroupLayout->addWidget( SCustom ); |
- pageLayout_2->addWidget( ShapeGroup ); |
- |
- EditShape = new QToolButton( page_2, "EditShape" ); |
- EditShape->setText( tr( "Edit Shape..." ) ); |
- pageLayout_2->addWidget( EditShape ); |
- |
- Layout13 = new QHBoxLayout( 0, 0, 2, "Layout13"); |
- |
- Text4 = new QLabel( page_2, "Text4" ); |
- Text4->setText( tr( "Round\nCorners:" ) ); |
- Layout13->addWidget( Text4 ); |
- |
- RoundRect = new QSpinBox( page_2, "Corner" ); |
- RoundRect->setSuffix( tr( " pt" ) ); |
- Layout13->addWidget( RoundRect ); |
- pageLayout_2->addLayout( Layout13 ); |
- |
- Textflow = new QCheckBox( page_2, "Textflow" ); |
- Textflow->setText( tr( "Text flows around Box" ) ); |
- pageLayout_2->addWidget( Textflow ); |
- |
- Distance = new QGroupBox( page_2, "Distance" ); |
- Distance->setTitle( tr( "Distance of Text" ) ); |
- Distance->setColumnLayout(0, Qt::Vertical ); |
- Distance->layout()->setSpacing( 2 ); |
- Distance->layout()->setMargin( 5 ); |
- DistanceLayout = new QGridLayout( Distance->layout() ); |
- DistanceLayout->setAlignment( Qt::AlignTop ); |
- Text14 = new QLabel( Distance, "Text14" ); |
- Text14->setText( tr( "Top:" ) ); |
- DistanceLayout->addWidget( Text14, 0, 0 ); |
- Text15 = new QLabel( Distance, "Text15" ); |
- Text15->setText( tr( "Bottom:" ) ); |
- DistanceLayout->addWidget( Text15, 1, 0 ); |
- Text16 = new QLabel( Distance, "Text16" ); |
- Text16->setText( tr( "Left:" ) ); |
- DistanceLayout->addWidget( Text16, 2, 0 ); |
- Text17 = new QLabel( Distance, "Text17" ); |
- Text17->setText( tr( "Right:" ) ); |
- DistanceLayout->addWidget( Text17, 3, 0 ); |
- DTop = new MSpinBox( Distance, 1 ); |
- DTop->setSuffix( tr( " pt" ) ); |
- DTop->setMaxValue( 3000 ); |
- DTop->setMinValue( 0 ); |
- DistanceLayout->addWidget( DTop, 0, 1 ); |
- DBottom = new MSpinBox( Distance, 1 ); |
- DBottom->setSuffix( tr( " pt" ) ); |
- DBottom->setMaxValue( 3000 ); |
- DBottom->setMinValue( 0 ); |
- DistanceLayout->addWidget( DBottom, 1, 1 ); |
- DLeft = new MSpinBox( Distance, 1 ); |
- DLeft->setSuffix( tr( " pt" ) ); |
- DLeft->setMaxValue( 3000 ); |
- DLeft->setMinValue( 0 ); |
- DistanceLayout->addWidget( DLeft, 2, 1 ); |
- DRight = new MSpinBox( Distance, 1 ); |
- DRight->setSuffix( tr( " pt" ) ); |
- DRight->setMaxValue( 3000 ); |
- DRight->setMinValue( 0 ); |
- DistanceLayout->addWidget( DRight, 3, 1 ); |
- pageLayout_2->addWidget( Distance ); |
- QSpacerItem* spacer6 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
- pageLayout_2->addItem( spacer6 ); |
- TabStack->addWidget( page_2, 1 ); |
- |
- page_3 = new QWidget( TabStack, "page_3" ); |
- pageLayout_3 = new QVBoxLayout( page_3, 0, 5, "pageLayout_3"); |
- |
- layout47 = new QHBoxLayout( 0, 0, 5, "layout47"); |
- |
- layout46 = new QVBoxLayout( 0, 0, 5, "layout46"); |
- |
- layout41 = new QGridLayout( 0, 1, 1, 0, 5, "layout41"); |
- |
- Fonts = new QToolButton( page_3, "Fonts" ); |
- Fonts->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, 0, 0, Fonts->sizePolicy().hasHeightForWidth() ) ); |
- Fonts->setMinimumSize( QSize( 150, 0 ) ); |
- Fonts->setMaximumSize( QSize( 250, 32767 ) ); |
- Fonts->setPopup(FontMenu); |
- Fonts->setPopupDelay(1); |
- Fonts->setText( tr( "Font" ) ); |
- layout41->addMultiCellWidget( Fonts, 0, 0, 0, 1 ); |
- |
- Text20 = new QLabel( page_3, "Text20" ); |
- Text20->setText(tr("Size:")); |
- layout41->addWidget( Text20, 1, 0 ); |
- Size = new QSpinBox( page_3, "Size" ); |
- Size->setPrefix( tr( "" ) ); |
- Size->setSuffix( tr( " pt" ) ); |
- Size->setMaxValue( 3000 ); |
- Size->setMinValue( -3000 ); |
- layout41->addWidget( Size, 1, 1 ); |
- layout46->addLayout( layout41 ); |
- |
- Layout1 = new QHBoxLayout( 0, 0, 0, "Layout1"); |
- |
- Underline = new QToolButton( page_3, "Underline" ); |
- Underline->setMaximumSize( QSize( 22, 22 ) ); |
- Underline->setText( tr( "" ) ); |
- Underline->setPixmap(loadIcon("Unter.xpm")); |
- Underline->setToggleButton( true ); |
- Layout1->addWidget( Underline ); |
- |
- ButtonGroup1 = new QButtonGroup( page_3, "ButtonGroup1" ); |
- ButtonGroup1->setFrameShape( QButtonGroup::NoFrame ); |
- ButtonGroup1->setTitle( tr( "" ) ); |
- ButtonGroup1->setExclusive( true ); |
- ButtonGroup1->setRadioButtonExclusive( false ); |
- ButtonGroup1->setColumnLayout(0, Qt::Vertical ); |
- ButtonGroup1->layout()->setSpacing( 0 ); |
- ButtonGroup1->layout()->setMargin( 0 ); |
- ButtonGroup1Layout = new QHBoxLayout( ButtonGroup1->layout() ); |
- ButtonGroup1Layout->setAlignment( Qt::AlignTop ); |
- |
- Subs = new QToolButton( ButtonGroup1, "Subs" ); |
- Subs->setMaximumSize( QSize( 22, 22 ) ); |
- Subs->setText( tr( "" ) ); |
- Subs->setPixmap(loadIcon("Tief.xpm")); |
- Subs->setToggleButton( true ); |
- ButtonGroup1Layout->addWidget( Subs ); |
- |
- Supers = new QToolButton( ButtonGroup1, "Supers" ); |
- Supers->setMaximumSize( QSize( 22, 22 ) ); |
- Supers->setText( tr( "" ) ); |
- Supers->setPixmap(loadIcon("Hoch.xpm")); |
- Supers->setToggleButton( true ); |
- ButtonGroup1Layout->addWidget( Supers ); |
- Layout1->addWidget( ButtonGroup1 ); |
- |
- Kapital = new QToolButton( page_3, "Kapital" ); |
- Kapital->setMaximumSize( QSize( 22, 22 ) ); |
- Kapital->setText( tr( "" ) ); |
- Kapital->setPixmap(loadIcon("Kapital.xpm")); |
- Kapital->setToggleButton( true ); |
- Layout1->addWidget( Kapital ); |
- |
- Strike = new QToolButton( page_3, "Strike" ); |
- Strike->setMaximumSize( QSize( 22, 22 ) ); |
- Strike->setText( tr( "" ) ); |
- Strike->setPixmap(loadIcon("Strike.xpm")); |
- Strike->setToggleButton( true ); |
- Layout1->addWidget( Strike ); |
- Revert = new QToolButton( page_3, "Bold" ); |
- Revert->setMaximumSize( QSize( 22, 22 ) ); |
- Revert->setText( tr( "" ) ); |
- Revert->setPixmap(loadIcon("Revers.png")); |
- Revert->setToggleButton( true ); |
- Layout1->addWidget( Revert ); |
- QSpacerItem* spacer7 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- Layout1->addItem( spacer7 ); |
- layout46->addLayout( Layout1 ); |
- layout47->addLayout( layout46 ); |
- pageLayout_3->addLayout( layout47 ); |
- |
- GroupAlign = new QButtonGroup( page_3, "GroupAlign" ); |
- GroupAlign->setFrameShape( QButtonGroup::NoFrame ); |
- GroupAlign->setTitle( tr( "" ) ); |
- GroupAlign->setExclusive( true ); |
- GroupAlign->setColumnLayout(0, Qt::Vertical ); |
- GroupAlign->layout()->setSpacing( 0 ); |
- GroupAlign->layout()->setMargin( 0 ); |
- GroupAlignLayout = new QGridLayout( GroupAlign->layout() ); |
- GroupAlignLayout->setAlignment( Qt::AlignTop ); |
- |
- TextL = new QToolButton( GroupAlign, "TextL" ); |
- TextL->setMaximumSize( QSize( 22, 22 ) ); |
- TextL->setPixmap(loadIcon("text_left.png")); |
- TextL->setToggleButton( true ); |
- TextL->setOn( true ); |
- GroupAlignLayout->addWidget( TextL, 0, 0 ); |
- |
- TextR = new QToolButton( GroupAlign, "TextR" ); |
- TextR->setMaximumSize( QSize( 22, 22 ) ); |
- TextR->setPixmap(loadIcon("text_right.png")); |
- TextR->setToggleButton( true ); |
- GroupAlignLayout->addWidget( TextR, 0, 1 ); |
- |
- TextC = new QToolButton( GroupAlign, "TextC" ); |
- TextC->setMaximumSize( QSize( 22, 22 ) ); |
- TextC->setPixmap(loadIcon("text_center.png")); |
- TextC->setToggleButton( true ); |
- GroupAlignLayout->addWidget( TextC, 0, 2 ); |
- |
- TextB = new QToolButton( GroupAlign, "TextB" ); |
- TextB->setMaximumSize( QSize( 22, 22 ) ); |
- TextB->setPixmap(loadIcon("text_block.png")); |
- TextB->setToggleButton( true ); |
- GroupAlignLayout->addWidget( TextB, 0, 3 ); |
- |
- TextF = new QToolButton( GroupAlign, "TextF" ); |
- TextF->setMaximumSize( QSize( 22, 22 ) ); |
- TextF->setPixmap(loadIcon("text_force.png")); |
- TextF->setToggleButton( true ); |
- GroupAlignLayout->addWidget( TextF, 0, 4 ); |
- pageLayout_3->addWidget( GroupAlign ); |
- |
- GroupBox3 = new QGroupBox( page_3, "GroupBox3" ); |
- GroupBox3->setTitle( tr( "Custom Spacing" ) ); |
- GroupBox3->setColumnLayout(0, Qt::Vertical ); |
- GroupBox3->layout()->setSpacing( 2 ); |
- GroupBox3->layout()->setMargin( 5 ); |
- GroupBox3Layout = new QGridLayout( GroupBox3->layout() ); |
- GroupBox3Layout->setAlignment( Qt::AlignTop ); |
- |
- LineSp = new MSpinBox( GroupBox3, 1 ); |
- LineSp->setSuffix( tr( " pt" ) ); |
- GroupBox3Layout->addWidget( LineSp, 1, 1 ); |
- |
- Extra = new MSpinBox( GroupBox3, 1 ); |
- Extra->setSuffix( tr( " pt" ) ); |
- GroupBox3Layout->addWidget( Extra, 0, 1 ); |
- |
- Text5 = new QLabel( GroupBox3, "Text5" ); |
- Text5->setText( tr( "Kerning:" ) ); |
- GroupBox3Layout->addWidget( Text5, 0, 0 ); |
- |
- Text6 = new QLabel( GroupBox3, "Text6" ); |
- Text6->setText( tr( "Linespacing:" ) ); |
- |
- GroupBox3Layout->addWidget( Text6, 1, 0 ); |
- pageLayout_3->addWidget( GroupBox3 ); |
- |
- GroupBox3a = new QGroupBox( page_3, "GroupBox3" ); |
- GroupBox3a->setTitle( tr( "Styles" ) ); |
- GroupBox3a->setColumnLayout(0, Qt::Vertical ); |
- GroupBox3a->layout()->setSpacing( 2 ); |
- GroupBox3a->layout()->setMargin( 5 ); |
- GroupBox3aLayout = new QVBoxLayout( GroupBox3a->layout() ); |
- GroupBox3aLayout->setAlignment( Qt::AlignTop ); |
- Spal = new Spalette(GroupBox3a); |
- GroupBox3aLayout->addWidget( Spal ); |
- pageLayout_3->addWidget( GroupBox3a ); |
- |
- QSpacerItem* spacer8 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
- pageLayout_3->addItem( spacer8 ); |
- TabStack->addWidget( page_3, 2 ); |
- |
- page_4 = new QWidget( TabStack, "page_4" ); |
- pageLayout_4 = new QVBoxLayout( page_4, 0, 5, "pageLayout_4"); |
- |
- FreeScale = new QRadioButton( page_4, "FreeScale" ); |
- FreeScale->setText( tr( "Free Scaling" ) ); |
- FreeScale->setChecked( true ); |
- pageLayout_4->addWidget( FreeScale ); |
- |
- layout43 = new QGridLayout( 0, 1, 1, 0, 5, "layout43"); |
- Text11 = new QLabel( page_4, "Text11" ); |
- Text11->setText( tr( "Position:" ) ); |
- layout43->addWidget( Text11, 0, 0 ); |
- LXpos = new MSpinBox( page_4, 2 ); |
- LXpos->setSuffix( tr( " pt" ) ); |
- layout43->addWidget( LXpos, 0, 1 ); |
- LYpos = new MSpinBox( page_4, 2 ); |
- LYpos->setSuffix( tr( " pt" ) ); |
- layout43->addWidget( LYpos, 1, 1 ); |
- Text12 = new QLabel( page_4, "Text12" ); |
- Text12->setText( tr( "Horiz. Scale:" ) ); |
- layout43->addWidget( Text12, 2, 0 ); |
- ScaleX = new MSpinBox( page_4, 1 ); |
- ScaleX->setSuffix( tr( " %" ) ); |
- layout43->addWidget( ScaleX, 2, 1 ); |
- Text13 = new QLabel( page_4, "Text13" ); |
- Text13->setText( tr( "Vert. Scale:" ) ); |
- layout43->addWidget( Text13, 3, 0 ); |
- ScaleY = new MSpinBox( page_4, 1 ); |
- ScaleY->setSuffix( tr( " %" ) ); |
- layout43->addWidget( ScaleY, 3, 1 ); |
- Kette = new LinkButton( page_4 ); |
- Kette->setToggleButton( true ); |
- Kette->setAutoRaise( true ); |
- Kette->setMaximumSize( QSize( 15, 32767 ) ); |
- layout43->addMultiCellWidget( Kette, 2, 3, 2, 2 ); |
- pageLayout_4->addLayout( layout43 ); |
- |
- Layout24 = new QVBoxLayout( 0, 0, 3, "Layout24"); |
- |
- FrameScale = new QRadioButton( page_4, "FixedScale" ); |
- FrameScale->setText( tr( "Scale to Frame Size" ) ); |
- Layout24->addWidget( FrameScale ); |
- |
- Layout18 = new QHBoxLayout( 0, 0, 6, "Layout18"); |
- |
- Frame4 = new QFrame( page_4, "Frame4" ); |
- Frame4->setMinimumSize( QSize( 15, 2 ) ); |
- Frame4->setMaximumSize( QSize( 15, 10 ) ); |
- Frame4->setFrameShape( QFrame::NoFrame ); |
- Frame4->setFrameShadow( QFrame::Plain ); |
- Layout18->addWidget( Frame4 ); |
- |
- Aspect = new QCheckBox( page_4, "Aspect" ); |
- /*<<<<<<< mpalette.cpp*/ |
- Aspect->setEnabled( false ); |
- Aspect->setText( tr( "Keep Aspect Ratio" ) ); |
- Aspect->setChecked( true ); |
- /*=======*/ |
- Aspect->setEnabled( FALSE ); |
- Aspect->setText( tr( "Proportional" ) ); |
- Aspect->setChecked( TRUE ); |
- /*>>>>>>> 1.8*/ |
- Layout18->addWidget( Aspect ); |
- Layout24->addLayout( Layout18 ); |
- pageLayout_4->addLayout( Layout24 ); |
- QSpacerItem* spacer9 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
- pageLayout_4->addItem( spacer9 ); |
- TabStack->addWidget( page_4, 3 ); |
- |
- page_5 = new QWidget( TabStack, "page_5" ); |
- pageLayout_5 = new QVBoxLayout( page_5, 0, 5, "pageLayout_5"); |
- |
- Layout13_2 = new QHBoxLayout( 0, 0, 4, "Layout13_2"); |
- |
- LineMode = new QComboBox( true, page_5, "LMode" ); |
- LineMode->setEditable(false); |
- LineMode->insertItem( tr( "Left Point" ) ); |
- LineMode->insertItem( tr( "Endpoints" ) ); |
- Layout13_2->addWidget( LineMode ); |
- LMode = false; |
- QSpacerItem* spacer10 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- Layout13_2->addItem( spacer10 ); |
- pageLayout_5->addLayout( Layout13_2 ); |
- |
- Layout12_2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout12_2"); |
- |
- Text8 = new QLabel( page_5, "Text8" ); |
- Text8->setText( tr( "Linestyle:" ) ); |
- Layout12_2->addWidget( Text8, 0, 0 ); |
- LStyle = new LineCombo(page_5); |
- Layout12_2->addWidget( LStyle, 1, 0 ); |
- TextLabel1 = new QLabel( page_5, "TextLabel1" ); |
- |
- TextLabel1->setText( tr( "Linewidth:" ) ); |
- Layout12_2->addWidget( TextLabel1, 2, 0 ); |
- LSize = new MSpinBox( page_5, 1 ); |
- LSize->setSuffix( tr( " pt" ) ); |
- LSize->setDecimals(10); |
- Layout12_2->addWidget( LSize, 3, 0 ); |
- |
- Text9 = new QLabel( page_5, "Text9" ); |
- Text9->setText( tr( "Edges:" ) ); |
- Layout12_2->addWidget( Text9, 4, 0 ); |
- LJoinStyle = new QComboBox( true, page_5, "LJoin" ); |
- LJoinStyle->setEditable(false); |
- LJoinStyle->insertItem(loadIcon("MiterJoin.png"), tr( "MiterJoin" ) ); |
- LJoinStyle->insertItem(loadIcon("BevelJoin.png"), tr( "BevelJoin" ) ); |
- LJoinStyle->insertItem(loadIcon("BevelJoin.png"), tr( "RoundJoin" ) ); |
- Layout12_2->addWidget( LJoinStyle, 5, 0 ); |
- |
- Text10 = new QLabel( page_5, "Text10" ); |
- Text10->setText( tr( "Endings:" ) ); |
- Layout12_2->addWidget( Text10, 6, 0 ); |
- LEndStyle = new QComboBox( true, page_5, "LCap" ); |
- LEndStyle->setEditable(false); |
- LEndStyle->insertItem(loadIcon("ButtCap.png"), tr( "FlatCap" ) ); |
- LEndStyle->insertItem(loadIcon("SquareCap.png"), tr( "SquareCap" ) ); |
- LEndStyle->insertItem(loadIcon("RoundCap.png"), tr( "RoundCap" ) ); |
- Layout12_2->addWidget( LEndStyle, 7, 0 ); |
- |
- pageLayout_5->addLayout( Layout12_2 ); |
- QSpacerItem* spacer11 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
- pageLayout_5->addItem( spacer11 ); |
- TabStack->addWidget( page_5, 4 ); |
- Cpal = new Cpalette(this); |
- TabStack->addWidget(Cpal, 5); |
- MpalLayout->addWidget( TabStack ); |
- QToolTip::add( Size, tr( "Font Size" ) ); |
- QToolTip::add( LineSp, tr( "Linespacing" ) ); |
- QToolTip::add( Extra, tr( "Manual Kerning" ) ); |
- QToolTip::add( Revert, tr( "Reverse Writing" ) ); |
- QToolTip::add( Underline, tr( "Underline" ) ); |
- QToolTip::add( Kapital, tr( "Small Caps" ) ); |
- QToolTip::add( Subs, tr( "Subscript" ) ); |
- QToolTip::add( Supers, tr( "Superscript" ) ); |
- QToolTip::add( Strike, tr( "Strikeout" ) ); |
- QToolTip::add( TextL, tr( "Align Text Left" ) ); |
- QToolTip::add( TextR, tr( "Align Text Right" ) ); |
- QToolTip::add( TextB, tr( "Align Text Block" ) ); |
- QToolTip::add( TextC, tr( "Align Text Center" ) ); |
- QToolTip::add( FlipH, tr( "Flip horizontal" ) ); |
- QToolTip::add( FlipV, tr( "Flip vertical" ) ); |
- QToolTip::add( Zup, tr( "Move one Level up" ) ); |
- QToolTip::add( ZDown, tr( "Move one Level down" ) ); |
- QToolTip::add( ZTop, tr( "Move to Front" ) ); |
- QToolTip::add( ZBottom, tr( "Move to Back" ) ); |
- connect(Xpos, SIGNAL(valueChanged(int)), this, SLOT(NewX())); |
- connect(Ypos, SIGNAL(valueChanged(int)), this, SLOT(NewY())); |
- connect(Width, SIGNAL(valueChanged(int)), this, SLOT(NewW())); |
- connect(Height, SIGNAL(valueChanged(int)), this, SLOT(NewH())); |
- connect(Rot, SIGNAL(valueChanged(int)), this, SLOT(NewR())); |
- connect(RoundRect, SIGNAL(valueChanged(int)), this, SLOT(NewRR())); |
- connect(LineSp, SIGNAL(valueChanged(int)), this, SLOT(NewLsp())); |
- connect(Size, SIGNAL(valueChanged(int)), this, SLOT(NewSize())); |
- connect(Extra, SIGNAL(valueChanged(int)), this, SLOT(NewExtra())); |
- connect(ScaleX, SIGNAL(valueChanged(int)), this, SLOT(HChange())); |
- connect(ScaleY, SIGNAL(valueChanged(int)), this, SLOT(VChange())); |
- connect(LXpos, SIGNAL(valueChanged(int)), this, SLOT(NewLocalXY())); |
- connect(LYpos, SIGNAL(valueChanged(int)), this, SLOT(NewLocalXY())); |
- connect(LSize, SIGNAL(valueChanged(int)), this, SLOT(NewLS())); |
- connect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLSty())); |
- connect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLJoin())); |
- connect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLEnd())); |
- connect(LineMode, SIGNAL(activated(int)), this, SLOT(NewLMode())); |
- connect(Kette, SIGNAL(clicked()), this, SLOT(ToggleKette())); |
- connect(FlipH, SIGNAL(clicked()), this, SLOT(DoFlipH())); |
- connect(FlipV, SIGNAL(clicked()), this, SLOT(DoFlipV())); |
- connect(GroupAlign, SIGNAL(clicked(int)), this, SLOT(NewAli())); |
- connect(Kapital, SIGNAL(clicked()), this, SLOT(setTypeStyle())); |
- connect(Revert, SIGNAL(clicked()), this, SLOT(DoRevert())); |
- connect(Underline, SIGNAL(clicked()), this, SLOT(setTypeStyle())); |
- connect(Strike, SIGNAL(clicked()), this, SLOT(setTypeStyle())); |
- connect(Supers, SIGNAL(clicked()), this, SLOT(setTypeStyle())); |
- connect(Subs, SIGNAL(clicked()), this, SLOT(setTypeStyle())); |
- connect(FreeScale, SIGNAL(clicked()), this, SLOT(ChangeScaling())); |
- connect(FrameScale, SIGNAL(clicked()), this, SLOT(ChangeScaling())); |
- connect(Aspect, SIGNAL(clicked()), this, SLOT(ChangeScaling())); |
- connect(Zup, SIGNAL(clicked()), this, SLOT(DoRaise())); |
- connect(ZDown, SIGNAL(clicked()), this, SLOT(DoLower())); |
- connect(ZTop, SIGNAL(clicked()), this, SLOT(DoFront())); |
- connect(ZBottom, SIGNAL(clicked()), this, SLOT(DoBack())); |
- connect(RotationGroup, SIGNAL(clicked(int)), this, SLOT(NewRotMode(int))); |
- connect(Textflow, SIGNAL(clicked()), this, SLOT(DoFlow())); |
- connect(SRect, SIGNAL(clicked()), this, SLOT(MakeRect())); |
- connect(SOval, SIGNAL(clicked()), this, SLOT(MakeOval())); |
- connect(SCustom, SIGNAL(clicked()), this, SLOT(MakeIrre())); |
- connect(EditShape, SIGNAL(clicked()), this, SLOT(EditSh())); |
- connect(DTop, SIGNAL(valueChanged(int)), this, SLOT(NewTDist())); |
- connect(DLeft, SIGNAL(valueChanged(int)), this, SLOT(NewTDist())); |
- connect(DRight, SIGNAL(valueChanged(int)), this, SLOT(NewTDist())); |
- connect(DBottom, SIGNAL(valueChanged(int)), this, SLOT(NewTDist())); |
- connect(buttonGroup5, SIGNAL(clicked(int)), this, SLOT(SelTab(int))); |
- HaveItem = false; |
- Xpos->setValue(0); |
- Ypos->setValue(0); |
- Width->setValue(0); |
- Height->setValue(0); |
- Rot->setValue(0); |
- RoundRect->setValue(0); |
- TabStack->raiseWidget(0); |
- TabStack->widget(0)->setEnabled(false); |
- SGeom->setEnabled(false); |
- SShape->setEnabled(false); |
- SText->setEnabled(false); |
- SImage->setEnabled(false); |
- SLine->setEnabled(false); |
- SColor->setEnabled(false); |
-} |
- |
- |
-void Mpalette::closeEvent(QCloseEvent *ce) |
-{ |
- emit Schliessen(); |
- ce->accept(); |
-} |
- |
-void Mpalette::SelTab(int t) |
-{ |
- TabStack->raiseWidget(t); |
-} |
- |
-void Mpalette::SetDoc(ScribusDoc *d) |
-{ |
- doc = d; |
- HaveDoc = true; |
- Xpos->setMaxValue( 300000 ); |
- Xpos->setMinValue( -300000 ); |
- Ypos->setMaxValue( 300000 ); |
- Ypos->setMinValue( -300000 ); |
- Width->setMaxValue( 300000 ); |
- Width->setMinValue( 100 ); |
- Height->setMaxValue( 300000 ); |
- Height->setMinValue( 100 ); |
- Rot->setMaxValue( 36000 ); |
- Rot->setMinValue( 0 ); |
- RoundRect->setMaxValue( 3000 ); |
- RoundRect->setMinValue( -3000 ); |
- LYpos->setMaxValue( 300000 ); |
- LYpos->setMinValue( -300000 ); |
- ScaleY->setMaxValue( 3000 ); |
- ScaleY->setMinValue( 1 ); |
- ScaleX->setMaxValue( 3000 ); |
- ScaleX->setMinValue( 1 ); |
- LXpos->setMaxValue( 300000 ); |
- LXpos->setMinValue( -300000 ); |
- Size->setMaxValue( 512 ); |
- Size->setMinValue( 1 ); |
- LineSp->setMaxValue( 3000 ); |
- LineSp->setMinValue( 1 ); |
- Extra->setMaxValue( 3000 ); |
- Extra->setMinValue( -3000 ); |
- LSize->setMaxValue( 120 ); |
- LSize->setMinValue( 1 ); |
- Xpos->setDecimals(100); |
- Ypos->setDecimals(100); |
- Width->setDecimals(100); |
- Height->setDecimals(100); |
- Rot->setDecimals(100); |
- Extra->setDecimals(10); |
- LineSp->setDecimals(10); |
- LXpos->setDecimals(100); |
- LYpos->setDecimals(100); |
- ScaleX->setDecimals(10); |
- ScaleY->setDecimals(10); |
- DTop->setDecimals(10); |
- DLeft->setDecimals(10); |
- DBottom->setDecimals(10); |
- DRight->setDecimals(10); |
-} |
- |
-void Mpalette::UnsetDoc() |
-{ |
- HaveDoc = false; |
-} |
- |
-void Mpalette::SetCurItem(PageItem *i) |
-{ |
- HaveItem = false; |
- CurItem = i; |
- if (i->IFont != ""); |
- Fonts->setText(i->IFont); |
- RoundRect->setValue(qRound(i->RadRect)); |
- DLeft->setValue(static_cast<int>(i->Extra*10)); |
- DTop->setValue(static_cast<int>(i->TExtra*10)); |
- DBottom->setValue(static_cast<int>(i->BExtra*10)); |
- DRight->setValue(static_cast<int>(i->RExtra*10)); |
- Revert->setOn(i->Reverse); |
- if (i->Locked) |
- { |
- Xpos->setEnabled(false); |
- Ypos->setEnabled(false); |
- Width->setEnabled(false); |
- Height->setEnabled(false); |
- Rot->setEnabled(false); |
- RoundRect->setEnabled(false); |
- return; |
- } |
- else |
- { |
- Xpos->setEnabled(true); |
- Ypos->setEnabled(true); |
- Width->setEnabled(true); |
- Height->setEnabled(true); |
- Rot->setEnabled(true); |
- RoundRect->setEnabled(true); |
- } |
- if (((i->PType == 4) || (i->PType == 2) || (i->PType == 3)) && (!i->ClipEdited)) |
- RoundRect->setEnabled(true); |
- else |
- RoundRect->setEnabled(false); |
- if (i->PType == 5) |
- { |
- if (LMode) |
- { |
- Text1->setText( tr( "X1:" ) ); |
- Text2->setText( tr( "X2:" ) ); |
- Text1a->setText( tr( "Y1:" ) ); |
- Text2a->setText( tr( "Y2:" ) ); |
- Rot->setEnabled(false); |
- Height->setEnabled(true); |
- } |
- else |
- { |
- Text1->setText( tr( "X-Pos:" ) ); |
- Text2->setText( tr( "Width:" ) ); |
- Text1a->setText( tr( "Y-Pos:" ) ); |
- Text2a->setText( tr( "Height:" ) ); |
- Rot->setEnabled(true); |
- Height->setEnabled(false); |
- } |
- HaveItem = true; |
- return; |
- } |
- else |
- { |
- if (i->PType == 2) |
- { |
- if (i->ScaleType) |
- { |
- FreeScale->setChecked(true); |
- FrameScale->setChecked(false); |
- Aspect->setEnabled(false); |
- Aspect->setChecked(i->AspectRatio); |
- } |
- else |
- { |
- FreeScale->setChecked(false); |
- FrameScale->setChecked(true); |
- Kette->setOn(false); |
- Aspect->setEnabled(true); |
- Aspect->setChecked(i->AspectRatio); |
- } |
- } |
- } |
- HaveItem = true; |
-} |
- |
-void Mpalette::NewSel(int nr) |
-{ |
- if (doc->ActPage->GroupSel) |
- { |
- Text1->setText( tr( "X-Pos:" ) ); |
- Text2->setText( tr( "Width:" ) ); |
- Text1a->setText( tr( "Y-Pos:" ) ); |
- Text2a->setText( tr( "Height:" ) ); |
- HaveItem = false; |
- Xpos->setValue(0); |
- Ypos->setValue(0); |
- Width->setValue(0); |
- Height->setValue(0); |
- Rot->setValue(0); |
- RoundRect->setValue(0); |
- HaveItem = true; |
- Xpos->setEnabled(true); |
- Ypos->setEnabled(true); |
- Width->setEnabled(true); |
- Height->setEnabled(true); |
- Rot->setEnabled(true); |
- } |
- else |
- { |
- FlipH->setEnabled(false); |
- FlipV->setEnabled(false); |
- ShapeGroup->setEnabled(false); |
- RoundRect->setEnabled(false); |
- Distance->setEnabled(false); |
- EditShape->setEnabled(false); |
- LineMode->setEnabled(false); |
- TopLeft->setEnabled(true); |
- TopRight->setEnabled(true); |
- BottomLeft->setEnabled(true); |
- BottomRight->setEnabled(true); |
- Center->setEnabled(true); |
- SGeom->setOn(true); |
- TabStack->widget(0)->setEnabled(true); |
- TabStack->widget(1)->setEnabled(false); |
- TabStack->widget(2)->setEnabled(false); |
- TabStack->widget(3)->setEnabled(false); |
- TabStack->widget(4)->setEnabled(false); |
- TabStack->widget(5)->setEnabled(true); |
- SColor->setEnabled(true); |
- switch (nr) |
- { |
- case -1: |
- Text1->setText( tr( "X-Pos:" ) ); |
- Text2->setText( tr( "Width:" ) ); |
- Text1a->setText( tr( "Y-Pos:" ) ); |
- Text2a->setText( tr( "Height:" ) ); |
- Rot->setEnabled(true); |
- Height->setEnabled(true); |
- HaveItem = false; |
- Xpos->setValue(0); |
- Ypos->setValue(0); |
- Width->setValue(0); |
- Height->setValue(0); |
- Rot->setValue(0); |
- RoundRect->setValue(0); |
- for (int ws = 0; ws < 6; ++ws) |
- { |
- TabStack->widget(ws)->setEnabled(false); |
- } |
- SGeom->setEnabled(false); |
- SShape->setEnabled(false); |
- SText->setEnabled(false); |
- SImage->setEnabled(false); |
- SLine->setEnabled(false); |
- SColor->setEnabled(false); |
- break; |
- case 1: |
- SGeom->setEnabled(true); |
- SShape->setEnabled(true); |
- SText->setEnabled(false); |
- SImage->setEnabled(false); |
- SLine->setEnabled(true); |
- TabStack->widget(1)->setEnabled(true); |
- TabStack->widget(4)->setEnabled(true); |
- ShapeGroup->setEnabled(true); |
- EditShape->setEnabled(true); |
- HaveItem = true; |
- break; |
- case 2: |
- SGeom->setEnabled(true); |
- SShape->setEnabled(true); |
- SText->setEnabled(false); |
- SImage->setEnabled(true); |
- SLine->setEnabled(false); |
- TabStack->widget(1)->setEnabled(true); |
- TabStack->widget(3)->setEnabled(true); |
- FlipH->setEnabled(true); |
- FlipV->setEnabled(true); |
- ShapeGroup->setEnabled(true); |
- RoundRect->setEnabled(true); |
- EditShape->setEnabled(true); |
- HaveItem = true; |
- break; |
- case 3: |
- SGeom->setEnabled(true); |
- SShape->setEnabled(true); |
- SText->setEnabled(false); |
- SImage->setEnabled(false); |
- SLine->setEnabled(true); |
- TabStack->widget(1)->setEnabled(true); |
- TabStack->widget(4)->setEnabled(true); |
- ShapeGroup->setEnabled(true); |
- RoundRect->setEnabled(true); |
- EditShape->setEnabled(true); |
- HaveItem = true; |
- break; |
- case 4: |
- SGeom->setEnabled(true); |
- SShape->setEnabled(true); |
- SText->setEnabled(true); |
- SImage->setEnabled(false); |
- SLine->setEnabled(false); |
- TabStack->widget(1)->setEnabled(true); |
- TabStack->widget(2)->setEnabled(true); |
- FlipH->setEnabled(true); |
- FlipV->setEnabled(true); |
- ShapeGroup->setEnabled(true); |
- RoundRect->setEnabled(true); |
- Distance->setEnabled(true); |
- EditShape->setEnabled(true); |
- HaveItem = true; |
- break; |
- case 5: |
- SGeom->setEnabled(true); |
- SShape->setEnabled(false); |
- SText->setEnabled(false); |
- SImage->setEnabled(false); |
- SLine->setEnabled(true); |
- TabStack->widget(4)->setEnabled(true); |
- LineMode->setEnabled(true); |
- TopLeft->setEnabled(false); |
- TopRight->setEnabled(false); |
- BottomLeft->setEnabled(false); |
- BottomRight->setEnabled(false); |
- Center->setEnabled(false); |
- HaveItem = true; |
- break; |
- case 6: |
- SGeom->setEnabled(true); |
- SShape->setEnabled(true); |
- SText->setEnabled(false); |
- SImage->setEnabled(false); |
- SLine->setEnabled(true); |
- TabStack->widget(1)->setEnabled(true); |
- TabStack->widget(4)->setEnabled(true); |
- ShapeGroup->setEnabled(true); |
- EditShape->setEnabled(true); |
- HaveItem = true; |
- break; |
- case 7: |
- SGeom->setEnabled(true); |
- SShape->setEnabled(true); |
- SText->setEnabled(false); |
- SImage->setEnabled(false); |
- SLine->setEnabled(true); |
- TabStack->widget(1)->setEnabled(true); |
- TabStack->widget(4)->setEnabled(true); |
- EditShape->setEnabled(true); |
- HaveItem = true; |
- break; |
- case 8: |
- SGeom->setEnabled(true); |
- SShape->setEnabled(true); |
- SText->setEnabled(true); |
- SImage->setEnabled(false); |
- SLine->setEnabled(false); |
- TabStack->widget(1)->setEnabled(true); |
- TabStack->widget(2)->setEnabled(true); |
- TabStack->widget(4)->setEnabled(true); |
- EditShape->setEnabled(true); |
- HaveItem = true; |
- break; |
- } |
- } |
- updateGeometry(); |
- setFocus(); |
- repaint(); |
-} |
- |
-void Mpalette::UnitChange() |
-{ |
- float old = Umrech; |
- bool tmp = HaveItem; |
- HaveItem = false; |
- QString ein; |
- Umrech = UmReFaktor; |
- switch (doc->Einheit) |
- { |
- case 0: |
- ein = " pt"; |
- break; |
- case 1: |
- ein = " mm"; |
- break; |
- case 2: |
- ein = " in"; |
- break; |
- case 3: |
- ein = " p"; |
- break; |
- } |
- Xpos->setSuffix( ein ); |
- Ypos->setSuffix( ein ); |
- Width->setSuffix( ein ); |
- Height->setSuffix( ein ); |
- LXpos->setSuffix( ein ); |
- LYpos->setSuffix( ein ); |
- Xpos->setValue(qRound(static_cast<float>(Xpos->value()) / old * UmReFaktor)); |
- Ypos->setValue(qRound(static_cast<float>(Ypos->value()) / old * UmReFaktor)); |
- Width->setValue(qRound(static_cast<float>(Width->value()) / old * UmReFaktor)); |
- Height->setValue(qRound(static_cast<float>(Height->value()) / old * UmReFaktor)); |
- LXpos->setValue(qRound(static_cast<float>(LXpos->value()) / old * UmReFaktor)); |
- LYpos->setValue(qRound(static_cast<float>(LYpos->value()) / old * UmReFaktor)); |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::setXY(float x, float y) |
-{ |
- bool tmp = HaveItem; |
- HaveItem = false; |
- Xpos->setValue(qRound(x*UmReFaktor*100)); |
- Ypos->setValue(qRound(y*UmReFaktor*100)); |
- if (LMode) |
- setBH(CurItem->Width, CurItem->Height); |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::setBH(float x, float y) |
-{ |
- bool tmp = HaveItem; |
- HaveItem = false; |
- QWMatrix ma; |
- QPoint dp; |
- if ((LMode) && (CurItem->PType == 5)) |
- { |
- ma.translate(static_cast<float>(Xpos->value()) / UmReFaktor / 100, static_cast<float>(Ypos->value()) / UmReFaktor / 100); |
- ma.rotate(static_cast<float>(Rot->value())/100*(-1)); |
- dp = ma * QPoint(static_cast<int>(x), static_cast<int>(y)); |
- Width->setValue(qRound(dp.x()*UmReFaktor*100)); |
- Height->setValue(qRound(dp.y()*UmReFaktor*100)); |
- } |
- else |
- { |
- RoundRect->setMaxValue(static_cast<int>(QMIN(x, y)/2)); |
- Width->setValue(qRound(x*UmReFaktor*100)); |
- Height->setValue(qRound(y*UmReFaktor*100)); |
- } |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::setR(float r) |
-{ |
- bool tmp = HaveItem; |
- float rr = r; |
- if (r > 0) |
- rr = 360 - rr; |
- HaveItem = false; |
- Rot->setValue(qRound(fabs(rr)*100)); |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::setRR(float r) |
-{ |
- bool tmp = HaveItem; |
- HaveItem = false; |
- RoundRect->setValue(qRound(r)); |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::setRM(int r) |
-{ |
- bool tmp = HaveItem; |
- HaveItem = false; |
- RotationGroup->setButton(r); |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::setLsp(float r) |
-{ |
- bool tmp = HaveItem; |
- HaveItem = false; |
- LineSp->setValue(qRound(r*10)); |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::setSize(int s) |
-{ |
- bool tmp = HaveItem; |
- HaveItem = false; |
- Size->setValue(s); |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::setExtra(float e) |
-{ |
- bool tmp = HaveItem; |
- HaveItem = false; |
- Extra->setValue(qRound(e*10)); |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::ChangeScaling() |
-{ |
- if (FreeScale == sender()) |
- { |
- FrameScale->setChecked(false); |
- FreeScale->setChecked(true); |
- Aspect->setEnabled(false); |
- } |
- if (FrameScale == sender()) |
- { |
- FrameScale->setChecked(true); |
- FreeScale->setChecked(false); |
- Aspect->setEnabled(true); |
- } |
- if ((HaveDoc) && (HaveItem)) |
- { |
- CurItem->ScaleType = FreeScale->isChecked(); |
- CurItem->AspectRatio = Aspect->isChecked(); |
- if (!CurItem->ScaleType) |
- doc->ActPage->AdjustPictScale(CurItem); |
- doc->ActPage->RefreshItem(CurItem); |
- emit DocChanged(); |
- setFocus(); |
- } |
-} |
- |
-void Mpalette::setLvalue(float scx, float scy, float x, float y) |
-{ |
- bool tmp = HaveItem; |
- HaveItem = false; |
- LXpos->setValue(qRound(x * UmReFaktor * 100)); |
- LYpos->setValue(qRound(y * UmReFaktor * 100)); |
- ScaleX->setValue(qRound(scx * 1000)); |
- ScaleY->setValue(qRound(scy * 1000)); |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::setSvalue(float s) |
-{ |
- bool tmp = HaveItem; |
- HaveItem = false; |
- LSize->setValue(qRound(s*10)); |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::setLIvalue(PenStyle p, PenCapStyle pc, PenJoinStyle pj) |
-{ |
- bool tmp = HaveItem; |
- HaveItem = false; |
- switch (p) |
- { |
- case SolidLine: |
- LStyle->setCurrentItem(0); |
- break; |
- case DashLine: |
- LStyle->setCurrentItem(1); |
- break; |
- case DotLine: |
- LStyle->setCurrentItem(2); |
- break; |
- case DashDotLine: |
- LStyle->setCurrentItem(3); |
- break; |
- case DashDotDotLine: |
- LStyle->setCurrentItem(4); |
- break; |
- default: |
- LStyle->setCurrentItem(0); |
- break; |
- } |
- switch (pc) |
- { |
- case FlatCap: |
- LEndStyle->setCurrentItem(0); |
- break; |
- case SquareCap: |
- LEndStyle->setCurrentItem(1); |
- break; |
- case RoundCap: |
- LEndStyle->setCurrentItem(2); |
- break; |
- default: |
- LEndStyle->setCurrentItem(0); |
- break; |
- } |
- switch (pj) |
- { |
- case MiterJoin: |
- LJoinStyle->setCurrentItem(0); |
- break; |
- case BevelJoin: |
- LJoinStyle->setCurrentItem(1); |
- break; |
- case RoundJoin: |
- LJoinStyle->setCurrentItem(2); |
- break; |
- default: |
- LJoinStyle->setCurrentItem(0); |
- break; |
- } |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::setStil(int s) |
-{ |
- Supers->setOn(false); |
- Subs->setOn(false); |
- Strike->setOn(false); |
- Underline->setOn(false); |
- Kapital->setOn(false); |
- if (s & 1) |
- Supers->setOn(true); |
- if (s & 2) |
- Subs->setOn(true); |
- if (s & 8) |
- Underline->setOn(true); |
- if (s & 16) |
- Strike->setOn(true); |
- if (s & 64) |
- Kapital->setOn(true); |
-} |
- |
-void Mpalette::setAli(int e) |
-{ |
- bool tmp = HaveItem; |
- HaveItem = false; |
- switch (e) |
- { |
- case 0: |
- TextL->setOn(true); |
- break; |
- case 2: |
- TextR->setOn(true); |
- break; |
- case 1: |
- TextC->setOn(true); |
- break; |
- case 3: |
- TextB->setOn(true); |
- break; |
- case 4: |
- TextF->setOn(true); |
- break; |
- default: |
- TextL->setOn(false); |
- TextR->setOn(false); |
- TextC->setOn(false); |
- TextB->setOn(false); |
- TextF->setOn(false); |
- break; |
- } |
- HaveItem = tmp; |
-} |
- |
-void Mpalette::NewX() |
-{ |
- float x,y,w,h, gx, gy, gh, gw; |
- x = static_cast<float>(Xpos->value()) / UmReFaktor / 100; |
- y = static_cast<float>(Ypos->value()) / UmReFaktor / 100; |
- w = static_cast<float>(Width->value()) / UmReFaktor / 100; |
- h = static_cast<float>(Height->value()) / UmReFaktor / 100; |
- if ((HaveDoc) && (HaveItem)) |
- { |
- if (doc->ActPage->GroupSel) |
- { |
- doc->ActPage->getGroupRect(&gx, &gy, &gw, &gh); |
- doc->ActPage->moveGroup(x - gx, 0, true); |
- } |
- else |
- { |
- if ((CurItem->PType == 5) && (LMode)) |
- { |
- float r = atan2(h-y,w-x)*(180.0/3.1415927); |
- w = sqrt(pow(w-x,2)+pow(h-y,2)); |
- doc->ActPage->MoveItem(x - CurItem->Xpos, 0, CurItem, true); |
- doc->ActPage->SizeItem(w, CurItem->Height, CurItem->ItemNr, true); |
- doc->ActPage->RotateItem(r, CurItem->ItemNr); |
- } |
- else |
- doc->ActPage->MoveItem(x - CurItem->Xpos, 0, CurItem, true); |
- } |
- emit DocChanged(); |
- } |
-} |
- |
-void Mpalette::NewY() |
-{ |
- float x,y,w,h, gx, gy, gh, gw; |
- x = static_cast<float>(Xpos->value()) / UmReFaktor / 100; |
- y = static_cast<float>(Ypos->value()) / UmReFaktor / 100; |
- w = static_cast<float>(Width->value()) / UmReFaktor / 100; |
- h = static_cast<float>(Height->value()) / UmReFaktor / 100; |
- if ((HaveDoc) && (HaveItem)) |
- { |
- if (doc->ActPage->GroupSel) |
- { |
- doc->ActPage->getGroupRect(&gx, &gy, &gw, &gh); |
- doc->ActPage->moveGroup(0, y - gy, true); |
- } |
- else |
- { |
- if ((CurItem->PType == 5) && (LMode)) |
- { |
- float r = atan2(h-y,w-x)*(180.0/3.1415927); |
- w = sqrt(pow(w-x,2)+pow(h-y,2)); |
- doc->ActPage->MoveItem(0, y - CurItem->Ypos, CurItem, true); |
- doc->ActPage->SizeItem(w, CurItem->Height, CurItem->ItemNr, true); |
- doc->ActPage->RotateItem(r, CurItem->ItemNr); |
- } |
- else |
- doc->ActPage->MoveItem(0, y - CurItem->Ypos, CurItem); |
- } |
- emit DocChanged(); |
- } |
-} |
- |
-void Mpalette::NewW() |
-{ |
- float x,y,w,h, gx, gy, gh, gw; |
- x = static_cast<float>(Xpos->value()) / UmReFaktor / 100; |
- y = static_cast<float>(Ypos->value()) / UmReFaktor / 100; |
- w = static_cast<float>(Width->value()) / UmReFaktor / 100; |
- h = static_cast<float>(Height->value()) / UmReFaktor / 100; |
- if ((HaveDoc) && (HaveItem)) |
- { |
- if (doc->ActPage->GroupSel) |
- { |
- doc->ActPage->getGroupRect(&gx, &gy, &gw, &gh); |
- doc->ActPage->HowTo = 1; |
- doc->ActPage->scaleGroup(w / gw, w / gw); |
- setBH(w, (w / gw) * gh); |
- } |
- else |
- { |
- CurItem->OldB2 = CurItem->Width; |
- CurItem->OldH2 = CurItem->Height; |
- if (CurItem->PType == 5) |
- { |
- if (LMode) |
- { |
- float r = atan2(h-y,w-x)*(180.0/3.1415927); |
- doc->ActPage->RotateItem(r, CurItem->ItemNr); |
- w = sqrt(pow(w-x,2)+pow(h-y,2)); |
- } |
- doc->ActPage->SizeItem(w, CurItem->Height, CurItem->ItemNr, true); |
- } |
- else |
- doc->ActPage->SizeItem(w, CurItem->Height, CurItem->ItemNr, true); |
- emit DocChanged(); |
- } |
- } |
-} |
- |
-void Mpalette::NewH() |
-{ |
- float x,y,w,h, gx, gy, gh, gw; |
- x = static_cast<float>(Xpos->value()) / UmReFaktor / 100; |
- y = static_cast<float>(Ypos->value()) / UmReFaktor / 100; |
- w = static_cast<float>(Width->value()) / UmReFaktor / 100; |
- h = static_cast<float>(Height->value()) / UmReFaktor / 100; |
- if ((HaveDoc) && (HaveItem)) |
- { |
- if (doc->ActPage->GroupSel) |
- { |
- doc->ActPage->getGroupRect(&gx, &gy, &gw, &gh); |
- doc->ActPage->HowTo = 1; |
- doc->ActPage->scaleGroup(h / gh, h / gh); |
- setBH((h / gh) * gw, h); |
- } |
- else |
- { |
- CurItem->OldB2 = CurItem->Width; |
- CurItem->OldH2 = CurItem->Height; |
- if (CurItem->PType == 5) |
- { |
- if (LMode) |
- { |
- float r = atan2(h-y,w-x)*(180.0/3.1415927); |
- doc->ActPage->RotateItem(r, CurItem->ItemNr); |
- w = sqrt(pow(w-x,2)+pow(h-y,2)); |
- } |
- doc->ActPage->SizeItem(w, CurItem->Height, CurItem->ItemNr, true); |
- } |
- else |
- doc->ActPage->SizeItem(CurItem->Width, h, CurItem->ItemNr, true); |
- } |
- emit DocChanged(); |
- } |
-} |
- |
-void Mpalette::NewR() |
-{ |
- if ((HaveDoc) && (HaveItem)) |
- { |
- if (doc->ActPage->GroupSel) |
- return; |
- doc->ActPage->RotateItem(static_cast<float>(Rot->value())/100*(-1), CurItem->ItemNr); |
- emit DocChanged(); |
- } |
-} |
- |
-void Mpalette::NewRR() |
-{ |
- if ((HaveDoc) && (HaveItem)) |
- { |
- CurItem->RadRect = RoundRect->value(); |
- doc->ActPage->SetFrameRounded(); |
- emit DocChanged(); |
- } |
-} |
- |
-void Mpalette::NewLsp() |
-{ |
- if ((HaveDoc) && (HaveItem)) |
- { |
- doc->ActPage->ChLineSpa(static_cast<float>(LineSp->value())/10); |
- emit DocChanged(); |
- } |
-} |
- |
-void Mpalette::NewSize() |
-{ |
- if ((HaveDoc) && (HaveItem)) |
- { |
- doc->ActPage->chFSize(Size->value()); |
- emit DocChanged(); |
- } |
-} |
- |
-void Mpalette::NewExtra() |
-{ |
- if ((HaveDoc) && (HaveItem)) |
- { |
- if ((CurItem->HasSel) || (doc->AppMode == 1)) |
- { |
- doc->ActPage->chKerning(static_cast<float>(Extra->value())/10); |
- emit DocChanged(); |
- } |
- else |
- { |
- if (uint(CurItem->CPos) != CurItem->Ptext.count()) |
- { |
- CurItem->Ptext.at(CurItem->CPos)->cextra = static_cast<float>(Extra->value())/10; |
- CurItem->Dirty = true; |
- CurItem->paintObj(); |
- emit DocChanged(); |
- } |
- } |
- } |
-} |
- |
-void Mpalette::NewLocalXY() |
-{ |
- if ((HaveDoc) && (HaveItem)) |
- { |
- doc->ActPage->ChLocalXY(static_cast<float>(LXpos->value()) / UmReFaktor / 100, static_cast<float>(LYpos->value()) / UmReFaktor / 100); |
- emit DocChanged(); |
- } |
-} |
- |
-void Mpalette::NewLocalSC() |
-{ |
- if ((HaveDoc) && (HaveItem)) |
- { |
- doc->ActPage->ChLocalSc(static_cast<float>(ScaleX->value()) / 1000, static_cast<float>(ScaleY->val |